aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/srm_env.c84
-rw-r--r--arch/alpha/kernel/vmlinux.lds.S8
-rw-r--r--arch/alpha/lib/checksum.c37
-rw-r--r--arch/alpha/lib/csum_partial_copy.c31
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/Makefile6
-rw-r--r--arch/arm/common/dmabounce.c3
-rw-r--r--arch/arm/configs/assabet_defconfig1
-rw-r--r--arch/arm/configs/at91rm9200dk_defconfig2
-rw-r--r--arch/arm/configs/at91rm9200ek_defconfig2
-rw-r--r--arch/arm/configs/ateb9200_defconfig2
-rw-r--r--arch/arm/configs/cerfcube_defconfig1
-rw-r--r--arch/arm/configs/collie_defconfig2
-rw-r--r--arch/arm/configs/corgi_defconfig1
-rw-r--r--arch/arm/configs/csb337_defconfig2
-rw-r--r--arch/arm/configs/csb637_defconfig2
-rw-r--r--arch/arm/configs/h3600_defconfig1
-rw-r--r--arch/arm/configs/integrator_defconfig1
-rw-r--r--arch/arm/configs/ixp4xx_defconfig6
-rw-r--r--arch/arm/configs/jornada720_defconfig1
-rw-r--r--arch/arm/configs/kafa_defconfig2
-rw-r--r--arch/arm/configs/lart_defconfig1
-rw-r--r--arch/arm/configs/neponset_defconfig1
-rw-r--r--arch/arm/configs/omap_h2_1610_defconfig2
-rw-r--r--arch/arm/configs/onearm_defconfig2
-rw-r--r--arch/arm/configs/realview-smp_defconfig (renamed from arch/arm/configs/bast_defconfig)793
-rw-r--r--arch/arm/configs/s3c2410_defconfig114
-rw-r--r--arch/arm/configs/simpad_defconfig1
-rw-r--r--arch/arm/configs/smdk2410_defconfig735
-rw-r--r--arch/arm/configs/spitz_defconfig1
-rw-r--r--arch/arm/configs/versatile_defconfig2
-rw-r--r--arch/arm/kernel/setup.c4
-rw-r--r--arch/arm/kernel/smp.c21
-rw-r--r--arch/arm/kernel/time.c7
-rw-r--r--arch/arm/kernel/vmlinux.lds.S8
-rw-r--r--arch/arm/mach-ebsa110/io.c8
-rw-r--r--arch/arm/mach-footbridge/dc21285.c1
-rw-r--r--arch/arm/mach-iop32x/n2100.c2
-rw-r--r--arch/arm/mach-ixp2000/ixdp2400.c6
-rw-r--r--arch/arm/mach-ixp2000/ixdp2800.c6
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x00.c7
-rw-r--r--arch/arm/mach-ixp4xx/Kconfig2
-rw-r--r--arch/arm/mach-ixp4xx/common.c60
-rw-r--r--arch/arm/mach-lh7a40x/Kconfig6
-rw-r--r--arch/arm/mach-lh7a40x/common.h2
-rw-r--r--arch/arm/mach-pnx4008/core.c69
-rw-r--r--arch/arm/mach-pxa/lubbock.c2
-rw-r--r--arch/arm/mach-s3c2410/Kconfig2
-rw-r--r--arch/arm/mach-s3c2410/gpio.c21
-rw-r--r--arch/arm/mach-s3c2410/s3c2410-gpio.c19
-rw-r--r--arch/arm/mach-sa1100/cpu-sa1110.c10
-rw-r--r--arch/arm/mm/Kconfig2
-rw-r--r--arch/arm/mm/consistent.c3
-rw-r--r--arch/arm/mm/init.c61
-rw-r--r--arch/arm/mm/proc-xscale.S2
-rw-r--r--arch/arm/oprofile/op_counter.h2
-rw-r--r--arch/arm/oprofile/op_model_xscale.c3
-rw-r--r--arch/arm/tools/mach-types18
-rw-r--r--arch/arm/vfp/vfpdouble.c2
-rw-r--r--arch/arm/vfp/vfpmodule.c1
-rw-r--r--arch/avr32/Makefile21
-rw-r--r--arch/avr32/boards/atstk1000/setup.c9
-rw-r--r--arch/avr32/boot/images/Makefile4
-rw-r--r--arch/avr32/configs/atstk1002_defconfig253
-rw-r--r--arch/avr32/kernel/avr32_ksyms.c9
-rw-r--r--arch/avr32/kernel/head.S3
-rw-r--r--arch/avr32/kernel/kprobes.c2
-rw-r--r--arch/avr32/kernel/module.c4
-rw-r--r--arch/avr32/kernel/ptrace.c2
-rw-r--r--arch/avr32/kernel/syscall-stubs.S9
-rw-r--r--arch/avr32/kernel/syscall_table.S1
-rw-r--r--arch/avr32/kernel/vmlinux.lds.c8
-rw-r--r--arch/avr32/lib/Makefile1
-rw-r--r--arch/avr32/lib/findbit.S3
-rw-r--r--arch/avr32/lib/io-readsb.S49
-rw-r--r--arch/avr32/lib/io-writesb.S52
-rw-r--r--arch/avr32/mach-at32ap/hsmc.h4
-rw-r--r--arch/avr32/mach-at32ap/intc.h6
-rw-r--r--arch/avr32/mach-at32ap/pio.h6
-rw-r--r--arch/avr32/mach-at32ap/sm.h6
-rw-r--r--arch/avr32/mm/init.c2
-rw-r--r--arch/avr32/mm/ioremap.c2
-rw-r--r--arch/cris/arch-v10/Kconfig2
-rw-r--r--arch/cris/arch-v10/drivers/Kconfig2
-rw-r--r--arch/cris/arch-v10/drivers/eeprom.c6
-rw-r--r--arch/cris/arch-v10/drivers/i2c.c2
-rw-r--r--arch/cris/arch-v10/kernel/kgdb.c2
-rw-r--r--arch/cris/arch-v10/lib/old_checksum.c62
-rw-r--r--arch/cris/arch-v32/drivers/Kconfig8
-rw-r--r--arch/cris/arch-v32/drivers/cryptocop.c1
-rw-r--r--arch/frv/kernel/vmlinux.lds.S8
-rw-r--r--arch/frv/lib/checksum.c25
-rw-r--r--arch/h8300/kernel/h8300_ksyms.c2
-rw-r--r--arch/h8300/kernel/vmlinux.lds.S8
-rw-r--r--arch/h8300/lib/checksum.c29
-rw-r--r--arch/i386/Makefile8
-rw-r--r--arch/i386/defconfig30
-rw-r--r--arch/i386/kernel/acpi/boot.c20
-rw-r--r--arch/i386/kernel/acpi/earlyquirk.c8
-rw-r--r--arch/i386/kernel/alternative.c4
-rw-r--r--arch/i386/kernel/apm.c39
-rw-r--r--arch/i386/kernel/cpuid.c20
-rw-r--r--arch/i386/kernel/head.S2
-rw-r--r--arch/i386/kernel/i8253.c2
-rw-r--r--arch/i386/kernel/i8259.c7
-rw-r--r--arch/i386/kernel/io_apic.c113
-rw-r--r--arch/i386/kernel/irq.c2
-rw-r--r--arch/i386/kernel/kprobes.c22
-rw-r--r--arch/i386/kernel/microcode.c2
-rw-r--r--arch/i386/kernel/msr.c20
-rw-r--r--arch/i386/kernel/nmi.c10
-rw-r--r--arch/i386/kernel/pci-dma.c4
-rw-r--r--arch/i386/kernel/process.c10
-rw-r--r--arch/i386/kernel/setup.c2
-rw-r--r--arch/i386/kernel/traps.c10
-rw-r--r--arch/i386/kernel/tsc.c6
-rw-r--r--arch/i386/kernel/vmlinux.lds.S9
-rw-r--r--arch/i386/lib/usercopy.c3
-rw-r--r--arch/i386/mach-visws/visws_apic.c7
-rw-r--r--arch/i386/pci/common.c60
-rw-r--r--arch/i386/pci/fixup.c62
-rw-r--r--arch/i386/pci/i386.c73
-rw-r--r--arch/i386/pci/irq.c10
-rw-r--r--arch/i386/pci/mmconfig.c35
-rw-r--r--arch/i386/pci/pci.h8
-rw-r--r--arch/ia64/Kconfig10
-rw-r--r--arch/ia64/configs/sn2_defconfig219
-rw-r--r--arch/ia64/hp/common/sba_iommu.c8
-rw-r--r--arch/ia64/hp/sim/Kconfig4
-rw-r--r--arch/ia64/hp/sim/hpsim_irq.c2
-rw-r--r--arch/ia64/kernel/acpi.c9
-rw-r--r--arch/ia64/kernel/iosapic.c6
-rw-r--r--arch/ia64/kernel/irq.c4
-rw-r--r--arch/ia64/kernel/irq_ia64.c24
-rw-r--r--arch/ia64/kernel/irq_lsapic.c2
-rw-r--r--arch/ia64/kernel/mca_drv.c95
-rw-r--r--arch/ia64/kernel/pal.S58
-rw-r--r--arch/ia64/kernel/perfmon.c3
-rw-r--r--arch/ia64/kernel/sal.c11
-rw-r--r--arch/ia64/kernel/setup.c2
-rw-r--r--arch/ia64/kernel/smp.c12
-rw-r--r--arch/ia64/kernel/time.c6
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S8
-rw-r--r--arch/ia64/lib/checksum.c38
-rw-r--r--arch/ia64/lib/csum_partial_copy.c31
-rw-r--r--arch/ia64/mm/hugetlbpage.c4
-rw-r--r--arch/ia64/pci/Makefile2
-rw-r--r--arch/ia64/pci/fixup.c69
-rw-r--r--arch/ia64/pci/pci.c75
-rw-r--r--arch/ia64/sn/kernel/Makefile5
-rw-r--r--arch/ia64/sn/kernel/bte.c9
-rw-r--r--arch/ia64/sn/kernel/io_acpi_init.c231
-rw-r--r--arch/ia64/sn/kernel/io_common.c613
-rw-r--r--arch/ia64/sn/kernel/io_init.c633
-rw-r--r--arch/ia64/sn/kernel/iomv.c11
-rw-r--r--arch/ia64/sn/kernel/irq.c2
-rw-r--r--arch/ia64/sn/kernel/setup.c30
-rw-r--r--arch/ia64/sn/kernel/tiocx.c2
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c17
-rw-r--r--arch/ia64/sn/pci/tioce_provider.c18
-rw-r--r--arch/m32r/kernel/vmlinux.lds.S8
-rw-r--r--arch/m32r/lib/csum_partial_copy.c12
-rw-r--r--arch/m68k/kernel/vmlinux-std.lds8
-rw-r--r--arch/m68k/kernel/vmlinux-sun3.lds8
-rw-r--r--arch/m68k/lib/checksum.c13
-rw-r--r--arch/m68knommu/Kconfig4
-rw-r--r--arch/m68knommu/kernel/m68k_ksyms.c2
-rw-r--r--arch/m68knommu/kernel/setup.c2
-rw-r--r--arch/m68knommu/kernel/time.c2
-rw-r--r--arch/m68knommu/kernel/vmlinux.lds.S8
-rw-r--r--arch/m68knommu/lib/checksum.c28
-rw-r--r--arch/m68knommu/platform/5307/ints.c17
-rw-r--r--arch/mips/Kconfig40
-rw-r--r--arch/mips/au1000/common/dbdma.c2
-rw-r--r--arch/mips/au1000/common/irq.c63
-rw-r--r--arch/mips/au1000/common/prom.c2
-rw-r--r--arch/mips/au1000/common/setup.c2
-rw-r--r--arch/mips/au1000/common/time.c106
-rw-r--r--arch/mips/au1000/pb1200/board_setup.c8
-rw-r--r--arch/mips/cobalt/irq.c31
-rw-r--r--arch/mips/cobalt/setup.c16
-rw-r--r--arch/mips/configs/pnx8550-jbs_defconfig384
-rw-r--r--arch/mips/configs/pnx8550-v2pci_defconfig441
-rw-r--r--arch/mips/configs/tb0287_defconfig182
-rw-r--r--arch/mips/ddb5xxx/ddb5477/irq_5477.c23
-rw-r--r--arch/mips/dec/ecc-berr.c6
-rw-r--r--arch/mips/dec/int-handler.S2
-rw-r--r--arch/mips/dec/ioasic-irq.c74
-rw-r--r--arch/mips/dec/kn02-irq.c53
-rw-r--r--arch/mips/dec/setup.c6
-rw-r--r--arch/mips/dec/time.c13
-rw-r--r--arch/mips/emma2rh/common/irq_emma2rh.c35
-rw-r--r--arch/mips/emma2rh/markeins/irq_markeins.c56
-rw-r--r--arch/mips/emma2rh/markeins/platform.c88
-rw-r--r--arch/mips/gt64120/common/time.c4
-rw-r--r--arch/mips/gt64120/ev64120/irq.c40
-rw-r--r--arch/mips/gt64120/ev64120/setup.c2
-rw-r--r--arch/mips/gt64120/momenco_ocelot/setup.c3
-rw-r--r--arch/mips/jazz/irq.c27
-rw-r--r--arch/mips/jmr3927/rbhma3100/irq.c35
-rw-r--r--arch/mips/jmr3927/rbhma3100/setup.c40
-rw-r--r--arch/mips/kernel/Makefile5
-rw-r--r--arch/mips/kernel/asm-offsets.c2
-rw-r--r--arch/mips/kernel/cpu-probe.c19
-rw-r--r--arch/mips/kernel/dma-no-isa.c28
-rw-r--r--arch/mips/kernel/entry.S3
-rw-r--r--arch/mips/kernel/genex.S63
-rw-r--r--arch/mips/kernel/head.S6
-rw-r--r--arch/mips/kernel/i8259.c21
-rw-r--r--arch/mips/kernel/irq-msc01.c47
-rw-r--r--arch/mips/kernel/irq-mv6434x.c54
-rw-r--r--arch/mips/kernel/irq-rm7000.c54
-rw-r--r--arch/mips/kernel/irq-rm9000.c47
-rw-r--r--arch/mips/kernel/irq.c74
-rw-r--r--arch/mips/kernel/irq_cpu.c80
-rw-r--r--arch/mips/kernel/linux32.c4
-rw-r--r--arch/mips/kernel/machine_kexec.c85
-rw-r--r--arch/mips/kernel/module.c15
-rw-r--r--arch/mips/kernel/process.c8
-rw-r--r--arch/mips/kernel/r4k_switch.S5
-rw-r--r--arch/mips/kernel/relocate_kernel.S80
-rw-r--r--arch/mips/kernel/scall32-o32.S5
-rw-r--r--arch/mips/kernel/scall64-64.S3
-rw-r--r--arch/mips/kernel/scall64-n32.S5
-rw-r--r--arch/mips/kernel/scall64-o32.S5
-rw-r--r--arch/mips/kernel/setup.c93
-rw-r--r--arch/mips/kernel/signal_n32.c1
-rw-r--r--arch/mips/kernel/smp-mt.c156
-rw-r--r--arch/mips/kernel/smp.c23
-rw-r--r--arch/mips/kernel/smtc-asm.S7
-rw-r--r--arch/mips/kernel/smtc.c2
-rw-r--r--arch/mips/kernel/stacktrace.c2
-rw-r--r--arch/mips/kernel/time.c349
-rw-r--r--arch/mips/kernel/topology.c29
-rw-r--r--arch/mips/kernel/traps.c74
-rw-r--r--arch/mips/kernel/vmlinux.lds.S18
-rw-r--r--arch/mips/lasat/interrupt.c36
-rw-r--r--arch/mips/lib-64/dump_tlb.c6
-rw-r--r--arch/mips/lib/csum_partial_copy.c8
-rw-r--r--arch/mips/mips-boards/atlas/atlas_int.c29
-rw-r--r--arch/mips/mips-boards/generic/memory.c2
-rw-r--r--arch/mips/mips-boards/generic/pci.c2
-rw-r--r--arch/mips/mips-boards/generic/time.c10
-rw-r--r--arch/mips/mips-boards/malta/malta_int.c3
-rw-r--r--arch/mips/mips-boards/malta/malta_setup.c2
-rw-r--r--arch/mips/mips-boards/sim/sim_time.c20
-rw-r--r--arch/mips/mm/c-r4k.c22
-rw-r--r--arch/mips/mm/c-sb1.c42
-rw-r--r--arch/mips/mm/fault.c4
-rw-r--r--arch/mips/mm/init.c209
-rw-r--r--arch/mips/mm/ioremap.c2
-rw-r--r--arch/mips/mm/pg-r4k.c30
-rw-r--r--arch/mips/mm/pgtable-32.c7
-rw-r--r--arch/mips/mm/pgtable-64.c14
-rw-r--r--arch/mips/mm/tlbex.c68
-rw-r--r--arch/mips/momentum/ocelot_3/Makefile2
-rw-r--r--arch/mips/momentum/ocelot_3/ocelot_3_fpga.h6
-rw-r--r--arch/mips/momentum/ocelot_3/platform.c235
-rw-r--r--arch/mips/momentum/ocelot_3/prom.c58
-rw-r--r--arch/mips/momentum/ocelot_3/setup.c2
-rw-r--r--arch/mips/momentum/ocelot_c/Makefile2
-rw-r--r--arch/mips/momentum/ocelot_c/cpci-irq.c53
-rw-r--r--arch/mips/momentum/ocelot_c/ocelot_c_fpga.h6
-rw-r--r--arch/mips/momentum/ocelot_c/platform.c201
-rw-r--r--arch/mips/momentum/ocelot_c/prom.c60
-rw-r--r--arch/mips/momentum/ocelot_c/setup.c23
-rw-r--r--arch/mips/momentum/ocelot_c/uart-irq.c56
-rw-r--r--arch/mips/momentum/ocelot_g/gt-irq.c8
-rw-r--r--arch/mips/momentum/ocelot_g/ocelot_pld.h6
-rw-r--r--arch/mips/momentum/ocelot_g/setup.c5
-rw-r--r--arch/mips/oprofile/Makefile1
-rw-r--r--arch/mips/oprofile/common.c3
-rw-r--r--arch/mips/oprofile/op_impl.h2
-rw-r--r--arch/mips/oprofile/op_model_mipsxx.c44
-rw-r--r--arch/mips/oprofile/op_model_rm9000.c3
-rw-r--r--arch/mips/pci/Makefile2
-rw-r--r--arch/mips/pci/fixup-cobalt.c11
-rw-r--r--arch/mips/pci/fixup-ev64120.c34
-rw-r--r--arch/mips/pci/ops-gt64111.c16
-rw-r--r--arch/mips/pci/pci-ev64120.c21
-rw-r--r--arch/mips/philips/pnx8550/common/int.c68
-rw-r--r--arch/mips/philips/pnx8550/common/time.c4
-rw-r--r--arch/mips/pmc-sierra/yosemite/i2c-yosemite.c2
-rw-r--r--arch/mips/pmc-sierra/yosemite/smp.c6
-rw-r--r--arch/mips/sgi-ip22/ip22-eisa.c33
-rw-r--r--arch/mips/sgi-ip22/ip22-int.c109
-rw-r--r--arch/mips/sgi-ip27/ip27-irq.c40
-rw-r--r--arch/mips/sgi-ip27/ip27-timer.c46
-rw-r--r--arch/mips/sgi-ip32/ip32-irq.c133
-rw-r--r--arch/mips/sgi-ip32/ip32-reset.c2
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c30
-rw-r--r--arch/mips/sibyte/bcm1480/time.c35
-rw-r--r--arch/mips/sibyte/sb1250/bcm1250_tbprof.c4
-rw-r--r--arch/mips/sibyte/sb1250/bus_watcher.c2
-rw-r--r--arch/mips/sibyte/sb1250/irq.c30
-rw-r--r--arch/mips/sibyte/sb1250/time.c34
-rw-r--r--arch/mips/sni/irq.c40
-rw-r--r--arch/mips/tx4927/common/smsc_fdc37m81x.c172
-rw-r--r--arch/mips/tx4927/common/tx4927_irq.c164
-rw-r--r--arch/mips/tx4927/common/tx4927_setup.c2
-rw-r--r--arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c184
-rw-r--r--arch/mips/tx4938/common/irq.c115
-rw-r--r--arch/mips/tx4938/common/setup.c1
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/irq.c54
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c8
-rw-r--r--arch/mips/vr41xx/common/icu.c48
-rw-r--r--arch/mips/vr41xx/nec-cmbvr4133/irq.c20
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S8
-rw-r--r--arch/parisc/lib/checksum.c17
-rw-r--r--arch/powerpc/Kconfig13
-rw-r--r--arch/powerpc/boot/Makefile2
-rw-r--r--arch/powerpc/configs/cell_defconfig19
-rw-r--r--arch/powerpc/configs/pseries_defconfig1
-rw-r--r--arch/powerpc/kernel/Makefile1
-rw-r--r--arch/powerpc/kernel/btext.c2
-rw-r--r--arch/powerpc/kernel/cputable.c86
-rw-r--r--arch/powerpc/kernel/head_64.S48
-rw-r--r--arch/powerpc/kernel/iommu.c77
-rw-r--r--arch/powerpc/kernel/misc_32.S74
-rw-r--r--arch/powerpc/kernel/misc_64.S124
-rw-r--r--arch/powerpc/kernel/module_32.c39
-rw-r--r--arch/powerpc/kernel/module_64.c49
-rw-r--r--arch/powerpc/kernel/perfmon_fsl_booke.c221
-rw-r--r--arch/powerpc/kernel/pmc.c2
-rw-r--r--arch/powerpc/kernel/prom.c8
-rw-r--r--arch/powerpc/kernel/rtas_flash.c47
-rw-r--r--arch/powerpc/kernel/setup_32.c8
-rw-r--r--arch/powerpc/kernel/setup_64.c11
-rw-r--r--arch/powerpc/kernel/time.c105
-rw-r--r--arch/powerpc/kernel/traps.c18
-rw-r--r--arch/powerpc/kernel/vdso.c43
-rw-r--r--arch/powerpc/kernel/vdso32/vdso32.lds.S12
-rw-r--r--arch/powerpc/kernel/vdso64/gettimeofday.S6
-rw-r--r--arch/powerpc/kernel/vdso64/vdso64.lds.S10
-rw-r--r--arch/powerpc/kernel/vio.c4
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S8
-rw-r--r--arch/powerpc/lib/sstep.c5
-rw-r--r--arch/powerpc/mm/hugetlbpage.c11
-rw-r--r--arch/powerpc/oprofile/Makefile2
-rw-r--r--arch/powerpc/oprofile/common.c10
-rw-r--r--arch/powerpc/oprofile/op_model_7450.c2
-rw-r--r--arch/powerpc/oprofile/op_model_fsl_booke.c170
-rw-r--r--arch/powerpc/oprofile/op_model_power4.c4
-rw-r--r--arch/powerpc/oprofile/op_model_rs64.c2
-rw-r--r--arch/powerpc/platforms/83xx/Kconfig4
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_mds.c19
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_itx.c4
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c41
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/hw_ops.c2
-rw-r--r--arch/powerpc/platforms/chrp/setup.c4
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c11
-rw-r--r--arch/powerpc/platforms/iseries/setup.c5
-rw-r--r--arch/powerpc/platforms/powermac/pci.c1
-rw-r--r--arch/powerpc/platforms/powermac/sleep.S3
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c35
-rw-r--r--arch/powerpc/sysdev/dart.h1
-rw-r--r--arch/powerpc/sysdev/dart_iommu.c8
-rw-r--r--arch/powerpc/sysdev/i8259.c5
-rw-r--r--arch/powerpc/sysdev/ipic.c4
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe.c3
-rw-r--r--arch/powerpc/sysdev/qe_lib/ucc.c2
-rw-r--r--arch/powerpc/sysdev/qe_lib/ucc_fast.c2
-rw-r--r--arch/powerpc/sysdev/qe_lib/ucc_slow.c2
-rw-r--r--arch/powerpc/sysdev/tsi108_dev.c4
-rw-r--r--arch/ppc/Kconfig2
-rw-r--r--arch/ppc/boot/simple/relocate.S6
-rw-r--r--arch/ppc/kernel/misc.S74
-rw-r--r--arch/ppc/kernel/setup.c10
-rw-r--r--arch/ppc/kernel/traps.c18
-rw-r--r--arch/ppc/kernel/vmlinux.lds.S8
-rw-r--r--arch/s390/Kconfig3
-rw-r--r--arch/s390/appldata/appldata_base.c1
-rw-r--r--arch/s390/defconfig13
-rw-r--r--arch/s390/kernel/compat_linux.c6
-rw-r--r--arch/s390/kernel/compat_signal.c12
-rw-r--r--arch/s390/kernel/compat_wrapper.S2
-rw-r--r--arch/s390/kernel/setup.c55
-rw-r--r--arch/s390/kernel/signal.c12
-rw-r--r--arch/s390/kernel/syscalls.S1
-rw-r--r--arch/s390/kernel/traps.c20
-rw-r--r--arch/s390/kernel/vmlinux.lds.S8
-rw-r--r--arch/s390/mm/init.c32
-rw-r--r--arch/sh/Kconfig2
-rw-r--r--arch/sh/boards/hp6xx/hp6xx_apm.c2
-rw-r--r--arch/sh/boards/hp6xx/pm.c2
-rw-r--r--arch/sh/boards/hp6xx/setup.c2
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/io.c2
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/irq.c2
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/setup.c19
-rw-r--r--arch/sh/boards/renesas/r7780rp/io.c2
-rw-r--r--arch/sh/boards/renesas/r7780rp/irq.c9
-rw-r--r--arch/sh/boards/renesas/r7780rp/setup.c2
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/io.c4
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/irq.c6
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/led.c15
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/setup.c2
-rw-r--r--arch/sh/boards/renesas/sh7710voipgw/setup.c105
-rw-r--r--arch/sh/boards/se/7300/irq.c20
-rw-r--r--arch/sh/boards/se/73180/irq.c47
-rw-r--r--arch/sh/boards/se/7343/irq.c90
-rw-r--r--arch/sh/boards/se/770x/irq.c80
-rw-r--r--arch/sh/boards/se/7751/irq.c85
-rw-r--r--arch/sh/boards/sh03/setup.c13
-rw-r--r--arch/sh/boards/shmin/setup.c2
-rw-r--r--arch/sh/boards/snapgear/setup.c12
-rw-r--r--arch/sh/boards/titan/setup.c12
-rw-r--r--arch/sh/cchips/voyagergx/irq.c22
-rw-r--r--arch/sh/configs/r7780rp_defconfig174
-rw-r--r--arch/sh/configs/titan_defconfig101
-rw-r--r--arch/sh/drivers/dma/dma-sh.c42
-rw-r--r--arch/sh/drivers/pci/ops-r7780rp.c2
-rw-r--r--arch/sh/drivers/pci/ops-rts7751r2d.c24
-rw-r--r--arch/sh/kernel/cpu/irq/intc2.c165
-rw-r--r--arch/sh/kernel/cpu/irq/ipr.c111
-rw-r--r--arch/sh/kernel/cpu/irq/pint.c8
-rw-r--r--arch/sh/kernel/cpu/sh3/ex.S9
-rw-r--r--arch/sh/kernel/cpu/sh4/ex.S9
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7760.c63
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7780.c27
-rw-r--r--arch/sh/kernel/irq.c2
-rw-r--r--arch/sh/kernel/process.c12
-rw-r--r--arch/sh/kernel/sh_ksyms.c1
-rw-r--r--arch/sh/kernel/syscalls.S3
-rw-r--r--arch/sh/kernel/traps.c167
-rw-r--r--arch/sh/kernel/vmlinux.lds.S8
-rw-r--r--arch/sh64/kernel/sh_ksyms.c2
-rw-r--r--arch/sh64/kernel/vmlinux.lds.S8
-rw-r--r--arch/sh64/lib/c-checksum.c49
-rw-r--r--arch/sh64/lib/dbg.c2
-rw-r--r--arch/sparc/Kconfig11
-rw-r--r--arch/sparc/Makefile2
-rw-r--r--arch/sparc/kernel/ebus.c8
-rw-r--r--arch/sparc/kernel/entry.S3
-rw-r--r--arch/sparc/kernel/irq.c2
-rw-r--r--arch/sparc/kernel/of_device.c2
-rw-r--r--arch/sparc/kernel/setup.c2
-rw-r--r--arch/sparc/kernel/systbls.S5
-rw-r--r--arch/sparc/kernel/time.c2
-rw-r--r--arch/sparc/kernel/vmlinux.lds.S8
-rw-r--r--arch/sparc/oprofile/Kconfig17
-rw-r--r--arch/sparc/oprofile/Makefile9
-rw-r--r--arch/sparc/oprofile/init.c23
-rw-r--r--arch/sparc64/defconfig25
-rw-r--r--arch/sparc64/kernel/central.c4
-rw-r--r--arch/sparc64/kernel/ebus.c8
-rw-r--r--arch/sparc64/kernel/entry.S3
-rw-r--r--arch/sparc64/kernel/isa.c8
-rw-r--r--arch/sparc64/kernel/of_device.c42
-rw-r--r--arch/sparc64/kernel/pci.c9
-rw-r--r--arch/sparc64/kernel/pci_common.c29
-rw-r--r--arch/sparc64/kernel/pci_iommu.c2
-rw-r--r--arch/sparc64/kernel/pci_sabre.c23
-rw-r--r--arch/sparc64/kernel/prom.c51
-rw-r--r--arch/sparc64/kernel/setup.c2
-rw-r--r--arch/sparc64/kernel/systbls.S8
-rw-r--r--arch/sparc64/kernel/traps.c8
-rw-r--r--arch/sparc64/kernel/vmlinux.lds.S8
-rw-r--r--arch/um/Kconfig6
-rw-r--r--arch/um/Kconfig.char5
-rw-r--r--arch/um/Makefile21
-rw-r--r--arch/um/Makefile-i3864
-rw-r--r--arch/um/Makefile-x86_644
-rw-r--r--arch/um/drivers/chan_user.c2
-rw-r--r--arch/um/drivers/cow_sys.h1
-rw-r--r--arch/um/drivers/daemon_user.c1
-rw-r--r--arch/um/drivers/fd.c1
-rw-r--r--arch/um/drivers/mcast_user.c1
-rw-r--r--arch/um/drivers/mconsole_kern.c23
-rw-r--r--arch/um/drivers/mconsole_user.c1
-rw-r--r--arch/um/drivers/mmapper_kern.c3
-rw-r--r--arch/um/drivers/net_user.c1
-rw-r--r--arch/um/drivers/pcap_user.c1
-rw-r--r--arch/um/drivers/port_user.c1
-rw-r--r--arch/um/drivers/pty.c1
-rw-r--r--arch/um/drivers/slip_user.c1
-rw-r--r--arch/um/drivers/tty.c1
-rw-r--r--arch/um/drivers/ubd_kern.c319
-rw-r--r--arch/um/drivers/xterm.c2
-rw-r--r--arch/um/include/mconsole.h1
-rw-r--r--arch/um/include/mconsole_kern.h1
-rw-r--r--arch/um/include/os.h2
-rw-r--r--arch/um/include/sysdep-i386/barrier.h9
-rw-r--r--arch/um/include/sysdep-i386/checksum.h74
-rw-r--r--arch/um/include/sysdep-x86_64/barrier.h7
-rw-r--r--arch/um/include/sysdep-x86_64/checksum.h47
-rw-r--r--arch/um/include/um_malloc.h17
-rw-r--r--arch/um/include/user.h6
-rw-r--r--arch/um/include/user_util.h1
-rw-r--r--arch/um/kernel/dyn.lds.S1
-rw-r--r--arch/um/kernel/irq.c1
-rw-r--r--arch/um/kernel/process.c1
-rw-r--r--arch/um/kernel/tt/tracer.c1
-rw-r--r--arch/um/kernel/uml.lds.S1
-rw-r--r--arch/um/os-Linux/Makefile10
-rw-r--r--arch/um/os-Linux/drivers/ethertap_user.c1
-rw-r--r--arch/um/os-Linux/execvp.c149
-rw-r--r--arch/um/os-Linux/helper.c68
-rw-r--r--arch/um/os-Linux/irq.c1
-rw-r--r--arch/um/os-Linux/main.c1
-rw-r--r--arch/um/os-Linux/process.c1
-rw-r--r--arch/um/os-Linux/sigio.c1
-rw-r--r--arch/um/os-Linux/signal.c31
-rw-r--r--arch/um/os-Linux/skas/process.c2
-rw-r--r--arch/um/os-Linux/sys-i386/tls.c3
-rw-r--r--arch/um/os-Linux/time.c3
-rw-r--r--arch/um/os-Linux/tls.c1
-rw-r--r--arch/um/sys-i386/unmap.c11
-rw-r--r--arch/um/sys-x86_64/unmap.c11
-rw-r--r--arch/v850/kernel/v850_ksyms.c2
-rw-r--r--arch/v850/kernel/vmlinux.lds.S8
-rw-r--r--arch/v850/lib/checksum.c26
-rw-r--r--arch/x86_64/Makefile8
-rw-r--r--arch/x86_64/boot/setup.S5
-rw-r--r--arch/x86_64/defconfig30
-rw-r--r--arch/x86_64/ia32/ia32_signal.c5
-rw-r--r--arch/x86_64/ia32/ptrace32.c2
-rw-r--r--arch/x86_64/kernel/e820.c18
-rw-r--r--arch/x86_64/kernel/early-quirks.c17
-rw-r--r--arch/x86_64/kernel/early_printk.c2
-rw-r--r--arch/x86_64/kernel/entry.S10
-rw-r--r--arch/x86_64/kernel/genapic_flat.c2
-rw-r--r--arch/x86_64/kernel/i8259.c7
-rw-r--r--arch/x86_64/kernel/io_apic.c193
-rw-r--r--arch/x86_64/kernel/irq.c2
-rw-r--r--arch/x86_64/kernel/pci-calgary.c44
-rw-r--r--arch/x86_64/kernel/process.c7
-rw-r--r--arch/x86_64/kernel/smp.c3
-rw-r--r--arch/x86_64/kernel/smpboot.c7
-rw-r--r--arch/x86_64/kernel/time.c13
-rw-r--r--arch/x86_64/kernel/traps.c16
-rw-r--r--arch/x86_64/kernel/vmlinux.lds.S12
-rw-r--r--arch/x86_64/kernel/vsyscall.c47
-rw-r--r--arch/x86_64/lib/csum-partial.c7
-rw-r--r--arch/x86_64/lib/csum-wrappers.c37
-rw-r--r--arch/x86_64/mm/init.c24
-rw-r--r--arch/x86_64/mm/srat.c4
-rw-r--r--arch/x86_64/pci/Makefile2
-rw-r--r--arch/x86_64/pci/mmconfig.c37
-rw-r--r--arch/xtensa/kernel/vmlinux.lds.S8
540 files changed, 8806 insertions, 8079 deletions
diff --git a/arch/alpha/kernel/srm_env.c b/arch/alpha/kernel/srm_env.c
index 990ac61028f..f7dd081d57f 100644
--- a/arch/alpha/kernel/srm_env.c
+++ b/arch/alpha/kernel/srm_env.c
@@ -2,7 +2,7 @@
2 * srm_env.c - Access to SRM environment 2 * srm_env.c - Access to SRM environment
3 * variables through linux' procfs 3 * variables through linux' procfs
4 * 4 *
5 * Copyright (C) 2001-2002 Jan-Benedict Glaw <jbglaw@lug-owl.de> 5 * (C) 2001,2002,2006 by Jan-Benedict Glaw <jbglaw@lug-owl.de>
6 * 6 *
7 * This driver is at all a modified version of Erik Mouw's 7 * This driver is at all a modified version of Erik Mouw's
8 * Documentation/DocBook/procfs_example.c, so: thank 8 * Documentation/DocBook/procfs_example.c, so: thank
@@ -21,7 +21,7 @@
21 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 21 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
22 * PURPOSE. See the GNU General Public License for more 22 * PURPOSE. See the GNU General Public License for more
23 * details. 23 * details.
24 * 24 *
25 * You should have received a copy of the GNU General Public 25 * You should have received a copy of the GNU General Public
26 * License along with this program; if not, write to the 26 * License along with this program; if not, write to the
27 * Free Software Foundation, Inc., 59 Temple Place, 27 * Free Software Foundation, Inc., 59 Temple Place,
@@ -29,33 +29,6 @@
29 * 29 *
30 */ 30 */
31 31
32/*
33 * Changelog
34 * ~~~~~~~~~
35 *
36 * Thu, 22 Aug 2002 15:10:43 +0200
37 * - Update Config.help entry. I got a number of emails asking
38 * me to tell their senders if they could make use of this
39 * piece of code... So: "SRM is something like BIOS for your
40 * Alpha"
41 * - Update code formatting a bit to better conform CodingStyle
42 * rules.
43 * - So this is v0.0.5, with no changes (except formatting)
44 *
45 * Wed, 22 May 2002 00:11:21 +0200
46 * - Fix typo on comment (SRC -> SRM)
47 * - Call this "Version 0.0.4"
48 *
49 * Tue, 9 Apr 2002 18:44:40 +0200
50 * - Implement access by variable name and additionally
51 * by number. This is done by creating two subdirectories
52 * where one holds all names (like the old directory
53 * did) and the other holding 256 files named like "0",
54 * "1" and so on.
55 * - Call this "Version 0.0.3"
56 *
57 */
58
59#include <linux/kernel.h> 32#include <linux/kernel.h>
60#include <linux/module.h> 33#include <linux/module.h>
61#include <linux/init.h> 34#include <linux/init.h>
@@ -67,7 +40,7 @@
67#define BASE_DIR "srm_environment" /* Subdir in /proc/ */ 40#define BASE_DIR "srm_environment" /* Subdir in /proc/ */
68#define NAMED_DIR "named_variables" /* Subdir for known variables */ 41#define NAMED_DIR "named_variables" /* Subdir for known variables */
69#define NUMBERED_DIR "numbered_variables" /* Subdir for all variables */ 42#define NUMBERED_DIR "numbered_variables" /* Subdir for all variables */
70#define VERSION "0.0.5" /* Module version */ 43#define VERSION "0.0.6" /* Module version */
71#define NAME "srm_env" /* Module name */ 44#define NAME "srm_env" /* Module name */
72 45
73MODULE_AUTHOR("Jan-Benedict Glaw <jbglaw@lug-owl.de>"); 46MODULE_AUTHOR("Jan-Benedict Glaw <jbglaw@lug-owl.de>");
@@ -106,7 +79,6 @@ static srm_env_t srm_named_entries[] = {
106static srm_env_t srm_numbered_entries[256]; 79static srm_env_t srm_numbered_entries[256];
107 80
108 81
109
110static int 82static int
111srm_env_read(char *page, char **start, off_t off, int count, int *eof, 83srm_env_read(char *page, char **start, off_t off, int count, int *eof,
112 void *data) 84 void *data)
@@ -115,21 +87,23 @@ srm_env_read(char *page, char **start, off_t off, int count, int *eof,
115 unsigned long ret; 87 unsigned long ret;
116 srm_env_t *entry; 88 srm_env_t *entry;
117 89
118 if(off != 0) 90 if (off != 0) {
119 return -EFAULT; 91 *eof = 1;
92 return 0;
93 }
120 94
121 entry = (srm_env_t *) data; 95 entry = (srm_env_t *) data;
122 ret = callback_getenv(entry->id, page, count); 96 ret = callback_getenv(entry->id, page, count);
123 97
124 if((ret >> 61) == 0) 98 if ((ret >> 61) == 0) {
125 nbytes = (int) ret; 99 nbytes = (int) ret;
126 else 100 *eof = 1;
101 } else
127 nbytes = -EFAULT; 102 nbytes = -EFAULT;
128 103
129 return nbytes; 104 return nbytes;
130} 105}
131 106
132
133static int 107static int
134srm_env_write(struct file *file, const char __user *buffer, unsigned long count, 108srm_env_write(struct file *file, const char __user *buffer, unsigned long count,
135 void *data) 109 void *data)
@@ -155,7 +129,7 @@ srm_env_write(struct file *file, const char __user *buffer, unsigned long count,
155 129
156 ret1 = callback_setenv(entry->id, buf, count); 130 ret1 = callback_setenv(entry->id, buf, count);
157 if ((ret1 >> 61) == 0) { 131 if ((ret1 >> 61) == 0) {
158 do 132 do
159 ret2 = callback_save_env(); 133 ret2 = callback_save_env();
160 while((ret2 >> 61) == 1); 134 while((ret2 >> 61) == 1);
161 res = (int) ret1; 135 res = (int) ret1;
@@ -172,14 +146,14 @@ srm_env_cleanup(void)
172 srm_env_t *entry; 146 srm_env_t *entry;
173 unsigned long var_num; 147 unsigned long var_num;
174 148
175 if(base_dir) { 149 if (base_dir) {
176 /* 150 /*
177 * Remove named entries 151 * Remove named entries
178 */ 152 */
179 if(named_dir) { 153 if (named_dir) {
180 entry = srm_named_entries; 154 entry = srm_named_entries;
181 while(entry->name != NULL && entry->id != 0) { 155 while (entry->name != NULL && entry->id != 0) {
182 if(entry->proc_entry) { 156 if (entry->proc_entry) {
183 remove_proc_entry(entry->name, 157 remove_proc_entry(entry->name,
184 named_dir); 158 named_dir);
185 entry->proc_entry = NULL; 159 entry->proc_entry = NULL;
@@ -192,11 +166,11 @@ srm_env_cleanup(void)
192 /* 166 /*
193 * Remove numbered entries 167 * Remove numbered entries
194 */ 168 */
195 if(numbered_dir) { 169 if (numbered_dir) {
196 for(var_num = 0; var_num <= 255; var_num++) { 170 for (var_num = 0; var_num <= 255; var_num++) {
197 entry = &srm_numbered_entries[var_num]; 171 entry = &srm_numbered_entries[var_num];
198 172
199 if(entry->proc_entry) { 173 if (entry->proc_entry) {
200 remove_proc_entry(entry->name, 174 remove_proc_entry(entry->name,
201 numbered_dir); 175 numbered_dir);
202 entry->proc_entry = NULL; 176 entry->proc_entry = NULL;
@@ -212,7 +186,6 @@ srm_env_cleanup(void)
212 return; 186 return;
213} 187}
214 188
215
216static int __init 189static int __init
217srm_env_init(void) 190srm_env_init(void)
218{ 191{
@@ -222,7 +195,7 @@ srm_env_init(void)
222 /* 195 /*
223 * Check system 196 * Check system
224 */ 197 */
225 if(!alpha_using_srm) { 198 if (!alpha_using_srm) {
226 printk(KERN_INFO "%s: This Alpha system doesn't " 199 printk(KERN_INFO "%s: This Alpha system doesn't "
227 "know about SRM (or you've booted " 200 "know about SRM (or you've booted "
228 "SRM->MILO->Linux, which gets " 201 "SRM->MILO->Linux, which gets "
@@ -233,14 +206,14 @@ srm_env_init(void)
233 /* 206 /*
234 * Init numbers 207 * Init numbers
235 */ 208 */
236 for(var_num = 0; var_num <= 255; var_num++) 209 for (var_num = 0; var_num <= 255; var_num++)
237 sprintf(number[var_num], "%ld", var_num); 210 sprintf(number[var_num], "%ld", var_num);
238 211
239 /* 212 /*
240 * Create base directory 213 * Create base directory
241 */ 214 */
242 base_dir = proc_mkdir(BASE_DIR, NULL); 215 base_dir = proc_mkdir(BASE_DIR, NULL);
243 if(base_dir == NULL) { 216 if (!base_dir) {
244 printk(KERN_ERR "Couldn't create base dir /proc/%s\n", 217 printk(KERN_ERR "Couldn't create base dir /proc/%s\n",
245 BASE_DIR); 218 BASE_DIR);
246 goto cleanup; 219 goto cleanup;
@@ -251,7 +224,7 @@ srm_env_init(void)
251 * Create per-name subdirectory 224 * Create per-name subdirectory
252 */ 225 */
253 named_dir = proc_mkdir(NAMED_DIR, base_dir); 226 named_dir = proc_mkdir(NAMED_DIR, base_dir);
254 if(named_dir == NULL) { 227 if (!named_dir) {
255 printk(KERN_ERR "Couldn't create dir /proc/%s/%s\n", 228 printk(KERN_ERR "Couldn't create dir /proc/%s/%s\n",
256 BASE_DIR, NAMED_DIR); 229 BASE_DIR, NAMED_DIR);
257 goto cleanup; 230 goto cleanup;
@@ -262,7 +235,7 @@ srm_env_init(void)
262 * Create per-number subdirectory 235 * Create per-number subdirectory
263 */ 236 */
264 numbered_dir = proc_mkdir(NUMBERED_DIR, base_dir); 237 numbered_dir = proc_mkdir(NUMBERED_DIR, base_dir);
265 if(numbered_dir == NULL) { 238 if (!numbered_dir) {
266 printk(KERN_ERR "Couldn't create dir /proc/%s/%s\n", 239 printk(KERN_ERR "Couldn't create dir /proc/%s/%s\n",
267 BASE_DIR, NUMBERED_DIR); 240 BASE_DIR, NUMBERED_DIR);
268 goto cleanup; 241 goto cleanup;
@@ -274,10 +247,10 @@ srm_env_init(void)
274 * Create all named nodes 247 * Create all named nodes
275 */ 248 */
276 entry = srm_named_entries; 249 entry = srm_named_entries;
277 while(entry->name != NULL && entry->id != 0) { 250 while (entry->name && entry->id) {
278 entry->proc_entry = create_proc_entry(entry->name, 251 entry->proc_entry = create_proc_entry(entry->name,
279 0644, named_dir); 252 0644, named_dir);
280 if(entry->proc_entry == NULL) 253 if (!entry->proc_entry)
281 goto cleanup; 254 goto cleanup;
282 255
283 entry->proc_entry->data = (void *) entry; 256 entry->proc_entry->data = (void *) entry;
@@ -291,13 +264,13 @@ srm_env_init(void)
291 /* 264 /*
292 * Create all numbered nodes 265 * Create all numbered nodes
293 */ 266 */
294 for(var_num = 0; var_num <= 255; var_num++) { 267 for (var_num = 0; var_num <= 255; var_num++) {
295 entry = &srm_numbered_entries[var_num]; 268 entry = &srm_numbered_entries[var_num];
296 entry->name = number[var_num]; 269 entry->name = number[var_num];
297 270
298 entry->proc_entry = create_proc_entry(entry->name, 271 entry->proc_entry = create_proc_entry(entry->name,
299 0644, numbered_dir); 272 0644, numbered_dir);
300 if(entry->proc_entry == NULL) 273 if (!entry->proc_entry)
301 goto cleanup; 274 goto cleanup;
302 275
303 entry->id = var_num; 276 entry->id = var_num;
@@ -318,7 +291,6 @@ cleanup:
318 return -ENOMEM; 291 return -ENOMEM;
319} 292}
320 293
321
322static void __exit 294static void __exit
323srm_env_exit(void) 295srm_env_exit(void)
324{ 296{
@@ -328,7 +300,5 @@ srm_env_exit(void)
328 return; 300 return;
329} 301}
330 302
331
332module_init(srm_env_init); 303module_init(srm_env_init);
333module_exit(srm_env_exit); 304module_exit(srm_env_exit);
334
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index 71470e9d93b..76bf071e376 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -48,13 +48,7 @@ SECTIONS
48 . = ALIGN(8); 48 . = ALIGN(8);
49 __initcall_start = .; 49 __initcall_start = .;
50 .initcall.init : { 50 .initcall.init : {
51 *(.initcall1.init) 51 INITCALLS
52 *(.initcall2.init)
53 *(.initcall3.init)
54 *(.initcall4.init)
55 *(.initcall5.init)
56 *(.initcall6.init)
57 *(.initcall7.init)
58 } 52 }
59 __initcall_end = .; 53 __initcall_end = .;
60 54
diff --git a/arch/alpha/lib/checksum.c b/arch/alpha/lib/checksum.c
index 89044e6385f..ab3761c437a 100644
--- a/arch/alpha/lib/checksum.c
+++ b/arch/alpha/lib/checksum.c
@@ -41,28 +41,25 @@ static inline unsigned short from64to16(unsigned long x)
41 * computes the checksum of the TCP/UDP pseudo-header 41 * computes the checksum of the TCP/UDP pseudo-header
42 * returns a 16-bit checksum, already complemented. 42 * returns a 16-bit checksum, already complemented.
43 */ 43 */
44unsigned short int csum_tcpudp_magic(unsigned long saddr, 44__sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
45 unsigned long daddr,
46 unsigned short len, 45 unsigned short len,
47 unsigned short proto, 46 unsigned short proto,
48 unsigned int sum) 47 __wsum sum)
49{ 48{
50 return ~from64to16(saddr + daddr + sum + 49 return (__force __sum16)~from64to16(
51 ((unsigned long) ntohs(len) << 16) + 50 (__force u64)saddr + (__force u64)daddr +
52 ((unsigned long) proto << 8)); 51 (__force u64)sum + ((len + proto) << 8));
53} 52}
54 53
55unsigned int csum_tcpudp_nofold(unsigned long saddr, 54__wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
56 unsigned long daddr,
57 unsigned short len, 55 unsigned short len,
58 unsigned short proto, 56 unsigned short proto,
59 unsigned int sum) 57 __wsum sum)
60{ 58{
61 unsigned long result; 59 unsigned long result;
62 60
63 result = (saddr + daddr + sum + 61 result = (__force u64)saddr + (__force u64)daddr +
64 ((unsigned long) ntohs(len) << 16) + 62 (__force u64)sum + ((len + proto) << 8);
65 ((unsigned long) proto << 8));
66 63
67 /* Fold down to 32-bits so we don't lose in the typedef-less 64 /* Fold down to 32-bits so we don't lose in the typedef-less
68 network stack. */ 65 network stack. */
@@ -70,7 +67,7 @@ unsigned int csum_tcpudp_nofold(unsigned long saddr,
70 result = (result & 0xffffffff) + (result >> 32); 67 result = (result & 0xffffffff) + (result >> 32);
71 /* 33 to 32 */ 68 /* 33 to 32 */
72 result = (result & 0xffffffff) + (result >> 32); 69 result = (result & 0xffffffff) + (result >> 32);
73 return result; 70 return (__force __wsum)result;
74} 71}
75 72
76/* 73/*
@@ -146,9 +143,9 @@ out:
146 * This is a version of ip_compute_csum() optimized for IP headers, 143 * This is a version of ip_compute_csum() optimized for IP headers,
147 * which always checksum on 4 octet boundaries. 144 * which always checksum on 4 octet boundaries.
148 */ 145 */
149unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) 146__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
150{ 147{
151 return ~do_csum(iph,ihl*4); 148 return (__force __sum16)~do_csum(iph,ihl*4);
152} 149}
153 150
154/* 151/*
@@ -163,15 +160,15 @@ unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl)
163 * 160 *
164 * it's best to have buff aligned on a 32-bit boundary 161 * it's best to have buff aligned on a 32-bit boundary
165 */ 162 */
166unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) 163__wsum csum_partial(const void *buff, int len, __wsum sum)
167{ 164{
168 unsigned long result = do_csum(buff, len); 165 unsigned long result = do_csum(buff, len);
169 166
170 /* add in old sum, and carry.. */ 167 /* add in old sum, and carry.. */
171 result += sum; 168 result += (__force u32)sum;
172 /* 32+c bits -> 32 bits */ 169 /* 32+c bits -> 32 bits */
173 result = (result & 0xffffffff) + (result >> 32); 170 result = (result & 0xffffffff) + (result >> 32);
174 return result; 171 return (__force __wsum)result;
175} 172}
176 173
177EXPORT_SYMBOL(csum_partial); 174EXPORT_SYMBOL(csum_partial);
@@ -180,7 +177,7 @@ EXPORT_SYMBOL(csum_partial);
180 * this routine is used for miscellaneous IP-like checksums, mainly 177 * this routine is used for miscellaneous IP-like checksums, mainly
181 * in icmp.c 178 * in icmp.c
182 */ 179 */
183unsigned short ip_compute_csum(unsigned char * buff, int len) 180__sum16 ip_compute_csum(const void *buff, int len)
184{ 181{
185 return ~from64to16(do_csum(buff,len)); 182 return (__force __sum16)~from64to16(do_csum(buff,len));
186} 183}
diff --git a/arch/alpha/lib/csum_partial_copy.c b/arch/alpha/lib/csum_partial_copy.c
index a37948f3037..4ca75c74ce9 100644
--- a/arch/alpha/lib/csum_partial_copy.c
+++ b/arch/alpha/lib/csum_partial_copy.c
@@ -329,11 +329,11 @@ csum_partial_cfu_unaligned(const unsigned long __user * src,
329 return checksum; 329 return checksum;
330} 330}
331 331
332static unsigned int 332__wsum
333do_csum_partial_copy_from_user(const char __user *src, char *dst, int len, 333csum_partial_copy_from_user(const void __user *src, void *dst, int len,
334 unsigned int sum, int *errp) 334 __wsum sum, int *errp)
335{ 335{
336 unsigned long checksum = (unsigned) sum; 336 unsigned long checksum = (__force u32) sum;
337 unsigned long soff = 7 & (unsigned long) src; 337 unsigned long soff = 7 & (unsigned long) src;
338 unsigned long doff = 7 & (unsigned long) dst; 338 unsigned long doff = 7 & (unsigned long) dst;
339 339
@@ -367,25 +367,12 @@ do_csum_partial_copy_from_user(const char __user *src, char *dst, int len,
367 } 367 }
368 checksum = from64to16 (checksum); 368 checksum = from64to16 (checksum);
369 } 369 }
370 return checksum; 370 return (__force __wsum)checksum;
371}
372
373unsigned int
374csum_partial_copy_from_user(const char __user *src, char *dst, int len,
375 unsigned int sum, int *errp)
376{
377 if (!access_ok(VERIFY_READ, src, len)) {
378 *errp = -EFAULT;
379 memset(dst, 0, len);
380 return sum;
381 }
382
383 return do_csum_partial_copy_from_user(src, dst, len, sum, errp);
384} 371}
385 372
386unsigned int 373__wsum
387csum_partial_copy_nocheck(const char __user *src, char *dst, int len, 374csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
388 unsigned int sum)
389{ 375{
390 return do_csum_partial_copy_from_user(src, dst, len, sum, NULL); 376 return csum_partial_copy_from_user((__force const void __user *)src,
377 dst, len, sum, NULL);
391} 378}
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index adb05de40e2..ce00c570459 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -879,6 +879,8 @@ endif
879 879
880source "drivers/scsi/Kconfig" 880source "drivers/scsi/Kconfig"
881 881
882source "drivers/ata/Kconfig"
883
882source "drivers/md/Kconfig" 884source "drivers/md/Kconfig"
883 885
884source "drivers/message/fusion/Kconfig" 886source "drivers/message/fusion/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 2a0b2c8a1fe..6f4f8bf3607 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -174,11 +174,13 @@ libs-y := arch/arm/lib/ $(libs-y)
174 174
175# Default target when executing plain make 175# Default target when executing plain make
176ifeq ($(CONFIG_XIP_KERNEL),y) 176ifeq ($(CONFIG_XIP_KERNEL),y)
177all: xipImage 177KBUILD_IMAGE := xipImage
178else 178else
179all: zImage 179KBUILD_IMAGE := zImage
180endif 180endif
181 181
182all: $(KBUILD_IMAGE)
183
182boot := arch/arm/boot 184boot := arch/arm/boot
183 185
184# Update machine arch and proc symlinks if something which affects 186# Update machine arch and proc symlinks if something which affects
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 028bdc9228f..2e635b814c1 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -662,7 +662,8 @@ EXPORT_SYMBOL(dma_map_single);
662EXPORT_SYMBOL(dma_unmap_single); 662EXPORT_SYMBOL(dma_unmap_single);
663EXPORT_SYMBOL(dma_map_sg); 663EXPORT_SYMBOL(dma_map_sg);
664EXPORT_SYMBOL(dma_unmap_sg); 664EXPORT_SYMBOL(dma_unmap_sg);
665EXPORT_SYMBOL(dma_sync_single); 665EXPORT_SYMBOL(dma_sync_single_for_cpu);
666EXPORT_SYMBOL(dma_sync_single_for_device);
666EXPORT_SYMBOL(dma_sync_sg); 667EXPORT_SYMBOL(dma_sync_sg);
667EXPORT_SYMBOL(dmabounce_register_dev); 668EXPORT_SYMBOL(dmabounce_register_dev);
668EXPORT_SYMBOL(dmabounce_unregister_dev); 669EXPORT_SYMBOL(dmabounce_unregister_dev);
diff --git a/arch/arm/configs/assabet_defconfig b/arch/arm/configs/assabet_defconfig
index 089c9d59840..b1cd331aaec 100644
--- a/arch/arm/configs/assabet_defconfig
+++ b/arch/arm/configs/assabet_defconfig
@@ -184,6 +184,7 @@ CONFIG_BINFMT_ELF=y
184# Power management options 184# Power management options
185# 185#
186CONFIG_PM=y 186CONFIG_PM=y
187# CONFIG_PM_LEGACY is not set
187# CONFIG_APM is not set 188# CONFIG_APM is not set
188 189
189# 190#
diff --git a/arch/arm/configs/at91rm9200dk_defconfig b/arch/arm/configs/at91rm9200dk_defconfig
index c82e4667f45..b43041476e0 100644
--- a/arch/arm/configs/at91rm9200dk_defconfig
+++ b/arch/arm/configs/at91rm9200dk_defconfig
@@ -577,7 +577,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
577# Watchdog Device Drivers 577# Watchdog Device Drivers
578# 578#
579# CONFIG_SOFT_WATCHDOG is not set 579# CONFIG_SOFT_WATCHDOG is not set
580CONFIG_AT91_WATCHDOG=y 580CONFIG_AT91RM9200_WATCHDOG=y
581 581
582# 582#
583# USB-based Watchdog Cards 583# USB-based Watchdog Cards
diff --git a/arch/arm/configs/at91rm9200ek_defconfig b/arch/arm/configs/at91rm9200ek_defconfig
index b983fc59aa4..d96fc8386e2 100644
--- a/arch/arm/configs/at91rm9200ek_defconfig
+++ b/arch/arm/configs/at91rm9200ek_defconfig
@@ -558,7 +558,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
558# Watchdog Device Drivers 558# Watchdog Device Drivers
559# 559#
560# CONFIG_SOFT_WATCHDOG is not set 560# CONFIG_SOFT_WATCHDOG is not set
561CONFIG_AT91_WATCHDOG=y 561CONFIG_AT91RM9200_WATCHDOG=y
562 562
563# 563#
564# USB-based Watchdog Cards 564# USB-based Watchdog Cards
diff --git a/arch/arm/configs/ateb9200_defconfig b/arch/arm/configs/ateb9200_defconfig
index 15e6b0bbbde..3de5c643848 100644
--- a/arch/arm/configs/ateb9200_defconfig
+++ b/arch/arm/configs/ateb9200_defconfig
@@ -217,7 +217,7 @@ CONFIG_BINFMT_ELF=y
217# Power management options 217# Power management options
218# 218#
219CONFIG_PM=y 219CONFIG_PM=y
220CONFIG_PM_LEGACY=y 220# CONFIG_PM_LEGACY is not set
221# CONFIG_PM_DEBUG is not set 221# CONFIG_PM_DEBUG is not set
222# CONFIG_APM is not set 222# CONFIG_APM is not set
223 223
diff --git a/arch/arm/configs/cerfcube_defconfig b/arch/arm/configs/cerfcube_defconfig
index f81a60005cd..09b7acd7f64 100644
--- a/arch/arm/configs/cerfcube_defconfig
+++ b/arch/arm/configs/cerfcube_defconfig
@@ -194,6 +194,7 @@ CONFIG_BINFMT_ELF=y
194# Power management options 194# Power management options
195# 195#
196CONFIG_PM=y 196CONFIG_PM=y
197# CONFIG_PM_LEGACY is not set
197# CONFIG_APM is not set 198# CONFIG_APM is not set
198 199
199# 200#
diff --git a/arch/arm/configs/collie_defconfig b/arch/arm/configs/collie_defconfig
index 074c47a4fb2..a3758913c0b 100644
--- a/arch/arm/configs/collie_defconfig
+++ b/arch/arm/configs/collie_defconfig
@@ -219,7 +219,7 @@ CONFIG_BINFMT_ELF=y
219# Power management options 219# Power management options
220# 220#
221CONFIG_PM=y 221CONFIG_PM=y
222CONFIG_PM_LEGACY=y 222# CONFIG_PM_LEGACY is not set
223# CONFIG_PM_DEBUG is not set 223# CONFIG_PM_DEBUG is not set
224CONFIG_APM=y 224CONFIG_APM=y
225 225
diff --git a/arch/arm/configs/corgi_defconfig b/arch/arm/configs/corgi_defconfig
index 3c3461e8339..c41c04fa502 100644
--- a/arch/arm/configs/corgi_defconfig
+++ b/arch/arm/configs/corgi_defconfig
@@ -208,6 +208,7 @@ CONFIG_BINFMT_MISC=m
208# Power management options 208# Power management options
209# 209#
210CONFIG_PM=y 210CONFIG_PM=y
211# CONFIG_PM_LEGACY is not set
211CONFIG_APM=y 212CONFIG_APM=y
212 213
213# 214#
diff --git a/arch/arm/configs/csb337_defconfig b/arch/arm/configs/csb337_defconfig
index a2d6fd398f1..20e68250d83 100644
--- a/arch/arm/configs/csb337_defconfig
+++ b/arch/arm/configs/csb337_defconfig
@@ -615,7 +615,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
615# Watchdog Device Drivers 615# Watchdog Device Drivers
616# 616#
617# CONFIG_SOFT_WATCHDOG is not set 617# CONFIG_SOFT_WATCHDOG is not set
618CONFIG_AT91_WATCHDOG=y 618CONFIG_AT91RM9200_WATCHDOG=y
619 619
620# 620#
621# USB-based Watchdog Cards 621# USB-based Watchdog Cards
diff --git a/arch/arm/configs/csb637_defconfig b/arch/arm/configs/csb637_defconfig
index 2a1ac6c60ab..df8595ac031 100644
--- a/arch/arm/configs/csb637_defconfig
+++ b/arch/arm/configs/csb637_defconfig
@@ -615,7 +615,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
615# Watchdog Device Drivers 615# Watchdog Device Drivers
616# 616#
617# CONFIG_SOFT_WATCHDOG is not set 617# CONFIG_SOFT_WATCHDOG is not set
618CONFIG_AT91_WATCHDOG=y 618CONFIG_AT91RM9200_WATCHDOG=y
619 619
620# 620#
621# USB-based Watchdog Cards 621# USB-based Watchdog Cards
diff --git a/arch/arm/configs/h3600_defconfig b/arch/arm/configs/h3600_defconfig
index 7a0da0b7fac..8f986e9f1c6 100644
--- a/arch/arm/configs/h3600_defconfig
+++ b/arch/arm/configs/h3600_defconfig
@@ -194,6 +194,7 @@ CONFIG_BINFMT_ELF=y
194# Power management options 194# Power management options
195# 195#
196CONFIG_PM=y 196CONFIG_PM=y
197# CONFIG_PM_LEGACY is not set
197# CONFIG_APM is not set 198# CONFIG_APM is not set
198 199
199# 200#
diff --git a/arch/arm/configs/integrator_defconfig b/arch/arm/configs/integrator_defconfig
index d1ba7fdde81..692ab57ba1c 100644
--- a/arch/arm/configs/integrator_defconfig
+++ b/arch/arm/configs/integrator_defconfig
@@ -190,6 +190,7 @@ CONFIG_BINFMT_ELF=y
190# Power management options 190# Power management options
191# 191#
192CONFIG_PM=y 192CONFIG_PM=y
193# CONFIG_PM_LEGACY is not set
193# CONFIG_APM is not set 194# CONFIG_APM is not set
194 195
195# 196#
diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig
index 4975b914f92..fac7c3b240c 100644
--- a/arch/arm/configs/ixp4xx_defconfig
+++ b/arch/arm/configs/ixp4xx_defconfig
@@ -206,10 +206,8 @@ CONFIG_BINFMT_ELF=y
206# 206#
207# Power management options 207# Power management options
208# 208#
209CONFIG_PM=y 209# CONFIG_PM is not set
210CONFIG_PM_LEGACY=y 210# CONFIG_APM is not set
211# CONFIG_PM_DEBUG is not set
212CONFIG_APM=y
213 211
214# 212#
215# Networking 213# Networking
diff --git a/arch/arm/configs/jornada720_defconfig b/arch/arm/configs/jornada720_defconfig
index ad1048db96f..80a6fd97eb3 100644
--- a/arch/arm/configs/jornada720_defconfig
+++ b/arch/arm/configs/jornada720_defconfig
@@ -182,6 +182,7 @@ CONFIG_BINFMT_AOUT=m
182# Power management options 182# Power management options
183# 183#
184CONFIG_PM=y 184CONFIG_PM=y
185# CONFIG_PM_LEGACY is not set
185# CONFIG_APM is not set 186# CONFIG_APM is not set
186 187
187# 188#
diff --git a/arch/arm/configs/kafa_defconfig b/arch/arm/configs/kafa_defconfig
index 54fcd75779d..a4cdafc1548 100644
--- a/arch/arm/configs/kafa_defconfig
+++ b/arch/arm/configs/kafa_defconfig
@@ -560,7 +560,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
560# Watchdog Device Drivers 560# Watchdog Device Drivers
561# 561#
562# CONFIG_SOFT_WATCHDOG is not set 562# CONFIG_SOFT_WATCHDOG is not set
563CONFIG_AT91_WATCHDOG=y 563CONFIG_AT91RM9200_WATCHDOG=y
564# CONFIG_NVRAM is not set 564# CONFIG_NVRAM is not set
565# CONFIG_DTLK is not set 565# CONFIG_DTLK is not set
566# CONFIG_R3964 is not set 566# CONFIG_R3964 is not set
diff --git a/arch/arm/configs/lart_defconfig b/arch/arm/configs/lart_defconfig
index c3a93284416..a1cc34f2560 100644
--- a/arch/arm/configs/lart_defconfig
+++ b/arch/arm/configs/lart_defconfig
@@ -180,6 +180,7 @@ CONFIG_BINFMT_AOUT=y
180# Power management options 180# Power management options
181# 181#
182CONFIG_PM=y 182CONFIG_PM=y
183# CONFIG_PM_LEGACY is not set
183CONFIG_APM=m 184CONFIG_APM=m
184 185
185# 186#
diff --git a/arch/arm/configs/neponset_defconfig b/arch/arm/configs/neponset_defconfig
index 3d35255c64e..df8168e57b7 100644
--- a/arch/arm/configs/neponset_defconfig
+++ b/arch/arm/configs/neponset_defconfig
@@ -190,6 +190,7 @@ CONFIG_BINFMT_AOUT=y
190# Power management options 190# Power management options
191# 191#
192CONFIG_PM=y 192CONFIG_PM=y
193# CONFIG_PM_LEGACY is not set
193CONFIG_APM=y 194CONFIG_APM=y
194 195
195# 196#
diff --git a/arch/arm/configs/omap_h2_1610_defconfig b/arch/arm/configs/omap_h2_1610_defconfig
index 05adb0b34e7..b0efd4ca993 100644
--- a/arch/arm/configs/omap_h2_1610_defconfig
+++ b/arch/arm/configs/omap_h2_1610_defconfig
@@ -257,7 +257,7 @@ CONFIG_BINFMT_AOUT=y
257# Power management options 257# Power management options
258# 258#
259CONFIG_PM=y 259CONFIG_PM=y
260CONFIG_PM_LEGACY=y 260# CONFIG_PM_LEGACY is not set
261# CONFIG_PM_DEBUG is not set 261# CONFIG_PM_DEBUG is not set
262# CONFIG_APM is not set 262# CONFIG_APM is not set
263 263
diff --git a/arch/arm/configs/onearm_defconfig b/arch/arm/configs/onearm_defconfig
index cb1d94f9049..9b9f2155af3 100644
--- a/arch/arm/configs/onearm_defconfig
+++ b/arch/arm/configs/onearm_defconfig
@@ -607,7 +607,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
607# Watchdog Device Drivers 607# Watchdog Device Drivers
608# 608#
609# CONFIG_SOFT_WATCHDOG is not set 609# CONFIG_SOFT_WATCHDOG is not set
610CONFIG_AT91_WATCHDOG=y 610CONFIG_AT91RM9200_WATCHDOG=y
611 611
612# 612#
613# USB-based Watchdog Cards 613# USB-based Watchdog Cards
diff --git a/arch/arm/configs/bast_defconfig b/arch/arm/configs/realview-smp_defconfig
index 4a8564f386a..ffd905ff19f 100644
--- a/arch/arm/configs/bast_defconfig
+++ b/arch/arm/configs/realview-smp_defconfig
@@ -1,136 +1,168 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2 3# Linux kernel version: 2.6.19-rc3
4# Sun Mar 27 02:24:16 2005 4# Wed Oct 25 14:12:00 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7# CONFIG_GENERIC_TIME is not set
7CONFIG_MMU=y 8CONFIG_MMU=y
8CONFIG_UID16=y 9CONFIG_GENERIC_HARDIRQS=y
10CONFIG_TRACE_IRQFLAGS_SUPPORT=y
11CONFIG_HARDIRQS_SW_RESEND=y
12CONFIG_GENERIC_IRQ_PROBE=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 13CONFIG_RWSEM_GENERIC_SPINLOCK=y
14CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 15CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y 16CONFIG_VECTORS_BASE=0xffff0000
17CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
12 18
13# 19#
14# Code maturity level options 20# Code maturity level options
15# 21#
16CONFIG_EXPERIMENTAL=y 22CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y 23CONFIG_LOCK_KERNEL=y
18CONFIG_BROKEN_ON_SMP=y 24CONFIG_INIT_ENV_ARG_LIMIT=32
19 25
20# 26#
21# General setup 27# General setup
22# 28#
23CONFIG_LOCALVERSION="" 29CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y 30CONFIG_LOCALVERSION_AUTO=y
31# CONFIG_SWAP is not set
25CONFIG_SYSVIPC=y 32CONFIG_SYSVIPC=y
33# CONFIG_IPC_NS is not set
26# CONFIG_POSIX_MQUEUE is not set 34# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set 35# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y 36# CONFIG_TASKSTATS is not set
37# CONFIG_UTS_NS is not set
29# CONFIG_AUDIT is not set 38# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set 39# CONFIG_IKCONFIG is not set
40# CONFIG_CPUSETS is not set
41# CONFIG_RELAY is not set
42CONFIG_INITRAMFS_SOURCE=""
43CONFIG_CC_OPTIMIZE_FOR_SIZE=y
44CONFIG_SYSCTL=y
33# CONFIG_EMBEDDED is not set 45# CONFIG_EMBEDDED is not set
46CONFIG_UID16=y
47# CONFIG_SYSCTL_SYSCALL is not set
34CONFIG_KALLSYMS=y 48CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set 49CONFIG_KALLSYMS_ALL=y
36# CONFIG_KALLSYMS_EXTRA_PASS is not set 50# CONFIG_KALLSYMS_EXTRA_PASS is not set
51CONFIG_HOTPLUG=y
52CONFIG_PRINTK=y
53CONFIG_BUG=y
54CONFIG_ELF_CORE=y
37CONFIG_BASE_FULL=y 55CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 56CONFIG_FUTEX=y
39CONFIG_EPOLL=y 57CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
41CONFIG_SHMEM=y 58CONFIG_SHMEM=y
42CONFIG_CC_ALIGN_FUNCTIONS=0 59CONFIG_SLAB=y
43CONFIG_CC_ALIGN_LABELS=0 60CONFIG_VM_EVENT_COUNTERS=y
44CONFIG_CC_ALIGN_LOOPS=0 61CONFIG_RT_MUTEXES=y
45CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set 62# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0 63CONFIG_BASE_SMALL=0
64# CONFIG_SLOB is not set
48 65
49# 66#
50# Loadable module support 67# Loadable module support
51# 68#
52CONFIG_MODULES=y 69CONFIG_MODULES=y
53# CONFIG_MODULE_UNLOAD is not set 70CONFIG_MODULE_UNLOAD=y
54CONFIG_OBSOLETE_MODPARM=y 71# CONFIG_MODULE_FORCE_UNLOAD is not set
55# CONFIG_MODVERSIONS is not set 72# CONFIG_MODVERSIONS is not set
56# CONFIG_MODULE_SRCVERSION_ALL is not set 73# CONFIG_MODULE_SRCVERSION_ALL is not set
57CONFIG_KMOD=y 74# CONFIG_KMOD is not set
75CONFIG_STOP_MACHINE=y
76
77#
78# Block layer
79#
80CONFIG_BLOCK=y
81# CONFIG_BLK_DEV_IO_TRACE is not set
82
83#
84# IO Schedulers
85#
86CONFIG_IOSCHED_NOOP=y
87# CONFIG_IOSCHED_AS is not set
88CONFIG_IOSCHED_DEADLINE=y
89# CONFIG_IOSCHED_CFQ is not set
90# CONFIG_DEFAULT_AS is not set
91CONFIG_DEFAULT_DEADLINE=y
92# CONFIG_DEFAULT_CFQ is not set
93# CONFIG_DEFAULT_NOOP is not set
94CONFIG_DEFAULT_IOSCHED="deadline"
58 95
59# 96#
60# System Type 97# System Type
61# 98#
99# CONFIG_ARCH_AAEC2000 is not set
100# CONFIG_ARCH_INTEGRATOR is not set
101CONFIG_ARCH_REALVIEW=y
102# CONFIG_ARCH_VERSATILE is not set
103# CONFIG_ARCH_AT91 is not set
62# CONFIG_ARCH_CLPS7500 is not set 104# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set 105# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set 106# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set 107# CONFIG_ARCH_EBSA110 is not set
108# CONFIG_ARCH_EP93XX is not set
66# CONFIG_ARCH_FOOTBRIDGE is not set 109# CONFIG_ARCH_FOOTBRIDGE is not set
67# CONFIG_ARCH_INTEGRATOR is not set 110# CONFIG_ARCH_NETX is not set
68# CONFIG_ARCH_IOP3XX is not set 111# CONFIG_ARCH_H720X is not set
112# CONFIG_ARCH_IMX is not set
113# CONFIG_ARCH_IOP32X is not set
114# CONFIG_ARCH_IOP33X is not set
69# CONFIG_ARCH_IXP4XX is not set 115# CONFIG_ARCH_IXP4XX is not set
70# CONFIG_ARCH_IXP2000 is not set 116# CONFIG_ARCH_IXP2000 is not set
117# CONFIG_ARCH_IXP23XX is not set
71# CONFIG_ARCH_L7200 is not set 118# CONFIG_ARCH_L7200 is not set
119# CONFIG_ARCH_PNX4008 is not set
72# CONFIG_ARCH_PXA is not set 120# CONFIG_ARCH_PXA is not set
73# CONFIG_ARCH_RPC is not set 121# CONFIG_ARCH_RPC is not set
74# CONFIG_ARCH_SA1100 is not set 122# CONFIG_ARCH_SA1100 is not set
75CONFIG_ARCH_S3C2410=y 123# CONFIG_ARCH_S3C2410 is not set
76# CONFIG_ARCH_SHARK is not set 124# CONFIG_ARCH_SHARK is not set
77# CONFIG_ARCH_LH7A40X is not set 125# CONFIG_ARCH_LH7A40X is not set
78# CONFIG_ARCH_OMAP is not set 126# CONFIG_ARCH_OMAP is not set
79# CONFIG_ARCH_VERSATILE is not set
80# CONFIG_ARCH_IMX is not set
81# CONFIG_ARCH_H720X is not set
82
83#
84# S3C24XX Implementations
85#
86CONFIG_ARCH_BAST=y
87# CONFIG_ARCH_H1940 is not set
88# CONFIG_MACH_N30 is not set
89# CONFIG_ARCH_SMDK2410 is not set
90# CONFIG_ARCH_S3C2440 is not set
91CONFIG_MACH_VR1000=y
92# CONFIG_MACH_RX3715 is not set
93# CONFIG_MACH_OTOM is not set
94# CONFIG_MACH_NEXCODER_2440 is not set
95CONFIG_CPU_S3C2410=y
96
97#
98# S3C2410 Boot
99#
100# CONFIG_S3C2410_BOOT_WATCHDOG is not set
101 127
102# 128#
103# S3C2410 Setup 129# RealView platform type
104# 130#
105CONFIG_S3C2410_DMA=y 131CONFIG_MACH_REALVIEW_EB=y
106# CONFIG_S3C2410_DMA_DEBUG is not set 132CONFIG_REALVIEW_MPCORE=y
107# CONFIG_S3C2410_PM_DEBUG is not set
108# CONFIG_S3C2410_PM_CHECK is not set
109CONFIG_S3C2410_LOWLEVEL_UART_PORT=0
110 133
111# 134#
112# Processor Type 135# Processor Type
113# 136#
114CONFIG_CPU_32=y 137CONFIG_CPU_32=y
115CONFIG_CPU_ARM920T=y 138# CONFIG_CPU_ARM926T is not set
116CONFIG_CPU_32v4=y 139CONFIG_CPU_V6=y
117CONFIG_CPU_ABRT_EV4T=y 140CONFIG_CPU_32v6K=y
118CONFIG_CPU_CACHE_V4WT=y 141CONFIG_CPU_32v6=y
119CONFIG_CPU_CACHE_VIVT=y 142CONFIG_CPU_ABRT_EV6=y
120CONFIG_CPU_COPY_V4WB=y 143CONFIG_CPU_CACHE_V6=y
121CONFIG_CPU_TLB_V4WBI=y 144CONFIG_CPU_CACHE_VIPT=y
145CONFIG_CPU_COPY_V6=y
146CONFIG_CPU_TLB_V6=y
147CONFIG_CPU_CP15=y
148CONFIG_CPU_CP15_MMU=y
122 149
123# 150#
124# Processor Features 151# Processor Features
125# 152#
126# CONFIG_ARM_THUMB is not set 153CONFIG_ARM_THUMB=y
127# CONFIG_CPU_ICACHE_DISABLE is not set 154# CONFIG_CPU_ICACHE_DISABLE is not set
128# CONFIG_CPU_DCACHE_DISABLE is not set 155# CONFIG_CPU_DCACHE_DISABLE is not set
129# CONFIG_CPU_DCACHE_WRITETHROUGH is not set 156# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
157# CONFIG_CPU_BPREDICT_DISABLE is not set
158CONFIG_HAS_TLS_REG=y
159CONFIG_ARM_GIC=y
160CONFIG_ICST307=y
130 161
131# 162#
132# Bus support 163# Bus support
133# 164#
165CONFIG_ARM_AMBA=y
134 166
135# 167#
136# PCCARD (PCMCIA/CardBus) support 168# PCCARD (PCMCIA/CardBus) support
@@ -140,7 +172,24 @@ CONFIG_CPU_TLB_V4WBI=y
140# 172#
141# Kernel Features 173# Kernel Features
142# 174#
175CONFIG_SMP=y
176CONFIG_NR_CPUS=4
177CONFIG_HOTPLUG_CPU=y
178CONFIG_LOCAL_TIMERS=y
143# CONFIG_PREEMPT is not set 179# CONFIG_PREEMPT is not set
180# CONFIG_NO_IDLE_HZ is not set
181CONFIG_HZ=100
182# CONFIG_AEABI is not set
183# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
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_SPLIT_PTLOCK_CPUS=4
192# CONFIG_RESOURCES_64BIT is not set
144CONFIG_ALIGNMENT_TRAP=y 193CONFIG_ALIGNMENT_TRAP=y
145 194
146# 195#
@@ -148,7 +197,7 @@ CONFIG_ALIGNMENT_TRAP=y
148# 197#
149CONFIG_ZBOOT_ROM_TEXT=0x0 198CONFIG_ZBOOT_ROM_TEXT=0x0
150CONFIG_ZBOOT_ROM_BSS=0x0 199CONFIG_ZBOOT_ROM_BSS=0x0
151CONFIG_CMDLINE="root=/dev/hda1 ro init=/bin/bash console=ttySAC0" 200CONFIG_CMDLINE="root=/dev/nfs nfsroot=10.1.69.3:/work/nfsroot ip=dhcp console=ttyAMA0 mem=128M"
152# CONFIG_XIP_KERNEL is not set 201# CONFIG_XIP_KERNEL is not set
153 202
154# 203#
@@ -161,20 +210,105 @@ CONFIG_CMDLINE="root=/dev/hda1 ro init=/bin/bash console=ttySAC0"
161CONFIG_FPE_NWFPE=y 210CONFIG_FPE_NWFPE=y
162# CONFIG_FPE_NWFPE_XP is not set 211# CONFIG_FPE_NWFPE_XP is not set
163# CONFIG_FPE_FASTFPE is not set 212# CONFIG_FPE_FASTFPE is not set
213CONFIG_VFP=y
164 214
165# 215#
166# Userspace binary formats 216# Userspace binary formats
167# 217#
168CONFIG_BINFMT_ELF=y 218CONFIG_BINFMT_ELF=y
169CONFIG_BINFMT_AOUT=y 219# CONFIG_BINFMT_AOUT is not set
170# CONFIG_BINFMT_MISC is not set 220# CONFIG_BINFMT_MISC is not set
171# CONFIG_ARTHUR is not set 221# CONFIG_ARTHUR is not set
172 222
173# 223#
174# Power management options 224# Power management options
175# 225#
176CONFIG_PM=y 226# CONFIG_PM is not set
177CONFIG_APM=y 227# CONFIG_APM is not set
228
229#
230# Networking
231#
232CONFIG_NET=y
233
234#
235# Networking options
236#
237# CONFIG_NETDEBUG is not set
238CONFIG_PACKET=y
239# CONFIG_PACKET_MMAP is not set
240CONFIG_UNIX=y
241# CONFIG_NET_KEY is not set
242CONFIG_INET=y
243# CONFIG_IP_MULTICAST is not set
244# CONFIG_IP_ADVANCED_ROUTER is not set
245CONFIG_IP_FIB_HASH=y
246CONFIG_IP_PNP=y
247CONFIG_IP_PNP_DHCP=y
248CONFIG_IP_PNP_BOOTP=y
249# CONFIG_IP_PNP_RARP is not set
250# CONFIG_NET_IPIP is not set
251# CONFIG_NET_IPGRE 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
257# CONFIG_INET_XFRM_TUNNEL is not set
258# CONFIG_INET_TUNNEL is not set
259# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
260# CONFIG_INET_XFRM_MODE_TUNNEL is not set
261# CONFIG_INET_XFRM_MODE_BEET is not set
262CONFIG_INET_DIAG=y
263CONFIG_INET_TCP_DIAG=y
264# CONFIG_TCP_CONG_ADVANCED is not set
265CONFIG_TCP_CONG_CUBIC=y
266CONFIG_DEFAULT_TCP_CONG="cubic"
267# CONFIG_IPV6 is not set
268# CONFIG_INET6_XFRM_TUNNEL is not set
269# CONFIG_INET6_TUNNEL is not set
270# CONFIG_NETWORK_SECMARK is not set
271# CONFIG_NETFILTER 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
283#
284# TIPC Configuration (EXPERIMENTAL)
285#
286# CONFIG_TIPC is not set
287# CONFIG_ATM is not set
288# CONFIG_BRIDGE is not set
289# CONFIG_VLAN_8021Q is not set
290# CONFIG_DECNET is not set
291# CONFIG_LLC2 is not set
292# CONFIG_IPX is not set
293# CONFIG_ATALK is not set
294# CONFIG_X25 is not set
295# CONFIG_LAPB 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
304#
305# Network testing
306#
307# CONFIG_NET_PKTGEN is not set
308# CONFIG_HAMRADIO is not set
309# CONFIG_IRDA is not set
310# CONFIG_BT is not set
311# CONFIG_IEEE80211 is not set
178 312
179# 313#
180# Device Drivers 314# Device Drivers
@@ -187,6 +321,12 @@ CONFIG_STANDALONE=y
187CONFIG_PREVENT_FIRMWARE_BUILD=y 321CONFIG_PREVENT_FIRMWARE_BUILD=y
188# CONFIG_FW_LOADER is not set 322# CONFIG_FW_LOADER is not set
189# CONFIG_DEBUG_DRIVER is not set 323# CONFIG_DEBUG_DRIVER is not set
324# CONFIG_SYS_HYPERVISOR is not set
325
326#
327# Connector - unified userspace <-> kernelspace linker
328#
329# CONFIG_CONNECTOR is not set
190 330
191# 331#
192# Memory Technology Devices (MTD) 332# Memory Technology Devices (MTD)
@@ -195,10 +335,7 @@ CONFIG_MTD=y
195# CONFIG_MTD_DEBUG is not set 335# CONFIG_MTD_DEBUG is not set
196# CONFIG_MTD_CONCAT is not set 336# CONFIG_MTD_CONCAT is not set
197CONFIG_MTD_PARTITIONS=y 337CONFIG_MTD_PARTITIONS=y
198CONFIG_MTD_REDBOOT_PARTS=y 338# CONFIG_MTD_REDBOOT_PARTS is not set
199CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
200CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
201# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
202CONFIG_MTD_CMDLINE_PARTS=y 339CONFIG_MTD_CMDLINE_PARTS=y
203# CONFIG_MTD_AFS_PARTS is not set 340# CONFIG_MTD_AFS_PARTS is not set
204 341
@@ -210,44 +347,42 @@ CONFIG_MTD_BLOCK=y
210# CONFIG_FTL is not set 347# CONFIG_FTL is not set
211# CONFIG_NFTL is not set 348# CONFIG_NFTL is not set
212# CONFIG_INFTL is not set 349# CONFIG_INFTL is not set
350# CONFIG_RFD_FTL is not set
351# CONFIG_SSFDC is not set
213 352
214# 353#
215# RAM/ROM/Flash chip drivers 354# RAM/ROM/Flash chip drivers
216# 355#
217CONFIG_MTD_CFI=y 356CONFIG_MTD_CFI=y
218CONFIG_MTD_JEDECPROBE=y 357# CONFIG_MTD_JEDECPROBE is not set
219CONFIG_MTD_GEN_PROBE=y 358CONFIG_MTD_GEN_PROBE=y
220# CONFIG_MTD_CFI_ADV_OPTIONS is not set 359# CONFIG_MTD_CFI_ADV_OPTIONS is not set
221CONFIG_MTD_MAP_BANK_WIDTH_1=y 360CONFIG_MTD_MAP_BANK_WIDTH_1=y
222CONFIG_MTD_MAP_BANK_WIDTH_2=y 361CONFIG_MTD_MAP_BANK_WIDTH_2=y
223CONFIG_MTD_MAP_BANK_WIDTH_4=y 362CONFIG_MTD_MAP_BANK_WIDTH_4=y
224# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set 363# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
225CONFIG_MTD_MAP_BANK_WIDTH_16=y 364# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
226# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set 365# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
227CONFIG_MTD_CFI_I1=y 366CONFIG_MTD_CFI_I1=y
228CONFIG_MTD_CFI_I2=y 367CONFIG_MTD_CFI_I2=y
229# CONFIG_MTD_CFI_I4 is not set 368# CONFIG_MTD_CFI_I4 is not set
230# CONFIG_MTD_CFI_I8 is not set 369# CONFIG_MTD_CFI_I8 is not set
231CONFIG_MTD_CFI_INTELEXT=y 370CONFIG_MTD_CFI_INTELEXT=y
232# CONFIG_MTD_CFI_AMDSTD is not set 371CONFIG_MTD_CFI_AMDSTD=y
233# CONFIG_MTD_CFI_STAA is not set 372# CONFIG_MTD_CFI_STAA is not set
234CONFIG_MTD_CFI_UTIL=y 373CONFIG_MTD_CFI_UTIL=y
235# CONFIG_MTD_RAM is not set 374# CONFIG_MTD_RAM is not set
236# CONFIG_MTD_ROM is not set 375# CONFIG_MTD_ROM is not set
237# CONFIG_MTD_ABSENT is not set 376# CONFIG_MTD_ABSENT is not set
238# CONFIG_MTD_OBSOLETE_CHIPS is not set 377# CONFIG_MTD_OBSOLETE_CHIPS is not set
239# CONFIG_MTD_XIP is not set
240 378
241# 379#
242# Mapping drivers for chip access 380# Mapping drivers for chip access
243# 381#
244# CONFIG_MTD_COMPLEX_MAPPINGS is not set 382# CONFIG_MTD_COMPLEX_MAPPINGS is not set
245# CONFIG_MTD_PHYSMAP is not set 383# CONFIG_MTD_PHYSMAP is not set
246# CONFIG_MTD_ARM_INTEGRATOR is not set 384CONFIG_MTD_ARM_INTEGRATOR=y
247# CONFIG_MTD_EDB7312 is not set 385# CONFIG_MTD_PLATRAM is not set
248# CONFIG_MTD_IMPA7 is not set
249CONFIG_MTD_BAST=y
250CONFIG_MTD_BAST_MAXSIZE=4
251 386
252# 387#
253# Self-contained MTD device drivers 388# Self-contained MTD device drivers
@@ -255,7 +390,6 @@ CONFIG_MTD_BAST_MAXSIZE=4
255# CONFIG_MTD_SLRAM is not set 390# CONFIG_MTD_SLRAM is not set
256# CONFIG_MTD_PHRAM is not set 391# CONFIG_MTD_PHRAM is not set
257# CONFIG_MTD_MTDRAM is not set 392# CONFIG_MTD_MTDRAM is not set
258# CONFIG_MTD_BLKMTD is not set
259# CONFIG_MTD_BLOCK2MTD is not set 393# CONFIG_MTD_BLOCK2MTD is not set
260 394
261# 395#
@@ -268,23 +402,17 @@ CONFIG_MTD_BAST_MAXSIZE=4
268# 402#
269# NAND Flash Device Drivers 403# NAND Flash Device Drivers
270# 404#
271CONFIG_MTD_NAND=y 405# CONFIG_MTD_NAND is not set
272# CONFIG_MTD_NAND_VERIFY_WRITE is not set 406
273CONFIG_MTD_NAND_IDS=y 407#
274CONFIG_MTD_NAND_S3C2410=y 408# OneNAND Flash Device Drivers
275# CONFIG_MTD_NAND_S3C2410_DEBUG is not set 409#
276# CONFIG_MTD_NAND_S3C2410_HWECC is not set 410# CONFIG_MTD_ONENAND is not set
277# CONFIG_MTD_NAND_DISKONCHIP is not set
278# CONFIG_MTD_NAND_NANDSIM is not set
279 411
280# 412#
281# Parallel port support 413# Parallel port support
282# 414#
283CONFIG_PARPORT=y 415# CONFIG_PARPORT is not set
284# CONFIG_PARPORT_PC is not set
285# CONFIG_PARPORT_ARC is not set
286# CONFIG_PARPORT_GSC is not set
287CONFIG_PARPORT_1284=y
288 416
289# 417#
290# Plug and Play support 418# Plug and Play support
@@ -293,59 +421,20 @@ CONFIG_PARPORT_1284=y
293# 421#
294# Block devices 422# Block devices
295# 423#
296# CONFIG_BLK_DEV_FD is not set
297# CONFIG_PARIDE is not set
298# CONFIG_BLK_DEV_COW_COMMON is not set 424# CONFIG_BLK_DEV_COW_COMMON is not set
299CONFIG_BLK_DEV_LOOP=y 425# CONFIG_BLK_DEV_LOOP is not set
300# CONFIG_BLK_DEV_CRYPTOLOOP is not set 426# CONFIG_BLK_DEV_NBD is not set
301CONFIG_BLK_DEV_NBD=m 427# CONFIG_BLK_DEV_RAM is not set
302CONFIG_BLK_DEV_RAM=y
303CONFIG_BLK_DEV_RAM_COUNT=16
304CONFIG_BLK_DEV_RAM_SIZE=4096
305CONFIG_BLK_DEV_INITRD=y 428CONFIG_BLK_DEV_INITRD=y
306CONFIG_INITRAMFS_SOURCE=""
307# CONFIG_CDROM_PKTCDVD is not set 429# CONFIG_CDROM_PKTCDVD is not set
308
309#
310# IO Schedulers
311#
312CONFIG_IOSCHED_NOOP=y
313CONFIG_IOSCHED_AS=y
314CONFIG_IOSCHED_DEADLINE=y
315CONFIG_IOSCHED_CFQ=y
316# CONFIG_ATA_OVER_ETH is not set 430# CONFIG_ATA_OVER_ETH is not set
317 431
318# 432#
319# ATA/ATAPI/MFM/RLL support
320#
321CONFIG_IDE=y
322CONFIG_BLK_DEV_IDE=y
323
324#
325# Please see Documentation/ide.txt for help/info on IDE drives
326#
327# CONFIG_BLK_DEV_IDE_SATA is not set
328CONFIG_BLK_DEV_IDEDISK=y
329# CONFIG_IDEDISK_MULTI_MODE is not set
330CONFIG_BLK_DEV_IDECD=y
331CONFIG_BLK_DEV_IDETAPE=m
332CONFIG_BLK_DEV_IDEFLOPPY=m
333# CONFIG_IDE_TASK_IOCTL is not set
334
335#
336# IDE chipset support/bugfixes
337#
338CONFIG_IDE_GENERIC=y
339# CONFIG_IDE_ARM is not set
340CONFIG_BLK_DEV_IDE_BAST=y
341# CONFIG_BLK_DEV_IDEDMA is not set
342# CONFIG_IDEDMA_AUTO is not set
343# CONFIG_BLK_DEV_HD is not set
344
345#
346# SCSI device support 433# SCSI device support
347# 434#
435# CONFIG_RAID_ATTRS is not set
348# CONFIG_SCSI is not set 436# CONFIG_SCSI is not set
437# CONFIG_SCSI_NETLINK is not set
349 438
350# 439#
351# Multi-device support (RAID and LVM) 440# Multi-device support (RAID and LVM)
@@ -355,6 +444,7 @@ CONFIG_BLK_DEV_IDE_BAST=y
355# 444#
356# Fusion MPT device support 445# Fusion MPT device support
357# 446#
447# CONFIG_FUSION is not set
358 448
359# 449#
360# IEEE 1394 (FireWire) support 450# IEEE 1394 (FireWire) support
@@ -365,69 +455,8 @@ CONFIG_BLK_DEV_IDE_BAST=y
365# 455#
366 456
367# 457#
368# Networking support 458# 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
378# CONFIG_NET_KEY is not set
379CONFIG_INET=y
380# CONFIG_IP_MULTICAST is not set
381# CONFIG_IP_ADVANCED_ROUTER is not set
382CONFIG_IP_PNP=y
383# CONFIG_IP_PNP_DHCP is not set
384CONFIG_IP_PNP_BOOTP=y
385# CONFIG_IP_PNP_RARP is not set
386# CONFIG_NET_IPIP is not set
387# CONFIG_NET_IPGRE is not set
388# CONFIG_ARPD is not set
389# CONFIG_SYN_COOKIES is not set
390# CONFIG_INET_AH is not set
391# CONFIG_INET_ESP is not set
392# CONFIG_INET_IPCOMP is not set
393# CONFIG_INET_TUNNEL is not set
394CONFIG_IP_TCPDIAG=y
395# CONFIG_IP_TCPDIAG_IPV6 is not set
396# CONFIG_IPV6 is not set
397# CONFIG_NETFILTER is not set
398
399#
400# SCTP Configuration (EXPERIMENTAL)
401#
402# CONFIG_IP_SCTP is not set
403# CONFIG_ATM is not set
404# CONFIG_BRIDGE is not set
405# CONFIG_VLAN_8021Q is not set
406# CONFIG_DECNET is not set
407# CONFIG_LLC2 is not set
408# CONFIG_IPX is not set
409# CONFIG_ATALK is not set
410# CONFIG_X25 is not set
411# CONFIG_LAPB is not set
412# CONFIG_NET_DIVERT is not set
413# CONFIG_ECONET is not set
414# CONFIG_WAN_ROUTER is not set
415
416#
417# QoS and/or fair queueing
418#
419# CONFIG_NET_SCHED is not set
420# CONFIG_NET_CLS_ROUTE is not set
421
422#
423# Network testing
424# 459#
425# CONFIG_NET_PKTGEN is not set
426# CONFIG_NETPOLL is not set
427# CONFIG_NET_POLL_CONTROLLER is not set
428# CONFIG_HAMRADIO is not set
429# CONFIG_IRDA is not set
430# CONFIG_BT is not set
431CONFIG_NETDEVICES=y 460CONFIG_NETDEVICES=y
432# CONFIG_DUMMY is not set 461# CONFIG_DUMMY is not set
433# CONFIG_BONDING is not set 462# CONFIG_BONDING is not set
@@ -435,11 +464,17 @@ CONFIG_NETDEVICES=y
435# CONFIG_TUN is not set 464# CONFIG_TUN is not set
436 465
437# 466#
467# PHY device support
468#
469# CONFIG_PHYLIB is not set
470
471#
438# Ethernet (10 or 100Mbit) 472# Ethernet (10 or 100Mbit)
439# 473#
440CONFIG_NET_ETHERNET=y 474CONFIG_NET_ETHERNET=y
441# CONFIG_MII is not set 475CONFIG_MII=y
442# CONFIG_SMC91X is not set 476CONFIG_SMC91X=y
477# CONFIG_DM9000 is not set
443 478
444# 479#
445# Ethernet (1000 Mbit) 480# Ethernet (1000 Mbit)
@@ -462,11 +497,12 @@ CONFIG_NET_ETHERNET=y
462# Wan interfaces 497# Wan interfaces
463# 498#
464# CONFIG_WAN is not set 499# CONFIG_WAN is not set
465# CONFIG_PLIP is not set
466# CONFIG_PPP is not set 500# CONFIG_PPP is not set
467# CONFIG_SLIP is not set 501# CONFIG_SLIP is not set
468# CONFIG_SHAPER is not set 502# CONFIG_SHAPER is not set
469# CONFIG_NETCONSOLE is not set 503# CONFIG_NETCONSOLE is not set
504# CONFIG_NETPOLL is not set
505# CONFIG_NET_POLL_CONTROLLER is not set
470 506
471# 507#
472# ISDN subsystem 508# ISDN subsystem
@@ -477,6 +513,7 @@ CONFIG_NET_ETHERNET=y
477# Input device support 513# Input device support
478# 514#
479CONFIG_INPUT=y 515CONFIG_INPUT=y
516# CONFIG_INPUT_FF_MEMLESS is not set
480 517
481# 518#
482# Userland interfaces 519# Userland interfaces
@@ -499,6 +536,7 @@ CONFIG_KEYBOARD_ATKBD=y
499# CONFIG_KEYBOARD_LKKBD is not set 536# CONFIG_KEYBOARD_LKKBD is not set
500# CONFIG_KEYBOARD_XTKBD is not set 537# CONFIG_KEYBOARD_XTKBD is not set
501# CONFIG_KEYBOARD_NEWTON is not set 538# CONFIG_KEYBOARD_NEWTON is not set
539# CONFIG_KEYBOARD_STOWAWAY is not set
502CONFIG_INPUT_MOUSE=y 540CONFIG_INPUT_MOUSE=y
503CONFIG_MOUSE_PS2=y 541CONFIG_MOUSE_PS2=y
504# CONFIG_MOUSE_SERIAL is not set 542# CONFIG_MOUSE_SERIAL is not set
@@ -511,12 +549,11 @@ CONFIG_MOUSE_PS2=y
511# Hardware I/O ports 549# Hardware I/O ports
512# 550#
513CONFIG_SERIO=y 551CONFIG_SERIO=y
514CONFIG_SERIO_SERPORT=y 552# CONFIG_SERIO_SERPORT is not set
515# CONFIG_SERIO_PARKBD is not set 553CONFIG_SERIO_AMBAKMI=y
516CONFIG_SERIO_LIBPS2=y 554CONFIG_SERIO_LIBPS2=y
517# CONFIG_SERIO_RAW is not set 555# CONFIG_SERIO_RAW is not set
518# CONFIG_GAMEPORT is not set 556# CONFIG_GAMEPORT is not set
519CONFIG_SOUND_GAMEPORT=y
520 557
521# 558#
522# Character devices 559# Character devices
@@ -524,49 +561,25 @@ CONFIG_SOUND_GAMEPORT=y
524CONFIG_VT=y 561CONFIG_VT=y
525CONFIG_VT_CONSOLE=y 562CONFIG_VT_CONSOLE=y
526CONFIG_HW_CONSOLE=y 563CONFIG_HW_CONSOLE=y
527CONFIG_SERIAL_NONSTANDARD=y 564# CONFIG_VT_HW_CONSOLE_BINDING is not set
528# CONFIG_COMPUTONE is not set 565# CONFIG_SERIAL_NONSTANDARD is not set
529# CONFIG_ROCKETPORT is not set
530# CONFIG_CYCLADES is not set
531# CONFIG_DIGIEPCA is not set
532# CONFIG_MOXA_INTELLIO is not set
533# CONFIG_MOXA_SMARTIO is not set
534# CONFIG_ISI is not set
535# CONFIG_SYNCLINKMP is not set
536# CONFIG_N_HDLC is not set
537# CONFIG_RISCOM8 is not set
538# CONFIG_SPECIALIX is not set
539# CONFIG_SX is not set
540# CONFIG_RIO is not set
541# CONFIG_STALDRV is not set
542 566
543# 567#
544# Serial drivers 568# Serial drivers
545# 569#
546CONFIG_SERIAL_8250=y 570# CONFIG_SERIAL_8250 is not set
547CONFIG_SERIAL_8250_CONSOLE=y
548CONFIG_SERIAL_8250_NR_UARTS=8
549CONFIG_SERIAL_8250_EXTENDED=y
550CONFIG_SERIAL_8250_MANY_PORTS=y
551CONFIG_SERIAL_8250_SHARE_IRQ=y
552# CONFIG_SERIAL_8250_DETECT_IRQ is not set
553# CONFIG_SERIAL_8250_MULTIPORT is not set
554# CONFIG_SERIAL_8250_RSA is not set
555 571
556# 572#
557# Non-8250 serial port support 573# Non-8250 serial port support
558# 574#
559CONFIG_SERIAL_S3C2410=y 575# CONFIG_SERIAL_AMBA_PL010 is not set
560CONFIG_SERIAL_S3C2410_CONSOLE=y 576CONFIG_SERIAL_AMBA_PL011=y
577CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
561CONFIG_SERIAL_CORE=y 578CONFIG_SERIAL_CORE=y
562CONFIG_SERIAL_CORE_CONSOLE=y 579CONFIG_SERIAL_CORE_CONSOLE=y
563CONFIG_UNIX98_PTYS=y 580CONFIG_UNIX98_PTYS=y
564CONFIG_LEGACY_PTYS=y 581CONFIG_LEGACY_PTYS=y
565CONFIG_LEGACY_PTY_COUNT=256 582CONFIG_LEGACY_PTY_COUNT=16
566CONFIG_PRINTER=y
567# CONFIG_LP_CONSOLE is not set
568CONFIG_PPDEV=y
569# CONFIG_TIPAR is not set
570 583
571# 584#
572# IPMI 585# IPMI
@@ -576,24 +589,15 @@ CONFIG_PPDEV=y
576# 589#
577# Watchdog Cards 590# Watchdog Cards
578# 591#
579CONFIG_WATCHDOG=y 592# CONFIG_WATCHDOG is not set
580# CONFIG_WATCHDOG_NOWAYOUT is not set 593# CONFIG_HW_RANDOM is not set
581
582#
583# Watchdog Device Drivers
584#
585# CONFIG_SOFT_WATCHDOG is not set
586CONFIG_S3C2410_WATCHDOG=y
587# CONFIG_NVRAM is not set 594# CONFIG_NVRAM is not set
588# CONFIG_RTC is not set
589CONFIG_S3C2410_RTC=y
590# CONFIG_DTLK is not set 595# CONFIG_DTLK is not set
591# CONFIG_R3964 is not set 596# CONFIG_R3964 is not set
592 597
593# 598#
594# Ftape, the floppy tape device driver 599# Ftape, the floppy tape device driver
595# 600#
596# CONFIG_DRM is not set
597# CONFIG_RAW_DRIVER is not set 601# CONFIG_RAW_DRIVER is not set
598 602
599# 603#
@@ -604,73 +608,43 @@ CONFIG_S3C2410_RTC=y
604# 608#
605# I2C support 609# I2C support
606# 610#
607CONFIG_I2C=y 611# CONFIG_I2C is not set
608CONFIG_I2C_CHARDEV=m 612
609 613#
610# 614# SPI support
611# I2C Algorithms 615#
612# 616# CONFIG_SPI is not set
613CONFIG_I2C_ALGOBIT=m 617# CONFIG_SPI_MASTER is not set
614# CONFIG_I2C_ALGOPCF is not set 618
615# CONFIG_I2C_ALGOPCA is not set 619#
616 620# Dallas's 1-wire bus
617# 621#
618# I2C Hardware Bus support 622# CONFIG_W1 is not set
619# 623
620# CONFIG_I2C_ISA is not set 624#
621# CONFIG_I2C_PARPORT is not set 625# Hardware Monitoring support
622# CONFIG_I2C_PARPORT_LIGHT is not set 626#
623CONFIG_I2C_S3C2410=y 627# CONFIG_HWMON is not set
624# CONFIG_I2C_STUB is not set 628# CONFIG_HWMON_VID is not set
625# CONFIG_I2C_PCA_ISA is not set
626
627#
628# Hardware Sensors Chip support
629#
630CONFIG_I2C_SENSOR=m
631# CONFIG_SENSORS_ADM1021 is not set
632# CONFIG_SENSORS_ADM1025 is not set
633# CONFIG_SENSORS_ADM1026 is not set
634# CONFIG_SENSORS_ADM1031 is not set
635# CONFIG_SENSORS_ASB100 is not set
636# CONFIG_SENSORS_DS1621 is not set
637# CONFIG_SENSORS_FSCHER is not set
638# CONFIG_SENSORS_FSCPOS is not set
639# CONFIG_SENSORS_GL518SM is not set
640# CONFIG_SENSORS_GL520SM is not set
641# CONFIG_SENSORS_IT87 is not set
642# CONFIG_SENSORS_LM63 is not set
643CONFIG_SENSORS_LM75=m
644# CONFIG_SENSORS_LM77 is not set
645CONFIG_SENSORS_LM78=m
646# CONFIG_SENSORS_LM80 is not set
647# CONFIG_SENSORS_LM83 is not set
648CONFIG_SENSORS_LM85=m
649# CONFIG_SENSORS_LM87 is not set
650# CONFIG_SENSORS_LM90 is not set
651# CONFIG_SENSORS_MAX1619 is not set
652# CONFIG_SENSORS_PC87360 is not set
653# CONFIG_SENSORS_SMSC47B397 is not set
654# CONFIG_SENSORS_SMSC47M1 is not set
655# CONFIG_SENSORS_W83781D is not set
656# CONFIG_SENSORS_W83L785TS is not set
657# CONFIG_SENSORS_W83627HF is not set
658
659#
660# Other I2C Chip support
661#
662CONFIG_SENSORS_EEPROM=m
663# CONFIG_SENSORS_PCF8574 is not set
664# CONFIG_SENSORS_PCF8591 is not set
665# CONFIG_SENSORS_RTC8564 is not set
666# CONFIG_I2C_DEBUG_CORE is not set
667# CONFIG_I2C_DEBUG_ALGO is not set
668# CONFIG_I2C_DEBUG_BUS is not set
669# CONFIG_I2C_DEBUG_CHIP is not set
670 629
671# 630#
672# Misc devices 631# Misc devices
673# 632#
633# CONFIG_SGI_IOC4 is not set
634# CONFIG_TIFM_CORE is not set
635
636#
637# LED devices
638#
639# CONFIG_NEW_LEDS is not set
640
641#
642# LED drivers
643#
644
645#
646# LED Triggers
647#
674 648
675# 649#
676# Multimedia devices 650# Multimedia devices
@@ -685,13 +659,17 @@ CONFIG_SENSORS_EEPROM=m
685# 659#
686# Graphics support 660# Graphics support
687# 661#
662# CONFIG_FIRMWARE_EDID is not set
688CONFIG_FB=y 663CONFIG_FB=y
689# CONFIG_FB_CFB_FILLRECT is not set 664CONFIG_FB_CFB_FILLRECT=y
690# CONFIG_FB_CFB_COPYAREA is not set 665CONFIG_FB_CFB_COPYAREA=y
691# CONFIG_FB_CFB_IMAGEBLIT is not set 666CONFIG_FB_CFB_IMAGEBLIT=y
692# CONFIG_FB_SOFT_CURSOR is not set 667# CONFIG_FB_MACMODES is not set
693CONFIG_FB_MODE_HELPERS=y 668# CONFIG_FB_BACKLIGHT is not set
669# CONFIG_FB_MODE_HELPERS is not set
694# CONFIG_FB_TILEBLITTING is not set 670# CONFIG_FB_TILEBLITTING is not set
671CONFIG_FB_ARMCLCD=y
672# CONFIG_FB_S1D13XXX is not set
695# CONFIG_FB_VIRTUAL is not set 673# CONFIG_FB_VIRTUAL is not set
696 674
697# 675#
@@ -699,27 +677,76 @@ CONFIG_FB_MODE_HELPERS=y
699# 677#
700# CONFIG_VGA_CONSOLE is not set 678# CONFIG_VGA_CONSOLE is not set
701CONFIG_DUMMY_CONSOLE=y 679CONFIG_DUMMY_CONSOLE=y
702# CONFIG_FRAMEBUFFER_CONSOLE is not set 680CONFIG_FRAMEBUFFER_CONSOLE=y
681# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
682# CONFIG_FONTS is not set
683CONFIG_FONT_8x8=y
684CONFIG_FONT_8x16=y
703 685
704# 686#
705# Logo configuration 687# Logo configuration
706# 688#
707# CONFIG_LOGO is not set 689CONFIG_LOGO=y
690# CONFIG_LOGO_LINUX_MONO is not set
691# CONFIG_LOGO_LINUX_VGA16 is not set
692CONFIG_LOGO_LINUX_CLUT224=y
708# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 693# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
709 694
710# 695#
711# Sound 696# Sound
712# 697#
713# CONFIG_SOUND is not set 698CONFIG_SOUND=y
699
700#
701# Advanced Linux Sound Architecture
702#
703CONFIG_SND=y
704CONFIG_SND_TIMER=y
705CONFIG_SND_PCM=y
706# CONFIG_SND_SEQUENCER is not set
707CONFIG_SND_OSSEMUL=y
708CONFIG_SND_MIXER_OSS=y
709CONFIG_SND_PCM_OSS=y
710CONFIG_SND_PCM_OSS_PLUGINS=y
711# CONFIG_SND_DYNAMIC_MINORS is not set
712CONFIG_SND_SUPPORT_OLD_API=y
713CONFIG_SND_VERBOSE_PROCFS=y
714# CONFIG_SND_VERBOSE_PRINTK is not set
715# CONFIG_SND_DEBUG is not set
716
717#
718# Generic devices
719#
720CONFIG_SND_AC97_CODEC=m
721CONFIG_SND_AC97_BUS=m
722# CONFIG_SND_DUMMY is not set
723# CONFIG_SND_MTPAV is not set
724# CONFIG_SND_SERIAL_U16550 is not set
725# CONFIG_SND_MPU401 is not set
726
727#
728# ALSA ARM devices
729#
730CONFIG_SND_ARMAACI=m
731
732#
733# Open Sound System
734#
735# CONFIG_SOUND_PRIME is not set
714 736
715# 737#
716# USB support 738# USB support
717# 739#
718CONFIG_USB_ARCH_HAS_HCD=y 740CONFIG_USB_ARCH_HAS_HCD=y
719# CONFIG_USB_ARCH_HAS_OHCI is not set 741# CONFIG_USB_ARCH_HAS_OHCI is not set
742# CONFIG_USB_ARCH_HAS_EHCI is not set
720# CONFIG_USB is not set 743# CONFIG_USB is not set
721 744
722# 745#
746# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
747#
748
749#
723# USB Gadget Support 750# USB Gadget Support
724# 751#
725# CONFIG_USB_GADGET is not set 752# CONFIG_USB_GADGET is not set
@@ -727,33 +754,62 @@ CONFIG_USB_ARCH_HAS_HCD=y
727# 754#
728# MMC/SD Card support 755# MMC/SD Card support
729# 756#
730# CONFIG_MMC is not set 757CONFIG_MMC=y
758# CONFIG_MMC_DEBUG is not set
759CONFIG_MMC_BLOCK=y
760CONFIG_MMC_ARMMMCI=y
761# CONFIG_MMC_TIFM_SD is not set
762
763#
764# Real Time Clock
765#
766CONFIG_RTC_LIB=y
767CONFIG_RTC_CLASS=y
768CONFIG_RTC_HCTOSYS=y
769CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
770# CONFIG_RTC_DEBUG is not set
771
772#
773# RTC interfaces
774#
775CONFIG_RTC_INTF_SYSFS=y
776CONFIG_RTC_INTF_PROC=y
777CONFIG_RTC_INTF_DEV=y
778CONFIG_RTC_INTF_DEV_UIE_EMUL=y
779
780#
781# RTC drivers
782#
783# CONFIG_RTC_DRV_DS1553 is not set
784# CONFIG_RTC_DRV_DS1742 is not set
785# CONFIG_RTC_DRV_M48T86 is not set
786CONFIG_RTC_DRV_PL031=y
787# CONFIG_RTC_DRV_TEST is not set
788# CONFIG_RTC_DRV_V3020 is not set
731 789
732# 790#
733# File systems 791# File systems
734# 792#
735CONFIG_EXT2_FS=y 793CONFIG_EXT2_FS=y
736# CONFIG_EXT2_FS_XATTR is not set 794# CONFIG_EXT2_FS_XATTR is not set
737CONFIG_EXT3_FS=y 795# CONFIG_EXT2_FS_XIP is not set
738CONFIG_EXT3_FS_XATTR=y 796# CONFIG_EXT3_FS is not set
739# CONFIG_EXT3_FS_POSIX_ACL is not set 797# CONFIG_EXT4DEV_FS is not set
740# CONFIG_EXT3_FS_SECURITY is not set
741CONFIG_JBD=y
742# CONFIG_JBD_DEBUG is not set
743CONFIG_FS_MBCACHE=y
744# CONFIG_REISERFS_FS is not set 798# CONFIG_REISERFS_FS is not set
745# CONFIG_JFS_FS is not set 799# CONFIG_JFS_FS is not set
746 800# CONFIG_FS_POSIX_ACL is not set
747#
748# XFS support
749#
750# CONFIG_XFS_FS is not set 801# CONFIG_XFS_FS is not set
802# CONFIG_GFS2_FS is not set
803# CONFIG_OCFS2_FS is not set
751# CONFIG_MINIX_FS is not set 804# CONFIG_MINIX_FS is not set
752CONFIG_ROMFS_FS=y 805# CONFIG_ROMFS_FS is not set
806CONFIG_INOTIFY=y
807# CONFIG_INOTIFY_USER is not set
753# CONFIG_QUOTA is not set 808# CONFIG_QUOTA is not set
754CONFIG_DNOTIFY=y 809CONFIG_DNOTIFY=y
755# CONFIG_AUTOFS_FS is not set 810# CONFIG_AUTOFS_FS is not set
756# CONFIG_AUTOFS4_FS is not set 811# CONFIG_AUTOFS4_FS is not set
812# CONFIG_FUSE_FS is not set
757 813
758# 814#
759# CD-ROM/DVD Filesystems 815# CD-ROM/DVD Filesystems
@@ -765,7 +821,7 @@ CONFIG_DNOTIFY=y
765# DOS/FAT/NT Filesystems 821# DOS/FAT/NT Filesystems
766# 822#
767CONFIG_FAT_FS=y 823CONFIG_FAT_FS=y
768CONFIG_MSDOS_FS=y 824# CONFIG_MSDOS_FS is not set
769CONFIG_VFAT_FS=y 825CONFIG_VFAT_FS=y
770CONFIG_FAT_DEFAULT_CODEPAGE=437 826CONFIG_FAT_DEFAULT_CODEPAGE=437
771CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 827CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
@@ -775,12 +831,13 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
775# Pseudo filesystems 831# Pseudo filesystems
776# 832#
777CONFIG_PROC_FS=y 833CONFIG_PROC_FS=y
834CONFIG_PROC_SYSCTL=y
778CONFIG_SYSFS=y 835CONFIG_SYSFS=y
779# CONFIG_DEVFS_FS is not set 836CONFIG_TMPFS=y
780# CONFIG_DEVPTS_FS_XATTR is not set 837# CONFIG_TMPFS_POSIX_ACL is not set
781# CONFIG_TMPFS is not set
782# CONFIG_HUGETLB_PAGE is not set 838# CONFIG_HUGETLB_PAGE is not set
783CONFIG_RAMFS=y 839CONFIG_RAMFS=y
840# CONFIG_CONFIGFS_FS is not set
784 841
785# 842#
786# Miscellaneous filesystems 843# Miscellaneous filesystems
@@ -792,18 +849,9 @@ CONFIG_RAMFS=y
792# CONFIG_BEFS_FS is not set 849# CONFIG_BEFS_FS is not set
793# CONFIG_BFS_FS is not set 850# CONFIG_BFS_FS is not set
794# CONFIG_EFS_FS is not set 851# CONFIG_EFS_FS is not set
795CONFIG_JFFS_FS=y 852# CONFIG_JFFS_FS is not set
796CONFIG_JFFS_FS_VERBOSE=0 853# CONFIG_JFFS2_FS is not set
797# CONFIG_JFFS_PROC_FS is not set 854CONFIG_CRAMFS=y
798CONFIG_JFFS2_FS=y
799CONFIG_JFFS2_FS_DEBUG=0
800# CONFIG_JFFS2_FS_NAND is not set
801# CONFIG_JFFS2_FS_NOR_ECC is not set
802# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
803CONFIG_JFFS2_ZLIB=y
804CONFIG_JFFS2_RTIME=y
805# CONFIG_JFFS2_RUBIN is not set
806# CONFIG_CRAMFS is not set
807# CONFIG_VXFS_FS is not set 855# CONFIG_VXFS_FS is not set
808# CONFIG_HPFS_FS is not set 856# CONFIG_HPFS_FS is not set
809# CONFIG_QNX4FS_FS is not set 857# CONFIG_QNX4FS_FS is not set
@@ -814,12 +862,15 @@ CONFIG_JFFS2_RTIME=y
814# Network File Systems 862# Network File Systems
815# 863#
816CONFIG_NFS_FS=y 864CONFIG_NFS_FS=y
817# CONFIG_NFS_V3 is not set 865CONFIG_NFS_V3=y
866# CONFIG_NFS_V3_ACL is not set
818# CONFIG_NFS_V4 is not set 867# CONFIG_NFS_V4 is not set
819# CONFIG_NFS_DIRECTIO is not set 868# CONFIG_NFS_DIRECTIO is not set
820# CONFIG_NFSD is not set 869# CONFIG_NFSD is not set
821CONFIG_ROOT_NFS=y 870CONFIG_ROOT_NFS=y
822CONFIG_LOCKD=y 871CONFIG_LOCKD=y
872CONFIG_LOCKD_V4=y
873CONFIG_NFS_COMMON=y
823CONFIG_SUNRPC=y 874CONFIG_SUNRPC=y
824# CONFIG_RPCSEC_GSS_KRB5 is not set 875# CONFIG_RPCSEC_GSS_KRB5 is not set
825# CONFIG_RPCSEC_GSS_SPKM3 is not set 876# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -828,33 +879,20 @@ CONFIG_SUNRPC=y
828# CONFIG_NCP_FS is not set 879# CONFIG_NCP_FS is not set
829# CONFIG_CODA_FS is not set 880# CONFIG_CODA_FS is not set
830# CONFIG_AFS_FS is not set 881# CONFIG_AFS_FS is not set
882# CONFIG_9P_FS is not set
831 883
832# 884#
833# Partition Types 885# Partition Types
834# 886#
835CONFIG_PARTITION_ADVANCED=y 887# CONFIG_PARTITION_ADVANCED is not set
836# CONFIG_ACORN_PARTITION is not set
837# CONFIG_OSF_PARTITION is not set
838# CONFIG_AMIGA_PARTITION is not set
839# CONFIG_ATARI_PARTITION is not set
840# CONFIG_MAC_PARTITION is not set
841CONFIG_MSDOS_PARTITION=y 888CONFIG_MSDOS_PARTITION=y
842CONFIG_BSD_DISKLABEL=y
843# CONFIG_MINIX_SUBPARTITION is not set
844CONFIG_SOLARIS_X86_PARTITION=y
845# CONFIG_UNIXWARE_DISKLABEL is not set
846# CONFIG_LDM_PARTITION is not set
847# CONFIG_SGI_PARTITION is not set
848# CONFIG_ULTRIX_PARTITION is not set
849# CONFIG_SUN_PARTITION is not set
850# CONFIG_EFI_PARTITION is not set
851 889
852# 890#
853# Native Language Support 891# Native Language Support
854# 892#
855CONFIG_NLS=y 893CONFIG_NLS=y
856CONFIG_NLS_DEFAULT="iso8859-1" 894CONFIG_NLS_DEFAULT="iso8859-1"
857# CONFIG_NLS_CODEPAGE_437 is not set 895CONFIG_NLS_CODEPAGE_437=y
858# CONFIG_NLS_CODEPAGE_737 is not set 896# CONFIG_NLS_CODEPAGE_737 is not set
859# CONFIG_NLS_CODEPAGE_775 is not set 897# CONFIG_NLS_CODEPAGE_775 is not set
860# CONFIG_NLS_CODEPAGE_850 is not set 898# CONFIG_NLS_CODEPAGE_850 is not set
@@ -878,7 +916,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
878# CONFIG_NLS_CODEPAGE_1250 is not set 916# CONFIG_NLS_CODEPAGE_1250 is not set
879# CONFIG_NLS_CODEPAGE_1251 is not set 917# CONFIG_NLS_CODEPAGE_1251 is not set
880# CONFIG_NLS_ASCII is not set 918# CONFIG_NLS_ASCII is not set
881# CONFIG_NLS_ISO8859_1 is not set 919CONFIG_NLS_ISO8859_1=y
882# CONFIG_NLS_ISO8859_2 is not set 920# CONFIG_NLS_ISO8859_2 is not set
883# CONFIG_NLS_ISO8859_3 is not set 921# CONFIG_NLS_ISO8859_3 is not set
884# CONFIG_NLS_ISO8859_4 is not set 922# CONFIG_NLS_ISO8859_4 is not set
@@ -902,25 +940,37 @@ CONFIG_NLS_DEFAULT="iso8859-1"
902# Kernel hacking 940# Kernel hacking
903# 941#
904# CONFIG_PRINTK_TIME is not set 942# CONFIG_PRINTK_TIME is not set
943# CONFIG_ENABLE_MUST_CHECK is not set
944CONFIG_MAGIC_SYSRQ=y
945# CONFIG_UNUSED_SYMBOLS is not set
905CONFIG_DEBUG_KERNEL=y 946CONFIG_DEBUG_KERNEL=y
906# CONFIG_MAGIC_SYSRQ is not set 947CONFIG_LOG_BUF_SHIFT=14
907CONFIG_LOG_BUF_SHIFT=16 948CONFIG_DETECT_SOFTLOCKUP=y
908# CONFIG_SCHEDSTATS is not set 949# CONFIG_SCHEDSTATS is not set
909# CONFIG_DEBUG_SLAB is not set 950# CONFIG_DEBUG_SLAB is not set
910# CONFIG_DEBUG_SPINLOCK is not set 951# CONFIG_DEBUG_RT_MUTEXES is not set
952# CONFIG_RT_MUTEX_TESTER is not set
953CONFIG_DEBUG_SPINLOCK=y
954CONFIG_DEBUG_MUTEXES=y
955CONFIG_DEBUG_RWSEMS=y
911# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 956# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
957# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
912# CONFIG_DEBUG_KOBJECT is not set 958# CONFIG_DEBUG_KOBJECT is not set
913CONFIG_DEBUG_BUGVERBOSE=y 959CONFIG_DEBUG_BUGVERBOSE=y
914CONFIG_DEBUG_INFO=y 960# CONFIG_DEBUG_INFO is not set
915# CONFIG_DEBUG_FS is not set 961# CONFIG_DEBUG_FS is not set
962# CONFIG_DEBUG_VM is not set
963# CONFIG_DEBUG_LIST is not set
916CONFIG_FRAME_POINTER=y 964CONFIG_FRAME_POINTER=y
965# CONFIG_UNWIND_INFO is not set
966CONFIG_FORCED_INLINING=y
967# CONFIG_HEADERS_CHECK is not set
968# CONFIG_RCU_TORTURE_TEST is not set
917CONFIG_DEBUG_USER=y 969CONFIG_DEBUG_USER=y
918# CONFIG_DEBUG_WAITQ is not set 970# CONFIG_DEBUG_WAITQ is not set
919# CONFIG_DEBUG_ERRORS is not set 971CONFIG_DEBUG_ERRORS=y
920CONFIG_DEBUG_LL=y 972CONFIG_DEBUG_LL=y
921# CONFIG_DEBUG_ICEDCC is not set 973# CONFIG_DEBUG_ICEDCC is not set
922CONFIG_DEBUG_S3C2410_PORT=y
923CONFIG_DEBUG_S3C2410_UART=0
924 974
925# 975#
926# Security options 976# Security options
@@ -934,14 +984,11 @@ CONFIG_DEBUG_S3C2410_UART=0
934# CONFIG_CRYPTO is not set 984# CONFIG_CRYPTO is not set
935 985
936# 986#
937# Hardware crypto devices
938#
939
940#
941# Library routines 987# Library routines
942# 988#
943# CONFIG_CRC_CCITT is not set 989# CONFIG_CRC_CCITT is not set
990# CONFIG_CRC16 is not set
944CONFIG_CRC32=y 991CONFIG_CRC32=y
945# CONFIG_LIBCRC32C is not set 992# CONFIG_LIBCRC32C is not set
946CONFIG_ZLIB_INFLATE=y 993CONFIG_ZLIB_INFLATE=y
947CONFIG_ZLIB_DEFLATE=y 994CONFIG_PLIST=y
diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
index a8322264104..c0152393e49 100644
--- a/arch/arm/configs/s3c2410_defconfig
+++ b/arch/arm/configs/s3c2410_defconfig
@@ -1,9 +1,10 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.18 3# Linux kernel version: 2.6.19-rc4
4# Wed Sep 20 20:27:31 2006 4# Fri Nov 3 17:41:31 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7# CONFIG_GENERIC_TIME is not set
7CONFIG_MMU=y 8CONFIG_MMU=y
8CONFIG_GENERIC_HARDIRQS=y 9CONFIG_GENERIC_HARDIRQS=y
9CONFIG_TRACE_IRQFLAGS_SUPPORT=y 10CONFIG_TRACE_IRQFLAGS_SUPPORT=y
@@ -29,17 +30,20 @@ CONFIG_LOCALVERSION=""
29CONFIG_LOCALVERSION_AUTO=y 30CONFIG_LOCALVERSION_AUTO=y
30CONFIG_SWAP=y 31CONFIG_SWAP=y
31CONFIG_SYSVIPC=y 32CONFIG_SYSVIPC=y
33# CONFIG_IPC_NS is not set
32# CONFIG_POSIX_MQUEUE is not set 34# CONFIG_POSIX_MQUEUE is not set
33# CONFIG_BSD_PROCESS_ACCT is not set 35# CONFIG_BSD_PROCESS_ACCT is not set
34# CONFIG_TASKSTATS is not set 36# CONFIG_TASKSTATS is not set
37# CONFIG_UTS_NS is not set
35# CONFIG_AUDIT is not set 38# CONFIG_AUDIT is not set
36# CONFIG_IKCONFIG is not set 39# CONFIG_IKCONFIG is not set
37# CONFIG_RELAY is not set 40# CONFIG_RELAY is not set
38CONFIG_INITRAMFS_SOURCE="" 41CONFIG_INITRAMFS_SOURCE=""
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y 42CONFIG_CC_OPTIMIZE_FOR_SIZE=y
43CONFIG_SYSCTL=y
40# CONFIG_EMBEDDED is not set 44# CONFIG_EMBEDDED is not set
41CONFIG_UID16=y 45CONFIG_UID16=y
42CONFIG_SYSCTL=y 46# CONFIG_SYSCTL_SYSCALL is not set
43CONFIG_KALLSYMS=y 47CONFIG_KALLSYMS=y
44# CONFIG_KALLSYMS_ALL is not set 48# CONFIG_KALLSYMS_ALL is not set
45# CONFIG_KALLSYMS_EXTRA_PASS is not set 49# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -62,7 +66,8 @@ CONFIG_BASE_SMALL=0
62# Loadable module support 66# Loadable module support
63# 67#
64CONFIG_MODULES=y 68CONFIG_MODULES=y
65# CONFIG_MODULE_UNLOAD is not set 69CONFIG_MODULE_UNLOAD=y
70# CONFIG_MODULE_FORCE_UNLOAD is not set
66# CONFIG_MODVERSIONS is not set 71# CONFIG_MODVERSIONS is not set
67# CONFIG_MODULE_SRCVERSION_ALL is not set 72# CONFIG_MODULE_SRCVERSION_ALL is not set
68CONFIG_KMOD=y 73CONFIG_KMOD=y
@@ -70,6 +75,7 @@ CONFIG_KMOD=y
70# 75#
71# Block layer 76# Block layer
72# 77#
78CONFIG_BLOCK=y
73# CONFIG_BLK_DEV_IO_TRACE is not set 79# CONFIG_BLK_DEV_IO_TRACE is not set
74 80
75# 81#
@@ -120,6 +126,7 @@ CONFIG_ARCH_S3C2410=y
120# 126#
121# S3C24XX Implementations 127# S3C24XX Implementations
122# 128#
129# CONFIG_MACH_AML_M5900 is not set
123CONFIG_MACH_ANUBIS=y 130CONFIG_MACH_ANUBIS=y
124CONFIG_MACH_OSIRIS=y 131CONFIG_MACH_OSIRIS=y
125CONFIG_ARCH_BAST=y 132CONFIG_ARCH_BAST=y
@@ -178,6 +185,8 @@ CONFIG_CPU_CACHE_V4WT=y
178CONFIG_CPU_CACHE_VIVT=y 185CONFIG_CPU_CACHE_VIVT=y
179CONFIG_CPU_COPY_V4WB=y 186CONFIG_CPU_COPY_V4WB=y
180CONFIG_CPU_TLB_V4WBI=y 187CONFIG_CPU_TLB_V4WBI=y
188CONFIG_CPU_CP15=y
189CONFIG_CPU_CP15_MMU=y
181 190
182# 191#
183# Processor Features 192# Processor Features
@@ -249,8 +258,9 @@ CONFIG_BINFMT_AOUT=y
249# Power management options 258# Power management options
250# 259#
251CONFIG_PM=y 260CONFIG_PM=y
252CONFIG_PM_LEGACY=y 261# CONFIG_PM_LEGACY is not set
253# CONFIG_PM_DEBUG is not set 262# CONFIG_PM_DEBUG is not set
263# CONFIG_PM_SYSFS_DEPRECATED is not set
254CONFIG_APM=y 264CONFIG_APM=y
255 265
256# 266#
@@ -266,6 +276,7 @@ CONFIG_NET=y
266CONFIG_UNIX=y 276CONFIG_UNIX=y
267CONFIG_XFRM=y 277CONFIG_XFRM=y
268# CONFIG_XFRM_USER is not set 278# CONFIG_XFRM_USER is not set
279# CONFIG_XFRM_SUB_POLICY is not set
269# CONFIG_NET_KEY is not set 280# CONFIG_NET_KEY is not set
270CONFIG_INET=y 281CONFIG_INET=y
271# CONFIG_IP_MULTICAST is not set 282# CONFIG_IP_MULTICAST is not set
@@ -286,10 +297,12 @@ CONFIG_IP_PNP_BOOTP=y
286# CONFIG_INET_TUNNEL is not set 297# CONFIG_INET_TUNNEL is not set
287CONFIG_INET_XFRM_MODE_TRANSPORT=y 298CONFIG_INET_XFRM_MODE_TRANSPORT=y
288CONFIG_INET_XFRM_MODE_TUNNEL=y 299CONFIG_INET_XFRM_MODE_TUNNEL=y
300CONFIG_INET_XFRM_MODE_BEET=y
289CONFIG_INET_DIAG=y 301CONFIG_INET_DIAG=y
290CONFIG_INET_TCP_DIAG=y 302CONFIG_INET_TCP_DIAG=y
291# CONFIG_TCP_CONG_ADVANCED is not set 303# CONFIG_TCP_CONG_ADVANCED is not set
292CONFIG_TCP_CONG_BIC=y 304CONFIG_TCP_CONG_CUBIC=y
305CONFIG_DEFAULT_TCP_CONG="cubic"
293# CONFIG_IPV6 is not set 306# CONFIG_IPV6 is not set
294# CONFIG_INET6_XFRM_TUNNEL is not set 307# CONFIG_INET6_XFRM_TUNNEL is not set
295# CONFIG_INET6_TUNNEL is not set 308# CONFIG_INET6_TUNNEL is not set
@@ -377,6 +390,7 @@ CONFIG_MTD_BLOCK=y
377# CONFIG_NFTL is not set 390# CONFIG_NFTL is not set
378# CONFIG_INFTL is not set 391# CONFIG_INFTL is not set
379# CONFIG_RFD_FTL is not set 392# CONFIG_RFD_FTL is not set
393# CONFIG_SSFDC is not set
380 394
381# 395#
382# RAM/ROM/Flash chip drivers 396# RAM/ROM/Flash chip drivers
@@ -418,6 +432,8 @@ CONFIG_MTD_BAST_MAXSIZE=4
418# 432#
419# Self-contained MTD device drivers 433# Self-contained MTD device drivers
420# 434#
435# CONFIG_MTD_DATAFLASH is not set
436# CONFIG_MTD_M25P80 is not set
421# CONFIG_MTD_SLRAM is not set 437# CONFIG_MTD_SLRAM is not set
422# CONFIG_MTD_PHRAM is not set 438# CONFIG_MTD_PHRAM is not set
423# CONFIG_MTD_MTDRAM is not set 439# CONFIG_MTD_MTDRAM is not set
@@ -512,6 +528,7 @@ CONFIG_BLK_DEV_IDE_BAST=y
512# 528#
513# CONFIG_RAID_ATTRS is not set 529# CONFIG_RAID_ATTRS is not set
514# CONFIG_SCSI is not set 530# CONFIG_SCSI is not set
531# CONFIG_SCSI_NETLINK is not set
515 532
516# 533#
517# Multi-device support (RAID and LVM) 534# Multi-device support (RAID and LVM)
@@ -606,6 +623,7 @@ CONFIG_DM9000=y
606# Input device support 623# Input device support
607# 624#
608CONFIG_INPUT=y 625CONFIG_INPUT=y
626# CONFIG_INPUT_FF_MEMLESS is not set
609 627
610# 628#
611# Userland interfaces 629# Userland interfaces
@@ -628,6 +646,7 @@ CONFIG_KEYBOARD_ATKBD=y
628# CONFIG_KEYBOARD_LKKBD is not set 646# CONFIG_KEYBOARD_LKKBD is not set
629# CONFIG_KEYBOARD_XTKBD is not set 647# CONFIG_KEYBOARD_XTKBD is not set
630# CONFIG_KEYBOARD_NEWTON is not set 648# CONFIG_KEYBOARD_NEWTON is not set
649# CONFIG_KEYBOARD_STOWAWAY is not set
631CONFIG_INPUT_MOUSE=y 650CONFIG_INPUT_MOUSE=y
632CONFIG_MOUSE_PS2=y 651CONFIG_MOUSE_PS2=y
633# CONFIG_MOUSE_SERIAL is not set 652# CONFIG_MOUSE_SERIAL is not set
@@ -734,7 +753,6 @@ CONFIG_S3C2410_WATCHDOG=y
734# CONFIG_USBPCWATCHDOG is not set 753# CONFIG_USBPCWATCHDOG is not set
735CONFIG_HW_RANDOM=y 754CONFIG_HW_RANDOM=y
736# CONFIG_NVRAM is not set 755# CONFIG_NVRAM is not set
737CONFIG_S3C2410_RTC=y
738# CONFIG_DTLK is not set 756# CONFIG_DTLK is not set
739# CONFIG_R3964 is not set 757# CONFIG_R3964 is not set
740 758
@@ -747,7 +765,6 @@ CONFIG_S3C2410_RTC=y
747# TPM devices 765# TPM devices
748# 766#
749# CONFIG_TCG_TPM is not set 767# CONFIG_TCG_TPM is not set
750# CONFIG_TELCLOCK is not set
751 768
752# 769#
753# I2C support 770# I2C support
@@ -792,12 +809,26 @@ CONFIG_SENSORS_EEPROM=m
792# 809#
793# SPI support 810# SPI support
794# 811#
795# CONFIG_SPI is not set 812CONFIG_SPI=y
796# CONFIG_SPI_MASTER is not set 813# CONFIG_SPI_DEBUG is not set
814CONFIG_SPI_MASTER=y
815
816#
817# SPI Master Controller Drivers
818#
819CONFIG_SPI_BITBANG=m
820# CONFIG_SPI_BUTTERFLY is not set
821CONFIG_SPI_S3C24XX_GPIO=m
822CONFIG_SPI_S3C24XX=m
823
824#
825# SPI Protocol Masters
826#
797 827
798# 828#
799# Dallas's 1-wire bus 829# Dallas's 1-wire bus
800# 830#
831# CONFIG_W1 is not set
801 832
802# 833#
803# Hardware Monitoring support 834# Hardware Monitoring support
@@ -820,6 +851,7 @@ CONFIG_HWMON_VID=m
820# CONFIG_SENSORS_GL520SM is not set 851# CONFIG_SENSORS_GL520SM is not set
821# CONFIG_SENSORS_IT87 is not set 852# CONFIG_SENSORS_IT87 is not set
822# CONFIG_SENSORS_LM63 is not set 853# CONFIG_SENSORS_LM63 is not set
854# CONFIG_SENSORS_LM70 is not set
823CONFIG_SENSORS_LM75=m 855CONFIG_SENSORS_LM75=m
824# CONFIG_SENSORS_LM77 is not set 856# CONFIG_SENSORS_LM77 is not set
825CONFIG_SENSORS_LM78=m 857CONFIG_SENSORS_LM78=m
@@ -834,6 +866,7 @@ CONFIG_SENSORS_LM85=m
834# CONFIG_SENSORS_SMSC47M1 is not set 866# CONFIG_SENSORS_SMSC47M1 is not set
835# CONFIG_SENSORS_SMSC47M192 is not set 867# CONFIG_SENSORS_SMSC47M192 is not set
836# CONFIG_SENSORS_SMSC47B397 is not set 868# CONFIG_SENSORS_SMSC47B397 is not set
869# CONFIG_SENSORS_VT1211 is not set
837# CONFIG_SENSORS_W83781D is not set 870# CONFIG_SENSORS_W83781D is not set
838# CONFIG_SENSORS_W83791D is not set 871# CONFIG_SENSORS_W83791D is not set
839# CONFIG_SENSORS_W83792D is not set 872# CONFIG_SENSORS_W83792D is not set
@@ -845,25 +878,31 @@ CONFIG_SENSORS_LM85=m
845# 878#
846# Misc devices 879# Misc devices
847# 880#
881# CONFIG_TIFM_CORE is not set
848 882
849# 883#
850# LED devices 884# LED devices
851# 885#
852# CONFIG_NEW_LEDS is not set 886CONFIG_NEW_LEDS=y
887CONFIG_LEDS_CLASS=m
853 888
854# 889#
855# LED drivers 890# LED drivers
856# 891#
892CONFIG_LEDS_S3C24XX=m
857 893
858# 894#
859# LED Triggers 895# LED Triggers
860# 896#
897CONFIG_LEDS_TRIGGERS=y
898CONFIG_LEDS_TRIGGER_TIMER=m
899# CONFIG_LEDS_TRIGGER_IDE_DISK is not set
900CONFIG_LEDS_TRIGGER_HEARTBEAT=m
861 901
862# 902#
863# Multimedia devices 903# Multimedia devices
864# 904#
865# CONFIG_VIDEO_DEV is not set 905# CONFIG_VIDEO_DEV is not set
866CONFIG_VIDEO_V4L2=y
867 906
868# 907#
869# Digital Video Broadcasting Devices 908# Digital Video Broadcasting Devices
@@ -876,6 +915,7 @@ CONFIG_VIDEO_V4L2=y
876# 915#
877CONFIG_FIRMWARE_EDID=y 916CONFIG_FIRMWARE_EDID=y
878CONFIG_FB=y 917CONFIG_FB=y
918# CONFIG_FB_DDC is not set
879CONFIG_FB_CFB_FILLRECT=y 919CONFIG_FB_CFB_FILLRECT=y
880CONFIG_FB_CFB_COPYAREA=y 920CONFIG_FB_CFB_COPYAREA=y
881CONFIG_FB_CFB_IMAGEBLIT=y 921CONFIG_FB_CFB_IMAGEBLIT=y
@@ -951,7 +991,6 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
951# 991#
952# may also be needed; see USB_STORAGE Help for more information 992# may also be needed; see USB_STORAGE Help for more information
953# 993#
954# CONFIG_USB_STORAGE is not set
955# CONFIG_USB_LIBUSUAL is not set 994# CONFIG_USB_LIBUSUAL is not set
956 995
957# 996#
@@ -1007,6 +1046,7 @@ CONFIG_USB_MON=y
1007# 1046#
1008# CONFIG_USB_EMI62 is not set 1047# CONFIG_USB_EMI62 is not set
1009# CONFIG_USB_EMI26 is not set 1048# CONFIG_USB_EMI26 is not set
1049# CONFIG_USB_ADUTUX is not set
1010# CONFIG_USB_AUERSWALD is not set 1050# CONFIG_USB_AUERSWALD is not set
1011# CONFIG_USB_RIO500 is not set 1051# CONFIG_USB_RIO500 is not set
1012# CONFIG_USB_LEGOTOWER is not set 1052# CONFIG_USB_LEGOTOWER is not set
@@ -1014,11 +1054,12 @@ CONFIG_USB_MON=y
1014# CONFIG_USB_LED is not set 1054# CONFIG_USB_LED is not set
1015# CONFIG_USB_CYPRESS_CY7C63 is not set 1055# CONFIG_USB_CYPRESS_CY7C63 is not set
1016# CONFIG_USB_CYTHERM is not set 1056# CONFIG_USB_CYTHERM is not set
1017# CONFIG_USB_PHIDGETKIT is not set 1057# CONFIG_USB_PHIDGET is not set
1018# CONFIG_USB_PHIDGETSERVO is not set
1019# CONFIG_USB_IDMOUSE is not set 1058# CONFIG_USB_IDMOUSE is not set
1059# CONFIG_USB_FTDI_ELAN is not set
1020# CONFIG_USB_APPLEDISPLAY is not set 1060# CONFIG_USB_APPLEDISPLAY is not set
1021# CONFIG_USB_LD is not set 1061# CONFIG_USB_LD is not set
1062# CONFIG_USB_TRANCEVIBRATOR is not set
1022# CONFIG_USB_TEST is not set 1063# CONFIG_USB_TEST is not set
1023 1064
1024# 1065#
@@ -1039,7 +1080,37 @@ CONFIG_USB_MON=y
1039# Real Time Clock 1080# Real Time Clock
1040# 1081#
1041CONFIG_RTC_LIB=y 1082CONFIG_RTC_LIB=y
1042# CONFIG_RTC_CLASS is not set 1083CONFIG_RTC_CLASS=y
1084CONFIG_RTC_HCTOSYS=y
1085CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1086# CONFIG_RTC_DEBUG is not set
1087
1088#
1089# RTC interfaces
1090#
1091CONFIG_RTC_INTF_SYSFS=y
1092CONFIG_RTC_INTF_PROC=y
1093CONFIG_RTC_INTF_DEV=y
1094# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1095
1096#
1097# RTC drivers
1098#
1099# CONFIG_RTC_DRV_X1205 is not set
1100# CONFIG_RTC_DRV_DS1307 is not set
1101# CONFIG_RTC_DRV_DS1553 is not set
1102# CONFIG_RTC_DRV_ISL1208 is not set
1103# CONFIG_RTC_DRV_DS1672 is not set
1104# CONFIG_RTC_DRV_DS1742 is not set
1105# CONFIG_RTC_DRV_PCF8563 is not set
1106# CONFIG_RTC_DRV_PCF8583 is not set
1107# CONFIG_RTC_DRV_RS5C348 is not set
1108# CONFIG_RTC_DRV_RS5C372 is not set
1109CONFIG_RTC_DRV_S3C=y
1110# CONFIG_RTC_DRV_M48T86 is not set
1111# CONFIG_RTC_DRV_TEST is not set
1112# CONFIG_RTC_DRV_MAX6902 is not set
1113# CONFIG_RTC_DRV_V3020 is not set
1043 1114
1044# 1115#
1045# File systems 1116# File systems
@@ -1051,6 +1122,7 @@ CONFIG_EXT3_FS=y
1051CONFIG_EXT3_FS_XATTR=y 1122CONFIG_EXT3_FS_XATTR=y
1052# CONFIG_EXT3_FS_POSIX_ACL is not set 1123# CONFIG_EXT3_FS_POSIX_ACL is not set
1053# CONFIG_EXT3_FS_SECURITY is not set 1124# CONFIG_EXT3_FS_SECURITY is not set
1125# CONFIG_EXT4DEV_FS is not set
1054CONFIG_JBD=y 1126CONFIG_JBD=y
1055# CONFIG_JBD_DEBUG is not set 1127# CONFIG_JBD_DEBUG is not set
1056CONFIG_FS_MBCACHE=y 1128CONFIG_FS_MBCACHE=y
@@ -1058,6 +1130,7 @@ CONFIG_FS_MBCACHE=y
1058# CONFIG_JFS_FS is not set 1130# CONFIG_JFS_FS is not set
1059# CONFIG_FS_POSIX_ACL is not set 1131# CONFIG_FS_POSIX_ACL is not set
1060# CONFIG_XFS_FS is not set 1132# CONFIG_XFS_FS is not set
1133# CONFIG_GFS2_FS is not set
1061# CONFIG_OCFS2_FS is not set 1134# CONFIG_OCFS2_FS is not set
1062# CONFIG_MINIX_FS is not set 1135# CONFIG_MINIX_FS is not set
1063CONFIG_ROMFS_FS=y 1136CONFIG_ROMFS_FS=y
@@ -1089,6 +1162,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1089# Pseudo filesystems 1162# Pseudo filesystems
1090# 1163#
1091CONFIG_PROC_FS=y 1164CONFIG_PROC_FS=y
1165CONFIG_PROC_SYSCTL=y
1092CONFIG_SYSFS=y 1166CONFIG_SYSFS=y
1093# CONFIG_TMPFS is not set 1167# CONFIG_TMPFS is not set
1094# CONFIG_HUGETLB_PAGE is not set 1168# CONFIG_HUGETLB_PAGE is not set
@@ -1219,6 +1293,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1219# Kernel hacking 1293# Kernel hacking
1220# 1294#
1221# CONFIG_PRINTK_TIME is not set 1295# CONFIG_PRINTK_TIME is not set
1296CONFIG_ENABLE_MUST_CHECK=y
1222CONFIG_MAGIC_SYSRQ=y 1297CONFIG_MAGIC_SYSRQ=y
1223# CONFIG_UNUSED_SYMBOLS is not set 1298# CONFIG_UNUSED_SYMBOLS is not set
1224CONFIG_DEBUG_KERNEL=y 1299CONFIG_DEBUG_KERNEL=y
@@ -1238,9 +1313,10 @@ CONFIG_DEBUG_BUGVERBOSE=y
1238CONFIG_DEBUG_INFO=y 1313CONFIG_DEBUG_INFO=y
1239# CONFIG_DEBUG_FS is not set 1314# CONFIG_DEBUG_FS is not set
1240# CONFIG_DEBUG_VM is not set 1315# CONFIG_DEBUG_VM is not set
1316# CONFIG_DEBUG_LIST is not set
1241CONFIG_FRAME_POINTER=y 1317CONFIG_FRAME_POINTER=y
1242# CONFIG_UNWIND_INFO is not set
1243CONFIG_FORCED_INLINING=y 1318CONFIG_FORCED_INLINING=y
1319# CONFIG_HEADERS_CHECK is not set
1244# CONFIG_RCU_TORTURE_TEST is not set 1320# CONFIG_RCU_TORTURE_TEST is not set
1245CONFIG_DEBUG_USER=y 1321CONFIG_DEBUG_USER=y
1246# CONFIG_DEBUG_WAITQ is not set 1322# CONFIG_DEBUG_WAITQ is not set
@@ -1262,10 +1338,6 @@ CONFIG_DEBUG_S3C2410_UART=0
1262# CONFIG_CRYPTO is not set 1338# CONFIG_CRYPTO is not set
1263 1339
1264# 1340#
1265# Hardware crypto devices
1266#
1267
1268#
1269# Library routines 1341# Library routines
1270# 1342#
1271# CONFIG_CRC_CCITT is not set 1343# CONFIG_CRC_CCITT is not set
diff --git a/arch/arm/configs/simpad_defconfig b/arch/arm/configs/simpad_defconfig
index 2e5a616cc98..140056a3507 100644
--- a/arch/arm/configs/simpad_defconfig
+++ b/arch/arm/configs/simpad_defconfig
@@ -180,6 +180,7 @@ CONFIG_BINFMT_MISC=m
180# Power management options 180# Power management options
181# 181#
182CONFIG_PM=y 182CONFIG_PM=y
183# CONFIG_PM_LEGACY is not set
183CONFIG_APM=y 184CONFIG_APM=y
184 185
185# 186#
diff --git a/arch/arm/configs/smdk2410_defconfig b/arch/arm/configs/smdk2410_defconfig
deleted file mode 100644
index 4d123d33c7d..00000000000
--- a/arch/arm/configs/smdk2410_defconfig
+++ /dev/null
@@ -1,735 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 22:42:40 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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#
52# CONFIG_MODULES is not set
53
54#
55# System Type
56#
57# CONFIG_ARCH_CLPS7500 is not set
58# CONFIG_ARCH_CLPS711X is not set
59# CONFIG_ARCH_CO285 is not set
60# CONFIG_ARCH_EBSA110 is not set
61# CONFIG_ARCH_FOOTBRIDGE is not set
62# CONFIG_ARCH_INTEGRATOR is not set
63# CONFIG_ARCH_IOP3XX is not set
64# CONFIG_ARCH_IXP4XX is not set
65# CONFIG_ARCH_IXP2000 is not set
66# CONFIG_ARCH_L7200 is not set
67# CONFIG_ARCH_PXA is not set
68# CONFIG_ARCH_RPC is not set
69# CONFIG_ARCH_SA1100 is not set
70CONFIG_ARCH_S3C2410=y
71# CONFIG_ARCH_SHARK is not set
72# CONFIG_ARCH_LH7A40X is not set
73# CONFIG_ARCH_OMAP is not set
74# CONFIG_ARCH_VERSATILE is not set
75# CONFIG_ARCH_IMX is not set
76# CONFIG_ARCH_H720X is not set
77
78#
79# S3C24XX Implementations
80#
81# CONFIG_ARCH_BAST is not set
82# CONFIG_ARCH_H1940 is not set
83# CONFIG_MACH_N30 is not set
84CONFIG_ARCH_SMDK2410=y
85# CONFIG_ARCH_S3C2440 is not set
86# CONFIG_MACH_VR1000 is not set
87# CONFIG_MACH_RX3715 is not set
88# CONFIG_MACH_OTOM is not set
89# CONFIG_MACH_NEXCODER_2440 is not set
90CONFIG_CPU_S3C2410=y
91
92#
93# S3C2410 Boot
94#
95
96#
97# S3C2410 Setup
98#
99# CONFIG_S3C2410_DMA is not set
100CONFIG_S3C2410_LOWLEVEL_UART_PORT=0
101
102#
103# Processor Type
104#
105CONFIG_CPU_32=y
106CONFIG_CPU_ARM920T=y
107CONFIG_CPU_32v4=y
108CONFIG_CPU_ABRT_EV4T=y
109CONFIG_CPU_CACHE_V4WT=y
110CONFIG_CPU_CACHE_VIVT=y
111CONFIG_CPU_COPY_V4WB=y
112CONFIG_CPU_TLB_V4WBI=y
113
114#
115# Processor Features
116#
117CONFIG_ARM_THUMB=y
118# CONFIG_CPU_ICACHE_DISABLE is not set
119# CONFIG_CPU_DCACHE_DISABLE is not set
120# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
121
122#
123# Bus support
124#
125
126#
127# PCCARD (PCMCIA/CardBus) support
128#
129# CONFIG_PCCARD is not set
130
131#
132# Kernel Features
133#
134# CONFIG_PREEMPT is not set
135CONFIG_ALIGNMENT_TRAP=y
136
137#
138# Boot options
139#
140CONFIG_ZBOOT_ROM_TEXT=0x0
141CONFIG_ZBOOT_ROM_BSS=0x0
142CONFIG_CMDLINE="root=1f04 mem=32M"
143# CONFIG_XIP_KERNEL is not set
144
145#
146# Floating point emulation
147#
148
149#
150# At least one emulation must be selected
151#
152# CONFIG_FPE_NWFPE is not set
153# CONFIG_FPE_FASTFPE is not set
154
155#
156# Userspace binary formats
157#
158CONFIG_BINFMT_ELF=y
159CONFIG_BINFMT_AOUT=y
160# CONFIG_BINFMT_MISC is not set
161# CONFIG_ARTHUR is not set
162
163#
164# Power management options
165#
166# CONFIG_PM is not set
167
168#
169# Device Drivers
170#
171
172#
173# Generic Driver Options
174#
175CONFIG_STANDALONE=y
176CONFIG_PREVENT_FIRMWARE_BUILD=y
177# CONFIG_FW_LOADER is not set
178# CONFIG_DEBUG_DRIVER is not set
179
180#
181# Memory Technology Devices (MTD)
182#
183CONFIG_MTD=y
184# CONFIG_MTD_DEBUG is not set
185# CONFIG_MTD_CONCAT is not set
186# CONFIG_MTD_PARTITIONS is not set
187
188#
189# User Modules And Translation Layers
190#
191CONFIG_MTD_CHAR=y
192CONFIG_MTD_BLOCK=y
193# CONFIG_FTL is not set
194# CONFIG_NFTL is not set
195# CONFIG_INFTL is not set
196
197#
198# RAM/ROM/Flash chip drivers
199#
200CONFIG_MTD_CFI=y
201# CONFIG_MTD_JEDECPROBE is not set
202CONFIG_MTD_GEN_PROBE=y
203# CONFIG_MTD_CFI_ADV_OPTIONS is not set
204CONFIG_MTD_MAP_BANK_WIDTH_1=y
205CONFIG_MTD_MAP_BANK_WIDTH_2=y
206CONFIG_MTD_MAP_BANK_WIDTH_4=y
207# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
208# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
209# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
210CONFIG_MTD_CFI_I1=y
211CONFIG_MTD_CFI_I2=y
212# CONFIG_MTD_CFI_I4 is not set
213# CONFIG_MTD_CFI_I8 is not set
214CONFIG_MTD_CFI_INTELEXT=y
215# CONFIG_MTD_CFI_AMDSTD is not set
216# CONFIG_MTD_CFI_STAA is not set
217CONFIG_MTD_CFI_UTIL=y
218# CONFIG_MTD_RAM is not set
219# CONFIG_MTD_ROM is not set
220# CONFIG_MTD_ABSENT is not set
221# CONFIG_MTD_XIP is not set
222
223#
224# Mapping drivers for chip access
225#
226# CONFIG_MTD_COMPLEX_MAPPINGS is not set
227# CONFIG_MTD_PHYSMAP is not set
228# CONFIG_MTD_ARM_INTEGRATOR is not set
229# CONFIG_MTD_EDB7312 is not set
230
231#
232# Self-contained MTD device drivers
233#
234# CONFIG_MTD_SLRAM is not set
235# CONFIG_MTD_PHRAM is not set
236# CONFIG_MTD_MTDRAM is not set
237# CONFIG_MTD_BLKMTD is not set
238# CONFIG_MTD_BLOCK2MTD is not set
239
240#
241# Disk-On-Chip Device Drivers
242#
243# CONFIG_MTD_DOC2000 is not set
244# CONFIG_MTD_DOC2001 is not set
245# CONFIG_MTD_DOC2001PLUS is not set
246
247#
248# NAND Flash Device Drivers
249#
250# CONFIG_MTD_NAND is not set
251
252#
253# Parallel port support
254#
255# CONFIG_PARPORT is not set
256
257#
258# Plug and Play support
259#
260
261#
262# Block devices
263#
264# CONFIG_BLK_DEV_FD is not set
265# CONFIG_BLK_DEV_COW_COMMON is not set
266# CONFIG_BLK_DEV_LOOP is not set
267# CONFIG_BLK_DEV_NBD is not set
268CONFIG_BLK_DEV_RAM=y
269CONFIG_BLK_DEV_RAM_COUNT=16
270CONFIG_BLK_DEV_RAM_SIZE=4096
271# CONFIG_BLK_DEV_INITRD is not set
272CONFIG_INITRAMFS_SOURCE=""
273# CONFIG_CDROM_PKTCDVD is not set
274
275#
276# IO Schedulers
277#
278CONFIG_IOSCHED_NOOP=y
279CONFIG_IOSCHED_AS=y
280CONFIG_IOSCHED_DEADLINE=y
281CONFIG_IOSCHED_CFQ=y
282# CONFIG_ATA_OVER_ETH is not set
283
284#
285# ATA/ATAPI/MFM/RLL support
286#
287# CONFIG_IDE is not set
288
289#
290# SCSI device support
291#
292# CONFIG_SCSI is not set
293
294#
295# Multi-device support (RAID and LVM)
296#
297# CONFIG_MD is not set
298
299#
300# Fusion MPT device support
301#
302
303#
304# IEEE 1394 (FireWire) support
305#
306
307#
308# I2O device support
309#
310
311#
312# Networking support
313#
314CONFIG_NET=y
315
316#
317# Networking options
318#
319# CONFIG_PACKET is not set
320# CONFIG_NETLINK_DEV is not set
321CONFIG_UNIX=y
322# CONFIG_NET_KEY is not set
323CONFIG_INET=y
324# CONFIG_IP_MULTICAST is not set
325# CONFIG_IP_ADVANCED_ROUTER is not set
326CONFIG_IP_PNP=y
327# CONFIG_IP_PNP_DHCP is not set
328CONFIG_IP_PNP_BOOTP=y
329# CONFIG_IP_PNP_RARP is not set
330# CONFIG_NET_IPIP is not set
331# CONFIG_NET_IPGRE is not set
332# CONFIG_ARPD is not set
333# CONFIG_SYN_COOKIES is not set
334# CONFIG_INET_AH is not set
335# CONFIG_INET_ESP is not set
336# CONFIG_INET_IPCOMP is not set
337# CONFIG_INET_TUNNEL is not set
338# CONFIG_IP_TCPDIAG is not set
339# CONFIG_IP_TCPDIAG_IPV6 is not set
340# CONFIG_IPV6 is not set
341# CONFIG_NETFILTER is not set
342
343#
344# SCTP Configuration (EXPERIMENTAL)
345#
346# CONFIG_IP_SCTP is not set
347# CONFIG_ATM is not set
348# CONFIG_BRIDGE is not set
349# CONFIG_VLAN_8021Q is not set
350# CONFIG_DECNET is not set
351# CONFIG_LLC2 is not set
352# CONFIG_IPX is not set
353# CONFIG_ATALK is not set
354# CONFIG_X25 is not set
355# CONFIG_LAPB is not set
356# CONFIG_NET_DIVERT is not set
357# CONFIG_ECONET is not set
358# CONFIG_WAN_ROUTER is not set
359
360#
361# QoS and/or fair queueing
362#
363# CONFIG_NET_SCHED is not set
364# CONFIG_NET_CLS_ROUTE is not set
365
366#
367# Network testing
368#
369# CONFIG_NET_PKTGEN is not set
370# CONFIG_NETPOLL is not set
371# CONFIG_NET_POLL_CONTROLLER is not set
372# CONFIG_HAMRADIO is not set
373# CONFIG_IRDA is not set
374# CONFIG_BT is not set
375CONFIG_NETDEVICES=y
376# CONFIG_DUMMY is not set
377# CONFIG_BONDING is not set
378# CONFIG_EQUALIZER is not set
379# CONFIG_TUN is not set
380
381#
382# Ethernet (10 or 100Mbit)
383#
384CONFIG_NET_ETHERNET=y
385# CONFIG_MII is not set
386# CONFIG_SMC91X is not set
387
388#
389# Ethernet (1000 Mbit)
390#
391
392#
393# Ethernet (10000 Mbit)
394#
395
396#
397# Token Ring devices
398#
399
400#
401# Wireless LAN (non-hamradio)
402#
403# CONFIG_NET_RADIO is not set
404
405#
406# Wan interfaces
407#
408# CONFIG_WAN is not set
409# CONFIG_PPP is not set
410# CONFIG_SLIP is not set
411# CONFIG_SHAPER is not set
412# CONFIG_NETCONSOLE is not set
413
414#
415# ISDN subsystem
416#
417# CONFIG_ISDN is not set
418
419#
420# Input device support
421#
422CONFIG_INPUT=y
423
424#
425# Userland interfaces
426#
427CONFIG_INPUT_MOUSEDEV=y
428CONFIG_INPUT_MOUSEDEV_PSAUX=y
429CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
430CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
431# CONFIG_INPUT_JOYDEV is not set
432# CONFIG_INPUT_TSDEV is not set
433# CONFIG_INPUT_EVDEV is not set
434# CONFIG_INPUT_EVBUG is not set
435
436#
437# Input Device Drivers
438#
439CONFIG_INPUT_KEYBOARD=y
440CONFIG_KEYBOARD_ATKBD=y
441# CONFIG_KEYBOARD_SUNKBD is not set
442# CONFIG_KEYBOARD_LKKBD is not set
443# CONFIG_KEYBOARD_XTKBD is not set
444# CONFIG_KEYBOARD_NEWTON is not set
445CONFIG_INPUT_MOUSE=y
446CONFIG_MOUSE_PS2=y
447# CONFIG_MOUSE_SERIAL is not set
448# CONFIG_MOUSE_VSXXXAA is not set
449# CONFIG_INPUT_JOYSTICK is not set
450# CONFIG_INPUT_TOUCHSCREEN is not set
451# CONFIG_INPUT_MISC is not set
452
453#
454# Hardware I/O ports
455#
456CONFIG_SERIO=y
457CONFIG_SERIO_SERPORT=y
458CONFIG_SERIO_LIBPS2=y
459# CONFIG_SERIO_RAW is not set
460# CONFIG_GAMEPORT is not set
461CONFIG_SOUND_GAMEPORT=y
462
463#
464# Character devices
465#
466CONFIG_VT=y
467CONFIG_VT_CONSOLE=y
468CONFIG_HW_CONSOLE=y
469# CONFIG_SERIAL_NONSTANDARD is not set
470
471#
472# Serial drivers
473#
474# CONFIG_SERIAL_8250 is not set
475
476#
477# Non-8250 serial port support
478#
479CONFIG_SERIAL_S3C2410=y
480CONFIG_SERIAL_S3C2410_CONSOLE=y
481CONFIG_SERIAL_CORE=y
482CONFIG_SERIAL_CORE_CONSOLE=y
483CONFIG_UNIX98_PTYS=y
484CONFIG_LEGACY_PTYS=y
485CONFIG_LEGACY_PTY_COUNT=256
486
487#
488# IPMI
489#
490# CONFIG_IPMI_HANDLER is not set
491
492#
493# Watchdog Cards
494#
495# CONFIG_WATCHDOG is not set
496# CONFIG_NVRAM is not set
497# CONFIG_RTC is not set
498# CONFIG_S3C2410_RTC is not set
499# CONFIG_DTLK is not set
500# CONFIG_R3964 is not set
501
502#
503# Ftape, the floppy tape device driver
504#
505# CONFIG_DRM is not set
506# CONFIG_RAW_DRIVER is not set
507
508#
509# TPM devices
510#
511# CONFIG_TCG_TPM is not set
512
513#
514# I2C support
515#
516# CONFIG_I2C is not set
517
518#
519# Misc devices
520#
521
522#
523# Multimedia devices
524#
525# CONFIG_VIDEO_DEV is not set
526
527#
528# Digital Video Broadcasting Devices
529#
530# CONFIG_DVB is not set
531
532#
533# Graphics support
534#
535CONFIG_FB=y
536CONFIG_FB_CFB_FILLRECT=y
537CONFIG_FB_CFB_COPYAREA=y
538CONFIG_FB_CFB_IMAGEBLIT=y
539CONFIG_FB_SOFT_CURSOR=y
540# CONFIG_FB_MODE_HELPERS is not set
541# CONFIG_FB_TILEBLITTING is not set
542CONFIG_FB_VIRTUAL=y
543
544#
545# Console display driver support
546#
547# CONFIG_VGA_CONSOLE is not set
548CONFIG_DUMMY_CONSOLE=y
549CONFIG_FRAMEBUFFER_CONSOLE=y
550# CONFIG_FONTS is not set
551CONFIG_FONT_8x8=y
552CONFIG_FONT_8x16=y
553
554#
555# Logo configuration
556#
557# CONFIG_LOGO is not set
558# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
559
560#
561# Sound
562#
563# CONFIG_SOUND is not set
564
565#
566# USB support
567#
568CONFIG_USB_ARCH_HAS_HCD=y
569# CONFIG_USB_ARCH_HAS_OHCI is not set
570# CONFIG_USB is not set
571
572#
573# USB Gadget Support
574#
575# CONFIG_USB_GADGET is not set
576
577#
578# MMC/SD Card support
579#
580# CONFIG_MMC is not set
581
582#
583# File systems
584#
585CONFIG_EXT2_FS=y
586# CONFIG_EXT2_FS_XATTR is not set
587# CONFIG_EXT3_FS is not set
588# CONFIG_JBD is not set
589# CONFIG_REISERFS_FS is not set
590# CONFIG_JFS_FS is not set
591
592#
593# XFS support
594#
595# CONFIG_XFS_FS is not set
596# CONFIG_MINIX_FS is not set
597CONFIG_ROMFS_FS=y
598# CONFIG_QUOTA is not set
599CONFIG_DNOTIFY=y
600# CONFIG_AUTOFS_FS is not set
601# CONFIG_AUTOFS4_FS is not set
602
603#
604# CD-ROM/DVD Filesystems
605#
606# CONFIG_ISO9660_FS is not set
607# CONFIG_UDF_FS is not set
608
609#
610# DOS/FAT/NT Filesystems
611#
612# CONFIG_MSDOS_FS is not set
613# CONFIG_VFAT_FS is not set
614# CONFIG_NTFS_FS is not set
615
616#
617# Pseudo filesystems
618#
619CONFIG_PROC_FS=y
620CONFIG_SYSFS=y
621# CONFIG_DEVFS_FS is not set
622# CONFIG_DEVPTS_FS_XATTR is not set
623# CONFIG_TMPFS is not set
624# CONFIG_HUGETLB_PAGE is not set
625CONFIG_RAMFS=y
626
627#
628# Miscellaneous filesystems
629#
630# CONFIG_ADFS_FS is not set
631# CONFIG_AFFS_FS is not set
632# CONFIG_HFS_FS is not set
633# CONFIG_HFSPLUS_FS is not set
634# CONFIG_BEFS_FS is not set
635# CONFIG_BFS_FS is not set
636# CONFIG_EFS_FS is not set
637# CONFIG_JFFS_FS is not set
638# CONFIG_JFFS2_FS is not set
639# CONFIG_CRAMFS is not set
640# CONFIG_VXFS_FS is not set
641# CONFIG_HPFS_FS is not set
642# CONFIG_QNX4FS_FS is not set
643# CONFIG_SYSV_FS is not set
644# CONFIG_UFS_FS is not set
645
646#
647# Network File Systems
648#
649CONFIG_NFS_FS=y
650# CONFIG_NFS_V3 is not set
651# CONFIG_NFS_V4 is not set
652# CONFIG_NFS_DIRECTIO is not set
653# CONFIG_NFSD is not set
654CONFIG_ROOT_NFS=y
655CONFIG_LOCKD=y
656CONFIG_SUNRPC=y
657# CONFIG_RPCSEC_GSS_KRB5 is not set
658# CONFIG_RPCSEC_GSS_SPKM3 is not set
659# CONFIG_SMB_FS is not set
660# CONFIG_CIFS is not set
661# CONFIG_NCP_FS is not set
662# CONFIG_CODA_FS is not set
663# CONFIG_AFS_FS is not set
664
665#
666# Partition Types
667#
668CONFIG_PARTITION_ADVANCED=y
669# CONFIG_ACORN_PARTITION is not set
670# CONFIG_OSF_PARTITION is not set
671# CONFIG_AMIGA_PARTITION is not set
672# CONFIG_ATARI_PARTITION is not set
673# CONFIG_MAC_PARTITION is not set
674# CONFIG_MSDOS_PARTITION is not set
675# CONFIG_LDM_PARTITION is not set
676# CONFIG_SGI_PARTITION is not set
677# CONFIG_ULTRIX_PARTITION is not set
678# CONFIG_SUN_PARTITION is not set
679# CONFIG_EFI_PARTITION is not set
680
681#
682# Native Language Support
683#
684# CONFIG_NLS is not set
685
686#
687# Profiling support
688#
689# CONFIG_PROFILING is not set
690
691#
692# Kernel hacking
693#
694# CONFIG_PRINTK_TIME is not set
695CONFIG_DEBUG_KERNEL=y
696# CONFIG_MAGIC_SYSRQ is not set
697CONFIG_LOG_BUF_SHIFT=14
698# CONFIG_SCHEDSTATS is not set
699# CONFIG_DEBUG_SLAB is not set
700# CONFIG_DEBUG_SPINLOCK is not set
701# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
702# CONFIG_DEBUG_KOBJECT is not set
703CONFIG_DEBUG_BUGVERBOSE=y
704# CONFIG_DEBUG_INFO is not set
705# CONFIG_DEBUG_FS is not set
706CONFIG_FRAME_POINTER=y
707CONFIG_DEBUG_USER=y
708# CONFIG_DEBUG_WAITQ is not set
709# CONFIG_DEBUG_ERRORS is not set
710CONFIG_DEBUG_LL=y
711# CONFIG_DEBUG_ICEDCC is not set
712CONFIG_DEBUG_S3C2410_PORT=y
713CONFIG_DEBUG_S3C2410_UART=0
714
715#
716# Security options
717#
718# CONFIG_KEYS is not set
719# CONFIG_SECURITY is not set
720
721#
722# Cryptographic options
723#
724# CONFIG_CRYPTO is not set
725
726#
727# Hardware crypto devices
728#
729
730#
731# Library routines
732#
733# CONFIG_CRC_CCITT is not set
734CONFIG_CRC32=y
735CONFIG_LIBCRC32C=y
diff --git a/arch/arm/configs/spitz_defconfig b/arch/arm/configs/spitz_defconfig
index d1ace3abfd8..bd03238968c 100644
--- a/arch/arm/configs/spitz_defconfig
+++ b/arch/arm/configs/spitz_defconfig
@@ -207,6 +207,7 @@ CONFIG_BINFMT_MISC=m
207# Power management options 207# Power management options
208# 208#
209CONFIG_PM=y 209CONFIG_PM=y
210# CONFIG_PM_LEGACY is not set
210CONFIG_APM=y 211CONFIG_APM=y
211 212
212# 213#
diff --git a/arch/arm/configs/versatile_defconfig b/arch/arm/configs/versatile_defconfig
index 96b7a776242..f7bf6ef27d1 100644
--- a/arch/arm/configs/versatile_defconfig
+++ b/arch/arm/configs/versatile_defconfig
@@ -200,7 +200,7 @@ CONFIG_BINFMT_ELF=y
200# Power management options 200# Power management options
201# 201#
202CONFIG_PM=y 202CONFIG_PM=y
203CONFIG_PM_LEGACY=y 203# CONFIG_PM_LEGACY is not set
204# CONFIG_PM_DEBUG is not set 204# CONFIG_PM_DEBUG is not set
205# CONFIG_APM is not set 205# CONFIG_APM is not set
206 206
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 6bbd93dd186..29efc9f8205 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -357,6 +357,9 @@ static void __init setup_processor(void)
357#ifndef CONFIG_VFP 357#ifndef CONFIG_VFP
358 elf_hwcap &= ~HWCAP_VFP; 358 elf_hwcap &= ~HWCAP_VFP;
359#endif 359#endif
360#ifndef CONFIG_IWMMXT
361 elf_hwcap &= ~HWCAP_IWMMXT;
362#endif
360 363
361 cpu_proc_init(); 364 cpu_proc_init();
362} 365}
@@ -854,6 +857,7 @@ static const char *hwcap_str[] = {
854 "vfp", 857 "vfp",
855 "edsp", 858 "edsp",
856 "java", 859 "java",
860 "iwmmxt",
857 NULL 861 NULL
858}; 862};
859 863
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 421329f5e18..070bcb7a630 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -7,6 +7,7 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/module.h>
10#include <linux/delay.h> 11#include <linux/delay.h>
11#include <linux/init.h> 12#include <linux/init.h>
12#include <linux/spinlock.h> 13#include <linux/spinlock.h>
@@ -19,6 +20,7 @@
19#include <linux/cpu.h> 20#include <linux/cpu.h>
20#include <linux/smp.h> 21#include <linux/smp.h>
21#include <linux/seq_file.h> 22#include <linux/seq_file.h>
23#include <linux/irq.h>
22 24
23#include <asm/atomic.h> 25#include <asm/atomic.h>
24#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
@@ -449,6 +451,7 @@ int smp_call_function(void (*func)(void *info), void *info, int retry,
449 return smp_call_function_on_cpu(func, info, retry, wait, 451 return smp_call_function_on_cpu(func, info, retry, wait,
450 cpu_online_map); 452 cpu_online_map);
451} 453}
454EXPORT_SYMBOL_GPL(smp_call_function);
452 455
453void show_ipi_list(struct seq_file *p) 456void show_ipi_list(struct seq_file *p)
454{ 457{
@@ -474,25 +477,26 @@ void show_local_irqs(struct seq_file *p)
474 seq_putc(p, '\n'); 477 seq_putc(p, '\n');
475} 478}
476 479
477static void ipi_timer(struct pt_regs *regs) 480static void ipi_timer(void)
478{ 481{
479 int user = user_mode(regs);
480
481 irq_enter(); 482 irq_enter();
482 profile_tick(CPU_PROFILING, regs); 483 profile_tick(CPU_PROFILING);
483 update_process_times(user); 484 update_process_times(user_mode(get_irq_regs()));
484 irq_exit(); 485 irq_exit();
485} 486}
486 487
487#ifdef CONFIG_LOCAL_TIMERS 488#ifdef CONFIG_LOCAL_TIMERS
488asmlinkage void do_local_timer(struct pt_regs *regs) 489asmlinkage void do_local_timer(struct pt_regs *regs)
489{ 490{
491 struct pt_regs *old_regs = set_irq_regs(regs);
490 int cpu = smp_processor_id(); 492 int cpu = smp_processor_id();
491 493
492 if (local_timer_ack()) { 494 if (local_timer_ack()) {
493 irq_stat[cpu].local_timer_irqs++; 495 irq_stat[cpu].local_timer_irqs++;
494 ipi_timer(regs); 496 ipi_timer();
495 } 497 }
498
499 set_irq_regs(old_regs);
496} 500}
497#endif 501#endif
498 502
@@ -551,6 +555,7 @@ asmlinkage void do_IPI(struct pt_regs *regs)
551{ 555{
552 unsigned int cpu = smp_processor_id(); 556 unsigned int cpu = smp_processor_id();
553 struct ipi_data *ipi = &per_cpu(ipi_data, cpu); 557 struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
558 struct pt_regs *old_regs = set_irq_regs(regs);
554 559
555 ipi->ipi_count++; 560 ipi->ipi_count++;
556 561
@@ -574,7 +579,7 @@ asmlinkage void do_IPI(struct pt_regs *regs)
574 579
575 switch (nextmsg) { 580 switch (nextmsg) {
576 case IPI_TIMER: 581 case IPI_TIMER:
577 ipi_timer(regs); 582 ipi_timer();
578 break; 583 break;
579 584
580 case IPI_RESCHEDULE: 585 case IPI_RESCHEDULE:
@@ -599,6 +604,8 @@ asmlinkage void do_IPI(struct pt_regs *regs)
599 } 604 }
600 } while (msgs); 605 } while (msgs);
601 } 606 }
607
608 set_irq_regs(old_regs);
602} 609}
603 610
604void smp_send_reschedule(int cpu) 611void smp_send_reschedule(int cpu)
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index c03cab5c4c7..6ff5e3ff6cb 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -220,10 +220,10 @@ EXPORT_SYMBOL(leds_event);
220#ifdef CONFIG_LEDS_TIMER 220#ifdef CONFIG_LEDS_TIMER
221static inline void do_leds(void) 221static inline void do_leds(void)
222{ 222{
223 static unsigned int count = 50; 223 static unsigned int count = HZ/2;
224 224
225 if (--count == 0) { 225 if (--count == 0) {
226 count = 50; 226 count = HZ/2;
227 leds_event(led_timer); 227 leds_event(led_timer);
228 } 228 }
229} 229}
@@ -327,13 +327,12 @@ EXPORT_SYMBOL(restore_time_delta);
327 */ 327 */
328void timer_tick(void) 328void timer_tick(void)
329{ 329{
330 struct pt_regs *regs = get_irq_regs();
331 profile_tick(CPU_PROFILING); 330 profile_tick(CPU_PROFILING);
332 do_leds(); 331 do_leds();
333 do_set_rtc(); 332 do_set_rtc();
334 do_timer(1); 333 do_timer(1);
335#ifndef CONFIG_SMP 334#ifndef CONFIG_SMP
336 update_process_times(user_mode(regs)); 335 update_process_times(user_mode(get_irq_regs()));
337#endif 336#endif
338} 337}
339 338
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 3ca574ee277..a8fa75ea07a 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -45,13 +45,7 @@ SECTIONS
45 *(.early_param.init) 45 *(.early_param.init)
46 __early_end = .; 46 __early_end = .;
47 __initcall_start = .; 47 __initcall_start = .;
48 *(.initcall1.init) 48 INITCALLS
49 *(.initcall2.init)
50 *(.initcall3.init)
51 *(.initcall4.init)
52 *(.initcall5.init)
53 *(.initcall6.init)
54 *(.initcall7.init)
55 __initcall_end = .; 49 __initcall_end = .;
56 __con_initcall_start = .; 50 __con_initcall_start = .;
57 *(.con_initcall.init) 51 *(.con_initcall.init)
diff --git a/arch/arm/mach-ebsa110/io.c b/arch/arm/mach-ebsa110/io.c
index c648bfb676a..db38afb2aa8 100644
--- a/arch/arm/mach-ebsa110/io.c
+++ b/arch/arm/mach-ebsa110/io.c
@@ -28,7 +28,7 @@
28#include <asm/io.h> 28#include <asm/io.h>
29#include <asm/page.h> 29#include <asm/page.h>
30 30
31static void __iomem *__isamem_convert_addr(void __iomem *addr) 31static void __iomem *__isamem_convert_addr(const volatile void __iomem *addr)
32{ 32{
33 u32 ret, a = (u32 __force) addr; 33 u32 ret, a = (u32 __force) addr;
34 34
@@ -63,7 +63,7 @@ static void __iomem *__isamem_convert_addr(void __iomem *addr)
63/* 63/*
64 * read[bwl] and write[bwl] 64 * read[bwl] and write[bwl]
65 */ 65 */
66u8 __readb(void __iomem *addr) 66u8 __readb(const volatile void __iomem *addr)
67{ 67{
68 void __iomem *a = __isamem_convert_addr(addr); 68 void __iomem *a = __isamem_convert_addr(addr);
69 u32 ret; 69 u32 ret;
@@ -75,7 +75,7 @@ u8 __readb(void __iomem *addr)
75 return ret; 75 return ret;
76} 76}
77 77
78u16 __readw(void __iomem *addr) 78u16 __readw(const volatile void __iomem *addr)
79{ 79{
80 void __iomem *a = __isamem_convert_addr(addr); 80 void __iomem *a = __isamem_convert_addr(addr);
81 81
@@ -85,7 +85,7 @@ u16 __readw(void __iomem *addr)
85 return __raw_readw(a); 85 return __raw_readw(a);
86} 86}
87 87
88u32 __readl(void __iomem *addr) 88u32 __readl(const volatile void __iomem *addr)
89{ 89{
90 void __iomem *a = __isamem_convert_addr(addr); 90 void __iomem *a = __isamem_convert_addr(addr);
91 u32 ret; 91 u32 ret;
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
index fa5d4976f51..1463330ed8e 100644
--- a/arch/arm/mach-footbridge/dc21285.c
+++ b/arch/arm/mach-footbridge/dc21285.c
@@ -16,6 +16,7 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/ioport.h> 18#include <linux/ioport.h>
19#include <linux/irq.h>
19 20
20#include <asm/io.h> 21#include <asm/io.h>
21#include <asm/irq.h> 22#include <asm/irq.h>
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c
index a2c94a47b2b..2499a7707e3 100644
--- a/arch/arm/mach-iop32x/n2100.c
+++ b/arch/arm/mach-iop32x/n2100.c
@@ -85,7 +85,7 @@ n2100_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
85 irq = IRQ_IOP32X_XINT0; 85 irq = IRQ_IOP32X_XINT0;
86 } else if (PCI_SLOT(dev->devfn) == 2) { 86 } else if (PCI_SLOT(dev->devfn) == 2) {
87 /* RTL8110SB #2 */ 87 /* RTL8110SB #2 */
88 irq = IRQ_IOP32X_XINT1; 88 irq = IRQ_IOP32X_XINT3;
89 } else if (PCI_SLOT(dev->devfn) == 3) { 89 } else if (PCI_SLOT(dev->devfn) == 3) {
90 /* Sil3512 */ 90 /* Sil3512 */
91 irq = IRQ_IOP32X_XINT2; 91 irq = IRQ_IOP32X_XINT2;
diff --git a/arch/arm/mach-ixp2000/ixdp2400.c b/arch/arm/mach-ixp2000/ixdp2400.c
index a6f14801872..0fdd03ab36e 100644
--- a/arch/arm/mach-ixp2000/ixdp2400.c
+++ b/arch/arm/mach-ixp2000/ixdp2400.c
@@ -133,11 +133,13 @@ static void ixdp2400_pci_postinit(void)
133 struct pci_dev *dev; 133 struct pci_dev *dev;
134 134
135 if (ixdp2x00_master_npu()) { 135 if (ixdp2x00_master_npu()) {
136 dev = pci_find_slot(1, IXDP2400_SLAVE_ENET_DEVFN); 136 dev = pci_get_bus_and_slot(1, IXDP2400_SLAVE_ENET_DEVFN);
137 pci_remove_bus_device(dev); 137 pci_remove_bus_device(dev);
138 pci_dev_put(dev);
138 } else { 139 } else {
139 dev = pci_find_slot(1, IXDP2400_MASTER_ENET_DEVFN); 140 dev = pci_get_bus_and_slot(1, IXDP2400_MASTER_ENET_DEVFN);
140 pci_remove_bus_device(dev); 141 pci_remove_bus_device(dev);
142 pci_dev_put(dev);
141 143
142 ixdp2x00_slave_pci_postinit(); 144 ixdp2x00_slave_pci_postinit();
143 } 145 }
diff --git a/arch/arm/mach-ixp2000/ixdp2800.c b/arch/arm/mach-ixp2000/ixdp2800.c
index 91d36d91dac..70d247f09a7 100644
--- a/arch/arm/mach-ixp2000/ixdp2800.c
+++ b/arch/arm/mach-ixp2000/ixdp2800.c
@@ -261,14 +261,16 @@ int __init ixdp2800_pci_init(void)
261 261
262 pci_common_init(&ixdp2800_pci); 262 pci_common_init(&ixdp2800_pci);
263 if (ixdp2x00_master_npu()) { 263 if (ixdp2x00_master_npu()) {
264 dev = pci_find_slot(1, IXDP2800_SLAVE_ENET_DEVFN); 264 dev = pci_get_bus_and_slot(1, IXDP2800_SLAVE_ENET_DEVFN);
265 pci_remove_bus_device(dev); 265 pci_remove_bus_device(dev);
266 pci_dev_put(dev);
266 267
267 ixdp2800_master_enable_slave(); 268 ixdp2800_master_enable_slave();
268 ixdp2800_master_wait_for_slave_bus_scan(); 269 ixdp2800_master_wait_for_slave_bus_scan();
269 } else { 270 } else {
270 dev = pci_find_slot(1, IXDP2800_MASTER_ENET_DEVFN); 271 dev = pci_get_bus_and_slot(1, IXDP2800_MASTER_ENET_DEVFN);
271 pci_remove_bus_device(dev); 272 pci_remove_bus_device(dev);
273 pci_dev_put(dev);
272 } 274 }
273 } 275 }
274 276
diff --git a/arch/arm/mach-ixp2000/ixdp2x00.c b/arch/arm/mach-ixp2000/ixdp2x00.c
index af48cb52dfc..aa2655092d2 100644
--- a/arch/arm/mach-ixp2000/ixdp2x00.c
+++ b/arch/arm/mach-ixp2000/ixdp2x00.c
@@ -241,11 +241,14 @@ void ixdp2x00_slave_pci_postinit(void)
241 /* 241 /*
242 * Remove PMC device is there is one 242 * Remove PMC device is there is one
243 */ 243 */
244 if((dev = pci_find_slot(1, IXDP2X00_PMC_DEVFN))) 244 if((dev = pci_get_bus_and_slot(1, IXDP2X00_PMC_DEVFN))) {
245 pci_remove_bus_device(dev); 245 pci_remove_bus_device(dev);
246 pci_dev_put(dev);
247 }
246 248
247 dev = pci_find_slot(0, IXDP2X00_21555_DEVFN); 249 dev = pci_get_bus_and_slot(0, IXDP2X00_21555_DEVFN);
248 pci_remove_bus_device(dev); 250 pci_remove_bus_device(dev);
251 pci_dev_put(dev);
249} 252}
250 253
251/************************************************************************** 254/**************************************************************************
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
index 57f23b46539..e316bd93313 100644
--- a/arch/arm/mach-ixp4xx/Kconfig
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -133,7 +133,7 @@ config IXP4XX_INDIRECT_PCI
133 into the kernel and we can use the standard read[bwl]/write[bwl] 133 into the kernel and we can use the standard read[bwl]/write[bwl]
134 macros. This is the preferred method due to speed but it 134 macros. This is the preferred method due to speed but it
135 limits the system to just 64MB of PCI memory. This can be 135 limits the system to just 64MB of PCI memory. This can be
136 problamatic if using video cards and other memory-heavy devices. 136 problematic if using video cards and other memory-heavy devices.
137 137
138 2) If > 64MB of memory space is required, the IXP4xx can be 138 2) If > 64MB of memory space is required, the IXP4xx can be
139 configured to use indirect registers to access PCI This allows 139 configured to use indirect registers to access PCI This allows
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index c7513f6eb50..fbe288a8da6 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -86,7 +86,8 @@ enum ixp4xx_irq_type {
86 IXP4XX_IRQ_LEVEL, IXP4XX_IRQ_EDGE 86 IXP4XX_IRQ_LEVEL, IXP4XX_IRQ_EDGE
87}; 87};
88 88
89static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type); 89/* Each bit represents an IRQ: 1: edge-triggered, 0: level triggered */
90static unsigned long long ixp4xx_irq_edge = 0;
90 91
91/* 92/*
92 * IRQ -> GPIO mapping table 93 * IRQ -> GPIO mapping table
@@ -135,7 +136,11 @@ static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type)
135 default: 136 default:
136 return -EINVAL; 137 return -EINVAL;
137 } 138 }
138 ixp4xx_config_irq(irq, irq_type); 139
140 if (irq_type == IXP4XX_IRQ_EDGE)
141 ixp4xx_irq_edge |= (1 << irq);
142 else
143 ixp4xx_irq_edge &= ~(1 << irq);
139 144
140 if (line >= 8) { /* pins 8-15 */ 145 if (line >= 8) { /* pins 8-15 */
141 line -= 8; 146 line -= 8;
@@ -167,14 +172,6 @@ static void ixp4xx_irq_mask(unsigned int irq)
167 *IXP4XX_ICMR &= ~(1 << irq); 172 *IXP4XX_ICMR &= ~(1 << irq);
168} 173}
169 174
170static void ixp4xx_irq_unmask(unsigned int irq)
171{
172 if (cpu_is_ixp46x() && irq >= 32)
173 *IXP4XX_ICMR2 |= (1 << (irq - 32));
174 else
175 *IXP4XX_ICMR |= (1 << irq);
176}
177
178static void ixp4xx_irq_ack(unsigned int irq) 175static void ixp4xx_irq_ack(unsigned int irq)
179{ 176{
180 int line = (irq < 32) ? irq2gpio[irq] : -1; 177 int line = (irq < 32) ? irq2gpio[irq] : -1;
@@ -187,41 +184,25 @@ static void ixp4xx_irq_ack(unsigned int irq)
187 * Level triggered interrupts on GPIO lines can only be cleared when the 184 * Level triggered interrupts on GPIO lines can only be cleared when the
188 * interrupt condition disappears. 185 * interrupt condition disappears.
189 */ 186 */
190static void ixp4xx_irq_level_unmask(unsigned int irq) 187static void ixp4xx_irq_unmask(unsigned int irq)
191{ 188{
192 ixp4xx_irq_ack(irq); 189 if (!(ixp4xx_irq_edge & (1 << irq)))
193 ixp4xx_irq_unmask(irq); 190 ixp4xx_irq_ack(irq);
194}
195 191
196static struct irqchip ixp4xx_irq_level_chip = { 192 if (cpu_is_ixp46x() && irq >= 32)
197 .ack = ixp4xx_irq_mask, 193 *IXP4XX_ICMR2 |= (1 << (irq - 32));
198 .mask = ixp4xx_irq_mask, 194 else
199 .unmask = ixp4xx_irq_level_unmask, 195 *IXP4XX_ICMR |= (1 << irq);
200 .set_type = ixp4xx_set_irq_type, 196}
201};
202 197
203static struct irqchip ixp4xx_irq_edge_chip = { 198static struct irqchip ixp4xx_irq_chip = {
199 .name = "IXP4xx",
204 .ack = ixp4xx_irq_ack, 200 .ack = ixp4xx_irq_ack,
205 .mask = ixp4xx_irq_mask, 201 .mask = ixp4xx_irq_mask,
206 .unmask = ixp4xx_irq_unmask, 202 .unmask = ixp4xx_irq_unmask,
207 .set_type = ixp4xx_set_irq_type, 203 .set_type = ixp4xx_set_irq_type,
208}; 204};
209 205
210static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type)
211{
212 switch (type) {
213 case IXP4XX_IRQ_LEVEL:
214 set_irq_chip(irq, &ixp4xx_irq_level_chip);
215 set_irq_handler(irq, do_level_IRQ);
216 break;
217 case IXP4XX_IRQ_EDGE:
218 set_irq_chip(irq, &ixp4xx_irq_edge_chip);
219 set_irq_handler(irq, do_edge_IRQ);
220 break;
221 }
222 set_irq_flags(irq, IRQF_VALID);
223}
224
225void __init ixp4xx_init_irq(void) 206void __init ixp4xx_init_irq(void)
226{ 207{
227 int i = 0; 208 int i = 0;
@@ -241,8 +222,11 @@ void __init ixp4xx_init_irq(void)
241 } 222 }
242 223
243 /* Default to all level triggered */ 224 /* Default to all level triggered */
244 for(i = 0; i < NR_IRQS; i++) 225 for(i = 0; i < NR_IRQS; i++) {
245 ixp4xx_config_irq(i, IXP4XX_IRQ_LEVEL); 226 set_irq_chip(i, &ixp4xx_irq_chip);
227 set_irq_handler(i, do_level_IRQ);
228 set_irq_flags(i, IRQF_VALID);
229 }
246} 230}
247 231
248 232
diff --git a/arch/arm/mach-lh7a40x/Kconfig b/arch/arm/mach-lh7a40x/Kconfig
index 558a34f53b1..6f4c6a1798c 100644
--- a/arch/arm/mach-lh7a40x/Kconfig
+++ b/arch/arm/mach-lh7a40x/Kconfig
@@ -8,13 +8,13 @@ config MACH_KEV7A400
8 help 8 help
9 Say Y here if you are using the Sharp KEV7A400 development 9 Say Y here if you are using the Sharp KEV7A400 development
10 board. This hardware is discontinued, so I'd be very 10 board. This hardware is discontinued, so I'd be very
11 suprised if you wanted this option. 11 surprised if you wanted this option.
12 12
13config MACH_LPD7A400 13config MACH_LPD7A400
14 bool "LPD7A400 Card Engine" 14 bool "LPD7A400 Card Engine"
15 select ARCH_LH7A400 15 select ARCH_LH7A400
16# select IDE_POLL 16# select IDE_POLL
17 select HAS_TOUCHSCREEN_ADS7843_LH7 17# select HAS_TOUCHSCREEN_ADS7843_LH7
18 help 18 help
19 Say Y here if you are using Logic Product Development's 19 Say Y here if you are using Logic Product Development's
20 LPD7A400 CardEngine. For the time being, the LPD7A400 and 20 LPD7A400 CardEngine. For the time being, the LPD7A400 and
@@ -24,7 +24,7 @@ config MACH_LPD7A404
24 bool "LPD7A404 Card Engine" 24 bool "LPD7A404 Card Engine"
25 select ARCH_LH7A404 25 select ARCH_LH7A404
26# select IDE_POLL 26# select IDE_POLL
27 select HAS_TOUCHSCREEN_ADC_LH7 27# select HAS_TOUCHSCREEN_ADC_LH7
28 help 28 help
29 Say Y here if you are using Logic Product Development's 29 Say Y here if you are using Logic Product Development's
30 LPD7A404 CardEngine. For the time being, the LPD7A400 and 30 LPD7A404 CardEngine. For the time being, the LPD7A400 and
diff --git a/arch/arm/mach-lh7a40x/common.h b/arch/arm/mach-lh7a40x/common.h
index 18e8bb4eb20..0ca20c6c83b 100644
--- a/arch/arm/mach-lh7a40x/common.h
+++ b/arch/arm/mach-lh7a40x/common.h
@@ -15,4 +15,4 @@ extern void lh7a404_init_irq (void);
15extern void lh7a40x_clcd_init (void); 15extern void lh7a40x_clcd_init (void);
16extern void lh7a40x_init_board_irq (void); 16extern void lh7a40x_init_board_irq (void);
17 17
18#define IRQ_DISPATCH(irq) desc_handle_irq((irq),(irq_desc + irq), regs) 18#define IRQ_DISPATCH(irq) desc_handle_irq((irq),(irq_desc + irq))
diff --git a/arch/arm/mach-pnx4008/core.c b/arch/arm/mach-pnx4008/core.c
index 3d73c1e9375..429c796938b 100644
--- a/arch/arm/mach-pnx4008/core.c
+++ b/arch/arm/mach-pnx4008/core.c
@@ -133,10 +133,79 @@ static struct platform_device serial_device = {
133 }, 133 },
134}; 134};
135 135
136static struct platform_device nand_flash_device = {
137 .name = "pnx4008-flash",
138 .id = -1,
139 .dev = {
140 .coherent_dma_mask = 0xFFFFFFFF,
141 },
142};
143
144/* The dmamask must be set for OHCI to work */
145static u64 ohci_dmamask = ~(u32) 0;
146
147static struct resource ohci_resources[] = {
148 {
149 .start = IO_ADDRESS(PNX4008_USB_CONFIG_BASE),
150 .end = IO_ADDRESS(PNX4008_USB_CONFIG_BASE + 0x100),
151 .flags = IORESOURCE_MEM,
152 }, {
153 .start = USB_HOST_INT,
154 .flags = IORESOURCE_IRQ,
155 },
156};
157
158static struct platform_device ohci_device = {
159 .name = "pnx4008-usb-ohci",
160 .id = -1,
161 .dev = {
162 .dma_mask = &ohci_dmamask,
163 .coherent_dma_mask = 0xffffffff,
164 },
165 .num_resources = ARRAY_SIZE(ohci_resources),
166 .resource = ohci_resources,
167};
168
169static struct platform_device sdum_device = {
170 .name = "pnx4008-sdum",
171 .id = 0,
172 .dev = {
173 .coherent_dma_mask = 0xffffffff,
174 },
175};
176
177static struct platform_device rgbfb_device = {
178 .name = "pnx4008-rgbfb",
179 .id = 0,
180 .dev = {
181 .coherent_dma_mask = 0xffffffff,
182 }
183};
184
185struct resource watchdog_resources[] = {
186 {
187 .start = PNX4008_WDOG_BASE,
188 .end = PNX4008_WDOG_BASE + SZ_4K - 1,
189 .flags = IORESOURCE_MEM,
190 },
191};
192
193static struct platform_device watchdog_device = {
194 .name = "pnx4008-watchdog",
195 .id = -1,
196 .num_resources = ARRAY_SIZE(watchdog_resources),
197 .resource = watchdog_resources,
198};
199
136static struct platform_device *devices[] __initdata = { 200static struct platform_device *devices[] __initdata = {
137 &spipnx_1, 201 &spipnx_1,
138 &spipnx_2, 202 &spipnx_2,
139 &serial_device, 203 &serial_device,
204 &ohci_device,
205 &nand_flash_device,
206 &sdum_device,
207 &rgbfb_device,
208 &watchdog_device,
140}; 209};
141 210
142 211
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index ee80d62119d..142c33c3dff 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -397,7 +397,7 @@ static void lubbock_mmc_poll(unsigned long data)
397 if (LUB_IRQ_SET_CLR & (1 << 0)) 397 if (LUB_IRQ_SET_CLR & (1 << 0))
398 mod_timer(&mmc_timer, jiffies + MMC_POLL_RATE); 398 mod_timer(&mmc_timer, jiffies + MMC_POLL_RATE);
399 else { 399 else {
400 (void) mmc_detect_int(LUBBOCK_SD_IRQ, (void *)data, NULL); 400 (void) mmc_detect_int(LUBBOCK_SD_IRQ, (void *)data);
401 enable_irq(LUBBOCK_SD_IRQ); 401 enable_irq(LUBBOCK_SD_IRQ);
402 } 402 }
403} 403}
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 63965c78de8..9aa26b99045 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -91,7 +91,7 @@ config SMDK2440_CPU2442
91config MACH_S3C2413 91config MACH_S3C2413
92 bool 92 bool
93 help 93 help
94 Internal node for S3C2413 verison of SMDK2413, so that 94 Internal node for S3C2413 version of SMDK2413, so that
95 machine_is_s3c2413() will work when MACH_SMDK2413 is 95 machine_is_s3c2413() will work when MACH_SMDK2413 is
96 selected 96 selected
97 97
diff --git a/arch/arm/mach-s3c2410/gpio.c b/arch/arm/mach-s3c2410/gpio.c
index db6393c9986..ba346546150 100644
--- a/arch/arm/mach-s3c2410/gpio.c
+++ b/arch/arm/mach-s3c2410/gpio.c
@@ -3,7 +3,7 @@
3 * Copyright (c) 2004-2005 Simtec Electronics 3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 GPIO support 6 * S3C24XX GPIO support
7 * 7 *
8 * 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
9 * 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
@@ -163,3 +163,22 @@ unsigned int s3c2410_modify_misccr(unsigned int clear, unsigned int change)
163} 163}
164 164
165EXPORT_SYMBOL(s3c2410_modify_misccr); 165EXPORT_SYMBOL(s3c2410_modify_misccr);
166
167int s3c2410_gpio_getirq(unsigned int pin)
168{
169 if (pin < S3C2410_GPF0 || pin > S3C2410_GPG15)
170 return -1; /* not valid interrupts */
171
172 if (pin < S3C2410_GPG0 && pin > S3C2410_GPF7)
173 return -1; /* not valid pin */
174
175 if (pin < S3C2410_GPF4)
176 return (pin - S3C2410_GPF0) + IRQ_EINT0;
177
178 if (pin < S3C2410_GPG0)
179 return (pin - S3C2410_GPF4) + IRQ_EINT4;
180
181 return (pin - S3C2410_GPG0) + IRQ_EINT8;
182}
183
184EXPORT_SYMBOL(s3c2410_gpio_getirq);
diff --git a/arch/arm/mach-s3c2410/s3c2410-gpio.c b/arch/arm/mach-s3c2410/s3c2410-gpio.c
index a2098f692d8..ec3a276cc3c 100644
--- a/arch/arm/mach-s3c2410/s3c2410-gpio.c
+++ b/arch/arm/mach-s3c2410/s3c2410-gpio.c
@@ -69,22 +69,3 @@ int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
69} 69}
70 70
71EXPORT_SYMBOL(s3c2410_gpio_irqfilter); 71EXPORT_SYMBOL(s3c2410_gpio_irqfilter);
72
73int s3c2410_gpio_getirq(unsigned int pin)
74{
75 if (pin < S3C2410_GPF0 || pin > S3C2410_GPG15)
76 return -1; /* not valid interrupts */
77
78 if (pin < S3C2410_GPG0 && pin > S3C2410_GPF7)
79 return -1; /* not valid pin */
80
81 if (pin < S3C2410_GPF4)
82 return (pin - S3C2410_GPF0) + IRQ_EINT0;
83
84 if (pin < S3C2410_GPG0)
85 return (pin - S3C2410_GPF4) + IRQ_EINT4;
86
87 return (pin - S3C2410_GPG0) + IRQ_EINT8;
88}
89
90EXPORT_SYMBOL(s3c2410_gpio_getirq);
diff --git a/arch/arm/mach-sa1100/cpu-sa1110.c b/arch/arm/mach-sa1100/cpu-sa1110.c
index 63959772993..78f4c134604 100644
--- a/arch/arm/mach-sa1100/cpu-sa1110.c
+++ b/arch/arm/mach-sa1100/cpu-sa1110.c
@@ -82,6 +82,14 @@ static struct sdram_params sdram_tbl[] __initdata = {
82 .twr = 9, 82 .twr = 9,
83 .refresh = 64000, 83 .refresh = 64000,
84 .cas_latency = 3, 84 .cas_latency = 3,
85 }, { /* Samsung K4S281632B-1H */
86 .name = "K4S281632B-1H",
87 .rows = 12,
88 .tck = 10,
89 .trp = 20,
90 .twr = 10,
91 .refresh = 64000,
92 .cas_latency = 3,
85 }, { /* Samsung KM416S4030CT */ 93 }, { /* Samsung KM416S4030CT */
86 .name = "KM416S4030CT", 94 .name = "KM416S4030CT",
87 .rows = 13, 95 .rows = 13,
@@ -366,6 +374,8 @@ static int __init sa1110_clk_init(void)
366 374
367 if (machine_is_h3100()) 375 if (machine_is_h3100())
368 name = "KM416S4030CT"; 376 name = "KM416S4030CT";
377 if (machine_is_jornada720())
378 name = "K4S281632B-1H";
369 } 379 }
370 380
371 sdram = sa1110_find_sdram(name); 381 sdram = sa1110_find_sdram(name);
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index c0bfb8212b7..b09a19f87d6 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -197,7 +197,7 @@ config CPU_ARM940T
197 select CPU_CP15_MPU 197 select CPU_CP15_MPU
198 help 198 help
199 ARM940T is a member of the ARM9TDMI family of general- 199 ARM940T is a member of the ARM9TDMI family of general-
200 purpose microprocessors with MPU and seperate 4KB 200 purpose microprocessors with MPU and separate 4KB
201 instruction and 4KB data cases, each with a 4-word line 201 instruction and 4KB data cases, each with a 4-word line
202 length. 202 length.
203 203
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c
index 50e6b6bfb2e..b797217e82b 100644
--- a/arch/arm/mm/consistent.c
+++ b/arch/arm/mm/consistent.c
@@ -476,6 +476,9 @@ core_initcall(consistent_init);
476 476
477/* 477/*
478 * Make an area consistent for devices. 478 * Make an area consistent for devices.
479 * Note: Drivers should NOT use this function directly, as it will break
480 * platforms with CONFIG_DMABOUNCE.
481 * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
479 */ 482 */
480void consistent_sync(void *vaddr, size_t size, int direction) 483void consistent_sync(void *vaddr, size_t size, int direction)
481{ 484{
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 22217fe2650..b5814b4b6f3 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -32,40 +32,51 @@ extern unsigned long phys_initrd_start;
32extern unsigned long phys_initrd_size; 32extern unsigned long phys_initrd_size;
33 33
34/* 34/*
35 * The sole use of this is to pass memory configuration 35 * This is used to pass memory configuration data from paging_init
36 * data from paging_init to mem_init. 36 * to mem_init, and by show_mem() to skip holes in the memory map.
37 */ 37 */
38static struct meminfo meminfo __initdata = { 0, }; 38static struct meminfo meminfo = { 0, };
39
40#define for_each_nodebank(iter,mi,no) \
41 for (iter = 0; iter < mi->nr_banks; iter++) \
42 if (mi->bank[iter].node == no)
39 43
40void show_mem(void) 44void show_mem(void)
41{ 45{
42 int free = 0, total = 0, reserved = 0; 46 int free = 0, total = 0, reserved = 0;
43 int shared = 0, cached = 0, slab = 0, node; 47 int shared = 0, cached = 0, slab = 0, node, i;
48 struct meminfo * mi = &meminfo;
44 49
45 printk("Mem-info:\n"); 50 printk("Mem-info:\n");
46 show_free_areas(); 51 show_free_areas();
47 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 52 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
48 53
49 for_each_online_node(node) { 54 for_each_online_node(node) {
50 struct page *page, *end; 55 for_each_nodebank (i,mi,node) {
51 56 unsigned int pfn1, pfn2;
52 page = NODE_MEM_MAP(node); 57 struct page *page, *end;
53 end = page + NODE_DATA(node)->node_spanned_pages; 58
54 59 pfn1 = mi->bank[i].start >> PAGE_SHIFT;
55 do { 60 pfn2 = (mi->bank[i].size + mi->bank[i].start) >> PAGE_SHIFT;
56 total++; 61
57 if (PageReserved(page)) 62 page = NODE_MEM_MAP(node) + pfn1;
58 reserved++; 63 end = NODE_MEM_MAP(node) + pfn2;
59 else if (PageSwapCache(page)) 64
60 cached++; 65 do {
61 else if (PageSlab(page)) 66 total++;
62 slab++; 67 if (PageReserved(page))
63 else if (!page_count(page)) 68 reserved++;
64 free++; 69 else if (PageSwapCache(page))
65 else 70 cached++;
66 shared += page_count(page) - 1; 71 else if (PageSlab(page))
67 page++; 72 slab++;
68 } while (page < end); 73 else if (!page_count(page))
74 free++;
75 else
76 shared += page_count(page) - 1;
77 page++;
78 } while (page < end);
79 }
69 } 80 }
70 81
71 printk("%d pages of RAM\n", total); 82 printk("%d pages of RAM\n", total);
@@ -76,10 +87,6 @@ void show_mem(void)
76 printk("%d pages swap cached\n", cached); 87 printk("%d pages swap cached\n", cached);
77} 88}
78 89
79#define for_each_nodebank(iter,mi,no) \
80 for (iter = 0; iter < mi->nr_banks; iter++) \
81 if (mi->bank[iter].node == no)
82
83/* 90/*
84 * FIXME: We really want to avoid allocating the bootmap bitmap 91 * FIXME: We really want to avoid allocating the bootmap bitmap
85 * over the top of the initrd. Hopefully, this is located towards 92 * over the top of the initrd. Hopefully, this is located towards
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index e8b377d637f..2749c1f88d7 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -909,7 +909,7 @@ __pxa270_proc_info:
909 b __xscale_setup 909 b __xscale_setup
910 .long cpu_arch_name 910 .long cpu_arch_name
911 .long cpu_elf_name 911 .long cpu_elf_name
912 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP 912 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_IWMMXT
913 .long cpu_pxa270_name 913 .long cpu_pxa270_name
914 .long xscale_processor_functions 914 .long xscale_processor_functions
915 .long v4wbi_tlb_fns 915 .long v4wbi_tlb_fns
diff --git a/arch/arm/oprofile/op_counter.h b/arch/arm/oprofile/op_counter.h
index 8c5351d751c..ca942a63b52 100644
--- a/arch/arm/oprofile/op_counter.h
+++ b/arch/arm/oprofile/op_counter.h
@@ -10,8 +10,6 @@
10#ifndef OP_COUNTER_H 10#ifndef OP_COUNTER_H
11#define OP_COUNTER_H 11#define OP_COUNTER_H
12 12
13#define OP_MAX_COUNTER 5
14
15/* Per performance monitor configuration as set via 13/* Per performance monitor configuration as set via
16 * oprofilefs. 14 * oprofilefs.
17 */ 15 */
diff --git a/arch/arm/oprofile/op_model_xscale.c b/arch/arm/oprofile/op_model_xscale.c
index 7899d3ca75a..7c3289c2acd 100644
--- a/arch/arm/oprofile/op_model_xscale.c
+++ b/arch/arm/oprofile/op_model_xscale.c
@@ -20,7 +20,8 @@
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/oprofile.h> 21#include <linux/oprofile.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <asm/irq.h> 23#include <linux/irq.h>
24
24#include <asm/system.h> 25#include <asm/system.h>
25 26
26#include "op_counter.h" 27#include "op_counter.h"
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index b02af1d740f..579c69ae9ff 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -4,7 +4,7 @@
4# 4#
5# Up to date versions of this file can be obtained from: 5# Up to date versions of this file can be obtained from:
6# 6#
7# http://www.arm.linux.org.uk/developer/machines/?action=download 7# http://www.arm.linux.org.uk/developer/machines/download.php
8# 8#
9# Please do not send patches to this file; it is automatically generated! 9# Please do not send patches to this file; it is automatically generated!
10# To add an entry into this database, please see Documentation/arm/README, 10# To add an entry into this database, please see Documentation/arm/README,
@@ -12,7 +12,7 @@
12# 12#
13# http://www.arm.linux.org.uk/developer/machines/?action=new 13# http://www.arm.linux.org.uk/developer/machines/?action=new
14# 14#
15# Last update: Sat Sep 23 13:20:43 2006 15# Last update: Mon Oct 16 21:13:36 2006
16# 16#
17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number 17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
18# 18#
@@ -1157,3 +1157,17 @@ adsturboxb MACH_ADSTURBOXB ADSTURBOXB 1143
1157oti4110 MACH_OTI4110 OTI4110 1144 1157oti4110 MACH_OTI4110 OTI4110 1144
1158hme_pxa MACH_HME_PXA HME_PXA 1145 1158hme_pxa MACH_HME_PXA HME_PXA 1145
1159deisterdca MACH_DEISTERDCA DEISTERDCA 1146 1159deisterdca MACH_DEISTERDCA DEISTERDCA 1146
1160ces_ssem2 MACH_CES_SSEM2 CES_SSEM2 1147
1161ces_mtr MACH_CES_MTR CES_MTR 1148
1162tds_avng_sbc MACH_TDS_AVNG_SBC TDS_AVNG_SBC 1149
1163everest MACH_EVEREST EVEREST 1150
1164pnx4010 MACH_PNX4010 PNX4010 1151
1165oxnas MACH_OXNAS OXNAS 1152
1166fiori MACH_FIORI FIORI 1153
1167ml1200 MACH_ML1200 ML1200 1154
1168cactus MACH_CACTUS CACTUS 1155
1169nb2xxx MACH_NB2XXX NB2XXX 1156
1170hw6900 MACH_HW6900 HW6900 1157
1171cdcs_quoll MACH_CDCS_QUOLL CDCS_QUOLL 1158
1172quicksilver MACH_QUICKSILVER QUICKSILVER 1159
1173uplat926 MACH_UPLAT926 UPLAT926 1160
diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c
index 4fc05ee0a2e..e44b9ed0f81 100644
--- a/arch/arm/vfp/vfpdouble.c
+++ b/arch/arm/vfp/vfpdouble.c
@@ -56,7 +56,7 @@ static void vfp_double_normalise_denormal(struct vfp_double *vd)
56{ 56{
57 int bits = 31 - fls(vd->significand >> 32); 57 int bits = 31 - fls(vd->significand >> 32);
58 if (bits == 31) 58 if (bits == 31)
59 bits = 62 - fls(vd->significand); 59 bits = 63 - fls(vd->significand);
60 60
61 vfp_double_dump("normalise_denormal: in", vd); 61 vfp_double_dump("normalise_denormal: in", vd);
62 62
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index a657a28f08d..f08eafbddcc 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -148,6 +148,7 @@ static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_
148 /* 148 /*
149 * These are arranged in priority order, least to highest. 149 * These are arranged in priority order, least to highest.
150 */ 150 */
151 RAISE(FPSCR_DZC, FPSCR_DZE, FPE_FLTDIV);
151 RAISE(FPSCR_IXC, FPSCR_IXE, FPE_FLTRES); 152 RAISE(FPSCR_IXC, FPSCR_IXE, FPE_FLTRES);
152 RAISE(FPSCR_UFC, FPSCR_UFE, FPE_FLTUND); 153 RAISE(FPSCR_UFC, FPSCR_UFE, FPE_FLTUND);
153 RAISE(FPSCR_OFC, FPSCR_OFE, FPE_FLTOVF); 154 RAISE(FPSCR_OFC, FPSCR_OFE, FPE_FLTOVF);
diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile
index cefc95a7398..7b842e98efe 100644
--- a/arch/avr32/Makefile
+++ b/arch/avr32/Makefile
@@ -7,7 +7,7 @@
7 7
8# Default target when executing plain make 8# Default target when executing plain make
9.PHONY: all 9.PHONY: all
10all: uImage vmlinux.elf linux.lst 10all: uImage vmlinux.elf
11 11
12KBUILD_DEFCONFIG := atstk1002_defconfig 12KBUILD_DEFCONFIG := atstk1002_defconfig
13 13
@@ -21,9 +21,7 @@ cpuflags-$(CONFIG_CPU_AP7000) += -mcpu=ap7000
21CFLAGS += $(cpuflags-y) 21CFLAGS += $(cpuflags-y)
22AFLAGS += $(cpuflags-y) 22AFLAGS += $(cpuflags-y)
23 23
24CHECKFLAGS += -D__avr32__ 24CHECKFLAGS += -D__avr32__ -D__BIG_ENDIAN
25
26LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
27 25
28head-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/head.o 26head-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/head.o
29head-y += arch/avr32/kernel/head.o 27head-y += arch/avr32/kernel/head.o
@@ -32,7 +30,7 @@ core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/
32core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/ 30core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/
33core-y += arch/avr32/kernel/ 31core-y += arch/avr32/kernel/
34core-y += arch/avr32/mm/ 32core-y += arch/avr32/mm/
35libs-y += arch/avr32/lib/ #$(LIBGCC) 33libs-y += arch/avr32/lib/
36 34
37archincdir-$(CONFIG_PLATFORM_AT32AP) := arch-at32ap 35archincdir-$(CONFIG_PLATFORM_AT32AP) := arch-at32ap
38 36
@@ -48,6 +46,8 @@ endif
48 46
49archprepare: include/asm-avr32/.arch 47archprepare: include/asm-avr32/.arch
50 48
49CLEAN_FILES += include/asm-avr32/.arch include/asm-avr32/arch
50
51BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec 51BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
52 52
53.PHONY: $(BOOT_TARGETS) install 53.PHONY: $(BOOT_TARGETS) install
@@ -71,14 +71,19 @@ vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux
71install: vmlinux 71install: vmlinux
72 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ 72 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
73 73
74linux.s: vmlinux 74vmlinux.s: vmlinux
75 $(call if_changed,disasm) 75 $(call if_changed,disasm)
76 76
77linux.lst: vmlinux 77vmlinux.lst: vmlinux
78 $(call if_changed,listing) 78 $(call if_changed,listing)
79 79
80CLEAN_FILES += vmlinux.s vmlinux.lst
81
82archclean:
83 $(Q)$(MAKE) $(clean)=$(boot)
84
80define archhelp 85define archhelp
81 @echo '* vmlinux.elf - ELF image with load address 0' 86 @echo '* vmlinux.elf - ELF image with load address 0'
82 @echo ' vmlinux.cso - PathFinder CSO image' 87 @echo ' vmlinux.cso - PathFinder CSO image'
83 @echo ' uImage - Create a bootable image for U-Boot' 88 @echo '* uImage - Create a bootable image for U-Boot'
84endef 89endef
diff --git a/arch/avr32/boards/atstk1000/setup.c b/arch/avr32/boards/atstk1000/setup.c
index 191ab85de9a..272c011802a 100644
--- a/arch/avr32/boards/atstk1000/setup.c
+++ b/arch/avr32/boards/atstk1000/setup.c
@@ -21,15 +21,6 @@ struct tag *bootloader_tags __initdata;
21 21
22struct lcdc_platform_data __initdata atstk1000_fb0_data; 22struct lcdc_platform_data __initdata atstk1000_fb0_data;
23 23
24asmlinkage void __init board_early_init(void)
25{
26 extern void sdram_init(void);
27
28#ifdef CONFIG_LOADER_STANDALONE
29 sdram_init();
30#endif
31}
32
33void __init board_setup_fbmem(unsigned long fbmem_start, 24void __init board_setup_fbmem(unsigned long fbmem_start,
34 unsigned long fbmem_size) 25 unsigned long fbmem_size)
35{ 26{
diff --git a/arch/avr32/boot/images/Makefile b/arch/avr32/boot/images/Makefile
index ccd74eeecec..219720a47bf 100644
--- a/arch/avr32/boot/images/Makefile
+++ b/arch/avr32/boot/images/Makefile
@@ -37,14 +37,12 @@ OBJCOPYFLAGS_vmlinux.elf := --change-section-lma .text-0x80000000 \
37 --change-section-lma .data-0x80000000 \ 37 --change-section-lma .data-0x80000000 \
38 --change-section-lma .init-0x80000000 \ 38 --change-section-lma .init-0x80000000 \
39 --change-section-lma .bss-0x80000000 \ 39 --change-section-lma .bss-0x80000000 \
40 --change-section-lma .initrd-0x80000000 \
41 --change-section-lma __param-0x80000000 \ 40 --change-section-lma __param-0x80000000 \
42 --change-section-lma __ksymtab-0x80000000 \ 41 --change-section-lma __ksymtab-0x80000000 \
43 --change-section-lma __ksymtab_gpl-0x80000000 \ 42 --change-section-lma __ksymtab_gpl-0x80000000 \
44 --change-section-lma __kcrctab-0x80000000 \ 43 --change-section-lma __kcrctab-0x80000000 \
45 --change-section-lma __kcrctab_gpl-0x80000000 \ 44 --change-section-lma __kcrctab_gpl-0x80000000 \
46 --change-section-lma __ksymtab_strings-0x80000000 \ 45 --change-section-lma __ksymtab_strings-0x80000000 \
47 --change-section-lma .got-0x80000000 \
48 --set-start 0xa0000000 46 --set-start 0xa0000000
49$(obj)/vmlinux.elf: vmlinux FORCE 47$(obj)/vmlinux.elf: vmlinux FORCE
50 $(call if_changed,objcopy) 48 $(call if_changed,objcopy)
@@ -59,4 +57,4 @@ install: $(BOOTIMAGE)
59 sh $(srctree)/install-kernel.sh $< 57 sh $(srctree)/install-kernel.sh $<
60 58
61# Generated files to be removed upon make clean 59# Generated files to be removed upon make clean
62clean-files := vmlinux* uImage uImage.srec 60clean-files := vmlinux.elf vmlinux.bin vmlinux.gz uImage uImage.srec
diff --git a/arch/avr32/configs/atstk1002_defconfig b/arch/avr32/configs/atstk1002_defconfig
index 6c2c5e00dfc..ae92a14ef9a 100644
--- a/arch/avr32/configs/atstk1002_defconfig
+++ b/arch/avr32/configs/atstk1002_defconfig
@@ -1,13 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.18-rc1 3# Linux kernel version: 2.6.19-rc2
4# Tue Jul 11 12:41:36 2006 4# Fri Oct 20 11:52:37 2006
5# 5#
6CONFIG_AVR32=y 6CONFIG_AVR32=y
7CONFIG_GENERIC_HARDIRQS=y 7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_HARDIRQS_SW_RESEND=y 8CONFIG_HARDIRQS_SW_RESEND=y
9CONFIG_GENERIC_IRQ_PROBE=y 9CONFIG_GENERIC_IRQ_PROBE=y
10CONFIG_RWSEM_GENERIC_SPINLOCK=y 10CONFIG_RWSEM_GENERIC_SPINLOCK=y
11CONFIG_GENERIC_TIME=y
11CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
13CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 14CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
@@ -25,16 +26,23 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
25CONFIG_LOCALVERSION="" 26CONFIG_LOCALVERSION=""
26# CONFIG_LOCALVERSION_AUTO is not set 27# CONFIG_LOCALVERSION_AUTO is not set
27CONFIG_SWAP=y 28CONFIG_SWAP=y
28# CONFIG_SYSVIPC is not set 29CONFIG_SYSVIPC=y
29# CONFIG_POSIX_MQUEUE is not set 30# CONFIG_IPC_NS is not set
30# CONFIG_BSD_PROCESS_ACCT is not set 31CONFIG_POSIX_MQUEUE=y
31CONFIG_SYSCTL=y 32CONFIG_BSD_PROCESS_ACCT=y
32# CONFIG_AUDIT is not set 33CONFIG_BSD_PROCESS_ACCT_V3=y
34CONFIG_TASKSTATS=y
35CONFIG_TASK_DELAY_ACCT=y
36# CONFIG_UTS_NS is not set
37CONFIG_AUDIT=y
33# CONFIG_IKCONFIG is not set 38# CONFIG_IKCONFIG is not set
34# CONFIG_RELAY is not set 39CONFIG_RELAY=y
35CONFIG_INITRAMFS_SOURCE="" 40CONFIG_INITRAMFS_SOURCE=""
36CONFIG_CC_OPTIMIZE_FOR_SIZE=y 41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
42# CONFIG_TASK_XACCT is not set
43CONFIG_SYSCTL=y
37CONFIG_EMBEDDED=y 44CONFIG_EMBEDDED=y
45# CONFIG_SYSCTL_SYSCALL is not set
38CONFIG_KALLSYMS=y 46CONFIG_KALLSYMS=y
39# CONFIG_KALLSYMS_ALL is not set 47# CONFIG_KALLSYMS_ALL is not set
40# CONFIG_KALLSYMS_EXTRA_PASS is not set 48# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -43,14 +51,15 @@ CONFIG_PRINTK=y
43CONFIG_BUG=y 51CONFIG_BUG=y
44CONFIG_ELF_CORE=y 52CONFIG_ELF_CORE=y
45# CONFIG_BASE_FULL is not set 53# CONFIG_BASE_FULL is not set
46# CONFIG_FUTEX is not set 54CONFIG_FUTEX=y
47# CONFIG_EPOLL is not set 55CONFIG_EPOLL=y
48CONFIG_SHMEM=y 56CONFIG_SHMEM=y
49# CONFIG_SLAB is not set 57CONFIG_SLAB=y
50# CONFIG_VM_EVENT_COUNTERS is not set 58CONFIG_VM_EVENT_COUNTERS=y
59CONFIG_RT_MUTEXES=y
51# CONFIG_TINY_SHMEM is not set 60# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=1 61CONFIG_BASE_SMALL=1
53CONFIG_SLOB=y 62# CONFIG_SLOB is not set
54 63
55# 64#
56# Loadable module support 65# Loadable module support
@@ -65,6 +74,7 @@ CONFIG_MODULE_UNLOAD=y
65# 74#
66# Block layer 75# Block layer
67# 76#
77CONFIG_BLOCK=y
68# CONFIG_BLK_DEV_IO_TRACE is not set 78# CONFIG_BLK_DEV_IO_TRACE is not set
69 79
70# 80#
@@ -166,10 +176,12 @@ CONFIG_IP_PNP_DHCP=y
166# CONFIG_INET_TUNNEL is not set 176# CONFIG_INET_TUNNEL is not set
167# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 177# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
168# CONFIG_INET_XFRM_MODE_TUNNEL is not set 178# CONFIG_INET_XFRM_MODE_TUNNEL is not set
179# CONFIG_INET_XFRM_MODE_BEET is not set
169CONFIG_INET_DIAG=y 180CONFIG_INET_DIAG=y
170CONFIG_INET_TCP_DIAG=y 181CONFIG_INET_TCP_DIAG=y
171# CONFIG_TCP_CONG_ADVANCED is not set 182# CONFIG_TCP_CONG_ADVANCED is not set
172CONFIG_TCP_CONG_BIC=y 183CONFIG_TCP_CONG_CUBIC=y
184CONFIG_DEFAULT_TCP_CONG="cubic"
173# CONFIG_IPV6 is not set 185# CONFIG_IPV6 is not set
174# CONFIG_INET6_XFRM_TUNNEL is not set 186# CONFIG_INET6_XFRM_TUNNEL is not set
175# CONFIG_INET6_TUNNEL is not set 187# CONFIG_INET6_TUNNEL is not set
@@ -199,7 +211,6 @@ CONFIG_TCP_CONG_BIC=y
199# CONFIG_ATALK is not set 211# CONFIG_ATALK is not set
200# CONFIG_X25 is not set 212# CONFIG_X25 is not set
201# CONFIG_LAPB is not set 213# CONFIG_LAPB is not set
202# CONFIG_NET_DIVERT is not set
203# CONFIG_ECONET is not set 214# CONFIG_ECONET is not set
204# CONFIG_WAN_ROUTER is not set 215# CONFIG_WAN_ROUTER is not set
205 216
@@ -212,7 +223,6 @@ CONFIG_TCP_CONG_BIC=y
212# Network testing 223# Network testing
213# 224#
214# CONFIG_NET_PKTGEN is not set 225# CONFIG_NET_PKTGEN is not set
215# CONFIG_NET_TCPPROBE is not set
216# CONFIG_HAMRADIO is not set 226# CONFIG_HAMRADIO is not set
217# CONFIG_IRDA is not set 227# CONFIG_IRDA is not set
218# CONFIG_BT is not set 228# CONFIG_BT is not set
@@ -239,7 +249,84 @@ CONFIG_STANDALONE=y
239# 249#
240# Memory Technology Devices (MTD) 250# Memory Technology Devices (MTD)
241# 251#
242# CONFIG_MTD is not set 252CONFIG_MTD=y
253# CONFIG_MTD_DEBUG is not set
254# CONFIG_MTD_CONCAT is not set
255CONFIG_MTD_PARTITIONS=y
256# CONFIG_MTD_REDBOOT_PARTS is not set
257CONFIG_MTD_CMDLINE_PARTS=y
258
259#
260# User Modules And Translation Layers
261#
262CONFIG_MTD_CHAR=y
263CONFIG_MTD_BLOCK=y
264# CONFIG_FTL is not set
265# CONFIG_NFTL is not set
266# CONFIG_INFTL is not set
267# CONFIG_RFD_FTL is not set
268# CONFIG_SSFDC is not set
269
270#
271# RAM/ROM/Flash chip drivers
272#
273CONFIG_MTD_CFI=y
274# CONFIG_MTD_JEDECPROBE is not set
275CONFIG_MTD_GEN_PROBE=y
276# CONFIG_MTD_CFI_ADV_OPTIONS is not set
277CONFIG_MTD_MAP_BANK_WIDTH_1=y
278CONFIG_MTD_MAP_BANK_WIDTH_2=y
279CONFIG_MTD_MAP_BANK_WIDTH_4=y
280# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
281# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
282# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
283CONFIG_MTD_CFI_I1=y
284CONFIG_MTD_CFI_I2=y
285# CONFIG_MTD_CFI_I4 is not set
286# CONFIG_MTD_CFI_I8 is not set
287# CONFIG_MTD_CFI_INTELEXT is not set
288CONFIG_MTD_CFI_AMDSTD=y
289# CONFIG_MTD_CFI_STAA is not set
290CONFIG_MTD_CFI_UTIL=y
291# CONFIG_MTD_RAM is not set
292# CONFIG_MTD_ROM is not set
293# CONFIG_MTD_ABSENT is not set
294# CONFIG_MTD_OBSOLETE_CHIPS is not set
295
296#
297# Mapping drivers for chip access
298#
299# CONFIG_MTD_COMPLEX_MAPPINGS is not set
300CONFIG_MTD_PHYSMAP=y
301CONFIG_MTD_PHYSMAP_START=0x8000000
302CONFIG_MTD_PHYSMAP_LEN=0x0
303CONFIG_MTD_PHYSMAP_BANKWIDTH=2
304# CONFIG_MTD_PLATRAM is not set
305
306#
307# Self-contained MTD device drivers
308#
309# CONFIG_MTD_SLRAM is not set
310# CONFIG_MTD_PHRAM is not set
311# CONFIG_MTD_MTDRAM is not set
312# CONFIG_MTD_BLOCK2MTD is not set
313
314#
315# Disk-On-Chip Device Drivers
316#
317# CONFIG_MTD_DOC2000 is not set
318# CONFIG_MTD_DOC2001 is not set
319# CONFIG_MTD_DOC2001PLUS is not set
320
321#
322# NAND Flash Device Drivers
323#
324# CONFIG_MTD_NAND is not set
325
326#
327# OneNAND Flash Device Drivers
328#
329# CONFIG_MTD_ONENAND is not set
243 330
244# 331#
245# Parallel port support 332# Parallel port support
@@ -260,11 +347,18 @@ CONFIG_BLK_DEV_NBD=m
260CONFIG_BLK_DEV_RAM=m 347CONFIG_BLK_DEV_RAM=m
261CONFIG_BLK_DEV_RAM_COUNT=16 348CONFIG_BLK_DEV_RAM_COUNT=16
262CONFIG_BLK_DEV_RAM_SIZE=4096 349CONFIG_BLK_DEV_RAM_SIZE=4096
350CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
263CONFIG_BLK_DEV_INITRD=y 351CONFIG_BLK_DEV_INITRD=y
264# CONFIG_CDROM_PKTCDVD is not set 352# CONFIG_CDROM_PKTCDVD is not set
265# CONFIG_ATA_OVER_ETH is not set 353# CONFIG_ATA_OVER_ETH is not set
266 354
267# 355#
356# Misc devices
357#
358# CONFIG_SGI_IOC4 is not set
359# CONFIG_TIFM_CORE is not set
360
361#
268# ATA/ATAPI/MFM/RLL support 362# ATA/ATAPI/MFM/RLL support
269# 363#
270# CONFIG_IDE is not set 364# CONFIG_IDE is not set
@@ -274,6 +368,12 @@ CONFIG_BLK_DEV_INITRD=y
274# 368#
275# CONFIG_RAID_ATTRS is not set 369# CONFIG_RAID_ATTRS is not set
276# CONFIG_SCSI is not set 370# CONFIG_SCSI is not set
371# CONFIG_SCSI_NETLINK is not set
372
373#
374# Serial ATA (prod) and Parallel ATA (experimental) drivers
375#
376# CONFIG_ATA is not set
277 377
278# 378#
279# Multi-device support (RAID and LVM) 379# Multi-device support (RAID and LVM)
@@ -305,14 +405,11 @@ CONFIG_TUN=m
305# 405#
306# PHY device support 406# PHY device support
307# 407#
308# CONFIG_PHYLIB is not set
309 408
310# 409#
311# Ethernet (10 or 100Mbit) 410# Ethernet (10 or 100Mbit)
312# 411#
313CONFIG_NET_ETHERNET=y 412# CONFIG_NET_ETHERNET is not set
314CONFIG_MII=y
315CONFIG_MACB=y
316 413
317# 414#
318# Ethernet (1000 Mbit) 415# Ethernet (1000 Mbit)
@@ -341,10 +438,11 @@ CONFIG_PPP=m
341CONFIG_PPP_ASYNC=m 438CONFIG_PPP_ASYNC=m
342# CONFIG_PPP_SYNC_TTY is not set 439# CONFIG_PPP_SYNC_TTY is not set
343CONFIG_PPP_DEFLATE=m 440CONFIG_PPP_DEFLATE=m
344# CONFIG_PPP_BSDCOMP is not set 441CONFIG_PPP_BSDCOMP=m
345# CONFIG_PPP_MPPE is not set 442# CONFIG_PPP_MPPE is not set
346# CONFIG_PPPOE is not set 443# CONFIG_PPPOE is not set
347# CONFIG_SLIP is not set 444# CONFIG_SLIP is not set
445CONFIG_SLHC=m
348# CONFIG_SHAPER is not set 446# CONFIG_SHAPER is not set
349# CONFIG_NETCONSOLE is not set 447# CONFIG_NETCONSOLE is not set
350# CONFIG_NETPOLL is not set 448# CONFIG_NETPOLL is not set
@@ -417,7 +515,6 @@ CONFIG_UNIX98_PTYS=y
417# TPM devices 515# TPM devices
418# 516#
419# CONFIG_TCG_TPM is not set 517# CONFIG_TCG_TPM is not set
420# CONFIG_TELCLOCK is not set
421 518
422# 519#
423# I2C support 520# I2C support
@@ -427,23 +524,13 @@ CONFIG_UNIX98_PTYS=y
427# 524#
428# SPI support 525# SPI support
429# 526#
430CONFIG_SPI=y 527# CONFIG_SPI is not set
431# CONFIG_SPI_DEBUG is not set 528# CONFIG_SPI_MASTER is not set
432CONFIG_SPI_MASTER=y
433
434#
435# SPI Master Controller Drivers
436#
437CONFIG_SPI_ATMEL=m
438# CONFIG_SPI_BITBANG is not set
439
440#
441# SPI Protocol Masters
442#
443 529
444# 530#
445# Dallas's 1-wire bus 531# Dallas's 1-wire bus
446# 532#
533# CONFIG_W1 is not set
447 534
448# 535#
449# Hardware Monitoring support 536# Hardware Monitoring support
@@ -452,14 +539,9 @@ CONFIG_SPI_ATMEL=m
452# CONFIG_HWMON_VID is not set 539# CONFIG_HWMON_VID is not set
453 540
454# 541#
455# Misc devices
456#
457
458#
459# Multimedia devices 542# Multimedia devices
460# 543#
461# CONFIG_VIDEO_DEV is not set 544# CONFIG_VIDEO_DEV is not set
462CONFIG_VIDEO_V4L2=y
463 545
464# 546#
465# Digital Video Broadcasting Devices 547# Digital Video Broadcasting Devices
@@ -470,28 +552,8 @@ CONFIG_VIDEO_V4L2=y
470# Graphics support 552# Graphics support
471# 553#
472# CONFIG_FIRMWARE_EDID is not set 554# CONFIG_FIRMWARE_EDID is not set
473CONFIG_FB=m 555# CONFIG_FB is not set
474CONFIG_FB_CFB_FILLRECT=m 556# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
475CONFIG_FB_CFB_COPYAREA=m
476CONFIG_FB_CFB_IMAGEBLIT=m
477# CONFIG_FB_MACMODES is not set
478# CONFIG_FB_BACKLIGHT is not set
479# CONFIG_FB_MODE_HELPERS is not set
480# CONFIG_FB_TILEBLITTING is not set
481CONFIG_FB_SIDSA=m
482CONFIG_FB_SIDSA_DEFAULT_BPP=24
483# CONFIG_FB_S1D13XXX is not set
484# CONFIG_FB_VIRTUAL is not set
485
486#
487# Logo configuration
488#
489# CONFIG_LOGO is not set
490CONFIG_BACKLIGHT_LCD_SUPPORT=y
491# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
492CONFIG_LCD_CLASS_DEVICE=m
493CONFIG_LCD_DEVICE=y
494CONFIG_LCD_LTV350QV=m
495 557
496# 558#
497# Sound 559# Sound
@@ -561,18 +623,21 @@ CONFIG_LCD_LTV350QV=m
561# 623#
562# File systems 624# File systems
563# 625#
564CONFIG_EXT2_FS=y 626CONFIG_EXT2_FS=m
565# CONFIG_EXT2_FS_XATTR is not set 627# CONFIG_EXT2_FS_XATTR is not set
566# CONFIG_EXT2_FS_XIP is not set 628# CONFIG_EXT2_FS_XIP is not set
567# CONFIG_EXT3_FS is not set 629# CONFIG_EXT3_FS is not set
630# CONFIG_EXT4DEV_FS is not set
568# CONFIG_REISERFS_FS is not set 631# CONFIG_REISERFS_FS is not set
569# CONFIG_JFS_FS is not set 632# CONFIG_JFS_FS is not set
570# CONFIG_FS_POSIX_ACL is not set 633# CONFIG_FS_POSIX_ACL is not set
571# CONFIG_XFS_FS is not set 634# CONFIG_XFS_FS is not set
635# CONFIG_GFS2_FS is not set
572# CONFIG_OCFS2_FS is not set 636# CONFIG_OCFS2_FS is not set
573CONFIG_MINIX_FS=m 637CONFIG_MINIX_FS=m
574CONFIG_ROMFS_FS=m 638# CONFIG_ROMFS_FS is not set
575# CONFIG_INOTIFY is not set 639CONFIG_INOTIFY=y
640CONFIG_INOTIFY_USER=y
576# CONFIG_QUOTA is not set 641# CONFIG_QUOTA is not set
577# CONFIG_DNOTIFY is not set 642# CONFIG_DNOTIFY is not set
578# CONFIG_AUTOFS_FS is not set 643# CONFIG_AUTOFS_FS is not set
@@ -600,8 +665,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
600# 665#
601CONFIG_PROC_FS=y 666CONFIG_PROC_FS=y
602CONFIG_PROC_KCORE=y 667CONFIG_PROC_KCORE=y
668CONFIG_PROC_SYSCTL=y
603CONFIG_SYSFS=y 669CONFIG_SYSFS=y
604CONFIG_TMPFS=y 670CONFIG_TMPFS=y
671# CONFIG_TMPFS_POSIX_ACL is not set
605# CONFIG_HUGETLB_PAGE is not set 672# CONFIG_HUGETLB_PAGE is not set
606CONFIG_RAMFS=y 673CONFIG_RAMFS=y
607CONFIG_CONFIGFS_FS=m 674CONFIG_CONFIGFS_FS=m
@@ -616,6 +683,16 @@ CONFIG_CONFIGFS_FS=m
616# CONFIG_BEFS_FS is not set 683# CONFIG_BEFS_FS is not set
617# CONFIG_BFS_FS is not set 684# CONFIG_BFS_FS is not set
618# CONFIG_EFS_FS is not set 685# CONFIG_EFS_FS is not set
686# CONFIG_JFFS_FS is not set
687CONFIG_JFFS2_FS=y
688CONFIG_JFFS2_FS_DEBUG=0
689CONFIG_JFFS2_FS_WRITEBUFFER=y
690# CONFIG_JFFS2_SUMMARY is not set
691# CONFIG_JFFS2_FS_XATTR is not set
692# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
693CONFIG_JFFS2_ZLIB=y
694CONFIG_JFFS2_RTIME=y
695# CONFIG_JFFS2_RUBIN is not set
619# CONFIG_CRAMFS is not set 696# CONFIG_CRAMFS is not set
620# CONFIG_VXFS_FS is not set 697# CONFIG_VXFS_FS is not set
621# CONFIG_HPFS_FS is not set 698# CONFIG_HPFS_FS is not set
@@ -626,26 +703,10 @@ CONFIG_CONFIGFS_FS=m
626# 703#
627# Network File Systems 704# Network File Systems
628# 705#
629CONFIG_NFS_FS=y 706# CONFIG_NFS_FS is not set
630CONFIG_NFS_V3=y
631# CONFIG_NFS_V3_ACL is not set
632# CONFIG_NFS_V4 is not set
633# CONFIG_NFS_DIRECTIO is not set
634# CONFIG_NFSD is not set 707# CONFIG_NFSD is not set
635CONFIG_ROOT_NFS=y
636CONFIG_LOCKD=y
637CONFIG_LOCKD_V4=y
638CONFIG_NFS_COMMON=y
639CONFIG_SUNRPC=y
640# CONFIG_RPCSEC_GSS_KRB5 is not set
641# CONFIG_RPCSEC_GSS_SPKM3 is not set
642# CONFIG_SMB_FS is not set 708# CONFIG_SMB_FS is not set
643CONFIG_CIFS=m 709# CONFIG_CIFS is not set
644# CONFIG_CIFS_STATS is not set
645# CONFIG_CIFS_WEAK_PW_HASH is not set
646# CONFIG_CIFS_XATTR is not set
647# CONFIG_CIFS_DEBUG2 is not set
648# CONFIG_CIFS_EXPERIMENTAL is not set
649# CONFIG_NCP_FS is not set 710# CONFIG_NCP_FS is not set
650# CONFIG_CODA_FS is not set 711# CONFIG_CODA_FS is not set
651# CONFIG_AFS_FS is not set 712# CONFIG_AFS_FS is not set
@@ -665,7 +726,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
665CONFIG_NLS_CODEPAGE_437=m 726CONFIG_NLS_CODEPAGE_437=m
666# CONFIG_NLS_CODEPAGE_737 is not set 727# CONFIG_NLS_CODEPAGE_737 is not set
667# CONFIG_NLS_CODEPAGE_775 is not set 728# CONFIG_NLS_CODEPAGE_775 is not set
668CONFIG_NLS_CODEPAGE_850=m 729# CONFIG_NLS_CODEPAGE_850 is not set
669# CONFIG_NLS_CODEPAGE_852 is not set 730# CONFIG_NLS_CODEPAGE_852 is not set
670# CONFIG_NLS_CODEPAGE_855 is not set 731# CONFIG_NLS_CODEPAGE_855 is not set
671# CONFIG_NLS_CODEPAGE_857 is not set 732# CONFIG_NLS_CODEPAGE_857 is not set
@@ -705,13 +766,17 @@ CONFIG_NLS_UTF8=m
705# Kernel hacking 766# Kernel hacking
706# 767#
707CONFIG_TRACE_IRQFLAGS_SUPPORT=y 768CONFIG_TRACE_IRQFLAGS_SUPPORT=y
708CONFIG_PRINTK_TIME=y 769# CONFIG_PRINTK_TIME is not set
770CONFIG_ENABLE_MUST_CHECK=y
709CONFIG_MAGIC_SYSRQ=y 771CONFIG_MAGIC_SYSRQ=y
710# CONFIG_UNUSED_SYMBOLS is not set 772# CONFIG_UNUSED_SYMBOLS is not set
711CONFIG_DEBUG_KERNEL=y 773CONFIG_DEBUG_KERNEL=y
712CONFIG_LOG_BUF_SHIFT=14 774CONFIG_LOG_BUF_SHIFT=14
713CONFIG_DETECT_SOFTLOCKUP=y 775CONFIG_DETECT_SOFTLOCKUP=y
714# CONFIG_SCHEDSTATS is not set 776# CONFIG_SCHEDSTATS is not set
777# CONFIG_DEBUG_SLAB is not set
778# CONFIG_DEBUG_RT_MUTEXES is not set
779# CONFIG_RT_MUTEX_TESTER is not set
715# CONFIG_DEBUG_SPINLOCK is not set 780# CONFIG_DEBUG_SPINLOCK is not set
716# CONFIG_DEBUG_MUTEXES is not set 781# CONFIG_DEBUG_MUTEXES is not set
717# CONFIG_DEBUG_RWSEMS is not set 782# CONFIG_DEBUG_RWSEMS is not set
@@ -722,11 +787,13 @@ CONFIG_DEBUG_BUGVERBOSE=y
722# CONFIG_DEBUG_INFO is not set 787# CONFIG_DEBUG_INFO is not set
723CONFIG_DEBUG_FS=y 788CONFIG_DEBUG_FS=y
724# CONFIG_DEBUG_VM is not set 789# CONFIG_DEBUG_VM is not set
790# CONFIG_DEBUG_LIST is not set
725CONFIG_FRAME_POINTER=y 791CONFIG_FRAME_POINTER=y
726# CONFIG_UNWIND_INFO is not set 792# CONFIG_UNWIND_INFO is not set
727CONFIG_FORCED_INLINING=y 793CONFIG_FORCED_INLINING=y
794# CONFIG_HEADERS_CHECK is not set
728# CONFIG_RCU_TORTURE_TEST is not set 795# CONFIG_RCU_TORTURE_TEST is not set
729CONFIG_KPROBES=y 796# CONFIG_KPROBES is not set
730 797
731# 798#
732# Security options 799# Security options
@@ -740,15 +807,13 @@ CONFIG_KPROBES=y
740# CONFIG_CRYPTO is not set 807# CONFIG_CRYPTO is not set
741 808
742# 809#
743# Hardware crypto devices
744#
745
746#
747# Library routines 810# Library routines
748# 811#
749CONFIG_CRC_CCITT=m 812CONFIG_CRC_CCITT=m
750# CONFIG_CRC16 is not set 813# CONFIG_CRC16 is not set
751CONFIG_CRC32=m 814CONFIG_CRC32=y
752# CONFIG_LIBCRC32C is not set 815# CONFIG_LIBCRC32C is not set
753CONFIG_ZLIB_INFLATE=m 816CONFIG_AUDIT_GENERIC=y
754CONFIG_ZLIB_DEFLATE=m 817CONFIG_ZLIB_INFLATE=y
818CONFIG_ZLIB_DEFLATE=y
819CONFIG_PLIST=y
diff --git a/arch/avr32/kernel/avr32_ksyms.c b/arch/avr32/kernel/avr32_ksyms.c
index 04f767a272b..372e3f8b241 100644
--- a/arch/avr32/kernel/avr32_ksyms.c
+++ b/arch/avr32/kernel/avr32_ksyms.c
@@ -7,6 +7,7 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/io.h>
10#include <linux/module.h> 11#include <linux/module.h>
11 12
12#include <asm/checksum.h> 13#include <asm/checksum.h>
@@ -53,3 +54,11 @@ EXPORT_SYMBOL(find_next_zero_bit);
53EXPORT_SYMBOL(find_first_bit); 54EXPORT_SYMBOL(find_first_bit);
54EXPORT_SYMBOL(find_next_bit); 55EXPORT_SYMBOL(find_next_bit);
55EXPORT_SYMBOL(generic_find_next_zero_le_bit); 56EXPORT_SYMBOL(generic_find_next_zero_le_bit);
57
58/* I/O primitives (lib/io-*.S) */
59EXPORT_SYMBOL(__raw_readsb);
60EXPORT_SYMBOL(__raw_readsw);
61EXPORT_SYMBOL(__raw_readsl);
62EXPORT_SYMBOL(__raw_writesb);
63EXPORT_SYMBOL(__raw_writesw);
64EXPORT_SYMBOL(__raw_writesl);
diff --git a/arch/avr32/kernel/head.S b/arch/avr32/kernel/head.S
index 773b7ad87be..6163bd0acb9 100644
--- a/arch/avr32/kernel/head.S
+++ b/arch/avr32/kernel/head.S
@@ -30,9 +30,6 @@ kernel_entry:
30 mov r7, 0 30 mov r7, 0
31#endif 31#endif
32 32
33 /* Set up the PIO, SDRAM controller, early printk, etc. */
34 rcall board_early_init
35
36 /* Start the show */ 33 /* Start the show */
37 lddpc pc, kernel_start_addr 34 lddpc pc, kernel_start_addr
38 35
diff --git a/arch/avr32/kernel/kprobes.c b/arch/avr32/kernel/kprobes.c
index 6caf9e8d808..ca41fc1edbe 100644
--- a/arch/avr32/kernel/kprobes.c
+++ b/arch/avr32/kernel/kprobes.c
@@ -109,7 +109,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
109 void *addr = (void *)regs->pc; 109 void *addr = (void *)regs->pc;
110 int ret = 0; 110 int ret = 0;
111 111
112 pr_debug("kprobe_handler: kprobe_running=%d\n", 112 pr_debug("kprobe_handler: kprobe_running=%p\n",
113 kprobe_running()); 113 kprobe_running());
114 114
115 /* 115 /*
diff --git a/arch/avr32/kernel/module.c b/arch/avr32/kernel/module.c
index dfc32f2817b..b599eae6457 100644
--- a/arch/avr32/kernel/module.c
+++ b/arch/avr32/kernel/module.c
@@ -263,7 +263,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
263 * value of PC. Just subtract the value of 263 * value of PC. Just subtract the value of
264 * GOT, and we're done. 264 * GOT, and we're done.
265 */ 265 */
266 pr_debug("GOTPC: PC=0x%lx, got_offset=0x%lx, core=0x%p\n", 266 pr_debug("GOTPC: PC=0x%x, got_offset=0x%lx, core=0x%p\n",
267 relocation, module->arch.got_offset, 267 relocation, module->arch.got_offset,
268 module->module_core); 268 module->module_core);
269 relocation -= ((unsigned long)module->module_core 269 relocation -= ((unsigned long)module->module_core
@@ -282,7 +282,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
282 && (relocation & 0xffff0000) != 0xffff0000) 282 && (relocation & 0xffff0000) != 0xffff0000)
283 return reloc_overflow(module, "R_AVR32_GOT16S", 283 return reloc_overflow(module, "R_AVR32_GOT16S",
284 relocation); 284 relocation);
285 pr_debug("GOT reloc @ 0x%lx -> %lu\n", 285 pr_debug("GOT reloc @ 0x%x -> %u\n",
286 rel->r_offset, relocation); 286 rel->r_offset, relocation);
287 value = *location; 287 value = *location;
288 value = ((value & 0xffff0000) 288 value = ((value & 0xffff0000)
diff --git a/arch/avr32/kernel/ptrace.c b/arch/avr32/kernel/ptrace.c
index 3c89e59029a..f2e81cd7900 100644
--- a/arch/avr32/kernel/ptrace.c
+++ b/arch/avr32/kernel/ptrace.c
@@ -157,7 +157,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
157 unsigned long tmp; 157 unsigned long tmp;
158 int ret; 158 int ret;
159 159
160 pr_debug("arch_ptrace(%ld, %ld, %#lx, %#lx)\n", 160 pr_debug("arch_ptrace(%ld, %d, %#lx, %#lx)\n",
161 request, child->pid, addr, data); 161 request, child->pid, addr, data);
162 162
163 pr_debug("ptrace: Enabling monitor mode...\n"); 163 pr_debug("ptrace: Enabling monitor mode...\n");
diff --git a/arch/avr32/kernel/syscall-stubs.S b/arch/avr32/kernel/syscall-stubs.S
index 7589a9b426c..890286a1e62 100644
--- a/arch/avr32/kernel/syscall-stubs.S
+++ b/arch/avr32/kernel/syscall-stubs.S
@@ -100,3 +100,12 @@ __sys_splice:
100 rcall sys_splice 100 rcall sys_splice
101 sub sp, -4 101 sub sp, -4
102 popm pc 102 popm pc
103
104 .global __sys_epoll_pwait
105 .type __sys_epoll_pwait,@function
106__sys_epoll_pwait:
107 pushm lr
108 st.w --sp, ARG6
109 rcall sys_epoll_pwait
110 sub sp, -4
111 popm pc
diff --git a/arch/avr32/kernel/syscall_table.S b/arch/avr32/kernel/syscall_table.S
index 63b206965d0..db8f8b55ffd 100644
--- a/arch/avr32/kernel/syscall_table.S
+++ b/arch/avr32/kernel/syscall_table.S
@@ -286,4 +286,5 @@ sys_call_table:
286 .long sys_sync_file_range 286 .long sys_sync_file_range
287 .long sys_tee 287 .long sys_tee
288 .long sys_vmsplice 288 .long sys_vmsplice
289 .long __sys_epoll_pwait /* 265 */
289 .long sys_ni_syscall /* r8 is saturated at nr_syscalls */ 290 .long sys_ni_syscall /* r8 is saturated at nr_syscalls */
diff --git a/arch/avr32/kernel/vmlinux.lds.c b/arch/avr32/kernel/vmlinux.lds.c
index cdd627c6b7d..5c4424e362b 100644
--- a/arch/avr32/kernel/vmlinux.lds.c
+++ b/arch/avr32/kernel/vmlinux.lds.c
@@ -38,13 +38,7 @@ SECTIONS
38 __setup_end = .; 38 __setup_end = .;
39 . = ALIGN(4); 39 . = ALIGN(4);
40 __initcall_start = .; 40 __initcall_start = .;
41 *(.initcall1.init) 41 INITCALLS
42 *(.initcall2.init)
43 *(.initcall3.init)
44 *(.initcall4.init)
45 *(.initcall5.init)
46 *(.initcall6.init)
47 *(.initcall7.init)
48 __initcall_end = .; 42 __initcall_end = .;
49 __con_initcall_start = .; 43 __con_initcall_start = .;
50 *(.con_initcall.init) 44 *(.con_initcall.init)
diff --git a/arch/avr32/lib/Makefile b/arch/avr32/lib/Makefile
index 09ac43e4052..084d95bac5e 100644
--- a/arch/avr32/lib/Makefile
+++ b/arch/avr32/lib/Makefile
@@ -7,4 +7,5 @@ lib-y += strncpy_from_user.o strnlen_user.o
7lib-y += delay.o memset.o memcpy.o findbit.o 7lib-y += delay.o memset.o memcpy.o findbit.o
8lib-y += csum_partial.o csum_partial_copy_generic.o 8lib-y += csum_partial.o csum_partial_copy_generic.o
9lib-y += io-readsw.o io-readsl.o io-writesw.o io-writesl.o 9lib-y += io-readsw.o io-readsl.o io-writesw.o io-writesl.o
10lib-y += io-readsb.o io-writesb.o
10lib-y += __avr32_lsl64.o __avr32_lsr64.o __avr32_asr64.o 11lib-y += __avr32_lsl64.o __avr32_lsr64.o __avr32_asr64.o
diff --git a/arch/avr32/lib/findbit.S b/arch/avr32/lib/findbit.S
index 2b4856f4bf7..c6b91dee857 100644
--- a/arch/avr32/lib/findbit.S
+++ b/arch/avr32/lib/findbit.S
@@ -136,6 +136,7 @@ ENTRY(generic_find_next_zero_le_bit)
136 /* offset is not word-aligned. Handle the first (32 - r10) bits */ 136 /* offset is not word-aligned. Handle the first (32 - r10) bits */
137 ldswp.w r8, r12[0] 137 ldswp.w r8, r12[0]
138 sub r12, -4 138 sub r12, -4
139 com r8
139 lsr r8, r8, r10 140 lsr r8, r8, r10
140 brne .L_found 141 brne .L_found
141 142
@@ -146,7 +147,7 @@ ENTRY(generic_find_next_zero_le_bit)
146 147
147 /* Main loop. offset must be word-aligned */ 148 /* Main loop. offset must be word-aligned */
1481: ldswp.w r8, r12[0] 1491: ldswp.w r8, r12[0]
149 cp.w r8, 0 150 com r8
150 brne .L_found 151 brne .L_found
151 sub r12, -4 152 sub r12, -4
152 sub r9, 32 153 sub r9, 32
diff --git a/arch/avr32/lib/io-readsb.S b/arch/avr32/lib/io-readsb.S
new file mode 100644
index 00000000000..2be5da7ed26
--- /dev/null
+++ b/arch/avr32/lib/io-readsb.S
@@ -0,0 +1,49 @@
1/*
2 * Copyright (C) 2004-2006 Atmel 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9 .text
10.Lnot_word_aligned:
111: ld.ub r8, r12[0]
12 sub r10, 1
13 st.b r11++, r8
14 reteq r12
15 tst r11, r9
16 brne 1b
17
18 /* fall through */
19
20 .global __raw_readsb
21 .type __raw_readsb,@function
22__raw_readsb:
23 cp.w r10, 0
24 mov r9, 3
25 reteq r12
26
27 tst r11, r9
28 brne .Lnot_word_aligned
29
30 sub r10, 4
31 brlt 2f
32
331: ldins.b r8:t, r12[0]
34 ldins.b r8:u, r12[0]
35 ldins.b r8:l, r12[0]
36 ldins.b r8:b, r12[0]
37 st.w r11++, r8
38 sub r10, 4
39 brge 1b
40
412: sub r10, -4
42 reteq r12
43
443: ld.uh r8, r12[0]
45 sub r10, 1
46 st.b r11++, r8
47 brne 3b
48
49 retal r12
diff --git a/arch/avr32/lib/io-writesb.S b/arch/avr32/lib/io-writesb.S
new file mode 100644
index 00000000000..b4ebaacccf6
--- /dev/null
+++ b/arch/avr32/lib/io-writesb.S
@@ -0,0 +1,52 @@
1/*
2 * Copyright (C) 2004-2006 Atmel 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9 .text
10.Lnot_word_aligned:
111: ld.ub r8, r11++
12 sub r10, 1
13 st.b r12[0], r8
14 reteq r12
15 tst r11, r9
16 brne 1b
17
18 /* fall through */
19
20 .global __raw_writesb
21 .type __raw_writesb,@function
22__raw_writesb:
23 cp.w r10, 0
24 mov r9, 3
25 reteq r12
26
27 tst r11, r9
28 brne .Lnot_word_aligned
29
30 sub r10, 4
31 brlt 2f
32
331: ld.w r8, r11++
34 bfextu r9, r8, 24, 8
35 st.b r12[0], r9
36 bfextu r9, r8, 16, 8
37 st.b r12[0], r9
38 bfextu r9, r8, 8, 8
39 st.b r12[0], r9
40 st.b r12[0], r8
41 sub r10, 4
42 brge 1b
43
442: sub r10, -4
45 reteq r12
46
473: ld.ub r8, r11++
48 sub r10, 1
49 st.b r12[0], r8
50 brne 3b
51
52 retal r12
diff --git a/arch/avr32/mach-at32ap/hsmc.h b/arch/avr32/mach-at32ap/hsmc.h
index 5681276fafd..d1d48e26e39 100644
--- a/arch/avr32/mach-at32ap/hsmc.h
+++ b/arch/avr32/mach-at32ap/hsmc.h
@@ -120,8 +120,8 @@
120 120
121/* Register access macros */ 121/* Register access macros */
122#define hsmc_readl(port,reg) \ 122#define hsmc_readl(port,reg) \
123 readl((port)->regs + HSMC_##reg) 123 __raw_readl((port)->regs + HSMC_##reg)
124#define hsmc_writel(port,reg,value) \ 124#define hsmc_writel(port,reg,value) \
125 writel((value), (port)->regs + HSMC_##reg) 125 __raw_writel((value), (port)->regs + HSMC_##reg)
126 126
127#endif /* __ASM_AVR32_HSMC_H__ */ 127#endif /* __ASM_AVR32_HSMC_H__ */
diff --git a/arch/avr32/mach-at32ap/intc.h b/arch/avr32/mach-at32ap/intc.h
index d289ca2fff1..4d3664e43a8 100644
--- a/arch/avr32/mach-at32ap/intc.h
+++ b/arch/avr32/mach-at32ap/intc.h
@@ -321,7 +321,9 @@
321#define INTC_MKBF(name, value) (((value) & ((1 << INTC_##name##_SIZE) - 1)) << INTC_##name##_OFFSET) 321#define INTC_MKBF(name, value) (((value) & ((1 << INTC_##name##_SIZE) - 1)) << INTC_##name##_OFFSET)
322#define INTC_GETBF(name, value) (((value) >> INTC_##name##_OFFSET) & ((1 << INTC_##name##_SIZE) - 1)) 322#define INTC_GETBF(name, value) (((value) >> INTC_##name##_OFFSET) & ((1 << INTC_##name##_SIZE) - 1))
323 323
324#define intc_readl(port,reg) readl((port)->regs + INTC_##reg) 324#define intc_readl(port,reg) \
325#define intc_writel(port,reg,value) writel((value), (port)->regs + INTC_##reg) 325 __raw_readl((port)->regs + INTC_##reg)
326#define intc_writel(port,reg,value) \
327 __raw_writel((value), (port)->regs + INTC_##reg)
326 328
327#endif /* __ASM_AVR32_PERIHP_INTC_H__ */ 329#endif /* __ASM_AVR32_PERIHP_INTC_H__ */
diff --git a/arch/avr32/mach-at32ap/pio.h b/arch/avr32/mach-at32ap/pio.h
index cfea1235159..50fa3aca32c 100644
--- a/arch/avr32/mach-at32ap/pio.h
+++ b/arch/avr32/mach-at32ap/pio.h
@@ -170,8 +170,10 @@
170#define PIO_BFINS(name,value,old) (((old) & ~(((1 << PIO_##name##_SIZE) - 1) << PIO_##name##_OFFSET)) | PIO_BF(name,value)) 170#define PIO_BFINS(name,value,old) (((old) & ~(((1 << PIO_##name##_SIZE) - 1) << PIO_##name##_OFFSET)) | PIO_BF(name,value))
171 171
172/* Register access macros */ 172/* Register access macros */
173#define pio_readl(port,reg) readl((port)->regs + PIO_##reg) 173#define pio_readl(port,reg) \
174#define pio_writel(port,reg,value) writel((value), (port)->regs + PIO_##reg) 174 __raw_readl((port)->regs + PIO_##reg)
175#define pio_writel(port,reg,value) \
176 __raw_writel((value), (port)->regs + PIO_##reg)
175 177
176void at32_init_pio(struct platform_device *pdev); 178void at32_init_pio(struct platform_device *pdev);
177 179
diff --git a/arch/avr32/mach-at32ap/sm.h b/arch/avr32/mach-at32ap/sm.h
index 27565822ae2..cad02b512bc 100644
--- a/arch/avr32/mach-at32ap/sm.h
+++ b/arch/avr32/mach-at32ap/sm.h
@@ -234,7 +234,9 @@
234#define SM_BFINS(name,value,old) (((old) & ~(((1 << SM_##name##_SIZE) - 1) << SM_##name##_OFFSET)) | SM_BF(name,value)) 234#define SM_BFINS(name,value,old) (((old) & ~(((1 << SM_##name##_SIZE) - 1) << SM_##name##_OFFSET)) | SM_BF(name,value))
235 235
236/* Register access macros */ 236/* Register access macros */
237#define sm_readl(port,reg) readl((port)->regs + SM_##reg) 237#define sm_readl(port,reg) \
238#define sm_writel(port,reg,value) writel((value), (port)->regs + SM_##reg) 238 __raw_readl((port)->regs + SM_##reg)
239#define sm_writel(port,reg,value) \
240 __raw_writel((value), (port)->regs + SM_##reg)
239 241
240#endif /* __ASM_AVR32_SM_H__ */ 242#endif /* __ASM_AVR32_SM_H__ */
diff --git a/arch/avr32/mm/init.c b/arch/avr32/mm/init.c
index 3e6c4103980..70da6894acc 100644
--- a/arch/avr32/mm/init.c
+++ b/arch/avr32/mm/init.c
@@ -206,7 +206,7 @@ void __init setup_bootmem(void)
206 206
207 if (mem_ramdisk) { 207 if (mem_ramdisk) {
208#ifdef CONFIG_BLK_DEV_INITRD 208#ifdef CONFIG_BLK_DEV_INITRD
209 initrd_start = __va(mem_ramdisk->addr); 209 initrd_start = (unsigned long)__va(mem_ramdisk->addr);
210 initrd_end = initrd_start + mem_ramdisk->size; 210 initrd_end = initrd_start + mem_ramdisk->size;
211 211
212 print_memory_map("RAMDISK images", mem_ramdisk); 212 print_memory_map("RAMDISK images", mem_ramdisk);
diff --git a/arch/avr32/mm/ioremap.c b/arch/avr32/mm/ioremap.c
index 8cfec65e37f..3437c82434a 100644
--- a/arch/avr32/mm/ioremap.c
+++ b/arch/avr32/mm/ioremap.c
@@ -77,6 +77,8 @@ void __iounmap(void __iomem *addr)
77 77
78 if ((unsigned long)addr >= P4SEG) 78 if ((unsigned long)addr >= P4SEG)
79 return; 79 return;
80 if (PXSEG(addr) == P2SEG)
81 return;
80 82
81 p = remove_vm_area((void *)(PAGE_MASK & (unsigned long __force)addr)); 83 p = remove_vm_area((void *)(PAGE_MASK & (unsigned long __force)addr));
82 if (unlikely(!p)) { 84 if (unlikely(!p)) {
diff --git a/arch/cris/arch-v10/Kconfig b/arch/cris/arch-v10/Kconfig
index 44eb1b9accb..c7ea9efd010 100644
--- a/arch/cris/arch-v10/Kconfig
+++ b/arch/cris/arch-v10/Kconfig
@@ -323,7 +323,7 @@ config ETRAX_DEF_R_WAITSTATES
323 depends on ETRAX_ARCH_V10 323 depends on ETRAX_ARCH_V10
324 default "95a6" 324 default "95a6"
325 help 325 help
326 Waitstates for SRAM, Flash and peripherials (not DRAM). 95f8 is a 326 Waitstates for SRAM, Flash and peripherals (not DRAM). 95f8 is a
327 good choice for most Axis products... 327 good choice for most Axis products...
328 328
329config ETRAX_DEF_R_BUS_CONFIG 329config ETRAX_DEF_R_BUS_CONFIG
diff --git a/arch/cris/arch-v10/drivers/Kconfig b/arch/cris/arch-v10/drivers/Kconfig
index 734d5f3a530..e7e724bc0ba 100644
--- a/arch/cris/arch-v10/drivers/Kconfig
+++ b/arch/cris/arch-v10/drivers/Kconfig
@@ -839,7 +839,7 @@ config ETRAX_DS1302_TRICKLE_CHARGE
839 default "0" 839 default "0"
840 help 840 help
841 This controls the initial value of the trickle charge register. 841 This controls the initial value of the trickle charge register.
842 0 = disabled (use this if you are unsure or have a non rechargable battery) 842 0 = disabled (use this if you are unsure or have a non rechargeable battery)
843 Otherwise the following values can be OR:ed together to control the 843 Otherwise the following values can be OR:ed together to control the
844 charge current: 844 charge current:
845 1 = 2kohm, 2 = 4kohm, 3 = 4kohm 845 1 = 2kohm, 2 = 4kohm, 3 = 4kohm
diff --git a/arch/cris/arch-v10/drivers/eeprom.c b/arch/cris/arch-v10/drivers/eeprom.c
index 6e1f191a71e..284ebfda03f 100644
--- a/arch/cris/arch-v10/drivers/eeprom.c
+++ b/arch/cris/arch-v10/drivers/eeprom.c
@@ -1,7 +1,7 @@
1/*!***************************************************************************** 1/*!*****************************************************************************
2*! 2*!
3*! Implements an interface for i2c compatible eeproms to run under linux. 3*! Implements an interface for i2c compatible eeproms to run under Linux.
4*! Supports 2k, 8k(?) and 16k. Uses adaptive timing adjustents by 4*! Supports 2k, 8k(?) and 16k. Uses adaptive timing adjustments by
5*! Johan.Adolfsson@axis.com 5*! Johan.Adolfsson@axis.com
6*! 6*!
7*! Probing results: 7*! Probing results:
@@ -51,7 +51,7 @@
51*! Revision 1.8 2001/06/15 13:24:29 jonashg 51*! Revision 1.8 2001/06/15 13:24:29 jonashg
52*! * Added verification of pointers from userspace in read and write. 52*! * Added verification of pointers from userspace in read and write.
53*! * Made busy counter volatile. 53*! * Made busy counter volatile.
54*! * Added define for inital write delay. 54*! * Added define for initial write delay.
55*! * Removed warnings by using loff_t instead of unsigned long. 55*! * Removed warnings by using loff_t instead of unsigned long.
56*! 56*!
57*! Revision 1.7 2001/06/14 15:26:54 jonashg 57*! Revision 1.7 2001/06/14 15:26:54 jonashg
diff --git a/arch/cris/arch-v10/drivers/i2c.c b/arch/cris/arch-v10/drivers/i2c.c
index 6114596c3b3..092c724a645 100644
--- a/arch/cris/arch-v10/drivers/i2c.c
+++ b/arch/cris/arch-v10/drivers/i2c.c
@@ -47,7 +47,7 @@
47*! Update Port B register and shadow even when running with hardware support 47*! Update Port B register and shadow even when running with hardware support
48*! to avoid glitches when reading bits 48*! to avoid glitches when reading bits
49*! Never set direction to out in i2c_inbyte 49*! Never set direction to out in i2c_inbyte
50*! Removed incorrect clock togling at end of i2c_inbyte 50*! Removed incorrect clock toggling at end of i2c_inbyte
51*! 51*!
52*! Revision 1.8 2002/08/13 06:31:53 starvik 52*! Revision 1.8 2002/08/13 06:31:53 starvik
53*! Made SDA and SCL line configurable 53*! Made SDA and SCL line configurable
diff --git a/arch/cris/arch-v10/kernel/kgdb.c b/arch/cris/arch-v10/kernel/kgdb.c
index 34528da9881..07628a13c6c 100644
--- a/arch/cris/arch-v10/kernel/kgdb.c
+++ b/arch/cris/arch-v10/kernel/kgdb.c
@@ -33,7 +33,7 @@
33*! 33*!
34*! Revision 1.2 2002/11/19 14:35:24 starvik 34*! Revision 1.2 2002/11/19 14:35:24 starvik
35*! Changes from linux 2.4 35*! Changes from linux 2.4
36*! Changed struct initializer syntax to the currently prefered notation 36*! Changed struct initializer syntax to the currently preferred notation
37*! 37*!
38*! Revision 1.1 2001/12/17 13:59:27 bjornw 38*! Revision 1.1 2001/12/17 13:59:27 bjornw
39*! Initial revision 39*! Initial revision
diff --git a/arch/cris/arch-v10/lib/old_checksum.c b/arch/cris/arch-v10/lib/old_checksum.c
index 22a6f0aa9ce..497634a6482 100644
--- a/arch/cris/arch-v10/lib/old_checksum.c
+++ b/arch/cris/arch-v10/lib/old_checksum.c
@@ -47,39 +47,41 @@
47 47
48#include <asm/delay.h> 48#include <asm/delay.h>
49 49
50unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) 50__wsum csum_partial(const void *p, int len, __wsum __sum)
51{ 51{
52 /* 52 u32 sum = (__force u32)__sum;
53 * Experiments with ethernet and slip connections show that buff 53 const u16 *buff = p;
54 * is aligned on either a 2-byte or 4-byte boundary. 54 /*
55 */ 55 * Experiments with ethernet and slip connections show that buff
56 const unsigned char *endMarker = buff + len; 56 * is aligned on either a 2-byte or 4-byte boundary.
57 const unsigned char *marker = endMarker - (len % 16); 57 */
58 const void *endMarker = p + len;
59 const void *marker = endMarker - (len % 16);
58#if 0 60#if 0
59 if((int)buff & 0x3) 61 if((int)buff & 0x3)
60 printk("unaligned buff %p\n", buff); 62 printk("unaligned buff %p\n", buff);
61 __delay(900); /* extra delay of 90 us to test performance hit */ 63 __delay(900); /* extra delay of 90 us to test performance hit */
62#endif 64#endif
63 BITON; 65 BITON;
64 while (buff < marker) { 66 while (buff < marker) {
65 sum += *((unsigned short *)buff)++; 67 sum += *buff++;
66 sum += *((unsigned short *)buff)++; 68 sum += *buff++;
67 sum += *((unsigned short *)buff)++; 69 sum += *buff++;
68 sum += *((unsigned short *)buff)++; 70 sum += *buff++;
69 sum += *((unsigned short *)buff)++; 71 sum += *buff++;
70 sum += *((unsigned short *)buff)++; 72 sum += *buff++;
71 sum += *((unsigned short *)buff)++; 73 sum += *buff++;
72 sum += *((unsigned short *)buff)++; 74 sum += *buff++;
73 } 75 }
74 marker = endMarker - (len % 2); 76 marker = endMarker - (len % 2);
75 while(buff < marker) { 77 while (buff < marker)
76 sum += *((unsigned short *)buff)++; 78 sum += *buff++;
77 } 79
78 if(endMarker - buff > 0) { 80 if (endMarker > buff)
79 sum += *buff; /* add extra byte seperately */ 81 sum += *(const u8 *)buff; /* add extra byte seperately */
80 } 82
81 BITOFF; 83 BITOFF;
82 return(sum); 84 return (__force __wsum)sum;
83} 85}
84 86
85EXPORT_SYMBOL(csum_partial); 87EXPORT_SYMBOL(csum_partial);
diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig
index a33097f9536..f64624fc450 100644
--- a/arch/cris/arch-v32/drivers/Kconfig
+++ b/arch/cris/arch-v32/drivers/Kconfig
@@ -88,7 +88,7 @@ config ETRAX_SERIAL_PORT0_DMA7_IN
88 help 88 help
89 Enables the DMA7 input channel for ser0 (ttyS0). 89 Enables the DMA7 input channel for ser0 (ttyS0).
90 If you do not enable DMA, an interrupt for each character will be 90 If you do not enable DMA, an interrupt for each character will be
91 used when receiveing data. 91 used when receiving data.
92 Normally you want to use DMA, unless you use the DMA channel for 92 Normally you want to use DMA, unless you use the DMA channel for
93 something else. 93 something else.
94 94
@@ -157,7 +157,7 @@ config ETRAX_SERIAL_PORT1_DMA5_IN
157 help 157 help
158 Enables the DMA5 input channel for ser1 (ttyS1). 158 Enables the DMA5 input channel for ser1 (ttyS1).
159 If you do not enable DMA, an interrupt for each character will be 159 If you do not enable DMA, an interrupt for each character will be
160 used when receiveing data. 160 used when receiving data.
161 Normally you want this on, unless you use the DMA channel for 161 Normally you want this on, unless you use the DMA channel for
162 something else. 162 something else.
163 163
@@ -228,7 +228,7 @@ config ETRAX_SERIAL_PORT2_DMA3_IN
228 help 228 help
229 Enables the DMA3 input channel for ser2 (ttyS2). 229 Enables the DMA3 input channel for ser2 (ttyS2).
230 If you do not enable DMA, an interrupt for each character will be 230 If you do not enable DMA, an interrupt for each character will be
231 used when receiveing data. 231 used when receiving data.
232 Normally you want to use DMA, unless you use the DMA channel for 232 Normally you want to use DMA, unless you use the DMA channel for
233 something else. 233 something else.
234 234
@@ -297,7 +297,7 @@ config ETRAX_SERIAL_PORT3_DMA9_IN
297 help 297 help
298 Enables the DMA9 input channel for ser3 (ttyS3). 298 Enables the DMA9 input channel for ser3 (ttyS3).
299 If you do not enable DMA, an interrupt for each character will be 299 If you do not enable DMA, an interrupt for each character will be
300 used when receiveing data. 300 used when receiving data.
301 Normally you want to use DMA, unless you use the DMA channel for 301 Normally you want to use DMA, unless you use the DMA channel for
302 something else. 302 something else.
303 303
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index ba096ebb0b1..2449637e6fc 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -2051,7 +2051,6 @@ static void cryptocop_job_queue_close(void)
2051 spin_lock_irqsave(&cryptocop_process_lock, process_flags); 2051 spin_lock_irqsave(&cryptocop_process_lock, process_flags);
2052 2052
2053 /* Empty the job queue. */ 2053 /* Empty the job queue. */
2054 spin_lock_irqsave(&cryptocop_process_lock, process_flags);
2055 for (i = 0; i < cryptocop_prio_no_prios; i++){ 2054 for (i = 0; i < cryptocop_prio_no_prios; i++){
2056 if (!list_empty(&(cryptocop_job_queues[i].jobs))){ 2055 if (!list_empty(&(cryptocop_job_queues[i].jobs))){
2057 list_for_each_safe(node, tmp, &(cryptocop_job_queues[i].jobs)) { 2056 list_for_each_safe(node, tmp, &(cryptocop_job_queues[i].jobs)) {
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
index f474534ba78..9c1fb12367f 100644
--- a/arch/frv/kernel/vmlinux.lds.S
+++ b/arch/frv/kernel/vmlinux.lds.S
@@ -44,13 +44,7 @@ SECTIONS
44 44
45 __initcall_start = .; 45 __initcall_start = .;
46 .initcall.init : { 46 .initcall.init : {
47 *(.initcall1.init) 47 INITCALLS
48 *(.initcall2.init)
49 *(.initcall3.init)
50 *(.initcall4.init)
51 *(.initcall5.init)
52 *(.initcall6.init)
53 *(.initcall7.init)
54 } 48 }
55 __initcall_end = .; 49 __initcall_end = .;
56 __con_initcall_start = .; 50 __con_initcall_start = .;
diff --git a/arch/frv/lib/checksum.c b/arch/frv/lib/checksum.c
index 20e7dfc474e..44e16d59bc1 100644
--- a/arch/frv/lib/checksum.c
+++ b/arch/frv/lib/checksum.c
@@ -32,7 +32,6 @@
32 of the assembly has to go. */ 32 of the assembly has to go. */
33 33
34#include <net/checksum.h> 34#include <net/checksum.h>
35#include <asm/checksum.h>
36#include <linux/module.h> 35#include <linux/module.h>
37 36
38static inline unsigned short from32to16(unsigned long x) 37static inline unsigned short from32to16(unsigned long x)
@@ -105,15 +104,15 @@ out:
105 * 104 *
106 * it's best to have buff aligned on a 32-bit boundary 105 * it's best to have buff aligned on a 32-bit boundary
107 */ 106 */
108unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) 107__wsum csum_partial(const void *buff, int len, __wsum sum)
109{ 108{
110 unsigned int result = do_csum(buff, len); 109 unsigned int result = do_csum(buff, len);
111 110
112 /* add in old sum, and carry.. */ 111 /* add in old sum, and carry.. */
113 result += sum; 112 result += (__force u32)sum;
114 if (sum > result) 113 if ((__force u32)sum > result)
115 result += 1; 114 result += 1;
116 return result; 115 return (__force __wsum)result;
117} 116}
118 117
119EXPORT_SYMBOL(csum_partial); 118EXPORT_SYMBOL(csum_partial);
@@ -122,9 +121,9 @@ EXPORT_SYMBOL(csum_partial);
122 * this routine is used for miscellaneous IP-like checksums, mainly 121 * this routine is used for miscellaneous IP-like checksums, mainly
123 * in icmp.c 122 * in icmp.c
124 */ 123 */
125unsigned short ip_compute_csum(const unsigned char * buff, int len) 124__sum16 ip_compute_csum(const void *buff, int len)
126{ 125{
127 return ~do_csum(buff, len); 126 return (__force __sum16)~do_csum(buff, len);
128} 127}
129 128
130EXPORT_SYMBOL(ip_compute_csum); 129EXPORT_SYMBOL(ip_compute_csum);
@@ -132,9 +131,9 @@ EXPORT_SYMBOL(ip_compute_csum);
132/* 131/*
133 * copy from fs while checksumming, otherwise like csum_partial 132 * copy from fs while checksumming, otherwise like csum_partial
134 */ 133 */
135unsigned int 134__wsum
136csum_partial_copy_from_user(const char __user *src, char *dst, 135csum_partial_copy_from_user(const void __user *src, void *dst,
137 int len, int sum, int *csum_err) 136 int len, __wsum sum, int *csum_err)
138{ 137{
139 int rem; 138 int rem;
140 139
@@ -157,11 +156,11 @@ EXPORT_SYMBOL(csum_partial_copy_from_user);
157/* 156/*
158 * copy from ds while checksumming, otherwise like csum_partial 157 * copy from ds while checksumming, otherwise like csum_partial
159 */ 158 */
160unsigned int 159__wsum
161csum_partial_copy(const char *src, char *dst, int len, int sum) 160csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
162{ 161{
163 memcpy(dst, src, len); 162 memcpy(dst, src, len);
164 return csum_partial(dst, len, sum); 163 return csum_partial(dst, len, sum);
165} 164}
166 165
167EXPORT_SYMBOL(csum_partial_copy); 166EXPORT_SYMBOL(csum_partial_copy_nocheck);
diff --git a/arch/h8300/kernel/h8300_ksyms.c b/arch/h8300/kernel/h8300_ksyms.c
index 9b4be053de3..d1b15267ac8 100644
--- a/arch/h8300/kernel/h8300_ksyms.c
+++ b/arch/h8300/kernel/h8300_ksyms.c
@@ -39,7 +39,7 @@ EXPORT_SYMBOL(enable_irq);
39EXPORT_SYMBOL(disable_irq); 39EXPORT_SYMBOL(disable_irq);
40 40
41/* Networking helper routines. */ 41/* Networking helper routines. */
42EXPORT_SYMBOL(csum_partial_copy); 42EXPORT_SYMBOL(csum_partial_copy_nocheck);
43 43
44/* The following are special because they're not called 44/* The following are special because they're not called
45 explicitly (the C compiler generates them). Fortunately, 45 explicitly (the C compiler generates them). Fortunately,
diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S
index 6406c388f88..756325dd480 100644
--- a/arch/h8300/kernel/vmlinux.lds.S
+++ b/arch/h8300/kernel/vmlinux.lds.S
@@ -118,13 +118,7 @@ SECTIONS
118 . = ALIGN(0x4) ; 118 . = ALIGN(0x4) ;
119 ___setup_end = .; 119 ___setup_end = .;
120 ___initcall_start = .; 120 ___initcall_start = .;
121 *(.initcall1.init) 121 INITCALLS
122 *(.initcall2.init)
123 *(.initcall3.init)
124 *(.initcall4.init)
125 *(.initcall5.init)
126 *(.initcall6.init)
127 *(.initcall7.init)
128 ___initcall_end = .; 122 ___initcall_end = .;
129 ___con_initcall_start = .; 123 ___con_initcall_start = .;
130 *(.con_initcall.init) 124 *(.con_initcall.init)
diff --git a/arch/h8300/lib/checksum.c b/arch/h8300/lib/checksum.c
index 5aa688d9242..bdc5b032acd 100644
--- a/arch/h8300/lib/checksum.c
+++ b/arch/h8300/lib/checksum.c
@@ -96,9 +96,9 @@ out:
96 * This is a version of ip_compute_csum() optimized for IP headers, 96 * This is a version of ip_compute_csum() optimized for IP headers,
97 * which always checksum on 4 octet boundaries. 97 * which always checksum on 4 octet boundaries.
98 */ 98 */
99unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) 99__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
100{ 100{
101 return ~do_csum(iph,ihl*4); 101 return (__force __sum16)~do_csum(iph,ihl*4);
102} 102}
103 103
104/* 104/*
@@ -113,15 +113,19 @@ unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl)
113 * 113 *
114 * it's best to have buff aligned on a 32-bit boundary 114 * it's best to have buff aligned on a 32-bit boundary
115 */ 115 */
116unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) 116/*
117 * Egads... That thing apparently assumes that *all* checksums it ever sees will
118 * be folded. Very likely a bug.
119 */
120__wsum csum_partial(const void *buff, int len, __wsum sum)
117{ 121{
118 unsigned int result = do_csum(buff, len); 122 unsigned int result = do_csum(buff, len);
119 123
120 /* add in old sum, and carry.. */ 124 /* add in old sum, and carry.. */
121 result += sum; 125 result += (__force u32)sum;
122 /* 16+c bits -> 16 bits */ 126 /* 16+c bits -> 16 bits */
123 result = (result & 0xffff) + (result >> 16); 127 result = (result & 0xffff) + (result >> 16);
124 return result; 128 return (__force __wsum)result;
125} 129}
126 130
127EXPORT_SYMBOL(csum_partial); 131EXPORT_SYMBOL(csum_partial);
@@ -130,20 +134,21 @@ EXPORT_SYMBOL(csum_partial);
130 * this routine is used for miscellaneous IP-like checksums, mainly 134 * this routine is used for miscellaneous IP-like checksums, mainly
131 * in icmp.c 135 * in icmp.c
132 */ 136 */
133unsigned short ip_compute_csum(const unsigned char * buff, int len) 137__sum16 ip_compute_csum(const void *buff, int len)
134{ 138{
135 return ~do_csum(buff,len); 139 return (__force __sum16)~do_csum(buff,len);
136} 140}
137 141
138/* 142/*
139 * copy from fs while checksumming, otherwise like csum_partial 143 * copy from fs while checksumming, otherwise like csum_partial
140 */ 144 */
141 145
142unsigned int 146__wsum
143csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *csum_err) 147csum_partial_copy_from_user(const void __user *src, void *dst, int len,
148 __wsum sum, int *csum_err)
144{ 149{
145 if (csum_err) *csum_err = 0; 150 if (csum_err) *csum_err = 0;
146 memcpy(dst, src, len); 151 memcpy(dst, (__force const void *)src, len);
147 return csum_partial(dst, len, sum); 152 return csum_partial(dst, len, sum);
148} 153}
149 154
@@ -151,8 +156,8 @@ csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *c
151 * copy from ds while checksumming, otherwise like csum_partial 156 * copy from ds while checksumming, otherwise like csum_partial
152 */ 157 */
153 158
154unsigned int 159__wsum
155csum_partial_copy(const char *src, char *dst, int len, int sum) 160csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
156{ 161{
157 memcpy(dst, src, len); 162 memcpy(dst, src, len);
158 return csum_partial(dst, len, sum); 163 return csum_partial(dst, len, sum);
diff --git a/arch/i386/Makefile b/arch/i386/Makefile
index 7cc0b189b82..0677908dfa0 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -42,6 +42,10 @@ cflags-$(CONFIG_REGPARM) += -mregparm=3
42# temporary until string.h is fixed 42# temporary until string.h is fixed
43cflags-y += -ffreestanding 43cflags-y += -ffreestanding
44 44
45# this works around some issues with generating unwind tables in older gccs
46# newer gccs do it by default
47cflags-y += -maccumulate-outgoing-args
48
45# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use 49# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
46# a lot more stack due to the lack of sharing of stacklots: 50# a lot more stack due to the lack of sharing of stacklots:
47CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;) 51CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;)
@@ -51,8 +55,8 @@ cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
51AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,) 55AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
52 56
53# is .cfi_signal_frame supported too? 57# is .cfi_signal_frame supported too?
54cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,) 58cflags-y += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
55AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,) 59AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
56 60
57CFLAGS += $(cflags-y) 61CFLAGS += $(cflags-y)
58 62
diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index 60c0c02574f..97aacd6bd7d 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/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.19-rc1 3# Linux kernel version: 2.6.19-rc2-git4
4# Thu Oct 5 13:04:53 2006 4# Sat Oct 21 03:38:56 2006
5# 5#
6CONFIG_X86_32=y 6CONFIG_X86_32=y
7CONFIG_GENERIC_TIME=y 7CONFIG_GENERIC_TIME=y
@@ -380,8 +380,8 @@ CONFIG_INET6_XFRM_MODE_TRANSPORT=y
380CONFIG_INET6_XFRM_MODE_TUNNEL=y 380CONFIG_INET6_XFRM_MODE_TUNNEL=y
381# CONFIG_INET6_XFRM_MODE_BEET is not set 381# CONFIG_INET6_XFRM_MODE_BEET is not set
382# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set 382# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
383CONFIG_IPV6_SIT=y
383# CONFIG_IPV6_TUNNEL is not set 384# CONFIG_IPV6_TUNNEL is not set
384# CONFIG_IPV6_SUBTREES is not set
385# CONFIG_IPV6_MULTIPLE_TABLES is not set 385# CONFIG_IPV6_MULTIPLE_TABLES is not set
386# CONFIG_NETWORK_SECMARK is not set 386# CONFIG_NETWORK_SECMARK is not set
387# CONFIG_NETFILTER is not set 387# CONFIG_NETFILTER is not set
@@ -483,6 +483,13 @@ CONFIG_BLK_DEV_INITRD=y
483# CONFIG_ATA_OVER_ETH is not set 483# CONFIG_ATA_OVER_ETH is not set
484 484
485# 485#
486# Misc devices
487#
488# CONFIG_IBM_ASM is not set
489# CONFIG_SGI_IOC4 is not set
490# CONFIG_TIFM_CORE is not set
491
492#
486# ATA/ATAPI/MFM/RLL support 493# ATA/ATAPI/MFM/RLL support
487# 494#
488CONFIG_IDE=y 495CONFIG_IDE=y
@@ -1024,6 +1031,7 @@ CONFIG_HANGCHECK_TIMER=y
1024# 1031#
1025# Dallas's 1-wire bus 1032# Dallas's 1-wire bus
1026# 1033#
1034# CONFIG_W1 is not set
1027 1035
1028# 1036#
1029# Hardware Monitoring support 1037# Hardware Monitoring support
@@ -1032,12 +1040,6 @@ CONFIG_HANGCHECK_TIMER=y
1032# CONFIG_HWMON_VID is not set 1040# CONFIG_HWMON_VID is not set
1033 1041
1034# 1042#
1035# Misc devices
1036#
1037# CONFIG_IBM_ASM is not set
1038# CONFIG_TIFM_CORE is not set
1039
1040#
1041# Multimedia devices 1043# Multimedia devices
1042# 1044#
1043# CONFIG_VIDEO_DEV is not set 1045# CONFIG_VIDEO_DEV is not set
@@ -1169,7 +1171,6 @@ CONFIG_USB_HIDINPUT=y
1169# CONFIG_USB_ATI_REMOTE2 is not set 1171# CONFIG_USB_ATI_REMOTE2 is not set
1170# CONFIG_USB_KEYSPAN_REMOTE is not set 1172# CONFIG_USB_KEYSPAN_REMOTE is not set
1171# CONFIG_USB_APPLETOUCH is not set 1173# CONFIG_USB_APPLETOUCH is not set
1172# CONFIG_USB_TRANCEVIBRATOR is not set
1173 1174
1174# 1175#
1175# USB Imaging devices 1176# USB Imaging devices
@@ -1215,6 +1216,7 @@ CONFIG_USB_MON=y
1215# CONFIG_USB_APPLEDISPLAY is not set 1216# CONFIG_USB_APPLEDISPLAY is not set
1216# CONFIG_USB_SISUSBVGA is not set 1217# CONFIG_USB_SISUSBVGA is not set
1217# CONFIG_USB_LD is not set 1218# CONFIG_USB_LD is not set
1219# CONFIG_USB_TRANCEVIBRATOR is not set
1218# CONFIG_USB_TEST is not set 1220# CONFIG_USB_TEST is not set
1219 1221
1220# 1222#
@@ -1284,6 +1286,7 @@ CONFIG_EXT3_FS=y
1284CONFIG_EXT3_FS_XATTR=y 1286CONFIG_EXT3_FS_XATTR=y
1285CONFIG_EXT3_FS_POSIX_ACL=y 1287CONFIG_EXT3_FS_POSIX_ACL=y
1286# CONFIG_EXT3_FS_SECURITY is not set 1288# CONFIG_EXT3_FS_SECURITY is not set
1289# CONFIG_EXT4DEV_FS is not set
1287CONFIG_JBD=y 1290CONFIG_JBD=y
1288# CONFIG_JBD_DEBUG is not set 1291# CONFIG_JBD_DEBUG is not set
1289CONFIG_FS_MBCACHE=y 1292CONFIG_FS_MBCACHE=y
@@ -1307,6 +1310,7 @@ CONFIG_DNOTIFY=y
1307# CONFIG_AUTOFS_FS is not set 1310# CONFIG_AUTOFS_FS is not set
1308CONFIG_AUTOFS4_FS=y 1311CONFIG_AUTOFS4_FS=y
1309# CONFIG_FUSE_FS is not set 1312# CONFIG_FUSE_FS is not set
1313CONFIG_GENERIC_ACL=y
1310 1314
1311# 1315#
1312# CD-ROM/DVD Filesystems 1316# CD-ROM/DVD Filesystems
@@ -1384,7 +1388,6 @@ CONFIG_SUNRPC=y
1384# CONFIG_CODA_FS is not set 1388# CONFIG_CODA_FS is not set
1385# CONFIG_AFS_FS is not set 1389# CONFIG_AFS_FS is not set
1386# CONFIG_9P_FS is not set 1390# CONFIG_9P_FS is not set
1387CONFIG_GENERIC_ACL=y
1388 1391
1389# 1392#
1390# Partition Types 1393# Partition Types
@@ -1437,10 +1440,6 @@ CONFIG_NLS_ISO8859_15=y
1437CONFIG_NLS_UTF8=y 1440CONFIG_NLS_UTF8=y
1438 1441
1439# 1442#
1440# Distributed Lock Manager
1441#
1442
1443#
1444# Instrumentation Support 1443# Instrumentation Support
1445# 1444#
1446CONFIG_PROFILING=y 1445CONFIG_PROFILING=y
@@ -1480,6 +1479,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
1480CONFIG_UNWIND_INFO=y 1479CONFIG_UNWIND_INFO=y
1481CONFIG_STACK_UNWIND=y 1480CONFIG_STACK_UNWIND=y
1482# CONFIG_FORCED_INLINING is not set 1481# CONFIG_FORCED_INLINING is not set
1482# CONFIG_HEADERS_CHECK is not set
1483# CONFIG_RCU_TORTURE_TEST is not set 1483# CONFIG_RCU_TORTURE_TEST is not set
1484# CONFIG_LKDTM is not set 1484# CONFIG_LKDTM is not set
1485CONFIG_EARLY_PRINTK=y 1485CONFIG_EARLY_PRINTK=y
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index ab974ff9707..c8f96cff07c 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -70,7 +70,7 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return
70 70
71#define PREFIX "ACPI: " 71#define PREFIX "ACPI: "
72 72
73int acpi_noirq __initdata; /* skip ACPI IRQ initialization */ 73int acpi_noirq; /* skip ACPI IRQ initialization */
74int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */ 74int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */
75int acpi_ht __initdata = 1; /* enable HT */ 75int acpi_ht __initdata = 1; /* enable HT */
76 76
@@ -82,6 +82,7 @@ EXPORT_SYMBOL(acpi_strict);
82acpi_interrupt_flags acpi_sci_flags __initdata; 82acpi_interrupt_flags acpi_sci_flags __initdata;
83int acpi_sci_override_gsi __initdata; 83int acpi_sci_override_gsi __initdata;
84int acpi_skip_timer_override __initdata; 84int acpi_skip_timer_override __initdata;
85int acpi_use_timer_override __initdata;
85 86
86#ifdef CONFIG_X86_LOCAL_APIC 87#ifdef CONFIG_X86_LOCAL_APIC
87static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; 88static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
@@ -332,7 +333,7 @@ acpi_parse_ioapic(acpi_table_entry_header * header, const unsigned long end)
332/* 333/*
333 * Parse Interrupt Source Override for the ACPI SCI 334 * Parse Interrupt Source Override for the ACPI SCI
334 */ 335 */
335static void acpi_sci_ioapic_setup(u32 bus_irq, u32 gsi, u16 polarity, u16 trigger) 336static void acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
336{ 337{
337 if (trigger == 0) /* compatible SCI trigger is level */ 338 if (trigger == 0) /* compatible SCI trigger is level */
338 trigger = 3; 339 trigger = 3;
@@ -352,13 +353,13 @@ static void acpi_sci_ioapic_setup(u32 bus_irq, u32 gsi, u16 polarity, u16 trigge
352 * If GSI is < 16, this will update its flags, 353 * If GSI is < 16, this will update its flags,
353 * else it will create a new mp_irqs[] entry. 354 * else it will create a new mp_irqs[] entry.
354 */ 355 */
355 mp_override_legacy_irq(bus_irq, polarity, trigger, gsi); 356 mp_override_legacy_irq(gsi, polarity, trigger, gsi);
356 357
357 /* 358 /*
358 * stash over-ride to indicate we've been here 359 * stash over-ride to indicate we've been here
359 * and for later update of acpi_fadt 360 * and for later update of acpi_fadt
360 */ 361 */
361 acpi_sci_override_gsi = bus_irq; 362 acpi_sci_override_gsi = gsi;
362 return; 363 return;
363} 364}
364 365
@@ -376,7 +377,7 @@ acpi_parse_int_src_ovr(acpi_table_entry_header * header,
376 acpi_table_print_madt_entry(header); 377 acpi_table_print_madt_entry(header);
377 378
378 if (intsrc->bus_irq == acpi_fadt.sci_int) { 379 if (intsrc->bus_irq == acpi_fadt.sci_int) {
379 acpi_sci_ioapic_setup(intsrc->bus_irq, intsrc->global_irq, 380 acpi_sci_ioapic_setup(intsrc->global_irq,
380 intsrc->flags.polarity, 381 intsrc->flags.polarity,
381 intsrc->flags.trigger); 382 intsrc->flags.trigger);
382 return 0; 383 return 0;
@@ -879,7 +880,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
879 * pretend we got one so we can set the SCI flags. 880 * pretend we got one so we can set the SCI flags.
880 */ 881 */
881 if (!acpi_sci_override_gsi) 882 if (!acpi_sci_override_gsi)
882 acpi_sci_ioapic_setup(acpi_fadt.sci_int, acpi_fadt.sci_int, 0, 0); 883 acpi_sci_ioapic_setup(acpi_fadt.sci_int, 0, 0);
883 884
884 /* Fill in identity legacy mapings where no override */ 885 /* Fill in identity legacy mapings where no override */
885 mp_config_acpi_legacy_irqs(); 886 mp_config_acpi_legacy_irqs();
@@ -1300,6 +1301,13 @@ static int __init parse_acpi_skip_timer_override(char *arg)
1300 return 0; 1301 return 0;
1301} 1302}
1302early_param("acpi_skip_timer_override", parse_acpi_skip_timer_override); 1303early_param("acpi_skip_timer_override", parse_acpi_skip_timer_override);
1304
1305static int __init parse_acpi_use_timer_override(char *arg)
1306{
1307 acpi_use_timer_override = 1;
1308 return 0;
1309}
1310early_param("acpi_use_timer_override", parse_acpi_use_timer_override);
1303#endif /* CONFIG_X86_IO_APIC */ 1311#endif /* CONFIG_X86_IO_APIC */
1304 1312
1305static int __init setup_acpi_sci(char *s) 1313static int __init setup_acpi_sci(char *s)
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c
index fe799b11ac0..c9841692bb7 100644
--- a/arch/i386/kernel/acpi/earlyquirk.c
+++ b/arch/i386/kernel/acpi/earlyquirk.c
@@ -27,11 +27,17 @@ static int __init check_bridge(int vendor, int device)
27#ifdef CONFIG_ACPI 27#ifdef CONFIG_ACPI
28 /* According to Nvidia all timer overrides are bogus unless HPET 28 /* According to Nvidia all timer overrides are bogus unless HPET
29 is enabled. */ 29 is enabled. */
30 if (vendor == PCI_VENDOR_ID_NVIDIA) { 30 if (!acpi_use_timer_override && vendor == PCI_VENDOR_ID_NVIDIA) {
31 nvidia_hpet_detected = 0; 31 nvidia_hpet_detected = 0;
32 acpi_table_parse(ACPI_HPET, nvidia_hpet_check); 32 acpi_table_parse(ACPI_HPET, nvidia_hpet_check);
33 if (nvidia_hpet_detected == 0) { 33 if (nvidia_hpet_detected == 0) {
34 acpi_skip_timer_override = 1; 34 acpi_skip_timer_override = 1;
35 printk(KERN_INFO "Nvidia board "
36 "detected. Ignoring ACPI "
37 "timer override.\n");
38 printk(KERN_INFO "If you got timer trouble "
39 "try acpi_use_timer_override\n");
40
35 } 41 }
36 } 42 }
37#endif 43#endif
diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c
index 28ab8064976..583c238e17f 100644
--- a/arch/i386/kernel/alternative.c
+++ b/arch/i386/kernel/alternative.c
@@ -344,6 +344,7 @@ void alternatives_smp_switch(int smp)
344 344
345void __init alternative_instructions(void) 345void __init alternative_instructions(void)
346{ 346{
347 unsigned long flags;
347 if (no_replacement) { 348 if (no_replacement) {
348 printk(KERN_INFO "(SMP-)alternatives turned off\n"); 349 printk(KERN_INFO "(SMP-)alternatives turned off\n");
349 free_init_pages("SMP alternatives", 350 free_init_pages("SMP alternatives",
@@ -351,6 +352,8 @@ void __init alternative_instructions(void)
351 (unsigned long)__smp_alt_end); 352 (unsigned long)__smp_alt_end);
352 return; 353 return;
353 } 354 }
355
356 local_irq_save(flags);
354 apply_alternatives(__alt_instructions, __alt_instructions_end); 357 apply_alternatives(__alt_instructions, __alt_instructions_end);
355 358
356 /* switch to patch-once-at-boottime-only mode and free the 359 /* switch to patch-once-at-boottime-only mode and free the
@@ -386,4 +389,5 @@ void __init alternative_instructions(void)
386 alternatives_smp_switch(0); 389 alternatives_smp_switch(0);
387 } 390 }
388#endif 391#endif
392 local_irq_restore(flags);
389} 393}
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index b42f2d914af..a60358fe9a4 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -198,7 +198,7 @@
198 * (APM) BIOS Interface Specification, Revision 1.2, February 1996. 198 * (APM) BIOS Interface Specification, Revision 1.2, February 1996.
199 * 199 *
200 * [This document is available from Microsoft at: 200 * [This document is available from Microsoft at:
201 * http://www.microsoft.com/hwdev/busbios/amp_12.htm] 201 * http://www.microsoft.com/whdc/archive/amp_12.mspx]
202 */ 202 */
203 203
204#include <linux/module.h> 204#include <linux/module.h>
@@ -540,11 +540,30 @@ static inline void apm_restore_cpus(cpumask_t mask)
540 * Also, we KNOW that for the non error case of apm_bios_call, there 540 * Also, we KNOW that for the non error case of apm_bios_call, there
541 * is no useful data returned in the low order 8 bits of eax. 541 * is no useful data returned in the low order 8 bits of eax.
542 */ 542 */
543#define APM_DO_CLI \ 543
544 if (apm_info.allow_ints) \ 544static inline unsigned long __apm_irq_save(void)
545 local_irq_enable(); \ 545{
546 else \ 546 unsigned long flags;
547 local_save_flags(flags);
548 if (apm_info.allow_ints) {
549 if (irqs_disabled_flags(flags))
550 local_irq_enable();
551 } else
552 local_irq_disable();
553
554 return flags;
555}
556
557#define apm_irq_save(flags) \
558 do { flags = __apm_irq_save(); } while (0)
559
560static inline void apm_irq_restore(unsigned long flags)
561{
562 if (irqs_disabled_flags(flags))
547 local_irq_disable(); 563 local_irq_disable();
564 else if (irqs_disabled())
565 local_irq_enable();
566}
548 567
549#ifdef APM_ZERO_SEGS 568#ifdef APM_ZERO_SEGS
550# define APM_DECL_SEGS \ 569# define APM_DECL_SEGS \
@@ -596,12 +615,11 @@ static u8 apm_bios_call(u32 func, u32 ebx_in, u32 ecx_in,
596 save_desc_40 = gdt[0x40 / 8]; 615 save_desc_40 = gdt[0x40 / 8];
597 gdt[0x40 / 8] = bad_bios_desc; 616 gdt[0x40 / 8] = bad_bios_desc;
598 617
599 local_save_flags(flags); 618 apm_irq_save(flags);
600 APM_DO_CLI;
601 APM_DO_SAVE_SEGS; 619 APM_DO_SAVE_SEGS;
602 apm_bios_call_asm(func, ebx_in, ecx_in, eax, ebx, ecx, edx, esi); 620 apm_bios_call_asm(func, ebx_in, ecx_in, eax, ebx, ecx, edx, esi);
603 APM_DO_RESTORE_SEGS; 621 APM_DO_RESTORE_SEGS;
604 local_irq_restore(flags); 622 apm_irq_restore(flags);
605 gdt[0x40 / 8] = save_desc_40; 623 gdt[0x40 / 8] = save_desc_40;
606 put_cpu(); 624 put_cpu();
607 apm_restore_cpus(cpus); 625 apm_restore_cpus(cpus);
@@ -640,12 +658,11 @@ static u8 apm_bios_call_simple(u32 func, u32 ebx_in, u32 ecx_in, u32 *eax)
640 save_desc_40 = gdt[0x40 / 8]; 658 save_desc_40 = gdt[0x40 / 8];
641 gdt[0x40 / 8] = bad_bios_desc; 659 gdt[0x40 / 8] = bad_bios_desc;
642 660
643 local_save_flags(flags); 661 apm_irq_save(flags);
644 APM_DO_CLI;
645 APM_DO_SAVE_SEGS; 662 APM_DO_SAVE_SEGS;
646 error = apm_bios_call_simple_asm(func, ebx_in, ecx_in, eax); 663 error = apm_bios_call_simple_asm(func, ebx_in, ecx_in, eax);
647 APM_DO_RESTORE_SEGS; 664 APM_DO_RESTORE_SEGS;
648 local_irq_restore(flags); 665 apm_irq_restore(flags);
649 gdt[0x40 / 8] = save_desc_40; 666 gdt[0x40 / 8] = save_desc_40;
650 put_cpu(); 667 put_cpu();
651 apm_restore_cpus(cpus); 668 apm_restore_cpus(cpus);
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c
index fde8bea85ce..ab0c327e79d 100644
--- a/arch/i386/kernel/cpuid.c
+++ b/arch/i386/kernel/cpuid.c
@@ -156,14 +156,14 @@ static struct file_operations cpuid_fops = {
156 .open = cpuid_open, 156 .open = cpuid_open,
157}; 157};
158 158
159static int cpuid_class_device_create(int i) 159static int cpuid_device_create(int i)
160{ 160{
161 int err = 0; 161 int err = 0;
162 struct class_device *class_err; 162 struct device *dev;
163 163
164 class_err = class_device_create(cpuid_class, NULL, MKDEV(CPUID_MAJOR, i), NULL, "cpu%d",i); 164 dev = device_create(cpuid_class, NULL, MKDEV(CPUID_MAJOR, i), "cpu%d",i);
165 if (IS_ERR(class_err)) 165 if (IS_ERR(dev))
166 err = PTR_ERR(class_err); 166 err = PTR_ERR(dev);
167 return err; 167 return err;
168} 168}
169 169
@@ -174,10 +174,10 @@ static int cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long ac
174 174
175 switch (action) { 175 switch (action) {
176 case CPU_ONLINE: 176 case CPU_ONLINE:
177 cpuid_class_device_create(cpu); 177 cpuid_device_create(cpu);
178 break; 178 break;
179 case CPU_DEAD: 179 case CPU_DEAD:
180 class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu)); 180 device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
181 break; 181 break;
182 } 182 }
183 return NOTIFY_OK; 183 return NOTIFY_OK;
@@ -206,7 +206,7 @@ static int __init cpuid_init(void)
206 goto out_chrdev; 206 goto out_chrdev;
207 } 207 }
208 for_each_online_cpu(i) { 208 for_each_online_cpu(i) {
209 err = cpuid_class_device_create(i); 209 err = cpuid_device_create(i);
210 if (err != 0) 210 if (err != 0)
211 goto out_class; 211 goto out_class;
212 } 212 }
@@ -218,7 +218,7 @@ static int __init cpuid_init(void)
218out_class: 218out_class:
219 i = 0; 219 i = 0;
220 for_each_online_cpu(i) { 220 for_each_online_cpu(i) {
221 class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, i)); 221 device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, i));
222 } 222 }
223 class_destroy(cpuid_class); 223 class_destroy(cpuid_class);
224out_chrdev: 224out_chrdev:
@@ -232,7 +232,7 @@ static void __exit cpuid_exit(void)
232 int cpu = 0; 232 int cpu = 0;
233 233
234 for_each_online_cpu(cpu) 234 for_each_online_cpu(cpu)
235 class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu)); 235 device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
236 class_destroy(cpuid_class); 236 class_destroy(cpuid_class);
237 unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); 237 unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
238 unregister_hotcpu_notifier(&cpuid_class_cpu_notifier); 238 unregister_hotcpu_notifier(&cpuid_class_cpu_notifier);
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index be9d883c62c..ca31f18d277 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -317,7 +317,7 @@ is386: movl $2,%ecx # set MP
317 movl %eax,%gs 317 movl %eax,%gs
318 lldt %ax 318 lldt %ax
319 cld # gcc2 wants the direction flag cleared at all times 319 cld # gcc2 wants the direction flag cleared at all times
320 pushl %eax # fake return address 320 pushl $0 # fake return address for unwinder
321#ifdef CONFIG_SMP 321#ifdef CONFIG_SMP
322 movb ready, %cl 322 movb ready, %cl
323 movb $1, ready 323 movb $1, ready
diff --git a/arch/i386/kernel/i8253.c b/arch/i386/kernel/i8253.c
index 477b24daff5..9a0060b92e3 100644
--- a/arch/i386/kernel/i8253.c
+++ b/arch/i386/kernel/i8253.c
@@ -109,7 +109,7 @@ static struct clocksource clocksource_pit = {
109 109
110static int __init init_pit_clocksource(void) 110static int __init init_pit_clocksource(void)
111{ 111{
112 if (num_possible_cpus() > 4) /* PIT does not scale! */ 112 if (num_possible_cpus() > 1) /* PIT does not scale! */
113 return 0; 113 return 0;
114 114
115 clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE, 20); 115 clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE, 20);
diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c
index d53eafb6daa..62996cd1708 100644
--- a/arch/i386/kernel/i8259.c
+++ b/arch/i386/kernel/i8259.c
@@ -113,7 +113,8 @@ void make_8259A_irq(unsigned int irq)
113{ 113{
114 disable_irq_nosync(irq); 114 disable_irq_nosync(irq);
115 io_apic_irqs &= ~(1<<irq); 115 io_apic_irqs &= ~(1<<irq);
116 set_irq_chip_and_handler(irq, &i8259A_chip, handle_level_irq); 116 set_irq_chip_and_handler_name(irq, &i8259A_chip, handle_level_irq,
117 "XT");
117 enable_irq(irq); 118 enable_irq(irq);
118} 119}
119 120
@@ -369,8 +370,8 @@ void __init init_ISA_irqs (void)
369 /* 370 /*
370 * 16 old-style INTA-cycle interrupts: 371 * 16 old-style INTA-cycle interrupts:
371 */ 372 */
372 set_irq_chip_and_handler(i, &i8259A_chip, 373 set_irq_chip_and_handler_name(i, &i8259A_chip,
373 handle_level_irq); 374 handle_level_irq, "XT");
374 } else { 375 } else {
375 /* 376 /*
376 * 'high' PCI IRQs filled in on demand 377 * 'high' PCI IRQs filled in on demand
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 27bceaf5ce4..3b7a63e0ed1 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -91,6 +91,46 @@ static struct irq_pin_list {
91 int apic, pin, next; 91 int apic, pin, next;
92} irq_2_pin[PIN_MAP_SIZE]; 92} irq_2_pin[PIN_MAP_SIZE];
93 93
94struct io_apic {
95 unsigned int index;
96 unsigned int unused[3];
97 unsigned int data;
98};
99
100static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx)
101{
102 return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx)
103 + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK);
104}
105
106static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
107{
108 struct io_apic __iomem *io_apic = io_apic_base(apic);
109 writel(reg, &io_apic->index);
110 return readl(&io_apic->data);
111}
112
113static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
114{
115 struct io_apic __iomem *io_apic = io_apic_base(apic);
116 writel(reg, &io_apic->index);
117 writel(value, &io_apic->data);
118}
119
120/*
121 * Re-write a value: to be used for read-modify-write
122 * cycles where the read already set up the index register.
123 *
124 * Older SiS APIC requires we rewrite the index register
125 */
126static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
127{
128 volatile struct io_apic *io_apic = io_apic_base(apic);
129 if (sis_apic_bug)
130 writel(reg, &io_apic->index);
131 writel(value, &io_apic->data);
132}
133
94union entry_union { 134union entry_union {
95 struct { u32 w1, w2; }; 135 struct { u32 w1, w2; };
96 struct IO_APIC_route_entry entry; 136 struct IO_APIC_route_entry entry;
@@ -107,12 +147,34 @@ static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin)
107 return eu.entry; 147 return eu.entry;
108} 148}
109 149
150/*
151 * When we write a new IO APIC routing entry, we need to write the high
152 * word first! If the mask bit in the low word is clear, we will enable
153 * the interrupt, and we need to make sure the entry is fully populated
154 * before that happens.
155 */
110static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) 156static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e)
111{ 157{
112 unsigned long flags; 158 unsigned long flags;
113 union entry_union eu; 159 union entry_union eu;
114 eu.entry = e; 160 eu.entry = e;
115 spin_lock_irqsave(&ioapic_lock, flags); 161 spin_lock_irqsave(&ioapic_lock, flags);
162 io_apic_write(apic, 0x11 + 2*pin, eu.w2);
163 io_apic_write(apic, 0x10 + 2*pin, eu.w1);
164 spin_unlock_irqrestore(&ioapic_lock, flags);
165}
166
167/*
168 * When we mask an IO APIC routing entry, we need to write the low
169 * word first, in order to set the mask bit before we change the
170 * high bits!
171 */
172static void ioapic_mask_entry(int apic, int pin)
173{
174 unsigned long flags;
175 union entry_union eu = { .entry.mask = 1 };
176
177 spin_lock_irqsave(&ioapic_lock, flags);
116 io_apic_write(apic, 0x10 + 2*pin, eu.w1); 178 io_apic_write(apic, 0x10 + 2*pin, eu.w1);
117 io_apic_write(apic, 0x11 + 2*pin, eu.w2); 179 io_apic_write(apic, 0x11 + 2*pin, eu.w2);
118 spin_unlock_irqrestore(&ioapic_lock, flags); 180 spin_unlock_irqrestore(&ioapic_lock, flags);
@@ -234,9 +296,7 @@ static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin)
234 /* 296 /*
235 * Disable it in the IO-APIC irq-routing table: 297 * Disable it in the IO-APIC irq-routing table:
236 */ 298 */
237 memset(&entry, 0, sizeof(entry)); 299 ioapic_mask_entry(apic, pin);
238 entry.mask = 1;
239 ioapic_write_entry(apic, pin, entry);
240} 300}
241 301
242static void clear_IO_APIC (void) 302static void clear_IO_APIC (void)
@@ -1225,11 +1285,13 @@ static void ioapic_register_intr(int irq, int vector, unsigned long trigger)
1225{ 1285{
1226 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) || 1286 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
1227 trigger == IOAPIC_LEVEL) 1287 trigger == IOAPIC_LEVEL)
1228 set_irq_chip_and_handler(irq, &ioapic_chip, 1288 set_irq_chip_and_handler_name(irq, &ioapic_chip,
1229 handle_fasteoi_irq); 1289 handle_fasteoi_irq, "fasteoi");
1230 else 1290 else {
1231 set_irq_chip_and_handler(irq, &ioapic_chip, 1291 irq_desc[irq].status |= IRQ_DELAYED_DISABLE;
1232 handle_edge_irq); 1292 set_irq_chip_and_handler_name(irq, &ioapic_chip,
1293 handle_edge_irq, "edge");
1294 }
1233 set_intr_gate(vector, interrupt[irq]); 1295 set_intr_gate(vector, interrupt[irq]);
1234} 1296}
1235 1297
@@ -2235,7 +2297,8 @@ static inline void check_timer(void)
2235 printk(KERN_INFO "...trying to set up timer as Virtual Wire IRQ..."); 2297 printk(KERN_INFO "...trying to set up timer as Virtual Wire IRQ...");
2236 2298
2237 disable_8259A_irq(0); 2299 disable_8259A_irq(0);
2238 set_irq_chip_and_handler(0, &lapic_chip, handle_fasteoi_irq); 2300 set_irq_chip_and_handler_name(0, &lapic_chip, handle_fasteoi_irq,
2301 "fasteio");
2239 apic_write_around(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */ 2302 apic_write_around(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */
2240 enable_8259A_irq(0); 2303 enable_8259A_irq(0);
2241 2304
@@ -2541,7 +2604,8 @@ int arch_setup_msi_irq(unsigned int irq, struct pci_dev *dev)
2541 2604
2542 write_msi_msg(irq, &msg); 2605 write_msi_msg(irq, &msg);
2543 2606
2544 set_irq_chip_and_handler(irq, &msi_chip, handle_edge_irq); 2607 set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq,
2608 "edge");
2545 2609
2546 return 0; 2610 return 0;
2547} 2611}
@@ -2562,18 +2626,16 @@ void arch_teardown_msi_irq(unsigned int irq)
2562 2626
2563static void target_ht_irq(unsigned int irq, unsigned int dest) 2627static void target_ht_irq(unsigned int irq, unsigned int dest)
2564{ 2628{
2565 u32 low, high; 2629 struct ht_irq_msg msg;
2566 low = read_ht_irq_low(irq); 2630 fetch_ht_irq_msg(irq, &msg);
2567 high = read_ht_irq_high(irq);
2568 2631
2569 low &= ~(HT_IRQ_LOW_DEST_ID_MASK); 2632 msg.address_lo &= ~(HT_IRQ_LOW_DEST_ID_MASK);
2570 high &= ~(HT_IRQ_HIGH_DEST_ID_MASK); 2633 msg.address_hi &= ~(HT_IRQ_HIGH_DEST_ID_MASK);
2571 2634
2572 low |= HT_IRQ_LOW_DEST_ID(dest); 2635 msg.address_lo |= HT_IRQ_LOW_DEST_ID(dest);
2573 high |= HT_IRQ_HIGH_DEST_ID(dest); 2636 msg.address_hi |= HT_IRQ_HIGH_DEST_ID(dest);
2574 2637
2575 write_ht_irq_low(irq, low); 2638 write_ht_irq_msg(irq, &msg);
2576 write_ht_irq_high(irq, high);
2577} 2639}
2578 2640
2579static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask) 2641static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask)
@@ -2611,7 +2673,7 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
2611 2673
2612 vector = assign_irq_vector(irq); 2674 vector = assign_irq_vector(irq);
2613 if (vector >= 0) { 2675 if (vector >= 0) {
2614 u32 low, high; 2676 struct ht_irq_msg msg;
2615 unsigned dest; 2677 unsigned dest;
2616 cpumask_t tmp; 2678 cpumask_t tmp;
2617 2679
@@ -2619,9 +2681,10 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
2619 cpu_set(vector >> 8, tmp); 2681 cpu_set(vector >> 8, tmp);
2620 dest = cpu_mask_to_apicid(tmp); 2682 dest = cpu_mask_to_apicid(tmp);
2621 2683
2622 high = HT_IRQ_HIGH_DEST_ID(dest); 2684 msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest);
2623 2685
2624 low = HT_IRQ_LOW_BASE | 2686 msg.address_lo =
2687 HT_IRQ_LOW_BASE |
2625 HT_IRQ_LOW_DEST_ID(dest) | 2688 HT_IRQ_LOW_DEST_ID(dest) |
2626 HT_IRQ_LOW_VECTOR(vector) | 2689 HT_IRQ_LOW_VECTOR(vector) |
2627 ((INT_DEST_MODE == 0) ? 2690 ((INT_DEST_MODE == 0) ?
@@ -2633,10 +2696,10 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
2633 HT_IRQ_LOW_MT_ARBITRATED) | 2696 HT_IRQ_LOW_MT_ARBITRATED) |
2634 HT_IRQ_LOW_IRQ_MASKED; 2697 HT_IRQ_LOW_IRQ_MASKED;
2635 2698
2636 write_ht_irq_low(irq, low); 2699 write_ht_irq_msg(irq, &msg);
2637 write_ht_irq_high(irq, high);
2638 2700
2639 set_irq_chip_and_handler(irq, &ht_irq_chip, handle_edge_irq); 2701 set_irq_chip_and_handler_name(irq, &ht_irq_chip,
2702 handle_edge_irq, "edge");
2640 } 2703 }
2641 return vector; 2704 return vector;
2642} 2705}
diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c
index 8cfc7dbec7b..3201d421090 100644
--- a/arch/i386/kernel/irq.c
+++ b/arch/i386/kernel/irq.c
@@ -258,7 +258,7 @@ int show_interrupts(struct seq_file *p, void *v)
258 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 258 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
259#endif 259#endif
260 seq_printf(p, " %8s", irq_desc[i].chip->name); 260 seq_printf(p, " %8s", irq_desc[i].chip->name);
261 seq_printf(p, "-%s", handle_irq_name(irq_desc[i].handle_irq)); 261 seq_printf(p, "-%-8s", irq_desc[i].name);
262 seq_printf(p, " %s", action->name); 262 seq_printf(p, " %s", action->name);
263 263
264 for (action=action->next; action; action = action->next) 264 for (action=action->next; action; action = action->next)
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index d98e44b16fe..fc79e1e859c 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -361,8 +361,11 @@ no_kprobe:
361 asm volatile ( ".global kretprobe_trampoline\n" 361 asm volatile ( ".global kretprobe_trampoline\n"
362 "kretprobe_trampoline: \n" 362 "kretprobe_trampoline: \n"
363 " pushf\n" 363 " pushf\n"
364 /* skip cs, eip, orig_eax, es, ds */ 364 /* skip cs, eip, orig_eax */
365 " subl $20, %esp\n" 365 " subl $12, %esp\n"
366 " pushl %gs\n"
367 " pushl %ds\n"
368 " pushl %es\n"
366 " pushl %eax\n" 369 " pushl %eax\n"
367 " pushl %ebp\n" 370 " pushl %ebp\n"
368 " pushl %edi\n" 371 " pushl %edi\n"
@@ -373,10 +376,10 @@ no_kprobe:
373 " movl %esp, %eax\n" 376 " movl %esp, %eax\n"
374 " call trampoline_handler\n" 377 " call trampoline_handler\n"
375 /* move eflags to cs */ 378 /* move eflags to cs */
376 " movl 48(%esp), %edx\n" 379 " movl 52(%esp), %edx\n"
377 " movl %edx, 44(%esp)\n" 380 " movl %edx, 48(%esp)\n"
378 /* save true return address on eflags */ 381 /* save true return address on eflags */
379 " movl %eax, 48(%esp)\n" 382 " movl %eax, 52(%esp)\n"
380 " popl %ebx\n" 383 " popl %ebx\n"
381 " popl %ecx\n" 384 " popl %ecx\n"
382 " popl %edx\n" 385 " popl %edx\n"
@@ -384,8 +387,8 @@ no_kprobe:
384 " popl %edi\n" 387 " popl %edi\n"
385 " popl %ebp\n" 388 " popl %ebp\n"
386 " popl %eax\n" 389 " popl %eax\n"
387 /* skip eip, orig_eax, es, ds */ 390 /* skip eip, orig_eax, es, ds, gs */
388 " addl $16, %esp\n" 391 " addl $20, %esp\n"
389 " popf\n" 392 " popf\n"
390 " ret\n"); 393 " ret\n");
391} 394}
@@ -404,6 +407,10 @@ fastcall void *__kprobes trampoline_handler(struct pt_regs *regs)
404 INIT_HLIST_HEAD(&empty_rp); 407 INIT_HLIST_HEAD(&empty_rp);
405 spin_lock_irqsave(&kretprobe_lock, flags); 408 spin_lock_irqsave(&kretprobe_lock, flags);
406 head = kretprobe_inst_table_head(current); 409 head = kretprobe_inst_table_head(current);
410 /* fixup registers */
411 regs->xcs = __KERNEL_CS;
412 regs->eip = trampoline_address;
413 regs->orig_eax = 0xffffffff;
407 414
408 /* 415 /*
409 * It is possible to have multiple instances associated with a given 416 * It is possible to have multiple instances associated with a given
@@ -425,6 +432,7 @@ fastcall void *__kprobes trampoline_handler(struct pt_regs *regs)
425 432
426 if (ri->rp && ri->rp->handler){ 433 if (ri->rp && ri->rp->handler){
427 __get_cpu_var(current_kprobe) = &ri->rp->kp; 434 __get_cpu_var(current_kprobe) = &ri->rp->kp;
435 get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE;
428 ri->rp->handler(ri, regs); 436 ri->rp->handler(ri, regs);
429 __get_cpu_var(current_kprobe) = NULL; 437 __get_cpu_var(current_kprobe) = NULL;
430 } 438 }
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c
index c4d0291b519..23f5984d065 100644
--- a/arch/i386/kernel/microcode.c
+++ b/arch/i386/kernel/microcode.c
@@ -577,7 +577,7 @@ static void microcode_init_cpu(int cpu)
577 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 577 set_cpus_allowed(current, cpumask_of_cpu(cpu));
578 mutex_lock(&microcode_mutex); 578 mutex_lock(&microcode_mutex);
579 collect_cpu_info(cpu); 579 collect_cpu_info(cpu);
580 if (uci->valid) 580 if (uci->valid && system_state == SYSTEM_RUNNING)
581 cpu_request_microcode(cpu); 581 cpu_request_microcode(cpu);
582 mutex_unlock(&microcode_mutex); 582 mutex_unlock(&microcode_mutex);
583 set_cpus_allowed(current, old); 583 set_cpus_allowed(current, old);
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c
index d535cdbbfd2..a773f776c9e 100644
--- a/arch/i386/kernel/msr.c
+++ b/arch/i386/kernel/msr.c
@@ -239,14 +239,14 @@ static struct file_operations msr_fops = {
239 .open = msr_open, 239 .open = msr_open,
240}; 240};
241 241
242static int msr_class_device_create(int i) 242static int msr_device_create(int i)
243{ 243{
244 int err = 0; 244 int err = 0;
245 struct class_device *class_err; 245 struct device *dev;
246 246
247 class_err = class_device_create(msr_class, NULL, MKDEV(MSR_MAJOR, i), NULL, "msr%d",i); 247 dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, i), "msr%d",i);
248 if (IS_ERR(class_err)) 248 if (IS_ERR(dev))
249 err = PTR_ERR(class_err); 249 err = PTR_ERR(dev);
250 return err; 250 return err;
251} 251}
252 252
@@ -258,10 +258,10 @@ static int msr_class_cpu_callback(struct notifier_block *nfb,
258 258
259 switch (action) { 259 switch (action) {
260 case CPU_ONLINE: 260 case CPU_ONLINE:
261 msr_class_device_create(cpu); 261 msr_device_create(cpu);
262 break; 262 break;
263 case CPU_DEAD: 263 case CPU_DEAD:
264 class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu)); 264 device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
265 break; 265 break;
266 } 266 }
267 return NOTIFY_OK; 267 return NOTIFY_OK;
@@ -290,7 +290,7 @@ static int __init msr_init(void)
290 goto out_chrdev; 290 goto out_chrdev;
291 } 291 }
292 for_each_online_cpu(i) { 292 for_each_online_cpu(i) {
293 err = msr_class_device_create(i); 293 err = msr_device_create(i);
294 if (err != 0) 294 if (err != 0)
295 goto out_class; 295 goto out_class;
296 } 296 }
@@ -302,7 +302,7 @@ static int __init msr_init(void)
302out_class: 302out_class:
303 i = 0; 303 i = 0;
304 for_each_online_cpu(i) 304 for_each_online_cpu(i)
305 class_device_destroy(msr_class, MKDEV(MSR_MAJOR, i)); 305 device_destroy(msr_class, MKDEV(MSR_MAJOR, i));
306 class_destroy(msr_class); 306 class_destroy(msr_class);
307out_chrdev: 307out_chrdev:
308 unregister_chrdev(MSR_MAJOR, "cpu/msr"); 308 unregister_chrdev(MSR_MAJOR, "cpu/msr");
@@ -314,7 +314,7 @@ static void __exit msr_exit(void)
314{ 314{
315 int cpu = 0; 315 int cpu = 0;
316 for_each_online_cpu(cpu) 316 for_each_online_cpu(cpu)
317 class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu)); 317 device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
318 class_destroy(msr_class); 318 class_destroy(msr_class);
319 unregister_chrdev(MSR_MAJOR, "cpu/msr"); 319 unregister_chrdev(MSR_MAJOR, "cpu/msr");
320 unregister_hotcpu_notifier(&msr_class_cpu_notifier); 320 unregister_hotcpu_notifier(&msr_class_cpu_notifier);
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index 3e8e3adb048..eaafe233a5d 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -219,11 +219,11 @@ static int __init check_nmi_watchdog(void)
219 int cpu; 219 int cpu;
220 220
221 /* Enable NMI watchdog for newer systems. 221 /* Enable NMI watchdog for newer systems.
222 Actually it should be safe for most systems before 2004 too except 222 Probably safe on most older systems too, but let's be careful.
223 for some IBM systems that corrupt registers when NMI happens 223 IBM ThinkPads use INT10 inside SMM and that allows early NMI inside SMM
224 during SMM. Unfortunately we don't have more exact information 224 which hangs the system. Disable watchdog for all thinkpads */
225 on these and use this coarse check. */ 225 if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004 &&
226 if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004) 226 !dmi_name_in_vendors("ThinkPad"))
227 nmi_watchdog = NMI_LOCAL_APIC; 227 nmi_watchdog = NMI_LOCAL_APIC;
228 228
229 if ((nmi_watchdog == NMI_NONE) || (nmi_watchdog == NMI_DEFAULT)) 229 if ((nmi_watchdog == NMI_NONE) || (nmi_watchdog == NMI_DEFAULT))
diff --git a/arch/i386/kernel/pci-dma.c b/arch/i386/kernel/pci-dma.c
index 25fe6685393..5c8c6ef1fc5 100644
--- a/arch/i386/kernel/pci-dma.c
+++ b/arch/i386/kernel/pci-dma.c
@@ -75,7 +75,7 @@ EXPORT_SYMBOL(dma_free_coherent);
75int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, 75int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
76 dma_addr_t device_addr, size_t size, int flags) 76 dma_addr_t device_addr, size_t size, int flags)
77{ 77{
78 void __iomem *mem_base; 78 void __iomem *mem_base = NULL;
79 int pages = size >> PAGE_SHIFT; 79 int pages = size >> PAGE_SHIFT;
80 int bitmap_size = (pages + 31)/32; 80 int bitmap_size = (pages + 31)/32;
81 81
@@ -114,6 +114,8 @@ int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
114 free1_out: 114 free1_out:
115 kfree(dev->dma_mem->bitmap); 115 kfree(dev->dma_mem->bitmap);
116 out: 116 out:
117 if (mem_base)
118 iounmap(mem_base);
117 return 0; 119 return 0;
118} 120}
119EXPORT_SYMBOL(dma_declare_coherent_memory); 121EXPORT_SYMBOL(dma_declare_coherent_memory);
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 57d375900af..dd53c58f64f 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -205,7 +205,7 @@ void cpu_idle(void)
205void cpu_idle_wait(void) 205void cpu_idle_wait(void)
206{ 206{
207 unsigned int cpu, this_cpu = get_cpu(); 207 unsigned int cpu, this_cpu = get_cpu();
208 cpumask_t map; 208 cpumask_t map, tmp = current->cpus_allowed;
209 209
210 set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); 210 set_cpus_allowed(current, cpumask_of_cpu(this_cpu));
211 put_cpu(); 211 put_cpu();
@@ -227,6 +227,8 @@ void cpu_idle_wait(void)
227 } 227 }
228 cpus_and(map, map, cpu_online_map); 228 cpus_and(map, map, cpu_online_map);
229 } while (!cpus_empty(map)); 229 } while (!cpus_empty(map));
230
231 set_cpus_allowed(current, tmp);
230} 232}
231EXPORT_SYMBOL_GPL(cpu_idle_wait); 233EXPORT_SYMBOL_GPL(cpu_idle_wait);
232 234
@@ -336,7 +338,6 @@ extern void kernel_thread_helper(void);
336int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) 338int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
337{ 339{
338 struct pt_regs regs; 340 struct pt_regs regs;
339 int err;
340 341
341 memset(&regs, 0, sizeof(regs)); 342 memset(&regs, 0, sizeof(regs));
342 343
@@ -351,10 +352,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
351 regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2; 352 regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2;
352 353
353 /* Ok, create the new process.. */ 354 /* Ok, create the new process.. */
354 err = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL); 355 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
355 if (err == 0) /* terminate kernel stack */
356 task_pt_regs(current)->eip = 0;
357 return err;
358} 356}
359EXPORT_SYMBOL(kernel_thread); 357EXPORT_SYMBOL(kernel_thread);
360 358
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 519e63c3c13..141041dde74 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -846,7 +846,7 @@ efi_find_max_pfn(unsigned long start, unsigned long end, void *arg)
846static int __init 846static int __init
847efi_memory_present_wrapper(unsigned long start, unsigned long end, void *arg) 847efi_memory_present_wrapper(unsigned long start, unsigned long end, void *arg)
848{ 848{
849 memory_present(0, start, end); 849 memory_present(0, PFN_UP(start), PFN_DOWN(end));
850 return 0; 850 return 0;
851} 851}
852 852
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 00489b706d2..fe9c5e8e7e6 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -129,15 +129,19 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo,
129 129
130#ifdef CONFIG_FRAME_POINTER 130#ifdef CONFIG_FRAME_POINTER
131 while (valid_stack_ptr(tinfo, (void *)ebp)) { 131 while (valid_stack_ptr(tinfo, (void *)ebp)) {
132 unsigned long new_ebp;
132 addr = *(unsigned long *)(ebp + 4); 133 addr = *(unsigned long *)(ebp + 4);
133 ops->address(data, addr); 134 ops->address(data, addr);
134 /* 135 /*
135 * break out of recursive entries (such as 136 * break out of recursive entries (such as
136 * end_of_stack_stop_unwind_function): 137 * end_of_stack_stop_unwind_function). Also,
138 * we can never allow a frame pointer to
139 * move downwards!
137 */ 140 */
138 if (ebp == *(unsigned long *)ebp) 141 new_ebp = *(unsigned long *)ebp;
142 if (new_ebp <= ebp)
139 break; 143 break;
140 ebp = *(unsigned long *)ebp; 144 ebp = new_ebp;
141 } 145 }
142#else 146#else
143 while (valid_stack_ptr(tinfo, stack)) { 147 while (valid_stack_ptr(tinfo, stack)) {
diff --git a/arch/i386/kernel/tsc.c b/arch/i386/kernel/tsc.c
index b8fa0a8b2e4..fbc95828cd7 100644
--- a/arch/i386/kernel/tsc.c
+++ b/arch/i386/kernel/tsc.c
@@ -349,8 +349,8 @@ static int tsc_update_callback(void)
349 int change = 0; 349 int change = 0;
350 350
351 /* check to see if we should switch to the safe clocksource: */ 351 /* check to see if we should switch to the safe clocksource: */
352 if (clocksource_tsc.rating != 50 && check_tsc_unstable()) { 352 if (clocksource_tsc.rating != 0 && check_tsc_unstable()) {
353 clocksource_tsc.rating = 50; 353 clocksource_tsc.rating = 0;
354 clocksource_reselect(); 354 clocksource_reselect();
355 change = 1; 355 change = 1;
356 } 356 }
@@ -461,7 +461,7 @@ static int __init init_tsc_clocksource(void)
461 clocksource_tsc.shift); 461 clocksource_tsc.shift);
462 /* lower the rating if we already know its unstable: */ 462 /* lower the rating if we already know its unstable: */
463 if (check_tsc_unstable()) 463 if (check_tsc_unstable())
464 clocksource_tsc.rating = 50; 464 clocksource_tsc.rating = 0;
465 465
466 init_timer(&verify_tsc_freq_timer); 466 init_timer(&verify_tsc_freq_timer);
467 verify_tsc_freq_timer.function = verify_tsc_freq; 467 verify_tsc_freq_timer.function = verify_tsc_freq;
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S
index 1e7ac1c44dd..c6f84a0322b 100644
--- a/arch/i386/kernel/vmlinux.lds.S
+++ b/arch/i386/kernel/vmlinux.lds.S
@@ -51,6 +51,7 @@ SECTIONS
51 __tracedata_end = .; 51 __tracedata_end = .;
52 52
53 /* writeable */ 53 /* writeable */
54 . = ALIGN(4096);
54 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */ 55 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
55 *(.data) 56 *(.data)
56 CONSTRUCTORS 57 CONSTRUCTORS
@@ -126,13 +127,7 @@ SECTIONS
126 __setup_end = .; 127 __setup_end = .;
127 __initcall_start = .; 128 __initcall_start = .;
128 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) { 129 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
129 *(.initcall1.init) 130 INITCALLS
130 *(.initcall2.init)
131 *(.initcall3.init)
132 *(.initcall4.init)
133 *(.initcall5.init)
134 *(.initcall6.init)
135 *(.initcall7.init)
136 } 131 }
137 __initcall_end = .; 132 __initcall_end = .;
138 __con_initcall_start = .; 133 __con_initcall_start = .;
diff --git a/arch/i386/lib/usercopy.c b/arch/i386/lib/usercopy.c
index 258df6b4d7d..d22cfc9d656 100644
--- a/arch/i386/lib/usercopy.c
+++ b/arch/i386/lib/usercopy.c
@@ -9,6 +9,7 @@
9#include <linux/highmem.h> 9#include <linux/highmem.h>
10#include <linux/blkdev.h> 10#include <linux/blkdev.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/backing-dev.h>
12#include <asm/uaccess.h> 13#include <asm/uaccess.h>
13#include <asm/mmx.h> 14#include <asm/mmx.h>
14 15
@@ -741,7 +742,7 @@ survive:
741 742
742 if (retval == -ENOMEM && is_init(current)) { 743 if (retval == -ENOMEM && is_init(current)) {
743 up_read(&current->mm->mmap_sem); 744 up_read(&current->mm->mmap_sem);
744 blk_congestion_wait(WRITE, HZ/50); 745 congestion_wait(WRITE, HZ/50);
745 goto survive; 746 goto survive;
746 } 747 }
747 748
diff --git a/arch/i386/mach-visws/visws_apic.c b/arch/i386/mach-visws/visws_apic.c
index 07097ed4889..38c2b13124d 100644
--- a/arch/i386/mach-visws/visws_apic.c
+++ b/arch/i386/mach-visws/visws_apic.c
@@ -122,7 +122,7 @@ static void end_cobalt_irq(unsigned int irq)
122 spin_unlock_irqrestore(&cobalt_lock, flags); 122 spin_unlock_irqrestore(&cobalt_lock, flags);
123} 123}
124 124
125static struct hw_interrupt_type cobalt_irq_type = { 125static struct irq_chip cobalt_irq_type = {
126 .typename = "Cobalt-APIC", 126 .typename = "Cobalt-APIC",
127 .startup = startup_cobalt_irq, 127 .startup = startup_cobalt_irq,
128 .shutdown = disable_cobalt_irq, 128 .shutdown = disable_cobalt_irq,
@@ -159,7 +159,7 @@ static void end_piix4_master_irq(unsigned int irq)
159 spin_unlock_irqrestore(&cobalt_lock, flags); 159 spin_unlock_irqrestore(&cobalt_lock, flags);
160} 160}
161 161
162static struct hw_interrupt_type piix4_master_irq_type = { 162static struct irq_chip piix4_master_irq_type = {
163 .typename = "PIIX4-master", 163 .typename = "PIIX4-master",
164 .startup = startup_piix4_master_irq, 164 .startup = startup_piix4_master_irq,
165 .ack = ack_cobalt_irq, 165 .ack = ack_cobalt_irq,
@@ -167,9 +167,8 @@ static struct hw_interrupt_type piix4_master_irq_type = {
167}; 167};
168 168
169 169
170static struct hw_interrupt_type piix4_virtual_irq_type = { 170static struct irq_chip piix4_virtual_irq_type = {
171 .typename = "PIIX4-virtual", 171 .typename = "PIIX4-virtual",
172 .startup = startup_8259A_irq,
173 .shutdown = disable_8259A_irq, 172 .shutdown = disable_8259A_irq,
174 .enable = enable_8259A_irq, 173 .enable = enable_8259A_irq,
175 .disable = disable_8259A_irq, 174 .disable = disable_8259A_irq,
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c
index 68bce194e68..53ca6e89798 100644
--- a/arch/i386/pci/common.c
+++ b/arch/i386/pci/common.c
@@ -20,6 +20,7 @@
20unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | 20unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 |
21 PCI_PROBE_MMCONF; 21 PCI_PROBE_MMCONF;
22 22
23static int pci_bf_sort;
23int pci_routeirq; 24int pci_routeirq;
24int pcibios_last_bus = -1; 25int pcibios_last_bus = -1;
25unsigned long pirq_table_addr; 26unsigned long pirq_table_addr;
@@ -118,6 +119,20 @@ void __devinit pcibios_fixup_bus(struct pci_bus *b)
118} 119}
119 120
120/* 121/*
122 * Only use DMI information to set this if nothing was passed
123 * on the kernel command line (which was parsed earlier).
124 */
125
126static int __devinit set_bf_sort(struct dmi_system_id *d)
127{
128 if (pci_bf_sort == pci_bf_sort_default) {
129 pci_bf_sort = pci_dmi_bf;
130 printk(KERN_INFO "PCI: %s detected, enabling pci=bfsort.\n", d->ident);
131 }
132 return 0;
133}
134
135/*
121 * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus) 136 * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus)
122 */ 137 */
123#ifdef __i386__ 138#ifdef __i386__
@@ -130,11 +145,11 @@ static int __devinit assign_all_busses(struct dmi_system_id *d)
130} 145}
131#endif 146#endif
132 147
148static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
149#ifdef __i386__
133/* 150/*
134 * Laptops which need pci=assign-busses to see Cardbus cards 151 * Laptops which need pci=assign-busses to see Cardbus cards
135 */ 152 */
136static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
137#ifdef __i386__
138 { 153 {
139 .callback = assign_all_busses, 154 .callback = assign_all_busses,
140 .ident = "Samsung X20 Laptop", 155 .ident = "Samsung X20 Laptop",
@@ -144,6 +159,38 @@ static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
144 }, 159 },
145 }, 160 },
146#endif /* __i386__ */ 161#endif /* __i386__ */
162 {
163 .callback = set_bf_sort,
164 .ident = "Dell PowerEdge 1950",
165 .matches = {
166 DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
167 DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1950"),
168 },
169 },
170 {
171 .callback = set_bf_sort,
172 .ident = "Dell PowerEdge 1955",
173 .matches = {
174 DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
175 DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1955"),
176 },
177 },
178 {
179 .callback = set_bf_sort,
180 .ident = "Dell PowerEdge 2900",
181 .matches = {
182 DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
183 DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2900"),
184 },
185 },
186 {
187 .callback = set_bf_sort,
188 .ident = "Dell PowerEdge 2950",
189 .matches = {
190 DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
191 DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2950"),
192 },
193 },
147 {} 194 {}
148}; 195};
149 196
@@ -189,6 +236,8 @@ static int __init pcibios_init(void)
189 236
190 pcibios_resource_survey(); 237 pcibios_resource_survey();
191 238
239 if (pci_bf_sort >= pci_force_bf)
240 pci_sort_breadthfirst();
192#ifdef CONFIG_PCI_BIOS 241#ifdef CONFIG_PCI_BIOS
193 if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT)) 242 if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT))
194 pcibios_sort(); 243 pcibios_sort();
@@ -203,6 +252,12 @@ char * __devinit pcibios_setup(char *str)
203 if (!strcmp(str, "off")) { 252 if (!strcmp(str, "off")) {
204 pci_probe = 0; 253 pci_probe = 0;
205 return NULL; 254 return NULL;
255 } else if (!strcmp(str, "bfsort")) {
256 pci_bf_sort = pci_force_bf;
257 return NULL;
258 } else if (!strcmp(str, "nobfsort")) {
259 pci_bf_sort = pci_force_nobf;
260 return NULL;
206 } 261 }
207#ifdef CONFIG_PCI_BIOS 262#ifdef CONFIG_PCI_BIOS
208 else if (!strcmp(str, "bios")) { 263 else if (!strcmp(str, "bios")) {
@@ -288,7 +343,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
288 343
289void pcibios_disable_device (struct pci_dev *dev) 344void pcibios_disable_device (struct pci_dev *dev)
290{ 345{
291 pcibios_disable_resources(dev);
292 if (pcibios_disable_irq) 346 if (pcibios_disable_irq)
293 pcibios_disable_irq(dev); 347 pcibios_disable_irq(dev);
294} 348}
diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c
index b60d7e8689e..cde1170b01a 100644
--- a/arch/i386/pci/fixup.c
+++ b/arch/i386/pci/fixup.c
@@ -74,52 +74,6 @@ static void __devinit pci_fixup_ncr53c810(struct pci_dev *d)
74} 74}
75DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, pci_fixup_ncr53c810); 75DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, pci_fixup_ncr53c810);
76 76
77static void __devinit pci_fixup_ide_bases(struct pci_dev *d)
78{
79 int i;
80
81 /*
82 * PCI IDE controllers use non-standard I/O port decoding, respect it.
83 */
84 if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
85 return;
86 DBG("PCI: IDE base address fixup for %s\n", pci_name(d));
87 for(i=0; i<4; i++) {
88 struct resource *r = &d->resource[i];
89 if ((r->start & ~0x80) == 0x374) {
90 r->start |= 2;
91 r->end = r->start;
92 }
93 }
94}
95DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases);
96
97static void __devinit pci_fixup_ide_trash(struct pci_dev *d)
98{
99 int i;
100
101 /*
102 * Runs the fixup only for the first IDE controller
103 * (Shai Fultheim - shai@ftcon.com)
104 */
105 static int called = 0;
106 if (called)
107 return;
108 called = 1;
109
110 /*
111 * There exist PCI IDE controllers which have utter garbage
112 * in first four base registers. Ignore that.
113 */
114 DBG("PCI: IDE base address trash cleared for %s\n", pci_name(d));
115 for(i=0; i<4; i++)
116 d->resource[i].start = d->resource[i].end = d->resource[i].flags = 0;
117}
118DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5513, pci_fixup_ide_trash);
119DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_10, pci_fixup_ide_trash);
120DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_11, pci_fixup_ide_trash);
121DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_9, pci_fixup_ide_trash);
122
123static void __devinit pci_fixup_latency(struct pci_dev *d) 77static void __devinit pci_fixup_latency(struct pci_dev *d)
124{ 78{
125 /* 79 /*
@@ -348,8 +302,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC1, pcie_r
348 * From information provided by "Jon Smirl" <jonsmirl@gmail.com> 302 * From information provided by "Jon Smirl" <jonsmirl@gmail.com>
349 * 303 *
350 * The standard boot ROM sequence for an x86 machine uses the BIOS 304 * The standard boot ROM sequence for an x86 machine uses the BIOS
351 * to select an initial video card for boot display. This boot video 305 * to select an initial video card for boot display. This boot video
352 * card will have it's BIOS copied to C0000 in system RAM. 306 * card will have it's BIOS copied to C0000 in system RAM.
353 * IORESOURCE_ROM_SHADOW is used to associate the boot video 307 * IORESOURCE_ROM_SHADOW is used to associate the boot video
354 * card with this copy. On laptops this copy has to be used since 308 * card with this copy. On laptops this copy has to be used since
355 * the main ROM may be compressed or combined with another image. 309 * the main ROM may be compressed or combined with another image.
@@ -371,7 +325,17 @@ static void __devinit pci_fixup_video(struct pci_dev *pdev)
371 bus = pdev->bus; 325 bus = pdev->bus;
372 while (bus) { 326 while (bus) {
373 bridge = bus->self; 327 bridge = bus->self;
374 if (bridge) { 328
329 /*
330 * From information provided by
331 * "David Miller" <davem@davemloft.net>
332 * The bridge control register is valid for PCI header
333 * type BRIDGE, or CARDBUS. Host to PCI controllers use
334 * PCI header type NORMAL.
335 */
336 if (bridge
337 &&((bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE)
338 ||(bridge->hdr_type == PCI_HEADER_TYPE_CARDBUS))) {
375 pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, 339 pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
376 &config); 340 &config);
377 if (!(config & PCI_BRIDGE_CTL_VGA)) 341 if (!(config & PCI_BRIDGE_CTL_VGA))
diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c
index 10154a2cac6..43005f04442 100644
--- a/arch/i386/pci/i386.c
+++ b/arch/i386/pci/i386.c
@@ -104,16 +104,24 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
104 /* Depth-First Search on bus tree */ 104 /* Depth-First Search on bus tree */
105 list_for_each_entry(bus, bus_list, node) { 105 list_for_each_entry(bus, bus_list, node) {
106 if ((dev = bus->self)) { 106 if ((dev = bus->self)) {
107 for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) { 107 for (idx = PCI_BRIDGE_RESOURCES;
108 idx < PCI_NUM_RESOURCES; idx++) {
108 r = &dev->resource[idx]; 109 r = &dev->resource[idx];
109 if (!r->flags) 110 if (!r->flags)
110 continue; 111 continue;
111 pr = pci_find_parent_resource(dev, r); 112 pr = pci_find_parent_resource(dev, r);
112 if (!r->start || !pr || request_resource(pr, r) < 0) { 113 if (!r->start || !pr ||
113 printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev)); 114 request_resource(pr, r) < 0) {
114 /* Something is wrong with the region. 115 printk(KERN_ERR "PCI: Cannot allocate "
115 Invalidate the resource to prevent child 116 "resource region %d "
116 resource allocations in this range. */ 117 "of bridge %s\n",
118 idx, pci_name(dev));
119 /*
120 * Something is wrong with the region.
121 * Invalidate the resource to prevent
122 * child resource allocations in this
123 * range.
124 */
117 r->flags = 0; 125 r->flags = 0;
118 } 126 }
119 } 127 }
@@ -131,7 +139,7 @@ static void __init pcibios_allocate_resources(int pass)
131 139
132 for_each_pci_dev(dev) { 140 for_each_pci_dev(dev) {
133 pci_read_config_word(dev, PCI_COMMAND, &command); 141 pci_read_config_word(dev, PCI_COMMAND, &command);
134 for(idx = 0; idx < 6; idx++) { 142 for (idx = 0; idx < PCI_ROM_RESOURCE; idx++) {
135 r = &dev->resource[idx]; 143 r = &dev->resource[idx];
136 if (r->parent) /* Already allocated */ 144 if (r->parent) /* Already allocated */
137 continue; 145 continue;
@@ -142,11 +150,15 @@ static void __init pcibios_allocate_resources(int pass)
142 else 150 else
143 disabled = !(command & PCI_COMMAND_MEMORY); 151 disabled = !(command & PCI_COMMAND_MEMORY);
144 if (pass == disabled) { 152 if (pass == disabled) {
145 DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n", 153 DBG("PCI: Resource %08lx-%08lx "
154 "(f=%lx, d=%d, p=%d)\n",
146 r->start, r->end, r->flags, disabled, pass); 155 r->start, r->end, r->flags, disabled, pass);
147 pr = pci_find_parent_resource(dev, r); 156 pr = pci_find_parent_resource(dev, r);
148 if (!pr || request_resource(pr, r) < 0) { 157 if (!pr || request_resource(pr, r) < 0) {
149 printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, pci_name(dev)); 158 printk(KERN_ERR "PCI: Cannot allocate "
159 "resource region %d "
160 "of device %s\n",
161 idx, pci_name(dev));
150 /* We'll assign a new address later */ 162 /* We'll assign a new address later */
151 r->end -= r->start; 163 r->end -= r->start;
152 r->start = 0; 164 r->start = 0;
@@ -156,12 +168,16 @@ static void __init pcibios_allocate_resources(int pass)
156 if (!pass) { 168 if (!pass) {
157 r = &dev->resource[PCI_ROM_RESOURCE]; 169 r = &dev->resource[PCI_ROM_RESOURCE];
158 if (r->flags & IORESOURCE_ROM_ENABLE) { 170 if (r->flags & IORESOURCE_ROM_ENABLE) {
159 /* Turn the ROM off, leave the resource region, but keep it unregistered. */ 171 /* Turn the ROM off, leave the resource region,
172 * but keep it unregistered. */
160 u32 reg; 173 u32 reg;
161 DBG("PCI: Switching off ROM of %s\n", pci_name(dev)); 174 DBG("PCI: Switching off ROM of %s\n",
175 pci_name(dev));
162 r->flags &= ~IORESOURCE_ROM_ENABLE; 176 r->flags &= ~IORESOURCE_ROM_ENABLE;
163 pci_read_config_dword(dev, dev->rom_base_reg, &reg); 177 pci_read_config_dword(dev,
164 pci_write_config_dword(dev, dev->rom_base_reg, reg & ~PCI_ROM_ADDRESS_ENABLE); 178 dev->rom_base_reg, &reg);
179 pci_write_config_dword(dev, dev->rom_base_reg,
180 reg & ~PCI_ROM_ADDRESS_ENABLE);
165 } 181 }
166 } 182 }
167 } 183 }
@@ -173,9 +189,11 @@ static int __init pcibios_assign_resources(void)
173 struct resource *r, *pr; 189 struct resource *r, *pr;
174 190
175 if (!(pci_probe & PCI_ASSIGN_ROMS)) { 191 if (!(pci_probe & PCI_ASSIGN_ROMS)) {
176 /* Try to use BIOS settings for ROMs, otherwise let 192 /*
177 pci_assign_unassigned_resources() allocate the new 193 * Try to use BIOS settings for ROMs, otherwise let
178 addresses. */ 194 * pci_assign_unassigned_resources() allocate the new
195 * addresses.
196 */
179 for_each_pci_dev(dev) { 197 for_each_pci_dev(dev) {
180 r = &dev->resource[PCI_ROM_RESOURCE]; 198 r = &dev->resource[PCI_ROM_RESOURCE];
181 if (!r->flags || !r->start) 199 if (!r->flags || !r->start)
@@ -215,9 +233,9 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask)
215 233
216 pci_read_config_word(dev, PCI_COMMAND, &cmd); 234 pci_read_config_word(dev, PCI_COMMAND, &cmd);
217 old_cmd = cmd; 235 old_cmd = cmd;
218 for(idx = 0; idx < PCI_NUM_RESOURCES; idx++) { 236 for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) {
219 /* Only set up the requested stuff */ 237 /* Only set up the requested stuff */
220 if (!(mask & (1<<idx))) 238 if (!(mask & (1 << idx)))
221 continue; 239 continue;
222 240
223 r = &dev->resource[idx]; 241 r = &dev->resource[idx];
@@ -227,7 +245,9 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask)
227 (!(r->flags & IORESOURCE_ROM_ENABLE))) 245 (!(r->flags & IORESOURCE_ROM_ENABLE)))
228 continue; 246 continue;
229 if (!r->start && r->end) { 247 if (!r->start && r->end) {
230 printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev)); 248 printk(KERN_ERR "PCI: Device %s not available "
249 "because of resource collisions\n",
250 pci_name(dev));
231 return -EINVAL; 251 return -EINVAL;
232 } 252 }
233 if (r->flags & IORESOURCE_IO) 253 if (r->flags & IORESOURCE_IO)
@@ -236,21 +256,13 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask)
236 cmd |= PCI_COMMAND_MEMORY; 256 cmd |= PCI_COMMAND_MEMORY;
237 } 257 }
238 if (cmd != old_cmd) { 258 if (cmd != old_cmd) {
239 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd); 259 printk("PCI: Enabling device %s (%04x -> %04x)\n",
260 pci_name(dev), old_cmd, cmd);
240 pci_write_config_word(dev, PCI_COMMAND, cmd); 261 pci_write_config_word(dev, PCI_COMMAND, cmd);
241 } 262 }
242 return 0; 263 return 0;
243} 264}
244 265
245void pcibios_disable_resources(struct pci_dev *dev)
246{
247 u16 cmd;
248
249 pci_read_config_word(dev, PCI_COMMAND, &cmd);
250 cmd &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
251 pci_write_config_word(dev, PCI_COMMAND, cmd);
252}
253
254/* 266/*
255 * If we set up a device for bus mastering, we need to check the latency 267 * If we set up a device for bus mastering, we need to check the latency
256 * timer as certain crappy BIOSes forget to set it properly. 268 * timer as certain crappy BIOSes forget to set it properly.
@@ -267,7 +279,8 @@ void pcibios_set_master(struct pci_dev *dev)
267 lat = pcibios_max_latency; 279 lat = pcibios_max_latency;
268 else 280 else
269 return; 281 return;
270 printk(KERN_DEBUG "PCI: Setting latency timer of device %s to %d\n", pci_name(dev), lat); 282 printk(KERN_DEBUG "PCI: Setting latency timer of device %s to %d\n",
283 pci_name(dev), lat);
271 pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); 284 pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
272} 285}
273 286
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index dbc4aae9195..e65551cd821 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -255,13 +255,13 @@ static int pirq_via_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i
255 */ 255 */
256static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq) 256static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
257{ 257{
258 static const unsigned int pirqmap[4] = { 3, 2, 5, 1 }; 258 static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 };
259 return read_config_nybble(router, 0x55, pirqmap[pirq-1]); 259 return read_config_nybble(router, 0x55, pirqmap[pirq-1]);
260} 260}
261 261
262static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) 262static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
263{ 263{
264 static const unsigned int pirqmap[4] = { 3, 2, 5, 1 }; 264 static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 };
265 write_config_nybble(router, 0x55, pirqmap[pirq-1], irq); 265 write_config_nybble(router, 0x55, pirqmap[pirq-1], irq);
266 return 1; 266 return 1;
267} 267}
@@ -543,6 +543,12 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
543 case PCI_DEVICE_ID_INTEL_ICH8_2: 543 case PCI_DEVICE_ID_INTEL_ICH8_2:
544 case PCI_DEVICE_ID_INTEL_ICH8_3: 544 case PCI_DEVICE_ID_INTEL_ICH8_3:
545 case PCI_DEVICE_ID_INTEL_ICH8_4: 545 case PCI_DEVICE_ID_INTEL_ICH8_4:
546 case PCI_DEVICE_ID_INTEL_ICH9_0:
547 case PCI_DEVICE_ID_INTEL_ICH9_1:
548 case PCI_DEVICE_ID_INTEL_ICH9_2:
549 case PCI_DEVICE_ID_INTEL_ICH9_3:
550 case PCI_DEVICE_ID_INTEL_ICH9_4:
551 case PCI_DEVICE_ID_INTEL_ICH9_5:
546 r->name = "PIIX/ICH"; 552 r->name = "PIIX/ICH";
547 r->get = pirq_piix_get; 553 r->get = pirq_piix_get;
548 r->set = pirq_piix_set; 554 r->set = pirq_piix_set;
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
index d0c3da3aa2a..c6b6d9bbc45 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@ -154,38 +154,6 @@ static struct pci_raw_ops pci_mmcfg = {
154 .write = pci_mmcfg_write, 154 .write = pci_mmcfg_write,
155}; 155};
156 156
157
158static __init void pci_mmcfg_insert_resources(void)
159{
160#define PCI_MMCFG_RESOURCE_NAME_LEN 19
161 int i;
162 struct resource *res;
163 char *names;
164 unsigned num_buses;
165
166 res = kcalloc(PCI_MMCFG_RESOURCE_NAME_LEN + sizeof(*res),
167 pci_mmcfg_config_num, GFP_KERNEL);
168
169 if (!res) {
170 printk(KERN_ERR "PCI: Unable to allocate MMCONFIG resources\n");
171 return;
172 }
173
174 names = (void *)&res[pci_mmcfg_config_num];
175 for (i = 0; i < pci_mmcfg_config_num; i++, res++) {
176 num_buses = pci_mmcfg_config[i].end_bus_number -
177 pci_mmcfg_config[i].start_bus_number + 1;
178 res->name = names;
179 snprintf(names, PCI_MMCFG_RESOURCE_NAME_LEN, "PCI MMCONFIG %u",
180 pci_mmcfg_config[i].pci_segment_group_number);
181 res->start = pci_mmcfg_config[i].base_address;
182 res->end = res->start + (num_buses << 20) - 1;
183 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
184 insert_resource(&iomem_resource, res);
185 names += PCI_MMCFG_RESOURCE_NAME_LEN;
186 }
187}
188
189/* K8 systems have some devices (typically in the builtin northbridge) 157/* K8 systems have some devices (typically in the builtin northbridge)
190 that are only accessible using type1 158 that are only accessible using type1
191 Normally this can be expressed in the MCFG by not listing them 159 Normally this can be expressed in the MCFG by not listing them
@@ -222,8 +190,6 @@ static __init void unreachable_devices(void)
222 } 190 }
223} 191}
224 192
225
226
227void __init pci_mmcfg_init(int type) 193void __init pci_mmcfg_init(int type)
228{ 194{
229 if ((pci_probe & PCI_PROBE_MMCONF) == 0) 195 if ((pci_probe & PCI_PROBE_MMCONF) == 0)
@@ -251,5 +217,4 @@ void __init pci_mmcfg_init(int type)
251 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; 217 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
252 218
253 unreachable_devices(); 219 unreachable_devices();
254 pci_mmcfg_insert_resources();
255} 220}
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h
index 1814f74569c..a0a25180b61 100644
--- a/arch/i386/pci/pci.h
+++ b/arch/i386/pci/pci.h
@@ -30,13 +30,19 @@
30extern unsigned int pci_probe; 30extern unsigned int pci_probe;
31extern unsigned long pirq_table_addr; 31extern unsigned long pirq_table_addr;
32 32
33enum pci_bf_sort_state {
34 pci_bf_sort_default,
35 pci_force_nobf,
36 pci_force_bf,
37 pci_dmi_bf,
38};
39
33/* pci-i386.c */ 40/* pci-i386.c */
34 41
35extern unsigned int pcibios_max_latency; 42extern unsigned int pcibios_max_latency;
36 43
37void pcibios_resource_survey(void); 44void pcibios_resource_survey(void);
38int pcibios_enable_resources(struct pci_dev *, int); 45int pcibios_enable_resources(struct pci_dev *, int);
39void pcibios_disable_resources(struct pci_dev *);
40 46
41/* pci-pc.c */ 47/* pci-pc.c */
42 48
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 70f7eb9fed3..683b12c6f76 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -341,6 +341,7 @@ config NUMA
341 bool "NUMA support" 341 bool "NUMA support"
342 depends on !IA64_HP_SIM && !FLATMEM 342 depends on !IA64_HP_SIM && !FLATMEM
343 default y if IA64_SGI_SN2 343 default y if IA64_SGI_SN2
344 select ACPI_NUMA if ACPI
344 help 345 help
345 Say Y to compile the kernel to support NUMA (Non-Uniform Memory 346 Say Y to compile the kernel to support NUMA (Non-Uniform Memory
346 Access). This option is for configuring high-end multiprocessor 347 Access). This option is for configuring high-end multiprocessor
@@ -483,6 +484,15 @@ source "net/Kconfig"
483 484
484source "drivers/Kconfig" 485source "drivers/Kconfig"
485 486
487config MSPEC
488 tristate "Memory special operations driver"
489 depends on IA64
490 select IA64_UNCACHED_ALLOCATOR
491 help
492 If you have an ia64 and you want to enable memory special
493 operations support (formerly known as fetchop), say Y here,
494 otherwise say N.
495
486source "fs/Kconfig" 496source "fs/Kconfig"
487 497
488source "lib/Kconfig" 498source "lib/Kconfig"
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index 0f14a82b856..64e951de4e5 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -1,8 +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.17-rc3 3# Linux kernel version: 2.6.19-rc1
4# Thu Apr 27 11:48:23 2006 4# Mon Oct 9 10:53:59 2006
5# 5#
6CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
6 7
7# 8#
8# Code maturity level options 9# Code maturity level options
@@ -18,16 +19,22 @@ CONFIG_LOCALVERSION=""
18# CONFIG_LOCALVERSION_AUTO is not set 19# CONFIG_LOCALVERSION_AUTO is not set
19CONFIG_SWAP=y 20CONFIG_SWAP=y
20CONFIG_SYSVIPC=y 21CONFIG_SYSVIPC=y
22# CONFIG_IPC_NS is not set
21CONFIG_POSIX_MQUEUE=y 23CONFIG_POSIX_MQUEUE=y
22# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
23CONFIG_SYSCTL=y 25CONFIG_TASKSTATS=y
26# CONFIG_TASK_DELAY_ACCT is not set
27# CONFIG_UTS_NS is not set
24# CONFIG_AUDIT is not set 28# CONFIG_AUDIT is not set
25# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
26CONFIG_CPUSETS=y 30CONFIG_CPUSETS=y
27CONFIG_RELAY=y 31CONFIG_RELAY=y
28CONFIG_INITRAMFS_SOURCE="" 32CONFIG_INITRAMFS_SOURCE=""
29CONFIG_CC_OPTIMIZE_FOR_SIZE=y 33CONFIG_CC_OPTIMIZE_FOR_SIZE=y
34CONFIG_TASK_XACCT=y
35CONFIG_SYSCTL=y
30# CONFIG_EMBEDDED is not set 36# CONFIG_EMBEDDED is not set
37# CONFIG_SYSCTL_SYSCALL is not set
31CONFIG_KALLSYMS=y 38CONFIG_KALLSYMS=y
32CONFIG_KALLSYMS_ALL=y 39CONFIG_KALLSYMS_ALL=y
33# CONFIG_KALLSYMS_EXTRA_PASS is not set 40# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -40,6 +47,8 @@ CONFIG_FUTEX=y
40CONFIG_EPOLL=y 47CONFIG_EPOLL=y
41CONFIG_SHMEM=y 48CONFIG_SHMEM=y
42CONFIG_SLAB=y 49CONFIG_SLAB=y
50CONFIG_VM_EVENT_COUNTERS=y
51CONFIG_RT_MUTEXES=y
43# CONFIG_TINY_SHMEM is not set 52# CONFIG_TINY_SHMEM is not set
44CONFIG_BASE_SMALL=0 53CONFIG_BASE_SMALL=0
45# CONFIG_SLOB is not set 54# CONFIG_SLOB is not set
@@ -58,6 +67,7 @@ CONFIG_STOP_MACHINE=y
58# 67#
59# Block layer 68# Block layer
60# 69#
70CONFIG_BLOCK=y
61# CONFIG_BLK_DEV_IO_TRACE is not set 71# CONFIG_BLK_DEV_IO_TRACE is not set
62 72
63# 73#
@@ -89,7 +99,7 @@ CONFIG_EFI=y
89CONFIG_GENERIC_IOMAP=y 99CONFIG_GENERIC_IOMAP=y
90CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 100CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
91CONFIG_IA64_UNCACHED_ALLOCATOR=y 101CONFIG_IA64_UNCACHED_ALLOCATOR=y
92CONFIG_DMA_IS_DMA32=y 102CONFIG_AUDIT_ARCH=y
93# CONFIG_IA64_GENERIC is not set 103# CONFIG_IA64_GENERIC is not set
94# CONFIG_IA64_DIG is not set 104# CONFIG_IA64_DIG is not set
95# CONFIG_IA64_HP_ZX1 is not set 105# CONFIG_IA64_HP_ZX1 is not set
@@ -116,6 +126,7 @@ CONFIG_FORCE_MAX_ZONEORDER=17
116CONFIG_SMP=y 126CONFIG_SMP=y
117CONFIG_NR_CPUS=1024 127CONFIG_NR_CPUS=1024
118# CONFIG_HOTPLUG_CPU is not set 128# CONFIG_HOTPLUG_CPU is not set
129CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
119CONFIG_SCHED_SMT=y 130CONFIG_SCHED_SMT=y
120CONFIG_PREEMPT=y 131CONFIG_PREEMPT=y
121CONFIG_SELECT_MEMORY_MODEL=y 132CONFIG_SELECT_MEMORY_MODEL=y
@@ -128,6 +139,7 @@ CONFIG_NEED_MULTIPLE_NODES=y
128# CONFIG_SPARSEMEM_STATIC is not set 139# CONFIG_SPARSEMEM_STATIC is not set
129CONFIG_SPLIT_PTLOCK_CPUS=4 140CONFIG_SPLIT_PTLOCK_CPUS=4
130CONFIG_MIGRATION=y 141CONFIG_MIGRATION=y
142CONFIG_RESOURCES_64BIT=y
131CONFIG_ARCH_SELECT_MEMORY_MODEL=y 143CONFIG_ARCH_SELECT_MEMORY_MODEL=y
132CONFIG_ARCH_DISCONTIGMEM_ENABLE=y 144CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
133CONFIG_ARCH_FLATMEM_ENABLE=y 145CONFIG_ARCH_FLATMEM_ENABLE=y
@@ -135,15 +147,24 @@ CONFIG_ARCH_SPARSEMEM_ENABLE=y
135CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y 147CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
136CONFIG_NUMA=y 148CONFIG_NUMA=y
137CONFIG_NODES_SHIFT=10 149CONFIG_NODES_SHIFT=10
150CONFIG_ARCH_POPULATES_NODE_MAP=y
138CONFIG_VIRTUAL_MEM_MAP=y 151CONFIG_VIRTUAL_MEM_MAP=y
139CONFIG_HOLES_IN_ZONE=y 152CONFIG_HOLES_IN_ZONE=y
140CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y 153CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
154CONFIG_HAVE_ARCH_NODEDATA_EXTENSION=y
141CONFIG_IA32_SUPPORT=y 155CONFIG_IA32_SUPPORT=y
142CONFIG_COMPAT=y 156CONFIG_COMPAT=y
143CONFIG_IA64_MCA_RECOVERY=y 157CONFIG_IA64_MCA_RECOVERY=y
144CONFIG_PERFMON=y 158CONFIG_PERFMON=y
145CONFIG_IA64_PALINFO=y 159CONFIG_IA64_PALINFO=y
146CONFIG_SGI_SN=y 160CONFIG_SGI_SN=y
161# CONFIG_IA64_ESI is not set
162
163#
164# SN Devices
165#
166CONFIG_SGI_IOC4=y
167CONFIG_SGI_IOC3=y
147 168
148# 169#
149# Firmware Drivers 170# Firmware Drivers
@@ -159,6 +180,7 @@ CONFIG_BINFMT_ELF=y
159CONFIG_PM=y 180CONFIG_PM=y
160# CONFIG_PM_LEGACY is not set 181# CONFIG_PM_LEGACY is not set
161# CONFIG_PM_DEBUG is not set 182# CONFIG_PM_DEBUG is not set
183# CONFIG_PM_SYSFS_DEPRECATED is not set
162 184
163# 185#
164# ACPI (Advanced Configuration and Power Interface) Support 186# ACPI (Advanced Configuration and Power Interface) Support
@@ -166,6 +188,7 @@ CONFIG_PM=y
166CONFIG_ACPI=y 188CONFIG_ACPI=y
167# CONFIG_ACPI_BUTTON is not set 189# CONFIG_ACPI_BUTTON is not set
168# CONFIG_ACPI_FAN is not set 190# CONFIG_ACPI_FAN is not set
191# CONFIG_ACPI_DOCK is not set
169# CONFIG_ACPI_PROCESSOR is not set 192# CONFIG_ACPI_PROCESSOR is not set
170CONFIG_ACPI_NUMA=y 193CONFIG_ACPI_NUMA=y
171CONFIG_ACPI_BLACKLIST_YEAR=0 194CONFIG_ACPI_BLACKLIST_YEAR=0
@@ -185,7 +208,12 @@ CONFIG_ACPI_SYSTEM=y
185# 208#
186CONFIG_PCI=y 209CONFIG_PCI=y
187CONFIG_PCI_DOMAINS=y 210CONFIG_PCI_DOMAINS=y
211CONFIG_PCIEPORTBUS=y
212CONFIG_HOTPLUG_PCI_PCIE=y
213# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set
214CONFIG_PCIEAER=y
188# CONFIG_PCI_MSI is not set 215# CONFIG_PCI_MSI is not set
216# CONFIG_PCI_MULTITHREAD_PROBE is not set
189# CONFIG_PCI_DEBUG is not set 217# CONFIG_PCI_DEBUG is not set
190 218
191# 219#
@@ -215,6 +243,9 @@ CONFIG_NET=y
215CONFIG_PACKET=y 243CONFIG_PACKET=y
216CONFIG_PACKET_MMAP=y 244CONFIG_PACKET_MMAP=y
217CONFIG_UNIX=y 245CONFIG_UNIX=y
246CONFIG_XFRM=y
247# CONFIG_XFRM_USER is not set
248# CONFIG_XFRM_SUB_POLICY is not set
218# CONFIG_NET_KEY is not set 249# CONFIG_NET_KEY is not set
219CONFIG_INET=y 250CONFIG_INET=y
220CONFIG_IP_MULTICAST=y 251CONFIG_IP_MULTICAST=y
@@ -231,19 +262,31 @@ CONFIG_SYN_COOKIES=y
231# CONFIG_INET_IPCOMP is not set 262# CONFIG_INET_IPCOMP is not set
232# CONFIG_INET_XFRM_TUNNEL is not set 263# CONFIG_INET_XFRM_TUNNEL is not set
233# CONFIG_INET_TUNNEL is not set 264# CONFIG_INET_TUNNEL is not set
265CONFIG_INET_XFRM_MODE_TRANSPORT=y
266CONFIG_INET_XFRM_MODE_TUNNEL=y
267CONFIG_INET_XFRM_MODE_BEET=y
234CONFIG_INET_DIAG=m 268CONFIG_INET_DIAG=m
235CONFIG_INET_TCP_DIAG=m 269CONFIG_INET_TCP_DIAG=m
236# CONFIG_TCP_CONG_ADVANCED is not set 270# CONFIG_TCP_CONG_ADVANCED is not set
237CONFIG_TCP_CONG_BIC=y 271CONFIG_TCP_CONG_CUBIC=y
272CONFIG_DEFAULT_TCP_CONG="cubic"
238CONFIG_IPV6=m 273CONFIG_IPV6=m
239# CONFIG_IPV6_PRIVACY is not set 274# CONFIG_IPV6_PRIVACY is not set
240# CONFIG_IPV6_ROUTER_PREF is not set 275# CONFIG_IPV6_ROUTER_PREF is not set
241# CONFIG_INET6_AH is not set 276# CONFIG_INET6_AH is not set
242# CONFIG_INET6_ESP is not set 277# CONFIG_INET6_ESP is not set
243# CONFIG_INET6_IPCOMP is not set 278# CONFIG_INET6_IPCOMP is not set
279# CONFIG_IPV6_MIP6 is not set
244# CONFIG_INET6_XFRM_TUNNEL is not set 280# CONFIG_INET6_XFRM_TUNNEL is not set
245# CONFIG_INET6_TUNNEL is not set 281# CONFIG_INET6_TUNNEL is not set
282CONFIG_INET6_XFRM_MODE_TRANSPORT=m
283CONFIG_INET6_XFRM_MODE_TUNNEL=m
284CONFIG_INET6_XFRM_MODE_BEET=m
285# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
246# CONFIG_IPV6_TUNNEL is not set 286# CONFIG_IPV6_TUNNEL is not set
287# CONFIG_IPV6_SUBTREES is not set
288# CONFIG_IPV6_MULTIPLE_TABLES is not set
289# CONFIG_NETWORK_SECMARK is not set
247# CONFIG_NETFILTER is not set 290# CONFIG_NETFILTER is not set
248 291
249# 292#
@@ -269,7 +312,6 @@ CONFIG_IPV6=m
269# CONFIG_ATALK is not set 312# CONFIG_ATALK is not set
270# CONFIG_X25 is not set 313# CONFIG_X25 is not set
271# CONFIG_LAPB is not set 314# CONFIG_LAPB is not set
272# CONFIG_NET_DIVERT is not set
273# CONFIG_ECONET is not set 315# CONFIG_ECONET is not set
274# CONFIG_WAN_ROUTER is not set 316# CONFIG_WAN_ROUTER is not set
275 317
@@ -298,6 +340,7 @@ CONFIG_STANDALONE=y
298CONFIG_PREVENT_FIRMWARE_BUILD=y 340CONFIG_PREVENT_FIRMWARE_BUILD=y
299CONFIG_FW_LOADER=y 341CONFIG_FW_LOADER=y
300# CONFIG_DEBUG_DRIVER is not set 342# CONFIG_DEBUG_DRIVER is not set
343# CONFIG_SYS_HYPERVISOR is not set
301 344
302# 345#
303# Connector - unified userspace <-> kernelspace linker 346# Connector - unified userspace <-> kernelspace linker
@@ -335,6 +378,7 @@ CONFIG_BLK_DEV_NBD=m
335CONFIG_BLK_DEV_RAM=y 378CONFIG_BLK_DEV_RAM=y
336CONFIG_BLK_DEV_RAM_COUNT=16 379CONFIG_BLK_DEV_RAM_COUNT=16
337CONFIG_BLK_DEV_RAM_SIZE=4096 380CONFIG_BLK_DEV_RAM_SIZE=4096
381CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
338CONFIG_BLK_DEV_INITRD=y 382CONFIG_BLK_DEV_INITRD=y
339# CONFIG_CDROM_PKTCDVD is not set 383# CONFIG_CDROM_PKTCDVD is not set
340CONFIG_ATA_OVER_ETH=m 384CONFIG_ATA_OVER_ETH=m
@@ -381,6 +425,7 @@ CONFIG_IDEDMA_PCI_AUTO=y
381# CONFIG_BLK_DEV_CS5530 is not set 425# CONFIG_BLK_DEV_CS5530 is not set
382# CONFIG_BLK_DEV_HPT34X is not set 426# CONFIG_BLK_DEV_HPT34X is not set
383# CONFIG_BLK_DEV_HPT366 is not set 427# CONFIG_BLK_DEV_HPT366 is not set
428# CONFIG_BLK_DEV_JMICRON is not set
384# CONFIG_BLK_DEV_SC1200 is not set 429# CONFIG_BLK_DEV_SC1200 is not set
385# CONFIG_BLK_DEV_PIIX is not set 430# CONFIG_BLK_DEV_PIIX is not set
386# CONFIG_BLK_DEV_IT821X is not set 431# CONFIG_BLK_DEV_IT821X is not set
@@ -404,6 +449,7 @@ CONFIG_IDEDMA_AUTO=y
404# 449#
405# CONFIG_RAID_ATTRS is not set 450# CONFIG_RAID_ATTRS is not set
406CONFIG_SCSI=y 451CONFIG_SCSI=y
452CONFIG_SCSI_NETLINK=y
407CONFIG_SCSI_PROC_FS=y 453CONFIG_SCSI_PROC_FS=y
408 454
409# 455#
@@ -425,12 +471,14 @@ CONFIG_SCSI_CONSTANTS=y
425# CONFIG_SCSI_LOGGING is not set 471# CONFIG_SCSI_LOGGING is not set
426 472
427# 473#
428# SCSI Transport Attributes 474# SCSI Transports
429# 475#
430CONFIG_SCSI_SPI_ATTRS=y 476CONFIG_SCSI_SPI_ATTRS=y
431CONFIG_SCSI_FC_ATTRS=y 477CONFIG_SCSI_FC_ATTRS=y
432CONFIG_SCSI_ISCSI_ATTRS=m 478CONFIG_SCSI_ISCSI_ATTRS=m
433CONFIG_SCSI_SAS_ATTRS=y 479CONFIG_SCSI_SAS_ATTRS=y
480CONFIG_SCSI_SAS_LIBSAS=y
481# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
434 482
435# 483#
436# SCSI low-level drivers 484# SCSI low-level drivers
@@ -443,46 +491,82 @@ CONFIG_ISCSI_TCP=m
443# CONFIG_SCSI_AIC7XXX is not set 491# CONFIG_SCSI_AIC7XXX is not set
444# CONFIG_SCSI_AIC7XXX_OLD is not set 492# CONFIG_SCSI_AIC7XXX_OLD is not set
445# CONFIG_SCSI_AIC79XX is not set 493# CONFIG_SCSI_AIC79XX is not set
494# CONFIG_SCSI_AIC94XX is not set
495# CONFIG_SCSI_ARCMSR is not set
446# CONFIG_MEGARAID_NEWGEN is not set 496# CONFIG_MEGARAID_NEWGEN is not set
447# CONFIG_MEGARAID_LEGACY is not set 497# CONFIG_MEGARAID_LEGACY is not set
448# CONFIG_MEGARAID_SAS is not set 498# CONFIG_MEGARAID_SAS is not set
449CONFIG_SCSI_SATA=y 499# CONFIG_SCSI_HPTIOP is not set
450# CONFIG_SCSI_SATA_AHCI is not set
451# CONFIG_SCSI_SATA_SVW is not set
452# CONFIG_SCSI_ATA_PIIX is not set
453# CONFIG_SCSI_SATA_MV is not set
454# CONFIG_SCSI_SATA_NV is not set
455# CONFIG_SCSI_PDC_ADMA is not set
456# CONFIG_SCSI_SATA_QSTOR is not set
457# CONFIG_SCSI_SATA_PROMISE is not set
458# CONFIG_SCSI_SATA_SX4 is not set
459# CONFIG_SCSI_SATA_SIL is not set
460# CONFIG_SCSI_SATA_SIL24 is not set
461# CONFIG_SCSI_SATA_SIS is not set
462# CONFIG_SCSI_SATA_ULI is not set
463# CONFIG_SCSI_SATA_VIA is not set
464CONFIG_SCSI_SATA_VITESSE=y
465# CONFIG_SCSI_DMX3191D is not set 500# CONFIG_SCSI_DMX3191D is not set
466# CONFIG_SCSI_FUTURE_DOMAIN is not set 501# CONFIG_SCSI_FUTURE_DOMAIN is not set
467# CONFIG_SCSI_IPS is not set 502# CONFIG_SCSI_IPS is not set
468# CONFIG_SCSI_INITIO is not set 503# CONFIG_SCSI_INITIO is not set
469# CONFIG_SCSI_INIA100 is not set 504# CONFIG_SCSI_INIA100 is not set
505# CONFIG_SCSI_STEX is not set
470# CONFIG_SCSI_SYM53C8XX_2 is not set 506# CONFIG_SCSI_SYM53C8XX_2 is not set
471# CONFIG_SCSI_IPR is not set 507# CONFIG_SCSI_IPR is not set
472CONFIG_SCSI_QLOGIC_1280=y 508CONFIG_SCSI_QLOGIC_1280=y
473CONFIG_SCSI_QLA_FC=y 509CONFIG_SCSI_QLA_FC=y
474CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE=y 510# CONFIG_SCSI_QLA_ISCSI is not set
475# CONFIG_SCSI_QLA21XX is not set
476CONFIG_SCSI_QLA22XX=y
477CONFIG_SCSI_QLA2300=y
478CONFIG_SCSI_QLA2322=y
479# CONFIG_SCSI_QLA24XX is not set
480# CONFIG_SCSI_LPFC is not set 511# CONFIG_SCSI_LPFC is not set
481# CONFIG_SCSI_DC395x is not set 512# CONFIG_SCSI_DC395x is not set
482# CONFIG_SCSI_DC390T is not set 513# CONFIG_SCSI_DC390T is not set
483# CONFIG_SCSI_DEBUG is not set 514# CONFIG_SCSI_DEBUG is not set
484 515
485# 516#
517# Serial ATA (prod) and Parallel ATA (experimental) drivers
518#
519CONFIG_ATA=y
520# CONFIG_SATA_AHCI is not set
521# CONFIG_SATA_SVW is not set
522# CONFIG_ATA_PIIX is not set
523# CONFIG_SATA_MV is not set
524# CONFIG_SATA_NV is not set
525# CONFIG_PDC_ADMA is not set
526# CONFIG_SATA_QSTOR is not set
527# CONFIG_SATA_PROMISE is not set
528# CONFIG_SATA_SX4 is not set
529# CONFIG_SATA_SIL is not set
530# CONFIG_SATA_SIL24 is not set
531# CONFIG_SATA_SIS is not set
532# CONFIG_SATA_ULI is not set
533# CONFIG_SATA_VIA is not set
534CONFIG_SATA_VITESSE=y
535# CONFIG_PATA_ALI is not set
536# CONFIG_PATA_AMD is not set
537# CONFIG_PATA_ARTOP is not set
538# CONFIG_PATA_ATIIXP is not set
539# CONFIG_PATA_CMD64X is not set
540# CONFIG_PATA_CS5520 is not set
541# CONFIG_PATA_CS5530 is not set
542# CONFIG_PATA_CYPRESS is not set
543# CONFIG_PATA_EFAR is not set
544# CONFIG_ATA_GENERIC is not set
545# CONFIG_PATA_HPT366 is not set
546# CONFIG_PATA_HPT37X is not set
547# CONFIG_PATA_HPT3X2N is not set
548# CONFIG_PATA_HPT3X3 is not set
549# CONFIG_PATA_IT821X is not set
550# CONFIG_PATA_JMICRON is not set
551# CONFIG_PATA_TRIFLEX is not set
552# CONFIG_PATA_MPIIX is not set
553# CONFIG_PATA_OLDPIIX is not set
554# CONFIG_PATA_NETCELL is not set
555# CONFIG_PATA_NS87410 is not set
556# CONFIG_PATA_OPTI is not set
557# CONFIG_PATA_OPTIDMA is not set
558# CONFIG_PATA_PDC_OLD is not set
559# CONFIG_PATA_RADISYS is not set
560# CONFIG_PATA_RZ1000 is not set
561# CONFIG_PATA_SC1200 is not set
562# CONFIG_PATA_SERVERWORKS is not set
563# CONFIG_PATA_PDC2027X is not set
564# CONFIG_PATA_SIL680 is not set
565# CONFIG_PATA_SIS is not set
566# CONFIG_PATA_VIA is not set
567# CONFIG_PATA_WINBOND is not set
568
569#
486# Multi-device support (RAID and LVM) 570# Multi-device support (RAID and LVM)
487# 571#
488CONFIG_MD=y 572CONFIG_MD=y
@@ -491,12 +575,12 @@ CONFIG_MD_LINEAR=y
491CONFIG_MD_RAID0=y 575CONFIG_MD_RAID0=y
492CONFIG_MD_RAID1=y 576CONFIG_MD_RAID1=y
493# CONFIG_MD_RAID10 is not set 577# CONFIG_MD_RAID10 is not set
494CONFIG_MD_RAID5=y 578CONFIG_MD_RAID456=y
495# CONFIG_MD_RAID5_RESHAPE is not set 579# CONFIG_MD_RAID5_RESHAPE is not set
496# CONFIG_MD_RAID6 is not set
497CONFIG_MD_MULTIPATH=y 580CONFIG_MD_MULTIPATH=y
498# CONFIG_MD_FAULTY is not set 581# CONFIG_MD_FAULTY is not set
499CONFIG_BLK_DEV_DM=y 582CONFIG_BLK_DEV_DM=y
583# CONFIG_DM_DEBUG is not set
500CONFIG_DM_CRYPT=m 584CONFIG_DM_CRYPT=m
501CONFIG_DM_SNAPSHOT=m 585CONFIG_DM_SNAPSHOT=m
502CONFIG_DM_MIRROR=m 586CONFIG_DM_MIRROR=m
@@ -563,6 +647,7 @@ CONFIG_NETDEVICES=y
563# CONFIG_SK98LIN is not set 647# CONFIG_SK98LIN is not set
564CONFIG_TIGON3=y 648CONFIG_TIGON3=y
565# CONFIG_BNX2 is not set 649# CONFIG_BNX2 is not set
650# CONFIG_QLA3XXX is not set
566 651
567# 652#
568# Ethernet (10000 Mbit) 653# Ethernet (10000 Mbit)
@@ -571,6 +656,7 @@ CONFIG_CHELSIO_T1=m
571# CONFIG_IXGB is not set 656# CONFIG_IXGB is not set
572CONFIG_S2IO=m 657CONFIG_S2IO=m
573# CONFIG_S2IO_NAPI is not set 658# CONFIG_S2IO_NAPI is not set
659# CONFIG_MYRI10GE is not set
574 660
575# 661#
576# Token Ring devices 662# Token Ring devices
@@ -612,6 +698,7 @@ CONFIG_NET_POLL_CONTROLLER=y
612# Input device support 698# Input device support
613# 699#
614CONFIG_INPUT=y 700CONFIG_INPUT=y
701# CONFIG_INPUT_FF_MEMLESS is not set
615 702
616# 703#
617# Userland interfaces 704# Userland interfaces
@@ -646,6 +733,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
646CONFIG_VT=y 733CONFIG_VT=y
647CONFIG_VT_CONSOLE=y 734CONFIG_VT_CONSOLE=y
648CONFIG_HW_CONSOLE=y 735CONFIG_HW_CONSOLE=y
736# CONFIG_VT_HW_CONSOLE_BINDING is not set
649CONFIG_SERIAL_NONSTANDARD=y 737CONFIG_SERIAL_NONSTANDARD=y
650# CONFIG_COMPUTONE is not set 738# CONFIG_COMPUTONE is not set
651# CONFIG_ROCKETPORT is not set 739# CONFIG_ROCKETPORT is not set
@@ -659,10 +747,12 @@ CONFIG_SERIAL_NONSTANDARD=y
659# CONFIG_N_HDLC is not set 747# CONFIG_N_HDLC is not set
660# CONFIG_SPECIALIX is not set 748# CONFIG_SPECIALIX is not set
661# CONFIG_SX is not set 749# CONFIG_SX is not set
750# CONFIG_RIO is not set
662# CONFIG_STALDRV is not set 751# CONFIG_STALDRV is not set
663CONFIG_SGI_SNSC=y 752CONFIG_SGI_SNSC=y
664CONFIG_SGI_TIOCX=y 753CONFIG_SGI_TIOCX=y
665CONFIG_SGI_MBCS=m 754CONFIG_SGI_MBCS=m
755CONFIG_MSPEC=y
666 756
667# 757#
668# Serial drivers 758# Serial drivers
@@ -701,6 +791,7 @@ CONFIG_EFI_RTC=y
701# Ftape, the floppy tape device driver 791# Ftape, the floppy tape device driver
702# 792#
703CONFIG_AGP=y 793CONFIG_AGP=y
794# CONFIG_AGP_SIS is not set
704# CONFIG_AGP_VIA is not set 795# CONFIG_AGP_VIA is not set
705CONFIG_AGP_SGI_TIOCA=y 796CONFIG_AGP_SGI_TIOCA=y
706# CONFIG_DRM is not set 797# CONFIG_DRM is not set
@@ -730,7 +821,6 @@ CONFIG_MMTIMER=y
730# 821#
731# Dallas's 1-wire bus 822# Dallas's 1-wire bus
732# 823#
733# CONFIG_W1 is not set
734 824
735# 825#
736# Hardware Monitoring support 826# Hardware Monitoring support
@@ -741,6 +831,7 @@ CONFIG_MMTIMER=y
741# 831#
742# Misc devices 832# Misc devices
743# 833#
834# CONFIG_TIFM_CORE is not set
744 835
745# 836#
746# Multimedia devices 837# Multimedia devices
@@ -756,6 +847,7 @@ CONFIG_MMTIMER=y
756# 847#
757# Graphics support 848# Graphics support
758# 849#
850CONFIG_FIRMWARE_EDID=y
759# CONFIG_FB is not set 851# CONFIG_FB is not set
760 852
761# 853#
@@ -764,6 +856,7 @@ CONFIG_MMTIMER=y
764CONFIG_VGA_CONSOLE=y 856CONFIG_VGA_CONSOLE=y
765# CONFIG_VGACON_SOFT_SCROLLBACK is not set 857# CONFIG_VGACON_SOFT_SCROLLBACK is not set
766CONFIG_DUMMY_CONSOLE=y 858CONFIG_DUMMY_CONSOLE=y
859# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
767 860
768# 861#
769# Sound 862# Sound
@@ -794,6 +887,7 @@ CONFIG_USB=m
794CONFIG_USB_EHCI_HCD=m 887CONFIG_USB_EHCI_HCD=m
795# CONFIG_USB_EHCI_SPLIT_ISO is not set 888# CONFIG_USB_EHCI_SPLIT_ISO is not set
796# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 889# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
890# CONFIG_USB_EHCI_TT_NEWSCHED is not set
797# CONFIG_USB_ISP116X_HCD is not set 891# CONFIG_USB_ISP116X_HCD is not set
798CONFIG_USB_OHCI_HCD=m 892CONFIG_USB_OHCI_HCD=m
799# CONFIG_USB_OHCI_BIG_ENDIAN is not set 893# CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -843,6 +937,7 @@ CONFIG_USB_HIDINPUT=y
843# CONFIG_USB_ATI_REMOTE2 is not set 937# CONFIG_USB_ATI_REMOTE2 is not set
844# CONFIG_USB_KEYSPAN_REMOTE is not set 938# CONFIG_USB_KEYSPAN_REMOTE is not set
845# CONFIG_USB_APPLETOUCH is not set 939# CONFIG_USB_APPLETOUCH is not set
940# CONFIG_USB_TRANCEVIBRATOR is not set
846 941
847# 942#
848# USB Imaging devices 943# USB Imaging devices
@@ -874,15 +969,18 @@ CONFIG_USB_MON=y
874# 969#
875# CONFIG_USB_EMI62 is not set 970# CONFIG_USB_EMI62 is not set
876# CONFIG_USB_EMI26 is not set 971# CONFIG_USB_EMI26 is not set
972# CONFIG_USB_ADUTUX is not set
877# CONFIG_USB_AUERSWALD is not set 973# CONFIG_USB_AUERSWALD is not set
878# CONFIG_USB_RIO500 is not set 974# CONFIG_USB_RIO500 is not set
879# CONFIG_USB_LEGOTOWER is not set 975# CONFIG_USB_LEGOTOWER is not set
880# CONFIG_USB_LCD is not set 976# CONFIG_USB_LCD is not set
881# CONFIG_USB_LED is not set 977# CONFIG_USB_LED is not set
978# CONFIG_USB_CYPRESS_CY7C63 is not set
882# CONFIG_USB_CYTHERM is not set 979# CONFIG_USB_CYTHERM is not set
883# CONFIG_USB_PHIDGETKIT is not set 980# CONFIG_USB_PHIDGET is not set
884# CONFIG_USB_PHIDGETSERVO is not set
885# CONFIG_USB_IDMOUSE is not set 981# CONFIG_USB_IDMOUSE is not set
982# CONFIG_USB_FTDI_ELAN is not set
983# CONFIG_USB_APPLEDISPLAY is not set
886# CONFIG_USB_SISUSBVGA is not set 984# CONFIG_USB_SISUSBVGA is not set
887# CONFIG_USB_LD is not set 985# CONFIG_USB_LD is not set
888 986
@@ -919,18 +1017,15 @@ CONFIG_USB_MON=y
919CONFIG_INFINIBAND=m 1017CONFIG_INFINIBAND=m
920# CONFIG_INFINIBAND_USER_MAD is not set 1018# CONFIG_INFINIBAND_USER_MAD is not set
921CONFIG_INFINIBAND_USER_ACCESS=m 1019CONFIG_INFINIBAND_USER_ACCESS=m
1020CONFIG_INFINIBAND_ADDR_TRANS=y
922CONFIG_INFINIBAND_MTHCA=m 1021CONFIG_INFINIBAND_MTHCA=m
923CONFIG_INFINIBAND_MTHCA_DEBUG=y 1022CONFIG_INFINIBAND_MTHCA_DEBUG=y
1023# CONFIG_INFINIBAND_AMSO1100 is not set
924CONFIG_INFINIBAND_IPOIB=m 1024CONFIG_INFINIBAND_IPOIB=m
925CONFIG_INFINIBAND_IPOIB_DEBUG=y 1025CONFIG_INFINIBAND_IPOIB_DEBUG=y
926# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set 1026# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
927CONFIG_INFINIBAND_SRP=m 1027CONFIG_INFINIBAND_SRP=m
928 1028# CONFIG_INFINIBAND_ISER is not set
929#
930# SN Devices
931#
932CONFIG_SGI_IOC4=y
933CONFIG_SGI_IOC3=y
934 1029
935# 1030#
936# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 1031# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
@@ -942,6 +1037,19 @@ CONFIG_SGI_IOC3=y
942# CONFIG_RTC_CLASS is not set 1037# CONFIG_RTC_CLASS is not set
943 1038
944# 1039#
1040# DMA Engine support
1041#
1042# CONFIG_DMA_ENGINE is not set
1043
1044#
1045# DMA Clients
1046#
1047
1048#
1049# DMA Devices
1050#
1051
1052#
945# File systems 1053# File systems
946# 1054#
947CONFIG_EXT2_FS=y 1055CONFIG_EXT2_FS=y
@@ -965,15 +1073,16 @@ CONFIG_REISERFS_FS_SECURITY=y
965# CONFIG_JFS_FS is not set 1073# CONFIG_JFS_FS is not set
966CONFIG_FS_POSIX_ACL=y 1074CONFIG_FS_POSIX_ACL=y
967CONFIG_XFS_FS=y 1075CONFIG_XFS_FS=y
968CONFIG_XFS_EXPORT=y
969CONFIG_XFS_QUOTA=y 1076CONFIG_XFS_QUOTA=y
970# CONFIG_XFS_SECURITY is not set 1077# CONFIG_XFS_SECURITY is not set
971CONFIG_XFS_POSIX_ACL=y 1078CONFIG_XFS_POSIX_ACL=y
972CONFIG_XFS_RT=y 1079CONFIG_XFS_RT=y
1080# CONFIG_GFS2_FS is not set
973# CONFIG_OCFS2_FS is not set 1081# CONFIG_OCFS2_FS is not set
974# CONFIG_MINIX_FS is not set 1082# CONFIG_MINIX_FS is not set
975# CONFIG_ROMFS_FS is not set 1083# CONFIG_ROMFS_FS is not set
976CONFIG_INOTIFY=y 1084CONFIG_INOTIFY=y
1085CONFIG_INOTIFY_USER=y
977CONFIG_QUOTA=y 1086CONFIG_QUOTA=y
978# CONFIG_QFMT_V1 is not set 1087# CONFIG_QFMT_V1 is not set
979# CONFIG_QFMT_V2 is not set 1088# CONFIG_QFMT_V2 is not set
@@ -1007,8 +1116,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1007# 1116#
1008CONFIG_PROC_FS=y 1117CONFIG_PROC_FS=y
1009CONFIG_PROC_KCORE=y 1118CONFIG_PROC_KCORE=y
1119CONFIG_PROC_SYSCTL=y
1010CONFIG_SYSFS=y 1120CONFIG_SYSFS=y
1011CONFIG_TMPFS=y 1121CONFIG_TMPFS=y
1122# CONFIG_TMPFS_POSIX_ACL is not set
1012CONFIG_HUGETLBFS=y 1123CONFIG_HUGETLBFS=y
1013CONFIG_HUGETLB_PAGE=y 1124CONFIG_HUGETLB_PAGE=y
1014CONFIG_RAMFS=y 1125CONFIG_RAMFS=y
@@ -1046,7 +1157,7 @@ CONFIG_NFSD_V4=y
1046CONFIG_NFSD_TCP=y 1157CONFIG_NFSD_TCP=y
1047CONFIG_LOCKD=m 1158CONFIG_LOCKD=m
1048CONFIG_LOCKD_V4=y 1159CONFIG_LOCKD_V4=y
1049CONFIG_EXPORTFS=y 1160CONFIG_EXPORTFS=m
1050CONFIG_NFS_COMMON=y 1161CONFIG_NFS_COMMON=y
1051CONFIG_SUNRPC=m 1162CONFIG_SUNRPC=m
1052CONFIG_SUNRPC_GSS=m 1163CONFIG_SUNRPC_GSS=m
@@ -1056,7 +1167,9 @@ CONFIG_SMB_FS=m
1056# CONFIG_SMB_NLS_DEFAULT is not set 1167# CONFIG_SMB_NLS_DEFAULT is not set
1057CONFIG_CIFS=m 1168CONFIG_CIFS=m
1058# CONFIG_CIFS_STATS is not set 1169# CONFIG_CIFS_STATS is not set
1170# CONFIG_CIFS_WEAK_PW_HASH is not set
1059# CONFIG_CIFS_XATTR is not set 1171# CONFIG_CIFS_XATTR is not set
1172# CONFIG_CIFS_DEBUG2 is not set
1060# CONFIG_CIFS_EXPERIMENTAL is not set 1173# CONFIG_CIFS_EXPERIMENTAL is not set
1061# CONFIG_NCP_FS is not set 1174# CONFIG_NCP_FS is not set
1062# CONFIG_CODA_FS is not set 1175# CONFIG_CODA_FS is not set
@@ -1129,6 +1242,10 @@ CONFIG_NLS_ISO8859_1=y
1129CONFIG_NLS_UTF8=y 1242CONFIG_NLS_UTF8=y
1130 1243
1131# 1244#
1245# Distributed Lock Manager
1246#
1247
1248#
1132# Library routines 1249# Library routines
1133# 1250#
1134# CONFIG_CRC_CCITT is not set 1251# CONFIG_CRC_CCITT is not set
@@ -1138,9 +1255,11 @@ CONFIG_LIBCRC32C=m
1138CONFIG_ZLIB_INFLATE=m 1255CONFIG_ZLIB_INFLATE=m
1139CONFIG_ZLIB_DEFLATE=m 1256CONFIG_ZLIB_DEFLATE=m
1140CONFIG_GENERIC_ALLOCATOR=y 1257CONFIG_GENERIC_ALLOCATOR=y
1258CONFIG_PLIST=y
1141CONFIG_GENERIC_HARDIRQS=y 1259CONFIG_GENERIC_HARDIRQS=y
1142CONFIG_GENERIC_IRQ_PROBE=y 1260CONFIG_GENERIC_IRQ_PROBE=y
1143CONFIG_GENERIC_PENDING_IRQ=y 1261CONFIG_GENERIC_PENDING_IRQ=y
1262CONFIG_IRQ_PER_CPU=y
1144 1263
1145# 1264#
1146# Instrumentation Support 1265# Instrumentation Support
@@ -1152,20 +1271,26 @@ CONFIG_GENERIC_PENDING_IRQ=y
1152# Kernel hacking 1271# Kernel hacking
1153# 1272#
1154# CONFIG_PRINTK_TIME is not set 1273# CONFIG_PRINTK_TIME is not set
1274CONFIG_ENABLE_MUST_CHECK=y
1155CONFIG_MAGIC_SYSRQ=y 1275CONFIG_MAGIC_SYSRQ=y
1276# CONFIG_UNUSED_SYMBOLS is not set
1156CONFIG_DEBUG_KERNEL=y 1277CONFIG_DEBUG_KERNEL=y
1157CONFIG_LOG_BUF_SHIFT=20 1278CONFIG_LOG_BUF_SHIFT=20
1158CONFIG_DETECT_SOFTLOCKUP=y 1279CONFIG_DETECT_SOFTLOCKUP=y
1159# CONFIG_SCHEDSTATS is not set 1280# CONFIG_SCHEDSTATS is not set
1160# CONFIG_DEBUG_SLAB is not set 1281# CONFIG_DEBUG_SLAB is not set
1161CONFIG_DEBUG_PREEMPT=y 1282# CONFIG_DEBUG_RT_MUTEXES is not set
1162# CONFIG_DEBUG_MUTEXES is not set 1283# CONFIG_RT_MUTEX_TESTER is not set
1163# CONFIG_DEBUG_SPINLOCK is not set 1284# CONFIG_DEBUG_SPINLOCK is not set
1285# CONFIG_DEBUG_MUTEXES is not set
1286# CONFIG_DEBUG_RWSEMS is not set
1164# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1287# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1288# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1165# CONFIG_DEBUG_KOBJECT is not set 1289# CONFIG_DEBUG_KOBJECT is not set
1166CONFIG_DEBUG_INFO=y 1290CONFIG_DEBUG_INFO=y
1167# CONFIG_DEBUG_FS is not set 1291# CONFIG_DEBUG_FS is not set
1168# CONFIG_DEBUG_VM is not set 1292# CONFIG_DEBUG_VM is not set
1293# CONFIG_DEBUG_LIST is not set
1169CONFIG_FORCED_INLINING=y 1294CONFIG_FORCED_INLINING=y
1170# CONFIG_RCU_TORTURE_TEST is not set 1295# CONFIG_RCU_TORTURE_TEST is not set
1171CONFIG_IA64_GRANULE_16MB=y 1296CONFIG_IA64_GRANULE_16MB=y
@@ -1186,6 +1311,10 @@ CONFIG_SYSVIPC_COMPAT=y
1186# Cryptographic options 1311# Cryptographic options
1187# 1312#
1188CONFIG_CRYPTO=y 1313CONFIG_CRYPTO=y
1314CONFIG_CRYPTO_ALGAPI=y
1315CONFIG_CRYPTO_BLKCIPHER=m
1316CONFIG_CRYPTO_HASH=y
1317CONFIG_CRYPTO_MANAGER=m
1189CONFIG_CRYPTO_HMAC=y 1318CONFIG_CRYPTO_HMAC=y
1190# CONFIG_CRYPTO_NULL is not set 1319# CONFIG_CRYPTO_NULL is not set
1191# CONFIG_CRYPTO_MD4 is not set 1320# CONFIG_CRYPTO_MD4 is not set
@@ -1195,6 +1324,8 @@ CONFIG_CRYPTO_SHA1=m
1195# CONFIG_CRYPTO_SHA512 is not set 1324# CONFIG_CRYPTO_SHA512 is not set
1196# CONFIG_CRYPTO_WP512 is not set 1325# CONFIG_CRYPTO_WP512 is not set
1197# CONFIG_CRYPTO_TGR192 is not set 1326# CONFIG_CRYPTO_TGR192 is not set
1327CONFIG_CRYPTO_ECB=m
1328CONFIG_CRYPTO_CBC=m
1198CONFIG_CRYPTO_DES=m 1329CONFIG_CRYPTO_DES=m
1199# CONFIG_CRYPTO_BLOWFISH is not set 1330# CONFIG_CRYPTO_BLOWFISH is not set
1200# CONFIG_CRYPTO_TWOFISH is not set 1331# CONFIG_CRYPTO_TWOFISH is not set
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index db8e1fcfa04..14691cda05c 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -75,7 +75,7 @@
75** If a device prefetches beyond the end of a valid pdir entry, it will cause 75** If a device prefetches beyond the end of a valid pdir entry, it will cause
76** a hard failure, ie. MCA. Version 3.0 and later of the zx1 LBA should 76** a hard failure, ie. MCA. Version 3.0 and later of the zx1 LBA should
77** disconnect on 4k boundaries and prevent such issues. If the device is 77** disconnect on 4k boundaries and prevent such issues. If the device is
78** particularly agressive, this option will keep the entire pdir valid such 78** particularly aggressive, this option will keep the entire pdir valid such
79** that prefetching will hit a valid address. This could severely impact 79** that prefetching will hit a valid address. This could severely impact
80** error containment, and is therefore off by default. The page that is 80** error containment, and is therefore off by default. The page that is
81** used for spill-over is poisoned, so that should help debugging somewhat. 81** used for spill-over is poisoned, so that should help debugging somewhat.
@@ -258,10 +258,10 @@ static u64 prefetch_spill_page;
258 258
259/* 259/*
260** DMA_CHUNK_SIZE is used by the SCSI mid-layer to break up 260** DMA_CHUNK_SIZE is used by the SCSI mid-layer to break up
261** (or rather not merge) DMA's into managable chunks. 261** (or rather not merge) DMAs into manageable chunks.
262** On parisc, this is more of the software/tuning constraint 262** On parisc, this is more of the software/tuning constraint
263** rather than the HW. I/O MMU allocation alogorithms can be 263** rather than the HW. I/O MMU allocation algorithms can be
264** faster with smaller size is (to some degree). 264** faster with smaller sizes (to some degree).
265*/ 265*/
266#define DMA_CHUNK_SIZE (BITS_PER_LONG*iovp_size) 266#define DMA_CHUNK_SIZE (BITS_PER_LONG*iovp_size)
267 267
diff --git a/arch/ia64/hp/sim/Kconfig b/arch/ia64/hp/sim/Kconfig
index 18ccb1266e1..f92306bbedb 100644
--- a/arch/ia64/hp/sim/Kconfig
+++ b/arch/ia64/hp/sim/Kconfig
@@ -13,8 +13,8 @@ config HP_SIMSERIAL_CONSOLE
13 depends on HP_SIMSERIAL 13 depends on HP_SIMSERIAL
14 14
15config HP_SIMSCSI 15config HP_SIMSCSI
16 tristate "Simulated SCSI disk" 16 bool "Simulated SCSI disk"
17 depends on SCSI 17 depends on SCSI=y
18 18
19endmenu 19endmenu
20 20
diff --git a/arch/ia64/hp/sim/hpsim_irq.c b/arch/ia64/hp/sim/hpsim_irq.c
index 8145547bb52..c2f58ff364e 100644
--- a/arch/ia64/hp/sim/hpsim_irq.c
+++ b/arch/ia64/hp/sim/hpsim_irq.c
@@ -27,7 +27,7 @@ hpsim_set_affinity_noop (unsigned int a, cpumask_t b)
27} 27}
28 28
29static struct hw_interrupt_type irq_type_hp_sim = { 29static struct hw_interrupt_type irq_type_hp_sim = {
30 .typename = "hpsim", 30 .name = "hpsim",
31 .startup = hpsim_irq_startup, 31 .startup = hpsim_irq_startup,
32 .shutdown = hpsim_irq_noop, 32 .shutdown = hpsim_irq_noop,
33 .enable = hpsim_irq_noop, 33 .enable = hpsim_irq_noop,
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 32c3abededc..73ef4a85b86 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -64,9 +64,6 @@ EXPORT_SYMBOL(pm_idle);
64void (*pm_power_off) (void); 64void (*pm_power_off) (void);
65EXPORT_SYMBOL(pm_power_off); 65EXPORT_SYMBOL(pm_power_off);
66 66
67unsigned char acpi_kbd_controller_present = 1;
68unsigned char acpi_legacy_devices;
69
70unsigned int acpi_cpei_override; 67unsigned int acpi_cpei_override;
71unsigned int acpi_cpei_phys_cpuid; 68unsigned int acpi_cpei_phys_cpuid;
72 69
@@ -628,12 +625,6 @@ static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size)
628 625
629 fadt = (struct fadt_descriptor *)fadt_header; 626 fadt = (struct fadt_descriptor *)fadt_header;
630 627
631 if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER))
632 acpi_kbd_controller_present = 0;
633
634 if (fadt->iapc_boot_arch & BAF_LEGACY_DEVICES)
635 acpi_legacy_devices = 1;
636
637 acpi_register_gsi(fadt->sci_int, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW); 628 acpi_register_gsi(fadt->sci_int, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
638 return 0; 629 return 0;
639} 630}
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index 9bf15fefa7e..60d64950e3c 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -426,7 +426,7 @@ iosapic_end_level_irq (unsigned int irq)
426#define iosapic_ack_level_irq nop 426#define iosapic_ack_level_irq nop
427 427
428struct hw_interrupt_type irq_type_iosapic_level = { 428struct hw_interrupt_type irq_type_iosapic_level = {
429 .typename = "IO-SAPIC-level", 429 .name = "IO-SAPIC-level",
430 .startup = iosapic_startup_level_irq, 430 .startup = iosapic_startup_level_irq,
431 .shutdown = iosapic_shutdown_level_irq, 431 .shutdown = iosapic_shutdown_level_irq,
432 .enable = iosapic_enable_level_irq, 432 .enable = iosapic_enable_level_irq,
@@ -473,7 +473,7 @@ iosapic_ack_edge_irq (unsigned int irq)
473#define iosapic_end_edge_irq nop 473#define iosapic_end_edge_irq nop
474 474
475struct hw_interrupt_type irq_type_iosapic_edge = { 475struct hw_interrupt_type irq_type_iosapic_edge = {
476 .typename = "IO-SAPIC-edge", 476 .name = "IO-SAPIC-edge",
477 .startup = iosapic_startup_edge_irq, 477 .startup = iosapic_startup_edge_irq,
478 .shutdown = iosapic_disable_edge_irq, 478 .shutdown = iosapic_disable_edge_irq,
479 .enable = iosapic_enable_edge_irq, 479 .enable = iosapic_enable_edge_irq,
@@ -664,7 +664,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
664 printk(KERN_WARNING 664 printk(KERN_WARNING
665 "%s: changing vector %d from %s to %s\n", 665 "%s: changing vector %d from %s to %s\n",
666 __FUNCTION__, vector, 666 __FUNCTION__, vector,
667 idesc->chip->typename, irq_type->typename); 667 idesc->chip->name, irq_type->name);
668 idesc->chip = irq_type; 668 idesc->chip = irq_type;
669 } 669 }
670 return 0; 670 return 0;
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index f07c0864b0b..54d55e4d64f 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -76,7 +76,7 @@ int show_interrupts(struct seq_file *p, void *v)
76 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 76 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
77 } 77 }
78#endif 78#endif
79 seq_printf(p, " %14s", irq_desc[i].chip->typename); 79 seq_printf(p, " %14s", irq_desc[i].chip->name);
80 seq_printf(p, " %s", action->name); 80 seq_printf(p, " %s", action->name);
81 81
82 for (action=action->next; action; action = action->next) 82 for (action=action->next; action; action = action->next)
@@ -197,7 +197,7 @@ void fixup_irqs(void)
197 struct pt_regs *old_regs = set_irq_regs(NULL); 197 struct pt_regs *old_regs = set_irq_regs(NULL);
198 198
199 vectors_in_migration[irq]=0; 199 vectors_in_migration[irq]=0;
200 __do_IRQ(irq); 200 generic_handle_irq(irq);
201 set_irq_regs(old_regs); 201 set_irq_regs(old_regs);
202 } 202 }
203 } 203 }
diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c
index 68339dd0c9e..ba3ba8bc50b 100644
--- a/arch/ia64/kernel/irq_ia64.c
+++ b/arch/ia64/kernel/irq_ia64.c
@@ -180,11 +180,13 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
180 saved_tpr = ia64_getreg(_IA64_REG_CR_TPR); 180 saved_tpr = ia64_getreg(_IA64_REG_CR_TPR);
181 ia64_srlz_d(); 181 ia64_srlz_d();
182 while (vector != IA64_SPURIOUS_INT_VECTOR) { 182 while (vector != IA64_SPURIOUS_INT_VECTOR) {
183 if (!IS_RESCHEDULE(vector)) { 183 if (unlikely(IS_RESCHEDULE(vector)))
184 kstat_this_cpu.irqs[vector]++;
185 else {
184 ia64_setreg(_IA64_REG_CR_TPR, vector); 186 ia64_setreg(_IA64_REG_CR_TPR, vector);
185 ia64_srlz_d(); 187 ia64_srlz_d();
186 188
187 __do_IRQ(local_vector_to_irq(vector)); 189 generic_handle_irq(local_vector_to_irq(vector));
188 190
189 /* 191 /*
190 * Disable interrupts and send EOI: 192 * Disable interrupts and send EOI:
@@ -225,7 +227,9 @@ void ia64_process_pending_intr(void)
225 * Perform normal interrupt style processing 227 * Perform normal interrupt style processing
226 */ 228 */
227 while (vector != IA64_SPURIOUS_INT_VECTOR) { 229 while (vector != IA64_SPURIOUS_INT_VECTOR) {
228 if (!IS_RESCHEDULE(vector)) { 230 if (unlikely(IS_RESCHEDULE(vector)))
231 kstat_this_cpu.irqs[vector]++;
232 else {
229 struct pt_regs *old_regs = set_irq_regs(NULL); 233 struct pt_regs *old_regs = set_irq_regs(NULL);
230 234
231 ia64_setreg(_IA64_REG_CR_TPR, vector); 235 ia64_setreg(_IA64_REG_CR_TPR, vector);
@@ -238,7 +242,7 @@ void ia64_process_pending_intr(void)
238 * Probably could shared code. 242 * Probably could shared code.
239 */ 243 */
240 vectors_in_migration[local_vector_to_irq(vector)]=0; 244 vectors_in_migration[local_vector_to_irq(vector)]=0;
241 __do_IRQ(local_vector_to_irq(vector)); 245 generic_handle_irq(local_vector_to_irq(vector));
242 set_irq_regs(old_regs); 246 set_irq_regs(old_regs);
243 247
244 /* 248 /*
@@ -258,11 +262,22 @@ void ia64_process_pending_intr(void)
258#ifdef CONFIG_SMP 262#ifdef CONFIG_SMP
259extern irqreturn_t handle_IPI (int irq, void *dev_id); 263extern irqreturn_t handle_IPI (int irq, void *dev_id);
260 264
265static irqreturn_t dummy_handler (int irq, void *dev_id)
266{
267 BUG();
268}
269
261static struct irqaction ipi_irqaction = { 270static struct irqaction ipi_irqaction = {
262 .handler = handle_IPI, 271 .handler = handle_IPI,
263 .flags = IRQF_DISABLED, 272 .flags = IRQF_DISABLED,
264 .name = "IPI" 273 .name = "IPI"
265}; 274};
275
276static struct irqaction resched_irqaction = {
277 .handler = dummy_handler,
278 .flags = SA_INTERRUPT,
279 .name = "resched"
280};
266#endif 281#endif
267 282
268void 283void
@@ -287,6 +302,7 @@ init_IRQ (void)
287 register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL); 302 register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL);
288#ifdef CONFIG_SMP 303#ifdef CONFIG_SMP
289 register_percpu_irq(IA64_IPI_VECTOR, &ipi_irqaction); 304 register_percpu_irq(IA64_IPI_VECTOR, &ipi_irqaction);
305 register_percpu_irq(IA64_IPI_RESCHEDULE, &resched_irqaction);
290#endif 306#endif
291#ifdef CONFIG_PERFMON 307#ifdef CONFIG_PERFMON
292 pfm_init_percpu(); 308 pfm_init_percpu();
diff --git a/arch/ia64/kernel/irq_lsapic.c b/arch/ia64/kernel/irq_lsapic.c
index 1ab58b09f3d..c2f07beb175 100644
--- a/arch/ia64/kernel/irq_lsapic.c
+++ b/arch/ia64/kernel/irq_lsapic.c
@@ -34,7 +34,7 @@ static int lsapic_retrigger(unsigned int irq)
34} 34}
35 35
36struct hw_interrupt_type irq_type_ia64_lsapic = { 36struct hw_interrupt_type irq_type_ia64_lsapic = {
37 .typename = "LSAPIC", 37 .name = "LSAPIC",
38 .startup = lsapic_noop_startup, 38 .startup = lsapic_noop_startup,
39 .shutdown = lsapic_noop, 39 .shutdown = lsapic_noop,
40 .enable = lsapic_noop, 40 .enable = lsapic_noop,
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index a45009d2bc9..afc1403799c 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -435,6 +435,50 @@ is_mca_global(peidx_table_t *peidx, pal_bus_check_info_t *pbci,
435} 435}
436 436
437/** 437/**
438 * get_target_identifier - Get the valid Cache or Bus check target identifier.
439 * @peidx: pointer of index of processor error section
440 *
441 * Return value:
442 * target address on Success / 0 on Failue
443 */
444static u64
445get_target_identifier(peidx_table_t *peidx)
446{
447 u64 target_address = 0;
448 sal_log_mod_error_info_t *smei;
449 pal_cache_check_info_t *pcci;
450 int i, level = 9;
451
452 /*
453 * Look through the cache checks for a valid target identifier
454 * If more than one valid target identifier, return the one
455 * with the lowest cache level.
456 */
457 for (i = 0; i < peidx_cache_check_num(peidx); i++) {
458 smei = (sal_log_mod_error_info_t *)peidx_cache_check(peidx, i);
459 if (smei->valid.target_identifier && smei->target_identifier) {
460 pcci = (pal_cache_check_info_t *)&(smei->check_info);
461 if (!target_address || (pcci->level < level)) {
462 target_address = smei->target_identifier;
463 level = pcci->level;
464 continue;
465 }
466 }
467 }
468 if (target_address)
469 return target_address;
470
471 /*
472 * Look at the bus check for a valid target identifier
473 */
474 smei = peidx_bus_check(peidx, 0);
475 if (smei && smei->valid.target_identifier)
476 return smei->target_identifier;
477
478 return 0;
479}
480
481/**
438 * recover_from_read_error - Try to recover the errors which type are "read"s. 482 * recover_from_read_error - Try to recover the errors which type are "read"s.
439 * @slidx: pointer of index of SAL error record 483 * @slidx: pointer of index of SAL error record
440 * @peidx: pointer of index of processor error section 484 * @peidx: pointer of index of processor error section
@@ -450,13 +494,14 @@ recover_from_read_error(slidx_table_t *slidx,
450 peidx_table_t *peidx, pal_bus_check_info_t *pbci, 494 peidx_table_t *peidx, pal_bus_check_info_t *pbci,
451 struct ia64_sal_os_state *sos) 495 struct ia64_sal_os_state *sos)
452{ 496{
453 sal_log_mod_error_info_t *smei; 497 u64 target_identifier;
454 pal_min_state_area_t *pmsa; 498 pal_min_state_area_t *pmsa;
455 struct ia64_psr *psr1, *psr2; 499 struct ia64_psr *psr1, *psr2;
456 ia64_fptr_t *mca_hdlr_bh = (ia64_fptr_t*)mca_handler_bhhook; 500 ia64_fptr_t *mca_hdlr_bh = (ia64_fptr_t*)mca_handler_bhhook;
457 501
458 /* Is target address valid? */ 502 /* Is target address valid? */
459 if (!pbci->tv) 503 target_identifier = get_target_identifier(peidx);
504 if (!target_identifier)
460 return fatal_mca("target address not valid"); 505 return fatal_mca("target address not valid");
461 506
462 /* 507 /*
@@ -487,32 +532,28 @@ recover_from_read_error(slidx_table_t *slidx,
487 pmsa = sos->pal_min_state; 532 pmsa = sos->pal_min_state;
488 if (psr1->cpl != 0 || 533 if (psr1->cpl != 0 ||
489 ((psr2->cpl != 0) && mca_recover_range(pmsa->pmsa_iip))) { 534 ((psr2->cpl != 0) && mca_recover_range(pmsa->pmsa_iip))) {
490 smei = peidx_bus_check(peidx, 0); 535 /*
491 if (smei->valid.target_identifier) { 536 * setup for resume to bottom half of MCA,
492 /* 537 * "mca_handler_bhhook"
493 * setup for resume to bottom half of MCA, 538 */
494 * "mca_handler_bhhook" 539 /* pass to bhhook as argument (gr8, ...) */
495 */ 540 pmsa->pmsa_gr[8-1] = target_identifier;
496 /* pass to bhhook as argument (gr8, ...) */ 541 pmsa->pmsa_gr[9-1] = pmsa->pmsa_iip;
497 pmsa->pmsa_gr[8-1] = smei->target_identifier; 542 pmsa->pmsa_gr[10-1] = pmsa->pmsa_ipsr;
498 pmsa->pmsa_gr[9-1] = pmsa->pmsa_iip; 543 /* set interrupted return address (but no use) */
499 pmsa->pmsa_gr[10-1] = pmsa->pmsa_ipsr; 544 pmsa->pmsa_br0 = pmsa->pmsa_iip;
500 /* set interrupted return address (but no use) */ 545 /* change resume address to bottom half */
501 pmsa->pmsa_br0 = pmsa->pmsa_iip; 546 pmsa->pmsa_iip = mca_hdlr_bh->fp;
502 /* change resume address to bottom half */ 547 pmsa->pmsa_gr[1-1] = mca_hdlr_bh->gp;
503 pmsa->pmsa_iip = mca_hdlr_bh->fp; 548 /* set cpl with kernel mode */
504 pmsa->pmsa_gr[1-1] = mca_hdlr_bh->gp; 549 psr2 = (struct ia64_psr *)&pmsa->pmsa_ipsr;
505 /* set cpl with kernel mode */ 550 psr2->cpl = 0;
506 psr2 = (struct ia64_psr *)&pmsa->pmsa_ipsr; 551 psr2->ri = 0;
507 psr2->cpl = 0; 552 psr2->bn = 1;
508 psr2->ri = 0; 553 psr2->i = 0;
509 psr2->bn = 1; 554
510 psr2->i = 0; 555 return mca_recovered("user memory corruption. "
511
512 return mca_recovered("user memory corruption. "
513 "kill affected process - recovered."); 556 "kill affected process - recovered.");
514 }
515
516 } 557 }
517 558
518 return fatal_mca("kernel context not recovered, iip 0x%lx\n", 559 return fatal_mca("kernel context not recovered, iip 0x%lx\n",
diff --git a/arch/ia64/kernel/pal.S b/arch/ia64/kernel/pal.S
index ebaf1e685f5..0b533441c3c 100644
--- a/arch/ia64/kernel/pal.S
+++ b/arch/ia64/kernel/pal.S
@@ -21,11 +21,12 @@ pal_entry_point:
21 .text 21 .text
22 22
23/* 23/*
24 * Set the PAL entry point address. This could be written in C code, but we do it here 24 * Set the PAL entry point address. This could be written in C code, but we
25 * to keep it all in one module (besides, it's so trivial that it's 25 * do it here to keep it all in one module (besides, it's so trivial that it's
26 * not a big deal). 26 * not a big deal).
27 * 27 *
28 * in0 Address of the PAL entry point (text address, NOT a function descriptor). 28 * in0 Address of the PAL entry point (text address, NOT a function
29 * descriptor).
29 */ 30 */
30GLOBAL_ENTRY(ia64_pal_handler_init) 31GLOBAL_ENTRY(ia64_pal_handler_init)
31 alloc r3=ar.pfs,1,0,0,0 32 alloc r3=ar.pfs,1,0,0,0
@@ -36,9 +37,9 @@ GLOBAL_ENTRY(ia64_pal_handler_init)
36END(ia64_pal_handler_init) 37END(ia64_pal_handler_init)
37 38
38/* 39/*
39 * Default PAL call handler. This needs to be coded in assembly because it uses 40 * Default PAL call handler. This needs to be coded in assembly because it
40 * the static calling convention, i.e., the RSE may not be used and calls are 41 * uses the static calling convention, i.e., the RSE may not be used and
41 * done via "br.cond" (not "br.call"). 42 * calls are done via "br.cond" (not "br.call").
42 */ 43 */
43GLOBAL_ENTRY(ia64_pal_default_handler) 44GLOBAL_ENTRY(ia64_pal_default_handler)
44 mov r8=-1 45 mov r8=-1
@@ -50,12 +51,10 @@ END(ia64_pal_default_handler)
50 * 51 *
51 * in0 Index of PAL service 52 * in0 Index of PAL service
52 * in1 - in3 Remaining PAL arguments 53 * in1 - in3 Remaining PAL arguments
53 * in4 1 ==> clear psr.ic, 0 ==> don't clear psr.ic
54 *
55 */ 54 */
56GLOBAL_ENTRY(ia64_pal_call_static) 55GLOBAL_ENTRY(ia64_pal_call_static)
57 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5) 56 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4)
58 alloc loc1 = ar.pfs,5,5,0,0 57 alloc loc1 = ar.pfs,4,5,0,0
59 movl loc2 = pal_entry_point 58 movl loc2 = pal_entry_point
601: { 591: {
61 mov r28 = in0 60 mov r28 = in0
@@ -64,7 +63,6 @@ GLOBAL_ENTRY(ia64_pal_call_static)
64 } 63 }
65 ;; 64 ;;
66 ld8 loc2 = [loc2] // loc2 <- entry point 65 ld8 loc2 = [loc2] // loc2 <- entry point
67 tbit.nz p6,p7 = in4, 0
68 adds r8 = 1f-1b,r8 66 adds r8 = 1f-1b,r8
69 mov loc4=ar.rsc // save RSE configuration 67 mov loc4=ar.rsc // save RSE configuration
70 ;; 68 ;;
@@ -74,13 +72,11 @@ GLOBAL_ENTRY(ia64_pal_call_static)
74 .body 72 .body
75 mov r30 = in2 73 mov r30 = in2
76 74
77(p6) rsm psr.i | psr.ic
78 mov r31 = in3 75 mov r31 = in3
79 mov b7 = loc2 76 mov b7 = loc2
80 77
81(p7) rsm psr.i 78 rsm psr.i
82 ;; 79 ;;
83(p6) srlz.i
84 mov rp = r8 80 mov rp = r8
85 br.cond.sptk.many b7 81 br.cond.sptk.many b7
861: mov psr.l = loc3 821: mov psr.l = loc3
@@ -96,8 +92,8 @@ END(ia64_pal_call_static)
96 * Make a PAL call using the stacked registers calling convention. 92 * Make a PAL call using the stacked registers calling convention.
97 * 93 *
98 * Inputs: 94 * Inputs:
99 * in0 Index of PAL service 95 * in0 Index of PAL service
100 * in2 - in3 Remaning PAL arguments 96 * in2 - in3 Remaining PAL arguments
101 */ 97 */
102GLOBAL_ENTRY(ia64_pal_call_stacked) 98GLOBAL_ENTRY(ia64_pal_call_stacked)
103 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4) 99 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4)
@@ -131,18 +127,18 @@ END(ia64_pal_call_stacked)
131 * Make a physical mode PAL call using the static registers calling convention. 127 * Make a physical mode PAL call using the static registers calling convention.
132 * 128 *
133 * Inputs: 129 * Inputs:
134 * in0 Index of PAL service 130 * in0 Index of PAL service
135 * in2 - in3 Remaning PAL arguments 131 * in2 - in3 Remaining PAL arguments
136 * 132 *
137 * PSR_LP, PSR_TB, PSR_ID, PSR_DA are never set by the kernel. 133 * PSR_LP, PSR_TB, PSR_ID, PSR_DA are never set by the kernel.
138 * So we don't need to clear them. 134 * So we don't need to clear them.
139 */ 135 */
140#define PAL_PSR_BITS_TO_CLEAR \ 136#define PAL_PSR_BITS_TO_CLEAR \
141 (IA64_PSR_I | IA64_PSR_IT | IA64_PSR_DT | IA64_PSR_DB | IA64_PSR_RT | \ 137 (IA64_PSR_I | IA64_PSR_IT | IA64_PSR_DT | IA64_PSR_DB | IA64_PSR_RT |\
142 IA64_PSR_DD | IA64_PSR_SS | IA64_PSR_RI | IA64_PSR_ED | \ 138 IA64_PSR_DD | IA64_PSR_SS | IA64_PSR_RI | IA64_PSR_ED | \
143 IA64_PSR_DFL | IA64_PSR_DFH) 139 IA64_PSR_DFL | IA64_PSR_DFH)
144 140
145#define PAL_PSR_BITS_TO_SET \ 141#define PAL_PSR_BITS_TO_SET \
146 (IA64_PSR_BN) 142 (IA64_PSR_BN)
147 143
148 144
@@ -178,7 +174,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_static)
178 ;; 174 ;;
179 andcm r16=loc3,r16 // removes bits to clear from psr 175 andcm r16=loc3,r16 // removes bits to clear from psr
180 br.call.sptk.many rp=ia64_switch_mode_phys 176 br.call.sptk.many rp=ia64_switch_mode_phys
181.ret1: mov rp = r8 // install return address (physical) 177 mov rp = r8 // install return address (physical)
182 mov loc5 = r19 178 mov loc5 = r19
183 mov loc6 = r20 179 mov loc6 = r20
184 br.cond.sptk.many b7 180 br.cond.sptk.many b7
@@ -188,7 +184,6 @@ GLOBAL_ENTRY(ia64_pal_call_phys_static)
188 mov r19=loc5 184 mov r19=loc5
189 mov r20=loc6 185 mov r20=loc6
190 br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode 186 br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode
191.ret2:
192 mov psr.l = loc3 // restore init PSR 187 mov psr.l = loc3 // restore init PSR
193 188
194 mov ar.pfs = loc1 189 mov ar.pfs = loc1
@@ -203,8 +198,8 @@ END(ia64_pal_call_phys_static)
203 * Make a PAL call using the stacked registers in physical mode. 198 * Make a PAL call using the stacked registers in physical mode.
204 * 199 *
205 * Inputs: 200 * Inputs:
206 * in0 Index of PAL service 201 * in0 Index of PAL service
207 * in2 - in3 Remaning PAL arguments 202 * in2 - in3 Remaining PAL arguments
208 */ 203 */
209GLOBAL_ENTRY(ia64_pal_call_phys_stacked) 204GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
210 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5) 205 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5)
@@ -212,7 +207,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
212 movl loc2 = pal_entry_point 207 movl loc2 = pal_entry_point
2131: { 2081: {
214 mov r28 = in0 // copy procedure index 209 mov r28 = in0 // copy procedure index
215 mov loc0 = rp // save rp 210 mov loc0 = rp // save rp
216 } 211 }
217 .body 212 .body
218 ;; 213 ;;
@@ -245,7 +240,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
245 mov r16=loc3 // r16= original psr 240 mov r16=loc3 // r16= original psr
246 mov r19=loc5 241 mov r19=loc5
247 mov r20=loc6 242 mov r20=loc6
248 br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode 243 br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode
249 244
250 mov psr.l = loc3 // restore init PSR 245 mov psr.l = loc3 // restore init PSR
251 mov ar.pfs = loc1 246 mov ar.pfs = loc1
@@ -257,10 +252,11 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
257END(ia64_pal_call_phys_stacked) 252END(ia64_pal_call_phys_stacked)
258 253
259/* 254/*
260 * Save scratch fp scratch regs which aren't saved in pt_regs already (fp10-fp15). 255 * Save scratch fp scratch regs which aren't saved in pt_regs already
256 * (fp10-fp15).
261 * 257 *
262 * NOTE: We need to do this since firmware (SAL and PAL) may use any of the scratch 258 * NOTE: We need to do this since firmware (SAL and PAL) may use any of the
263 * regs fp-low partition. 259 * scratch regs fp-low partition.
264 * 260 *
265 * Inputs: 261 * Inputs:
266 * in0 Address of stack storage for fp regs 262 * in0 Address of stack storage for fp regs
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 281004ff7b0..3aaede0d698 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -5558,12 +5558,13 @@ report_spurious2:
5558} 5558}
5559 5559
5560static irqreturn_t 5560static irqreturn_t
5561pfm_interrupt_handler(int irq, void *arg, struct pt_regs *regs) 5561pfm_interrupt_handler(int irq, void *arg)
5562{ 5562{
5563 unsigned long start_cycles, total_cycles; 5563 unsigned long start_cycles, total_cycles;
5564 unsigned long min, max; 5564 unsigned long min, max;
5565 int this_cpu; 5565 int this_cpu;
5566 int ret; 5566 int ret;
5567 struct pt_regs *regs = get_irq_regs();
5567 5568
5568 this_cpu = get_cpu(); 5569 this_cpu = get_cpu();
5569 if (likely(!pfm_alt_intr_handler)) { 5570 if (likely(!pfm_alt_intr_handler)) {
diff --git a/arch/ia64/kernel/sal.c b/arch/ia64/kernel/sal.c
index 642fdc7b969..20bad78b507 100644
--- a/arch/ia64/kernel/sal.c
+++ b/arch/ia64/kernel/sal.c
@@ -223,12 +223,13 @@ static void __init sal_desc_ap_wakeup(void *p) { }
223 */ 223 */
224static int sal_cache_flush_drops_interrupts; 224static int sal_cache_flush_drops_interrupts;
225 225
226static void __init 226void __init
227check_sal_cache_flush (void) 227check_sal_cache_flush (void)
228{ 228{
229 unsigned long flags; 229 unsigned long flags;
230 int cpu; 230 int cpu;
231 u64 vector; 231 u64 vector, cache_type = 3;
232 struct ia64_sal_retval isrv;
232 233
233 cpu = get_cpu(); 234 cpu = get_cpu();
234 local_irq_save(flags); 235 local_irq_save(flags);
@@ -243,7 +244,10 @@ check_sal_cache_flush (void)
243 while (!ia64_get_irr(IA64_TIMER_VECTOR)) 244 while (!ia64_get_irr(IA64_TIMER_VECTOR))
244 cpu_relax(); 245 cpu_relax();
245 246
246 ia64_sal_cache_flush(3); 247 SAL_CALL(isrv, SAL_CACHE_FLUSH, cache_type, 0, 0, 0, 0, 0, 0);
248
249 if (isrv.status)
250 printk(KERN_ERR "SAL_CAL_FLUSH failed with %ld\n", isrv.status);
247 251
248 if (ia64_get_irr(IA64_TIMER_VECTOR)) { 252 if (ia64_get_irr(IA64_TIMER_VECTOR)) {
249 vector = ia64_get_ivr(); 253 vector = ia64_get_ivr();
@@ -331,7 +335,6 @@ ia64_sal_init (struct ia64_sal_systab *systab)
331 p += SAL_DESC_SIZE(*p); 335 p += SAL_DESC_SIZE(*p);
332 } 336 }
333 337
334 check_sal_cache_flush();
335} 338}
336 339
337int 340int
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index c4caa800349..d10404a4175 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -457,6 +457,8 @@ setup_arch (char **cmdline_p)
457 cpu_init(); /* initialize the bootstrap CPU */ 457 cpu_init(); /* initialize the bootstrap CPU */
458 mmu_context_init(); /* initialize context_id bitmap */ 458 mmu_context_init(); /* initialize context_id bitmap */
459 459
460 check_sal_cache_flush();
461
460#ifdef CONFIG_ACPI 462#ifdef CONFIG_ACPI
461 acpi_boot_init(); 463 acpi_boot_init();
462#endif 464#endif
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
index 657ac99a451..6ab95ceaf9d 100644
--- a/arch/ia64/kernel/smp.c
+++ b/arch/ia64/kernel/smp.c
@@ -108,7 +108,7 @@ cpu_die(void)
108} 108}
109 109
110irqreturn_t 110irqreturn_t
111handle_IPI (int irq, void *dev_id, struct pt_regs *regs) 111handle_IPI (int irq, void *dev_id)
112{ 112{
113 int this_cpu = get_cpu(); 113 int this_cpu = get_cpu();
114 unsigned long *pending_ipis = &__ia64_per_cpu_var(ipi_operation); 114 unsigned long *pending_ipis = &__ia64_per_cpu_var(ipi_operation);
@@ -328,10 +328,14 @@ int
328smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wait) 328smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wait)
329{ 329{
330 struct call_data_struct data; 330 struct call_data_struct data;
331 int cpus = num_online_cpus()-1; 331 int cpus;
332 332
333 if (!cpus) 333 spin_lock(&call_lock);
334 cpus = num_online_cpus() - 1;
335 if (!cpus) {
336 spin_unlock(&call_lock);
334 return 0; 337 return 0;
338 }
335 339
336 /* Can deadlock when called with interrupts disabled */ 340 /* Can deadlock when called with interrupts disabled */
337 WARN_ON(irqs_disabled()); 341 WARN_ON(irqs_disabled());
@@ -343,8 +347,6 @@ smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wai
343 if (wait) 347 if (wait)
344 atomic_set(&data.finished, 0); 348 atomic_set(&data.finished, 0);
345 349
346 spin_lock(&call_lock);
347
348 call_data = &data; 350 call_data = &data;
349 mb(); /* ensure store to call_data precedes setting of IPI_CALL_FUNC */ 351 mb(); /* ensure store to call_data precedes setting of IPI_CALL_FUNC */
350 send_IPI_allbutself(IPI_CALL_FUNC); 352 send_IPI_allbutself(IPI_CALL_FUNC);
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 41169a9bc30..39e0cd3a088 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -84,6 +84,12 @@ timer_interrupt (int irq, void *dev_id)
84 84
85 if (time_after(new_itm, ia64_get_itc())) 85 if (time_after(new_itm, ia64_get_itc()))
86 break; 86 break;
87
88 /*
89 * Allow IPIs to interrupt the timer loop.
90 */
91 local_irq_enable();
92 local_irq_disable();
87 } 93 }
88 94
89 do { 95 do {
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index b3b2e389d6b..d6083a0936f 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -128,13 +128,7 @@ SECTIONS
128 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) 128 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET)
129 { 129 {
130 __initcall_start = .; 130 __initcall_start = .;
131 *(.initcall1.init) 131 INITCALLS
132 *(.initcall2.init)
133 *(.initcall3.init)
134 *(.initcall4.init)
135 *(.initcall5.init)
136 *(.initcall6.init)
137 *(.initcall7.init)
138 __initcall_end = .; 132 __initcall_end = .;
139 } 133 }
140 134
diff --git a/arch/ia64/lib/checksum.c b/arch/ia64/lib/checksum.c
index beb11721d9f..4411d9baeb2 100644
--- a/arch/ia64/lib/checksum.c
+++ b/arch/ia64/lib/checksum.c
@@ -33,32 +33,32 @@ from64to16 (unsigned long x)
33 * computes the checksum of the TCP/UDP pseudo-header 33 * computes the checksum of the TCP/UDP pseudo-header
34 * returns a 16-bit checksum, already complemented. 34 * returns a 16-bit checksum, already complemented.
35 */ 35 */
36unsigned short int 36__sum16
37csum_tcpudp_magic (unsigned long saddr, unsigned long daddr, unsigned short len, 37csum_tcpudp_magic (__be32 saddr, __be32 daddr, unsigned short len,
38 unsigned short proto, unsigned int sum) 38 unsigned short proto, __wsum sum)
39{ 39{
40 return ~from64to16(saddr + daddr + sum + ((unsigned long) ntohs(len) << 16) + 40 return (__force __sum16)~from64to16(
41 ((unsigned long) proto << 8)); 41 (__force u64)saddr + (__force u64)daddr +
42 (__force u64)sum + ((len + proto) << 8));
42} 43}
43 44
44EXPORT_SYMBOL(csum_tcpudp_magic); 45EXPORT_SYMBOL(csum_tcpudp_magic);
45 46
46unsigned int 47__wsum
47csum_tcpudp_nofold (unsigned long saddr, unsigned long daddr, unsigned short len, 48csum_tcpudp_nofold (__be32 saddr, __be32 daddr, unsigned short len,
48 unsigned short proto, unsigned int sum) 49 unsigned short proto, __wsum sum)
49{ 50{
50 unsigned long result; 51 unsigned long result;
51 52
52 result = (saddr + daddr + sum + 53 result = (__force u64)saddr + (__force u64)daddr +
53 ((unsigned long) ntohs(len) << 16) + 54 (__force u64)sum + ((len + proto) << 8);
54 ((unsigned long) proto << 8));
55 55
56 /* Fold down to 32-bits so we don't lose in the typedef-less network stack. */ 56 /* Fold down to 32-bits so we don't lose in the typedef-less network stack. */
57 /* 64 to 33 */ 57 /* 64 to 33 */
58 result = (result & 0xffffffff) + (result >> 32); 58 result = (result & 0xffffffff) + (result >> 32);
59 /* 33 to 32 */ 59 /* 33 to 32 */
60 result = (result & 0xffffffff) + (result >> 32); 60 result = (result & 0xffffffff) + (result >> 32);
61 return result; 61 return (__force __wsum)result;
62} 62}
63 63
64extern unsigned long do_csum (const unsigned char *, long); 64extern unsigned long do_csum (const unsigned char *, long);
@@ -75,16 +75,15 @@ extern unsigned long do_csum (const unsigned char *, long);
75 * 75 *
76 * it's best to have buff aligned on a 32-bit boundary 76 * it's best to have buff aligned on a 32-bit boundary
77 */ 77 */
78unsigned int 78__wsum csum_partial(const void *buff, int len, __wsum sum)
79csum_partial (const unsigned char * buff, int len, unsigned int sum)
80{ 79{
81 unsigned long result = do_csum(buff, len); 80 u64 result = do_csum(buff, len);
82 81
83 /* add in old sum, and carry.. */ 82 /* add in old sum, and carry.. */
84 result += sum; 83 result += (__force u32)sum;
85 /* 32+c bits -> 32 bits */ 84 /* 32+c bits -> 32 bits */
86 result = (result & 0xffffffff) + (result >> 32); 85 result = (result & 0xffffffff) + (result >> 32);
87 return result; 86 return (__force __wsum)result;
88} 87}
89 88
90EXPORT_SYMBOL(csum_partial); 89EXPORT_SYMBOL(csum_partial);
@@ -93,10 +92,9 @@ EXPORT_SYMBOL(csum_partial);
93 * this routine is used for miscellaneous IP-like checksums, mainly 92 * this routine is used for miscellaneous IP-like checksums, mainly
94 * in icmp.c 93 * in icmp.c
95 */ 94 */
96unsigned short 95__sum16 ip_compute_csum (const void *buff, int len)
97ip_compute_csum (unsigned char * buff, int len)
98{ 96{
99 return ~do_csum(buff,len); 97 return (__force __sum16)~do_csum(buff,len);
100} 98}
101 99
102EXPORT_SYMBOL(ip_compute_csum); 100EXPORT_SYMBOL(ip_compute_csum);
diff --git a/arch/ia64/lib/csum_partial_copy.c b/arch/ia64/lib/csum_partial_copy.c
index 36866e8a5d2..503dfe6d145 100644
--- a/arch/ia64/lib/csum_partial_copy.c
+++ b/arch/ia64/lib/csum_partial_copy.c
@@ -104,9 +104,9 @@ out:
104 */ 104 */
105extern unsigned long do_csum(const unsigned char *, long); 105extern unsigned long do_csum(const unsigned char *, long);
106 106
107static unsigned int 107__wsum
108do_csum_partial_copy_from_user (const unsigned char __user *src, unsigned char *dst, 108csum_partial_copy_from_user(const void __user *src, void *dst,
109 int len, unsigned int psum, int *errp) 109 int len, __wsum psum, int *errp)
110{ 110{
111 unsigned long result; 111 unsigned long result;
112 112
@@ -122,30 +122,17 @@ do_csum_partial_copy_from_user (const unsigned char __user *src, unsigned char *
122 result = do_csum(dst, len); 122 result = do_csum(dst, len);
123 123
124 /* add in old sum, and carry.. */ 124 /* add in old sum, and carry.. */
125 result += psum; 125 result += (__force u32)psum;
126 /* 32+c bits -> 32 bits */ 126 /* 32+c bits -> 32 bits */
127 result = (result & 0xffffffff) + (result >> 32); 127 result = (result & 0xffffffff) + (result >> 32);
128 return result; 128 return (__force __wsum)result;
129}
130
131unsigned int
132csum_partial_copy_from_user (const unsigned char __user *src, unsigned char *dst,
133 int len, unsigned int sum, int *errp)
134{
135 if (!access_ok(VERIFY_READ, src, len)) {
136 *errp = -EFAULT;
137 memset(dst, 0, len);
138 return sum;
139 }
140
141 return do_csum_partial_copy_from_user(src, dst, len, sum, errp);
142} 129}
143 130
144unsigned int 131__wsum
145csum_partial_copy_nocheck(const unsigned char __user *src, unsigned char *dst, 132csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
146 int len, unsigned int sum)
147{ 133{
148 return do_csum_partial_copy_from_user(src, dst, len, sum, NULL); 134 return csum_partial_copy_from_user((__force const void __user *)src,
135 dst, len, sum, NULL);
149} 136}
150 137
151EXPORT_SYMBOL(csum_partial_copy_nocheck); 138EXPORT_SYMBOL(csum_partial_copy_nocheck);
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index eee5c1cfbe3..f3a9585e98a 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -70,8 +70,10 @@ huge_pte_offset (struct mm_struct *mm, unsigned long addr)
70 * Don't actually need to do any preparation, but need to make sure 70 * Don't actually need to do any preparation, but need to make sure
71 * the address is in the right region. 71 * the address is in the right region.
72 */ 72 */
73int prepare_hugepage_range(unsigned long addr, unsigned long len) 73int prepare_hugepage_range(unsigned long addr, unsigned long len, pgoff_t pgoff)
74{ 74{
75 if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT))
76 return -EINVAL;
75 if (len & ~HPAGE_MASK) 77 if (len & ~HPAGE_MASK)
76 return -EINVAL; 78 return -EINVAL;
77 if (addr & ~HPAGE_MASK) 79 if (addr & ~HPAGE_MASK)
diff --git a/arch/ia64/pci/Makefile b/arch/ia64/pci/Makefile
index e66889e6922..fb14dc520d2 100644
--- a/arch/ia64/pci/Makefile
+++ b/arch/ia64/pci/Makefile
@@ -1,4 +1,4 @@
1# 1#
2# Makefile for the ia64-specific parts of the pci bus 2# Makefile for the ia64-specific parts of the pci bus
3# 3#
4obj-y := pci.o 4obj-y := pci.o fixup.o
diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c
new file mode 100644
index 00000000000..245dc1fedc2
--- /dev/null
+++ b/arch/ia64/pci/fixup.c
@@ -0,0 +1,69 @@
1/*
2 * Exceptions for specific devices. Usually work-arounds for fatal design flaws.
3 * Derived from fixup.c of i386 tree.
4 */
5
6#include <linux/pci.h>
7#include <linux/init.h>
8
9#include <asm/machvec.h>
10
11/*
12 * Fixup to mark boot BIOS video selected by BIOS before it changes
13 *
14 * From information provided by "Jon Smirl" <jonsmirl@gmail.com>
15 *
16 * The standard boot ROM sequence for an x86 machine uses the BIOS
17 * to select an initial video card for boot display. This boot video
18 * card will have it's BIOS copied to C0000 in system RAM.
19 * IORESOURCE_ROM_SHADOW is used to associate the boot video
20 * card with this copy. On laptops this copy has to be used since
21 * the main ROM may be compressed or combined with another image.
22 * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW
23 * is marked here since the boot video device will be the only enabled
24 * video device at this point.
25 */
26
27static void __devinit pci_fixup_video(struct pci_dev *pdev)
28{
29 struct pci_dev *bridge;
30 struct pci_bus *bus;
31 u16 config;
32
33 if ((strcmp(platform_name, "dig") != 0)
34 && (strcmp(platform_name, "hpzx1") != 0))
35 return;
36 /* Maybe, this machine supports legacy memory map. */
37
38 if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
39 return;
40
41 /* Is VGA routed to us? */
42 bus = pdev->bus;
43 while (bus) {
44 bridge = bus->self;
45
46 /*
47 * From information provided by
48 * "David Miller" <davem@davemloft.net>
49 * The bridge control register is valid for PCI header
50 * type BRIDGE, or CARDBUS. Host to PCI controllers use
51 * PCI header type NORMAL.
52 */
53 if (bridge
54 &&((bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE)
55 ||(bridge->hdr_type == PCI_HEADER_TYPE_CARDBUS))) {
56 pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
57 &config);
58 if (!(config & PCI_BRIDGE_CTL_VGA))
59 return;
60 }
61 bus = bus->parent;
62 }
63 pci_read_config_word(pdev, PCI_COMMAND, &config);
64 if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
65 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
66 printk(KERN_DEBUG "Boot video device is %s\n", pci_name(pdev));
67 }
68}
69DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index b30be7c48ba..f4edfbf2713 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -469,10 +469,11 @@ pcibios_fixup_resources(struct pci_dev *dev, int start, int limit)
469 } 469 }
470} 470}
471 471
472static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) 472void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
473{ 473{
474 pcibios_fixup_resources(dev, 0, PCI_BRIDGE_RESOURCES); 474 pcibios_fixup_resources(dev, 0, PCI_BRIDGE_RESOURCES);
475} 475}
476EXPORT_SYMBOL_GPL(pcibios_fixup_device_resources);
476 477
477static void __devinit pcibios_fixup_bridge_resources(struct pci_dev *dev) 478static void __devinit pcibios_fixup_bridge_resources(struct pci_dev *dev)
478{ 479{
@@ -493,6 +494,7 @@ pcibios_fixup_bus (struct pci_bus *b)
493 } 494 }
494 list_for_each_entry(dev, &b->devices, bus_list) 495 list_for_each_entry(dev, &b->devices, bus_list)
495 pcibios_fixup_device_resources(dev); 496 pcibios_fixup_device_resources(dev);
497 platform_pci_fixup_bus(b);
496 498
497 return; 499 return;
498} 500}
@@ -738,75 +740,44 @@ int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size)
738 return ret; 740 return ret;
739} 741}
740 742
743/* It's defined in drivers/pci/pci.c */
744extern u8 pci_cache_line_size;
745
741/** 746/**
742 * pci_cacheline_size - determine cacheline size for PCI devices 747 * set_pci_cacheline_size - determine cacheline size for PCI devices
743 * @dev: void
744 * 748 *
745 * We want to use the line-size of the outer-most cache. We assume 749 * We want to use the line-size of the outer-most cache. We assume
746 * that this line-size is the same for all CPUs. 750 * that this line-size is the same for all CPUs.
747 * 751 *
748 * Code mostly taken from arch/ia64/kernel/palinfo.c:cache_info(). 752 * Code mostly taken from arch/ia64/kernel/palinfo.c:cache_info().
749 *
750 * RETURNS: An appropriate -ERRNO error value on eror, or zero for success.
751 */ 753 */
752static unsigned long 754static void __init set_pci_cacheline_size(void)
753pci_cacheline_size (void)
754{ 755{
755 u64 levels, unique_caches; 756 u64 levels, unique_caches;
756 s64 status; 757 s64 status;
757 pal_cache_config_info_t cci; 758 pal_cache_config_info_t cci;
758 static u8 cacheline_size;
759
760 if (cacheline_size)
761 return cacheline_size;
762 759
763 status = ia64_pal_cache_summary(&levels, &unique_caches); 760 status = ia64_pal_cache_summary(&levels, &unique_caches);
764 if (status != 0) { 761 if (status != 0) {
765 printk(KERN_ERR "%s: ia64_pal_cache_summary() failed (status=%ld)\n", 762 printk(KERN_ERR "%s: ia64_pal_cache_summary() failed "
766 __FUNCTION__, status); 763 "(status=%ld)\n", __FUNCTION__, status);
767 return SMP_CACHE_BYTES; 764 return;
768 } 765 }
769 766
770 status = ia64_pal_cache_config_info(levels - 1, /* cache_type (data_or_unified)= */ 2, 767 status = ia64_pal_cache_config_info(levels - 1,
771 &cci); 768 /* cache_type (data_or_unified)= */ 2, &cci);
772 if (status != 0) { 769 if (status != 0) {
773 printk(KERN_ERR "%s: ia64_pal_cache_config_info() failed (status=%ld)\n", 770 printk(KERN_ERR "%s: ia64_pal_cache_config_info() failed "
774 __FUNCTION__, status); 771 "(status=%ld)\n", __FUNCTION__, status);
775 return SMP_CACHE_BYTES; 772 return;
776 } 773 }
777 cacheline_size = 1 << cci.pcci_line_size; 774 pci_cache_line_size = (1 << cci.pcci_line_size) / 4;
778 return cacheline_size;
779} 775}
780 776
781/** 777static int __init pcibios_init(void)
782 * pcibios_prep_mwi - helper function for drivers/pci/pci.c:pci_set_mwi() 778{
783 * @dev: the PCI device for which MWI is enabled 779 set_pci_cacheline_size();
784 * 780 return 0;
785 * For ia64, we can get the cacheline sizes from PAL.
786 *
787 * RETURNS: An appropriate -ERRNO error value on eror, or zero for success.
788 */
789int
790pcibios_prep_mwi (struct pci_dev *dev)
791{
792 unsigned long desired_linesize, current_linesize;
793 int rc = 0;
794 u8 pci_linesize;
795
796 desired_linesize = pci_cacheline_size();
797
798 pci_read_config_byte(dev, PCI_CACHE_LINE_SIZE, &pci_linesize);
799 current_linesize = 4 * pci_linesize;
800 if (desired_linesize != current_linesize) {
801 printk(KERN_WARNING "PCI: slot %s has incorrect PCI cache line size of %lu bytes,",
802 pci_name(dev), current_linesize);
803 if (current_linesize > desired_linesize) {
804 printk(" expected %lu bytes instead\n", desired_linesize);
805 rc = -EINVAL;
806 } else {
807 printk(" correcting to %lu\n", desired_linesize);
808 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, desired_linesize / 4);
809 }
810 }
811 return rc;
812} 781}
782
783subsys_initcall(pcibios_init);
diff --git a/arch/ia64/sn/kernel/Makefile b/arch/ia64/sn/kernel/Makefile
index 2d78f34dd76..0a59371d347 100644
--- a/arch/ia64/sn/kernel/Makefile
+++ b/arch/ia64/sn/kernel/Makefile
@@ -4,13 +4,14 @@
4# License. See the file "COPYING" in the main directory of this archive 4# License. See the file "COPYING" in the main directory of this archive
5# for more details. 5# for more details.
6# 6#
7# Copyright (C) 1999,2001-2005 Silicon Graphics, Inc. All Rights Reserved. 7# Copyright (C) 1999,2001-2006 Silicon Graphics, Inc. All Rights Reserved.
8# 8#
9 9
10CPPFLAGS += -I$(srctree)/arch/ia64/sn/include 10CPPFLAGS += -I$(srctree)/arch/ia64/sn/include
11 11
12obj-y += setup.o bte.o bte_error.o irq.o mca.o idle.o \ 12obj-y += setup.o bte.o bte_error.o irq.o mca.o idle.o \
13 huberror.o io_init.o iomv.o klconflib.o pio_phys.o \ 13 huberror.o io_acpi_init.o io_common.o \
14 io_init.o iomv.o klconflib.o pio_phys.o \
14 sn2/ 15 sn2/
15obj-$(CONFIG_IA64_GENERIC) += machvec.o 16obj-$(CONFIG_IA64_GENERIC) += machvec.o
16obj-$(CONFIG_SGI_TIOCX) += tiocx.o 17obj-$(CONFIG_SGI_TIOCX) += tiocx.o
diff --git a/arch/ia64/sn/kernel/bte.c b/arch/ia64/sn/kernel/bte.c
index 7f73ad4408a..ff1c5560117 100644
--- a/arch/ia64/sn/kernel/bte.c
+++ b/arch/ia64/sn/kernel/bte.c
@@ -381,14 +381,13 @@ bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)
381 * bcopy to the destination. 381 * bcopy to the destination.
382 */ 382 */
383 383
384 /* Add the leader from source */
385 headBteLen = len + (src & L1_CACHE_MASK);
386 /* Add the trailing bytes from footer. */
387 headBteLen += L1_CACHE_BYTES - (headBteLen & L1_CACHE_MASK);
388 headBteSource = src & ~L1_CACHE_MASK;
389 headBcopySrcOffset = src & L1_CACHE_MASK; 384 headBcopySrcOffset = src & L1_CACHE_MASK;
390 headBcopyDest = dest; 385 headBcopyDest = dest;
391 headBcopyLen = len; 386 headBcopyLen = len;
387
388 headBteSource = src - headBcopySrcOffset;
389 /* Add the leading and trailing bytes from source */
390 headBteLen = L1_CACHE_ALIGN(len + headBcopySrcOffset);
392 } 391 }
393 392
394 if (headBcopyLen > 0) { 393 if (headBcopyLen > 0) {
diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c
new file mode 100644
index 00000000000..99d7f278612
--- /dev/null
+++ b/arch/ia64/sn/kernel/io_acpi_init.c
@@ -0,0 +1,231 @@
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) 2006 Silicon Graphics, Inc. All rights reserved.
7 */
8
9#include <asm/sn/types.h>
10#include <asm/sn/addrs.h>
11#include <asm/sn/pcidev.h>
12#include <asm/sn/pcibus_provider_defs.h>
13#include <asm/sn/sn_sal.h>
14#include "xtalk/hubdev.h"
15#include <linux/acpi.h>
16
17
18/*
19 * The code in this file will only be executed when running with
20 * a PROM that has ACPI IO support. (i.e., SN_ACPI_BASE_SUPPORT() == 1)
21 */
22
23
24/*
25 * This value must match the UUID the PROM uses
26 * (io/acpi/defblk.c) when building a vendor descriptor.
27 */
28struct acpi_vendor_uuid sn_uuid = {
29 .subtype = 0,
30 .data = { 0x2c, 0xc6, 0xa6, 0xfe, 0x9c, 0x44, 0xda, 0x11,
31 0xa2, 0x7c, 0x08, 0x00, 0x69, 0x13, 0xea, 0x51 },
32};
33
34/*
35 * Perform the early IO init in PROM.
36 */
37static s64
38sal_ioif_init(u64 *result)
39{
40 struct ia64_sal_retval isrv = {0,0,0,0};
41
42 SAL_CALL_NOLOCK(isrv,
43 SN_SAL_IOIF_INIT, 0, 0, 0, 0, 0, 0, 0);
44 *result = isrv.v0;
45 return isrv.status;
46}
47
48/*
49 * sn_hubdev_add - The 'add' function of the acpi_sn_hubdev_driver.
50 * Called for every "SGIHUB" or "SGITIO" device defined
51 * in the ACPI namespace.
52 */
53static int __init
54sn_hubdev_add(struct acpi_device *device)
55{
56 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
57 u64 addr;
58 struct hubdev_info *hubdev;
59 struct hubdev_info *hubdev_ptr;
60 int i;
61 u64 nasid;
62 struct acpi_resource *resource;
63 int ret = 0;
64 acpi_status status;
65 struct acpi_resource_vendor_typed *vendor;
66 extern void sn_common_hubdev_init(struct hubdev_info *);
67
68 status = acpi_get_vendor_resource(device->handle, METHOD_NAME__CRS,
69 &sn_uuid, &buffer);
70 if (ACPI_FAILURE(status)) {
71 printk(KERN_ERR
72 "sn_hubdev_add: acpi_get_vendor_resource() failed: %d\n",
73 status);
74 return 1;
75 }
76
77 resource = buffer.pointer;
78 vendor = &resource->data.vendor_typed;
79 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
80 sizeof(struct hubdev_info *)) {
81 printk(KERN_ERR
82 "sn_hubdev_add: Invalid vendor data length: %d\n",
83 vendor->byte_length);
84 ret = 1;
85 goto exit;
86 }
87
88 memcpy(&addr, vendor->byte_data, sizeof(struct hubdev_info *));
89 hubdev_ptr = __va((struct hubdev_info *) addr);
90
91 nasid = hubdev_ptr->hdi_nasid;
92 i = nasid_to_cnodeid(nasid);
93 hubdev = (struct hubdev_info *)(NODEPDA(i)->pdinfo);
94 *hubdev = *hubdev_ptr;
95 sn_common_hubdev_init(hubdev);
96
97exit:
98 kfree(buffer.pointer);
99 return ret;
100}
101
102/*
103 * sn_get_bussoft_ptr() - The pcibus_bussoft pointer is found in
104 * the ACPI Vendor resource for this bus.
105 */
106static struct pcibus_bussoft *
107sn_get_bussoft_ptr(struct pci_bus *bus)
108{
109 u64 addr;
110 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
111 acpi_handle handle;
112 struct pcibus_bussoft *prom_bussoft_ptr;
113 struct acpi_resource *resource;
114 acpi_status status;
115 struct acpi_resource_vendor_typed *vendor;
116
117
118 handle = PCI_CONTROLLER(bus)->acpi_handle;
119 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
120 &sn_uuid, &buffer);
121 if (ACPI_FAILURE(status)) {
122 printk(KERN_ERR "get_acpi_pcibus_ptr: "
123 "get_acpi_bussoft_info() failed: %d\n",
124 status);
125 return NULL;
126 }
127 resource = buffer.pointer;
128 vendor = &resource->data.vendor_typed;
129
130 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
131 sizeof(struct pcibus_bussoft *)) {
132 printk(KERN_ERR
133 "get_acpi_bussoft_ptr: Invalid vendor data "
134 "length %d\n", vendor->byte_length);
135 kfree(buffer.pointer);
136 return NULL;
137 }
138 memcpy(&addr, vendor->byte_data, sizeof(struct pcibus_bussoft *));
139 prom_bussoft_ptr = __va((struct pcibus_bussoft *) addr);
140 kfree(buffer.pointer);
141
142 return prom_bussoft_ptr;
143}
144
145/*
146 * sn_acpi_bus_fixup
147 */
148void
149sn_acpi_bus_fixup(struct pci_bus *bus)
150{
151 struct pci_dev *pci_dev = NULL;
152 struct pcibus_bussoft *prom_bussoft_ptr;
153 extern void sn_common_bus_fixup(struct pci_bus *,
154 struct pcibus_bussoft *);
155
156 if (!bus->parent) { /* If root bus */
157 prom_bussoft_ptr = sn_get_bussoft_ptr(bus);
158 if (prom_bussoft_ptr == NULL) {
159 printk(KERN_ERR
160 "sn_pci_fixup_bus: 0x%04x:0x%02x Unable to "
161 "obtain prom_bussoft_ptr\n",
162 pci_domain_nr(bus), bus->number);
163 return;
164 }
165 sn_common_bus_fixup(bus, prom_bussoft_ptr);
166 }
167 list_for_each_entry(pci_dev, &bus->devices, bus_list) {
168 sn_pci_fixup_slot(pci_dev);
169 }
170}
171
172/*
173 * sn_acpi_slot_fixup - Perform any SN specific slot fixup.
174 * At present there does not appear to be
175 * any generic way to handle a ROM image
176 * that has been shadowed by the PROM, so
177 * we pass a pointer to it within the
178 * pcidev_info structure.
179 */
180
181void
182sn_acpi_slot_fixup(struct pci_dev *dev, struct pcidev_info *pcidev_info)
183{
184 void __iomem *addr;
185 size_t size;
186
187 if (pcidev_info->pdi_pio_mapped_addr[PCI_ROM_RESOURCE]) {
188 /*
189 * A valid ROM image exists and has been shadowed by the
190 * PROM. Setup the pci_dev ROM resource to point to
191 * the shadowed copy.
192 */
193 size = dev->resource[PCI_ROM_RESOURCE].end -
194 dev->resource[PCI_ROM_RESOURCE].start;
195 addr =
196 ioremap(pcidev_info->pdi_pio_mapped_addr[PCI_ROM_RESOURCE],
197 size);
198 dev->resource[PCI_ROM_RESOURCE].start = (unsigned long) addr;
199 dev->resource[PCI_ROM_RESOURCE].end =
200 (unsigned long) addr + size;
201 dev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_BIOS_COPY;
202 }
203}
204
205static struct acpi_driver acpi_sn_hubdev_driver = {
206 .name = "SGI HUBDEV Driver",
207 .ids = "SGIHUB,SGITIO",
208 .ops = {
209 .add = sn_hubdev_add,
210 },
211};
212
213
214/*
215 * sn_io_acpi_init - PROM has ACPI support for IO, defining at a minimum the
216 * nodes and root buses in the DSDT. As a result, bus scanning
217 * will be initiated by the Linux ACPI code.
218 */
219
220void __init
221sn_io_acpi_init(void)
222{
223 u64 result;
224 s64 status;
225
226 acpi_bus_register_driver(&acpi_sn_hubdev_driver);
227 status = sal_ioif_init(&result);
228 if (status || result)
229 panic("sal_ioif_init failed: [%lx] %s\n",
230 status, ia64_sal_strerror(status));
231}
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
new file mode 100644
index 00000000000..d4dd8f4b6b8
--- /dev/null
+++ b/arch/ia64/sn/kernel/io_common.c
@@ -0,0 +1,613 @@
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) 2006 Silicon Graphics, Inc. All rights reserved.
7 */
8
9#include <linux/bootmem.h>
10#include <asm/sn/types.h>
11#include <asm/sn/addrs.h>
12#include <asm/sn/sn_feature_sets.h>
13#include <asm/sn/geo.h>
14#include <asm/sn/io.h>
15#include <asm/sn/l1.h>
16#include <asm/sn/module.h>
17#include <asm/sn/pcibr_provider.h>
18#include <asm/sn/pcibus_provider_defs.h>
19#include <asm/sn/pcidev.h>
20#include <asm/sn/simulator.h>
21#include <asm/sn/sn_sal.h>
22#include <asm/sn/tioca_provider.h>
23#include <asm/sn/tioce_provider.h>
24#include "xtalk/hubdev.h"
25#include "xtalk/xwidgetdev.h"
26#include <linux/acpi.h>
27#include <asm/sn/sn2/sn_hwperf.h>
28#include <asm/sn/acpi.h>
29
30extern void sn_init_cpei_timer(void);
31extern void register_sn_procfs(void);
32extern void sn_acpi_bus_fixup(struct pci_bus *);
33extern void sn_bus_fixup(struct pci_bus *);
34extern void sn_acpi_slot_fixup(struct pci_dev *, struct pcidev_info *);
35extern void sn_more_slot_fixup(struct pci_dev *, struct pcidev_info *);
36extern void sn_legacy_pci_window_fixup(struct pci_controller *, u64, u64);
37extern void sn_io_acpi_init(void);
38extern void sn_io_init(void);
39
40
41static struct list_head sn_sysdata_list;
42
43/* sysdata list struct */
44struct sysdata_el {
45 struct list_head entry;
46 void *sysdata;
47};
48
49int sn_ioif_inited; /* SN I/O infrastructure initialized? */
50
51struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES]; /* indexed by asic type */
52
53/*
54 * Hooks and struct for unsupported pci providers
55 */
56
57static dma_addr_t
58sn_default_pci_map(struct pci_dev *pdev, unsigned long paddr, size_t size, int type)
59{
60 return 0;
61}
62
63static void
64sn_default_pci_unmap(struct pci_dev *pdev, dma_addr_t addr, int direction)
65{
66 return;
67}
68
69static void *
70sn_default_pci_bus_fixup(struct pcibus_bussoft *soft, struct pci_controller *controller)
71{
72 return NULL;
73}
74
75static struct sn_pcibus_provider sn_pci_default_provider = {
76 .dma_map = sn_default_pci_map,
77 .dma_map_consistent = sn_default_pci_map,
78 .dma_unmap = sn_default_pci_unmap,
79 .bus_fixup = sn_default_pci_bus_fixup,
80};
81
82/*
83 * Retrieve the DMA Flush List given nasid, widget, and device.
84 * This list is needed to implement the WAR - Flush DMA data on PIO Reads.
85 */
86static inline u64
87sal_get_device_dmaflush_list(u64 nasid, u64 widget_num, u64 device_num,
88 u64 address)
89{
90 struct ia64_sal_retval ret_stuff;
91 ret_stuff.status = 0;
92 ret_stuff.v0 = 0;
93
94 SAL_CALL_NOLOCK(ret_stuff,
95 (u64) SN_SAL_IOIF_GET_DEVICE_DMAFLUSH_LIST,
96 (u64) nasid, (u64) widget_num,
97 (u64) device_num, (u64) address, 0, 0, 0);
98 return ret_stuff.status;
99}
100
101/*
102 * Retrieve the pci device information given the bus and device|function number.
103 */
104static inline u64
105sal_get_pcidev_info(u64 segment, u64 bus_number, u64 devfn, u64 pci_dev,
106 u64 sn_irq_info)
107{
108 struct ia64_sal_retval ret_stuff;
109 ret_stuff.status = 0;
110 ret_stuff.v0 = 0;
111
112 SAL_CALL_NOLOCK(ret_stuff,
113 (u64) SN_SAL_IOIF_GET_PCIDEV_INFO,
114 (u64) segment, (u64) bus_number, (u64) devfn,
115 (u64) pci_dev,
116 sn_irq_info, 0, 0);
117 return ret_stuff.v0;
118}
119
120/*
121 * sn_pcidev_info_get() - Retrieve the pcidev_info struct for the specified
122 * device.
123 */
124inline struct pcidev_info *
125sn_pcidev_info_get(struct pci_dev *dev)
126{
127 struct pcidev_info *pcidev;
128
129 list_for_each_entry(pcidev,
130 &(SN_PLATFORM_DATA(dev)->pcidev_info), pdi_list) {
131 if (pcidev->pdi_linux_pcidev == dev)
132 return pcidev;
133 }
134 return NULL;
135}
136
137/* Older PROM flush WAR
138 *
139 * 01/16/06 -- This war will be in place until a new official PROM is released.
140 * Additionally note that the struct sn_flush_device_war also has to be
141 * removed from arch/ia64/sn/include/xtalk/hubdev.h
142 */
143static u8 war_implemented = 0;
144
145static s64 sn_device_fixup_war(u64 nasid, u64 widget, int device,
146 struct sn_flush_device_common *common)
147{
148 struct sn_flush_device_war *war_list;
149 struct sn_flush_device_war *dev_entry;
150 struct ia64_sal_retval isrv = {0,0,0,0};
151
152 if (!war_implemented) {
153 printk(KERN_WARNING "PROM version < 4.50 -- implementing old "
154 "PROM flush WAR\n");
155 war_implemented = 1;
156 }
157
158 war_list = kzalloc(DEV_PER_WIDGET * sizeof(*war_list), GFP_KERNEL);
159 if (!war_list)
160 BUG();
161
162 SAL_CALL_NOLOCK(isrv, SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST,
163 nasid, widget, __pa(war_list), 0, 0, 0 ,0);
164 if (isrv.status)
165 panic("sn_device_fixup_war failed: %s\n",
166 ia64_sal_strerror(isrv.status));
167
168 dev_entry = war_list + device;
169 memcpy(common,dev_entry, sizeof(*common));
170 kfree(war_list);
171
172 return isrv.status;
173}
174
175/*
176 * sn_common_hubdev_init() - This routine is called to initialize the HUB data
177 * structure for each node in the system.
178 */
179void __init
180sn_common_hubdev_init(struct hubdev_info *hubdev)
181{
182
183 struct sn_flush_device_kernel *sn_flush_device_kernel;
184 struct sn_flush_device_kernel *dev_entry;
185 s64 status;
186 int widget, device, size;
187
188 /* Attach the error interrupt handlers */
189 if (hubdev->hdi_nasid & 1) /* If TIO */
190 ice_error_init(hubdev);
191 else
192 hub_error_init(hubdev);
193
194 for (widget = 0; widget <= HUB_WIDGET_ID_MAX; widget++)
195 hubdev->hdi_xwidget_info[widget].xwi_hubinfo = hubdev;
196
197 if (!hubdev->hdi_flush_nasid_list.widget_p)
198 return;
199
200 size = (HUB_WIDGET_ID_MAX + 1) *
201 sizeof(struct sn_flush_device_kernel *);
202 hubdev->hdi_flush_nasid_list.widget_p =
203 kzalloc(size, GFP_KERNEL);
204 if (!hubdev->hdi_flush_nasid_list.widget_p)
205 BUG();
206
207 for (widget = 0; widget <= HUB_WIDGET_ID_MAX; widget++) {
208 size = DEV_PER_WIDGET *
209 sizeof(struct sn_flush_device_kernel);
210 sn_flush_device_kernel = kzalloc(size, GFP_KERNEL);
211 if (!sn_flush_device_kernel)
212 BUG();
213
214 dev_entry = sn_flush_device_kernel;
215 for (device = 0; device < DEV_PER_WIDGET;
216 device++, dev_entry++) {
217 size = sizeof(struct sn_flush_device_common);
218 dev_entry->common = kzalloc(size, GFP_KERNEL);
219 if (!dev_entry->common)
220 BUG();
221 if (sn_prom_feature_available(PRF_DEVICE_FLUSH_LIST))
222 status = sal_get_device_dmaflush_list(
223 hubdev->hdi_nasid, widget, device,
224 (u64)(dev_entry->common));
225 else
226 status = sn_device_fixup_war(hubdev->hdi_nasid,
227 widget, device,
228 dev_entry->common);
229 if (status != SALRET_OK)
230 panic("SAL call failed: %s\n",
231 ia64_sal_strerror(status));
232
233 spin_lock_init(&dev_entry->sfdl_flush_lock);
234 }
235
236 if (sn_flush_device_kernel)
237 hubdev->hdi_flush_nasid_list.widget_p[widget] =
238 sn_flush_device_kernel;
239 }
240}
241
242void sn_pci_unfixup_slot(struct pci_dev *dev)
243{
244 struct pci_dev *host_pci_dev = SN_PCIDEV_INFO(dev)->host_pci_dev;
245
246 sn_irq_unfixup(dev);
247 pci_dev_put(host_pci_dev);
248 pci_dev_put(dev);
249}
250
251/*
252 * sn_pci_fixup_slot() - This routine sets up a slot's resources consistent
253 * with the Linux PCI abstraction layer. Resources
254 * acquired from our PCI provider include PIO maps
255 * to BAR space and interrupt objects.
256 */
257void sn_pci_fixup_slot(struct pci_dev *dev)
258{
259 int segment = pci_domain_nr(dev->bus);
260 int status = 0;
261 struct pcibus_bussoft *bs;
262 struct pci_bus *host_pci_bus;
263 struct pci_dev *host_pci_dev;
264 struct pcidev_info *pcidev_info;
265 struct sn_irq_info *sn_irq_info;
266 unsigned int bus_no, devfn;
267
268 pci_dev_get(dev); /* for the sysdata pointer */
269 pcidev_info = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL);
270 if (!pcidev_info)
271 BUG(); /* Cannot afford to run out of memory */
272
273 sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL);
274 if (!sn_irq_info)
275 BUG(); /* Cannot afford to run out of memory */
276
277 /* Call to retrieve pci device information needed by kernel. */
278 status = sal_get_pcidev_info((u64) segment, (u64) dev->bus->number,
279 dev->devfn,
280 (u64) __pa(pcidev_info),
281 (u64) __pa(sn_irq_info));
282 if (status)
283 BUG(); /* Cannot get platform pci device information */
284
285 /* Add pcidev_info to list in pci_controller.platform_data */
286 list_add_tail(&pcidev_info->pdi_list,
287 &(SN_PLATFORM_DATA(dev->bus)->pcidev_info));
288
289 if (SN_ACPI_BASE_SUPPORT())
290 sn_acpi_slot_fixup(dev, pcidev_info);
291 else
292 sn_more_slot_fixup(dev, pcidev_info);
293 /*
294 * Using the PROMs values for the PCI host bus, get the Linux
295 * PCI host_pci_dev struct and set up host bus linkages
296 */
297
298 bus_no = (pcidev_info->pdi_slot_host_handle >> 32) & 0xff;
299 devfn = pcidev_info->pdi_slot_host_handle & 0xffffffff;
300 host_pci_bus = pci_find_bus(segment, bus_no);
301 host_pci_dev = pci_get_slot(host_pci_bus, devfn);
302
303 pcidev_info->host_pci_dev = host_pci_dev;
304 pcidev_info->pdi_linux_pcidev = dev;
305 pcidev_info->pdi_host_pcidev_info = SN_PCIDEV_INFO(host_pci_dev);
306 bs = SN_PCIBUS_BUSSOFT(dev->bus);
307 pcidev_info->pdi_pcibus_info = bs;
308
309 if (bs && bs->bs_asic_type < PCIIO_ASIC_MAX_TYPES) {
310 SN_PCIDEV_BUSPROVIDER(dev) = sn_pci_provider[bs->bs_asic_type];
311 } else {
312 SN_PCIDEV_BUSPROVIDER(dev) = &sn_pci_default_provider;
313 }
314
315 /* Only set up IRQ stuff if this device has a host bus context */
316 if (bs && sn_irq_info->irq_irq) {
317 pcidev_info->pdi_sn_irq_info = sn_irq_info;
318 dev->irq = pcidev_info->pdi_sn_irq_info->irq_irq;
319 sn_irq_fixup(dev, sn_irq_info);
320 } else {
321 pcidev_info->pdi_sn_irq_info = NULL;
322 kfree(sn_irq_info);
323 }
324}
325
326/*
327 * sn_common_bus_fixup - Perform platform specific bus fixup.
328 * Execute the ASIC specific fixup routine
329 * for this bus.
330 */
331void
332sn_common_bus_fixup(struct pci_bus *bus,
333 struct pcibus_bussoft *prom_bussoft_ptr)
334{
335 int cnode;
336 struct pci_controller *controller;
337 struct hubdev_info *hubdev_info;
338 int nasid;
339 void *provider_soft;
340 struct sn_pcibus_provider *provider;
341 struct sn_platform_data *sn_platform_data;
342
343 controller = PCI_CONTROLLER(bus);
344 /*
345 * Per-provider fixup. Copies the bus soft structure from prom
346 * to local area and links SN_PCIBUS_BUSSOFT().
347 */
348
349 if (prom_bussoft_ptr->bs_asic_type >= PCIIO_ASIC_MAX_TYPES) {
350 printk(KERN_WARNING "sn_common_bus_fixup: Unsupported asic type, %d",
351 prom_bussoft_ptr->bs_asic_type);
352 return;
353 }
354
355 if (prom_bussoft_ptr->bs_asic_type == PCIIO_ASIC_TYPE_PPB)
356 return; /* no further fixup necessary */
357
358 provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type];
359 if (provider == NULL)
360 panic("sn_common_bus_fixup: No provider registered for this asic type, %d",
361 prom_bussoft_ptr->bs_asic_type);
362
363 if (provider->bus_fixup)
364 provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr,
365 controller);
366 else
367 provider_soft = NULL;
368
369 /*
370 * Generic bus fixup goes here. Don't reference prom_bussoft_ptr
371 * after this point.
372 */
373 controller->platform_data = kzalloc(sizeof(struct sn_platform_data),
374 GFP_KERNEL);
375 if (controller->platform_data == NULL)
376 BUG();
377 sn_platform_data =
378 (struct sn_platform_data *) controller->platform_data;
379 sn_platform_data->provider_soft = provider_soft;
380 INIT_LIST_HEAD(&((struct sn_platform_data *)
381 controller->platform_data)->pcidev_info);
382 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(bus)->bs_base);
383 cnode = nasid_to_cnodeid(nasid);
384 hubdev_info = (struct hubdev_info *)(NODEPDA(cnode)->pdinfo);
385 SN_PCIBUS_BUSSOFT(bus)->bs_xwidget_info =
386 &(hubdev_info->hdi_xwidget_info[SN_PCIBUS_BUSSOFT(bus)->bs_xid]);
387
388 /*
389 * If the node information we obtained during the fixup phase is
390 * invalid then set controller->node to -1 (undetermined)
391 */
392 if (controller->node >= num_online_nodes()) {
393 struct pcibus_bussoft *b = SN_PCIBUS_BUSSOFT(bus);
394
395 printk(KERN_WARNING "Device ASIC=%u XID=%u PBUSNUM=%u"
396 "L_IO=%lx L_MEM=%lx BASE=%lx\n",
397 b->bs_asic_type, b->bs_xid, b->bs_persist_busnum,
398 b->bs_legacy_io, b->bs_legacy_mem, b->bs_base);
399 printk(KERN_WARNING "on node %d but only %d nodes online."
400 "Association set to undetermined.\n",
401 controller->node, num_online_nodes());
402 controller->node = -1;
403 }
404}
405
406void sn_bus_store_sysdata(struct pci_dev *dev)
407{
408 struct sysdata_el *element;
409
410 element = kzalloc(sizeof(struct sysdata_el), GFP_KERNEL);
411 if (!element) {
412 dev_dbg(dev, "%s: out of memory!\n", __FUNCTION__);
413 return;
414 }
415 element->sysdata = SN_PCIDEV_INFO(dev);
416 list_add(&element->entry, &sn_sysdata_list);
417}
418
419void sn_bus_free_sysdata(void)
420{
421 struct sysdata_el *element;
422 struct list_head *list, *safe;
423
424 list_for_each_safe(list, safe, &sn_sysdata_list) {
425 element = list_entry(list, struct sysdata_el, entry);
426 list_del(&element->entry);
427 list_del(&(((struct pcidev_info *)
428 (element->sysdata))->pdi_list));
429 kfree(element->sysdata);
430 kfree(element);
431 }
432 return;
433}
434
435/*
436 * hubdev_init_node() - Creates the HUB data structure and link them to it's
437 * own NODE specific data area.
438 */
439void hubdev_init_node(nodepda_t * npda, cnodeid_t node)
440{
441 struct hubdev_info *hubdev_info;
442 int size;
443 pg_data_t *pg;
444
445 size = sizeof(struct hubdev_info);
446
447 if (node >= num_online_nodes()) /* Headless/memless IO nodes */
448 pg = NODE_DATA(0);
449 else
450 pg = NODE_DATA(node);
451
452 hubdev_info = (struct hubdev_info *)alloc_bootmem_node(pg, size);
453
454 npda->pdinfo = (void *)hubdev_info;
455}
456
457geoid_t
458cnodeid_get_geoid(cnodeid_t cnode)
459{
460 struct hubdev_info *hubdev;
461
462 hubdev = (struct hubdev_info *)(NODEPDA(cnode)->pdinfo);
463 return hubdev->hdi_geoid;
464}
465
466void sn_generate_path(struct pci_bus *pci_bus, char *address)
467{
468 nasid_t nasid;
469 cnodeid_t cnode;
470 geoid_t geoid;
471 moduleid_t moduleid;
472 u16 bricktype;
473
474 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(pci_bus)->bs_base);
475 cnode = nasid_to_cnodeid(nasid);
476 geoid = cnodeid_get_geoid(cnode);
477 moduleid = geo_module(geoid);
478
479 sprintf(address, "module_%c%c%c%c%.2d",
480 '0'+RACK_GET_CLASS(MODULE_GET_RACK(moduleid)),
481 '0'+RACK_GET_GROUP(MODULE_GET_RACK(moduleid)),
482 '0'+RACK_GET_NUM(MODULE_GET_RACK(moduleid)),
483 MODULE_GET_BTCHAR(moduleid), MODULE_GET_BPOS(moduleid));
484
485 /* Tollhouse requires slot id to be displayed */
486 bricktype = MODULE_GET_BTYPE(moduleid);
487 if ((bricktype == L1_BRICKTYPE_191010) ||
488 (bricktype == L1_BRICKTYPE_1932))
489 sprintf(address, "%s^%d", address, geo_slot(geoid));
490}
491
492/*
493 * sn_pci_fixup_bus() - Perform SN specific setup of software structs
494 * (pcibus_bussoft, pcidev_info) and hardware
495 * registers, for the specified bus and devices under it.
496 */
497void __devinit
498sn_pci_fixup_bus(struct pci_bus *bus)
499{
500
501 if (SN_ACPI_BASE_SUPPORT())
502 sn_acpi_bus_fixup(bus);
503 else
504 sn_bus_fixup(bus);
505}
506
507/*
508 * sn_io_early_init - Perform early IO (and some non-IO) initialization.
509 * In particular, setup the sn_pci_provider[] array.
510 * This needs to be done prior to any bus scanning
511 * (acpi_scan_init()) in the ACPI case, as the SN
512 * bus fixup code will reference the array.
513 */
514static int __init
515sn_io_early_init(void)
516{
517 int i;
518
519 if (!ia64_platform_is("sn2") || IS_RUNNING_ON_FAKE_PROM())
520 return 0;
521
522 /*
523 * prime sn_pci_provider[]. Individial provider init routines will
524 * override their respective default entries.
525 */
526
527 for (i = 0; i < PCIIO_ASIC_MAX_TYPES; i++)
528 sn_pci_provider[i] = &sn_pci_default_provider;
529
530 pcibr_init_provider();
531 tioca_init_provider();
532 tioce_init_provider();
533
534 /*
535 * This is needed to avoid bounce limit checks in the blk layer
536 */
537 ia64_max_iommu_merge_mask = ~PAGE_MASK;
538
539 sn_irq_lh_init();
540 INIT_LIST_HEAD(&sn_sysdata_list);
541 sn_init_cpei_timer();
542
543#ifdef CONFIG_PROC_FS
544 register_sn_procfs();
545#endif
546
547 printk(KERN_INFO "ACPI DSDT OEM Rev 0x%x\n",
548 acpi_gbl_DSDT->oem_revision);
549 if (SN_ACPI_BASE_SUPPORT())
550 sn_io_acpi_init();
551 else
552 sn_io_init();
553 return 0;
554}
555
556arch_initcall(sn_io_early_init);
557
558/*
559 * sn_io_late_init() - Perform any final platform specific IO initialization.
560 */
561
562int __init
563sn_io_late_init(void)
564{
565 struct pci_bus *bus;
566 struct pcibus_bussoft *bussoft;
567 cnodeid_t cnode;
568 nasid_t nasid;
569 cnodeid_t near_cnode;
570
571 if (!ia64_platform_is("sn2") || IS_RUNNING_ON_FAKE_PROM())
572 return 0;
573
574 /*
575 * Setup closest node in pci_controller->node for
576 * PIC, TIOCP, TIOCE (TIOCA does it during bus fixup using
577 * info from the PROM).
578 */
579 bus = NULL;
580 while ((bus = pci_find_next_bus(bus)) != NULL) {
581 bussoft = SN_PCIBUS_BUSSOFT(bus);
582 nasid = NASID_GET(bussoft->bs_base);
583 cnode = nasid_to_cnodeid(nasid);
584 if ((bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP) ||
585 (bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCE)) {
586 /* TIO PCI Bridge: find nearest node with CPUs */
587 int e = sn_hwperf_get_nearest_node(cnode, NULL,
588 &near_cnode);
589 if (e < 0) {
590 near_cnode = (cnodeid_t)-1; /* use any node */
591 printk(KERN_WARNING "pcibr_bus_fixup: failed "
592 "to find near node with CPUs to TIO "
593 "node %d, err=%d\n", cnode, e);
594 }
595 PCI_CONTROLLER(bus)->node = near_cnode;
596 } else if (bussoft->bs_asic_type == PCIIO_ASIC_TYPE_PIC) {
597 PCI_CONTROLLER(bus)->node = cnode;
598 }
599 }
600
601 sn_ioif_inited = 1; /* SN I/O infrastructure now initialized */
602
603 return 0;
604}
605
606fs_initcall(sn_io_late_init);
607
608EXPORT_SYMBOL(sn_pci_fixup_slot);
609EXPORT_SYMBOL(sn_pci_unfixup_slot);
610EXPORT_SYMBOL(sn_bus_store_sysdata);
611EXPORT_SYMBOL(sn_bus_free_sysdata);
612EXPORT_SYMBOL(sn_generate_path);
613
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index dc09a6a28a3..9ad843e0383 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -3,103 +3,28 @@
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) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 1992 - 1997, 2000-2006 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#include <linux/bootmem.h>
10#include <linux/nodemask.h>
11#include <asm/sn/types.h> 9#include <asm/sn/types.h>
12#include <asm/sn/addrs.h> 10#include <asm/sn/addrs.h>
13#include <asm/sn/sn_feature_sets.h>
14#include <asm/sn/geo.h>
15#include <asm/sn/io.h> 11#include <asm/sn/io.h>
16#include <asm/sn/l1.h>
17#include <asm/sn/module.h> 12#include <asm/sn/module.h>
18#include <asm/sn/pcibr_provider.h> 13#include <asm/sn/intr.h>
19#include <asm/sn/pcibus_provider_defs.h> 14#include <asm/sn/pcibus_provider_defs.h>
20#include <asm/sn/pcidev.h> 15#include <asm/sn/pcidev.h>
21#include <asm/sn/simulator.h>
22#include <asm/sn/sn_sal.h> 16#include <asm/sn/sn_sal.h>
23#include <asm/sn/tioca_provider.h>
24#include <asm/sn/tioce_provider.h>
25#include "xtalk/hubdev.h" 17#include "xtalk/hubdev.h"
26#include "xtalk/xwidgetdev.h"
27
28
29extern void sn_init_cpei_timer(void);
30extern void register_sn_procfs(void);
31
32static struct list_head sn_sysdata_list;
33
34/* sysdata list struct */
35struct sysdata_el {
36 struct list_head entry;
37 void *sysdata;
38};
39
40struct slab_info {
41 struct hubdev_info hubdev;
42};
43
44struct brick {
45 moduleid_t id; /* Module ID of this module */
46 struct slab_info slab_info[MAX_SLABS + 1];
47};
48
49int sn_ioif_inited; /* SN I/O infrastructure initialized? */
50
51struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES]; /* indexed by asic type */
52
53static int max_segment_number; /* Default highest segment number */
54static int max_pcibus_number = 255; /* Default highest pci bus number */
55 18
56/* 19/*
57 * Hooks and struct for unsupported pci providers 20 * The code in this file will only be executed when running with
21 * a PROM that does _not_ have base ACPI IO support.
22 * (i.e., SN_ACPI_BASE_SUPPORT() == 0)
58 */ 23 */
59 24
60static dma_addr_t 25static int max_segment_number; /* Default highest segment number */
61sn_default_pci_map(struct pci_dev *pdev, unsigned long paddr, size_t size, int type) 26static int max_pcibus_number = 255; /* Default highest pci bus number */
62{
63 return 0;
64}
65
66static void
67sn_default_pci_unmap(struct pci_dev *pdev, dma_addr_t addr, int direction)
68{
69 return;
70}
71
72static void *
73sn_default_pci_bus_fixup(struct pcibus_bussoft *soft, struct pci_controller *controller)
74{
75 return NULL;
76}
77
78static struct sn_pcibus_provider sn_pci_default_provider = {
79 .dma_map = sn_default_pci_map,
80 .dma_map_consistent = sn_default_pci_map,
81 .dma_unmap = sn_default_pci_unmap,
82 .bus_fixup = sn_default_pci_bus_fixup,
83};
84
85/*
86 * Retrieve the DMA Flush List given nasid, widget, and device.
87 * This list is needed to implement the WAR - Flush DMA data on PIO Reads.
88 */
89static inline u64
90sal_get_device_dmaflush_list(u64 nasid, u64 widget_num, u64 device_num,
91 u64 address)
92{
93 struct ia64_sal_retval ret_stuff;
94 ret_stuff.status = 0;
95 ret_stuff.v0 = 0;
96 27
97 SAL_CALL_NOLOCK(ret_stuff,
98 (u64) SN_SAL_IOIF_GET_DEVICE_DMAFLUSH_LIST,
99 (u64) nasid, (u64) widget_num,
100 (u64) device_num, (u64) address, 0, 0, 0);
101 return ret_stuff.status;
102}
103 28
104/* 29/*
105 * Retrieve the hub device info structure for the given nasid. 30 * Retrieve the hub device info structure for the given nasid.
@@ -131,93 +56,20 @@ static inline u64 sal_get_pcibus_info(u64 segment, u64 busnum, u64 address)
131 return ret_stuff.v0; 56 return ret_stuff.v0;
132} 57}
133 58
134/*
135 * Retrieve the pci device information given the bus and device|function number.
136 */
137static inline u64
138sal_get_pcidev_info(u64 segment, u64 bus_number, u64 devfn, u64 pci_dev,
139 u64 sn_irq_info)
140{
141 struct ia64_sal_retval ret_stuff;
142 ret_stuff.status = 0;
143 ret_stuff.v0 = 0;
144
145 SAL_CALL_NOLOCK(ret_stuff,
146 (u64) SN_SAL_IOIF_GET_PCIDEV_INFO,
147 (u64) segment, (u64) bus_number, (u64) devfn,
148 (u64) pci_dev,
149 sn_irq_info, 0, 0);
150 return ret_stuff.v0;
151}
152
153/*
154 * sn_pcidev_info_get() - Retrieve the pcidev_info struct for the specified
155 * device.
156 */
157inline struct pcidev_info *
158sn_pcidev_info_get(struct pci_dev *dev)
159{
160 struct pcidev_info *pcidev;
161
162 list_for_each_entry(pcidev,
163 &(SN_PCI_CONTROLLER(dev)->pcidev_info), pdi_list) {
164 if (pcidev->pdi_linux_pcidev == dev) {
165 return pcidev;
166 }
167 }
168 return NULL;
169}
170
171/* Older PROM flush WAR
172 *
173 * 01/16/06 -- This war will be in place until a new official PROM is released.
174 * Additionally note that the struct sn_flush_device_war also has to be
175 * removed from arch/ia64/sn/include/xtalk/hubdev.h
176 */
177static u8 war_implemented = 0;
178
179static s64 sn_device_fixup_war(u64 nasid, u64 widget, int device,
180 struct sn_flush_device_common *common)
181{
182 struct sn_flush_device_war *war_list;
183 struct sn_flush_device_war *dev_entry;
184 struct ia64_sal_retval isrv = {0,0,0,0};
185
186 if (!war_implemented) {
187 printk(KERN_WARNING "PROM version < 4.50 -- implementing old "
188 "PROM flush WAR\n");
189 war_implemented = 1;
190 }
191
192 war_list = kzalloc(DEV_PER_WIDGET * sizeof(*war_list), GFP_KERNEL);
193 if (!war_list)
194 BUG();
195
196 SAL_CALL_NOLOCK(isrv, SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST,
197 nasid, widget, __pa(war_list), 0, 0, 0 ,0);
198 if (isrv.status)
199 panic("sn_device_fixup_war failed: %s\n",
200 ia64_sal_strerror(isrv.status));
201
202 dev_entry = war_list + device;
203 memcpy(common,dev_entry, sizeof(*common));
204 kfree(war_list);
205
206 return isrv.status;
207}
208 59
209/* 60/*
210 * sn_fixup_ionodes() - This routine initializes the HUB data strcuture for 61 * sn_fixup_ionodes() - This routine initializes the HUB data structure for
211 * each node in the system. 62 * each node in the system. This function is only
63 * executed when running with a non-ACPI capable PROM.
212 */ 64 */
213static void __init sn_fixup_ionodes(void) 65static void __init sn_fixup_ionodes(void)
214{ 66{
215 struct sn_flush_device_kernel *sn_flush_device_kernel; 67
216 struct sn_flush_device_kernel *dev_entry;
217 struct hubdev_info *hubdev; 68 struct hubdev_info *hubdev;
218 u64 status; 69 u64 status;
219 u64 nasid; 70 u64 nasid;
220 int i, widget, device, size; 71 int i;
72 extern void sn_common_hubdev_init(struct hubdev_info *);
221 73
222 /* 74 /*
223 * Get SGI Specific HUB chipset information. 75 * Get SGI Specific HUB chipset information.
@@ -240,70 +92,47 @@ static void __init sn_fixup_ionodes(void)
240 max_segment_number = hubdev->max_segment_number; 92 max_segment_number = hubdev->max_segment_number;
241 max_pcibus_number = hubdev->max_pcibus_number; 93 max_pcibus_number = hubdev->max_pcibus_number;
242 } 94 }
95 sn_common_hubdev_init(hubdev);
96 }
97}
243 98
244 /* Attach the error interrupt handlers */ 99/*
245 if (nasid & 1) 100 * sn_pci_legacy_window_fixup - Create PCI controller windows for
246 ice_error_init(hubdev); 101 * legacy IO and MEM space. This needs to
247 else 102 * be done here, as the PROM does not have
248 hub_error_init(hubdev); 103 * ACPI support defining the root buses
249 104 * and their resources (_CRS),
250 for (widget = 0; widget <= HUB_WIDGET_ID_MAX; widget++) 105 */
251 hubdev->hdi_xwidget_info[widget].xwi_hubinfo = hubdev; 106static void
252 107sn_legacy_pci_window_fixup(struct pci_controller *controller,
253 if (!hubdev->hdi_flush_nasid_list.widget_p) 108 u64 legacy_io, u64 legacy_mem)
254 continue; 109{
255 110 controller->window = kcalloc(2, sizeof(struct pci_window),
256 size = (HUB_WIDGET_ID_MAX + 1) * 111 GFP_KERNEL);
257 sizeof(struct sn_flush_device_kernel *); 112 if (controller->window == NULL)
258 hubdev->hdi_flush_nasid_list.widget_p =
259 kzalloc(size, GFP_KERNEL);
260 if (!hubdev->hdi_flush_nasid_list.widget_p)
261 BUG(); 113 BUG();
262 114 controller->window[0].offset = legacy_io;
263 for (widget = 0; widget <= HUB_WIDGET_ID_MAX; widget++) { 115 controller->window[0].resource.name = "legacy_io";
264 size = DEV_PER_WIDGET * 116 controller->window[0].resource.flags = IORESOURCE_IO;
265 sizeof(struct sn_flush_device_kernel); 117 controller->window[0].resource.start = legacy_io;
266 sn_flush_device_kernel = kzalloc(size, GFP_KERNEL); 118 controller->window[0].resource.end =
267 if (!sn_flush_device_kernel) 119 controller->window[0].resource.start + 0xffff;
268 BUG(); 120 controller->window[0].resource.parent = &ioport_resource;
269 121 controller->window[1].offset = legacy_mem;
270 dev_entry = sn_flush_device_kernel; 122 controller->window[1].resource.name = "legacy_mem";
271 for (device = 0; device < DEV_PER_WIDGET; 123 controller->window[1].resource.flags = IORESOURCE_MEM;
272 device++,dev_entry++) { 124 controller->window[1].resource.start = legacy_mem;
273 size = sizeof(struct sn_flush_device_common); 125 controller->window[1].resource.end =
274 dev_entry->common = kzalloc(size, GFP_KERNEL); 126 controller->window[1].resource.start + (1024 * 1024) - 1;
275 if (!dev_entry->common) 127 controller->window[1].resource.parent = &iomem_resource;
276 BUG(); 128 controller->windows = 2;
277
278 if (sn_prom_feature_available(
279 PRF_DEVICE_FLUSH_LIST))
280 status = sal_get_device_dmaflush_list(
281 nasid, widget, device,
282 (u64)(dev_entry->common));
283 else
284 status = sn_device_fixup_war(nasid,
285 widget, device,
286 dev_entry->common);
287 if (status != SALRET_OK)
288 panic("SAL call failed: %s\n",
289 ia64_sal_strerror(status));
290
291 spin_lock_init(&dev_entry->sfdl_flush_lock);
292 }
293
294 if (sn_flush_device_kernel)
295 hubdev->hdi_flush_nasid_list.widget_p[widget] =
296 sn_flush_device_kernel;
297 }
298 }
299} 129}
300 130
301/* 131/*
302 * sn_pci_window_fixup() - Create a pci_window for each device resource. 132 * sn_pci_window_fixup() - Create a pci_window for each device resource.
303 * Until ACPI support is added, we need this code 133 * It will setup pci_windows for use by
304 * to setup pci_windows for use by 134 * pcibios_bus_to_resource(), pcibios_resource_to_bus(),
305 * pcibios_bus_to_resource(), 135 * etc.
306 * pcibios_resource_to_bus(), etc.
307 */ 136 */
308static void 137static void
309sn_pci_window_fixup(struct pci_dev *dev, unsigned int count, 138sn_pci_window_fixup(struct pci_dev *dev, unsigned int count,
@@ -342,60 +171,22 @@ sn_pci_window_fixup(struct pci_dev *dev, unsigned int count,
342 controller->window = new_window; 171 controller->window = new_window;
343} 172}
344 173
345void sn_pci_unfixup_slot(struct pci_dev *dev)
346{
347 struct pci_dev *host_pci_dev = SN_PCIDEV_INFO(dev)->host_pci_dev;
348
349 sn_irq_unfixup(dev);
350 pci_dev_put(host_pci_dev);
351 pci_dev_put(dev);
352}
353
354/* 174/*
355 * sn_pci_fixup_slot() - This routine sets up a slot's resources 175 * sn_more_slot_fixup() - We are not running with an ACPI capable PROM,
356 * consistent with the Linux PCI abstraction layer. Resources acquired 176 * and need to convert the pci_dev->resource
357 * from our PCI provider include PIO maps to BAR space and interrupt 177 * 'start' and 'end' addresses to mapped addresses,
358 * objects. 178 * and setup the pci_controller->window array entries.
359 */ 179 */
360void sn_pci_fixup_slot(struct pci_dev *dev) 180void
181sn_more_slot_fixup(struct pci_dev *dev, struct pcidev_info *pcidev_info)
361{ 182{
362 unsigned int count = 0; 183 unsigned int count = 0;
363 int idx; 184 int idx;
364 int segment = pci_domain_nr(dev->bus);
365 int status = 0;
366 struct pcibus_bussoft *bs;
367 struct pci_bus *host_pci_bus;
368 struct pci_dev *host_pci_dev;
369 struct pcidev_info *pcidev_info;
370 s64 pci_addrs[PCI_ROM_RESOURCE + 1]; 185 s64 pci_addrs[PCI_ROM_RESOURCE + 1];
371 struct sn_irq_info *sn_irq_info; 186 unsigned long addr, end, size, start;
372 unsigned long size;
373 unsigned int bus_no, devfn;
374
375 pci_dev_get(dev); /* for the sysdata pointer */
376 pcidev_info = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL);
377 if (!pcidev_info)
378 BUG(); /* Cannot afford to run out of memory */
379
380 sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL);
381 if (!sn_irq_info)
382 BUG(); /* Cannot afford to run out of memory */
383
384 /* Call to retrieve pci device information needed by kernel. */
385 status = sal_get_pcidev_info((u64) segment, (u64) dev->bus->number,
386 dev->devfn,
387 (u64) __pa(pcidev_info),
388 (u64) __pa(sn_irq_info));
389 if (status)
390 BUG(); /* Cannot get platform pci device information */
391
392 /* Add pcidev_info to list in sn_pci_controller struct */
393 list_add_tail(&pcidev_info->pdi_list,
394 &(SN_PCI_CONTROLLER(dev->bus)->pcidev_info));
395 187
396 /* Copy over PIO Mapped Addresses */ 188 /* Copy over PIO Mapped Addresses */
397 for (idx = 0; idx <= PCI_ROM_RESOURCE; idx++) { 189 for (idx = 0; idx <= PCI_ROM_RESOURCE; idx++) {
398 unsigned long start, end, addr;
399 190
400 if (!pcidev_info->pdi_pio_mapped_addr[idx]) { 191 if (!pcidev_info->pdi_pio_mapped_addr[idx]) {
401 pci_addrs[idx] = -1; 192 pci_addrs[idx] = -1;
@@ -419,60 +210,28 @@ void sn_pci_fixup_slot(struct pci_dev *dev)
419 dev->resource[idx].parent = &ioport_resource; 210 dev->resource[idx].parent = &ioport_resource;
420 else 211 else
421 dev->resource[idx].parent = &iomem_resource; 212 dev->resource[idx].parent = &iomem_resource;
213 /* If ROM, mark as shadowed in PROM */
214 if (idx == PCI_ROM_RESOURCE)
215 dev->resource[idx].flags |= IORESOURCE_ROM_BIOS_COPY;
422 } 216 }
423 /* Create a pci_window in the pci_controller struct for 217 /* Create a pci_window in the pci_controller struct for
424 * each device resource. 218 * each device resource.
425 */ 219 */
426 if (count > 0) 220 if (count > 0)
427 sn_pci_window_fixup(dev, count, pci_addrs); 221 sn_pci_window_fixup(dev, count, pci_addrs);
428
429 /*
430 * Using the PROMs values for the PCI host bus, get the Linux
431 * PCI host_pci_dev struct and set up host bus linkages
432 */
433
434 bus_no = (pcidev_info->pdi_slot_host_handle >> 32) & 0xff;
435 devfn = pcidev_info->pdi_slot_host_handle & 0xffffffff;
436 host_pci_bus = pci_find_bus(segment, bus_no);
437 host_pci_dev = pci_get_slot(host_pci_bus, devfn);
438
439 pcidev_info->host_pci_dev = host_pci_dev;
440 pcidev_info->pdi_linux_pcidev = dev;
441 pcidev_info->pdi_host_pcidev_info = SN_PCIDEV_INFO(host_pci_dev);
442 bs = SN_PCIBUS_BUSSOFT(dev->bus);
443 pcidev_info->pdi_pcibus_info = bs;
444
445 if (bs && bs->bs_asic_type < PCIIO_ASIC_MAX_TYPES) {
446 SN_PCIDEV_BUSPROVIDER(dev) = sn_pci_provider[bs->bs_asic_type];
447 } else {
448 SN_PCIDEV_BUSPROVIDER(dev) = &sn_pci_default_provider;
449 }
450
451 /* Only set up IRQ stuff if this device has a host bus context */
452 if (bs && sn_irq_info->irq_irq) {
453 pcidev_info->pdi_sn_irq_info = sn_irq_info;
454 dev->irq = pcidev_info->pdi_sn_irq_info->irq_irq;
455 sn_irq_fixup(dev, sn_irq_info);
456 } else {
457 pcidev_info->pdi_sn_irq_info = NULL;
458 kfree(sn_irq_info);
459 }
460} 222}
461 223
462/* 224/*
463 * sn_pci_controller_fixup() - This routine sets up a bus's resources 225 * sn_pci_controller_fixup() - This routine sets up a bus's resources
464 * consistent with the Linux PCI abstraction layer. 226 * consistent with the Linux PCI abstraction layer.
465 */ 227 */
466void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) 228static void
229sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
467{ 230{
468 int status; 231 s64 status = 0;
469 int nasid, cnode;
470 struct pci_controller *controller; 232 struct pci_controller *controller;
471 struct sn_pci_controller *sn_controller;
472 struct pcibus_bussoft *prom_bussoft_ptr; 233 struct pcibus_bussoft *prom_bussoft_ptr;
473 struct hubdev_info *hubdev_info; 234
474 void *provider_soft;
475 struct sn_pcibus_provider *provider;
476 235
477 status = sal_get_pcibus_info((u64) segment, (u64) busnum, 236 status = sal_get_pcibus_info((u64) segment, (u64) busnum,
478 (u64) ia64_tpa(&prom_bussoft_ptr)); 237 (u64) ia64_tpa(&prom_bussoft_ptr));
@@ -480,261 +239,77 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
480 return; /*bus # does not exist */ 239 return; /*bus # does not exist */
481 prom_bussoft_ptr = __va(prom_bussoft_ptr); 240 prom_bussoft_ptr = __va(prom_bussoft_ptr);
482 241
483 /* Allocate a sn_pci_controller, which has a pci_controller struct 242 controller = kzalloc(sizeof(*controller), GFP_KERNEL);
484 * as the first member. 243 if (!controller)
485 */
486 sn_controller = kzalloc(sizeof(struct sn_pci_controller), GFP_KERNEL);
487 if (!sn_controller)
488 BUG(); 244 BUG();
489 INIT_LIST_HEAD(&sn_controller->pcidev_info);
490 controller = &sn_controller->pci_controller;
491 controller->segment = segment; 245 controller->segment = segment;
492 246
493 if (bus == NULL) {
494 bus = pci_scan_bus(busnum, &pci_root_ops, controller);
495 if (bus == NULL)
496 goto error_return; /* error, or bus already scanned */
497 bus->sysdata = NULL;
498 }
499
500 if (bus->sysdata)
501 goto error_return; /* sysdata already alloc'd */
502
503 /* 247 /*
504 * Per-provider fixup. Copies the contents from prom to local 248 * Temporarily save the prom_bussoft_ptr for use by sn_bus_fixup().
505 * area and links SN_PCIBUS_BUSSOFT(). 249 * (platform_data will be overwritten later in sn_common_bus_fixup())
506 */ 250 */
251 controller->platform_data = prom_bussoft_ptr;
507 252
508 if (prom_bussoft_ptr->bs_asic_type >= PCIIO_ASIC_MAX_TYPES) 253 bus = pci_scan_bus(busnum, &pci_root_ops, controller);
509 goto error_return; /* unsupported asic type */ 254 if (bus == NULL)
510 255 goto error_return; /* error, or bus already scanned */
511 if (prom_bussoft_ptr->bs_asic_type == PCIIO_ASIC_TYPE_PPB)
512 goto error_return; /* no further fixup necessary */
513
514 provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type];
515 if (provider == NULL)
516 goto error_return; /* no provider registerd for this asic */
517 256
518 bus->sysdata = controller; 257 bus->sysdata = controller;
519 if (provider->bus_fixup)
520 provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr, controller);
521 else
522 provider_soft = NULL;
523
524 if (provider_soft == NULL) {
525 /* fixup failed or not applicable */
526 bus->sysdata = NULL;
527 goto error_return;
528 }
529
530 /*
531 * Setup pci_windows for legacy IO and MEM space.
532 * (Temporary until ACPI support is in place.)
533 */
534 controller->window = kcalloc(2, sizeof(struct pci_window), GFP_KERNEL);
535 if (controller->window == NULL)
536 BUG();
537 controller->window[0].offset = prom_bussoft_ptr->bs_legacy_io;
538 controller->window[0].resource.name = "legacy_io";
539 controller->window[0].resource.flags = IORESOURCE_IO;
540 controller->window[0].resource.start = prom_bussoft_ptr->bs_legacy_io;
541 controller->window[0].resource.end =
542 controller->window[0].resource.start + 0xffff;
543 controller->window[0].resource.parent = &ioport_resource;
544 controller->window[1].offset = prom_bussoft_ptr->bs_legacy_mem;
545 controller->window[1].resource.name = "legacy_mem";
546 controller->window[1].resource.flags = IORESOURCE_MEM;
547 controller->window[1].resource.start = prom_bussoft_ptr->bs_legacy_mem;
548 controller->window[1].resource.end =
549 controller->window[1].resource.start + (1024 * 1024) - 1;
550 controller->window[1].resource.parent = &iomem_resource;
551 controller->windows = 2;
552
553 /*
554 * Generic bus fixup goes here. Don't reference prom_bussoft_ptr
555 * after this point.
556 */
557
558 PCI_CONTROLLER(bus)->platform_data = provider_soft;
559 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(bus)->bs_base);
560 cnode = nasid_to_cnodeid(nasid);
561 hubdev_info = (struct hubdev_info *)(NODEPDA(cnode)->pdinfo);
562 SN_PCIBUS_BUSSOFT(bus)->bs_xwidget_info =
563 &(hubdev_info->hdi_xwidget_info[SN_PCIBUS_BUSSOFT(bus)->bs_xid]);
564 258
565 /*
566 * If the node information we obtained during the fixup phase is invalid
567 * then set controller->node to -1 (undetermined)
568 */
569 if (controller->node >= num_online_nodes()) {
570 struct pcibus_bussoft *b = SN_PCIBUS_BUSSOFT(bus);
571
572 printk(KERN_WARNING "Device ASIC=%u XID=%u PBUSNUM=%u"
573 "L_IO=%lx L_MEM=%lx BASE=%lx\n",
574 b->bs_asic_type, b->bs_xid, b->bs_persist_busnum,
575 b->bs_legacy_io, b->bs_legacy_mem, b->bs_base);
576 printk(KERN_WARNING "on node %d but only %d nodes online."
577 "Association set to undetermined.\n",
578 controller->node, num_online_nodes());
579 controller->node = -1;
580 }
581 return; 259 return;
582 260
583error_return: 261error_return:
584 262
585 kfree(sn_controller); 263 kfree(controller);
586 return; 264 return;
587} 265}
588 266
589void sn_bus_store_sysdata(struct pci_dev *dev) 267/*
268 * sn_bus_fixup
269 */
270void
271sn_bus_fixup(struct pci_bus *bus)
590{ 272{
591 struct sysdata_el *element; 273 struct pci_dev *pci_dev = NULL;
592 274 struct pcibus_bussoft *prom_bussoft_ptr;
593 element = kzalloc(sizeof(struct sysdata_el), GFP_KERNEL); 275 extern void sn_common_bus_fixup(struct pci_bus *,
594 if (!element) { 276 struct pcibus_bussoft *);
595 dev_dbg(dev, "%s: out of memory!\n", __FUNCTION__); 277
596 return; 278
597 } 279 if (!bus->parent) { /* If root bus */
598 element->sysdata = SN_PCIDEV_INFO(dev); 280 prom_bussoft_ptr = PCI_CONTROLLER(bus)->platform_data;
599 list_add(&element->entry, &sn_sysdata_list); 281 if (prom_bussoft_ptr == NULL) {
600} 282 printk(KERN_ERR
283 "sn_bus_fixup: 0x%04x:0x%02x Unable to "
284 "obtain prom_bussoft_ptr\n",
285 pci_domain_nr(bus), bus->number);
286 return;
287 }
288 sn_common_bus_fixup(bus, prom_bussoft_ptr);
289 sn_legacy_pci_window_fixup(PCI_CONTROLLER(bus),
290 prom_bussoft_ptr->bs_legacy_io,
291 prom_bussoft_ptr->bs_legacy_mem);
292 }
293 list_for_each_entry(pci_dev, &bus->devices, bus_list) {
294 sn_pci_fixup_slot(pci_dev);
295 }
601 296
602void sn_bus_free_sysdata(void)
603{
604 struct sysdata_el *element;
605 struct list_head *list, *safe;
606
607 list_for_each_safe(list, safe, &sn_sysdata_list) {
608 element = list_entry(list, struct sysdata_el, entry);
609 list_del(&element->entry);
610 list_del(&(((struct pcidev_info *)
611 (element->sysdata))->pdi_list));
612 kfree(element->sysdata);
613 kfree(element);
614 }
615 return;
616} 297}
617 298
618/* 299/*
619 * Ugly hack to get PCI setup until we have a proper ACPI namespace. 300 * sn_io_init - PROM does not have ACPI support to define nodes or root buses,
301 * so we need to do things the hard way, including initiating the
302 * bus scanning ourselves.
620 */ 303 */
621 304
622#define PCI_BUSES_TO_SCAN 256 305void __init sn_io_init(void)
623
624static int __init sn_pci_init(void)
625{ 306{
626 int i, j; 307 int i, j;
627 struct pci_dev *pci_dev = NULL;
628
629 if (!ia64_platform_is("sn2") || IS_RUNNING_ON_FAKE_PROM())
630 return 0;
631
632 /*
633 * prime sn_pci_provider[]. Individial provider init routines will
634 * override their respective default entries.
635 */
636
637 for (i = 0; i < PCIIO_ASIC_MAX_TYPES; i++)
638 sn_pci_provider[i] = &sn_pci_default_provider;
639 308
640 pcibr_init_provider();
641 tioca_init_provider();
642 tioce_init_provider();
643
644 /*
645 * This is needed to avoid bounce limit checks in the blk layer
646 */
647 ia64_max_iommu_merge_mask = ~PAGE_MASK;
648 sn_fixup_ionodes(); 309 sn_fixup_ionodes();
649 sn_irq_lh_init();
650 INIT_LIST_HEAD(&sn_sysdata_list);
651 sn_init_cpei_timer();
652
653#ifdef CONFIG_PROC_FS
654 register_sn_procfs();
655#endif
656 310
657 /* busses are not known yet ... */ 311 /* busses are not known yet ... */
658 for (i = 0; i <= max_segment_number; i++) 312 for (i = 0; i <= max_segment_number; i++)
659 for (j = 0; j <= max_pcibus_number; j++) 313 for (j = 0; j <= max_pcibus_number; j++)
660 sn_pci_controller_fixup(i, j, NULL); 314 sn_pci_controller_fixup(i, j, NULL);
661
662 /*
663 * Generic Linux PCI Layer has created the pci_bus and pci_dev
664 * structures - time for us to add our SN PLatform specific
665 * information.
666 */
667
668 while ((pci_dev =
669 pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pci_dev)) != NULL)
670 sn_pci_fixup_slot(pci_dev);
671
672 sn_ioif_inited = 1; /* sn I/O infrastructure now initialized */
673
674 return 0;
675}
676
677/*
678 * hubdev_init_node() - Creates the HUB data structure and link them to it's
679 * own NODE specific data area.
680 */
681void hubdev_init_node(nodepda_t * npda, cnodeid_t node)
682{
683 struct hubdev_info *hubdev_info;
684 int size;
685 pg_data_t *pg;
686
687 size = sizeof(struct hubdev_info);
688
689 if (node >= num_online_nodes()) /* Headless/memless IO nodes */
690 pg = NODE_DATA(0);
691 else
692 pg = NODE_DATA(node);
693
694 hubdev_info = (struct hubdev_info *)alloc_bootmem_node(pg, size);
695
696 npda->pdinfo = (void *)hubdev_info;
697} 315}
698
699geoid_t
700cnodeid_get_geoid(cnodeid_t cnode)
701{
702 struct hubdev_info *hubdev;
703
704 hubdev = (struct hubdev_info *)(NODEPDA(cnode)->pdinfo);
705 return hubdev->hdi_geoid;
706}
707
708void sn_generate_path(struct pci_bus *pci_bus, char *address)
709{
710 nasid_t nasid;
711 cnodeid_t cnode;
712 geoid_t geoid;
713 moduleid_t moduleid;
714 u16 bricktype;
715
716 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(pci_bus)->bs_base);
717 cnode = nasid_to_cnodeid(nasid);
718 geoid = cnodeid_get_geoid(cnode);
719 moduleid = geo_module(geoid);
720
721 sprintf(address, "module_%c%c%c%c%.2d",
722 '0'+RACK_GET_CLASS(MODULE_GET_RACK(moduleid)),
723 '0'+RACK_GET_GROUP(MODULE_GET_RACK(moduleid)),
724 '0'+RACK_GET_NUM(MODULE_GET_RACK(moduleid)),
725 MODULE_GET_BTCHAR(moduleid), MODULE_GET_BPOS(moduleid));
726
727 /* Tollhouse requires slot id to be displayed */
728 bricktype = MODULE_GET_BTYPE(moduleid);
729 if ((bricktype == L1_BRICKTYPE_191010) ||
730 (bricktype == L1_BRICKTYPE_1932))
731 sprintf(address, "%s^%d", address, geo_slot(geoid));
732}
733
734subsys_initcall(sn_pci_init);
735EXPORT_SYMBOL(sn_pci_fixup_slot);
736EXPORT_SYMBOL(sn_pci_unfixup_slot);
737EXPORT_SYMBOL(sn_pci_controller_fixup);
738EXPORT_SYMBOL(sn_bus_store_sysdata);
739EXPORT_SYMBOL(sn_bus_free_sysdata);
740EXPORT_SYMBOL(sn_generate_path);
diff --git a/arch/ia64/sn/kernel/iomv.c b/arch/ia64/sn/kernel/iomv.c
index 7ce3cdad627..4aa4f301d56 100644
--- a/arch/ia64/sn/kernel/iomv.c
+++ b/arch/ia64/sn/kernel/iomv.c
@@ -3,10 +3,11 @@
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) 2000-2003 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 2000-2003, 2006 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/acpi.h>
10#include <asm/io.h> 11#include <asm/io.h>
11#include <asm/delay.h> 12#include <asm/delay.h>
12#include <asm/vga.h> 13#include <asm/vga.h>
@@ -15,6 +16,7 @@
15#include <asm/sn/pda.h> 16#include <asm/sn/pda.h>
16#include <asm/sn/sn_cpuid.h> 17#include <asm/sn/sn_cpuid.h>
17#include <asm/sn/shub_mmr.h> 18#include <asm/sn/shub_mmr.h>
19#include <asm/sn/acpi.h>
18 20
19#define IS_LEGACY_VGA_IOPORT(p) \ 21#define IS_LEGACY_VGA_IOPORT(p) \
20 (((p) >= 0x3b0 && (p) <= 0x3bb) || ((p) >= 0x3c0 && (p) <= 0x3df)) 22 (((p) >= 0x3b0 && (p) <= 0x3bb) || ((p) >= 0x3c0 && (p) <= 0x3df))
@@ -31,11 +33,14 @@ void *sn_io_addr(unsigned long port)
31{ 33{
32 if (!IS_RUNNING_ON_SIMULATOR()) { 34 if (!IS_RUNNING_ON_SIMULATOR()) {
33 if (IS_LEGACY_VGA_IOPORT(port)) 35 if (IS_LEGACY_VGA_IOPORT(port))
34 port += vga_console_iobase; 36 return (__ia64_mk_io_addr(port));
35 /* On sn2, legacy I/O ports don't point at anything */ 37 /* On sn2, legacy I/O ports don't point at anything */
36 if (port < (64 * 1024)) 38 if (port < (64 * 1024))
37 return NULL; 39 return NULL;
38 return ((void *)(port | __IA64_UNCACHED_OFFSET)); 40 if (SN_ACPI_BASE_SUPPORT())
41 return (__ia64_mk_io_addr(port));
42 else
43 return ((void *)(port | __IA64_UNCACHED_OFFSET));
39 } else { 44 } else {
40 /* but the simulator uses them... */ 45 /* but the simulator uses them... */
41 unsigned long addr; 46 unsigned long addr;
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 7bb6ad188ba..0b49459a878 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -201,7 +201,7 @@ static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask)
201} 201}
202 202
203struct hw_interrupt_type irq_type_sn = { 203struct hw_interrupt_type irq_type_sn = {
204 .typename = "SN hub", 204 .name = "SN hub",
205 .startup = sn_startup_irq, 205 .startup = sn_startup_irq,
206 .shutdown = sn_shutdown_irq, 206 .shutdown = sn_shutdown_irq,
207 .enable = sn_enable_irq, 207 .enable = sn_enable_irq,
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 5f2dcba7fa8..1d009f93244 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -65,7 +65,6 @@ extern void sn_timer_init(void);
65extern unsigned long last_time_offset; 65extern unsigned long last_time_offset;
66extern void (*ia64_mark_idle) (int); 66extern void (*ia64_mark_idle) (int);
67extern void snidle(int); 67extern void snidle(int);
68extern unsigned char acpi_kbd_controller_present;
69extern unsigned long long (*ia64_printk_clock)(void); 68extern unsigned long long (*ia64_printk_clock)(void);
70 69
71unsigned long sn_rtc_cycles_per_second; 70unsigned long sn_rtc_cycles_per_second;
@@ -389,6 +388,14 @@ void __init sn_setup(char **cmdline_p)
389 ia64_sn_plat_set_error_handling_features(); // obsolete 388 ia64_sn_plat_set_error_handling_features(); // obsolete
390 ia64_sn_set_os_feature(OSF_MCA_SLV_TO_OS_INIT_SLV); 389 ia64_sn_set_os_feature(OSF_MCA_SLV_TO_OS_INIT_SLV);
391 ia64_sn_set_os_feature(OSF_FEAT_LOG_SBES); 390 ia64_sn_set_os_feature(OSF_FEAT_LOG_SBES);
391 /*
392 * Note: The calls to notify the PROM of ACPI and PCI Segment
393 * support must be done prior to acpi_load_tables(), as
394 * an ACPI capable PROM will rebuild the DSDT as result
395 * of the call.
396 */
397 ia64_sn_set_os_feature(OSF_PCISEGMENT_ENABLE);
398 ia64_sn_set_os_feature(OSF_ACPI_ENABLE);
392 399
393 400
394#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) 401#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
@@ -414,6 +421,16 @@ void __init sn_setup(char **cmdline_p)
414 if (! vga_console_membase) 421 if (! vga_console_membase)
415 sn_scan_pcdp(); 422 sn_scan_pcdp();
416 423
424 /*
425 * Setup legacy IO space.
426 * vga_console_iobase maps to PCI IO Space address 0 on the
427 * bus containing the VGA console.
428 */
429 if (vga_console_iobase) {
430 io_space[0].mmio_base = vga_console_iobase;
431 io_space[0].sparse = 0;
432 }
433
417 if (vga_console_membase) { 434 if (vga_console_membase) {
418 /* usable vga ... make tty0 the preferred default console */ 435 /* usable vga ... make tty0 the preferred default console */
419 if (!strstr(*cmdline_p, "console=")) 436 if (!strstr(*cmdline_p, "console="))
@@ -452,17 +469,6 @@ void __init sn_setup(char **cmdline_p)
452 469
453 ia64_printk_clock = ia64_sn2_printk_clock; 470 ia64_printk_clock = ia64_sn2_printk_clock;
454 471
455 /*
456 * Old PROMs do not provide an ACPI FADT. Disable legacy keyboard
457 * support here so we don't have to listen to failed keyboard probe
458 * messages.
459 */
460 if (is_shub1() && version <= 0x0209 && acpi_kbd_controller_present) {
461 printk(KERN_INFO "Disabling legacy keyboard support as prom "
462 "is too old and doesn't provide FADT\n");
463 acpi_kbd_controller_present = 0;
464 }
465
466 printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF); 472 printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF);
467 473
468 /* 474 /*
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index feaf1a6e810..493380b2c05 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -552,7 +552,7 @@ static void __exit tiocx_exit(void)
552 bus_unregister(&tiocx_bus_type); 552 bus_unregister(&tiocx_bus_type);
553} 553}
554 554
555subsys_initcall(tiocx_init); 555fs_initcall(tiocx_init);
556module_exit(tiocx_exit); 556module_exit(tiocx_exit);
557 557
558/************************************************************************ 558/************************************************************************
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 27dd7df0f44..6846dc9b432 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -3,7 +3,7 @@
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) 2001-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 2001-2004, 2006 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#include <linux/interrupt.h> 9#include <linux/interrupt.h>
@@ -109,7 +109,6 @@ void *
109pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller) 109pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller)
110{ 110{
111 int nasid, cnode, j; 111 int nasid, cnode, j;
112 cnodeid_t near_cnode;
113 struct hubdev_info *hubdev_info; 112 struct hubdev_info *hubdev_info;
114 struct pcibus_info *soft; 113 struct pcibus_info *soft;
115 struct sn_flush_device_kernel *sn_flush_device_kernel; 114 struct sn_flush_device_kernel *sn_flush_device_kernel;
@@ -186,20 +185,6 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
186 return NULL; 185 return NULL;
187 } 186 }
188 187
189 if (prom_bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP) {
190 /* TIO PCI Bridge: find nearest node with CPUs */
191 int e = sn_hwperf_get_nearest_node(cnode, NULL, &near_cnode);
192
193 if (e < 0) {
194 near_cnode = (cnodeid_t)-1; /* use any node */
195 printk(KERN_WARNING "pcibr_bus_fixup: failed to find "
196 "near node with CPUs to TIO node %d, err=%d\n",
197 cnode, e);
198 }
199 controller->node = near_cnode;
200 }
201 else
202 controller->node = cnode;
203 return soft; 188 return soft;
204} 189}
205 190
diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c
index 46e16dcf597..35f854fb612 100644
--- a/arch/ia64/sn/pci/tioce_provider.c
+++ b/arch/ia64/sn/pci/tioce_provider.c
@@ -15,7 +15,6 @@
15#include <asm/sn/pcidev.h> 15#include <asm/sn/pcidev.h>
16#include <asm/sn/pcibus_provider_defs.h> 16#include <asm/sn/pcibus_provider_defs.h>
17#include <asm/sn/tioce_provider.h> 17#include <asm/sn/tioce_provider.h>
18#include <asm/sn/sn2/sn_hwperf.h>
19 18
20/* 19/*
21 * 1/26/2006 20 * 1/26/2006
@@ -990,8 +989,6 @@ tioce_target_interrupt(struct sn_irq_info *sn_irq_info)
990static void * 989static void *
991tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller) 990tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller)
992{ 991{
993 int my_nasid;
994 cnodeid_t my_cnode, mem_cnode;
995 struct tioce_common *tioce_common; 992 struct tioce_common *tioce_common;
996 struct tioce_kernel *tioce_kern; 993 struct tioce_kernel *tioce_kern;
997 struct tioce __iomem *tioce_mmr; 994 struct tioce __iomem *tioce_mmr;
@@ -1035,21 +1032,6 @@ tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
1035 tioce_common->ce_pcibus.bs_persist_segment, 1032 tioce_common->ce_pcibus.bs_persist_segment,
1036 tioce_common->ce_pcibus.bs_persist_busnum); 1033 tioce_common->ce_pcibus.bs_persist_busnum);
1037 1034
1038 /*
1039 * identify closest nasid for memory allocations
1040 */
1041
1042 my_nasid = NASID_GET(tioce_common->ce_pcibus.bs_base);
1043 my_cnode = nasid_to_cnodeid(my_nasid);
1044
1045 if (sn_hwperf_get_nearest_node(my_cnode, &mem_cnode, NULL) < 0) {
1046 printk(KERN_WARNING "tioce_bus_fixup: failed to find "
1047 "closest node with MEM to TIO node %d\n", my_cnode);
1048 mem_cnode = (cnodeid_t)-1; /* use any node */
1049 }
1050
1051 controller->node = mem_cnode;
1052
1053 return tioce_common; 1035 return tioce_common;
1054} 1036}
1055 1037
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 13c7bb698e3..358b9cee2c6 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -83,13 +83,7 @@ SECTIONS
83 __setup_end = .; 83 __setup_end = .;
84 __initcall_start = .; 84 __initcall_start = .;
85 .initcall.init : { 85 .initcall.init : {
86 *(.initcall1.init) 86 INITCALLS
87 *(.initcall2.init)
88 *(.initcall3.init)
89 *(.initcall4.init)
90 *(.initcall5.init)
91 *(.initcall6.init)
92 *(.initcall7.init)
93 } 87 }
94 __initcall_end = .; 88 __initcall_end = .;
95 __con_initcall_start = .; 89 __con_initcall_start = .;
diff --git a/arch/m32r/lib/csum_partial_copy.c b/arch/m32r/lib/csum_partial_copy.c
index 3d5f0614585..5596f3df833 100644
--- a/arch/m32r/lib/csum_partial_copy.c
+++ b/arch/m32r/lib/csum_partial_copy.c
@@ -27,9 +27,8 @@
27/* 27/*
28 * Copy while checksumming, otherwise like csum_partial 28 * Copy while checksumming, otherwise like csum_partial
29 */ 29 */
30unsigned int 30__wsum
31csum_partial_copy_nocheck (const unsigned char *src, unsigned char *dst, 31csum_partial_copy_nocheck (const void *src, void *dst, int len, __wsum sum)
32 int len, unsigned int sum)
33{ 32{
34 sum = csum_partial(src, len, sum); 33 sum = csum_partial(src, len, sum);
35 memcpy(dst, src, len); 34 memcpy(dst, src, len);
@@ -42,10 +41,9 @@ EXPORT_SYMBOL(csum_partial_copy_nocheck);
42 * Copy from userspace and compute checksum. If we catch an exception 41 * Copy from userspace and compute checksum. If we catch an exception
43 * then zero the rest of the buffer. 42 * then zero the rest of the buffer.
44 */ 43 */
45unsigned int 44__wsum
46csum_partial_copy_from_user (const unsigned char __user *src, 45csum_partial_copy_from_user (const void __user *src, void *dst,
47 unsigned char *dst, 46 int len, __wsum sum, int *err_ptr)
48 int len, unsigned int sum, int *err_ptr)
49{ 47{
50 int missing; 48 int missing;
51 49
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index 69d1d3d30c7..d2794452b19 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -54,13 +54,7 @@ SECTIONS
54 __setup_end = .; 54 __setup_end = .;
55 __initcall_start = .; 55 __initcall_start = .;
56 .initcall.init : { 56 .initcall.init : {
57 *(.initcall1.init) 57 INITCALLS
58 *(.initcall2.init)
59 *(.initcall3.init)
60 *(.initcall4.init)
61 *(.initcall5.init)
62 *(.initcall6.init)
63 *(.initcall7.init)
64 } 58 }
65 __initcall_end = .; 59 __initcall_end = .;
66 __con_initcall_start = .; 60 __con_initcall_start = .;
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index 65cc39c2418..2550b4ae273 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -48,13 +48,7 @@ __init_begin = .;
48 __setup_end = .; 48 __setup_end = .;
49 __initcall_start = .; 49 __initcall_start = .;
50 .initcall.init : { 50 .initcall.init : {
51 *(.initcall1.init) 51 INITCALLS
52 *(.initcall2.init)
53 *(.initcall3.init)
54 *(.initcall4.init)
55 *(.initcall5.init)
56 *(.initcall6.init)
57 *(.initcall7.init)
58 } 52 }
59 __initcall_end = .; 53 __initcall_end = .;
60 __con_initcall_start = .; 54 __con_initcall_start = .;
diff --git a/arch/m68k/lib/checksum.c b/arch/m68k/lib/checksum.c
index cb13c6e3cca..aed3be29e06 100644
--- a/arch/m68k/lib/checksum.c
+++ b/arch/m68k/lib/checksum.c
@@ -39,8 +39,7 @@
39 * computes a partial checksum, e.g. for TCP/UDP fragments 39 * computes a partial checksum, e.g. for TCP/UDP fragments
40 */ 40 */
41 41
42unsigned int 42__wsum csum_partial(const void *buff, int len, __wsum sum)
43csum_partial (const unsigned char *buff, int len, unsigned int sum)
44{ 43{
45 unsigned long tmp1, tmp2; 44 unsigned long tmp1, tmp2;
46 /* 45 /*
@@ -133,9 +132,9 @@ EXPORT_SYMBOL(csum_partial);
133 * copy from user space while checksumming, with exception handling. 132 * copy from user space while checksumming, with exception handling.
134 */ 133 */
135 134
136unsigned int 135__wsum
137csum_partial_copy_from_user(const unsigned char __user *src, unsigned char *dst, 136csum_partial_copy_from_user(const void __user *src, void *dst,
138 int len, int sum, int *csum_err) 137 int len, __wsum sum, int *csum_err)
139{ 138{
140 /* 139 /*
141 * GCC doesn't like more than 10 operands for the asm 140 * GCC doesn't like more than 10 operands for the asm
@@ -325,8 +324,8 @@ csum_partial_copy_from_user(const unsigned char __user *src, unsigned char *dst,
325 * copy from kernel space while checksumming, otherwise like csum_partial 324 * copy from kernel space while checksumming, otherwise like csum_partial
326 */ 325 */
327 326
328unsigned int 327__wsum
329csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, int len, int sum) 328csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
330{ 329{
331 unsigned long tmp1, tmp2; 330 unsigned long tmp1, tmp2;
332 __asm__("movel %2,%4\n\t" 331 __asm__("movel %2,%4\n\t"
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index 6d920d4bdc3..c1bc22c6d0d 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -565,7 +565,7 @@ config ROMVEC
565 depends on ROM 565 depends on ROM
566 help 566 help
567 This is almost always the same as the base of the ROM. Since on all 567 This is almost always the same as the base of the ROM. Since on all
568 68000 type varients the vectors are at the base of the boot device 568 68000 type variants the vectors are at the base of the boot device
569 on system startup. 569 on system startup.
570 570
571config ROMVECSIZE 571config ROMVECSIZE
@@ -574,7 +574,7 @@ config ROMVECSIZE
574 depends on ROM 574 depends on ROM
575 help 575 help
576 Define the size of the vector region in ROM. For most 68000 576 Define the size of the vector region in ROM. For most 68000
577 varients this would be 0x400 bytes in size. Set to 0 if you do 577 variants this would be 0x400 bytes in size. Set to 0 if you do
578 not want a vector region at the start of the ROM. 578 not want a vector region at the start of the ROM.
579 579
580config ROMSTART 580config ROMSTART
diff --git a/arch/m68knommu/kernel/m68k_ksyms.c b/arch/m68knommu/kernel/m68k_ksyms.c
index 1e62150f358..25327c9eadd 100644
--- a/arch/m68knommu/kernel/m68k_ksyms.c
+++ b/arch/m68knommu/kernel/m68k_ksyms.c
@@ -38,7 +38,7 @@ EXPORT_SYMBOL(ip_fast_csum);
38EXPORT_SYMBOL(kernel_thread); 38EXPORT_SYMBOL(kernel_thread);
39 39
40/* Networking helper routines. */ 40/* Networking helper routines. */
41EXPORT_SYMBOL(csum_partial_copy); 41EXPORT_SYMBOL(csum_partial_copy_nocheck);
42 42
43/* The following are special because they're not called 43/* The following are special because they're not called
44 explicitly (the C compiler generates them). Fortunately, 44 explicitly (the C compiler generates them). Fortunately,
diff --git a/arch/m68knommu/kernel/setup.c b/arch/m68knommu/kernel/setup.c
index bde9811cf98..7b21959eaea 100644
--- a/arch/m68knommu/kernel/setup.c
+++ b/arch/m68knommu/kernel/setup.c
@@ -62,7 +62,7 @@ int (*mach_kbdrate) (struct kbd_repeat *);
62void (*mach_kbd_leds) (unsigned int); 62void (*mach_kbd_leds) (unsigned int);
63/* machine dependent irq functions */ 63/* machine dependent irq functions */
64void (*mach_init_IRQ) (void); 64void (*mach_init_IRQ) (void);
65irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *); 65irq_handler_t mach_default_handler;
66int (*mach_get_irq_list) (struct seq_file *, void *); 66int (*mach_get_irq_list) (struct seq_file *, void *);
67void (*mach_process_int) (int irq, struct pt_regs *fp); 67void (*mach_process_int) (int irq, struct pt_regs *fp);
68void (*mach_trap_init) (void); 68void (*mach_trap_init) (void);
diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c
index c5667bdddd5..9226264abf1 100644
--- a/arch/m68knommu/kernel/time.c
+++ b/arch/m68knommu/kernel/time.c
@@ -54,7 +54,7 @@ static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs)
54 update_process_times(user_mode(regs)); 54 update_process_times(user_mode(regs));
55#endif 55#endif
56 if (current->pid) 56 if (current->pid)
57 profile_tick(CPU_PROFILING, regs); 57 profile_tick(CPU_PROFILING);
58 58
59 /* 59 /*
60 * If we have an externally synchronized Linux clock, then update 60 * If we have an externally synchronized Linux clock, then update
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index ccd2ceb05cf..58afa8be604 100644
--- a/arch/m68knommu/kernel/vmlinux.lds.S
+++ b/arch/m68knommu/kernel/vmlinux.lds.S
@@ -140,13 +140,7 @@ SECTIONS {
140 *(.init.setup) 140 *(.init.setup)
141 __setup_end = .; 141 __setup_end = .;
142 __initcall_start = .; 142 __initcall_start = .;
143 *(.initcall1.init) 143 INITCALLS
144 *(.initcall2.init)
145 *(.initcall3.init)
146 *(.initcall4.init)
147 *(.initcall5.init)
148 *(.initcall6.init)
149 *(.initcall7.init)
150 __initcall_end = .; 144 __initcall_end = .;
151 __con_initcall_start = .; 145 __con_initcall_start = .;
152 *(.con_initcall.init) 146 *(.con_initcall.init)
diff --git a/arch/m68knommu/lib/checksum.c b/arch/m68knommu/lib/checksum.c
index 7bec6fdee34..269d83bfbbe 100644
--- a/arch/m68knommu/lib/checksum.c
+++ b/arch/m68knommu/lib/checksum.c
@@ -96,9 +96,9 @@ out:
96 * This is a version of ip_compute_csum() optimized for IP headers, 96 * This is a version of ip_compute_csum() optimized for IP headers,
97 * which always checksum on 4 octet boundaries. 97 * which always checksum on 4 octet boundaries.
98 */ 98 */
99unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) 99__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
100{ 100{
101 return ~do_csum(iph,ihl*4); 101 return (__force __sum16)~do_csum(iph,ihl*4);
102} 102}
103 103
104/* 104/*
@@ -113,15 +113,15 @@ unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl)
113 * 113 *
114 * it's best to have buff aligned on a 32-bit boundary 114 * it's best to have buff aligned on a 32-bit boundary
115 */ 115 */
116unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) 116__wsum csum_partial(const void *buff, int len, __wsum sum)
117{ 117{
118 unsigned int result = do_csum(buff, len); 118 unsigned int result = do_csum(buff, len);
119 119
120 /* add in old sum, and carry.. */ 120 /* add in old sum, and carry.. */
121 result += sum; 121 result += (__force u32)sum;
122 if (sum > result) 122 if ((__force u32)sum > result)
123 result += 1; 123 result += 1;
124 return result; 124 return (__force __wsum)result;
125} 125}
126 126
127EXPORT_SYMBOL(csum_partial); 127EXPORT_SYMBOL(csum_partial);
@@ -130,21 +130,21 @@ EXPORT_SYMBOL(csum_partial);
130 * this routine is used for miscellaneous IP-like checksums, mainly 130 * this routine is used for miscellaneous IP-like checksums, mainly
131 * in icmp.c 131 * in icmp.c
132 */ 132 */
133unsigned short ip_compute_csum(const unsigned char * buff, int len) 133__sum16 ip_compute_csum(const void *buff, int len)
134{ 134{
135 return ~do_csum(buff,len); 135 return (__force __sum16)~do_csum(buff,len);
136} 136}
137 137
138/* 138/*
139 * copy from fs while checksumming, otherwise like csum_partial 139 * copy from fs while checksumming, otherwise like csum_partial
140 */ 140 */
141 141
142unsigned int 142__wsum
143csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, 143csum_partial_copy_from_user(const void __user *src, void *dst,
144 int len, int sum, int *csum_err) 144 int len, __wsum sum, int *csum_err)
145{ 145{
146 if (csum_err) *csum_err = 0; 146 if (csum_err) *csum_err = 0;
147 memcpy(dst, src, len); 147 memcpy(dst, (__force const void *)src, len);
148 return csum_partial(dst, len, sum); 148 return csum_partial(dst, len, sum);
149} 149}
150 150
@@ -152,8 +152,8 @@ csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst,
152 * copy from ds while checksumming, otherwise like csum_partial 152 * copy from ds while checksumming, otherwise like csum_partial
153 */ 153 */
154 154
155unsigned int 155__wsum
156csum_partial_copy(const unsigned char *src, unsigned char *dst, int len, int sum) 156csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
157{ 157{
158 memcpy(dst, src, len); 158 memcpy(dst, src, len);
159 return csum_partial(dst, len, sum); 159 return csum_partial(dst, len, sum);
diff --git a/arch/m68knommu/platform/5307/ints.c b/arch/m68knommu/platform/5307/ints.c
index b4b55093ae7..a57239ec6c8 100644
--- a/arch/m68knommu/platform/5307/ints.c
+++ b/arch/m68knommu/platform/5307/ints.c
@@ -33,7 +33,7 @@
33/* 33/*
34 * This table stores the address info for each vector handler. 34 * This table stores the address info for each vector handler.
35 */ 35 */
36irq_handler_t irq_list[SYS_IRQS]; 36struct irq_entry irq_list[SYS_IRQS];
37 37
38#define NUM_IRQ_NODES 16 38#define NUM_IRQ_NODES 16
39static irq_node_t nodes[NUM_IRQ_NODES]; 39static irq_node_t nodes[NUM_IRQ_NODES];
@@ -44,7 +44,7 @@ volatile unsigned int num_spurious;
44unsigned int local_bh_count[NR_CPUS]; 44unsigned int local_bh_count[NR_CPUS];
45unsigned int local_irq_count[NR_CPUS]; 45unsigned int local_irq_count[NR_CPUS];
46 46
47static irqreturn_t default_irq_handler(int irq, void *ptr, struct pt_regs *regs) 47static irqreturn_t default_irq_handler(int irq, void *ptr)
48{ 48{
49#if 1 49#if 1
50 printk(KERN_INFO "%s(%d): default irq handler vec=%d [0x%x]\n", 50 printk(KERN_INFO "%s(%d): default irq handler vec=%d [0x%x]\n",
@@ -70,7 +70,7 @@ void __init init_IRQ(void)
70 70
71 for (i = 0; i < SYS_IRQS; i++) { 71 for (i = 0; i < SYS_IRQS; i++) {
72 if (mach_default_handler) 72 if (mach_default_handler)
73 irq_list[i].handler = (*mach_default_handler)[i]; 73 irq_list[i].handler = mach_default_handler;
74 else 74 else
75 irq_list[i].handler = default_irq_handler; 75 irq_list[i].handler = default_irq_handler;
76 irq_list[i].flags = IRQ_FLG_STD; 76 irq_list[i].flags = IRQ_FLG_STD;
@@ -100,7 +100,7 @@ irq_node_t *new_irq_node(void)
100 100
101int request_irq( 101int request_irq(
102 unsigned int irq, 102 unsigned int irq,
103 irqreturn_t (*handler)(int, void *, struct pt_regs *), 103 irq_handler_t handler,
104 unsigned long flags, 104 unsigned long flags,
105 const char *devname, 105 const char *devname,
106 void *dev_id) 106 void *dev_id)
@@ -157,7 +157,7 @@ void free_irq(unsigned int irq, void *dev_id)
157 } 157 }
158 158
159 if (mach_default_handler) 159 if (mach_default_handler)
160 irq_list[irq].handler = (*mach_default_handler)[irq]; 160 irq_list[irq].handler = mach_default_handler;
161 else 161 else
162 irq_list[irq].handler = default_irq_handler; 162 irq_list[irq].handler = default_irq_handler;
163 irq_list[irq].flags = IRQ_FLG_STD; 163 irq_list[irq].flags = IRQ_FLG_STD;
@@ -168,8 +168,7 @@ void free_irq(unsigned int irq, void *dev_id)
168EXPORT_SYMBOL(free_irq); 168EXPORT_SYMBOL(free_irq);
169 169
170 170
171int sys_request_irq(unsigned int irq, 171int sys_request_irq(unsigned int irq, irq_handler_t handler,
172 irqreturn_t (*handler)(int, void *, struct pt_regs *),
173 unsigned long flags, const char *devname, void *dev_id) 172 unsigned long flags, const char *devname, void *dev_id)
174{ 173{
175 if (irq > IRQ7) { 174 if (irq > IRQ7) {
@@ -211,7 +210,7 @@ void sys_free_irq(unsigned int irq, void *dev_id)
211 printk(KERN_WARNING "%s: Removing probably wrong IRQ %d from %s\n", 210 printk(KERN_WARNING "%s: Removing probably wrong IRQ %d from %s\n",
212 __FUNCTION__, irq, irq_list[irq].devname); 211 __FUNCTION__, irq, irq_list[irq].devname);
213 212
214 irq_list[irq].handler = (*mach_default_handler)[irq]; 213 irq_list[irq].handler = mach_default_handler;
215 irq_list[irq].flags = 0; 214 irq_list[irq].flags = 0;
216 irq_list[irq].dev_id = NULL; 215 irq_list[irq].dev_id = NULL;
217 irq_list[irq].devname = NULL; 216 irq_list[irq].devname = NULL;
@@ -241,7 +240,7 @@ asmlinkage void process_int(unsigned long vec, struct pt_regs *fp)
241 if (vec >= VEC_INT1 && vec <= VEC_INT7) { 240 if (vec >= VEC_INT1 && vec <= VEC_INT7) {
242 vec -= VEC_SPUR; 241 vec -= VEC_SPUR;
243 kstat_cpu(0).irqs[vec]++; 242 kstat_cpu(0).irqs[vec]++;
244 irq_list[vec].handler(vec, irq_list[vec].dev_id, fp); 243 irq_list[vec].handler(vec, irq_list[vec].dev_id);
245 } else { 244 } else {
246 if (mach_process_int) 245 if (mach_process_int)
247 mach_process_int(vec, fp); 246 mach_process_int(vec, fp);
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 14af6cce2fa..27f83e64296 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -266,8 +266,8 @@ config MIPS_MALTA
266 select BOOT_ELF32 266 select BOOT_ELF32
267 select HAVE_STD_PC_SERIAL_PORT 267 select HAVE_STD_PC_SERIAL_PORT
268 select DMA_NONCOHERENT 268 select DMA_NONCOHERENT
269 select IRQ_CPU
270 select GENERIC_ISA_DMA 269 select GENERIC_ISA_DMA
270 select IRQ_CPU
271 select HW_HAS_PCI 271 select HW_HAS_PCI
272 select I8259 272 select I8259
273 select MIPS_BOARDS_GEN 273 select MIPS_BOARDS_GEN
@@ -425,9 +425,8 @@ config MOMENCO_OCELOT_G
425 select SWAP_IO_SPACE 425 select SWAP_IO_SPACE
426 select SYS_HAS_CPU_RM7000 426 select SYS_HAS_CPU_RM7000
427 select SYS_SUPPORTS_32BIT_KERNEL 427 select SYS_SUPPORTS_32BIT_KERNEL
428 select SYS_SUPPORTS_64BIT_KERNEL 428 select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
429 select SYS_SUPPORTS_BIG_ENDIAN 429 select SYS_SUPPORTS_BIG_ENDIAN
430 select ARCH_SPARSEMEM_ENABLE
431 help 430 help
432 The Ocelot is a MIPS-based Single Board Computer (SBC) made by 431 The Ocelot is a MIPS-based Single Board Computer (SBC) made by
433 Momentum Computer <http://www.momenco.com/>. 432 Momentum Computer <http://www.momenco.com/>.
@@ -535,7 +534,7 @@ config SGI_IP22
535 select HW_HAS_EISA 534 select HW_HAS_EISA
536 select IP22_CPU_SCACHE 535 select IP22_CPU_SCACHE
537 select IRQ_CPU 536 select IRQ_CPU
538 select NO_ISA if ISA 537 select GENERIC_ISA_DMA_SUPPORT_BROKEN
539 select SWAP_IO_SPACE 538 select SWAP_IO_SPACE
540 select SYS_HAS_CPU_R4X00 539 select SYS_HAS_CPU_R4X00
541 select SYS_HAS_CPU_R5000 540 select SYS_HAS_CPU_R5000
@@ -560,6 +559,7 @@ config SGI_IP27
560 select SYS_SUPPORTS_64BIT_KERNEL 559 select SYS_SUPPORTS_64BIT_KERNEL
561 select SYS_SUPPORTS_BIG_ENDIAN 560 select SYS_SUPPORTS_BIG_ENDIAN
562 select SYS_SUPPORTS_NUMA 561 select SYS_SUPPORTS_NUMA
562 select SYS_SUPPORTS_SMP
563 help 563 help
564 This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics 564 This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
565 workstations. To compile a Linux kernel that runs on these, say Y 565 workstations. To compile a Linux kernel that runs on these, say Y
@@ -766,6 +766,23 @@ config TOSHIBA_RBTX4938
766 766
767endchoice 767endchoice
768 768
769config KEXEC
770 bool "Kexec system call (EXPERIMENTAL)"
771 depends on EXPERIMENTAL
772 help
773 kexec is a system call that implements the ability to shutdown your
774 current kernel, and to start another kernel. It is like a reboot
775 but it is indepedent of the system firmware. And like a reboot
776 you can start any kernel with it, not just Linux.
777
778 The name comes from the similiarity to the exec system call.
779
780 It is an ongoing process to be certain the hardware in a machine
781 is properly shutdown, so do not be surprised if this code does not
782 initially work for you. It may help to enable device hotplugging
783 support. As of this writing the exact hardware interface is
784 strongly in flux, so no good recommendation can be made.
785
769source "arch/mips/ddb5xxx/Kconfig" 786source "arch/mips/ddb5xxx/Kconfig"
770source "arch/mips/gt64120/ev64120/Kconfig" 787source "arch/mips/gt64120/ev64120/Kconfig"
771source "arch/mips/jazz/Kconfig" 788source "arch/mips/jazz/Kconfig"
@@ -864,8 +881,11 @@ config MIPS_NILE4
864config MIPS_DISABLE_OBSOLETE_IDE 881config MIPS_DISABLE_OBSOLETE_IDE
865 bool 882 bool
866 883
884config GENERIC_ISA_DMA_SUPPORT_BROKEN
885 bool
886
867# 887#
868# Endianess selection. Suffiently obscure so many users don't know what to 888# Endianess selection. Sufficiently obscure so many users don't know what to
869# answer,so we try hard to limit the available choices. Also the use of a 889# answer,so we try hard to limit the available choices. Also the use of a
870# choice statement should be more obvious to the user. 890# choice statement should be more obvious to the user.
871# 891#
@@ -874,7 +894,7 @@ choice
874 help 894 help
875 Some MIPS machines can be configured for either little or big endian 895 Some MIPS machines can be configured for either little or big endian
876 byte order. These modes require different kernels and a different 896 byte order. These modes require different kernels and a different
877 Linux distribution. In general there is one prefered byteorder for a 897 Linux distribution. In general there is one preferred byteorder for a
878 particular system but some systems are just as commonly used in the 898 particular system but some systems are just as commonly used in the
879 one or the other endianess. 899 one or the other endianess.
880 900
@@ -1633,9 +1653,6 @@ config ARCH_DISCONTIGMEM_ENABLE
1633 1653
1634config ARCH_SPARSEMEM_ENABLE 1654config ARCH_SPARSEMEM_ENABLE
1635 bool 1655 bool
1636
1637config ARCH_SPARSEMEM_ENABLE
1638 bool
1639 select SPARSEMEM_STATIC 1656 select SPARSEMEM_STATIC
1640 1657
1641config NUMA 1658config NUMA
@@ -1690,6 +1707,7 @@ config NR_CPUS
1690 depends on SMP 1707 depends on SMP
1691 default "64" if SGI_IP27 1708 default "64" if SGI_IP27
1692 default "2" 1709 default "2"
1710 default "8" if MIPS_MT_SMTC
1693 help 1711 help
1694 This allows you to specify the maximum number of CPUs which this 1712 This allows you to specify the maximum number of CPUs which this
1695 kernel will support. The maximum supported value is 32 for 32-bit 1713 kernel will support. The maximum supported value is 32 for 32-bit
@@ -1837,13 +1855,11 @@ source "drivers/pci/Kconfig"
1837config ISA 1855config ISA
1838 bool 1856 bool
1839 1857
1840config NO_ISA
1841 bool
1842
1843config EISA 1858config EISA
1844 bool "EISA support" 1859 bool "EISA support"
1845 depends on HW_HAS_EISA 1860 depends on HW_HAS_EISA
1846 select ISA 1861 select ISA
1862 select GENERIC_ISA_DMA
1847 ---help--- 1863 ---help---
1848 The Extended Industry Standard Architecture (EISA) bus was 1864 The Extended Industry Standard Architecture (EISA) bus was
1849 developed as an open alternative to the IBM MicroChannel bus. 1865 developed as an open alternative to the IBM MicroChannel bus.
diff --git a/arch/mips/au1000/common/dbdma.c b/arch/mips/au1000/common/dbdma.c
index c4fae8ff467..626de44bd88 100644
--- a/arch/mips/au1000/common/dbdma.c
+++ b/arch/mips/au1000/common/dbdma.c
@@ -849,7 +849,7 @@ au1xxx_dbdma_chan_free(u32 chanid)
849EXPORT_SYMBOL(au1xxx_dbdma_chan_free); 849EXPORT_SYMBOL(au1xxx_dbdma_chan_free);
850 850
851static irqreturn_t 851static irqreturn_t
852dbdma_interrupt(int irq, void *dev_id, struct pt_regs *regs) 852dbdma_interrupt(int irq, void *dev_id)
853{ 853{
854 u32 intstat; 854 u32 intstat;
855 u32 chan_index; 855 u32 chan_index;
diff --git a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c
index 2abe132bb07..9cf7b671583 100644
--- a/arch/mips/au1000/common/irq.c
+++ b/arch/mips/au1000/common/irq.c
@@ -70,7 +70,6 @@ extern irq_cpustat_t irq_stat [NR_CPUS];
70extern void mips_timer_interrupt(void); 70extern void mips_timer_interrupt(void);
71 71
72static void setup_local_irq(unsigned int irq, int type, int int_req); 72static void setup_local_irq(unsigned int irq, int type, int int_req);
73static unsigned int startup_irq(unsigned int irq);
74static void end_irq(unsigned int irq_nr); 73static void end_irq(unsigned int irq_nr);
75static inline void mask_and_ack_level_irq(unsigned int irq_nr); 74static inline void mask_and_ack_level_irq(unsigned int irq_nr);
76static inline void mask_and_ack_rise_edge_irq(unsigned int irq_nr); 75static inline void mask_and_ack_rise_edge_irq(unsigned int irq_nr);
@@ -84,20 +83,6 @@ void (*board_init_irq)(void);
84static DEFINE_SPINLOCK(irq_lock); 83static DEFINE_SPINLOCK(irq_lock);
85 84
86 85
87static unsigned int startup_irq(unsigned int irq_nr)
88{
89 local_enable_irq(irq_nr);
90 return 0;
91}
92
93
94static void shutdown_irq(unsigned int irq_nr)
95{
96 local_disable_irq(irq_nr);
97 return;
98}
99
100
101inline void local_enable_irq(unsigned int irq_nr) 86inline void local_enable_irq(unsigned int irq_nr)
102{ 87{
103 if (irq_nr > AU1000_LAST_INTC0_INT) { 88 if (irq_nr > AU1000_LAST_INTC0_INT) {
@@ -249,41 +234,37 @@ void restore_local_and_enable(int controller, unsigned long mask)
249 234
250static struct irq_chip rise_edge_irq_type = { 235static struct irq_chip rise_edge_irq_type = {
251 .typename = "Au1000 Rise Edge", 236 .typename = "Au1000 Rise Edge",
252 .startup = startup_irq,
253 .shutdown = shutdown_irq,
254 .enable = local_enable_irq,
255 .disable = local_disable_irq,
256 .ack = mask_and_ack_rise_edge_irq, 237 .ack = mask_and_ack_rise_edge_irq,
238 .mask = local_disable_irq,
239 .mask_ack = mask_and_ack_rise_edge_irq,
240 .unmask = local_enable_irq,
257 .end = end_irq, 241 .end = end_irq,
258}; 242};
259 243
260static struct irq_chip fall_edge_irq_type = { 244static struct irq_chip fall_edge_irq_type = {
261 .typename = "Au1000 Fall Edge", 245 .typename = "Au1000 Fall Edge",
262 .startup = startup_irq,
263 .shutdown = shutdown_irq,
264 .enable = local_enable_irq,
265 .disable = local_disable_irq,
266 .ack = mask_and_ack_fall_edge_irq, 246 .ack = mask_and_ack_fall_edge_irq,
247 .mask = local_disable_irq,
248 .mask_ack = mask_and_ack_fall_edge_irq,
249 .unmask = local_enable_irq,
267 .end = end_irq, 250 .end = end_irq,
268}; 251};
269 252
270static struct irq_chip either_edge_irq_type = { 253static struct irq_chip either_edge_irq_type = {
271 .typename = "Au1000 Rise or Fall Edge", 254 .typename = "Au1000 Rise or Fall Edge",
272 .startup = startup_irq,
273 .shutdown = shutdown_irq,
274 .enable = local_enable_irq,
275 .disable = local_disable_irq,
276 .ack = mask_and_ack_either_edge_irq, 255 .ack = mask_and_ack_either_edge_irq,
256 .mask = local_disable_irq,
257 .mask_ack = mask_and_ack_either_edge_irq,
258 .unmask = local_enable_irq,
277 .end = end_irq, 259 .end = end_irq,
278}; 260};
279 261
280static struct irq_chip level_irq_type = { 262static struct irq_chip level_irq_type = {
281 .typename = "Au1000 Level", 263 .typename = "Au1000 Level",
282 .startup = startup_irq,
283 .shutdown = shutdown_irq,
284 .enable = local_enable_irq,
285 .disable = local_disable_irq,
286 .ack = mask_and_ack_level_irq, 264 .ack = mask_and_ack_level_irq,
265 .mask = local_disable_irq,
266 .mask_ack = mask_and_ack_level_irq,
267 .unmask = local_enable_irq,
287 .end = end_irq, 268 .end = end_irq,
288}; 269};
289 270
@@ -328,31 +309,31 @@ static void setup_local_irq(unsigned int irq_nr, int type, int int_req)
328 au_writel(1<<(irq_nr-32), IC1_CFG2CLR); 309 au_writel(1<<(irq_nr-32), IC1_CFG2CLR);
329 au_writel(1<<(irq_nr-32), IC1_CFG1CLR); 310 au_writel(1<<(irq_nr-32), IC1_CFG1CLR);
330 au_writel(1<<(irq_nr-32), IC1_CFG0SET); 311 au_writel(1<<(irq_nr-32), IC1_CFG0SET);
331 irq_desc[irq_nr].chip = &rise_edge_irq_type; 312 set_irq_chip(irq_nr, &rise_edge_irq_type);
332 break; 313 break;
333 case INTC_INT_FALL_EDGE: /* 0:1:0 */ 314 case INTC_INT_FALL_EDGE: /* 0:1:0 */
334 au_writel(1<<(irq_nr-32), IC1_CFG2CLR); 315 au_writel(1<<(irq_nr-32), IC1_CFG2CLR);
335 au_writel(1<<(irq_nr-32), IC1_CFG1SET); 316 au_writel(1<<(irq_nr-32), IC1_CFG1SET);
336 au_writel(1<<(irq_nr-32), IC1_CFG0CLR); 317 au_writel(1<<(irq_nr-32), IC1_CFG0CLR);
337 irq_desc[irq_nr].chip = &fall_edge_irq_type; 318 set_irq_chip(irq_nr, &fall_edge_irq_type);
338 break; 319 break;
339 case INTC_INT_RISE_AND_FALL_EDGE: /* 0:1:1 */ 320 case INTC_INT_RISE_AND_FALL_EDGE: /* 0:1:1 */
340 au_writel(1<<(irq_nr-32), IC1_CFG2CLR); 321 au_writel(1<<(irq_nr-32), IC1_CFG2CLR);
341 au_writel(1<<(irq_nr-32), IC1_CFG1SET); 322 au_writel(1<<(irq_nr-32), IC1_CFG1SET);
342 au_writel(1<<(irq_nr-32), IC1_CFG0SET); 323 au_writel(1<<(irq_nr-32), IC1_CFG0SET);
343 irq_desc[irq_nr].chip = &either_edge_irq_type; 324 set_irq_chip(irq_nr, &either_edge_irq_type);
344 break; 325 break;
345 case INTC_INT_HIGH_LEVEL: /* 1:0:1 */ 326 case INTC_INT_HIGH_LEVEL: /* 1:0:1 */
346 au_writel(1<<(irq_nr-32), IC1_CFG2SET); 327 au_writel(1<<(irq_nr-32), IC1_CFG2SET);
347 au_writel(1<<(irq_nr-32), IC1_CFG1CLR); 328 au_writel(1<<(irq_nr-32), IC1_CFG1CLR);
348 au_writel(1<<(irq_nr-32), IC1_CFG0SET); 329 au_writel(1<<(irq_nr-32), IC1_CFG0SET);
349 irq_desc[irq_nr].chip = &level_irq_type; 330 set_irq_chip(irq_nr, &level_irq_type);
350 break; 331 break;
351 case INTC_INT_LOW_LEVEL: /* 1:1:0 */ 332 case INTC_INT_LOW_LEVEL: /* 1:1:0 */
352 au_writel(1<<(irq_nr-32), IC1_CFG2SET); 333 au_writel(1<<(irq_nr-32), IC1_CFG2SET);
353 au_writel(1<<(irq_nr-32), IC1_CFG1SET); 334 au_writel(1<<(irq_nr-32), IC1_CFG1SET);
354 au_writel(1<<(irq_nr-32), IC1_CFG0CLR); 335 au_writel(1<<(irq_nr-32), IC1_CFG0CLR);
355 irq_desc[irq_nr].chip = &level_irq_type; 336 set_irq_chip(irq_nr, &level_irq_type);
356 break; 337 break;
357 case INTC_INT_DISABLED: /* 0:0:0 */ 338 case INTC_INT_DISABLED: /* 0:0:0 */
358 au_writel(1<<(irq_nr-32), IC1_CFG0CLR); 339 au_writel(1<<(irq_nr-32), IC1_CFG0CLR);
@@ -380,31 +361,31 @@ static void setup_local_irq(unsigned int irq_nr, int type, int int_req)
380 au_writel(1<<irq_nr, IC0_CFG2CLR); 361 au_writel(1<<irq_nr, IC0_CFG2CLR);
381 au_writel(1<<irq_nr, IC0_CFG1CLR); 362 au_writel(1<<irq_nr, IC0_CFG1CLR);
382 au_writel(1<<irq_nr, IC0_CFG0SET); 363 au_writel(1<<irq_nr, IC0_CFG0SET);
383 irq_desc[irq_nr].chip = &rise_edge_irq_type; 364 set_irq_chip(irq_nr, &rise_edge_irq_type);
384 break; 365 break;
385 case INTC_INT_FALL_EDGE: /* 0:1:0 */ 366 case INTC_INT_FALL_EDGE: /* 0:1:0 */
386 au_writel(1<<irq_nr, IC0_CFG2CLR); 367 au_writel(1<<irq_nr, IC0_CFG2CLR);
387 au_writel(1<<irq_nr, IC0_CFG1SET); 368 au_writel(1<<irq_nr, IC0_CFG1SET);
388 au_writel(1<<irq_nr, IC0_CFG0CLR); 369 au_writel(1<<irq_nr, IC0_CFG0CLR);
389 irq_desc[irq_nr].chip = &fall_edge_irq_type; 370 set_irq_chip(irq_nr, &fall_edge_irq_type);
390 break; 371 break;
391 case INTC_INT_RISE_AND_FALL_EDGE: /* 0:1:1 */ 372 case INTC_INT_RISE_AND_FALL_EDGE: /* 0:1:1 */
392 au_writel(1<<irq_nr, IC0_CFG2CLR); 373 au_writel(1<<irq_nr, IC0_CFG2CLR);
393 au_writel(1<<irq_nr, IC0_CFG1SET); 374 au_writel(1<<irq_nr, IC0_CFG1SET);
394 au_writel(1<<irq_nr, IC0_CFG0SET); 375 au_writel(1<<irq_nr, IC0_CFG0SET);
395 irq_desc[irq_nr].chip = &either_edge_irq_type; 376 set_irq_chip(irq_nr, &either_edge_irq_type);
396 break; 377 break;
397 case INTC_INT_HIGH_LEVEL: /* 1:0:1 */ 378 case INTC_INT_HIGH_LEVEL: /* 1:0:1 */
398 au_writel(1<<irq_nr, IC0_CFG2SET); 379 au_writel(1<<irq_nr, IC0_CFG2SET);
399 au_writel(1<<irq_nr, IC0_CFG1CLR); 380 au_writel(1<<irq_nr, IC0_CFG1CLR);
400 au_writel(1<<irq_nr, IC0_CFG0SET); 381 au_writel(1<<irq_nr, IC0_CFG0SET);
401 irq_desc[irq_nr].chip = &level_irq_type; 382 set_irq_chip(irq_nr, &level_irq_type);
402 break; 383 break;
403 case INTC_INT_LOW_LEVEL: /* 1:1:0 */ 384 case INTC_INT_LOW_LEVEL: /* 1:1:0 */
404 au_writel(1<<irq_nr, IC0_CFG2SET); 385 au_writel(1<<irq_nr, IC0_CFG2SET);
405 au_writel(1<<irq_nr, IC0_CFG1SET); 386 au_writel(1<<irq_nr, IC0_CFG1SET);
406 au_writel(1<<irq_nr, IC0_CFG0CLR); 387 au_writel(1<<irq_nr, IC0_CFG0CLR);
407 irq_desc[irq_nr].chip = &level_irq_type; 388 set_irq_chip(irq_nr, &level_irq_type);
408 break; 389 break;
409 case INTC_INT_DISABLED: /* 0:0:0 */ 390 case INTC_INT_DISABLED: /* 0:0:0 */
410 au_writel(1<<irq_nr, IC0_CFG0CLR); 391 au_writel(1<<irq_nr, IC0_CFG0CLR);
diff --git a/arch/mips/au1000/common/prom.c b/arch/mips/au1000/common/prom.c
index b4b010a2fe3..6fce60af005 100644
--- a/arch/mips/au1000/common/prom.c
+++ b/arch/mips/au1000/common/prom.c
@@ -47,7 +47,7 @@ extern int prom_argc;
47extern char **prom_argv, **prom_envp; 47extern char **prom_argv, **prom_envp;
48 48
49 49
50char * prom_getcmdline(void) 50char * __init_or_module prom_getcmdline(void)
51{ 51{
52 return &(arcs_cmdline[0]); 52 return &(arcs_cmdline[0]);
53} 53}
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index 377ae0d8ff0..919172db560 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -43,7 +43,7 @@
43#include <asm/mach-au1x00/au1000.h> 43#include <asm/mach-au1x00/au1000.h>
44#include <asm/time.h> 44#include <asm/time.h>
45 45
46extern char * __init prom_getcmdline(void); 46extern char * prom_getcmdline(void);
47extern void __init board_setup(void); 47extern void __init board_setup(void);
48extern void au1000_restart(char *); 48extern void au1000_restart(char *);
49extern void au1000_halt(void); 49extern void au1000_halt(void);
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index 94f09194d63..fa1c62f0551 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -53,9 +53,6 @@ static unsigned long r4k_cur; /* What counter should be at next timer irq */
53int no_au1xxx_32khz; 53int no_au1xxx_32khz;
54extern int allow_au1k_wait; /* default off for CP0 Counter */ 54extern int allow_au1k_wait; /* default off for CP0 Counter */
55 55
56/* Cycle counter value at the previous timer interrupt.. */
57static unsigned int timerhi = 0, timerlo = 0;
58
59#ifdef CONFIG_PM 56#ifdef CONFIG_PM
60#if HZ < 100 || HZ > 1000 57#if HZ < 100 || HZ > 1000
61#error "unsupported HZ value! Must be in [100,1000]" 58#error "unsupported HZ value! Must be in [100,1000]"
@@ -82,7 +79,6 @@ unsigned long wtimer;
82void mips_timer_interrupt(void) 79void mips_timer_interrupt(void)
83{ 80{
84 int irq = 63; 81 int irq = 63;
85 unsigned long count;
86 82
87 irq_enter(); 83 irq_enter();
88 kstat_this_cpu.irqs[irq]++; 84 kstat_this_cpu.irqs[irq]++;
@@ -91,10 +87,6 @@ void mips_timer_interrupt(void)
91 goto null; 87 goto null;
92 88
93 do { 89 do {
94 count = read_c0_count();
95 timerhi += (count < timerlo); /* Wrap around */
96 timerlo = count;
97
98 kstat_this_cpu.irqs[irq]++; 90 kstat_this_cpu.irqs[irq]++;
99 do_timer(1); 91 do_timer(1);
100#ifndef CONFIG_SMP 92#ifndef CONFIG_SMP
@@ -231,7 +223,6 @@ wakeup_counter0_set(int ticks)
231 */ 223 */
232unsigned long cal_r4koff(void) 224unsigned long cal_r4koff(void)
233{ 225{
234 unsigned long count;
235 unsigned long cpu_speed; 226 unsigned long cpu_speed;
236 unsigned long flags; 227 unsigned long flags;
237 unsigned long counter; 228 unsigned long counter;
@@ -258,7 +249,7 @@ unsigned long cal_r4koff(void)
258 249
259#if defined(CONFIG_AU1000_USE32K) 250#if defined(CONFIG_AU1000_USE32K)
260 { 251 {
261 unsigned long start, end; 252 unsigned long start, end, count;
262 253
263 start = au_readl(SYS_RTCREAD); 254 start = au_readl(SYS_RTCREAD);
264 start += 2; 255 start += 2;
@@ -282,7 +273,6 @@ unsigned long cal_r4koff(void)
282#else 273#else
283 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * 274 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) *
284 AU1000_SRC_CLK; 275 AU1000_SRC_CLK;
285 count = cpu_speed / 2;
286#endif 276#endif
287 } 277 }
288 else { 278 else {
@@ -291,98 +281,15 @@ unsigned long cal_r4koff(void)
291 * NOTE: some old silicon doesn't allow reading the PLL. 281 * NOTE: some old silicon doesn't allow reading the PLL.
292 */ 282 */
293 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * AU1000_SRC_CLK; 283 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * AU1000_SRC_CLK;
294 count = cpu_speed / 2;
295 no_au1xxx_32khz = 1; 284 no_au1xxx_32khz = 1;
296 } 285 }
297 mips_hpt_frequency = count; 286 mips_hpt_frequency = cpu_speed;
298 // Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16) 287 // Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16)
299 set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2) * 16)); 288 set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2) * 16));
300 spin_unlock_irqrestore(&time_lock, flags); 289 spin_unlock_irqrestore(&time_lock, flags);
301 return (cpu_speed / HZ); 290 return (cpu_speed / HZ);
302} 291}
303 292
304/* This is for machines which generate the exact clock. */
305#define USECS_PER_JIFFY (1000000/HZ)
306#define USECS_PER_JIFFY_FRAC (0x100000000LL*1000000/HZ&0xffffffff)
307
308static unsigned long
309div64_32(unsigned long v1, unsigned long v2, unsigned long v3)
310{
311 unsigned long r0;
312 do_div64_32(r0, v1, v2, v3);
313 return r0;
314}
315
316static unsigned long do_fast_cp0_gettimeoffset(void)
317{
318 u32 count;
319 unsigned long res, tmp;
320 unsigned long r0;
321
322 /* Last jiffy when do_fast_gettimeoffset() was called. */
323 static unsigned long last_jiffies=0;
324 unsigned long quotient;
325
326 /*
327 * Cached "1/(clocks per usec)*2^32" value.
328 * It has to be recalculated once each jiffy.
329 */
330 static unsigned long cached_quotient=0;
331
332 tmp = jiffies;
333
334 quotient = cached_quotient;
335
336 if (tmp && last_jiffies != tmp) {
337 last_jiffies = tmp;
338 if (last_jiffies != 0) {
339 r0 = div64_32(timerhi, timerlo, tmp);
340 quotient = div64_32(USECS_PER_JIFFY, USECS_PER_JIFFY_FRAC, r0);
341 cached_quotient = quotient;
342 }
343 }
344
345 /* Get last timer tick in absolute kernel time */
346 count = read_c0_count();
347
348 /* .. relative to previous jiffy (32 bits is enough) */
349 count -= timerlo;
350
351 __asm__("multu\t%1,%2\n\t"
352 "mfhi\t%0"
353 : "=r" (res)
354 : "r" (count), "r" (quotient)
355 : "hi", "lo", GCC_REG_ACCUM);
356
357 /*
358 * Due to possible jiffies inconsistencies, we need to check
359 * the result so that we'll get a timer that is monotonic.
360 */
361 if (res >= USECS_PER_JIFFY)
362 res = USECS_PER_JIFFY-1;
363
364 return res;
365}
366
367#ifdef CONFIG_PM
368static unsigned long do_fast_pm_gettimeoffset(void)
369{
370 unsigned long pc0;
371 unsigned long offset;
372
373 pc0 = au_readl(SYS_TOYREAD);
374 au_sync();
375 offset = pc0 - last_pc0;
376 if (offset > 2*MATCH20_INC) {
377 printk("huge offset %x, last_pc0 %x last_match20 %x pc0 %x\n",
378 (unsigned)offset, (unsigned)last_pc0,
379 (unsigned)last_match20, (unsigned)pc0);
380 }
381 offset = (unsigned long)((offset * 305) / 10);
382 return offset;
383}
384#endif
385
386void __init plat_timer_setup(struct irqaction *irq) 293void __init plat_timer_setup(struct irqaction *irq)
387{ 294{
388 unsigned int est_freq; 295 unsigned int est_freq;
@@ -420,7 +327,6 @@ void __init plat_timer_setup(struct irqaction *irq)
420 unsigned int c0_status; 327 unsigned int c0_status;
421 328
422 printk("WARNING: no 32KHz clock found.\n"); 329 printk("WARNING: no 32KHz clock found.\n");
423 do_gettimeoffset = do_fast_cp0_gettimeoffset;
424 330
425 /* Ensure we get CPO_COUNTER interrupts. 331 /* Ensure we get CPO_COUNTER interrupts.
426 */ 332 */
@@ -445,19 +351,11 @@ void __init plat_timer_setup(struct irqaction *irq)
445 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20); 351 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
446 startup_match20_interrupt(counter0_irq); 352 startup_match20_interrupt(counter0_irq);
447 353
448 do_gettimeoffset = do_fast_pm_gettimeoffset;
449
450 /* We can use the real 'wait' instruction. 354 /* We can use the real 'wait' instruction.
451 */ 355 */
452 allow_au1k_wait = 1; 356 allow_au1k_wait = 1;
453 } 357 }
454 358
455#else
456 /* We have to do this here instead of in timer_init because
457 * the generic code in arch/mips/kernel/time.c will write
458 * over our function pointer.
459 */
460 do_gettimeoffset = do_fast_cp0_gettimeoffset;
461#endif 359#endif
462} 360}
463 361
diff --git a/arch/mips/au1000/pb1200/board_setup.c b/arch/mips/au1000/pb1200/board_setup.c
index 8b953b9fc25..043302b7fe5 100644
--- a/arch/mips/au1000/pb1200/board_setup.c
+++ b/arch/mips/au1000/pb1200/board_setup.c
@@ -55,7 +55,7 @@
55#endif 55#endif
56 56
57extern void _board_init_irq(void); 57extern void _board_init_irq(void);
58extern void (*board_init_irq)(void); 58extern void (*board_init_irq)(void);
59 59
60void board_reset (void) 60void board_reset (void)
61{ 61{
@@ -151,11 +151,7 @@ void __init board_setup(void)
151#endif 151#endif
152 152
153 /* Setup Pb1200 External Interrupt Controller */ 153 /* Setup Pb1200 External Interrupt Controller */
154 { 154 board_init_irq = _board_init_irq;
155 extern void (*board_init_irq)(void);
156 extern void _board_init_irq(void);
157 board_init_irq = _board_init_irq;
158 }
159} 155}
160 156
161int 157int
diff --git a/arch/mips/cobalt/irq.c b/arch/mips/cobalt/irq.c
index 82e569d5b02..4c46f0e7378 100644
--- a/arch/mips/cobalt/irq.c
+++ b/arch/mips/cobalt/irq.c
@@ -45,25 +45,22 @@ static inline void galileo_irq(void)
45{ 45{
46 unsigned int mask, pending, devfn; 46 unsigned int mask, pending, devfn;
47 47
48 mask = GALILEO_INL(GT_INTRMASK_OFS); 48 mask = GT_READ(GT_INTRMASK_OFS);
49 pending = GALILEO_INL(GT_INTRCAUSE_OFS) & mask; 49 pending = GT_READ(GT_INTRCAUSE_OFS) & mask;
50 50
51 if (pending & GALILEO_INTR_T0EXP) { 51 if (pending & GT_INTR_T0EXP_MSK) {
52 52 GT_WRITE(GT_INTRCAUSE_OFS, ~GT_INTR_T0EXP_MSK);
53 GALILEO_OUTL(~GALILEO_INTR_T0EXP, GT_INTRCAUSE_OFS);
54 do_IRQ(COBALT_GALILEO_IRQ); 53 do_IRQ(COBALT_GALILEO_IRQ);
55 54 } else if (pending & GT_INTR_RETRYCTR0_MSK) {
56 } else if (pending & GALILEO_INTR_RETRY_CTR) { 55 devfn = GT_READ(GT_PCI0_CFGADDR_OFS) >> 8;
57 56 GT_WRITE(GT_INTRCAUSE_OFS, ~GT_INTR_RETRYCTR0_MSK);
58 devfn = GALILEO_INL(GT_PCI0_CFGADDR_OFS) >> 8; 57 printk(KERN_WARNING
59 GALILEO_OUTL(~GALILEO_INTR_RETRY_CTR, GT_INTRCAUSE_OFS); 58 "Galileo: PCI retry count exceeded (%02x.%u)\n",
60 printk(KERN_WARNING "Galileo: PCI retry count exceeded (%02x.%u)\n", 59 PCI_SLOT(devfn), PCI_FUNC(devfn));
61 PCI_SLOT(devfn), PCI_FUNC(devfn));
62
63 } else { 60 } else {
64 61 GT_WRITE(GT_INTRMASK_OFS, mask & ~pending);
65 GALILEO_OUTL(mask & ~pending, GT_INTRMASK_OFS); 62 printk(KERN_WARNING
66 printk(KERN_WARNING "Galileo: masking unexpected interrupt %08x\n", pending); 63 "Galileo: masking unexpected interrupt %08x\n", pending);
67 } 64 }
68} 65}
69 66
@@ -104,7 +101,7 @@ void __init arch_init_irq(void)
104 * Mask all Galileo interrupts. The Galileo 101 * Mask all Galileo interrupts. The Galileo
105 * handler is set in cobalt_timer_setup() 102 * handler is set in cobalt_timer_setup()
106 */ 103 */
107 GALILEO_OUTL(0, GT_INTRMASK_OFS); 104 GT_WRITE(GT_INTRMASK_OFS, 0);
108 105
109 init_i8259_irqs(); /* 0 ... 15 */ 106 init_i8259_irqs(); /* 0 ... 15 */
110 mips_cpu_irq_init(COBALT_CPU_IRQ); /* 16 ... 23 */ 107 mips_cpu_irq_init(COBALT_CPU_IRQ); /* 16 ... 23 */
diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c
index bf9dc72b972..e8f0f20b852 100644
--- a/arch/mips/cobalt/setup.c
+++ b/arch/mips/cobalt/setup.c
@@ -51,23 +51,23 @@ const char *get_system_type(void)
51void __init plat_timer_setup(struct irqaction *irq) 51void __init plat_timer_setup(struct irqaction *irq)
52{ 52{
53 /* Load timer value for HZ (TCLK is 50MHz) */ 53 /* Load timer value for HZ (TCLK is 50MHz) */
54 GALILEO_OUTL(50*1000*1000 / HZ, GT_TC0_OFS); 54 GT_WRITE(GT_TC0_OFS, 50*1000*1000 / HZ);
55 55
56 /* Enable timer */ 56 /* Enable timer */
57 GALILEO_OUTL(GALILEO_ENTC0 | GALILEO_SELTC0, GT_TC_CONTROL_OFS); 57 GT_WRITE(GT_TC_CONTROL_OFS, GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK);
58 58
59 /* Register interrupt */ 59 /* Register interrupt */
60 setup_irq(COBALT_GALILEO_IRQ, irq); 60 setup_irq(COBALT_GALILEO_IRQ, irq);
61 61
62 /* Enable interrupt */ 62 /* Enable interrupt */
63 GALILEO_OUTL(GALILEO_INTR_T0EXP | GALILEO_INL(GT_INTRMASK_OFS), GT_INTRMASK_OFS); 63 GT_WRITE(GT_INTRMASK_OFS, GT_INTR_T0EXP_MSK | GT_READ(GT_INTRMASK_OFS));
64} 64}
65 65
66extern struct pci_ops gt64111_pci_ops; 66extern struct pci_ops gt64111_pci_ops;
67 67
68static struct resource cobalt_mem_resource = { 68static struct resource cobalt_mem_resource = {
69 .start = GT64111_MEM_BASE, 69 .start = GT_DEF_PCI0_MEM0_BASE,
70 .end = GT64111_MEM_END, 70 .end = GT_DEF_PCI0_MEM0_BASE + GT_DEF_PCI0_MEM0_SIZE - 1,
71 .name = "PCI memory", 71 .name = "PCI memory",
72 .flags = IORESOURCE_MEM 72 .flags = IORESOURCE_MEM
73}; 73};
@@ -115,7 +115,7 @@ static struct pci_controller cobalt_pci_controller = {
115 .mem_resource = &cobalt_mem_resource, 115 .mem_resource = &cobalt_mem_resource,
116 .mem_offset = 0, 116 .mem_offset = 0,
117 .io_resource = &cobalt_io_resource, 117 .io_resource = &cobalt_io_resource,
118 .io_offset = 0 - GT64111_IO_BASE 118 .io_offset = 0 - GT_DEF_PCI0_IO_BASE,
119}; 119};
120 120
121void __init plat_mem_setup(void) 121void __init plat_mem_setup(void)
@@ -128,7 +128,7 @@ void __init plat_mem_setup(void)
128 _machine_halt = cobalt_machine_halt; 128 _machine_halt = cobalt_machine_halt;
129 pm_power_off = cobalt_machine_power_off; 129 pm_power_off = cobalt_machine_power_off;
130 130
131 set_io_port_base(CKSEG1ADDR(GT64111_IO_BASE)); 131 set_io_port_base(CKSEG1ADDR(GT_DEF_PCI0_IO_BASE));
132 132
133 /* I/O port resource must include UART and LCD/buttons */ 133 /* I/O port resource must include UART and LCD/buttons */
134 ioport_resource.end = 0x0fffffff; 134 ioport_resource.end = 0x0fffffff;
@@ -139,7 +139,7 @@ void __init plat_mem_setup(void)
139 139
140 /* Read the cobalt id register out of the PCI config space */ 140 /* Read the cobalt id register out of the PCI config space */
141 PCI_CFG_SET(devfn, (VIA_COBALT_BRD_ID_REG & ~0x3)); 141 PCI_CFG_SET(devfn, (VIA_COBALT_BRD_ID_REG & ~0x3));
142 cobalt_board_id = GALILEO_INL(GT_PCI0_CFGDATA_OFS); 142 cobalt_board_id = GT_READ(GT_PCI0_CFGDATA_OFS);
143 cobalt_board_id >>= ((VIA_COBALT_BRD_ID_REG & 3) * 8); 143 cobalt_board_id >>= ((VIA_COBALT_BRD_ID_REG & 3) * 8);
144 cobalt_board_id = VIA_COBALT_BRD_REG_to_ID(cobalt_board_id); 144 cobalt_board_id = VIA_COBALT_BRD_REG_to_ID(cobalt_board_id);
145 145
diff --git a/arch/mips/configs/pnx8550-jbs_defconfig b/arch/mips/configs/pnx8550-jbs_defconfig
index 26b0b988349..280a8001eac 100644
--- a/arch/mips/configs/pnx8550-jbs_defconfig
+++ b/arch/mips/configs/pnx8550-jbs_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.18-rc1 3# Linux kernel version: 2.6.19-rc2
4# Thu Jul 6 10:04:18 2006 4# Sat Oct 14 23:01:16 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -25,8 +25,6 @@ CONFIG_MIPS=y
25# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
26# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
27# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
28# CONFIG_MIPS_IVR is not set
29# CONFIG_MIPS_ITE8172 is not set
30# CONFIG_MACH_JAZZ is not set 28# CONFIG_MACH_JAZZ is not set
31# CONFIG_LASAT is not set 29# CONFIG_LASAT is not set
32# CONFIG_MIPS_ATLAS is not set 30# CONFIG_MIPS_ATLAS is not set
@@ -41,13 +39,13 @@ CONFIG_MIPS=y
41# CONFIG_MOMENCO_OCELOT_G is not set 39# CONFIG_MOMENCO_OCELOT_G is not set
42# CONFIG_MIPS_XXS1500 is not set 40# CONFIG_MIPS_XXS1500 is not set
43# CONFIG_PNX8550_V2PCI is not set 41# CONFIG_PNX8550_V2PCI is not set
44# CONFIG_PNX8550_JBS is not set 42CONFIG_PNX8550_JBS=y
45# CONFIG_DDB5477 is not set 43# CONFIG_DDB5477 is not set
46# CONFIG_MACH_VR41XX is not set 44# CONFIG_MACH_VR41XX is not set
47# CONFIG_PMC_YOSEMITE is not set 45# CONFIG_PMC_YOSEMITE is not set
48# CONFIG_QEMU is not set 46# CONFIG_QEMU is not set
49# CONFIG_MARKEINS is not set 47# CONFIG_MARKEINS is not set
50CONFIG_SGI_IP22=y 48# CONFIG_SGI_IP22 is not set
51# CONFIG_SGI_IP27 is not set 49# CONFIG_SGI_IP27 is not set
52# CONFIG_SGI_IP32 is not set 50# CONFIG_SGI_IP32 is not set
53# CONFIG_SIBYTE_BIGSUR is not set 51# CONFIG_SIBYTE_BIGSUR is not set
@@ -67,25 +65,21 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y 65CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y 66CONFIG_GENERIC_HWEIGHT=y
69CONFIG_GENERIC_CALIBRATE_DELAY=y 67CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_GENERIC_TIME=y
70CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 69CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
71CONFIG_ARC=y
72CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
73CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
74CONFIG_CPU_BIG_ENDIAN=y 72# CONFIG_CPU_BIG_ENDIAN is not set
75# CONFIG_CPU_LITTLE_ENDIAN is not set 73CONFIG_CPU_LITTLE_ENDIAN=y
76CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y 74CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
77CONFIG_IRQ_CPU=y 75CONFIG_PNX8550=y
78CONFIG_SWAP_IO_SPACE=y 76CONFIG_SOC_PNX8550=y
79CONFIG_ARC32=y
80CONFIG_BOOT_ELF32=y
81CONFIG_MIPS_L1_CACHE_SHIFT=5 77CONFIG_MIPS_L1_CACHE_SHIFT=5
82# CONFIG_ARC_CONSOLE is not set
83CONFIG_ARC_PROMLIB=y
84 78
85# 79#
86# CPU selection 80# CPU selection
87# 81#
88# CONFIG_CPU_MIPS32_R1 is not set 82CONFIG_CPU_MIPS32_R1=y
89# CONFIG_CPU_MIPS32_R2 is not set 83# CONFIG_CPU_MIPS32_R2 is not set
90# CONFIG_CPU_MIPS64_R1 is not set 84# CONFIG_CPU_MIPS64_R1 is not set
91# CONFIG_CPU_MIPS64_R2 is not set 85# CONFIG_CPU_MIPS64_R2 is not set
@@ -93,7 +87,7 @@ CONFIG_ARC_PROMLIB=y
93# CONFIG_CPU_TX39XX is not set 87# CONFIG_CPU_TX39XX is not set
94# CONFIG_CPU_VR41XX is not set 88# CONFIG_CPU_VR41XX is not set
95# CONFIG_CPU_R4300 is not set 89# CONFIG_CPU_R4300 is not set
96CONFIG_CPU_R4X00=y 90# CONFIG_CPU_R4X00 is not set
97# CONFIG_CPU_TX49XX is not set 91# CONFIG_CPU_TX49XX is not set
98# CONFIG_CPU_R5000 is not set 92# CONFIG_CPU_R5000 is not set
99# CONFIG_CPU_R5432 is not set 93# CONFIG_CPU_R5432 is not set
@@ -104,12 +98,11 @@ CONFIG_CPU_R4X00=y
104# CONFIG_CPU_RM7000 is not set 98# CONFIG_CPU_RM7000 is not set
105# CONFIG_CPU_RM9000 is not set 99# CONFIG_CPU_RM9000 is not set
106# CONFIG_CPU_SB1 is not set 100# CONFIG_CPU_SB1 is not set
107CONFIG_SYS_HAS_CPU_R4X00=y 101CONFIG_SYS_HAS_CPU_MIPS32_R1=y
108CONFIG_SYS_HAS_CPU_R5000=y 102CONFIG_CPU_MIPS32=y
103CONFIG_CPU_MIPSR1=y
109CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 104CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
110CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
111CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 105CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
112CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
113 106
114# 107#
115# Kernel type 108# Kernel type
@@ -120,17 +113,17 @@ CONFIG_PAGE_SIZE_4KB=y
120# CONFIG_PAGE_SIZE_8KB is not set 113# CONFIG_PAGE_SIZE_8KB is not set
121# CONFIG_PAGE_SIZE_16KB is not set 114# CONFIG_PAGE_SIZE_16KB is not set
122# CONFIG_PAGE_SIZE_64KB is not set 115# CONFIG_PAGE_SIZE_64KB is not set
123CONFIG_BOARD_SCACHE=y 116CONFIG_CPU_HAS_PREFETCH=y
124CONFIG_IP22_CPU_SCACHE=y
125CONFIG_MIPS_MT_DISABLED=y 117CONFIG_MIPS_MT_DISABLED=y
126# CONFIG_MIPS_MT_SMTC is not set
127# CONFIG_MIPS_MT_SMP is not set 118# CONFIG_MIPS_MT_SMP is not set
119# CONFIG_MIPS_MT_SMTC is not set
128# CONFIG_MIPS_VPE_LOADER is not set 120# CONFIG_MIPS_VPE_LOADER is not set
129# CONFIG_64BIT_PHYS_ADDR is not set 121# CONFIG_64BIT_PHYS_ADDR is not set
130CONFIG_CPU_HAS_LLSC=y 122CONFIG_CPU_HAS_LLSC=y
131CONFIG_CPU_HAS_SYNC=y 123CONFIG_CPU_HAS_SYNC=y
132CONFIG_GENERIC_HARDIRQS=y 124CONFIG_GENERIC_HARDIRQS=y
133CONFIG_GENERIC_IRQ_PROBE=y 125CONFIG_GENERIC_IRQ_PROBE=y
126CONFIG_CPU_SUPPORTS_HIGHMEM=y
134CONFIG_ARCH_FLATMEM_ENABLE=y 127CONFIG_ARCH_FLATMEM_ENABLE=y
135CONFIG_SELECT_MEMORY_MODEL=y 128CONFIG_SELECT_MEMORY_MODEL=y
136CONFIG_FLATMEM_MANUAL=y 129CONFIG_FLATMEM_MANUAL=y
@@ -144,12 +137,12 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
144# CONFIG_HZ_48 is not set 137# CONFIG_HZ_48 is not set
145# CONFIG_HZ_100 is not set 138# CONFIG_HZ_100 is not set
146# CONFIG_HZ_128 is not set 139# CONFIG_HZ_128 is not set
147# CONFIG_HZ_250 is not set 140CONFIG_HZ_250=y
148# CONFIG_HZ_256 is not set 141# CONFIG_HZ_256 is not set
149CONFIG_HZ_1000=y 142# CONFIG_HZ_1000 is not set
150# CONFIG_HZ_1024 is not set 143# CONFIG_HZ_1024 is not set
151CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 144CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
152CONFIG_HZ=1000 145CONFIG_HZ=250
153CONFIG_PREEMPT_NONE=y 146CONFIG_PREEMPT_NONE=y
154# CONFIG_PREEMPT_VOLUNTARY is not set 147# CONFIG_PREEMPT_VOLUNTARY is not set
155# CONFIG_PREEMPT is not set 148# CONFIG_PREEMPT is not set
@@ -171,16 +164,20 @@ CONFIG_LOCALVERSION=""
171CONFIG_LOCALVERSION_AUTO=y 164CONFIG_LOCALVERSION_AUTO=y
172CONFIG_SWAP=y 165CONFIG_SWAP=y
173CONFIG_SYSVIPC=y 166CONFIG_SYSVIPC=y
167# CONFIG_IPC_NS is not set
174# CONFIG_POSIX_MQUEUE is not set 168# CONFIG_POSIX_MQUEUE is not set
175# CONFIG_BSD_PROCESS_ACCT is not set 169# CONFIG_BSD_PROCESS_ACCT is not set
176CONFIG_SYSCTL=y 170# CONFIG_TASKSTATS is not set
171# CONFIG_UTS_NS is not set
177# CONFIG_AUDIT is not set 172# CONFIG_AUDIT is not set
178CONFIG_IKCONFIG=y 173CONFIG_IKCONFIG=y
179CONFIG_IKCONFIG_PROC=y 174CONFIG_IKCONFIG_PROC=y
180# CONFIG_RELAY is not set 175# CONFIG_RELAY is not set
181CONFIG_INITRAMFS_SOURCE="" 176CONFIG_INITRAMFS_SOURCE=""
182# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 177# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
178CONFIG_SYSCTL=y
183CONFIG_EMBEDDED=y 179CONFIG_EMBEDDED=y
180# CONFIG_SYSCTL_SYSCALL is not set
184CONFIG_KALLSYMS=y 181CONFIG_KALLSYMS=y
185# CONFIG_KALLSYMS_ALL is not set 182# CONFIG_KALLSYMS_ALL is not set
186# CONFIG_KALLSYMS_EXTRA_PASS is not set 183# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -189,12 +186,12 @@ CONFIG_PRINTK=y
189CONFIG_BUG=y 186CONFIG_BUG=y
190CONFIG_ELF_CORE=y 187CONFIG_ELF_CORE=y
191CONFIG_BASE_FULL=y 188CONFIG_BASE_FULL=y
192CONFIG_RT_MUTEXES=y
193CONFIG_FUTEX=y 189CONFIG_FUTEX=y
194CONFIG_EPOLL=y 190CONFIG_EPOLL=y
195CONFIG_SHMEM=y 191CONFIG_SHMEM=y
196CONFIG_SLAB=y 192CONFIG_SLAB=y
197CONFIG_VM_EVENT_COUNTERS=y 193CONFIG_VM_EVENT_COUNTERS=y
194CONFIG_RT_MUTEXES=y
198# CONFIG_TINY_SHMEM is not set 195# CONFIG_TINY_SHMEM is not set
199CONFIG_BASE_SMALL=0 196CONFIG_BASE_SMALL=0
200# CONFIG_SLOB is not set 197# CONFIG_SLOB is not set
@@ -211,6 +208,7 @@ CONFIG_KMOD=y
211# 208#
212# Block layer 209# Block layer
213# 210#
211CONFIG_BLOCK=y
214# CONFIG_LBD is not set 212# CONFIG_LBD is not set
215# CONFIG_BLK_DEV_IO_TRACE is not set 213# CONFIG_BLK_DEV_IO_TRACE is not set
216# CONFIG_LSF is not set 214# CONFIG_LSF is not set
@@ -231,8 +229,10 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
231# 229#
232# Bus options (PCI, PCMCIA, EISA, ISA, TC) 230# Bus options (PCI, PCMCIA, EISA, ISA, TC)
233# 231#
234CONFIG_HW_HAS_EISA=y 232CONFIG_HW_HAS_PCI=y
235# CONFIG_EISA is not set 233CONFIG_PCI=y
234# CONFIG_PCI_MULTITHREAD_PROBE is not set
235# CONFIG_PCI_DEBUG is not set
236CONFIG_MMU=y 236CONFIG_MMU=y
237 237
238# 238#
@@ -243,6 +243,7 @@ CONFIG_MMU=y
243# 243#
244# PCI Hotplug Support 244# PCI Hotplug Support
245# 245#
246# CONFIG_HOTPLUG_PCI is not set
246 247
247# 248#
248# Executable file formats 249# Executable file formats
@@ -265,6 +266,7 @@ CONFIG_PACKET=y
265CONFIG_UNIX=y 266CONFIG_UNIX=y
266CONFIG_XFRM=y 267CONFIG_XFRM=y
267# CONFIG_XFRM_USER is not set 268# CONFIG_XFRM_USER is not set
269# CONFIG_XFRM_SUB_POLICY is not set
268# CONFIG_NET_KEY is not set 270# CONFIG_NET_KEY is not set
269CONFIG_INET=y 271CONFIG_INET=y
270# CONFIG_IP_MULTICAST is not set 272# CONFIG_IP_MULTICAST is not set
@@ -283,16 +285,18 @@ CONFIG_IP_PNP_BOOTP=y
283# CONFIG_INET_IPCOMP is not set 285# CONFIG_INET_IPCOMP is not set
284# CONFIG_INET_XFRM_TUNNEL is not set 286# CONFIG_INET_XFRM_TUNNEL is not set
285# CONFIG_INET_TUNNEL is not set 287# CONFIG_INET_TUNNEL is not set
286CONFIG_INET_XFRM_MODE_TRANSPORT=m 288CONFIG_INET_XFRM_MODE_TRANSPORT=y
287CONFIG_INET_XFRM_MODE_TUNNEL=m 289CONFIG_INET_XFRM_MODE_TUNNEL=y
290CONFIG_INET_XFRM_MODE_BEET=y
288CONFIG_INET_DIAG=y 291CONFIG_INET_DIAG=y
289CONFIG_INET_TCP_DIAG=y 292CONFIG_INET_TCP_DIAG=y
290# CONFIG_TCP_CONG_ADVANCED is not set 293# CONFIG_TCP_CONG_ADVANCED is not set
291CONFIG_TCP_CONG_BIC=y 294CONFIG_TCP_CONG_CUBIC=y
295CONFIG_DEFAULT_TCP_CONG="cubic"
292# CONFIG_IPV6 is not set 296# CONFIG_IPV6 is not set
293# CONFIG_INET6_XFRM_TUNNEL is not set 297# CONFIG_INET6_XFRM_TUNNEL is not set
294# CONFIG_INET6_TUNNEL is not set 298# CONFIG_INET6_TUNNEL is not set
295CONFIG_NETWORK_SECMARK=y 299# CONFIG_NETWORK_SECMARK is not set
296# CONFIG_NETFILTER is not set 300# CONFIG_NETFILTER is not set
297 301
298# 302#
@@ -318,7 +322,6 @@ CONFIG_NETWORK_SECMARK=y
318# CONFIG_ATALK is not set 322# CONFIG_ATALK is not set
319# CONFIG_X25 is not set 323# CONFIG_X25 is not set
320# CONFIG_LAPB is not set 324# CONFIG_LAPB is not set
321# CONFIG_NET_DIVERT is not set
322# CONFIG_ECONET is not set 325# CONFIG_ECONET is not set
323# CONFIG_WAN_ROUTER is not set 326# CONFIG_WAN_ROUTER is not set
324 327
@@ -371,13 +374,20 @@ CONFIG_FW_LOADER=y
371# 374#
372# Block devices 375# Block devices
373# 376#
377# CONFIG_BLK_CPQ_DA is not set
378# CONFIG_BLK_CPQ_CISS_DA is not set
379# CONFIG_BLK_DEV_DAC960 is not set
380# CONFIG_BLK_DEV_UMEM is not set
374# CONFIG_BLK_DEV_COW_COMMON is not set 381# CONFIG_BLK_DEV_COW_COMMON is not set
375CONFIG_BLK_DEV_LOOP=y 382CONFIG_BLK_DEV_LOOP=y
376# CONFIG_BLK_DEV_CRYPTOLOOP is not set 383# CONFIG_BLK_DEV_CRYPTOLOOP is not set
377# CONFIG_BLK_DEV_NBD is not set 384# CONFIG_BLK_DEV_NBD is not set
385# CONFIG_BLK_DEV_SX8 is not set
386# CONFIG_BLK_DEV_UB is not set
378CONFIG_BLK_DEV_RAM=y 387CONFIG_BLK_DEV_RAM=y
379CONFIG_BLK_DEV_RAM_COUNT=16 388CONFIG_BLK_DEV_RAM_COUNT=16
380CONFIG_BLK_DEV_RAM_SIZE=8192 389CONFIG_BLK_DEV_RAM_SIZE=8192
390CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
381CONFIG_BLK_DEV_INITRD=y 391CONFIG_BLK_DEV_INITRD=y
382# CONFIG_CDROM_PKTCDVD is not set 392# CONFIG_CDROM_PKTCDVD is not set
383# CONFIG_ATA_OVER_ETH is not set 393# CONFIG_ATA_OVER_ETH is not set
@@ -386,6 +396,7 @@ CONFIG_BLK_DEV_INITRD=y
386# ATA/ATAPI/MFM/RLL support 396# ATA/ATAPI/MFM/RLL support
387# 397#
388CONFIG_IDE=y 398CONFIG_IDE=y
399CONFIG_IDE_MAX_HWIFS=4
389CONFIG_BLK_DEV_IDE=y 400CONFIG_BLK_DEV_IDE=y
390 401
391# 402#
@@ -404,8 +415,39 @@ CONFIG_BLK_DEV_IDESCSI=y
404# IDE chipset support/bugfixes 415# IDE chipset support/bugfixes
405# 416#
406CONFIG_IDE_GENERIC=y 417CONFIG_IDE_GENERIC=y
418CONFIG_BLK_DEV_IDEPCI=y
419CONFIG_IDEPCI_SHARE_IRQ=y
420CONFIG_BLK_DEV_OFFBOARD=y
421CONFIG_BLK_DEV_GENERIC=y
422# CONFIG_BLK_DEV_OPTI621 is not set
423CONFIG_BLK_DEV_IDEDMA_PCI=y
424# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
425# CONFIG_IDEDMA_PCI_AUTO is not set
426# CONFIG_BLK_DEV_AEC62XX is not set
427# CONFIG_BLK_DEV_ALI15X3 is not set
428# CONFIG_BLK_DEV_AMD74XX is not set
429# CONFIG_BLK_DEV_CMD64X is not set
430# CONFIG_BLK_DEV_TRIFLEX is not set
431# CONFIG_BLK_DEV_CY82C693 is not set
432# CONFIG_BLK_DEV_CS5520 is not set
433# CONFIG_BLK_DEV_CS5530 is not set
434# CONFIG_BLK_DEV_HPT34X is not set
435CONFIG_BLK_DEV_HPT366=y
436# CONFIG_BLK_DEV_JMICRON is not set
437# CONFIG_BLK_DEV_SC1200 is not set
438# CONFIG_BLK_DEV_PIIX is not set
439# CONFIG_BLK_DEV_IT821X is not set
440# CONFIG_BLK_DEV_NS87415 is not set
441# CONFIG_BLK_DEV_PDC202XX_OLD is not set
442# CONFIG_BLK_DEV_PDC202XX_NEW is not set
443# CONFIG_BLK_DEV_SVWKS is not set
444# CONFIG_BLK_DEV_SIIMAGE is not set
445# CONFIG_BLK_DEV_SLC90E66 is not set
446# CONFIG_BLK_DEV_TRM290 is not set
447# CONFIG_BLK_DEV_VIA82CXXX is not set
407# CONFIG_IDE_ARM is not set 448# CONFIG_IDE_ARM is not set
408# CONFIG_BLK_DEV_IDEDMA is not set 449CONFIG_BLK_DEV_IDEDMA=y
450# CONFIG_IDEDMA_IVB is not set
409# CONFIG_IDEDMA_AUTO is not set 451# CONFIG_IDEDMA_AUTO is not set
410# CONFIG_BLK_DEV_HD is not set 452# CONFIG_BLK_DEV_HD is not set
411 453
@@ -414,6 +456,7 @@ CONFIG_IDE_GENERIC=y
414# 456#
415# CONFIG_RAID_ATTRS is not set 457# CONFIG_RAID_ATTRS is not set
416CONFIG_SCSI=y 458CONFIG_SCSI=y
459CONFIG_SCSI_NETLINK=y
417CONFIG_SCSI_PROC_FS=y 460CONFIG_SCSI_PROC_FS=y
418 461
419# 462#
@@ -434,22 +477,54 @@ CONFIG_SCSI_CONSTANTS=y
434# CONFIG_SCSI_LOGGING is not set 477# CONFIG_SCSI_LOGGING is not set
435 478
436# 479#
437# SCSI Transport Attributes 480# SCSI Transports
438# 481#
439# CONFIG_SCSI_SPI_ATTRS is not set 482# CONFIG_SCSI_SPI_ATTRS is not set
440CONFIG_SCSI_FC_ATTRS=y 483CONFIG_SCSI_FC_ATTRS=y
441CONFIG_SCSI_ISCSI_ATTRS=m 484CONFIG_SCSI_ISCSI_ATTRS=m
442# CONFIG_SCSI_SAS_ATTRS is not set 485# CONFIG_SCSI_SAS_ATTRS is not set
486# CONFIG_SCSI_SAS_LIBSAS is not set
443 487
444# 488#
445# SCSI low-level drivers 489# SCSI low-level drivers
446# 490#
447CONFIG_ISCSI_TCP=m 491CONFIG_ISCSI_TCP=m
448# CONFIG_SGIWD93_SCSI is not set 492# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
449# CONFIG_SCSI_SATA is not set 493# CONFIG_SCSI_3W_9XXX is not set
494# CONFIG_SCSI_ACARD is not set
495# CONFIG_SCSI_AACRAID is not set
496# CONFIG_SCSI_AIC7XXX is not set
497# CONFIG_SCSI_AIC7XXX_OLD is not set
498# CONFIG_SCSI_AIC79XX is not set
499# CONFIG_SCSI_AIC94XX is not set
500# CONFIG_SCSI_DPT_I2O is not set
501# CONFIG_SCSI_ARCMSR is not set
502# CONFIG_MEGARAID_NEWGEN is not set
503# CONFIG_MEGARAID_LEGACY is not set
504# CONFIG_MEGARAID_SAS is not set
505# CONFIG_SCSI_HPTIOP is not set
506# CONFIG_SCSI_DMX3191D is not set
507# CONFIG_SCSI_FUTURE_DOMAIN is not set
508# CONFIG_SCSI_IPS is not set
509# CONFIG_SCSI_INITIO is not set
510# CONFIG_SCSI_INIA100 is not set
511# CONFIG_SCSI_STEX is not set
512# CONFIG_SCSI_SYM53C8XX_2 is not set
513# CONFIG_SCSI_QLOGIC_1280 is not set
514# CONFIG_SCSI_QLA_FC is not set
515# CONFIG_SCSI_QLA_ISCSI is not set
516# CONFIG_SCSI_LPFC is not set
517# CONFIG_SCSI_DC395x is not set
518# CONFIG_SCSI_DC390T is not set
519# CONFIG_SCSI_NSP32 is not set
450# CONFIG_SCSI_DEBUG is not set 520# CONFIG_SCSI_DEBUG is not set
451 521
452# 522#
523# Serial ATA (prod) and Parallel ATA (experimental) drivers
524#
525# CONFIG_ATA is not set
526
527#
453# Multi-device support (RAID and LVM) 528# Multi-device support (RAID and LVM)
454# 529#
455# CONFIG_MD is not set 530# CONFIG_MD is not set
@@ -458,14 +533,19 @@ CONFIG_ISCSI_TCP=m
458# Fusion MPT device support 533# Fusion MPT device support
459# 534#
460# CONFIG_FUSION is not set 535# CONFIG_FUSION is not set
536# CONFIG_FUSION_SPI is not set
537# CONFIG_FUSION_FC is not set
538# CONFIG_FUSION_SAS is not set
461 539
462# 540#
463# IEEE 1394 (FireWire) support 541# IEEE 1394 (FireWire) support
464# 542#
543# CONFIG_IEEE1394 is not set
465 544
466# 545#
467# I2O device support 546# I2O device support
468# 547#
548# CONFIG_I2O is not set
469 549
470# 550#
471# Network device support 551# Network device support
@@ -477,6 +557,11 @@ CONFIG_NETDEVICES=y
477# CONFIG_TUN is not set 557# CONFIG_TUN is not set
478 558
479# 559#
560# ARCnet devices
561#
562# CONFIG_ARCNET is not set
563
564#
480# PHY device support 565# PHY device support
481# 566#
482# CONFIG_PHYLIB is not set 567# CONFIG_PHYLIB is not set
@@ -486,20 +571,73 @@ CONFIG_NETDEVICES=y
486# 571#
487CONFIG_NET_ETHERNET=y 572CONFIG_NET_ETHERNET=y
488CONFIG_MII=y 573CONFIG_MII=y
574# CONFIG_HAPPYMEAL is not set
575# CONFIG_SUNGEM is not set
576# CONFIG_CASSINI is not set
577# CONFIG_NET_VENDOR_3COM is not set
489# CONFIG_DM9000 is not set 578# CONFIG_DM9000 is not set
490# CONFIG_SGISEEQ is not set 579
580#
581# Tulip family network device support
582#
583# CONFIG_NET_TULIP is not set
584# CONFIG_HP100 is not set
585CONFIG_NET_PCI=y
586# CONFIG_PCNET32 is not set
587# CONFIG_AMD8111_ETH is not set
588# CONFIG_ADAPTEC_STARFIRE is not set
589# CONFIG_B44 is not set
590# CONFIG_FORCEDETH is not set
591# CONFIG_DGRS is not set
592# CONFIG_EEPRO100 is not set
593# CONFIG_E100 is not set
594# CONFIG_FEALNX is not set
595# CONFIG_NATSEMI is not set
596# CONFIG_NE2K_PCI is not set
597# CONFIG_8139CP is not set
598CONFIG_8139TOO=y
599# CONFIG_8139TOO_PIO is not set
600CONFIG_8139TOO_TUNE_TWISTER=y
601CONFIG_8139TOO_8129=y
602# CONFIG_8139_OLD_RX_RESET is not set
603# CONFIG_SIS900 is not set
604# CONFIG_EPIC100 is not set
605# CONFIG_SUNDANCE is not set
606# CONFIG_TLAN is not set
607# CONFIG_VIA_RHINE is not set
608# CONFIG_LAN_SAA9730 is not set
491 609
492# 610#
493# Ethernet (1000 Mbit) 611# Ethernet (1000 Mbit)
494# 612#
613# CONFIG_ACENIC is not set
614# CONFIG_DL2K is not set
615# CONFIG_E1000 is not set
616# CONFIG_NS83820 is not set
617# CONFIG_HAMACHI is not set
618# CONFIG_YELLOWFIN is not set
619# CONFIG_R8169 is not set
620# CONFIG_SIS190 is not set
621# CONFIG_SKGE is not set
622# CONFIG_SKY2 is not set
623# CONFIG_SK98LIN is not set
624# CONFIG_VIA_VELOCITY is not set
625# CONFIG_TIGON3 is not set
626# CONFIG_BNX2 is not set
627# CONFIG_QLA3XXX is not set
495 628
496# 629#
497# Ethernet (10000 Mbit) 630# Ethernet (10000 Mbit)
498# 631#
632# CONFIG_CHELSIO_T1 is not set
633# CONFIG_IXGB is not set
634# CONFIG_S2IO is not set
635# CONFIG_MYRI10GE is not set
499 636
500# 637#
501# Token Ring devices 638# Token Ring devices
502# 639#
640# CONFIG_TR is not set
503 641
504# 642#
505# Wireless LAN (non-hamradio) 643# Wireless LAN (non-hamradio)
@@ -510,8 +648,11 @@ CONFIG_MII=y
510# Wan interfaces 648# Wan interfaces
511# 649#
512# CONFIG_WAN is not set 650# CONFIG_WAN is not set
651# CONFIG_FDDI is not set
652# CONFIG_HIPPI is not set
513# CONFIG_PPP is not set 653# CONFIG_PPP is not set
514# CONFIG_SLIP is not set 654# CONFIG_SLIP is not set
655# CONFIG_NET_FC is not set
515# CONFIG_SHAPER is not set 656# CONFIG_SHAPER is not set
516# CONFIG_NETCONSOLE is not set 657# CONFIG_NETCONSOLE is not set
517# CONFIG_NETPOLL is not set 658# CONFIG_NETPOLL is not set
@@ -531,6 +672,7 @@ CONFIG_MII=y
531# Input device support 672# Input device support
532# 673#
533CONFIG_INPUT=y 674CONFIG_INPUT=y
675# CONFIG_INPUT_FF_MEMLESS is not set
534 676
535# 677#
536# Userland interfaces 678# Userland interfaces
@@ -556,6 +698,7 @@ CONFIG_INPUT=y
556CONFIG_SERIO=y 698CONFIG_SERIO=y
557# CONFIG_SERIO_I8042 is not set 699# CONFIG_SERIO_I8042 is not set
558# CONFIG_SERIO_SERPORT is not set 700# CONFIG_SERIO_SERPORT is not set
701# CONFIG_SERIO_PCIPS2 is not set
559CONFIG_SERIO_LIBPS2=y 702CONFIG_SERIO_LIBPS2=y
560# CONFIG_SERIO_RAW is not set 703# CONFIG_SERIO_RAW is not set
561# CONFIG_GAMEPORT is not set 704# CONFIG_GAMEPORT is not set
@@ -566,7 +709,7 @@ CONFIG_SERIO_LIBPS2=y
566CONFIG_VT=y 709CONFIG_VT=y
567CONFIG_VT_CONSOLE=y 710CONFIG_VT_CONSOLE=y
568CONFIG_HW_CONSOLE=y 711CONFIG_HW_CONSOLE=y
569CONFIG_VT_HW_CONSOLE_BINDING=y 712# CONFIG_VT_HW_CONSOLE_BINDING is not set
570# CONFIG_SERIAL_NONSTANDARD is not set 713# CONFIG_SERIAL_NONSTANDARD is not set
571 714
572# 715#
@@ -577,7 +720,8 @@ CONFIG_VT_HW_CONSOLE_BINDING=y
577# 720#
578# Non-8250 serial port support 721# Non-8250 serial port support
579# 722#
580# CONFIG_SERIAL_IP22_ZILOG is not set 723# CONFIG_SERIAL_IP3106 is not set
724# CONFIG_SERIAL_JSM is not set
581CONFIG_UNIX98_PTYS=y 725CONFIG_UNIX98_PTYS=y
582CONFIG_LEGACY_PTYS=y 726CONFIG_LEGACY_PTYS=y
583CONFIG_LEGACY_PTY_COUNT=256 727CONFIG_LEGACY_PTY_COUNT=256
@@ -591,16 +735,17 @@ CONFIG_LEGACY_PTY_COUNT=256
591# Watchdog Cards 735# Watchdog Cards
592# 736#
593# CONFIG_WATCHDOG is not set 737# CONFIG_WATCHDOG is not set
594# CONFIG_HW_RANDOM is not set 738CONFIG_HW_RANDOM=y
595# CONFIG_RTC is not set 739# CONFIG_RTC is not set
596# CONFIG_SGI_DS1286 is not set
597# CONFIG_GEN_RTC is not set 740# CONFIG_GEN_RTC is not set
598# CONFIG_DTLK is not set 741# CONFIG_DTLK is not set
599# CONFIG_R3964 is not set 742# CONFIG_R3964 is not set
743# CONFIG_APPLICOM is not set
600 744
601# 745#
602# Ftape, the floppy tape device driver 746# Ftape, the floppy tape device driver
603# 747#
748# CONFIG_DRM is not set
604# CONFIG_RAW_DRIVER is not set 749# CONFIG_RAW_DRIVER is not set
605 750
606# 751#
@@ -631,35 +776,37 @@ CONFIG_HWMON=y
631# CONFIG_HWMON_VID is not set 776# CONFIG_HWMON_VID is not set
632# CONFIG_SENSORS_ABITUGURU is not set 777# CONFIG_SENSORS_ABITUGURU is not set
633# CONFIG_SENSORS_F71805F is not set 778# CONFIG_SENSORS_F71805F is not set
779# CONFIG_SENSORS_VT1211 is not set
634# CONFIG_HWMON_DEBUG_CHIP is not set 780# CONFIG_HWMON_DEBUG_CHIP is not set
635 781
636# 782#
637# Misc devices 783# Misc devices
638# 784#
785# CONFIG_TIFM_CORE is not set
639 786
640# 787#
641# Multimedia devices 788# Multimedia devices
642# 789#
643# CONFIG_VIDEO_DEV is not set 790# CONFIG_VIDEO_DEV is not set
644CONFIG_VIDEO_V4L2=y
645 791
646# 792#
647# Digital Video Broadcasting Devices 793# Digital Video Broadcasting Devices
648# 794#
649# CONFIG_DVB is not set 795# CONFIG_DVB is not set
796# CONFIG_USB_DABUSB is not set
650 797
651# 798#
652# Graphics support 799# Graphics support
653# 800#
654# CONFIG_FIRMWARE_EDID is not set 801CONFIG_FIRMWARE_EDID=y
655# CONFIG_FB is not set 802# CONFIG_FB is not set
656 803
657# 804#
658# Console display driver support 805# Console display driver support
659# 806#
660# CONFIG_VGA_CONSOLE is not set 807# CONFIG_VGA_CONSOLE is not set
661# CONFIG_SGI_NEWPORT_CONSOLE is not set
662CONFIG_DUMMY_CONSOLE=y 808CONFIG_DUMMY_CONSOLE=y
809# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
663 810
664# 811#
665# Sound 812# Sound
@@ -669,15 +816,131 @@ CONFIG_DUMMY_CONSOLE=y
669# 816#
670# USB support 817# USB support
671# 818#
672# CONFIG_USB_ARCH_HAS_HCD is not set 819CONFIG_USB_ARCH_HAS_HCD=y
673# CONFIG_USB_ARCH_HAS_OHCI is not set 820CONFIG_USB_ARCH_HAS_OHCI=y
674# CONFIG_USB_ARCH_HAS_EHCI is not set 821CONFIG_USB_ARCH_HAS_EHCI=y
822CONFIG_USB=y
823# CONFIG_USB_DEBUG is not set
824
825#
826# Miscellaneous USB options
827#
828# CONFIG_USB_DEVICEFS is not set
829# CONFIG_USB_BANDWIDTH is not set
830# CONFIG_USB_DYNAMIC_MINORS is not set
831# CONFIG_USB_OTG is not set
832
833#
834# USB Host Controller Drivers
835#
836# CONFIG_USB_EHCI_HCD is not set
837# CONFIG_USB_ISP116X_HCD is not set
838CONFIG_USB_OHCI_HCD=y
839# CONFIG_USB_OHCI_BIG_ENDIAN is not set
840CONFIG_USB_OHCI_LITTLE_ENDIAN=y
841# CONFIG_USB_UHCI_HCD is not set
842# CONFIG_USB_SL811_HCD is not set
843
844#
845# USB Device Class drivers
846#
847# CONFIG_USB_ACM is not set
848# CONFIG_USB_PRINTER is not set
675 849
676# 850#
677# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 851# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
678# 852#
679 853
680# 854#
855# may also be needed; see USB_STORAGE Help for more information
856#
857CONFIG_USB_STORAGE=y
858# CONFIG_USB_STORAGE_DEBUG is not set
859CONFIG_USB_STORAGE_DATAFAB=y
860CONFIG_USB_STORAGE_FREECOM=y
861CONFIG_USB_STORAGE_ISD200=y
862CONFIG_USB_STORAGE_DPCM=y
863CONFIG_USB_STORAGE_USBAT=y
864CONFIG_USB_STORAGE_SDDR09=y
865CONFIG_USB_STORAGE_SDDR55=y
866CONFIG_USB_STORAGE_JUMPSHOT=y
867# CONFIG_USB_STORAGE_ALAUDA is not set
868# CONFIG_USB_STORAGE_KARMA is not set
869# CONFIG_USB_LIBUSUAL is not set
870
871#
872# USB Input Devices
873#
874# CONFIG_USB_HID is not set
875
876#
877# USB HID Boot Protocol drivers
878#
879# CONFIG_USB_KBD is not set
880# CONFIG_USB_MOUSE is not set
881# CONFIG_USB_AIPTEK is not set
882# CONFIG_USB_WACOM is not set
883# CONFIG_USB_ACECAD is not set
884# CONFIG_USB_KBTAB is not set
885# CONFIG_USB_POWERMATE is not set
886# CONFIG_USB_TOUCHSCREEN is not set
887# CONFIG_USB_YEALINK is not set
888# CONFIG_USB_XPAD is not set
889# CONFIG_USB_ATI_REMOTE is not set
890# CONFIG_USB_ATI_REMOTE2 is not set
891# CONFIG_USB_KEYSPAN_REMOTE is not set
892# CONFIG_USB_APPLETOUCH is not set
893# CONFIG_USB_TRANCEVIBRATOR is not set
894
895#
896# USB Imaging devices
897#
898# CONFIG_USB_MDC800 is not set
899# CONFIG_USB_MICROTEK is not set
900
901#
902# USB Network Adapters
903#
904# CONFIG_USB_CATC is not set
905# CONFIG_USB_KAWETH is not set
906# CONFIG_USB_PEGASUS is not set
907# CONFIG_USB_RTL8150 is not set
908# CONFIG_USB_USBNET is not set
909CONFIG_USB_MON=y
910
911#
912# USB port drivers
913#
914
915#
916# USB Serial Converter support
917#
918# CONFIG_USB_SERIAL is not set
919
920#
921# USB Miscellaneous drivers
922#
923# CONFIG_USB_EMI62 is not set
924# CONFIG_USB_EMI26 is not set
925# CONFIG_USB_ADUTUX is not set
926# CONFIG_USB_AUERSWALD is not set
927# CONFIG_USB_RIO500 is not set
928# CONFIG_USB_LEGOTOWER is not set
929# CONFIG_USB_LCD is not set
930# CONFIG_USB_LED is not set
931# CONFIG_USB_CYPRESS_CY7C63 is not set
932# CONFIG_USB_CYTHERM is not set
933# CONFIG_USB_PHIDGET is not set
934# CONFIG_USB_IDMOUSE is not set
935# CONFIG_USB_FTDI_ELAN is not set
936# CONFIG_USB_APPLEDISPLAY is not set
937# CONFIG_USB_LD is not set
938
939#
940# USB DSL modem support
941#
942
943#
681# USB Gadget Support 944# USB Gadget Support
682# 945#
683# CONFIG_USB_GADGET is not set 946# CONFIG_USB_GADGET is not set
@@ -703,6 +966,7 @@ CONFIG_DUMMY_CONSOLE=y
703# 966#
704# InfiniBand support 967# InfiniBand support
705# 968#
969# CONFIG_INFINIBAND is not set
706 970
707# 971#
708# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 972# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
@@ -733,10 +997,12 @@ CONFIG_EXT2_FS=y
733# CONFIG_EXT2_FS_XATTR is not set 997# CONFIG_EXT2_FS_XATTR is not set
734# CONFIG_EXT2_FS_XIP is not set 998# CONFIG_EXT2_FS_XIP is not set
735# CONFIG_EXT3_FS is not set 999# CONFIG_EXT3_FS is not set
1000# CONFIG_EXT4DEV_FS is not set
736# CONFIG_REISERFS_FS is not set 1001# CONFIG_REISERFS_FS is not set
737# CONFIG_JFS_FS is not set 1002# CONFIG_JFS_FS is not set
738# CONFIG_FS_POSIX_ACL is not set 1003# CONFIG_FS_POSIX_ACL is not set
739# CONFIG_XFS_FS is not set 1004# CONFIG_XFS_FS is not set
1005# CONFIG_GFS2_FS is not set
740# CONFIG_OCFS2_FS is not set 1006# CONFIG_OCFS2_FS is not set
741# CONFIG_MINIX_FS is not set 1007# CONFIG_MINIX_FS is not set
742# CONFIG_ROMFS_FS is not set 1008# CONFIG_ROMFS_FS is not set
@@ -769,8 +1035,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
769# 1035#
770CONFIG_PROC_FS=y 1036CONFIG_PROC_FS=y
771# CONFIG_PROC_KCORE is not set 1037# CONFIG_PROC_KCORE is not set
1038CONFIG_PROC_SYSCTL=y
772CONFIG_SYSFS=y 1039CONFIG_SYSFS=y
773CONFIG_TMPFS=y 1040CONFIG_TMPFS=y
1041# CONFIG_TMPFS_POSIX_ACL is not set
774# CONFIG_HUGETLB_PAGE is not set 1042# CONFIG_HUGETLB_PAGE is not set
775CONFIG_RAMFS=y 1043CONFIG_RAMFS=y
776# CONFIG_CONFIGFS_FS is not set 1044# CONFIG_CONFIGFS_FS is not set
@@ -813,7 +1081,6 @@ CONFIG_SUNRPC=y
813# CONFIG_RPCSEC_GSS_SPKM3 is not set 1081# CONFIG_RPCSEC_GSS_SPKM3 is not set
814# CONFIG_SMB_FS is not set 1082# CONFIG_SMB_FS is not set
815# CONFIG_CIFS is not set 1083# CONFIG_CIFS is not set
816# CONFIG_CIFS_DEBUG2 is not set
817# CONFIG_NCP_FS is not set 1084# CONFIG_NCP_FS is not set
818# CONFIG_CODA_FS is not set 1085# CONFIG_CODA_FS is not set
819# CONFIG_AFS_FS is not set 1086# CONFIG_AFS_FS is not set
@@ -824,7 +1091,6 @@ CONFIG_SUNRPC=y
824# 1091#
825# CONFIG_PARTITION_ADVANCED is not set 1092# CONFIG_PARTITION_ADVANCED is not set
826CONFIG_MSDOS_PARTITION=y 1093CONFIG_MSDOS_PARTITION=y
827CONFIG_SGI_PARTITION=y
828 1094
829# 1095#
830# Native Language Support 1096# Native Language Support
@@ -880,6 +1146,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
880# 1146#
881CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1147CONFIG_TRACE_IRQFLAGS_SUPPORT=y
882# CONFIG_PRINTK_TIME is not set 1148# CONFIG_PRINTK_TIME is not set
1149CONFIG_ENABLE_MUST_CHECK=y
883CONFIG_MAGIC_SYSRQ=y 1150CONFIG_MAGIC_SYSRQ=y
884# CONFIG_UNUSED_SYMBOLS is not set 1151# CONFIG_UNUSED_SYMBOLS is not set
885CONFIG_DEBUG_KERNEL=y 1152CONFIG_DEBUG_KERNEL=y
@@ -893,13 +1160,17 @@ CONFIG_DEBUG_SLAB=y
893# CONFIG_DEBUG_SPINLOCK is not set 1160# CONFIG_DEBUG_SPINLOCK is not set
894CONFIG_DEBUG_MUTEXES=y 1161CONFIG_DEBUG_MUTEXES=y
895# CONFIG_DEBUG_RWSEMS is not set 1162# CONFIG_DEBUG_RWSEMS is not set
1163# CONFIG_DEBUG_LOCK_ALLOC is not set
1164# CONFIG_PROVE_LOCKING is not set
896# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1165# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
897# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1166# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
898# CONFIG_DEBUG_KOBJECT is not set 1167# CONFIG_DEBUG_KOBJECT is not set
899# CONFIG_DEBUG_INFO is not set 1168# CONFIG_DEBUG_INFO is not set
900# CONFIG_DEBUG_FS is not set 1169# CONFIG_DEBUG_FS is not set
901# CONFIG_DEBUG_VM is not set 1170# CONFIG_DEBUG_VM is not set
1171# CONFIG_DEBUG_LIST is not set
902CONFIG_FORCED_INLINING=y 1172CONFIG_FORCED_INLINING=y
1173# CONFIG_HEADERS_CHECK is not set
903# CONFIG_RCU_TORTURE_TEST is not set 1174# CONFIG_RCU_TORTURE_TEST is not set
904CONFIG_CROSSCOMPILE=y 1175CONFIG_CROSSCOMPILE=y
905CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp" 1176CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp"
@@ -918,6 +1189,9 @@ CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp"
918# Cryptographic options 1189# Cryptographic options
919# 1190#
920CONFIG_CRYPTO=y 1191CONFIG_CRYPTO=y
1192CONFIG_CRYPTO_ALGAPI=m
1193CONFIG_CRYPTO_BLKCIPHER=m
1194CONFIG_CRYPTO_MANAGER=m
921# CONFIG_CRYPTO_HMAC is not set 1195# CONFIG_CRYPTO_HMAC is not set
922# CONFIG_CRYPTO_NULL is not set 1196# CONFIG_CRYPTO_NULL is not set
923# CONFIG_CRYPTO_MD4 is not set 1197# CONFIG_CRYPTO_MD4 is not set
@@ -927,6 +1201,8 @@ CONFIG_CRYPTO_MD5=m
927# CONFIG_CRYPTO_SHA512 is not set 1201# CONFIG_CRYPTO_SHA512 is not set
928# CONFIG_CRYPTO_WP512 is not set 1202# CONFIG_CRYPTO_WP512 is not set
929# CONFIG_CRYPTO_TGR192 is not set 1203# CONFIG_CRYPTO_TGR192 is not set
1204CONFIG_CRYPTO_ECB=m
1205CONFIG_CRYPTO_CBC=m
930# CONFIG_CRYPTO_DES is not set 1206# CONFIG_CRYPTO_DES is not set
931# CONFIG_CRYPTO_BLOWFISH is not set 1207# CONFIG_CRYPTO_BLOWFISH is not set
932# CONFIG_CRYPTO_TWOFISH is not set 1208# CONFIG_CRYPTO_TWOFISH is not set
diff --git a/arch/mips/configs/pnx8550-v2pci_defconfig b/arch/mips/configs/pnx8550-v2pci_defconfig
index e93266b37dd..64b9fbf44a6 100644
--- a/arch/mips/configs/pnx8550-v2pci_defconfig
+++ b/arch/mips/configs/pnx8550-v2pci_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.18-rc1 3# Linux kernel version: 2.6.19-rc2
4# Thu Jul 6 10:04:18 2006 4# Sat Oct 14 23:12:15 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -25,8 +25,6 @@ CONFIG_MIPS=y
25# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
26# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
27# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
28# CONFIG_MIPS_IVR is not set
29# CONFIG_MIPS_ITE8172 is not set
30# CONFIG_MACH_JAZZ is not set 28# CONFIG_MACH_JAZZ is not set
31# CONFIG_LASAT is not set 29# CONFIG_LASAT is not set
32# CONFIG_MIPS_ATLAS is not set 30# CONFIG_MIPS_ATLAS is not set
@@ -40,14 +38,14 @@ CONFIG_MIPS=y
40# CONFIG_MOMENCO_OCELOT_C is not set 38# CONFIG_MOMENCO_OCELOT_C is not set
41# CONFIG_MOMENCO_OCELOT_G is not set 39# CONFIG_MOMENCO_OCELOT_G is not set
42# CONFIG_MIPS_XXS1500 is not set 40# CONFIG_MIPS_XXS1500 is not set
43# CONFIG_PNX8550_V2PCI is not set 41CONFIG_PNX8550_V2PCI=y
44# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
45# CONFIG_DDB5477 is not set 43# CONFIG_DDB5477 is not set
46# CONFIG_MACH_VR41XX is not set 44# CONFIG_MACH_VR41XX is not set
47# CONFIG_PMC_YOSEMITE is not set 45# CONFIG_PMC_YOSEMITE is not set
48# CONFIG_QEMU is not set 46# CONFIG_QEMU is not set
49# CONFIG_MARKEINS is not set 47# CONFIG_MARKEINS is not set
50CONFIG_SGI_IP22=y 48# CONFIG_SGI_IP22 is not set
51# CONFIG_SGI_IP27 is not set 49# CONFIG_SGI_IP27 is not set
52# CONFIG_SGI_IP32 is not set 50# CONFIG_SGI_IP32 is not set
53# CONFIG_SIBYTE_BIGSUR is not set 51# CONFIG_SIBYTE_BIGSUR is not set
@@ -67,25 +65,21 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y 65CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y 66CONFIG_GENERIC_HWEIGHT=y
69CONFIG_GENERIC_CALIBRATE_DELAY=y 67CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_GENERIC_TIME=y
70CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 69CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
71CONFIG_ARC=y
72CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
73CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
74CONFIG_CPU_BIG_ENDIAN=y 72# CONFIG_CPU_BIG_ENDIAN is not set
75# CONFIG_CPU_LITTLE_ENDIAN is not set 73CONFIG_CPU_LITTLE_ENDIAN=y
76CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y 74CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
77CONFIG_IRQ_CPU=y 75CONFIG_PNX8550=y
78CONFIG_SWAP_IO_SPACE=y 76CONFIG_SOC_PNX8550=y
79CONFIG_ARC32=y
80CONFIG_BOOT_ELF32=y
81CONFIG_MIPS_L1_CACHE_SHIFT=5 77CONFIG_MIPS_L1_CACHE_SHIFT=5
82# CONFIG_ARC_CONSOLE is not set
83CONFIG_ARC_PROMLIB=y
84 78
85# 79#
86# CPU selection 80# CPU selection
87# 81#
88# CONFIG_CPU_MIPS32_R1 is not set 82CONFIG_CPU_MIPS32_R1=y
89# CONFIG_CPU_MIPS32_R2 is not set 83# CONFIG_CPU_MIPS32_R2 is not set
90# CONFIG_CPU_MIPS64_R1 is not set 84# CONFIG_CPU_MIPS64_R1 is not set
91# CONFIG_CPU_MIPS64_R2 is not set 85# CONFIG_CPU_MIPS64_R2 is not set
@@ -93,7 +87,7 @@ CONFIG_ARC_PROMLIB=y
93# CONFIG_CPU_TX39XX is not set 87# CONFIG_CPU_TX39XX is not set
94# CONFIG_CPU_VR41XX is not set 88# CONFIG_CPU_VR41XX is not set
95# CONFIG_CPU_R4300 is not set 89# CONFIG_CPU_R4300 is not set
96CONFIG_CPU_R4X00=y 90# CONFIG_CPU_R4X00 is not set
97# CONFIG_CPU_TX49XX is not set 91# CONFIG_CPU_TX49XX is not set
98# CONFIG_CPU_R5000 is not set 92# CONFIG_CPU_R5000 is not set
99# CONFIG_CPU_R5432 is not set 93# CONFIG_CPU_R5432 is not set
@@ -104,12 +98,11 @@ CONFIG_CPU_R4X00=y
104# CONFIG_CPU_RM7000 is not set 98# CONFIG_CPU_RM7000 is not set
105# CONFIG_CPU_RM9000 is not set 99# CONFIG_CPU_RM9000 is not set
106# CONFIG_CPU_SB1 is not set 100# CONFIG_CPU_SB1 is not set
107CONFIG_SYS_HAS_CPU_R4X00=y 101CONFIG_SYS_HAS_CPU_MIPS32_R1=y
108CONFIG_SYS_HAS_CPU_R5000=y 102CONFIG_CPU_MIPS32=y
103CONFIG_CPU_MIPSR1=y
109CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 104CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
110CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
111CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 105CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
112CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
113 106
114# 107#
115# Kernel type 108# Kernel type
@@ -120,17 +113,17 @@ CONFIG_PAGE_SIZE_4KB=y
120# CONFIG_PAGE_SIZE_8KB is not set 113# CONFIG_PAGE_SIZE_8KB is not set
121# CONFIG_PAGE_SIZE_16KB is not set 114# CONFIG_PAGE_SIZE_16KB is not set
122# CONFIG_PAGE_SIZE_64KB is not set 115# CONFIG_PAGE_SIZE_64KB is not set
123CONFIG_BOARD_SCACHE=y 116CONFIG_CPU_HAS_PREFETCH=y
124CONFIG_IP22_CPU_SCACHE=y
125CONFIG_MIPS_MT_DISABLED=y 117CONFIG_MIPS_MT_DISABLED=y
126# CONFIG_MIPS_MT_SMTC is not set
127# CONFIG_MIPS_MT_SMP is not set 118# CONFIG_MIPS_MT_SMP is not set
119# CONFIG_MIPS_MT_SMTC is not set
128# CONFIG_MIPS_VPE_LOADER is not set 120# CONFIG_MIPS_VPE_LOADER is not set
129# CONFIG_64BIT_PHYS_ADDR is not set 121# CONFIG_64BIT_PHYS_ADDR is not set
130CONFIG_CPU_HAS_LLSC=y 122CONFIG_CPU_HAS_LLSC=y
131CONFIG_CPU_HAS_SYNC=y 123CONFIG_CPU_HAS_SYNC=y
132CONFIG_GENERIC_HARDIRQS=y 124CONFIG_GENERIC_HARDIRQS=y
133CONFIG_GENERIC_IRQ_PROBE=y 125CONFIG_GENERIC_IRQ_PROBE=y
126CONFIG_CPU_SUPPORTS_HIGHMEM=y
134CONFIG_ARCH_FLATMEM_ENABLE=y 127CONFIG_ARCH_FLATMEM_ENABLE=y
135CONFIG_SELECT_MEMORY_MODEL=y 128CONFIG_SELECT_MEMORY_MODEL=y
136CONFIG_FLATMEM_MANUAL=y 129CONFIG_FLATMEM_MANUAL=y
@@ -144,12 +137,12 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
144# CONFIG_HZ_48 is not set 137# CONFIG_HZ_48 is not set
145# CONFIG_HZ_100 is not set 138# CONFIG_HZ_100 is not set
146# CONFIG_HZ_128 is not set 139# CONFIG_HZ_128 is not set
147# CONFIG_HZ_250 is not set 140CONFIG_HZ_250=y
148# CONFIG_HZ_256 is not set 141# CONFIG_HZ_256 is not set
149CONFIG_HZ_1000=y 142# CONFIG_HZ_1000 is not set
150# CONFIG_HZ_1024 is not set 143# CONFIG_HZ_1024 is not set
151CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 144CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
152CONFIG_HZ=1000 145CONFIG_HZ=250
153CONFIG_PREEMPT_NONE=y 146CONFIG_PREEMPT_NONE=y
154# CONFIG_PREEMPT_VOLUNTARY is not set 147# CONFIG_PREEMPT_VOLUNTARY is not set
155# CONFIG_PREEMPT is not set 148# CONFIG_PREEMPT is not set
@@ -171,16 +164,20 @@ CONFIG_LOCALVERSION=""
171CONFIG_LOCALVERSION_AUTO=y 164CONFIG_LOCALVERSION_AUTO=y
172CONFIG_SWAP=y 165CONFIG_SWAP=y
173CONFIG_SYSVIPC=y 166CONFIG_SYSVIPC=y
167# CONFIG_IPC_NS is not set
174# CONFIG_POSIX_MQUEUE is not set 168# CONFIG_POSIX_MQUEUE is not set
175# CONFIG_BSD_PROCESS_ACCT is not set 169# CONFIG_BSD_PROCESS_ACCT is not set
176CONFIG_SYSCTL=y 170# CONFIG_TASKSTATS is not set
171# CONFIG_UTS_NS is not set
177# CONFIG_AUDIT is not set 172# CONFIG_AUDIT is not set
178CONFIG_IKCONFIG=y 173CONFIG_IKCONFIG=y
179CONFIG_IKCONFIG_PROC=y 174CONFIG_IKCONFIG_PROC=y
180# CONFIG_RELAY is not set 175# CONFIG_RELAY is not set
181CONFIG_INITRAMFS_SOURCE="" 176CONFIG_INITRAMFS_SOURCE=""
182# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 177# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
178CONFIG_SYSCTL=y
183CONFIG_EMBEDDED=y 179CONFIG_EMBEDDED=y
180# CONFIG_SYSCTL_SYSCALL is not set
184CONFIG_KALLSYMS=y 181CONFIG_KALLSYMS=y
185# CONFIG_KALLSYMS_EXTRA_PASS is not set 182# CONFIG_KALLSYMS_EXTRA_PASS is not set
186CONFIG_HOTPLUG=y 183CONFIG_HOTPLUG=y
@@ -188,12 +185,12 @@ CONFIG_PRINTK=y
188CONFIG_BUG=y 185CONFIG_BUG=y
189CONFIG_ELF_CORE=y 186CONFIG_ELF_CORE=y
190CONFIG_BASE_FULL=y 187CONFIG_BASE_FULL=y
191CONFIG_RT_MUTEXES=y
192CONFIG_FUTEX=y 188CONFIG_FUTEX=y
193CONFIG_EPOLL=y 189CONFIG_EPOLL=y
194CONFIG_SHMEM=y 190CONFIG_SHMEM=y
195CONFIG_SLAB=y 191CONFIG_SLAB=y
196CONFIG_VM_EVENT_COUNTERS=y 192CONFIG_VM_EVENT_COUNTERS=y
193CONFIG_RT_MUTEXES=y
197# CONFIG_TINY_SHMEM is not set 194# CONFIG_TINY_SHMEM is not set
198CONFIG_BASE_SMALL=0 195CONFIG_BASE_SMALL=0
199# CONFIG_SLOB is not set 196# CONFIG_SLOB is not set
@@ -210,6 +207,7 @@ CONFIG_KMOD=y
210# 207#
211# Block layer 208# Block layer
212# 209#
210CONFIG_BLOCK=y
213# CONFIG_LBD is not set 211# CONFIG_LBD is not set
214# CONFIG_BLK_DEV_IO_TRACE is not set 212# CONFIG_BLK_DEV_IO_TRACE is not set
215# CONFIG_LSF is not set 213# CONFIG_LSF is not set
@@ -230,8 +228,9 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
230# 228#
231# Bus options (PCI, PCMCIA, EISA, ISA, TC) 229# Bus options (PCI, PCMCIA, EISA, ISA, TC)
232# 230#
233CONFIG_HW_HAS_EISA=y 231CONFIG_HW_HAS_PCI=y
234# CONFIG_EISA is not set 232CONFIG_PCI=y
233# CONFIG_PCI_MULTITHREAD_PROBE is not set
235CONFIG_MMU=y 234CONFIG_MMU=y
236 235
237# 236#
@@ -242,6 +241,7 @@ CONFIG_MMU=y
242# 241#
243# PCI Hotplug Support 242# PCI Hotplug Support
244# 243#
244# CONFIG_HOTPLUG_PCI is not set
245 245
246# 246#
247# Executable file formats 247# Executable file formats
@@ -264,6 +264,7 @@ CONFIG_PACKET=y
264CONFIG_UNIX=y 264CONFIG_UNIX=y
265CONFIG_XFRM=y 265CONFIG_XFRM=y
266# CONFIG_XFRM_USER is not set 266# CONFIG_XFRM_USER is not set
267# CONFIG_XFRM_SUB_POLICY is not set
267# CONFIG_NET_KEY is not set 268# CONFIG_NET_KEY is not set
268CONFIG_INET=y 269CONFIG_INET=y
269# CONFIG_IP_MULTICAST is not set 270# CONFIG_IP_MULTICAST is not set
@@ -282,12 +283,14 @@ CONFIG_IP_PNP=y
282# CONFIG_INET_IPCOMP is not set 283# CONFIG_INET_IPCOMP is not set
283# CONFIG_INET_XFRM_TUNNEL is not set 284# CONFIG_INET_XFRM_TUNNEL is not set
284# CONFIG_INET_TUNNEL is not set 285# CONFIG_INET_TUNNEL is not set
285CONFIG_INET_XFRM_MODE_TRANSPORT=m 286CONFIG_INET_XFRM_MODE_TRANSPORT=y
286CONFIG_INET_XFRM_MODE_TUNNEL=m 287CONFIG_INET_XFRM_MODE_TUNNEL=y
288CONFIG_INET_XFRM_MODE_BEET=y
287CONFIG_INET_DIAG=y 289CONFIG_INET_DIAG=y
288CONFIG_INET_TCP_DIAG=y 290CONFIG_INET_TCP_DIAG=y
289# CONFIG_TCP_CONG_ADVANCED is not set 291# CONFIG_TCP_CONG_ADVANCED is not set
290CONFIG_TCP_CONG_BIC=y 292CONFIG_TCP_CONG_CUBIC=y
293CONFIG_DEFAULT_TCP_CONG="cubic"
291 294
292# 295#
293# IP: Virtual Server Configuration 296# IP: Virtual Server Configuration
@@ -300,12 +303,18 @@ CONFIG_IPV6_ROUTE_INFO=y
300# CONFIG_INET6_AH is not set 303# CONFIG_INET6_AH is not set
301# CONFIG_INET6_ESP is not set 304# CONFIG_INET6_ESP is not set
302# CONFIG_INET6_IPCOMP is not set 305# CONFIG_INET6_IPCOMP is not set
306# CONFIG_IPV6_MIP6 is not set
303# CONFIG_INET6_XFRM_TUNNEL is not set 307# CONFIG_INET6_XFRM_TUNNEL is not set
304# CONFIG_INET6_TUNNEL is not set 308# CONFIG_INET6_TUNNEL is not set
305CONFIG_INET6_XFRM_MODE_TRANSPORT=m 309CONFIG_INET6_XFRM_MODE_TRANSPORT=m
306CONFIG_INET6_XFRM_MODE_TUNNEL=m 310CONFIG_INET6_XFRM_MODE_TUNNEL=m
311CONFIG_INET6_XFRM_MODE_BEET=m
312# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
313CONFIG_IPV6_SIT=m
307# CONFIG_IPV6_TUNNEL is not set 314# CONFIG_IPV6_TUNNEL is not set
308CONFIG_NETWORK_SECMARK=y 315# CONFIG_IPV6_SUBTREES is not set
316# CONFIG_IPV6_MULTIPLE_TABLES is not set
317# CONFIG_NETWORK_SECMARK is not set
309CONFIG_NETFILTER=y 318CONFIG_NETFILTER=y
310# CONFIG_NETFILTER_DEBUG is not set 319# CONFIG_NETFILTER_DEBUG is not set
311 320
@@ -318,9 +327,9 @@ CONFIG_NETFILTER_XTABLES=m
318CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 327CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
319CONFIG_NETFILTER_XT_TARGET_MARK=m 328CONFIG_NETFILTER_XT_TARGET_MARK=m
320CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 329CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
321CONFIG_NETFILTER_XT_TARGET_SECMARK=m
322CONFIG_NETFILTER_XT_MATCH_COMMENT=m 330CONFIG_NETFILTER_XT_MATCH_COMMENT=m
323CONFIG_NETFILTER_XT_MATCH_DCCP=m 331CONFIG_NETFILTER_XT_MATCH_DCCP=m
332# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
324CONFIG_NETFILTER_XT_MATCH_ESP=m 333CONFIG_NETFILTER_XT_MATCH_ESP=m
325CONFIG_NETFILTER_XT_MATCH_LENGTH=m 334CONFIG_NETFILTER_XT_MATCH_LENGTH=m
326CONFIG_NETFILTER_XT_MATCH_LIMIT=m 335CONFIG_NETFILTER_XT_MATCH_LIMIT=m
@@ -329,10 +338,10 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
329# CONFIG_NETFILTER_XT_MATCH_POLICY is not set 338# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
330CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 339CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
331CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 340CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
332CONFIG_NETFILTER_XT_MATCH_QUOTA=m 341# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
333CONFIG_NETFILTER_XT_MATCH_REALM=m 342CONFIG_NETFILTER_XT_MATCH_REALM=m
334CONFIG_NETFILTER_XT_MATCH_SCTP=m 343CONFIG_NETFILTER_XT_MATCH_SCTP=m
335CONFIG_NETFILTER_XT_MATCH_STATISTIC=m 344# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
336CONFIG_NETFILTER_XT_MATCH_STRING=m 345CONFIG_NETFILTER_XT_MATCH_STRING=m
337CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 346CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
338 347
@@ -373,7 +382,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
373# CONFIG_ATALK is not set 382# CONFIG_ATALK is not set
374# CONFIG_X25 is not set 383# CONFIG_X25 is not set
375# CONFIG_LAPB is not set 384# CONFIG_LAPB is not set
376# CONFIG_NET_DIVERT is not set
377# CONFIG_ECONET is not set 385# CONFIG_ECONET is not set
378# CONFIG_WAN_ROUTER is not set 386# CONFIG_WAN_ROUTER is not set
379 387
@@ -426,13 +434,20 @@ CONFIG_FW_LOADER=y
426# 434#
427# Block devices 435# Block devices
428# 436#
437# CONFIG_BLK_CPQ_DA is not set
438# CONFIG_BLK_CPQ_CISS_DA is not set
439# CONFIG_BLK_DEV_DAC960 is not set
440# CONFIG_BLK_DEV_UMEM is not set
429# CONFIG_BLK_DEV_COW_COMMON is not set 441# CONFIG_BLK_DEV_COW_COMMON is not set
430CONFIG_BLK_DEV_LOOP=y 442CONFIG_BLK_DEV_LOOP=y
431# CONFIG_BLK_DEV_CRYPTOLOOP is not set 443# CONFIG_BLK_DEV_CRYPTOLOOP is not set
432# CONFIG_BLK_DEV_NBD is not set 444# CONFIG_BLK_DEV_NBD is not set
445# CONFIG_BLK_DEV_SX8 is not set
446# CONFIG_BLK_DEV_UB is not set
433CONFIG_BLK_DEV_RAM=y 447CONFIG_BLK_DEV_RAM=y
434CONFIG_BLK_DEV_RAM_COUNT=16 448CONFIG_BLK_DEV_RAM_COUNT=16
435CONFIG_BLK_DEV_RAM_SIZE=8192 449CONFIG_BLK_DEV_RAM_SIZE=8192
450CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
436CONFIG_BLK_DEV_INITRD=y 451CONFIG_BLK_DEV_INITRD=y
437# CONFIG_CDROM_PKTCDVD is not set 452# CONFIG_CDROM_PKTCDVD is not set
438# CONFIG_ATA_OVER_ETH is not set 453# CONFIG_ATA_OVER_ETH is not set
@@ -441,6 +456,7 @@ CONFIG_BLK_DEV_INITRD=y
441# ATA/ATAPI/MFM/RLL support 456# ATA/ATAPI/MFM/RLL support
442# 457#
443CONFIG_IDE=y 458CONFIG_IDE=y
459CONFIG_IDE_MAX_HWIFS=4
444CONFIG_BLK_DEV_IDE=y 460CONFIG_BLK_DEV_IDE=y
445 461
446# 462#
@@ -459,9 +475,41 @@ CONFIG_IDEDISK_MULTI_MODE=y
459# IDE chipset support/bugfixes 475# IDE chipset support/bugfixes
460# 476#
461CONFIG_IDE_GENERIC=y 477CONFIG_IDE_GENERIC=y
478CONFIG_BLK_DEV_IDEPCI=y
479CONFIG_IDEPCI_SHARE_IRQ=y
480# CONFIG_BLK_DEV_OFFBOARD is not set
481# CONFIG_BLK_DEV_GENERIC is not set
482# CONFIG_BLK_DEV_OPTI621 is not set
483CONFIG_BLK_DEV_IDEDMA_PCI=y
484# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
485CONFIG_IDEDMA_PCI_AUTO=y
486# CONFIG_IDEDMA_ONLYDISK is not set
487# CONFIG_BLK_DEV_AEC62XX is not set
488# CONFIG_BLK_DEV_ALI15X3 is not set
489# CONFIG_BLK_DEV_AMD74XX is not set
490CONFIG_BLK_DEV_CMD64X=y
491# CONFIG_BLK_DEV_TRIFLEX is not set
492# CONFIG_BLK_DEV_CY82C693 is not set
493# CONFIG_BLK_DEV_CS5520 is not set
494# CONFIG_BLK_DEV_CS5530 is not set
495# CONFIG_BLK_DEV_HPT34X is not set
496# CONFIG_BLK_DEV_HPT366 is not set
497# CONFIG_BLK_DEV_JMICRON is not set
498# CONFIG_BLK_DEV_SC1200 is not set
499# CONFIG_BLK_DEV_PIIX is not set
500# CONFIG_BLK_DEV_IT821X is not set
501# CONFIG_BLK_DEV_NS87415 is not set
502# CONFIG_BLK_DEV_PDC202XX_OLD is not set
503# CONFIG_BLK_DEV_PDC202XX_NEW is not set
504# CONFIG_BLK_DEV_SVWKS is not set
505# CONFIG_BLK_DEV_SIIMAGE is not set
506# CONFIG_BLK_DEV_SLC90E66 is not set
507# CONFIG_BLK_DEV_TRM290 is not set
508# CONFIG_BLK_DEV_VIA82CXXX is not set
462# CONFIG_IDE_ARM is not set 509# CONFIG_IDE_ARM is not set
463# CONFIG_BLK_DEV_IDEDMA is not set 510CONFIG_BLK_DEV_IDEDMA=y
464# CONFIG_IDEDMA_AUTO is not set 511# CONFIG_IDEDMA_IVB is not set
512CONFIG_IDEDMA_AUTO=y
465# CONFIG_BLK_DEV_HD is not set 513# CONFIG_BLK_DEV_HD is not set
466 514
467# 515#
@@ -469,6 +517,7 @@ CONFIG_IDE_GENERIC=y
469# 517#
470# CONFIG_RAID_ATTRS is not set 518# CONFIG_RAID_ATTRS is not set
471CONFIG_SCSI=y 519CONFIG_SCSI=y
520CONFIG_SCSI_NETLINK=y
472CONFIG_SCSI_PROC_FS=y 521CONFIG_SCSI_PROC_FS=y
473 522
474# 523#
@@ -489,22 +538,59 @@ CONFIG_BLK_DEV_SD=y
489# CONFIG_SCSI_LOGGING is not set 538# CONFIG_SCSI_LOGGING is not set
490 539
491# 540#
492# SCSI Transport Attributes 541# SCSI Transports
493# 542#
494CONFIG_SCSI_SPI_ATTRS=m 543CONFIG_SCSI_SPI_ATTRS=m
495CONFIG_SCSI_FC_ATTRS=y 544CONFIG_SCSI_FC_ATTRS=y
496CONFIG_SCSI_ISCSI_ATTRS=m 545CONFIG_SCSI_ISCSI_ATTRS=m
497# CONFIG_SCSI_SAS_ATTRS is not set 546# CONFIG_SCSI_SAS_ATTRS is not set
547# CONFIG_SCSI_SAS_LIBSAS is not set
498 548
499# 549#
500# SCSI low-level drivers 550# SCSI low-level drivers
501# 551#
502CONFIG_ISCSI_TCP=m 552CONFIG_ISCSI_TCP=m
503# CONFIG_SGIWD93_SCSI is not set 553# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
504# CONFIG_SCSI_SATA is not set 554# CONFIG_SCSI_3W_9XXX is not set
555# CONFIG_SCSI_ACARD is not set
556# CONFIG_SCSI_AACRAID is not set
557CONFIG_SCSI_AIC7XXX=m
558CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
559CONFIG_AIC7XXX_RESET_DELAY_MS=15000
560# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
561CONFIG_AIC7XXX_DEBUG_MASK=0
562# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
563# CONFIG_SCSI_AIC7XXX_OLD is not set
564# CONFIG_SCSI_AIC79XX is not set
565# CONFIG_SCSI_AIC94XX is not set
566# CONFIG_SCSI_DPT_I2O is not set
567# CONFIG_SCSI_ARCMSR is not set
568# CONFIG_MEGARAID_NEWGEN is not set
569# CONFIG_MEGARAID_LEGACY is not set
570# CONFIG_MEGARAID_SAS is not set
571# CONFIG_SCSI_HPTIOP is not set
572# CONFIG_SCSI_DMX3191D is not set
573# CONFIG_SCSI_FUTURE_DOMAIN is not set
574# CONFIG_SCSI_IPS is not set
575# CONFIG_SCSI_INITIO is not set
576# CONFIG_SCSI_INIA100 is not set
577# CONFIG_SCSI_STEX is not set
578# CONFIG_SCSI_SYM53C8XX_2 is not set
579# CONFIG_SCSI_QLOGIC_1280 is not set
580# CONFIG_SCSI_QLA_FC is not set
581# CONFIG_SCSI_QLA_ISCSI is not set
582# CONFIG_SCSI_LPFC is not set
583# CONFIG_SCSI_DC395x is not set
584# CONFIG_SCSI_DC390T is not set
585# CONFIG_SCSI_NSP32 is not set
505# CONFIG_SCSI_DEBUG is not set 586# CONFIG_SCSI_DEBUG is not set
506 587
507# 588#
589# Serial ATA (prod) and Parallel ATA (experimental) drivers
590#
591# CONFIG_ATA is not set
592
593#
508# Multi-device support (RAID and LVM) 594# Multi-device support (RAID and LVM)
509# 595#
510# CONFIG_MD is not set 596# CONFIG_MD is not set
@@ -513,14 +599,19 @@ CONFIG_ISCSI_TCP=m
513# Fusion MPT device support 599# Fusion MPT device support
514# 600#
515# CONFIG_FUSION is not set 601# CONFIG_FUSION is not set
602# CONFIG_FUSION_SPI is not set
603# CONFIG_FUSION_FC is not set
604# CONFIG_FUSION_SAS is not set
516 605
517# 606#
518# IEEE 1394 (FireWire) support 607# IEEE 1394 (FireWire) support
519# 608#
609# CONFIG_IEEE1394 is not set
520 610
521# 611#
522# I2O device support 612# I2O device support
523# 613#
614# CONFIG_I2O is not set
524 615
525# 616#
526# Network device support 617# Network device support
@@ -532,6 +623,11 @@ CONFIG_NETDEVICES=y
532CONFIG_TUN=m 623CONFIG_TUN=m
533 624
534# 625#
626# ARCnet devices
627#
628# CONFIG_ARCNET is not set
629
630#
535# PHY device support 631# PHY device support
536# 632#
537# CONFIG_PHYLIB is not set 633# CONFIG_PHYLIB is not set
@@ -541,20 +637,73 @@ CONFIG_TUN=m
541# 637#
542CONFIG_NET_ETHERNET=y 638CONFIG_NET_ETHERNET=y
543CONFIG_MII=y 639CONFIG_MII=y
640# CONFIG_HAPPYMEAL is not set
641# CONFIG_SUNGEM is not set
642# CONFIG_CASSINI is not set
643# CONFIG_NET_VENDOR_3COM is not set
544# CONFIG_DM9000 is not set 644# CONFIG_DM9000 is not set
545# CONFIG_SGISEEQ is not set 645
646#
647# Tulip family network device support
648#
649# CONFIG_NET_TULIP is not set
650# CONFIG_HP100 is not set
651CONFIG_NET_PCI=y
652# CONFIG_PCNET32 is not set
653# CONFIG_AMD8111_ETH is not set
654# CONFIG_ADAPTEC_STARFIRE is not set
655# CONFIG_B44 is not set
656# CONFIG_FORCEDETH is not set
657# CONFIG_DGRS is not set
658# CONFIG_EEPRO100 is not set
659# CONFIG_E100 is not set
660# CONFIG_FEALNX is not set
661CONFIG_NATSEMI=y
662# CONFIG_NE2K_PCI is not set
663# CONFIG_8139CP is not set
664CONFIG_8139TOO=y
665# CONFIG_8139TOO_PIO is not set
666# CONFIG_8139TOO_TUNE_TWISTER is not set
667# CONFIG_8139TOO_8129 is not set
668# CONFIG_8139_OLD_RX_RESET is not set
669# CONFIG_SIS900 is not set
670# CONFIG_EPIC100 is not set
671# CONFIG_SUNDANCE is not set
672# CONFIG_TLAN is not set
673# CONFIG_VIA_RHINE is not set
674# CONFIG_LAN_SAA9730 is not set
546 675
547# 676#
548# Ethernet (1000 Mbit) 677# Ethernet (1000 Mbit)
549# 678#
679# CONFIG_ACENIC is not set
680# CONFIG_DL2K is not set
681# CONFIG_E1000 is not set
682# CONFIG_NS83820 is not set
683# CONFIG_HAMACHI is not set
684# CONFIG_YELLOWFIN is not set
685# CONFIG_R8169 is not set
686# CONFIG_SIS190 is not set
687# CONFIG_SKGE is not set
688# CONFIG_SKY2 is not set
689# CONFIG_SK98LIN is not set
690# CONFIG_VIA_VELOCITY is not set
691# CONFIG_TIGON3 is not set
692# CONFIG_BNX2 is not set
693# CONFIG_QLA3XXX is not set
550 694
551# 695#
552# Ethernet (10000 Mbit) 696# Ethernet (10000 Mbit)
553# 697#
698# CONFIG_CHELSIO_T1 is not set
699# CONFIG_IXGB is not set
700# CONFIG_S2IO is not set
701# CONFIG_MYRI10GE is not set
554 702
555# 703#
556# Token Ring devices 704# Token Ring devices
557# 705#
706# CONFIG_TR is not set
558 707
559# 708#
560# Wireless LAN (non-hamradio) 709# Wireless LAN (non-hamradio)
@@ -565,6 +714,8 @@ CONFIG_MII=y
565# Wan interfaces 714# Wan interfaces
566# 715#
567# CONFIG_WAN is not set 716# CONFIG_WAN is not set
717# CONFIG_FDDI is not set
718# CONFIG_HIPPI is not set
568CONFIG_PPP=m 719CONFIG_PPP=m
569# CONFIG_PPP_MULTILINK is not set 720# CONFIG_PPP_MULTILINK is not set
570# CONFIG_PPP_FILTER is not set 721# CONFIG_PPP_FILTER is not set
@@ -575,6 +726,8 @@ CONFIG_PPP_DEFLATE=m
575CONFIG_PPP_MPPE=m 726CONFIG_PPP_MPPE=m
576# CONFIG_PPPOE is not set 727# CONFIG_PPPOE is not set
577# CONFIG_SLIP is not set 728# CONFIG_SLIP is not set
729CONFIG_SLHC=m
730# CONFIG_NET_FC is not set
578# CONFIG_SHAPER is not set 731# CONFIG_SHAPER is not set
579# CONFIG_NETCONSOLE is not set 732# CONFIG_NETCONSOLE is not set
580# CONFIG_NETPOLL is not set 733# CONFIG_NETPOLL is not set
@@ -594,6 +747,7 @@ CONFIG_PPP_MPPE=m
594# Input device support 747# Input device support
595# 748#
596CONFIG_INPUT=y 749CONFIG_INPUT=y
750# CONFIG_INPUT_FF_MEMLESS is not set
597 751
598# 752#
599# Userland interfaces 753# Userland interfaces
@@ -616,6 +770,7 @@ CONFIG_KEYBOARD_ATKBD=y
616# CONFIG_KEYBOARD_LKKBD is not set 770# CONFIG_KEYBOARD_LKKBD is not set
617# CONFIG_KEYBOARD_XTKBD is not set 771# CONFIG_KEYBOARD_XTKBD is not set
618# CONFIG_KEYBOARD_NEWTON is not set 772# CONFIG_KEYBOARD_NEWTON is not set
773# CONFIG_KEYBOARD_STOWAWAY is not set
619CONFIG_INPUT_MOUSE=y 774CONFIG_INPUT_MOUSE=y
620CONFIG_MOUSE_PS2=y 775CONFIG_MOUSE_PS2=y
621# CONFIG_MOUSE_SERIAL is not set 776# CONFIG_MOUSE_SERIAL is not set
@@ -630,6 +785,7 @@ CONFIG_MOUSE_PS2=y
630CONFIG_SERIO=y 785CONFIG_SERIO=y
631CONFIG_SERIO_I8042=y 786CONFIG_SERIO_I8042=y
632CONFIG_SERIO_SERPORT=y 787CONFIG_SERIO_SERPORT=y
788# CONFIG_SERIO_PCIPS2 is not set
633CONFIG_SERIO_LIBPS2=y 789CONFIG_SERIO_LIBPS2=y
634# CONFIG_SERIO_RAW is not set 790# CONFIG_SERIO_RAW is not set
635# CONFIG_GAMEPORT is not set 791# CONFIG_GAMEPORT is not set
@@ -640,7 +796,7 @@ CONFIG_SERIO_LIBPS2=y
640CONFIG_VT=y 796CONFIG_VT=y
641# CONFIG_VT_CONSOLE is not set 797# CONFIG_VT_CONSOLE is not set
642CONFIG_HW_CONSOLE=y 798CONFIG_HW_CONSOLE=y
643CONFIG_VT_HW_CONSOLE_BINDING=y 799# CONFIG_VT_HW_CONSOLE_BINDING is not set
644CONFIG_SERIAL_NONSTANDARD=y 800CONFIG_SERIAL_NONSTANDARD=y
645# CONFIG_COMPUTONE is not set 801# CONFIG_COMPUTONE is not set
646# CONFIG_ROCKETPORT is not set 802# CONFIG_ROCKETPORT is not set
@@ -650,6 +806,7 @@ CONFIG_SERIAL_NONSTANDARD=y
650# CONFIG_MOXA_SMARTIO is not set 806# CONFIG_MOXA_SMARTIO is not set
651# CONFIG_ISI is not set 807# CONFIG_ISI is not set
652# CONFIG_SYNCLINKMP is not set 808# CONFIG_SYNCLINKMP is not set
809# CONFIG_SYNCLINK_GT is not set
653# CONFIG_N_HDLC is not set 810# CONFIG_N_HDLC is not set
654# CONFIG_RISCOM8 is not set 811# CONFIG_RISCOM8 is not set
655# CONFIG_SPECIALIX is not set 812# CONFIG_SPECIALIX is not set
@@ -665,7 +822,8 @@ CONFIG_SERIAL_NONSTANDARD=y
665# 822#
666# Non-8250 serial port support 823# Non-8250 serial port support
667# 824#
668# CONFIG_SERIAL_IP22_ZILOG is not set 825# CONFIG_SERIAL_IP3106 is not set
826# CONFIG_SERIAL_JSM is not set
669CONFIG_UNIX98_PTYS=y 827CONFIG_UNIX98_PTYS=y
670CONFIG_LEGACY_PTYS=y 828CONFIG_LEGACY_PTYS=y
671CONFIG_LEGACY_PTY_COUNT=256 829CONFIG_LEGACY_PTY_COUNT=256
@@ -679,16 +837,17 @@ CONFIG_LEGACY_PTY_COUNT=256
679# Watchdog Cards 837# Watchdog Cards
680# 838#
681# CONFIG_WATCHDOG is not set 839# CONFIG_WATCHDOG is not set
682# CONFIG_HW_RANDOM is not set 840CONFIG_HW_RANDOM=y
683# CONFIG_RTC is not set 841# CONFIG_RTC is not set
684# CONFIG_SGI_DS1286 is not set
685# CONFIG_GEN_RTC is not set 842# CONFIG_GEN_RTC is not set
686# CONFIG_DTLK is not set 843# CONFIG_DTLK is not set
687# CONFIG_R3964 is not set 844# CONFIG_R3964 is not set
845# CONFIG_APPLICOM is not set
688 846
689# 847#
690# Ftape, the floppy tape device driver 848# Ftape, the floppy tape device driver
691# 849#
850# CONFIG_DRM is not set
692# CONFIG_RAW_DRIVER is not set 851# CONFIG_RAW_DRIVER is not set
693 852
694# 853#
@@ -709,14 +868,30 @@ CONFIG_I2C_CHARDEV=m
709CONFIG_I2C_ALGOBIT=m 868CONFIG_I2C_ALGOBIT=m
710# CONFIG_I2C_ALGOPCF is not set 869# CONFIG_I2C_ALGOPCF is not set
711# CONFIG_I2C_ALGOPCA is not set 870# CONFIG_I2C_ALGOPCA is not set
712# CONFIG_I2C_ALGO_SGI is not set
713 871
714# 872#
715# I2C Hardware Bus support 873# I2C Hardware Bus support
716# 874#
875# CONFIG_I2C_ALI1535 is not set
876# CONFIG_I2C_ALI1563 is not set
877# CONFIG_I2C_ALI15X3 is not set
878# CONFIG_I2C_AMD756 is not set
879# CONFIG_I2C_AMD8111 is not set
880# CONFIG_I2C_I801 is not set
881# CONFIG_I2C_I810 is not set
882# CONFIG_I2C_PIIX4 is not set
883# CONFIG_I2C_NFORCE2 is not set
717# CONFIG_I2C_OCORES is not set 884# CONFIG_I2C_OCORES is not set
718# CONFIG_I2C_PARPORT_LIGHT is not set 885# CONFIG_I2C_PARPORT_LIGHT is not set
886# CONFIG_I2C_PROSAVAGE is not set
887# CONFIG_I2C_SAVAGE4 is not set
888# CONFIG_I2C_SIS5595 is not set
889# CONFIG_I2C_SIS630 is not set
890# CONFIG_I2C_SIS96X is not set
719# CONFIG_I2C_STUB is not set 891# CONFIG_I2C_STUB is not set
892# CONFIG_I2C_VIA is not set
893# CONFIG_I2C_VIAPRO is not set
894# CONFIG_I2C_VOODOO3 is not set
720# CONFIG_I2C_PCA_ISA is not set 895# CONFIG_I2C_PCA_ISA is not set
721 896
722# 897#
@@ -776,9 +951,13 @@ CONFIG_HWMON=y
776# CONFIG_SENSORS_LM92 is not set 951# CONFIG_SENSORS_LM92 is not set
777# CONFIG_SENSORS_MAX1619 is not set 952# CONFIG_SENSORS_MAX1619 is not set
778# CONFIG_SENSORS_PC87360 is not set 953# CONFIG_SENSORS_PC87360 is not set
954# CONFIG_SENSORS_SIS5595 is not set
779# CONFIG_SENSORS_SMSC47M1 is not set 955# CONFIG_SENSORS_SMSC47M1 is not set
780# CONFIG_SENSORS_SMSC47M192 is not set 956# CONFIG_SENSORS_SMSC47M192 is not set
781# CONFIG_SENSORS_SMSC47B397 is not set 957# CONFIG_SENSORS_SMSC47B397 is not set
958# CONFIG_SENSORS_VIA686A is not set
959# CONFIG_SENSORS_VT1211 is not set
960# CONFIG_SENSORS_VT8231 is not set
782# CONFIG_SENSORS_W83781D is not set 961# CONFIG_SENSORS_W83781D is not set
783# CONFIG_SENSORS_W83791D is not set 962# CONFIG_SENSORS_W83791D is not set
784# CONFIG_SENSORS_W83792D is not set 963# CONFIG_SENSORS_W83792D is not set
@@ -790,23 +969,25 @@ CONFIG_HWMON=y
790# 969#
791# Misc devices 970# Misc devices
792# 971#
972# CONFIG_TIFM_CORE is not set
793 973
794# 974#
795# Multimedia devices 975# Multimedia devices
796# 976#
797# CONFIG_VIDEO_DEV is not set 977# CONFIG_VIDEO_DEV is not set
798CONFIG_VIDEO_V4L2=y
799 978
800# 979#
801# Digital Video Broadcasting Devices 980# Digital Video Broadcasting Devices
802# 981#
803# CONFIG_DVB is not set 982# CONFIG_DVB is not set
983# CONFIG_USB_DABUSB is not set
804 984
805# 985#
806# Graphics support 986# Graphics support
807# 987#
808# CONFIG_FIRMWARE_EDID is not set 988CONFIG_FIRMWARE_EDID=y
809CONFIG_FB=y 989CONFIG_FB=y
990# CONFIG_FB_DDC is not set
810# CONFIG_FB_CFB_FILLRECT is not set 991# CONFIG_FB_CFB_FILLRECT is not set
811# CONFIG_FB_CFB_COPYAREA is not set 992# CONFIG_FB_CFB_COPYAREA is not set
812# CONFIG_FB_CFB_IMAGEBLIT is not set 993# CONFIG_FB_CFB_IMAGEBLIT is not set
@@ -814,14 +995,32 @@ CONFIG_FB=y
814# CONFIG_FB_BACKLIGHT is not set 995# CONFIG_FB_BACKLIGHT is not set
815# CONFIG_FB_MODE_HELPERS is not set 996# CONFIG_FB_MODE_HELPERS is not set
816# CONFIG_FB_TILEBLITTING is not set 997# CONFIG_FB_TILEBLITTING is not set
998# CONFIG_FB_CIRRUS is not set
999# CONFIG_FB_PM2 is not set
1000# CONFIG_FB_CYBER2000 is not set
1001# CONFIG_FB_ASILIANT is not set
1002# CONFIG_FB_IMSTT is not set
817# CONFIG_FB_S1D13XXX is not set 1003# CONFIG_FB_S1D13XXX is not set
1004# CONFIG_FB_NVIDIA is not set
1005# CONFIG_FB_RIVA is not set
1006# CONFIG_FB_MATROX is not set
1007# CONFIG_FB_RADEON is not set
1008# CONFIG_FB_ATY128 is not set
1009# CONFIG_FB_ATY is not set
1010# CONFIG_FB_SAVAGE is not set
1011# CONFIG_FB_SIS is not set
1012# CONFIG_FB_NEOMAGIC is not set
1013# CONFIG_FB_KYRO is not set
1014# CONFIG_FB_3DFX is not set
1015# CONFIG_FB_VOODOO1 is not set
1016# CONFIG_FB_SMIVGX is not set
1017# CONFIG_FB_TRIDENT is not set
818# CONFIG_FB_VIRTUAL is not set 1018# CONFIG_FB_VIRTUAL is not set
819 1019
820# 1020#
821# Console display driver support 1021# Console display driver support
822# 1022#
823# CONFIG_VGA_CONSOLE is not set 1023# CONFIG_VGA_CONSOLE is not set
824# CONFIG_SGI_NEWPORT_CONSOLE is not set
825CONFIG_DUMMY_CONSOLE=y 1024CONFIG_DUMMY_CONSOLE=y
826# CONFIG_FRAMEBUFFER_CONSOLE is not set 1025# CONFIG_FRAMEBUFFER_CONSOLE is not set
827 1026
@@ -839,15 +1038,129 @@ CONFIG_DUMMY_CONSOLE=y
839# 1038#
840# USB support 1039# USB support
841# 1040#
842# CONFIG_USB_ARCH_HAS_HCD is not set 1041CONFIG_USB_ARCH_HAS_HCD=y
843# CONFIG_USB_ARCH_HAS_OHCI is not set 1042CONFIG_USB_ARCH_HAS_OHCI=y
844# CONFIG_USB_ARCH_HAS_EHCI is not set 1043CONFIG_USB_ARCH_HAS_EHCI=y
1044CONFIG_USB=y
1045# CONFIG_USB_DEBUG is not set
1046
1047#
1048# Miscellaneous USB options
1049#
1050CONFIG_USB_DEVICEFS=y
1051# CONFIG_USB_BANDWIDTH is not set
1052# CONFIG_USB_DYNAMIC_MINORS is not set
1053# CONFIG_USB_OTG is not set
1054
1055#
1056# USB Host Controller Drivers
1057#
1058# CONFIG_USB_EHCI_HCD is not set
1059# CONFIG_USB_ISP116X_HCD is not set
1060# CONFIG_USB_OHCI_HCD is not set
1061# CONFIG_USB_UHCI_HCD is not set
1062# CONFIG_USB_SL811_HCD is not set
1063
1064#
1065# USB Device Class drivers
1066#
1067# CONFIG_USB_ACM is not set
1068# CONFIG_USB_PRINTER is not set
845 1069
846# 1070#
847# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1071# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
848# 1072#
849 1073
850# 1074#
1075# may also be needed; see USB_STORAGE Help for more information
1076#
1077CONFIG_USB_STORAGE=y
1078# CONFIG_USB_STORAGE_DEBUG is not set
1079# CONFIG_USB_STORAGE_DATAFAB is not set
1080# CONFIG_USB_STORAGE_FREECOM is not set
1081# CONFIG_USB_STORAGE_ISD200 is not set
1082# CONFIG_USB_STORAGE_DPCM is not set
1083# CONFIG_USB_STORAGE_USBAT is not set
1084# CONFIG_USB_STORAGE_SDDR09 is not set
1085# CONFIG_USB_STORAGE_SDDR55 is not set
1086# CONFIG_USB_STORAGE_JUMPSHOT is not set
1087# CONFIG_USB_STORAGE_ALAUDA is not set
1088# CONFIG_USB_STORAGE_ONETOUCH is not set
1089# CONFIG_USB_STORAGE_KARMA is not set
1090# CONFIG_USB_LIBUSUAL is not set
1091
1092#
1093# USB Input Devices
1094#
1095CONFIG_USB_HID=y
1096CONFIG_USB_HIDINPUT=y
1097# CONFIG_USB_HIDINPUT_POWERBOOK is not set
1098# CONFIG_HID_FF is not set
1099CONFIG_USB_HIDDEV=y
1100# CONFIG_USB_AIPTEK is not set
1101# CONFIG_USB_WACOM is not set
1102# CONFIG_USB_ACECAD is not set
1103# CONFIG_USB_KBTAB is not set
1104# CONFIG_USB_POWERMATE is not set
1105# CONFIG_USB_TOUCHSCREEN is not set
1106# CONFIG_USB_YEALINK is not set
1107# CONFIG_USB_XPAD is not set
1108# CONFIG_USB_ATI_REMOTE is not set
1109# CONFIG_USB_ATI_REMOTE2 is not set
1110# CONFIG_USB_KEYSPAN_REMOTE is not set
1111# CONFIG_USB_APPLETOUCH is not set
1112# CONFIG_USB_TRANCEVIBRATOR is not set
1113
1114#
1115# USB Imaging devices
1116#
1117# CONFIG_USB_MDC800 is not set
1118# CONFIG_USB_MICROTEK is not set
1119
1120#
1121# USB Network Adapters
1122#
1123# CONFIG_USB_CATC is not set
1124# CONFIG_USB_KAWETH is not set
1125# CONFIG_USB_PEGASUS is not set
1126# CONFIG_USB_RTL8150 is not set
1127# CONFIG_USB_USBNET is not set
1128CONFIG_USB_MON=y
1129
1130#
1131# USB port drivers
1132#
1133
1134#
1135# USB Serial Converter support
1136#
1137# CONFIG_USB_SERIAL is not set
1138
1139#
1140# USB Miscellaneous drivers
1141#
1142# CONFIG_USB_EMI62 is not set
1143# CONFIG_USB_EMI26 is not set
1144# CONFIG_USB_ADUTUX is not set
1145# CONFIG_USB_AUERSWALD is not set
1146# CONFIG_USB_RIO500 is not set
1147# CONFIG_USB_LEGOTOWER is not set
1148# CONFIG_USB_LCD is not set
1149# CONFIG_USB_LED is not set
1150# CONFIG_USB_CYPRESS_CY7C63 is not set
1151# CONFIG_USB_CYTHERM is not set
1152# CONFIG_USB_PHIDGET is not set
1153# CONFIG_USB_IDMOUSE is not set
1154# CONFIG_USB_FTDI_ELAN is not set
1155# CONFIG_USB_APPLEDISPLAY is not set
1156# CONFIG_USB_LD is not set
1157# CONFIG_USB_TEST is not set
1158
1159#
1160# USB DSL modem support
1161#
1162
1163#
851# USB Gadget Support 1164# USB Gadget Support
852# 1165#
853# CONFIG_USB_GADGET is not set 1166# CONFIG_USB_GADGET is not set
@@ -873,6 +1186,7 @@ CONFIG_DUMMY_CONSOLE=y
873# 1186#
874# InfiniBand support 1187# InfiniBand support
875# 1188#
1189# CONFIG_INFINIBAND is not set
876 1190
877# 1191#
878# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 1192# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
@@ -906,6 +1220,7 @@ CONFIG_EXT3_FS=y
906CONFIG_EXT3_FS_XATTR=y 1220CONFIG_EXT3_FS_XATTR=y
907# CONFIG_EXT3_FS_POSIX_ACL is not set 1221# CONFIG_EXT3_FS_POSIX_ACL is not set
908# CONFIG_EXT3_FS_SECURITY is not set 1222# CONFIG_EXT3_FS_SECURITY is not set
1223# CONFIG_EXT4DEV_FS is not set
909CONFIG_JBD=y 1224CONFIG_JBD=y
910# CONFIG_JBD_DEBUG is not set 1225# CONFIG_JBD_DEBUG is not set
911CONFIG_FS_MBCACHE=y 1226CONFIG_FS_MBCACHE=y
@@ -917,6 +1232,7 @@ CONFIG_XFS_FS=m
917# CONFIG_XFS_SECURITY is not set 1232# CONFIG_XFS_SECURITY is not set
918# CONFIG_XFS_POSIX_ACL is not set 1233# CONFIG_XFS_POSIX_ACL is not set
919# CONFIG_XFS_RT is not set 1234# CONFIG_XFS_RT is not set
1235# CONFIG_GFS2_FS is not set
920# CONFIG_OCFS2_FS is not set 1236# CONFIG_OCFS2_FS is not set
921# CONFIG_MINIX_FS is not set 1237# CONFIG_MINIX_FS is not set
922# CONFIG_ROMFS_FS is not set 1238# CONFIG_ROMFS_FS is not set
@@ -949,8 +1265,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
949# 1265#
950CONFIG_PROC_FS=y 1266CONFIG_PROC_FS=y
951# CONFIG_PROC_KCORE is not set 1267# CONFIG_PROC_KCORE is not set
1268CONFIG_PROC_SYSCTL=y
952CONFIG_SYSFS=y 1269CONFIG_SYSFS=y
953CONFIG_TMPFS=y 1270CONFIG_TMPFS=y
1271# CONFIG_TMPFS_POSIX_ACL is not set
954# CONFIG_HUGETLB_PAGE is not set 1272# CONFIG_HUGETLB_PAGE is not set
955CONFIG_RAMFS=y 1273CONFIG_RAMFS=y
956# CONFIG_CONFIGFS_FS is not set 1274# CONFIG_CONFIGFS_FS is not set
@@ -994,7 +1312,6 @@ CONFIG_SUNRPC=y
994CONFIG_SMB_FS=m 1312CONFIG_SMB_FS=m
995# CONFIG_SMB_NLS_DEFAULT is not set 1313# CONFIG_SMB_NLS_DEFAULT is not set
996# CONFIG_CIFS is not set 1314# CONFIG_CIFS is not set
997# CONFIG_CIFS_DEBUG2 is not set
998# CONFIG_NCP_FS is not set 1315# CONFIG_NCP_FS is not set
999# CONFIG_CODA_FS is not set 1316# CONFIG_CODA_FS is not set
1000# CONFIG_AFS_FS is not set 1317# CONFIG_AFS_FS is not set
@@ -1005,7 +1322,6 @@ CONFIG_SMB_FS=m
1005# 1322#
1006# CONFIG_PARTITION_ADVANCED is not set 1323# CONFIG_PARTITION_ADVANCED is not set
1007CONFIG_MSDOS_PARTITION=y 1324CONFIG_MSDOS_PARTITION=y
1008CONFIG_SGI_PARTITION=y
1009 1325
1010# 1326#
1011# Native Language Support 1327# Native Language Support
@@ -1061,11 +1377,13 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1061# 1377#
1062CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1378CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1063# CONFIG_PRINTK_TIME is not set 1379# CONFIG_PRINTK_TIME is not set
1380CONFIG_ENABLE_MUST_CHECK=y
1064# CONFIG_MAGIC_SYSRQ is not set 1381# CONFIG_MAGIC_SYSRQ is not set
1065# CONFIG_UNUSED_SYMBOLS is not set 1382# CONFIG_UNUSED_SYMBOLS is not set
1066# CONFIG_DEBUG_KERNEL is not set 1383# CONFIG_DEBUG_KERNEL is not set
1067CONFIG_LOG_BUF_SHIFT=14 1384CONFIG_LOG_BUF_SHIFT=14
1068# CONFIG_DEBUG_FS is not set 1385# CONFIG_DEBUG_FS is not set
1386# CONFIG_HEADERS_CHECK is not set
1069CONFIG_CROSSCOMPILE=y 1387CONFIG_CROSSCOMPILE=y
1070CONFIG_CMDLINE="" 1388CONFIG_CMDLINE=""
1071 1389
@@ -1079,6 +1397,9 @@ CONFIG_CMDLINE=""
1079# Cryptographic options 1397# Cryptographic options
1080# 1398#
1081CONFIG_CRYPTO=y 1399CONFIG_CRYPTO=y
1400CONFIG_CRYPTO_ALGAPI=m
1401CONFIG_CRYPTO_BLKCIPHER=m
1402CONFIG_CRYPTO_MANAGER=m
1082# CONFIG_CRYPTO_HMAC is not set 1403# CONFIG_CRYPTO_HMAC is not set
1083# CONFIG_CRYPTO_NULL is not set 1404# CONFIG_CRYPTO_NULL is not set
1084# CONFIG_CRYPTO_MD4 is not set 1405# CONFIG_CRYPTO_MD4 is not set
@@ -1088,6 +1409,8 @@ CONFIG_CRYPTO_SHA1=m
1088# CONFIG_CRYPTO_SHA512 is not set 1409# CONFIG_CRYPTO_SHA512 is not set
1089# CONFIG_CRYPTO_WP512 is not set 1410# CONFIG_CRYPTO_WP512 is not set
1090# CONFIG_CRYPTO_TGR192 is not set 1411# CONFIG_CRYPTO_TGR192 is not set
1412CONFIG_CRYPTO_ECB=m
1413CONFIG_CRYPTO_CBC=m
1091# CONFIG_CRYPTO_DES is not set 1414# CONFIG_CRYPTO_DES is not set
1092# CONFIG_CRYPTO_BLOWFISH is not set 1415# CONFIG_CRYPTO_BLOWFISH is not set
1093# CONFIG_CRYPTO_TWOFISH is not set 1416# CONFIG_CRYPTO_TWOFISH is not set
diff --git a/arch/mips/configs/tb0287_defconfig b/arch/mips/configs/tb0287_defconfig
index ad7271b3f26..f7e8194809a 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.18-rc1 3# Linux kernel version: 2.6.19-rc2
4# Thu Jul 6 10:04:21 2006 4# Wed Oct 18 12:57:11 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -25,8 +25,6 @@ CONFIG_MIPS=y
25# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
26# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
27# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
28# CONFIG_MIPS_IVR is not set
29# CONFIG_MIPS_ITE8172 is not set
30# CONFIG_MACH_JAZZ is not set 28# CONFIG_MACH_JAZZ is not set
31# CONFIG_LASAT is not set 29# CONFIG_LASAT is not set
32# CONFIG_MIPS_ATLAS is not set 30# CONFIG_MIPS_ATLAS is not set
@@ -72,11 +70,11 @@ CONFIG_TANBAC_TB0287=y
72# CONFIG_VICTOR_MPC30X is not set 70# CONFIG_VICTOR_MPC30X is not set
73# CONFIG_ZAO_CAPCELLA is not set 71# CONFIG_ZAO_CAPCELLA is not set
74CONFIG_PCI_VR41XX=y 72CONFIG_PCI_VR41XX=y
75# CONFIG_VRC4173 is not set
76CONFIG_RWSEM_GENERIC_SPINLOCK=y 73CONFIG_RWSEM_GENERIC_SPINLOCK=y
77CONFIG_GENERIC_FIND_NEXT_BIT=y 74CONFIG_GENERIC_FIND_NEXT_BIT=y
78CONFIG_GENERIC_HWEIGHT=y 75CONFIG_GENERIC_HWEIGHT=y
79CONFIG_GENERIC_CALIBRATE_DELAY=y 76CONFIG_GENERIC_CALIBRATE_DELAY=y
77CONFIG_GENERIC_TIME=y
80CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 78CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
81CONFIG_DMA_NONCOHERENT=y 79CONFIG_DMA_NONCOHERENT=y
82CONFIG_DMA_NEED_PCI_MAP_STATE=y 80CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -123,8 +121,8 @@ CONFIG_PAGE_SIZE_4KB=y
123# CONFIG_PAGE_SIZE_16KB is not set 121# CONFIG_PAGE_SIZE_16KB is not set
124# CONFIG_PAGE_SIZE_64KB is not set 122# CONFIG_PAGE_SIZE_64KB is not set
125CONFIG_MIPS_MT_DISABLED=y 123CONFIG_MIPS_MT_DISABLED=y
126# CONFIG_MIPS_MT_SMTC is not set
127# CONFIG_MIPS_MT_SMP is not set 124# CONFIG_MIPS_MT_SMP is not set
125# CONFIG_MIPS_MT_SMTC is not set
128# CONFIG_MIPS_VPE_LOADER is not set 126# CONFIG_MIPS_VPE_LOADER is not set
129CONFIG_CPU_HAS_SYNC=y 127CONFIG_CPU_HAS_SYNC=y
130CONFIG_GENERIC_HARDIRQS=y 128CONFIG_GENERIC_HARDIRQS=y
@@ -169,15 +167,19 @@ CONFIG_LOCALVERSION=""
169CONFIG_LOCALVERSION_AUTO=y 167CONFIG_LOCALVERSION_AUTO=y
170CONFIG_SWAP=y 168CONFIG_SWAP=y
171CONFIG_SYSVIPC=y 169CONFIG_SYSVIPC=y
170# CONFIG_IPC_NS is not set
172# CONFIG_POSIX_MQUEUE is not set 171# CONFIG_POSIX_MQUEUE is not set
173# CONFIG_BSD_PROCESS_ACCT is not set 172# CONFIG_BSD_PROCESS_ACCT is not set
174CONFIG_SYSCTL=y 173# CONFIG_TASKSTATS is not set
174# CONFIG_UTS_NS is not set
175# CONFIG_AUDIT is not set 175# CONFIG_AUDIT is not set
176# CONFIG_IKCONFIG is not set 176# CONFIG_IKCONFIG is not set
177# CONFIG_RELAY is not set 177# CONFIG_RELAY is not set
178CONFIG_INITRAMFS_SOURCE="" 178CONFIG_INITRAMFS_SOURCE=""
179# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 179# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
180CONFIG_SYSCTL=y
180CONFIG_EMBEDDED=y 181CONFIG_EMBEDDED=y
182# CONFIG_SYSCTL_SYSCALL is not set
181CONFIG_KALLSYMS=y 183CONFIG_KALLSYMS=y
182# CONFIG_KALLSYMS_EXTRA_PASS is not set 184# CONFIG_KALLSYMS_EXTRA_PASS is not set
183# CONFIG_HOTPLUG is not set 185# CONFIG_HOTPLUG is not set
@@ -185,12 +187,12 @@ CONFIG_PRINTK=y
185CONFIG_BUG=y 187CONFIG_BUG=y
186CONFIG_ELF_CORE=y 188CONFIG_ELF_CORE=y
187CONFIG_BASE_FULL=y 189CONFIG_BASE_FULL=y
188CONFIG_RT_MUTEXES=y
189CONFIG_FUTEX=y 190CONFIG_FUTEX=y
190CONFIG_EPOLL=y 191CONFIG_EPOLL=y
191CONFIG_SHMEM=y 192CONFIG_SHMEM=y
192CONFIG_SLAB=y 193CONFIG_SLAB=y
193CONFIG_VM_EVENT_COUNTERS=y 194CONFIG_VM_EVENT_COUNTERS=y
195CONFIG_RT_MUTEXES=y
194# CONFIG_TINY_SHMEM is not set 196# CONFIG_TINY_SHMEM is not set
195CONFIG_BASE_SMALL=0 197CONFIG_BASE_SMALL=0
196# CONFIG_SLOB is not set 198# CONFIG_SLOB is not set
@@ -208,6 +210,7 @@ CONFIG_KMOD=y
208# 210#
209# Block layer 211# Block layer
210# 212#
213CONFIG_BLOCK=y
211# CONFIG_LBD is not set 214# CONFIG_LBD is not set
212# CONFIG_BLK_DEV_IO_TRACE is not set 215# CONFIG_BLK_DEV_IO_TRACE is not set
213# CONFIG_LSF is not set 216# CONFIG_LSF is not set
@@ -230,17 +233,16 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
230# 233#
231CONFIG_HW_HAS_PCI=y 234CONFIG_HW_HAS_PCI=y
232CONFIG_PCI=y 235CONFIG_PCI=y
236# CONFIG_PCI_MULTITHREAD_PROBE is not set
233CONFIG_MMU=y 237CONFIG_MMU=y
234 238
235# 239#
236# PCCARD (PCMCIA/CardBus) support 240# PCCARD (PCMCIA/CardBus) support
237# 241#
238# CONFIG_PCCARD is not set
239 242
240# 243#
241# PCI Hotplug Support 244# PCI Hotplug Support
242# 245#
243# CONFIG_HOTPLUG_PCI is not set
244 246
245# 247#
246# Executable file formats 248# Executable file formats
@@ -263,6 +265,7 @@ CONFIG_PACKET=y
263CONFIG_UNIX=y 265CONFIG_UNIX=y
264CONFIG_XFRM=y 266CONFIG_XFRM=y
265# CONFIG_XFRM_USER is not set 267# CONFIG_XFRM_USER is not set
268# CONFIG_XFRM_SUB_POLICY is not set
266# CONFIG_NET_KEY is not set 269# CONFIG_NET_KEY is not set
267CONFIG_INET=y 270CONFIG_INET=y
268CONFIG_IP_MULTICAST=y 271CONFIG_IP_MULTICAST=y
@@ -291,13 +294,10 @@ CONFIG_SYN_COOKIES=y
291CONFIG_INET_TUNNEL=m 294CONFIG_INET_TUNNEL=m
292CONFIG_INET_XFRM_MODE_TRANSPORT=m 295CONFIG_INET_XFRM_MODE_TRANSPORT=m
293CONFIG_INET_XFRM_MODE_TUNNEL=m 296CONFIG_INET_XFRM_MODE_TUNNEL=m
297CONFIG_INET_XFRM_MODE_BEET=y
294CONFIG_INET_DIAG=y 298CONFIG_INET_DIAG=y
295CONFIG_INET_TCP_DIAG=y 299CONFIG_INET_TCP_DIAG=y
296CONFIG_TCP_CONG_ADVANCED=y 300CONFIG_TCP_CONG_ADVANCED=y
297
298#
299# TCP congestion control
300#
301CONFIG_TCP_CONG_BIC=y 301CONFIG_TCP_CONG_BIC=y
302CONFIG_TCP_CONG_CUBIC=m 302CONFIG_TCP_CONG_CUBIC=m
303CONFIG_TCP_CONG_WESTWOOD=m 303CONFIG_TCP_CONG_WESTWOOD=m
@@ -308,7 +308,13 @@ CONFIG_TCP_CONG_HTCP=m
308# CONFIG_TCP_CONG_SCALABLE is not set 308# CONFIG_TCP_CONG_SCALABLE is not set
309# CONFIG_TCP_CONG_LP is not set 309# CONFIG_TCP_CONG_LP is not set
310# CONFIG_TCP_CONG_VENO is not set 310# CONFIG_TCP_CONG_VENO is not set
311# CONFIG_TCP_CONG_COMPOUND is not set 311CONFIG_DEFAULT_BIC=y
312# CONFIG_DEFAULT_CUBIC is not set
313# CONFIG_DEFAULT_HTCP is not set
314# CONFIG_DEFAULT_VEGAS is not set
315# CONFIG_DEFAULT_WESTWOOD is not set
316# CONFIG_DEFAULT_RENO is not set
317CONFIG_DEFAULT_TCP_CONG="bic"
312# CONFIG_IPV6 is not set 318# CONFIG_IPV6 is not set
313# CONFIG_INET6_XFRM_TUNNEL is not set 319# CONFIG_INET6_XFRM_TUNNEL is not set
314# CONFIG_INET6_TUNNEL is not set 320# CONFIG_INET6_TUNNEL is not set
@@ -338,7 +344,6 @@ CONFIG_NETWORK_SECMARK=y
338# CONFIG_ATALK is not set 344# CONFIG_ATALK is not set
339# CONFIG_X25 is not set 345# CONFIG_X25 is not set
340# CONFIG_LAPB is not set 346# CONFIG_LAPB is not set
341# CONFIG_NET_DIVERT is not set
342# CONFIG_ECONET is not set 347# CONFIG_ECONET is not set
343# CONFIG_WAN_ROUTER is not set 348# CONFIG_WAN_ROUTER is not set
344 349
@@ -355,6 +360,7 @@ CONFIG_NETWORK_SECMARK=y
355# CONFIG_IRDA is not set 360# CONFIG_IRDA is not set
356# CONFIG_BT is not set 361# CONFIG_BT is not set
357# CONFIG_IEEE80211 is not set 362# CONFIG_IEEE80211 is not set
363CONFIG_FIB_RULES=y
358 364
359# 365#
360# Device Drivers 366# Device Drivers
@@ -365,7 +371,6 @@ CONFIG_NETWORK_SECMARK=y
365# 371#
366CONFIG_STANDALONE=y 372CONFIG_STANDALONE=y
367CONFIG_PREVENT_FIRMWARE_BUILD=y 373CONFIG_PREVENT_FIRMWARE_BUILD=y
368# CONFIG_FW_LOADER is not set
369# CONFIG_SYS_HYPERVISOR is not set 374# CONFIG_SYS_HYPERVISOR is not set
370 375
371# 376#
@@ -403,6 +408,7 @@ CONFIG_BLK_DEV_NBD=m
403CONFIG_BLK_DEV_RAM=y 408CONFIG_BLK_DEV_RAM=y
404CONFIG_BLK_DEV_RAM_COUNT=16 409CONFIG_BLK_DEV_RAM_COUNT=16
405CONFIG_BLK_DEV_RAM_SIZE=4096 410CONFIG_BLK_DEV_RAM_SIZE=4096
411CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
406# CONFIG_BLK_DEV_INITRD is not set 412# CONFIG_BLK_DEV_INITRD is not set
407# CONFIG_CDROM_PKTCDVD is not set 413# CONFIG_CDROM_PKTCDVD is not set
408# CONFIG_ATA_OVER_ETH is not set 414# CONFIG_ATA_OVER_ETH is not set
@@ -410,65 +416,14 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
410# 416#
411# ATA/ATAPI/MFM/RLL support 417# ATA/ATAPI/MFM/RLL support
412# 418#
413CONFIG_IDE=y 419# CONFIG_IDE is not set
414CONFIG_BLK_DEV_IDE=y
415
416#
417# Please see Documentation/ide.txt for help/info on IDE drives
418#
419# CONFIG_BLK_DEV_IDE_SATA is not set
420CONFIG_BLK_DEV_IDEDISK=y
421# CONFIG_IDEDISK_MULTI_MODE is not set
422# CONFIG_BLK_DEV_IDECD is not set
423# CONFIG_BLK_DEV_IDETAPE is not set
424# CONFIG_BLK_DEV_IDEFLOPPY is not set
425# CONFIG_BLK_DEV_IDESCSI is not set
426# CONFIG_IDE_TASK_IOCTL is not set
427
428#
429# IDE chipset support/bugfixes
430#
431CONFIG_IDE_GENERIC=y
432CONFIG_BLK_DEV_IDEPCI=y
433# CONFIG_IDEPCI_SHARE_IRQ is not set
434# CONFIG_BLK_DEV_OFFBOARD is not set
435# CONFIG_BLK_DEV_GENERIC is not set
436# CONFIG_BLK_DEV_OPTI621 is not set
437CONFIG_BLK_DEV_IDEDMA_PCI=y
438# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
439# CONFIG_IDEDMA_PCI_AUTO is not set
440# CONFIG_BLK_DEV_AEC62XX is not set
441# CONFIG_BLK_DEV_ALI15X3 is not set
442# CONFIG_BLK_DEV_AMD74XX is not set
443# CONFIG_BLK_DEV_CMD64X is not set
444# CONFIG_BLK_DEV_TRIFLEX is not set
445# CONFIG_BLK_DEV_CY82C693 is not set
446# CONFIG_BLK_DEV_CS5520 is not set
447# CONFIG_BLK_DEV_CS5530 is not set
448# CONFIG_BLK_DEV_HPT34X is not set
449# CONFIG_BLK_DEV_HPT366 is not set
450# CONFIG_BLK_DEV_SC1200 is not set
451# CONFIG_BLK_DEV_PIIX is not set
452# CONFIG_BLK_DEV_IT821X is not set
453# CONFIG_BLK_DEV_NS87415 is not set
454# CONFIG_BLK_DEV_PDC202XX_OLD is not set
455# CONFIG_BLK_DEV_PDC202XX_NEW is not set
456# CONFIG_BLK_DEV_SVWKS is not set
457CONFIG_BLK_DEV_SIIMAGE=y
458# CONFIG_BLK_DEV_SLC90E66 is not set
459# CONFIG_BLK_DEV_TRM290 is not set
460# CONFIG_BLK_DEV_VIA82CXXX is not set
461# CONFIG_IDE_ARM is not set
462CONFIG_BLK_DEV_IDEDMA=y
463# CONFIG_IDEDMA_IVB is not set
464# CONFIG_IDEDMA_AUTO is not set
465# CONFIG_BLK_DEV_HD is not set
466 420
467# 421#
468# SCSI device support 422# SCSI device support
469# 423#
470# CONFIG_RAID_ATTRS is not set 424# CONFIG_RAID_ATTRS is not set
471CONFIG_SCSI=y 425CONFIG_SCSI=y
426# CONFIG_SCSI_NETLINK is not set
472CONFIG_SCSI_PROC_FS=y 427CONFIG_SCSI_PROC_FS=y
473 428
474# 429#
@@ -489,12 +444,13 @@ CONFIG_BLK_DEV_SD=y
489# CONFIG_SCSI_LOGGING is not set 444# CONFIG_SCSI_LOGGING is not set
490 445
491# 446#
492# SCSI Transport Attributes 447# SCSI Transports
493# 448#
494# CONFIG_SCSI_SPI_ATTRS is not set 449# CONFIG_SCSI_SPI_ATTRS is not set
495# CONFIG_SCSI_FC_ATTRS is not set 450# CONFIG_SCSI_FC_ATTRS is not set
496# CONFIG_SCSI_ISCSI_ATTRS is not set 451# CONFIG_SCSI_ISCSI_ATTRS is not set
497# CONFIG_SCSI_SAS_ATTRS is not set 452# CONFIG_SCSI_SAS_ATTRS is not set
453# CONFIG_SCSI_SAS_LIBSAS is not set
498 454
499# 455#
500# SCSI low-level drivers 456# SCSI low-level drivers
@@ -507,21 +463,24 @@ CONFIG_BLK_DEV_SD=y
507# CONFIG_SCSI_AIC7XXX is not set 463# CONFIG_SCSI_AIC7XXX is not set
508# CONFIG_SCSI_AIC7XXX_OLD is not set 464# CONFIG_SCSI_AIC7XXX_OLD is not set
509# CONFIG_SCSI_AIC79XX is not set 465# CONFIG_SCSI_AIC79XX is not set
466# CONFIG_SCSI_AIC94XX is not set
510# CONFIG_SCSI_DPT_I2O is not set 467# CONFIG_SCSI_DPT_I2O is not set
468# CONFIG_SCSI_ARCMSR is not set
511# CONFIG_MEGARAID_NEWGEN is not set 469# CONFIG_MEGARAID_NEWGEN is not set
512# CONFIG_MEGARAID_LEGACY is not set 470# CONFIG_MEGARAID_LEGACY is not set
513# CONFIG_MEGARAID_SAS is not set 471# CONFIG_MEGARAID_SAS is not set
514# CONFIG_SCSI_SATA is not set
515# CONFIG_SCSI_HPTIOP is not set 472# CONFIG_SCSI_HPTIOP is not set
516# CONFIG_SCSI_DMX3191D is not set 473# CONFIG_SCSI_DMX3191D is not set
517# CONFIG_SCSI_FUTURE_DOMAIN is not set 474# CONFIG_SCSI_FUTURE_DOMAIN is not set
518# CONFIG_SCSI_IPS is not set 475# CONFIG_SCSI_IPS is not set
519# CONFIG_SCSI_INITIO is not set 476# CONFIG_SCSI_INITIO is not set
520# CONFIG_SCSI_INIA100 is not set 477# CONFIG_SCSI_INIA100 is not set
478# CONFIG_SCSI_STEX is not set
521# CONFIG_SCSI_SYM53C8XX_2 is not set 479# CONFIG_SCSI_SYM53C8XX_2 is not set
522# CONFIG_SCSI_IPR is not set 480# CONFIG_SCSI_IPR is not set
523# CONFIG_SCSI_QLOGIC_1280 is not set 481# CONFIG_SCSI_QLOGIC_1280 is not set
524# CONFIG_SCSI_QLA_FC is not set 482# CONFIG_SCSI_QLA_FC is not set
483# CONFIG_SCSI_QLA_ISCSI is not set
525# CONFIG_SCSI_LPFC is not set 484# CONFIG_SCSI_LPFC is not set
526# CONFIG_SCSI_DC395x is not set 485# CONFIG_SCSI_DC395x is not set
527# CONFIG_SCSI_DC390T is not set 486# CONFIG_SCSI_DC390T is not set
@@ -529,6 +488,59 @@ CONFIG_BLK_DEV_SD=y
529# CONFIG_SCSI_DEBUG is not set 488# CONFIG_SCSI_DEBUG is not set
530 489
531# 490#
491# Serial ATA (prod) and Parallel ATA (experimental) drivers
492#
493CONFIG_ATA=y
494# CONFIG_SATA_AHCI is not set
495# CONFIG_SATA_SVW is not set
496# CONFIG_ATA_PIIX is not set
497# CONFIG_SATA_MV is not set
498# CONFIG_SATA_NV is not set
499# CONFIG_PDC_ADMA is not set
500# CONFIG_SATA_QSTOR is not set
501# CONFIG_SATA_PROMISE is not set
502# CONFIG_SATA_SX4 is not set
503# CONFIG_SATA_SIL is not set
504# CONFIG_SATA_SIL24 is not set
505# CONFIG_SATA_SIS is not set
506# CONFIG_SATA_ULI is not set
507# CONFIG_SATA_VIA is not set
508# CONFIG_SATA_VITESSE is not set
509# CONFIG_PATA_ALI is not set
510# CONFIG_PATA_AMD is not set
511# CONFIG_PATA_ARTOP is not set
512# CONFIG_PATA_ATIIXP is not set
513# CONFIG_PATA_CMD64X is not set
514# CONFIG_PATA_CS5520 is not set
515# CONFIG_PATA_CS5530 is not set
516# CONFIG_PATA_CYPRESS is not set
517# CONFIG_PATA_EFAR is not set
518# CONFIG_ATA_GENERIC is not set
519# CONFIG_PATA_HPT366 is not set
520# CONFIG_PATA_HPT37X is not set
521# CONFIG_PATA_HPT3X2N is not set
522# CONFIG_PATA_HPT3X3 is not set
523# CONFIG_PATA_IT821X is not set
524# CONFIG_PATA_JMICRON is not set
525# CONFIG_PATA_TRIFLEX is not set
526# CONFIG_PATA_MPIIX is not set
527# CONFIG_PATA_OLDPIIX is not set
528# CONFIG_PATA_NETCELL is not set
529# CONFIG_PATA_NS87410 is not set
530# CONFIG_PATA_OPTI is not set
531# CONFIG_PATA_OPTIDMA is not set
532# CONFIG_PATA_PDC_OLD is not set
533# CONFIG_PATA_RADISYS is not set
534# CONFIG_PATA_RZ1000 is not set
535# CONFIG_PATA_SC1200 is not set
536# CONFIG_PATA_SERVERWORKS is not set
537# CONFIG_PATA_PDC2027X is not set
538CONFIG_PATA_SIL680=y
539# CONFIG_PATA_SIS is not set
540# CONFIG_PATA_VIA is not set
541# CONFIG_PATA_WINBOND is not set
542
543#
532# Multi-device support (RAID and LVM) 544# Multi-device support (RAID and LVM)
533# 545#
534# CONFIG_MD is not set 546# CONFIG_MD is not set
@@ -632,6 +644,7 @@ CONFIG_R8169=y
632# CONFIG_SK98LIN is not set 644# CONFIG_SK98LIN is not set
633# CONFIG_TIGON3 is not set 645# CONFIG_TIGON3 is not set
634# CONFIG_BNX2 is not set 646# CONFIG_BNX2 is not set
647# CONFIG_QLA3XXX is not set
635 648
636# 649#
637# Ethernet (10000 Mbit) 650# Ethernet (10000 Mbit)
@@ -679,6 +692,7 @@ CONFIG_R8169=y
679# Input device support 692# Input device support
680# 693#
681CONFIG_INPUT=y 694CONFIG_INPUT=y
695# CONFIG_INPUT_FF_MEMLESS is not set
682 696
683# 697#
684# Userland interfaces 698# Userland interfaces
@@ -758,7 +772,6 @@ CONFIG_GPIO_VR41XX=y
758# TPM devices 772# TPM devices
759# 773#
760# CONFIG_TCG_TPM is not set 774# CONFIG_TCG_TPM is not set
761# CONFIG_TELCLOCK is not set
762 775
763# 776#
764# I2C support 777# I2C support
@@ -784,12 +797,12 @@ CONFIG_GPIO_VR41XX=y
784# 797#
785# Misc devices 798# Misc devices
786# 799#
800# CONFIG_TIFM_CORE is not set
787 801
788# 802#
789# Multimedia devices 803# Multimedia devices
790# 804#
791# CONFIG_VIDEO_DEV is not set 805# CONFIG_VIDEO_DEV is not set
792CONFIG_VIDEO_V4L2=y
793 806
794# 807#
795# Digital Video Broadcasting Devices 808# Digital Video Broadcasting Devices
@@ -897,13 +910,13 @@ CONFIG_USB_STORAGE=m
897# CONFIG_USB_STORAGE_DEBUG is not set 910# CONFIG_USB_STORAGE_DEBUG is not set
898# CONFIG_USB_STORAGE_DATAFAB is not set 911# CONFIG_USB_STORAGE_DATAFAB is not set
899# CONFIG_USB_STORAGE_FREECOM is not set 912# CONFIG_USB_STORAGE_FREECOM is not set
900# CONFIG_USB_STORAGE_ISD200 is not set
901# CONFIG_USB_STORAGE_DPCM is not set 913# CONFIG_USB_STORAGE_DPCM is not set
902# CONFIG_USB_STORAGE_USBAT is not set 914# CONFIG_USB_STORAGE_USBAT is not set
903# CONFIG_USB_STORAGE_SDDR09 is not set 915# CONFIG_USB_STORAGE_SDDR09 is not set
904# CONFIG_USB_STORAGE_SDDR55 is not set 916# CONFIG_USB_STORAGE_SDDR55 is not set
905# CONFIG_USB_STORAGE_JUMPSHOT is not set 917# CONFIG_USB_STORAGE_JUMPSHOT is not set
906# CONFIG_USB_STORAGE_ALAUDA is not set 918# CONFIG_USB_STORAGE_ALAUDA is not set
919# CONFIG_USB_STORAGE_KARMA is not set
907# CONFIG_USB_LIBUSUAL is not set 920# CONFIG_USB_LIBUSUAL is not set
908 921
909# 922#
@@ -932,6 +945,7 @@ CONFIG_USB_HIDINPUT=y
932# CONFIG_USB_ATI_REMOTE2 is not set 945# CONFIG_USB_ATI_REMOTE2 is not set
933# CONFIG_USB_KEYSPAN_REMOTE is not set 946# CONFIG_USB_KEYSPAN_REMOTE is not set
934# CONFIG_USB_APPLETOUCH is not set 947# CONFIG_USB_APPLETOUCH is not set
948# CONFIG_USB_TRANCEVIBRATOR is not set
935 949
936# 950#
937# USB Imaging devices 951# USB Imaging devices
@@ -963,16 +977,17 @@ CONFIG_USB_MON=y
963# 977#
964# CONFIG_USB_EMI62 is not set 978# CONFIG_USB_EMI62 is not set
965# CONFIG_USB_EMI26 is not set 979# CONFIG_USB_EMI26 is not set
980# CONFIG_USB_ADUTUX is not set
966# CONFIG_USB_AUERSWALD is not set 981# CONFIG_USB_AUERSWALD is not set
967# CONFIG_USB_RIO500 is not set 982# CONFIG_USB_RIO500 is not set
968# CONFIG_USB_LEGOTOWER is not set 983# CONFIG_USB_LEGOTOWER is not set
969# CONFIG_USB_LCD is not set 984# CONFIG_USB_LCD is not set
970# CONFIG_USB_LED is not set 985# CONFIG_USB_LED is not set
971# CONFIG_USB_CY7C63 is not set 986# CONFIG_USB_CYPRESS_CY7C63 is not set
972# CONFIG_USB_CYTHERM is not set 987# CONFIG_USB_CYTHERM is not set
973# CONFIG_USB_PHIDGETKIT is not set 988# CONFIG_USB_PHIDGET is not set
974# CONFIG_USB_PHIDGETSERVO is not set
975# CONFIG_USB_IDMOUSE is not set 989# CONFIG_USB_IDMOUSE is not set
990# CONFIG_USB_FTDI_ELAN is not set
976# CONFIG_USB_APPLEDISPLAY is not set 991# CONFIG_USB_APPLEDISPLAY is not set
977# CONFIG_USB_SISUSBVGA is not set 992# CONFIG_USB_SISUSBVGA is not set
978# CONFIG_USB_LD is not set 993# CONFIG_USB_LD is not set
@@ -1041,6 +1056,7 @@ CONFIG_EXT3_FS=y
1041CONFIG_EXT3_FS_XATTR=y 1056CONFIG_EXT3_FS_XATTR=y
1042# CONFIG_EXT3_FS_POSIX_ACL is not set 1057# CONFIG_EXT3_FS_POSIX_ACL is not set
1043# CONFIG_EXT3_FS_SECURITY is not set 1058# CONFIG_EXT3_FS_SECURITY is not set
1059# CONFIG_EXT4DEV_FS is not set
1044CONFIG_JBD=y 1060CONFIG_JBD=y
1045# CONFIG_JBD_DEBUG is not set 1061# CONFIG_JBD_DEBUG is not set
1046CONFIG_FS_MBCACHE=y 1062CONFIG_FS_MBCACHE=y
@@ -1052,6 +1068,7 @@ CONFIG_XFS_QUOTA=y
1052# CONFIG_XFS_SECURITY is not set 1068# CONFIG_XFS_SECURITY is not set
1053CONFIG_XFS_POSIX_ACL=y 1069CONFIG_XFS_POSIX_ACL=y
1054# CONFIG_XFS_RT is not set 1070# CONFIG_XFS_RT is not set
1071# CONFIG_GFS2_FS is not set
1055# CONFIG_OCFS2_FS is not set 1072# CONFIG_OCFS2_FS is not set
1056# CONFIG_MINIX_FS is not set 1073# CONFIG_MINIX_FS is not set
1057CONFIG_ROMFS_FS=m 1074CONFIG_ROMFS_FS=m
@@ -1082,8 +1099,10 @@ CONFIG_AUTOFS4_FS=y
1082# 1099#
1083CONFIG_PROC_FS=y 1100CONFIG_PROC_FS=y
1084CONFIG_PROC_KCORE=y 1101CONFIG_PROC_KCORE=y
1102CONFIG_PROC_SYSCTL=y
1085CONFIG_SYSFS=y 1103CONFIG_SYSFS=y
1086CONFIG_TMPFS=y 1104CONFIG_TMPFS=y
1105# CONFIG_TMPFS_POSIX_ACL is not set
1087# CONFIG_HUGETLB_PAGE is not set 1106# CONFIG_HUGETLB_PAGE is not set
1088CONFIG_RAMFS=y 1107CONFIG_RAMFS=y
1089# CONFIG_CONFIGFS_FS is not set 1108# CONFIG_CONFIGFS_FS is not set
@@ -1123,7 +1142,6 @@ CONFIG_SUNRPC=y
1123# CONFIG_RPCSEC_GSS_SPKM3 is not set 1142# CONFIG_RPCSEC_GSS_SPKM3 is not set
1124# CONFIG_SMB_FS is not set 1143# CONFIG_SMB_FS is not set
1125# CONFIG_CIFS is not set 1144# CONFIG_CIFS is not set
1126# CONFIG_CIFS_DEBUG2 is not set
1127# CONFIG_NCP_FS is not set 1145# CONFIG_NCP_FS is not set
1128# CONFIG_CODA_FS is not set 1146# CONFIG_CODA_FS is not set
1129# CONFIG_AFS_FS is not set 1147# CONFIG_AFS_FS is not set
@@ -1150,11 +1168,13 @@ CONFIG_MSDOS_PARTITION=y
1150# 1168#
1151CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1169CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1152# CONFIG_PRINTK_TIME is not set 1170# CONFIG_PRINTK_TIME is not set
1171CONFIG_ENABLE_MUST_CHECK=y
1153# CONFIG_MAGIC_SYSRQ is not set 1172# CONFIG_MAGIC_SYSRQ is not set
1154# CONFIG_UNUSED_SYMBOLS is not set 1173# CONFIG_UNUSED_SYMBOLS is not set
1155# CONFIG_DEBUG_KERNEL is not set 1174# CONFIG_DEBUG_KERNEL is not set
1156CONFIG_LOG_BUF_SHIFT=14 1175CONFIG_LOG_BUF_SHIFT=14
1157# CONFIG_DEBUG_FS is not set 1176# CONFIG_DEBUG_FS is not set
1177# CONFIG_HEADERS_CHECK is not set
1158CONFIG_CROSSCOMPILE=y 1178CONFIG_CROSSCOMPILE=y
1159CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs" 1179CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
1160 1180
@@ -1170,10 +1190,6 @@ CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
1170# CONFIG_CRYPTO is not set 1190# CONFIG_CRYPTO is not set
1171 1191
1172# 1192#
1173# Hardware crypto devices
1174#
1175
1176#
1177# Library routines 1193# Library routines
1178# 1194#
1179# CONFIG_CRC_CCITT is not set 1195# CONFIG_CRC_CCITT is not set
diff --git a/arch/mips/ddb5xxx/ddb5477/irq_5477.c b/arch/mips/ddb5xxx/ddb5477/irq_5477.c
index ba52705a273..96249aa5df5 100644
--- a/arch/mips/ddb5xxx/ddb5477/irq_5477.c
+++ b/arch/mips/ddb5xxx/ddb5477/irq_5477.c
@@ -53,14 +53,6 @@ vrc5477_irq_disable(unsigned int irq)
53 ll_vrc5477_irq_disable(irq - vrc5477_irq_base); 53 ll_vrc5477_irq_disable(irq - vrc5477_irq_base);
54} 54}
55 55
56static unsigned int vrc5477_irq_startup(unsigned int irq)
57{
58 vrc5477_irq_enable(irq);
59 return 0;
60}
61
62#define vrc5477_irq_shutdown vrc5477_irq_disable
63
64static void 56static void
65vrc5477_irq_ack(unsigned int irq) 57vrc5477_irq_ack(unsigned int irq)
66{ 58{
@@ -91,11 +83,10 @@ vrc5477_irq_end(unsigned int irq)
91 83
92struct irq_chip vrc5477_irq_controller = { 84struct irq_chip vrc5477_irq_controller = {
93 .typename = "vrc5477_irq", 85 .typename = "vrc5477_irq",
94 .startup = vrc5477_irq_startup,
95 .shutdown = vrc5477_irq_shutdown,
96 .enable = vrc5477_irq_enable,
97 .disable = vrc5477_irq_disable,
98 .ack = vrc5477_irq_ack, 86 .ack = vrc5477_irq_ack,
87 .mask = vrc5477_irq_disable,
88 .mask_ack = vrc5477_irq_ack,
89 .unmask = vrc5477_irq_enable,
99 .end = vrc5477_irq_end 90 .end = vrc5477_irq_end
100}; 91};
101 92
@@ -103,12 +94,8 @@ void __init vrc5477_irq_init(u32 irq_base)
103{ 94{
104 u32 i; 95 u32 i;
105 96
106 for (i= irq_base; i< irq_base+ NUM_5477_IRQ; i++) { 97 for (i= irq_base; i< irq_base+ NUM_5477_IRQ; i++)
107 irq_desc[i].status = IRQ_DISABLED; 98 set_irq_chip(i, &vrc5477_irq_controller);
108 irq_desc[i].action = NULL;
109 irq_desc[i].depth = 1;
110 irq_desc[i].chip = &vrc5477_irq_controller;
111 }
112 99
113 vrc5477_irq_base = irq_base; 100 vrc5477_irq_base = irq_base;
114} 101}
diff --git a/arch/mips/dec/ecc-berr.c b/arch/mips/dec/ecc-berr.c
index 3e374d05978..c8430c07355 100644
--- a/arch/mips/dec/ecc-berr.c
+++ b/arch/mips/dec/ecc-berr.c
@@ -18,7 +18,6 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/spinlock.h>
22#include <linux/types.h> 21#include <linux/types.h>
23 22
24#include <asm/addrspace.h> 23#include <asm/addrspace.h>
@@ -231,13 +230,10 @@ irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id)
231static inline void dec_kn02_be_init(void) 230static inline void dec_kn02_be_init(void)
232{ 231{
233 volatile u32 *csr = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR); 232 volatile u32 *csr = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR);
234 unsigned long flags;
235 233
236 kn0x_erraddr = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_ERRADDR); 234 kn0x_erraddr = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_ERRADDR);
237 kn0x_chksyn = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CHKSYN); 235 kn0x_chksyn = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CHKSYN);
238 236
239 spin_lock_irqsave(&kn02_lock, flags);
240
241 /* Preset write-only bits of the Control Register cache. */ 237 /* Preset write-only bits of the Control Register cache. */
242 cached_kn02_csr = *csr | KN02_CSR_LEDS; 238 cached_kn02_csr = *csr | KN02_CSR_LEDS;
243 239
@@ -247,8 +243,6 @@ static inline void dec_kn02_be_init(void)
247 cached_kn02_csr |= KN02_CSR_CORRECT; 243 cached_kn02_csr |= KN02_CSR_CORRECT;
248 *csr = cached_kn02_csr; 244 *csr = cached_kn02_csr;
249 iob(); 245 iob();
250
251 spin_unlock_irqrestore(&kn02_lock, flags);
252} 246}
253 247
254static inline void dec_kn03_be_init(void) 248static inline void dec_kn03_be_init(void)
diff --git a/arch/mips/dec/int-handler.S b/arch/mips/dec/int-handler.S
index 31dd47d1002..b251ef864c3 100644
--- a/arch/mips/dec/int-handler.S
+++ b/arch/mips/dec/int-handler.S
@@ -267,7 +267,7 @@ handle_it:
267 LONG_L s0, TI_REGS($28) 267 LONG_L s0, TI_REGS($28)
268 LONG_S sp, TI_REGS($28) 268 LONG_S sp, TI_REGS($28)
269 PTR_LA ra, ret_from_irq 269 PTR_LA ra, ret_from_irq
270 j do_IRQ 270 j dec_irq_dispatch
271 nop 271 nop
272 272
273#ifdef CONFIG_32BIT 273#ifdef CONFIG_32BIT
diff --git a/arch/mips/dec/ioasic-irq.c b/arch/mips/dec/ioasic-irq.c
index 41cd2a96148..269b22b3431 100644
--- a/arch/mips/dec/ioasic-irq.c
+++ b/arch/mips/dec/ioasic-irq.c
@@ -13,7 +13,6 @@
13 13
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/irq.h> 15#include <linux/irq.h>
16#include <linux/spinlock.h>
17#include <linux/types.h> 16#include <linux/types.h>
18 17
19#include <asm/dec/ioasic.h> 18#include <asm/dec/ioasic.h>
@@ -21,8 +20,6 @@
21#include <asm/dec/ioasic_ints.h> 20#include <asm/dec/ioasic_ints.h>
22 21
23 22
24static DEFINE_SPINLOCK(ioasic_lock);
25
26static int ioasic_irq_base; 23static int ioasic_irq_base;
27 24
28 25
@@ -52,65 +49,31 @@ static inline void clear_ioasic_irq(unsigned int irq)
52 ioasic_write(IO_REG_SIR, sir); 49 ioasic_write(IO_REG_SIR, sir);
53} 50}
54 51
55static inline void enable_ioasic_irq(unsigned int irq)
56{
57 unsigned long flags;
58
59 spin_lock_irqsave(&ioasic_lock, flags);
60 unmask_ioasic_irq(irq);
61 spin_unlock_irqrestore(&ioasic_lock, flags);
62}
63
64static inline void disable_ioasic_irq(unsigned int irq)
65{
66 unsigned long flags;
67
68 spin_lock_irqsave(&ioasic_lock, flags);
69 mask_ioasic_irq(irq);
70 spin_unlock_irqrestore(&ioasic_lock, flags);
71}
72
73
74static inline unsigned int startup_ioasic_irq(unsigned int irq)
75{
76 enable_ioasic_irq(irq);
77 return 0;
78}
79
80#define shutdown_ioasic_irq disable_ioasic_irq
81
82static inline void ack_ioasic_irq(unsigned int irq) 52static inline void ack_ioasic_irq(unsigned int irq)
83{ 53{
84 spin_lock(&ioasic_lock);
85 mask_ioasic_irq(irq); 54 mask_ioasic_irq(irq);
86 spin_unlock(&ioasic_lock);
87 fast_iob(); 55 fast_iob();
88} 56}
89 57
90static inline void end_ioasic_irq(unsigned int irq) 58static inline void end_ioasic_irq(unsigned int irq)
91{ 59{
92 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 60 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
93 enable_ioasic_irq(irq); 61 unmask_ioasic_irq(irq);
94} 62}
95 63
96static struct irq_chip ioasic_irq_type = { 64static struct irq_chip ioasic_irq_type = {
97 .typename = "IO-ASIC", 65 .typename = "IO-ASIC",
98 .startup = startup_ioasic_irq,
99 .shutdown = shutdown_ioasic_irq,
100 .enable = enable_ioasic_irq,
101 .disable = disable_ioasic_irq,
102 .ack = ack_ioasic_irq, 66 .ack = ack_ioasic_irq,
67 .mask = mask_ioasic_irq,
68 .mask_ack = ack_ioasic_irq,
69 .unmask = unmask_ioasic_irq,
103 .end = end_ioasic_irq, 70 .end = end_ioasic_irq,
104}; 71};
105 72
106 73
107#define startup_ioasic_dma_irq startup_ioasic_irq 74#define unmask_ioasic_dma_irq unmask_ioasic_irq
108
109#define shutdown_ioasic_dma_irq shutdown_ioasic_irq
110
111#define enable_ioasic_dma_irq enable_ioasic_irq
112 75
113#define disable_ioasic_dma_irq disable_ioasic_irq 76#define mask_ioasic_dma_irq mask_ioasic_irq
114 77
115#define ack_ioasic_dma_irq ack_ioasic_irq 78#define ack_ioasic_dma_irq ack_ioasic_irq
116 79
@@ -123,11 +86,10 @@ static inline void end_ioasic_dma_irq(unsigned int irq)
123 86
124static struct irq_chip ioasic_dma_irq_type = { 87static struct irq_chip ioasic_dma_irq_type = {
125 .typename = "IO-ASIC-DMA", 88 .typename = "IO-ASIC-DMA",
126 .startup = startup_ioasic_dma_irq,
127 .shutdown = shutdown_ioasic_dma_irq,
128 .enable = enable_ioasic_dma_irq,
129 .disable = disable_ioasic_dma_irq,
130 .ack = ack_ioasic_dma_irq, 89 .ack = ack_ioasic_dma_irq,
90 .mask = mask_ioasic_dma_irq,
91 .mask_ack = ack_ioasic_dma_irq,
92 .unmask = unmask_ioasic_dma_irq,
131 .end = end_ioasic_dma_irq, 93 .end = end_ioasic_dma_irq,
132}; 94};
133 95
@@ -140,18 +102,12 @@ void __init init_ioasic_irqs(int base)
140 ioasic_write(IO_REG_SIMR, 0); 102 ioasic_write(IO_REG_SIMR, 0);
141 fast_iob(); 103 fast_iob();
142 104
143 for (i = base; i < base + IO_INR_DMA; i++) { 105 for (i = base; i < base + IO_INR_DMA; i++)
144 irq_desc[i].status = IRQ_DISABLED; 106 set_irq_chip_and_handler(i, &ioasic_irq_type,
145 irq_desc[i].action = 0; 107 handle_level_irq);
146 irq_desc[i].depth = 1; 108 for (; i < base + IO_IRQ_LINES; i++)
147 irq_desc[i].chip = &ioasic_irq_type; 109 set_irq_chip_and_handler(i, &ioasic_dma_irq_type,
148 } 110 handle_level_irq);
149 for (; i < base + IO_IRQ_LINES; i++) {
150 irq_desc[i].status = IRQ_DISABLED;
151 irq_desc[i].action = 0;
152 irq_desc[i].depth = 1;
153 irq_desc[i].chip = &ioasic_dma_irq_type;
154 }
155 111
156 ioasic_irq_base = base; 112 ioasic_irq_base = base;
157} 113}
diff --git a/arch/mips/dec/kn02-irq.c b/arch/mips/dec/kn02-irq.c
index 04a367a60a5..5a9be4c9358 100644
--- a/arch/mips/dec/kn02-irq.c
+++ b/arch/mips/dec/kn02-irq.c
@@ -14,7 +14,6 @@
14 14
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/irq.h> 16#include <linux/irq.h>
17#include <linux/spinlock.h>
18#include <linux/types.h> 17#include <linux/types.h>
19 18
20#include <asm/dec/kn02.h> 19#include <asm/dec/kn02.h>
@@ -29,7 +28,6 @@
29 * There is no default value -- it has to be initialized. 28 * There is no default value -- it has to be initialized.
30 */ 29 */
31u32 cached_kn02_csr; 30u32 cached_kn02_csr;
32DEFINE_SPINLOCK(kn02_lock);
33 31
34 32
35static int kn02_irq_base; 33static int kn02_irq_base;
@@ -53,54 +51,24 @@ static inline void mask_kn02_irq(unsigned int irq)
53 *csr = cached_kn02_csr; 51 *csr = cached_kn02_csr;
54} 52}
55 53
56static inline void enable_kn02_irq(unsigned int irq)
57{
58 unsigned long flags;
59
60 spin_lock_irqsave(&kn02_lock, flags);
61 unmask_kn02_irq(irq);
62 spin_unlock_irqrestore(&kn02_lock, flags);
63}
64
65static inline void disable_kn02_irq(unsigned int irq)
66{
67 unsigned long flags;
68
69 spin_lock_irqsave(&kn02_lock, flags);
70 mask_kn02_irq(irq);
71 spin_unlock_irqrestore(&kn02_lock, flags);
72}
73
74
75static unsigned int startup_kn02_irq(unsigned int irq)
76{
77 enable_kn02_irq(irq);
78 return 0;
79}
80
81#define shutdown_kn02_irq disable_kn02_irq
82
83static void ack_kn02_irq(unsigned int irq) 54static void ack_kn02_irq(unsigned int irq)
84{ 55{
85 spin_lock(&kn02_lock);
86 mask_kn02_irq(irq); 56 mask_kn02_irq(irq);
87 spin_unlock(&kn02_lock);
88 iob(); 57 iob();
89} 58}
90 59
91static void end_kn02_irq(unsigned int irq) 60static void end_kn02_irq(unsigned int irq)
92{ 61{
93 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 62 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
94 enable_kn02_irq(irq); 63 unmask_kn02_irq(irq);
95} 64}
96 65
97static struct irq_chip kn02_irq_type = { 66static struct irq_chip kn02_irq_type = {
98 .typename = "KN02-CSR", 67 .typename = "KN02-CSR",
99 .startup = startup_kn02_irq,
100 .shutdown = shutdown_kn02_irq,
101 .enable = enable_kn02_irq,
102 .disable = disable_kn02_irq,
103 .ack = ack_kn02_irq, 68 .ack = ack_kn02_irq,
69 .mask = mask_kn02_irq,
70 .mask_ack = ack_kn02_irq,
71 .unmask = unmask_kn02_irq,
104 .end = end_kn02_irq, 72 .end = end_kn02_irq,
105}; 73};
106 74
@@ -109,22 +77,15 @@ void __init init_kn02_irqs(int base)
109{ 77{
110 volatile u32 *csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE + 78 volatile u32 *csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE +
111 KN02_CSR); 79 KN02_CSR);
112 unsigned long flags;
113 int i; 80 int i;
114 81
115 /* Mask interrupts. */ 82 /* Mask interrupts. */
116 spin_lock_irqsave(&kn02_lock, flags);
117 cached_kn02_csr &= ~KN02_CSR_IOINTEN; 83 cached_kn02_csr &= ~KN02_CSR_IOINTEN;
118 *csr = cached_kn02_csr; 84 *csr = cached_kn02_csr;
119 iob(); 85 iob();
120 spin_unlock_irqrestore(&kn02_lock, flags); 86
121 87 for (i = base; i < base + KN02_IRQ_LINES; i++)
122 for (i = base; i < base + KN02_IRQ_LINES; i++) { 88 set_irq_chip_and_handler(i, &kn02_irq_type, handle_level_irq);
123 irq_desc[i].status = IRQ_DISABLED;
124 irq_desc[i].action = 0;
125 irq_desc[i].depth = 1;
126 irq_desc[i].chip = &kn02_irq_type;
127 }
128 89
129 kn02_irq_base = base; 90 kn02_irq_base = base;
130} 91}
diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c
index 6b7481e97be..d34032ac492 100644
--- a/arch/mips/dec/setup.c
+++ b/arch/mips/dec/setup.c
@@ -761,3 +761,9 @@ void __init arch_init_irq(void)
761 if (dec_interrupt[DEC_IRQ_HALT] >= 0) 761 if (dec_interrupt[DEC_IRQ_HALT] >= 0)
762 setup_irq(dec_interrupt[DEC_IRQ_HALT], &haltirq); 762 setup_irq(dec_interrupt[DEC_IRQ_HALT], &haltirq);
763} 763}
764
765asmlinkage unsigned int dec_irq_dispatch(unsigned int irq)
766{
767 do_IRQ(irq);
768 return 0;
769}
diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c
index 4cf0c06e241..8b7e0c17ac3 100644
--- a/arch/mips/dec/time.c
+++ b/arch/mips/dec/time.c
@@ -151,7 +151,7 @@ static void dec_timer_ack(void)
151 CMOS_READ(RTC_REG_C); /* Ack the RTC interrupt. */ 151 CMOS_READ(RTC_REG_C); /* Ack the RTC interrupt. */
152} 152}
153 153
154static unsigned int dec_ioasic_hpt_read(void) 154static cycle_t dec_ioasic_hpt_read(void)
155{ 155{
156 /* 156 /*
157 * The free-running counter is 32-bit which is good for about 157 * The free-running counter is 32-bit which is good for about
@@ -160,11 +160,6 @@ static unsigned int dec_ioasic_hpt_read(void)
160 return ioasic_read(IO_REG_FCTR); 160 return ioasic_read(IO_REG_FCTR);
161} 161}
162 162
163static void dec_ioasic_hpt_init(unsigned int count)
164{
165 ioasic_write(IO_REG_FCTR, ioasic_read(IO_REG_FCTR) - count);
166}
167
168 163
169void __init dec_time_init(void) 164void __init dec_time_init(void)
170{ 165{
@@ -174,11 +169,9 @@ void __init dec_time_init(void)
174 mips_timer_state = dec_timer_state; 169 mips_timer_state = dec_timer_state;
175 mips_timer_ack = dec_timer_ack; 170 mips_timer_ack = dec_timer_ack;
176 171
177 if (!cpu_has_counter && IOASIC) { 172 if (!cpu_has_counter && IOASIC)
178 /* For pre-R4k systems we use the I/O ASIC's counter. */ 173 /* For pre-R4k systems we use the I/O ASIC's counter. */
179 mips_hpt_read = dec_ioasic_hpt_read; 174 clocksource_mips.read = dec_ioasic_hpt_read;
180 mips_hpt_init = dec_ioasic_hpt_init;
181 }
182 175
183 /* Set up the rate of periodic DS1287 interrupts. */ 176 /* Set up the rate of periodic DS1287 interrupts. */
184 CMOS_WRITE(RTC_REF_CLCK_32KHZ | (16 - __ffs(HZ)), RTC_REG_A); 177 CMOS_WRITE(RTC_REF_CLCK_32KHZ | (16 - __ffs(HZ)), RTC_REG_A);
diff --git a/arch/mips/emma2rh/common/irq_emma2rh.c b/arch/mips/emma2rh/common/irq_emma2rh.c
index 7c930860c92..59b98299c89 100644
--- a/arch/mips/emma2rh/common/irq_emma2rh.c
+++ b/arch/mips/emma2rh/common/irq_emma2rh.c
@@ -56,22 +56,6 @@ static void emma2rh_irq_disable(unsigned int irq)
56 ll_emma2rh_irq_disable(irq - emma2rh_irq_base); 56 ll_emma2rh_irq_disable(irq - emma2rh_irq_base);
57} 57}
58 58
59static unsigned int emma2rh_irq_startup(unsigned int irq)
60{
61 emma2rh_irq_enable(irq);
62 return 0;
63}
64
65#define emma2rh_irq_shutdown emma2rh_irq_disable
66
67static void emma2rh_irq_ack(unsigned int irq)
68{
69 /* disable interrupt - some handler will re-enable the irq
70 * and if the interrupt is leveled, we will have infinite loop
71 */
72 ll_emma2rh_irq_disable(irq - emma2rh_irq_base);
73}
74
75static void emma2rh_irq_end(unsigned int irq) 59static void emma2rh_irq_end(unsigned int irq)
76{ 60{
77 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 61 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
@@ -80,25 +64,20 @@ static void emma2rh_irq_end(unsigned int irq)
80 64
81struct irq_chip emma2rh_irq_controller = { 65struct irq_chip emma2rh_irq_controller = {
82 .typename = "emma2rh_irq", 66 .typename = "emma2rh_irq",
83 .startup = emma2rh_irq_startup, 67 .ack = emma2rh_irq_disable,
84 .shutdown = emma2rh_irq_shutdown, 68 .mask = emma2rh_irq_disable,
85 .enable = emma2rh_irq_enable, 69 .mask_ack = emma2rh_irq_disable,
86 .disable = emma2rh_irq_disable, 70 .unmask = emma2rh_irq_enable,
87 .ack = emma2rh_irq_ack,
88 .end = emma2rh_irq_end, 71 .end = emma2rh_irq_end,
89 .set_affinity = NULL /* no affinity stuff for UP */
90}; 72};
91 73
92void emma2rh_irq_init(u32 irq_base) 74void emma2rh_irq_init(u32 irq_base)
93{ 75{
94 u32 i; 76 u32 i;
95 77
96 for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ; i++) { 78 for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ; i++)
97 irq_desc[i].status = IRQ_DISABLED; 79 set_irq_chip_and_handler(i, &emma2rh_irq_controller,
98 irq_desc[i].action = NULL; 80 handle_level_irq);
99 irq_desc[i].depth = 1;
100 irq_desc[i].handler = &emma2rh_irq_controller;
101 }
102 81
103 emma2rh_irq_base = irq_base; 82 emma2rh_irq_base = irq_base;
104} 83}
diff --git a/arch/mips/emma2rh/markeins/irq_markeins.c b/arch/mips/emma2rh/markeins/irq_markeins.c
index f23ae9fcffa..3ac4e405ecd 100644
--- a/arch/mips/emma2rh/markeins/irq_markeins.c
+++ b/arch/mips/emma2rh/markeins/irq_markeins.c
@@ -48,19 +48,6 @@ static void emma2rh_sw_irq_disable(unsigned int irq)
48 ll_emma2rh_sw_irq_disable(irq - emma2rh_sw_irq_base); 48 ll_emma2rh_sw_irq_disable(irq - emma2rh_sw_irq_base);
49} 49}
50 50
51static unsigned int emma2rh_sw_irq_startup(unsigned int irq)
52{
53 emma2rh_sw_irq_enable(irq);
54 return 0;
55}
56
57#define emma2rh_sw_irq_shutdown emma2rh_sw_irq_disable
58
59static void emma2rh_sw_irq_ack(unsigned int irq)
60{
61 ll_emma2rh_sw_irq_disable(irq - emma2rh_sw_irq_base);
62}
63
64static void emma2rh_sw_irq_end(unsigned int irq) 51static void emma2rh_sw_irq_end(unsigned int irq)
65{ 52{
66 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 53 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
@@ -69,25 +56,20 @@ static void emma2rh_sw_irq_end(unsigned int irq)
69 56
70struct irq_chip emma2rh_sw_irq_controller = { 57struct irq_chip emma2rh_sw_irq_controller = {
71 .typename = "emma2rh_sw_irq", 58 .typename = "emma2rh_sw_irq",
72 .startup = emma2rh_sw_irq_startup, 59 .ack = emma2rh_sw_irq_disable,
73 .shutdown = emma2rh_sw_irq_shutdown, 60 .mask = emma2rh_sw_irq_disable,
74 .enable = emma2rh_sw_irq_enable, 61 .mask_ack = emma2rh_sw_irq_disable,
75 .disable = emma2rh_sw_irq_disable, 62 .unmask = emma2rh_sw_irq_enable,
76 .ack = emma2rh_sw_irq_ack,
77 .end = emma2rh_sw_irq_end, 63 .end = emma2rh_sw_irq_end,
78 .set_affinity = NULL,
79}; 64};
80 65
81void emma2rh_sw_irq_init(u32 irq_base) 66void emma2rh_sw_irq_init(u32 irq_base)
82{ 67{
83 u32 i; 68 u32 i;
84 69
85 for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ_SW; i++) { 70 for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ_SW; i++)
86 irq_desc[i].status = IRQ_DISABLED; 71 set_irq_chip_and_handler(i, &emma2rh_sw_irq_controller,
87 irq_desc[i].action = NULL; 72 handle_level_irq);
88 irq_desc[i].depth = 2;
89 irq_desc[i].handler = &emma2rh_sw_irq_controller;
90 }
91 73
92 emma2rh_sw_irq_base = irq_base; 74 emma2rh_sw_irq_base = irq_base;
93} 75}
@@ -126,14 +108,6 @@ static void emma2rh_gpio_irq_disable(unsigned int irq)
126 ll_emma2rh_gpio_irq_disable(irq - emma2rh_gpio_irq_base); 108 ll_emma2rh_gpio_irq_disable(irq - emma2rh_gpio_irq_base);
127} 109}
128 110
129static unsigned int emma2rh_gpio_irq_startup(unsigned int irq)
130{
131 emma2rh_gpio_irq_enable(irq);
132 return 0;
133}
134
135#define emma2rh_gpio_irq_shutdown emma2rh_gpio_irq_disable
136
137static void emma2rh_gpio_irq_ack(unsigned int irq) 111static void emma2rh_gpio_irq_ack(unsigned int irq)
138{ 112{
139 irq -= emma2rh_gpio_irq_base; 113 irq -= emma2rh_gpio_irq_base;
@@ -149,25 +123,19 @@ static void emma2rh_gpio_irq_end(unsigned int irq)
149 123
150struct irq_chip emma2rh_gpio_irq_controller = { 124struct irq_chip emma2rh_gpio_irq_controller = {
151 .typename = "emma2rh_gpio_irq", 125 .typename = "emma2rh_gpio_irq",
152 .startup = emma2rh_gpio_irq_startup,
153 .shutdown = emma2rh_gpio_irq_shutdown,
154 .enable = emma2rh_gpio_irq_enable,
155 .disable = emma2rh_gpio_irq_disable,
156 .ack = emma2rh_gpio_irq_ack, 126 .ack = emma2rh_gpio_irq_ack,
127 .mask = emma2rh_gpio_irq_disable,
128 .mask_ack = emma2rh_gpio_irq_ack,
129 .unmask = emma2rh_gpio_irq_enable,
157 .end = emma2rh_gpio_irq_end, 130 .end = emma2rh_gpio_irq_end,
158 .set_affinity = NULL,
159}; 131};
160 132
161void emma2rh_gpio_irq_init(u32 irq_base) 133void emma2rh_gpio_irq_init(u32 irq_base)
162{ 134{
163 u32 i; 135 u32 i;
164 136
165 for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ_GPIO; i++) { 137 for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ_GPIO; i++)
166 irq_desc[i].status = IRQ_DISABLED; 138 set_irq_chip(i, &emma2rh_gpio_irq_controller);
167 irq_desc[i].action = NULL;
168 irq_desc[i].depth = 2;
169 irq_desc[i].handler = &emma2rh_gpio_irq_controller;
170 }
171 139
172 emma2rh_gpio_irq_base = irq_base; 140 emma2rh_gpio_irq_base = irq_base;
173} 141}
diff --git a/arch/mips/emma2rh/markeins/platform.c b/arch/mips/emma2rh/markeins/platform.c
index 15cc61df362..11567702b15 100644
--- a/arch/mips/emma2rh/markeins/platform.c
+++ b/arch/mips/emma2rh/markeins/platform.c
@@ -44,18 +44,45 @@
44#define I2C_EMMA2RH "emma2rh-iic" /* must be in sync with IIC driver */ 44#define I2C_EMMA2RH "emma2rh-iic" /* must be in sync with IIC driver */
45 45
46static struct resource i2c_emma_resources_0[] = { 46static struct resource i2c_emma_resources_0[] = {
47 { NULL, EMMA2RH_IRQ_PIIC0, EMMA2RH_IRQ_PIIC0, IORESOURCE_IRQ }, 47 {
48 { NULL, KSEG1ADDR(EMMA2RH_PIIC0_BASE), KSEG1ADDR(EMMA2RH_PIIC0_BASE + 0x1000), 0 }, 48 .name = NULL,
49 .start = EMMA2RH_IRQ_PIIC0,
50 .end = EMMA2RH_IRQ_PIIC0,
51 .flags = IORESOURCE_IRQ
52 }, {
53 .name = NULL,
54 .start = EMMA2RH_PIIC0_BASE,
55 .end = EMMA2RH_PIIC0_BASE + 0x1000,
56 .flags = 0
57 },
49}; 58};
50 59
51struct resource i2c_emma_resources_1[] = { 60struct resource i2c_emma_resources_1[] = {
52 { NULL, EMMA2RH_IRQ_PIIC1, EMMA2RH_IRQ_PIIC1, IORESOURCE_IRQ }, 61 {
53 { NULL, KSEG1ADDR(EMMA2RH_PIIC1_BASE), KSEG1ADDR(EMMA2RH_PIIC1_BASE + 0x1000), 0 }, 62 .name = NULL,
63 .start = EMMA2RH_IRQ_PIIC1,
64 .end = EMMA2RH_IRQ_PIIC1,
65 .flags = IORESOURCE_IRQ
66 }, {
67 .name = NULL,
68 .start = EMMA2RH_PIIC1_BASE,
69 .end = EMMA2RH_PIIC1_BASE + 0x1000,
70 .flags = 0
71 },
54}; 72};
55 73
56struct resource i2c_emma_resources_2[] = { 74struct resource i2c_emma_resources_2[] = {
57 { NULL, EMMA2RH_IRQ_PIIC2, EMMA2RH_IRQ_PIIC2, IORESOURCE_IRQ }, 75 {
58 { NULL, KSEG1ADDR(EMMA2RH_PIIC2_BASE), KSEG1ADDR(EMMA2RH_PIIC2_BASE + 0x1000), 0 }, 76 .name = NULL,
77 .start = EMMA2RH_IRQ_PIIC2,
78 .end = EMMA2RH_IRQ_PIIC2,
79 .flags = IORESOURCE_IRQ
80 }, {
81 .name = NULL,
82 .start = EMMA2RH_PIIC2_BASE,
83 .end = EMMA2RH_PIIC2_BASE + 0x1000,
84 .flags = 0
85 },
59}; 86};
60 87
61struct platform_device i2c_emma_devices[] = { 88struct platform_device i2c_emma_devices[] = {
@@ -83,32 +110,29 @@ struct platform_device i2c_emma_devices[] = {
83#define EMMA2RH_SERIAL_FLAGS UPF_BOOT_AUTOCONF | UPF_SKIP_TEST 110#define EMMA2RH_SERIAL_FLAGS UPF_BOOT_AUTOCONF | UPF_SKIP_TEST
84 111
85static struct plat_serial8250_port platform_serial_ports[] = { 112static struct plat_serial8250_port platform_serial_ports[] = {
86 [0] = { 113 [0] = {
87 .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR0_BASE + 3), 114 .membase= (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR0_BASE + 3),
88 .irq = EMMA2RH_IRQ_PFUR0, 115 .irq = EMMA2RH_IRQ_PFUR0,
89 .uartclk = EMMA2RH_SERIAL_CLOCK, 116 .uartclk = EMMA2RH_SERIAL_CLOCK,
90 .regshift = 4, 117 .regshift = 4,
91 .iotype = UPIO_MEM, 118 .iotype = UPIO_MEM,
92 .flags = EMMA2RH_SERIAL_FLAGS, 119 .flags = EMMA2RH_SERIAL_FLAGS,
93 }, 120 }, [1] = {
94 [1] = { 121 .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR1_BASE + 3),
95 .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR1_BASE + 3), 122 .irq = EMMA2RH_IRQ_PFUR1,
96 .irq = EMMA2RH_IRQ_PFUR1, 123 .uartclk = EMMA2RH_SERIAL_CLOCK,
97 .uartclk = EMMA2RH_SERIAL_CLOCK, 124 .regshift = 4,
98 .regshift = 4, 125 .iotype = UPIO_MEM,
99 .iotype = UPIO_MEM, 126 .flags = EMMA2RH_SERIAL_FLAGS,
100 .flags = EMMA2RH_SERIAL_FLAGS, 127 }, [2] = {
101 }, 128 .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR2_BASE + 3),
102 [2] = { 129 .irq = EMMA2RH_IRQ_PFUR2,
103 .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR2_BASE + 3), 130 .uartclk = EMMA2RH_SERIAL_CLOCK,
104 .irq = EMMA2RH_IRQ_PFUR2, 131 .regshift = 4,
105 .uartclk = EMMA2RH_SERIAL_CLOCK, 132 .iotype = UPIO_MEM,
106 .regshift = 4, 133 .flags = EMMA2RH_SERIAL_FLAGS,
107 .iotype = UPIO_MEM, 134 }, [3] = {
108 .flags = EMMA2RH_SERIAL_FLAGS, 135 .flags = 0,
109 },
110 [3] = {
111 .flags = 0,
112 }, 136 },
113}; 137};
114 138
diff --git a/arch/mips/gt64120/common/time.c b/arch/mips/gt64120/common/time.c
index c83ae6acd60..c47eeb76819 100644
--- a/arch/mips/gt64120/common/time.c
+++ b/arch/mips/gt64120/common/time.c
@@ -64,14 +64,14 @@ static irqreturn_t gt64120_irq(int irq, void *dev_id)
64 * as *irq (=irq0 in ../kernel/time.c). We will do our own timer interrupt 64 * as *irq (=irq0 in ../kernel/time.c). We will do our own timer interrupt
65 * handling. 65 * handling.
66 */ 66 */
67void gt64120_time_init(void) 67void __init plat_timer_setup(struct irqaction *irq)
68{ 68{
69 static struct irqaction timer; 69 static struct irqaction timer;
70 70
71 /* Disable timer first */ 71 /* Disable timer first */
72 GT_WRITE(GT_TC_CONTROL_OFS, 0); 72 GT_WRITE(GT_TC_CONTROL_OFS, 0);
73 /* Load timer value for 100 Hz */ 73 /* Load timer value for 100 Hz */
74 GT_WRITE(GT_TC3_OFS, Sys_clock / 100); 74 GT_WRITE(GT_TC3_OFS, Sys_clock / HZ);
75 75
76 /* 76 /*
77 * Create the IRQ structure entry for the timer. Since we're too early 77 * Create the IRQ structure entry for the timer. Since we're too early
diff --git a/arch/mips/gt64120/ev64120/irq.c b/arch/mips/gt64120/ev64120/irq.c
index ed4d82b9a24..b3e5796c81d 100644
--- a/arch/mips/gt64120/ev64120/irq.c
+++ b/arch/mips/gt64120/ev64120/irq.c
@@ -66,38 +66,21 @@ asmlinkage void plat_irq_dispatch(void)
66 66
67static void disable_ev64120_irq(unsigned int irq_nr) 67static void disable_ev64120_irq(unsigned int irq_nr)
68{ 68{
69 unsigned long flags;
70
71 local_irq_save(flags);
72 if (irq_nr >= 8) { // All PCI interrupts are on line 5 or 2 69 if (irq_nr >= 8) { // All PCI interrupts are on line 5 or 2
73 clear_c0_status(9 << 10); 70 clear_c0_status(9 << 10);
74 } else { 71 } else {
75 clear_c0_status(1 << (irq_nr + 8)); 72 clear_c0_status(1 << (irq_nr + 8));
76 } 73 }
77 local_irq_restore(flags);
78} 74}
79 75
80static void enable_ev64120_irq(unsigned int irq_nr) 76static void enable_ev64120_irq(unsigned int irq_nr)
81{ 77{
82 unsigned long flags;
83
84 local_irq_save(flags);
85 if (irq_nr >= 8) // All PCI interrupts are on line 5 or 2 78 if (irq_nr >= 8) // All PCI interrupts are on line 5 or 2
86 set_c0_status(9 << 10); 79 set_c0_status(9 << 10);
87 else 80 else
88 set_c0_status(1 << (irq_nr + 8)); 81 set_c0_status(1 << (irq_nr + 8));
89 local_irq_restore(flags);
90}
91
92static unsigned int startup_ev64120_irq(unsigned int irq)
93{
94 enable_ev64120_irq(irq);
95 return 0; /* Never anything pending */
96} 82}
97 83
98#define shutdown_ev64120_irq disable_ev64120_irq
99#define mask_and_ack_ev64120_irq disable_ev64120_irq
100
101static void end_ev64120_irq(unsigned int irq) 84static void end_ev64120_irq(unsigned int irq)
102{ 85{
103 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 86 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
@@ -106,13 +89,11 @@ static void end_ev64120_irq(unsigned int irq)
106 89
107static struct irq_chip ev64120_irq_type = { 90static struct irq_chip ev64120_irq_type = {
108 .typename = "EV64120", 91 .typename = "EV64120",
109 .startup = startup_ev64120_irq, 92 .ack = disable_ev64120_irq,
110 .shutdown = shutdown_ev64120_irq, 93 .mask = disable_ev64120_irq,
111 .enable = enable_ev64120_irq, 94 .mask_ack = disable_ev64120_irq,
112 .disable = disable_ev64120_irq, 95 .unmask = enable_ev64120_irq,
113 .ack = mask_and_ack_ev64120_irq,
114 .end = end_ev64120_irq, 96 .end = end_ev64120_irq,
115 .set_affinity = NULL
116}; 97};
117 98
118void gt64120_irq_setup(void) 99void gt64120_irq_setup(void)
@@ -122,8 +103,6 @@ void gt64120_irq_setup(void)
122 */ 103 */
123 clear_c0_status(ST0_IM); 104 clear_c0_status(ST0_IM);
124 105
125 local_irq_disable();
126
127 /* 106 /*
128 * Enable timer. Other interrupts will be enabled as they are 107 * Enable timer. Other interrupts will be enabled as they are
129 * registered. 108 * registered.
@@ -133,16 +112,5 @@ void gt64120_irq_setup(void)
133 112
134void __init arch_init_irq(void) 113void __init arch_init_irq(void)
135{ 114{
136 int i;
137
138 /* Let's initialize our IRQ descriptors */
139 for (i = 0; i < NR_IRQS; i++) {
140 irq_desc[i].status = 0;
141 irq_desc[i].chip = &no_irq_chip;
142 irq_desc[i].action = NULL;
143 irq_desc[i].depth = 0;
144 spin_lock_init(&irq_desc[i].lock);
145 }
146
147 gt64120_irq_setup(); 115 gt64120_irq_setup();
148} 116}
diff --git a/arch/mips/gt64120/ev64120/setup.c b/arch/mips/gt64120/ev64120/setup.c
index 91c2d3f4161..99c8d42212e 100644
--- a/arch/mips/gt64120/ev64120/setup.c
+++ b/arch/mips/gt64120/ev64120/setup.c
@@ -68,7 +68,6 @@ unsigned long __init prom_free_prom_memory(void)
68 * Initializes basic routines and structures pointers, memory size (as 68 * Initializes basic routines and structures pointers, memory size (as
69 * given by the bios and saves the command line. 69 * given by the bios and saves the command line.
70 */ 70 */
71extern void gt64120_time_init(void);
72 71
73void __init plat_mem_setup(void) 72void __init plat_mem_setup(void)
74{ 73{
@@ -76,7 +75,6 @@ void __init plat_mem_setup(void)
76 _machine_halt = galileo_machine_halt; 75 _machine_halt = galileo_machine_halt;
77 pm_power_off = galileo_machine_power_off; 76 pm_power_off = galileo_machine_power_off;
78 77
79 board_time_init = gt64120_time_init;
80 set_io_port_base(KSEG1); 78 set_io_port_base(KSEG1);
81} 79}
82 80
diff --git a/arch/mips/gt64120/momenco_ocelot/setup.c b/arch/mips/gt64120/momenco_ocelot/setup.c
index 0e5bbee2d5b..94f94ebbda6 100644
--- a/arch/mips/gt64120/momenco_ocelot/setup.c
+++ b/arch/mips/gt64120/momenco_ocelot/setup.c
@@ -70,7 +70,6 @@ extern void momenco_ocelot_restart(char *command);
70extern void momenco_ocelot_halt(void); 70extern void momenco_ocelot_halt(void);
71extern void momenco_ocelot_power_off(void); 71extern void momenco_ocelot_power_off(void);
72 72
73extern void gt64120_time_init(void);
74extern void momenco_ocelot_irq_setup(void); 73extern void momenco_ocelot_irq_setup(void);
75 74
76static char reset_reason; 75static char reset_reason;
@@ -156,8 +155,6 @@ void __init plat_mem_setup(void)
156 void (*l3func)(unsigned long)=KSEG1ADDR(&setup_l3cache); 155 void (*l3func)(unsigned long)=KSEG1ADDR(&setup_l3cache);
157 unsigned int tmpword; 156 unsigned int tmpword;
158 157
159 board_time_init = gt64120_time_init;
160
161 _machine_restart = momenco_ocelot_restart; 158 _machine_restart = momenco_ocelot_restart;
162 _machine_halt = momenco_ocelot_halt; 159 _machine_halt = momenco_ocelot_halt;
163 pm_power_off = momenco_ocelot_power_off; 160 pm_power_off = momenco_ocelot_power_off;
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c
index d5bd6b3a093..5c4f50cdf15 100644
--- a/arch/mips/jazz/irq.c
+++ b/arch/mips/jazz/irq.c
@@ -28,14 +28,6 @@ static void enable_r4030_irq(unsigned int irq)
28 spin_unlock_irqrestore(&r4030_lock, flags); 28 spin_unlock_irqrestore(&r4030_lock, flags);
29} 29}
30 30
31static unsigned int startup_r4030_irq(unsigned int irq)
32{
33 enable_r4030_irq(irq);
34 return 0; /* never anything pending */
35}
36
37#define shutdown_r4030_irq disable_r4030_irq
38
39void disable_r4030_irq(unsigned int irq) 31void disable_r4030_irq(unsigned int irq)
40{ 32{
41 unsigned int mask = ~(1 << (irq - JAZZ_PARALLEL_IRQ)); 33 unsigned int mask = ~(1 << (irq - JAZZ_PARALLEL_IRQ));
@@ -47,8 +39,6 @@ void disable_r4030_irq(unsigned int irq)
47 spin_unlock_irqrestore(&r4030_lock, flags); 39 spin_unlock_irqrestore(&r4030_lock, flags);
48} 40}
49 41
50#define mask_and_ack_r4030_irq disable_r4030_irq
51
52static void end_r4030_irq(unsigned int irq) 42static void end_r4030_irq(unsigned int irq)
53{ 43{
54 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 44 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
@@ -57,11 +47,10 @@ static void end_r4030_irq(unsigned int irq)
57 47
58static struct irq_chip r4030_irq_type = { 48static struct irq_chip r4030_irq_type = {
59 .typename = "R4030", 49 .typename = "R4030",
60 .startup = startup_r4030_irq, 50 .ack = disable_r4030_irq,
61 .shutdown = shutdown_r4030_irq, 51 .mask = disable_r4030_irq,
62 .enable = enable_r4030_irq, 52 .mask_ack = disable_r4030_irq,
63 .disable = disable_r4030_irq, 53 .unmask = enable_r4030_irq,
64 .ack = mask_and_ack_r4030_irq,
65 .end = end_r4030_irq, 54 .end = end_r4030_irq,
66}; 55};
67 56
@@ -69,12 +58,8 @@ void __init init_r4030_ints(void)
69{ 58{
70 int i; 59 int i;
71 60
72 for (i = JAZZ_PARALLEL_IRQ; i <= JAZZ_TIMER_IRQ; i++) { 61 for (i = JAZZ_PARALLEL_IRQ; i <= JAZZ_TIMER_IRQ; i++)
73 irq_desc[i].status = IRQ_DISABLED; 62 set_irq_chip_and_handler(i, &r4030_irq_type, handle_level_irq);
74 irq_desc[i].action = 0;
75 irq_desc[i].depth = 1;
76 irq_desc[i].chip = &r4030_irq_type;
77 }
78 63
79 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, 0); 64 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, 0);
80 r4030_read_reg16(JAZZ_IO_IRQ_SOURCE); /* clear pending IRQs */ 65 r4030_read_reg16(JAZZ_IO_IRQ_SOURCE); /* clear pending IRQs */
diff --git a/arch/mips/jmr3927/rbhma3100/irq.c b/arch/mips/jmr3927/rbhma3100/irq.c
index 39a0243bed9..3da49c5aaf4 100644
--- a/arch/mips/jmr3927/rbhma3100/irq.c
+++ b/arch/mips/jmr3927/rbhma3100/irq.c
@@ -90,17 +90,6 @@ static unsigned char irc_level[TX3927_NUM_IR] = {
90static void jmr3927_irq_disable(unsigned int irq_nr); 90static void jmr3927_irq_disable(unsigned int irq_nr);
91static void jmr3927_irq_enable(unsigned int irq_nr); 91static void jmr3927_irq_enable(unsigned int irq_nr);
92 92
93static DEFINE_SPINLOCK(jmr3927_irq_lock);
94
95static unsigned int jmr3927_irq_startup(unsigned int irq)
96{
97 jmr3927_irq_enable(irq);
98
99 return 0;
100}
101
102#define jmr3927_irq_shutdown jmr3927_irq_disable
103
104static void jmr3927_irq_ack(unsigned int irq) 93static void jmr3927_irq_ack(unsigned int irq)
105{ 94{
106 if (irq == JMR3927_IRQ_IRC_TMR0) 95 if (irq == JMR3927_IRQ_IRC_TMR0)
@@ -118,9 +107,7 @@ static void jmr3927_irq_end(unsigned int irq)
118static void jmr3927_irq_disable(unsigned int irq_nr) 107static void jmr3927_irq_disable(unsigned int irq_nr)
119{ 108{
120 struct tb_irq_space* sp; 109 struct tb_irq_space* sp;
121 unsigned long flags;
122 110
123 spin_lock_irqsave(&jmr3927_irq_lock, flags);
124 for (sp = tb_irq_spaces; sp; sp = sp->next) { 111 for (sp = tb_irq_spaces; sp; sp = sp->next) {
125 if (sp->start_irqno <= irq_nr && 112 if (sp->start_irqno <= irq_nr &&
126 irq_nr < sp->start_irqno + sp->nr_irqs) { 113 irq_nr < sp->start_irqno + sp->nr_irqs) {
@@ -130,15 +117,12 @@ static void jmr3927_irq_disable(unsigned int irq_nr)
130 break; 117 break;
131 } 118 }
132 } 119 }
133 spin_unlock_irqrestore(&jmr3927_irq_lock, flags);
134} 120}
135 121
136static void jmr3927_irq_enable(unsigned int irq_nr) 122static void jmr3927_irq_enable(unsigned int irq_nr)
137{ 123{
138 struct tb_irq_space* sp; 124 struct tb_irq_space* sp;
139 unsigned long flags;
140 125
141 spin_lock_irqsave(&jmr3927_irq_lock, flags);
142 for (sp = tb_irq_spaces; sp; sp = sp->next) { 126 for (sp = tb_irq_spaces; sp; sp = sp->next) {
143 if (sp->start_irqno <= irq_nr && 127 if (sp->start_irqno <= irq_nr &&
144 irq_nr < sp->start_irqno + sp->nr_irqs) { 128 irq_nr < sp->start_irqno + sp->nr_irqs) {
@@ -148,7 +132,6 @@ static void jmr3927_irq_enable(unsigned int irq_nr)
148 break; 132 break;
149 } 133 }
150 } 134 }
151 spin_unlock_irqrestore(&jmr3927_irq_lock, flags);
152} 135}
153 136
154/* 137/*
@@ -288,6 +271,8 @@ static void tx_branch_likely_bug_fixup(void)
288 271
289static void jmr3927_spurious(void) 272static void jmr3927_spurious(void)
290{ 273{
274 struct pt_regs * regs = get_irq_regs();
275
291#ifdef CONFIG_TX_BRANCH_LIKELY_BUG_WORKAROUND 276#ifdef CONFIG_TX_BRANCH_LIKELY_BUG_WORKAROUND
292 tx_branch_likely_bug_fixup(); 277 tx_branch_likely_bug_fixup();
293#endif 278#endif
@@ -297,6 +282,7 @@ static void jmr3927_spurious(void)
297 282
298asmlinkage void plat_irq_dispatch(void) 283asmlinkage void plat_irq_dispatch(void)
299{ 284{
285 struct pt_regs * regs = get_irq_regs();
300 int irq; 286 int irq;
301 287
302#ifdef CONFIG_TX_BRANCH_LIKELY_BUG_WORKAROUND 288#ifdef CONFIG_TX_BRANCH_LIKELY_BUG_WORKAROUND
@@ -454,11 +440,10 @@ void __init arch_init_irq(void)
454 440
455static struct irq_chip jmr3927_irq_controller = { 441static struct irq_chip jmr3927_irq_controller = {
456 .typename = "jmr3927_irq", 442 .typename = "jmr3927_irq",
457 .startup = jmr3927_irq_startup,
458 .shutdown = jmr3927_irq_shutdown,
459 .enable = jmr3927_irq_enable,
460 .disable = jmr3927_irq_disable,
461 .ack = jmr3927_irq_ack, 443 .ack = jmr3927_irq_ack,
444 .mask = jmr3927_irq_disable,
445 .mask_ack = jmr3927_irq_ack,
446 .unmask = jmr3927_irq_enable,
462 .end = jmr3927_irq_end, 447 .end = jmr3927_irq_end,
463}; 448};
464 449
@@ -466,12 +451,8 @@ void jmr3927_irq_init(u32 irq_base)
466{ 451{
467 u32 i; 452 u32 i;
468 453
469 for (i= irq_base; i< irq_base + JMR3927_NR_IRQ_IRC + JMR3927_NR_IRQ_IOC; i++) { 454 for (i= irq_base; i< irq_base + JMR3927_NR_IRQ_IRC + JMR3927_NR_IRQ_IOC; i++)
470 irq_desc[i].status = IRQ_DISABLED; 455 set_irq_chip(i, &jmr3927_irq_controller);
471 irq_desc[i].action = NULL;
472 irq_desc[i].depth = 1;
473 irq_desc[i].chip = &jmr3927_irq_controller;
474 }
475 456
476 jmr3927_irq_base = irq_base; 457 jmr3927_irq_base = irq_base;
477} 458}
diff --git a/arch/mips/jmr3927/rbhma3100/setup.c b/arch/mips/jmr3927/rbhma3100/setup.c
index 025434054ed..138f25efe38 100644
--- a/arch/mips/jmr3927/rbhma3100/setup.c
+++ b/arch/mips/jmr3927/rbhma3100/setup.c
@@ -170,12 +170,20 @@ static void jmr3927_machine_power_off(void)
170 while (1); 170 while (1);
171} 171}
172 172
173static cycle_t jmr3927_hpt_read(void)
174{
175 /* We assume this function is called xtime_lock held. */
176 return jiffies * (JMR3927_TIMER_CLK / HZ) + jmr3927_tmrptr->trr;
177}
178
173#define USE_RTC_DS1742 179#define USE_RTC_DS1742
174#ifdef USE_RTC_DS1742 180#ifdef USE_RTC_DS1742
175extern void rtc_ds1742_init(unsigned long base); 181extern void rtc_ds1742_init(unsigned long base);
176#endif 182#endif
177static void __init jmr3927_time_init(void) 183static void __init jmr3927_time_init(void)
178{ 184{
185 clocksource_mips.read = jmr3927_hpt_read;
186 mips_hpt_frequency = JMR3927_TIMER_CLK;
179#ifdef USE_RTC_DS1742 187#ifdef USE_RTC_DS1742
180 if (jmr3927_have_nvram()) { 188 if (jmr3927_have_nvram()) {
181 rtc_ds1742_init(JMR3927_IOC_NVRAMB_ADDR); 189 rtc_ds1742_init(JMR3927_IOC_NVRAMB_ADDR);
@@ -183,12 +191,8 @@ static void __init jmr3927_time_init(void)
183#endif 191#endif
184} 192}
185 193
186unsigned long jmr3927_do_gettimeoffset(void);
187
188void __init plat_timer_setup(struct irqaction *irq) 194void __init plat_timer_setup(struct irqaction *irq)
189{ 195{
190 do_gettimeoffset = jmr3927_do_gettimeoffset;
191
192 jmr3927_tmrptr->cpra = JMR3927_TIMER_CLK / HZ; 196 jmr3927_tmrptr->cpra = JMR3927_TIMER_CLK / HZ;
193 jmr3927_tmrptr->itmr = TXx927_TMTITMR_TIIE | TXx927_TMTITMR_TZCE; 197 jmr3927_tmrptr->itmr = TXx927_TMTITMR_TIIE | TXx927_TMTITMR_TZCE;
194 jmr3927_tmrptr->ccdr = JMR3927_TIMER_CCD; 198 jmr3927_tmrptr->ccdr = JMR3927_TIMER_CCD;
@@ -200,34 +204,6 @@ void __init plat_timer_setup(struct irqaction *irq)
200 204
201#define USECS_PER_JIFFY (1000000/HZ) 205#define USECS_PER_JIFFY (1000000/HZ)
202 206
203unsigned long jmr3927_do_gettimeoffset(void)
204{
205 unsigned long count;
206 unsigned long res = 0;
207
208 /* MUST read TRR before TISR. */
209 count = jmr3927_tmrptr->trr;
210
211 if (jmr3927_tmrptr->tisr & TXx927_TMTISR_TIIS) {
212 /* timer interrupt is pending. use Max value. */
213 res = USECS_PER_JIFFY - 1;
214 } else {
215 /* convert to usec */
216 /* res = count / (JMR3927_TIMER_CLK / 1000000); */
217 res = (count << 7) / ((JMR3927_TIMER_CLK << 7) / 1000000);
218
219 /*
220 * Due to possible jiffies inconsistencies, we need to check
221 * the result so that we'll get a timer that is monotonic.
222 */
223 if (res >= USECS_PER_JIFFY)
224 res = USECS_PER_JIFFY-1;
225 }
226
227 return res;
228}
229
230
231//#undef DO_WRITE_THROUGH 207//#undef DO_WRITE_THROUGH
232#define DO_WRITE_THROUGH 208#define DO_WRITE_THROUGH
233#define DO_ENABLE_CACHE 209#define DO_ENABLE_CACHE
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index cd9cec9e39e..bbbb8d7cb89 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -6,7 +6,7 @@ extra-y := head.o init_task.o vmlinux.lds
6 6
7obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ 7obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \
8 ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \ 8 ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \
9 time.o traps.o unaligned.o 9 time.o topology.o traps.o unaligned.o
10 10
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
@@ -45,7 +45,6 @@ obj-$(CONFIG_MIPS_APSP_KSPD) += kspd.o
45obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o 45obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o
46obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o 46obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o
47 47
48obj-$(CONFIG_NO_ISA) += dma-no-isa.o
49obj-$(CONFIG_I8259) += i8259.o 48obj-$(CONFIG_I8259) += i8259.o
50obj-$(CONFIG_IRQ_CPU) += irq_cpu.o 49obj-$(CONFIG_IRQ_CPU) += irq_cpu.o
51obj-$(CONFIG_IRQ_CPU_RM7K) += irq-rm7000.o 50obj-$(CONFIG_IRQ_CPU_RM7K) += irq-rm7000.o
@@ -67,6 +66,8 @@ obj-$(CONFIG_64BIT) += cpu-bugs64.o
67 66
68obj-$(CONFIG_I8253) += i8253.o 67obj-$(CONFIG_I8253) += i8253.o
69 68
69obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
70
70CFLAGS_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) 71CFLAGS_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)
71 72
72EXTRA_AFLAGS := $(CFLAGS) 73EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index e9ce5b3721a..ff88b06f89d 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -22,7 +22,7 @@
22#define offset(string, ptr, member) \ 22#define offset(string, ptr, member) \
23 __asm__("\n@@@" string "%0" : : "i" (_offset(ptr, member))) 23 __asm__("\n@@@" string "%0" : : "i" (_offset(ptr, member)))
24#define constant(string, member) \ 24#define constant(string, member) \
25 __asm__("\n@@@" string "%x0" : : "ri" (member)) 25 __asm__("\n@@@" string "%X0" : : "ri" (member))
26#define size(string, size) \ 26#define size(string, size) \
27 __asm__("\n@@@" string "%0" : : "i" (sizeof(size))) 27 __asm__("\n@@@" string "%0" : : "i" (sizeof(size)))
28#define linefeed text("") 28#define linefeed text("")
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 8485af340ee..442839e9578 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -110,9 +110,8 @@ static inline void check_wait(void)
110{ 110{
111 struct cpuinfo_mips *c = &current_cpu_data; 111 struct cpuinfo_mips *c = &current_cpu_data;
112 112
113 printk("Checking for 'wait' instruction... ");
114 if (nowait) { 113 if (nowait) {
115 printk (" disabled.\n"); 114 printk("Wait instruction disabled.\n");
116 return; 115 return;
117 } 116 }
118 117
@@ -120,11 +119,9 @@ static inline void check_wait(void)
120 case CPU_R3081: 119 case CPU_R3081:
121 case CPU_R3081E: 120 case CPU_R3081E:
122 cpu_wait = r3081_wait; 121 cpu_wait = r3081_wait;
123 printk(" available.\n");
124 break; 122 break;
125 case CPU_TX3927: 123 case CPU_TX3927:
126 cpu_wait = r39xx_wait; 124 cpu_wait = r39xx_wait;
127 printk(" available.\n");
128 break; 125 break;
129 case CPU_R4200: 126 case CPU_R4200:
130/* case CPU_R4300: */ 127/* case CPU_R4300: */
@@ -146,33 +143,23 @@ static inline void check_wait(void)
146 case CPU_74K: 143 case CPU_74K:
147 case CPU_PR4450: 144 case CPU_PR4450:
148 cpu_wait = r4k_wait; 145 cpu_wait = r4k_wait;
149 printk(" available.\n");
150 break; 146 break;
151 case CPU_TX49XX: 147 case CPU_TX49XX:
152 cpu_wait = r4k_wait_irqoff; 148 cpu_wait = r4k_wait_irqoff;
153 printk(" available.\n");
154 break; 149 break;
155 case CPU_AU1000: 150 case CPU_AU1000:
156 case CPU_AU1100: 151 case CPU_AU1100:
157 case CPU_AU1500: 152 case CPU_AU1500:
158 case CPU_AU1550: 153 case CPU_AU1550:
159 case CPU_AU1200: 154 case CPU_AU1200:
160 if (allow_au1k_wait) { 155 if (allow_au1k_wait)
161 cpu_wait = au1k_wait; 156 cpu_wait = au1k_wait;
162 printk(" available.\n");
163 } else
164 printk(" unavailable.\n");
165 break; 157 break;
166 case CPU_RM9000: 158 case CPU_RM9000:
167 if ((c->processor_id & 0x00ff) >= 0x40) { 159 if ((c->processor_id & 0x00ff) >= 0x40)
168 cpu_wait = r4k_wait; 160 cpu_wait = r4k_wait;
169 printk(" available.\n");
170 } else {
171 printk(" unavailable.\n");
172 }
173 break; 161 break;
174 default: 162 default:
175 printk(" unavailable.\n");
176 break; 163 break;
177 } 164 }
178} 165}
diff --git a/arch/mips/kernel/dma-no-isa.c b/arch/mips/kernel/dma-no-isa.c
deleted file mode 100644
index 6df8b07741e..00000000000
--- a/arch/mips/kernel/dma-no-isa.c
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 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 417c08ac76e..f10b6a19f8b 100644
--- a/arch/mips/kernel/entry.S
+++ b/arch/mips/kernel/entry.S
@@ -83,7 +83,10 @@ FEXPORT(syscall_exit)
83FEXPORT(restore_all) # restore full frame 83FEXPORT(restore_all) # restore full frame
84#ifdef CONFIG_MIPS_MT_SMTC 84#ifdef CONFIG_MIPS_MT_SMTC
85/* Detect and execute deferred IPI "interrupts" */ 85/* Detect and execute deferred IPI "interrupts" */
86 LONG_L s0, TI_REGS($28)
87 LONG_S sp, TI_REGS($28)
86 jal deferred_smtc_ipi 88 jal deferred_smtc_ipi
89 LONG_S s0, TI_REGS($28)
87/* Re-arm any temporarily masked interrupts not explicitly "acked" */ 90/* Re-arm any temporarily masked interrupts not explicitly "acked" */
88 mfc0 v0, CP0_TCSTATUS 91 mfc0 v0, CP0_TCSTATUS
89 ori v1, v0, TCSTATUS_IXMT 92 ori v1, v0, TCSTATUS_IXMT
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index 5baca16993d..aacd4a005c5 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -19,6 +19,7 @@
19#include <asm/mipsregs.h> 19#include <asm/mipsregs.h>
20#include <asm/stackframe.h> 20#include <asm/stackframe.h>
21#include <asm/war.h> 21#include <asm/war.h>
22#include <asm/page.h>
22 23
23#define PANIC_PIC(msg) \ 24#define PANIC_PIC(msg) \
24 .set push; \ 25 .set push; \
@@ -378,6 +379,68 @@ NESTED(nmi_handler, PT_SIZE, sp)
378 BUILD_HANDLER dsp dsp sti silent /* #26 */ 379 BUILD_HANDLER dsp dsp sti silent /* #26 */
379 BUILD_HANDLER reserved reserved sti verbose /* others */ 380 BUILD_HANDLER reserved reserved sti verbose /* others */
380 381
382 .align 5
383 LEAF(handle_ri_rdhwr_vivt)
384#ifdef CONFIG_MIPS_MT_SMTC
385 PANIC_PIC("handle_ri_rdhwr_vivt called")
386#else
387 .set push
388 .set noat
389 .set noreorder
390 /* check if TLB contains a entry for EPC */
391 MFC0 k1, CP0_ENTRYHI
392 andi k1, 0xff /* ASID_MASK */
393 MFC0 k0, CP0_EPC
394 PTR_SRL k0, PAGE_SHIFT + 1
395 PTR_SLL k0, PAGE_SHIFT + 1
396 or k1, k0
397 MTC0 k1, CP0_ENTRYHI
398 mtc0_tlbw_hazard
399 tlbp
400 tlb_probe_hazard
401 mfc0 k1, CP0_INDEX
402 .set pop
403 bltz k1, handle_ri /* slow path */
404 /* fall thru */
405#endif
406 END(handle_ri_rdhwr_vivt)
407
408 LEAF(handle_ri_rdhwr)
409 .set push
410 .set noat
411 .set noreorder
412 /* 0x7c03e83b: rdhwr v1,$29 */
413 MFC0 k1, CP0_EPC
414 lui k0, 0x7c03
415 lw k1, (k1)
416 ori k0, 0xe83b
417 .set reorder
418 bne k0, k1, handle_ri /* if not ours */
419 /* The insn is rdhwr. No need to check CAUSE.BD here. */
420 get_saved_sp /* k1 := current_thread_info */
421 .set noreorder
422 MFC0 k0, CP0_EPC
423#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
424 ori k1, _THREAD_MASK
425 xori k1, _THREAD_MASK
426 LONG_L v1, TI_TP_VALUE(k1)
427 LONG_ADDIU k0, 4
428 jr k0
429 rfe
430#else
431 LONG_ADDIU k0, 4 /* stall on $k0 */
432 MTC0 k0, CP0_EPC
433 /* I hope three instructions between MTC0 and ERET are enough... */
434 ori k1, _THREAD_MASK
435 xori k1, _THREAD_MASK
436 LONG_L v1, TI_TP_VALUE(k1)
437 .set mips3
438 eret
439 .set mips0
440#endif
441 .set pop
442 END(handle_ri_rdhwr)
443
381#ifdef CONFIG_64BIT 444#ifdef CONFIG_64BIT
382/* A temporary overflow handler used by check_daddi(). */ 445/* A temporary overflow handler used by check_daddi(). */
383 446
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index 8c6db0fc72f..a2e095adaa3 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -189,7 +189,8 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
189 189
190 MTC0 zero, CP0_CONTEXT # clear context register 190 MTC0 zero, CP0_CONTEXT # clear context register
191 PTR_LA $28, init_thread_union 191 PTR_LA $28, init_thread_union
192 PTR_ADDIU sp, $28, _THREAD_SIZE - 32 192 PTR_LI sp, _THREAD_SIZE - 32
193 PTR_ADDU sp, $28
193 set_saved_sp sp, t0, t1 194 set_saved_sp sp, t0, t1
194 PTR_SUBU sp, 4 * SZREG # init stack pointer 195 PTR_SUBU sp, 4 * SZREG # init stack pointer
195 196
@@ -249,6 +250,9 @@ NESTED(smp_bootstrap, 16, sp)
249 */ 250 */
250 page swapper_pg_dir, _PGD_ORDER 251 page swapper_pg_dir, _PGD_ORDER
251#ifdef CONFIG_64BIT 252#ifdef CONFIG_64BIT
253#if defined(CONFIG_MODULES) && !defined(CONFIG_BUILD_ELF64)
254 page module_pg_dir, _PGD_ORDER
255#endif
252 page invalid_pmd_table, _PMD_ORDER 256 page invalid_pmd_table, _PMD_ORDER
253#endif 257#endif
254 page invalid_pte_table, _PTE_ORDER 258 page invalid_pte_table, _PTE_ORDER
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index 48e3418c217..2526c0ca4d8 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
@@ -40,21 +40,10 @@ static void end_8259A_irq (unsigned int irq)
40 enable_8259A_irq(irq); 40 enable_8259A_irq(irq);
41} 41}
42 42
43#define shutdown_8259A_irq disable_8259A_irq
44
45void mask_and_ack_8259A(unsigned int); 43void mask_and_ack_8259A(unsigned int);
46 44
47static unsigned int startup_8259A_irq(unsigned int irq)
48{
49 enable_8259A_irq(irq);
50
51 return 0; /* never anything pending */
52}
53
54static struct irq_chip i8259A_irq_type = { 45static struct irq_chip i8259A_irq_type = {
55 .typename = "XT-PIC", 46 .typename = "XT-PIC",
56 .startup = startup_8259A_irq,
57 .shutdown = shutdown_8259A_irq,
58 .enable = enable_8259A_irq, 47 .enable = enable_8259A_irq,
59 .disable = disable_8259A_irq, 48 .disable = disable_8259A_irq,
60 .ack = mask_and_ack_8259A, 49 .ack = mask_and_ack_8259A,
@@ -120,7 +109,7 @@ int i8259A_irq_pending(unsigned int irq)
120void make_8259A_irq(unsigned int irq) 109void make_8259A_irq(unsigned int irq)
121{ 110{
122 disable_irq_nosync(irq); 111 disable_irq_nosync(irq);
123 irq_desc[irq].chip = &i8259A_irq_type; 112 set_irq_chip(irq, &i8259A_irq_type);
124 enable_irq(irq); 113 enable_irq(irq);
125} 114}
126 115
@@ -323,12 +312,8 @@ void __init init_i8259_irqs (void)
323 312
324 init_8259A(0); 313 init_8259A(0);
325 314
326 for (i = 0; i < 16; i++) { 315 for (i = 0; i < 16; i++)
327 irq_desc[i].status = IRQ_DISABLED; 316 set_irq_chip(i, &i8259A_irq_type);
328 irq_desc[i].action = NULL;
329 irq_desc[i].depth = 1;
330 irq_desc[i].chip = &i8259A_irq_type;
331 }
332 317
333 setup_irq(2, &irq2); 318 setup_irq(2, &irq2);
334} 319}
diff --git a/arch/mips/kernel/irq-msc01.c b/arch/mips/kernel/irq-msc01.c
index 650a80ca374..bcaad669608 100644
--- a/arch/mips/kernel/irq-msc01.c
+++ b/arch/mips/kernel/irq-msc01.c
@@ -45,31 +45,6 @@ static inline void unmask_msc_irq(unsigned int irq)
45} 45}
46 46
47/* 47/*
48 * Enables the IRQ on SOC-it
49 */
50static void enable_msc_irq(unsigned int irq)
51{
52 unmask_msc_irq(irq);
53}
54
55/*
56 * Initialize the IRQ on SOC-it
57 */
58static unsigned int startup_msc_irq(unsigned int irq)
59{
60 unmask_msc_irq(irq);
61 return 0;
62}
63
64/*
65 * Disables the IRQ on SOC-it
66 */
67static void disable_msc_irq(unsigned int irq)
68{
69 mask_msc_irq(irq);
70}
71
72/*
73 * Masks and ACKs an IRQ 48 * Masks and ACKs an IRQ
74 */ 49 */
75static void level_mask_and_ack_msc_irq(unsigned int irq) 50static void level_mask_and_ack_msc_irq(unsigned int irq)
@@ -136,25 +111,23 @@ msc_bind_eic_interrupt (unsigned int irq, unsigned int set)
136 (irq<<MSC01_IC_RAMW_ADDR_SHF) | (set<<MSC01_IC_RAMW_DATA_SHF)); 111 (irq<<MSC01_IC_RAMW_ADDR_SHF) | (set<<MSC01_IC_RAMW_DATA_SHF));
137} 112}
138 113
139#define shutdown_msc_irq disable_msc_irq
140
141struct irq_chip msc_levelirq_type = { 114struct irq_chip msc_levelirq_type = {
142 .typename = "SOC-it-Level", 115 .typename = "SOC-it-Level",
143 .startup = startup_msc_irq,
144 .shutdown = shutdown_msc_irq,
145 .enable = enable_msc_irq,
146 .disable = disable_msc_irq,
147 .ack = level_mask_and_ack_msc_irq, 116 .ack = level_mask_and_ack_msc_irq,
117 .mask = mask_msc_irq,
118 .mask_ack = level_mask_and_ack_msc_irq,
119 .unmask = unmask_msc_irq,
120 .eoi = unmask_msc_irq,
148 .end = end_msc_irq, 121 .end = end_msc_irq,
149}; 122};
150 123
151struct irq_chip msc_edgeirq_type = { 124struct irq_chip msc_edgeirq_type = {
152 .typename = "SOC-it-Edge", 125 .typename = "SOC-it-Edge",
153 .startup =startup_msc_irq,
154 .shutdown = shutdown_msc_irq,
155 .enable = enable_msc_irq,
156 .disable = disable_msc_irq,
157 .ack = edge_mask_and_ack_msc_irq, 126 .ack = edge_mask_and_ack_msc_irq,
127 .mask = mask_msc_irq,
128 .mask_ack = edge_mask_and_ack_msc_irq,
129 .unmask = unmask_msc_irq,
130 .eoi = unmask_msc_irq,
158 .end = end_msc_irq, 131 .end = end_msc_irq,
159}; 132};
160 133
@@ -175,14 +148,14 @@ void __init init_msc_irqs(unsigned int base, msc_irqmap_t *imp, int nirq)
175 148
176 switch (imp->im_type) { 149 switch (imp->im_type) {
177 case MSC01_IRQ_EDGE: 150 case MSC01_IRQ_EDGE:
178 irq_desc[base+n].chip = &msc_edgeirq_type; 151 set_irq_chip(base+n, &msc_edgeirq_type);
179 if (cpu_has_veic) 152 if (cpu_has_veic)
180 MSCIC_WRITE(MSC01_IC_SUP+n*8, MSC01_IC_SUP_EDGE_BIT); 153 MSCIC_WRITE(MSC01_IC_SUP+n*8, MSC01_IC_SUP_EDGE_BIT);
181 else 154 else
182 MSCIC_WRITE(MSC01_IC_SUP+n*8, MSC01_IC_SUP_EDGE_BIT | imp->im_lvl); 155 MSCIC_WRITE(MSC01_IC_SUP+n*8, MSC01_IC_SUP_EDGE_BIT | imp->im_lvl);
183 break; 156 break;
184 case MSC01_IRQ_LEVEL: 157 case MSC01_IRQ_LEVEL:
185 irq_desc[base+n].chip = &msc_levelirq_type; 158 set_irq_chip(base+n, &msc_levelirq_type);
186 if (cpu_has_veic) 159 if (cpu_has_veic)
187 MSCIC_WRITE(MSC01_IC_SUP+n*8, 0); 160 MSCIC_WRITE(MSC01_IC_SUP+n*8, 0);
188 else 161 else
diff --git a/arch/mips/kernel/irq-mv6434x.c b/arch/mips/kernel/irq-mv6434x.c
index 37d106202b8..6cfb31cafde 100644
--- a/arch/mips/kernel/irq-mv6434x.c
+++ b/arch/mips/kernel/irq-mv6434x.c
@@ -67,39 +67,6 @@ static inline void unmask_mv64340_irq(unsigned int irq)
67} 67}
68 68
69/* 69/*
70 * Enables the IRQ on Marvell Chip
71 */
72static void enable_mv64340_irq(unsigned int irq)
73{
74 unmask_mv64340_irq(irq);
75}
76
77/*
78 * Initialize the IRQ on Marvell Chip
79 */
80static unsigned int startup_mv64340_irq(unsigned int irq)
81{
82 unmask_mv64340_irq(irq);
83 return 0;
84}
85
86/*
87 * Disables the IRQ on Marvell Chip
88 */
89static void disable_mv64340_irq(unsigned int irq)
90{
91 mask_mv64340_irq(irq);
92}
93
94/*
95 * Masks and ACKs an IRQ
96 */
97static void mask_and_ack_mv64340_irq(unsigned int irq)
98{
99 mask_mv64340_irq(irq);
100}
101
102/*
103 * End IRQ processing 70 * End IRQ processing
104 */ 71 */
105static void end_mv64340_irq(unsigned int irq) 72static void end_mv64340_irq(unsigned int irq)
@@ -133,15 +100,12 @@ void ll_mv64340_irq(void)
133 do_IRQ(ls1bit32(irq_src_high) + irq_base + 32); 100 do_IRQ(ls1bit32(irq_src_high) + irq_base + 32);
134} 101}
135 102
136#define shutdown_mv64340_irq disable_mv64340_irq
137
138struct irq_chip mv64340_irq_type = { 103struct irq_chip mv64340_irq_type = {
139 .typename = "MV-64340", 104 .typename = "MV-64340",
140 .startup = startup_mv64340_irq, 105 .ack = mask_mv64340_irq,
141 .shutdown = shutdown_mv64340_irq, 106 .mask = mask_mv64340_irq,
142 .enable = enable_mv64340_irq, 107 .mask_ack = mask_mv64340_irq,
143 .disable = disable_mv64340_irq, 108 .unmask = unmask_mv64340_irq,
144 .ack = mask_and_ack_mv64340_irq,
145 .end = end_mv64340_irq, 109 .end = end_mv64340_irq,
146}; 110};
147 111
@@ -149,13 +113,9 @@ void __init mv64340_irq_init(unsigned int base)
149{ 113{
150 int i; 114 int i;
151 115
152 /* Reset irq handlers pointers to NULL */ 116 for (i = base; i < base + 64; i++)
153 for (i = base; i < base + 64; i++) { 117 set_irq_chip_and_handler(i, &mv64340_irq_type,
154 irq_desc[i].status = IRQ_DISABLED; 118 handle_level_irq);
155 irq_desc[i].action = 0;
156 irq_desc[i].depth = 2;
157 irq_desc[i].chip = &mv64340_irq_type;
158 }
159 119
160 irq_base = base; 120 irq_base = base;
161} 121}
diff --git a/arch/mips/kernel/irq-rm7000.c b/arch/mips/kernel/irq-rm7000.c
index 6b54c7109e2..ddcc2a5f8a0 100644
--- a/arch/mips/kernel/irq-rm7000.c
+++ b/arch/mips/kernel/irq-rm7000.c
@@ -29,42 +29,6 @@ static inline void mask_rm7k_irq(unsigned int irq)
29 clear_c0_intcontrol(0x100 << (irq - irq_base)); 29 clear_c0_intcontrol(0x100 << (irq - irq_base));
30} 30}
31 31
32static inline void rm7k_cpu_irq_enable(unsigned int irq)
33{
34 unsigned long flags;
35
36 local_irq_save(flags);
37 unmask_rm7k_irq(irq);
38 local_irq_restore(flags);
39}
40
41static void rm7k_cpu_irq_disable(unsigned int irq)
42{
43 unsigned long flags;
44
45 local_irq_save(flags);
46 mask_rm7k_irq(irq);
47 local_irq_restore(flags);
48}
49
50static unsigned int rm7k_cpu_irq_startup(unsigned int irq)
51{
52 rm7k_cpu_irq_enable(irq);
53
54 return 0;
55}
56
57#define rm7k_cpu_irq_shutdown rm7k_cpu_irq_disable
58
59/*
60 * While we ack the interrupt interrupts are disabled and thus we don't need
61 * to deal with concurrency issues. Same for rm7k_cpu_irq_end.
62 */
63static void rm7k_cpu_irq_ack(unsigned int irq)
64{
65 mask_rm7k_irq(irq);
66}
67
68static void rm7k_cpu_irq_end(unsigned int irq) 32static void rm7k_cpu_irq_end(unsigned int irq)
69{ 33{
70 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 34 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
@@ -73,11 +37,10 @@ static void rm7k_cpu_irq_end(unsigned int irq)
73 37
74static struct irq_chip rm7k_irq_controller = { 38static struct irq_chip rm7k_irq_controller = {
75 .typename = "RM7000", 39 .typename = "RM7000",
76 .startup = rm7k_cpu_irq_startup, 40 .ack = mask_rm7k_irq,
77 .shutdown = rm7k_cpu_irq_shutdown, 41 .mask = mask_rm7k_irq,
78 .enable = rm7k_cpu_irq_enable, 42 .mask_ack = mask_rm7k_irq,
79 .disable = rm7k_cpu_irq_disable, 43 .unmask = unmask_rm7k_irq,
80 .ack = rm7k_cpu_irq_ack,
81 .end = rm7k_cpu_irq_end, 44 .end = rm7k_cpu_irq_end,
82}; 45};
83 46
@@ -87,12 +50,9 @@ void __init rm7k_cpu_irq_init(int base)
87 50
88 clear_c0_intcontrol(0x00000f00); /* Mask all */ 51 clear_c0_intcontrol(0x00000f00); /* Mask all */
89 52
90 for (i = base; i < base + 4; i++) { 53 for (i = base; i < base + 4; i++)
91 irq_desc[i].status = IRQ_DISABLED; 54 set_irq_chip_and_handler(i, &rm7k_irq_controller,
92 irq_desc[i].action = NULL; 55 handle_level_irq);
93 irq_desc[i].depth = 1;
94 irq_desc[i].chip = &rm7k_irq_controller;
95 }
96 56
97 irq_base = base; 57 irq_base = base;
98} 58}
diff --git a/arch/mips/kernel/irq-rm9000.c b/arch/mips/kernel/irq-rm9000.c
index 62f011ba97a..ba6440c88ab 100644
--- a/arch/mips/kernel/irq-rm9000.c
+++ b/arch/mips/kernel/irq-rm9000.c
@@ -48,15 +48,6 @@ static void rm9k_cpu_irq_disable(unsigned int irq)
48 local_irq_restore(flags); 48 local_irq_restore(flags);
49} 49}
50 50
51static unsigned int rm9k_cpu_irq_startup(unsigned int irq)
52{
53 rm9k_cpu_irq_enable(irq);
54
55 return 0;
56}
57
58#define rm9k_cpu_irq_shutdown rm9k_cpu_irq_disable
59
60/* 51/*
61 * Performance counter interrupts are global on all processors. 52 * Performance counter interrupts are global on all processors.
62 */ 53 */
@@ -89,16 +80,6 @@ static void rm9k_perfcounter_irq_shutdown(unsigned int irq)
89 on_each_cpu(local_rm9k_perfcounter_irq_shutdown, (void *) irq, 0, 1); 80 on_each_cpu(local_rm9k_perfcounter_irq_shutdown, (void *) irq, 0, 1);
90} 81}
91 82
92
93/*
94 * While we ack the interrupt interrupts are disabled and thus we don't need
95 * to deal with concurrency issues. Same for rm9k_cpu_irq_end.
96 */
97static void rm9k_cpu_irq_ack(unsigned int irq)
98{
99 mask_rm9k_irq(irq);
100}
101
102static void rm9k_cpu_irq_end(unsigned int irq) 83static void rm9k_cpu_irq_end(unsigned int irq)
103{ 84{
104 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 85 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
@@ -107,11 +88,10 @@ static void rm9k_cpu_irq_end(unsigned int irq)
107 88
108static struct irq_chip rm9k_irq_controller = { 89static struct irq_chip rm9k_irq_controller = {
109 .typename = "RM9000", 90 .typename = "RM9000",
110 .startup = rm9k_cpu_irq_startup, 91 .ack = mask_rm9k_irq,
111 .shutdown = rm9k_cpu_irq_shutdown, 92 .mask = mask_rm9k_irq,
112 .enable = rm9k_cpu_irq_enable, 93 .mask_ack = mask_rm9k_irq,
113 .disable = rm9k_cpu_irq_disable, 94 .unmask = unmask_rm9k_irq,
114 .ack = rm9k_cpu_irq_ack,
115 .end = rm9k_cpu_irq_end, 95 .end = rm9k_cpu_irq_end,
116}; 96};
117 97
@@ -119,9 +99,10 @@ static struct irq_chip rm9k_perfcounter_irq = {
119 .typename = "RM9000", 99 .typename = "RM9000",
120 .startup = rm9k_perfcounter_irq_startup, 100 .startup = rm9k_perfcounter_irq_startup,
121 .shutdown = rm9k_perfcounter_irq_shutdown, 101 .shutdown = rm9k_perfcounter_irq_shutdown,
122 .enable = rm9k_cpu_irq_enable, 102 .ack = mask_rm9k_irq,
123 .disable = rm9k_cpu_irq_disable, 103 .mask = mask_rm9k_irq,
124 .ack = rm9k_cpu_irq_ack, 104 .mask_ack = mask_rm9k_irq,
105 .unmask = unmask_rm9k_irq,
125 .end = rm9k_cpu_irq_end, 106 .end = rm9k_cpu_irq_end,
126}; 107};
127 108
@@ -135,15 +116,13 @@ void __init rm9k_cpu_irq_init(int base)
135 116
136 clear_c0_intcontrol(0x0000f000); /* Mask all */ 117 clear_c0_intcontrol(0x0000f000); /* Mask all */
137 118
138 for (i = base; i < base + 4; i++) { 119 for (i = base; i < base + 4; i++)
139 irq_desc[i].status = IRQ_DISABLED; 120 set_irq_chip_and_handler(i, &rm9k_irq_controller,
140 irq_desc[i].action = NULL; 121 handle_level_irq);
141 irq_desc[i].depth = 1;
142 irq_desc[i].chip = &rm9k_irq_controller;
143 }
144 122
145 rm9000_perfcount_irq = base + 1; 123 rm9000_perfcount_irq = base + 1;
146 irq_desc[rm9000_perfcount_irq].chip = &rm9k_perfcounter_irq; 124 set_irq_chip_and_handler(rm9000_perfcount_irq, &rm9k_perfcounter_irq,
125 handle_level_irq);
147 126
148 irq_base = base; 127 irq_base = base;
149} 128}
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index dd24434392b..b339798b317 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -26,6 +26,48 @@
26#include <asm/system.h> 26#include <asm/system.h>
27#include <asm/uaccess.h> 27#include <asm/uaccess.h>
28 28
29static unsigned long irq_map[NR_IRQS / BITS_PER_LONG];
30
31int __devinit allocate_irqno(void)
32{
33 int irq;
34
35again:
36 irq = find_first_zero_bit(irq_map, NR_IRQS);
37
38 if (irq >= NR_IRQS)
39 return -ENOSPC;
40
41 if (test_and_set_bit(irq, irq_map))
42 goto again;
43
44 return irq;
45}
46
47EXPORT_SYMBOL_GPL(allocate_irqno);
48
49/*
50 * Allocate the 16 legacy interrupts for i8259 devices. This happens early
51 * in the kernel initialization so treating allocation failure as BUG() is
52 * ok.
53 */
54void __init alloc_legacy_irqno(void)
55{
56 int i;
57
58 for (i = 0; i <= 16; i++)
59 BUG_ON(test_and_set_bit(i, irq_map));
60}
61
62void __devinit free_irqno(unsigned int irq)
63{
64 smp_mb__before_clear_bit();
65 clear_bit(irq, irq_map);
66 smp_mb__after_clear_bit();
67}
68
69EXPORT_SYMBOL_GPL(free_irqno);
70
29/* 71/*
30 * 'what should we do if we get a hw irq event on an illegal vector'. 72 * 'what should we do if we get a hw irq event on an illegal vector'.
31 * each architecture has to answer this themselves. 73 * each architecture has to answer this themselves.
@@ -46,25 +88,6 @@ atomic_t irq_err_count;
46unsigned long irq_hwmask[NR_IRQS]; 88unsigned long irq_hwmask[NR_IRQS];
47#endif /* CONFIG_MIPS_MT_SMTC */ 89#endif /* CONFIG_MIPS_MT_SMTC */
48 90
49#undef do_IRQ
50
51/*
52 * do_IRQ handles all normal device IRQ's (the special
53 * SMP cross-CPU interrupts have their own specific
54 * handlers).
55 */
56asmlinkage unsigned int do_IRQ(unsigned int irq)
57{
58 irq_enter();
59
60 __DO_IRQ_SMTC_HOOK();
61 __do_IRQ(irq);
62
63 irq_exit();
64
65 return 1;
66}
67
68/* 91/*
69 * Generic, controller-independent functions: 92 * Generic, controller-independent functions:
70 */ 93 */
@@ -130,19 +153,6 @@ __setup("nokgdb", nokgdb);
130 153
131void __init init_IRQ(void) 154void __init init_IRQ(void)
132{ 155{
133 int i;
134
135 for (i = 0; i < NR_IRQS; i++) {
136 irq_desc[i].status = IRQ_DISABLED;
137 irq_desc[i].action = NULL;
138 irq_desc[i].depth = 1;
139 irq_desc[i].chip = &no_irq_chip;
140 spin_lock_init(&irq_desc[i].lock);
141#ifdef CONFIG_MIPS_MT_SMTC
142 irq_hwmask[i] = 0;
143#endif /* CONFIG_MIPS_MT_SMTC */
144 }
145
146 arch_init_irq(); 156 arch_init_irq();
147 157
148#ifdef CONFIG_KGDB 158#ifdef CONFIG_KGDB
diff --git a/arch/mips/kernel/irq_cpu.c b/arch/mips/kernel/irq_cpu.c
index 9bb21c7f214..be5ac23d381 100644
--- a/arch/mips/kernel/irq_cpu.c
+++ b/arch/mips/kernel/irq_cpu.c
@@ -50,44 +50,6 @@ static inline void mask_mips_irq(unsigned int irq)
50 irq_disable_hazard(); 50 irq_disable_hazard();
51} 51}
52 52
53static inline void mips_cpu_irq_enable(unsigned int irq)
54{
55 unsigned long flags;
56
57 local_irq_save(flags);
58 unmask_mips_irq(irq);
59 back_to_back_c0_hazard();
60 local_irq_restore(flags);
61}
62
63static void mips_cpu_irq_disable(unsigned int irq)
64{
65 unsigned long flags;
66
67 local_irq_save(flags);
68 mask_mips_irq(irq);
69 back_to_back_c0_hazard();
70 local_irq_restore(flags);
71}
72
73static unsigned int mips_cpu_irq_startup(unsigned int irq)
74{
75 mips_cpu_irq_enable(irq);
76
77 return 0;
78}
79
80#define mips_cpu_irq_shutdown mips_cpu_irq_disable
81
82/*
83 * While we ack the interrupt interrupts are disabled and thus we don't need
84 * to deal with concurrency issues. Same for mips_cpu_irq_end.
85 */
86static void mips_cpu_irq_ack(unsigned int irq)
87{
88 mask_mips_irq(irq);
89}
90
91static void mips_cpu_irq_end(unsigned int irq) 53static void mips_cpu_irq_end(unsigned int irq)
92{ 54{
93 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 55 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
@@ -96,11 +58,11 @@ static void mips_cpu_irq_end(unsigned int irq)
96 58
97static struct irq_chip mips_cpu_irq_controller = { 59static struct irq_chip mips_cpu_irq_controller = {
98 .typename = "MIPS", 60 .typename = "MIPS",
99 .startup = mips_cpu_irq_startup, 61 .ack = mask_mips_irq,
100 .shutdown = mips_cpu_irq_shutdown, 62 .mask = mask_mips_irq,
101 .enable = mips_cpu_irq_enable, 63 .mask_ack = mask_mips_irq,
102 .disable = mips_cpu_irq_disable, 64 .unmask = unmask_mips_irq,
103 .ack = mips_cpu_irq_ack, 65 .eoi = unmask_mips_irq,
104 .end = mips_cpu_irq_end, 66 .end = mips_cpu_irq_end,
105}; 67};
106 68
@@ -110,8 +72,6 @@ static struct irq_chip mips_cpu_irq_controller = {
110 72
111#define unmask_mips_mt_irq unmask_mips_irq 73#define unmask_mips_mt_irq unmask_mips_irq
112#define mask_mips_mt_irq mask_mips_irq 74#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 75
116static unsigned int mips_mt_cpu_irq_startup(unsigned int irq) 76static unsigned int mips_mt_cpu_irq_startup(unsigned int irq)
117{ 77{
@@ -119,13 +79,11 @@ static unsigned int mips_mt_cpu_irq_startup(unsigned int irq)
119 79
120 clear_c0_cause(0x100 << (irq - mips_cpu_irq_base)); 80 clear_c0_cause(0x100 << (irq - mips_cpu_irq_base));
121 evpe(vpflags); 81 evpe(vpflags);
122 mips_mt_cpu_irq_enable(irq); 82 unmask_mips_mt_irq(irq);
123 83
124 return 0; 84 return 0;
125} 85}
126 86
127#define mips_mt_cpu_irq_shutdown mips_mt_cpu_irq_disable
128
129/* 87/*
130 * While we ack the interrupt interrupts are disabled and thus we don't need 88 * 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. 89 * to deal with concurrency issues. Same for mips_cpu_irq_end.
@@ -143,10 +101,11 @@ static void mips_mt_cpu_irq_ack(unsigned int irq)
143static struct irq_chip mips_mt_cpu_irq_controller = { 101static struct irq_chip mips_mt_cpu_irq_controller = {
144 .typename = "MIPS", 102 .typename = "MIPS",
145 .startup = mips_mt_cpu_irq_startup, 103 .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, 104 .ack = mips_mt_cpu_irq_ack,
105 .mask = mask_mips_mt_irq,
106 .mask_ack = mips_mt_cpu_irq_ack,
107 .unmask = unmask_mips_mt_irq,
108 .eoi = unmask_mips_mt_irq,
150 .end = mips_mt_cpu_irq_end, 109 .end = mips_mt_cpu_irq_end,
151}; 110};
152 111
@@ -163,19 +122,12 @@ void __init mips_cpu_irq_init(int irq_base)
163 * leave them uninitialized for other processors. 122 * leave them uninitialized for other processors.
164 */ 123 */
165 if (cpu_has_mipsmt) 124 if (cpu_has_mipsmt)
166 for (i = irq_base; i < irq_base + 2; i++) { 125 for (i = irq_base; i < irq_base + 2; i++)
167 irq_desc[i].status = IRQ_DISABLED; 126 set_irq_chip(i, &mips_mt_cpu_irq_controller);
168 irq_desc[i].action = NULL; 127
169 irq_desc[i].depth = 1; 128 for (i = irq_base + 2; i < irq_base + 8; i++)
170 irq_desc[i].chip = &mips_mt_cpu_irq_controller; 129 set_irq_chip_and_handler(i, &mips_cpu_irq_controller,
171 } 130 handle_level_irq);
172
173 for (i = irq_base + 2; i < irq_base + 8; i++) {
174 irq_desc[i].status = IRQ_DISABLED;
175 irq_desc[i].action = NULL;
176 irq_desc[i].depth = 1;
177 irq_desc[i].chip = &mips_cpu_irq_controller;
178 }
179 131
180 mips_cpu_irq_base = irq_base; 132 mips_cpu_irq_base = irq_base;
181} 133}
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 53f4171fc18..7a3ebbeba1f 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -1055,7 +1055,9 @@ asmlinkage long sys32_newuname(struct new_utsname __user * name)
1055asmlinkage int sys32_personality(unsigned long personality) 1055asmlinkage int sys32_personality(unsigned long personality)
1056{ 1056{
1057 int ret; 1057 int ret;
1058 if (current->personality == PER_LINUX32 && personality == PER_LINUX) 1058 personality &= 0xffffffff;
1059 if (personality(current->personality) == PER_LINUX32 &&
1060 personality == PER_LINUX)
1059 personality = PER_LINUX32; 1061 personality = PER_LINUX32;
1060 ret = sys_personality(personality); 1062 ret = sys_personality(personality);
1061 if (ret == PER_LINUX32) 1063 if (ret == PER_LINUX32)
diff --git a/arch/mips/kernel/machine_kexec.c b/arch/mips/kernel/machine_kexec.c
new file mode 100644
index 00000000000..e0ad754c7ed
--- /dev/null
+++ b/arch/mips/kernel/machine_kexec.c
@@ -0,0 +1,85 @@
1/*
2 * machine_kexec.c for kexec
3 * Created by <nschichan@corp.free.fr> on Thu Oct 12 15:15:06 2006
4 *
5 * This source code is licensed under the GNU General Public License,
6 * Version 2. See the file COPYING for more details.
7 */
8
9#include <linux/kexec.h>
10#include <linux/mm.h>
11#include <linux/delay.h>
12
13#include <asm/cacheflush.h>
14#include <asm/page.h>
15
16const extern unsigned char relocate_new_kernel[];
17const extern unsigned int relocate_new_kernel_size;
18
19extern unsigned long kexec_start_address;
20extern unsigned long kexec_indirection_page;
21
22int
23machine_kexec_prepare(struct kimage *kimage)
24{
25 return 0;
26}
27
28void
29machine_kexec_cleanup(struct kimage *kimage)
30{
31}
32
33void
34machine_shutdown(void)
35{
36}
37
38void
39machine_crash_shutdown(struct pt_regs *regs)
40{
41}
42
43void
44machine_kexec(struct kimage *image)
45{
46 unsigned long reboot_code_buffer;
47 unsigned long entry;
48 unsigned long *ptr;
49
50 reboot_code_buffer =
51 (unsigned long)page_address(image->control_code_page);
52
53 kexec_start_address = image->start;
54 kexec_indirection_page = phys_to_virt(image->head & PAGE_MASK);
55
56 memcpy((void*)reboot_code_buffer, relocate_new_kernel,
57 relocate_new_kernel_size);
58
59 /*
60 * The generic kexec code builds a page list with physical
61 * addresses. they are directly accessible through KSEG0 (or
62 * CKSEG0 or XPHYS if on 64bit system), hence the
63 * pys_to_virt() call.
64 */
65 for (ptr = &image->head; (entry = *ptr) && !(entry &IND_DONE);
66 ptr = (entry & IND_INDIRECTION) ?
67 phys_to_virt(entry & PAGE_MASK) : ptr + 1) {
68 if (*ptr & IND_SOURCE || *ptr & IND_INDIRECTION ||
69 *ptr & IND_DESTINATION)
70 *ptr = phys_to_virt(*ptr);
71 }
72
73 /*
74 * we do not want to be bothered.
75 */
76 local_irq_disable();
77
78 flush_icache_range(reboot_code_buffer,
79 reboot_code_buffer + KEXEC_CONTROL_CODE_SIZE);
80
81 printk("Will call new kernel at %08x\n", image->start);
82 printk("Bye ...\n");
83 flush_cache_all();
84 ((void (*)(void))reboot_code_buffer)();
85}
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
index d7bf0215bc1..cb0801437b6 100644
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -29,6 +29,7 @@
29#include <linux/kernel.h> 29#include <linux/kernel.h>
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/spinlock.h> 31#include <linux/spinlock.h>
32#include <asm/pgtable.h> /* MODULE_START */
32 33
33struct mips_hi16 { 34struct mips_hi16 {
34 struct mips_hi16 *next; 35 struct mips_hi16 *next;
@@ -43,9 +44,23 @@ static DEFINE_SPINLOCK(dbe_lock);
43 44
44void *module_alloc(unsigned long size) 45void *module_alloc(unsigned long size)
45{ 46{
47#ifdef MODULE_START
48 struct vm_struct *area;
49
50 size = PAGE_ALIGN(size);
51 if (!size)
52 return NULL;
53
54 area = __get_vm_area(size, VM_ALLOC, MODULE_START, MODULE_END);
55 if (!area)
56 return NULL;
57
58 return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL);
59#else
46 if (size == 0) 60 if (size == 0)
47 return NULL; 61 return NULL;
48 return vmalloc(size); 62 return vmalloc(size);
63#endif
49} 64}
50 65
51/* Free memory returned from module_alloc */ 66/* Free memory returned from module_alloc */
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 9f307eb1a31..ec8209f3a0c 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -358,10 +358,8 @@ static int __init frame_info_init(void)
358 unsigned long size = 0; 358 unsigned long size = 0;
359#ifdef CONFIG_KALLSYMS 359#ifdef CONFIG_KALLSYMS
360 unsigned long ofs; 360 unsigned long ofs;
361 char *modname;
362 char namebuf[KSYM_NAME_LEN + 1];
363 361
364 kallsyms_lookup((unsigned long)schedule, &size, &ofs, &modname, namebuf); 362 kallsyms_lookup_size_offset((unsigned long)schedule, &size, &ofs);
365#endif 363#endif
366 schedule_mfi.func = schedule; 364 schedule_mfi.func = schedule;
367 schedule_mfi.func_size = size; 365 schedule_mfi.func_size = size;
@@ -403,8 +401,6 @@ unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
403{ 401{
404 unsigned long stack_page; 402 unsigned long stack_page;
405 struct mips_frame_info info; 403 struct mips_frame_info info;
406 char *modname;
407 char namebuf[KSYM_NAME_LEN + 1];
408 unsigned long size, ofs; 404 unsigned long size, ofs;
409 int leaf; 405 int leaf;
410 extern void ret_from_irq(void); 406 extern void ret_from_irq(void);
@@ -433,7 +429,7 @@ unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
433 } 429 }
434 return 0; 430 return 0;
435 } 431 }
436 if (!kallsyms_lookup(pc, &size, &ofs, &modname, namebuf)) 432 if (!kallsyms_lookup_size_offset(pc, &size, &ofs))
437 return 0; 433 return 0;
438 /* 434 /*
439 * Return ra if an exception occured at the first instruction 435 * Return ra if an exception occured at the first instruction
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index d5c8b82fed7..cc566cf1224 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -85,7 +85,12 @@
85 move $28, a2 85 move $28, a2
86 cpu_restore_nonscratch a1 86 cpu_restore_nonscratch a1
87 87
88#if (_THREAD_SIZE - 32) < 0x10000
88 PTR_ADDIU t0, $28, _THREAD_SIZE - 32 89 PTR_ADDIU t0, $28, _THREAD_SIZE - 32
90#else
91 PTR_LI t0, _THREAD_SIZE - 32
92 PTR_ADDU t0, $28
93#endif
89 set_saved_sp t0, t1, t2 94 set_saved_sp t0, t1, t2
90#ifdef CONFIG_MIPS_MT_SMTC 95#ifdef CONFIG_MIPS_MT_SMTC
91 /* Read-modify-writes of Status must be atomic on a VPE */ 96 /* Read-modify-writes of Status must be atomic on a VPE */
diff --git a/arch/mips/kernel/relocate_kernel.S b/arch/mips/kernel/relocate_kernel.S
new file mode 100644
index 00000000000..a3f0d00c133
--- /dev/null
+++ b/arch/mips/kernel/relocate_kernel.S
@@ -0,0 +1,80 @@
1/*
2 * relocate_kernel.S for kexec
3 * Created by <nschichan@corp.free.fr> on Thu Oct 12 17:49:57 2006
4 *
5 * This source code is licensed under the GNU General Public License,
6 * Version 2. See the file COPYING for more details.
7 */
8
9#include <asm/asm.h>
10#include <asm/asmmacro.h>
11#include <asm/regdef.h>
12#include <asm/page.h>
13#include <asm/mipsregs.h>
14#include <asm/stackframe.h>
15#include <asm/addrspace.h>
16
17 .globl relocate_new_kernel
18relocate_new_kernel:
19
20 PTR_L s0, kexec_indirection_page
21 PTR_L s1, kexec_start_address
22
23process_entry:
24 PTR_L s2, (s0)
25 PTR_ADD s0, s0, SZREG
26
27 /* destination page */
28 and s3, s2, 0x1
29 beq s3, zero, 1f
30 and s4, s2, ~0x1 /* store destination addr in s4 */
31 move a0, s4
32 b process_entry
33
341:
35 /* indirection page, update s0 */
36 and s3, s2, 0x2
37 beq s3, zero, 1f
38 and s0, s2, ~0x2
39 b process_entry
40
411:
42 /* done page */
43 and s3, s2, 0x4
44 beq s3, zero, 1f
45 b done
461:
47 /* source page */
48 and s3, s2, 0x8
49 beq s3, zero, process_entry
50 and s2, s2, ~0x8
51 li s6, (1 << PAGE_SHIFT) / SZREG
52
53copy_word:
54 /* copy page word by word */
55 REG_L s5, (s2)
56 REG_S s5, (s4)
57 INT_ADD s4, s4, SZREG
58 INT_ADD s2, s2, SZREG
59 INT_SUB s6, s6, 1
60 beq s6, zero, process_entry
61 b copy_word
62 b process_entry
63
64done:
65 /* jump to kexec_start_address */
66 j s1
67
68 .globl kexec_start_address
69kexec_start_address:
70 .long 0x0
71
72 .globl kexec_indirection_page
73kexec_indirection_page:
74 .long 0x0
75
76relocate_new_kernel_end:
77
78 .globl relocate_new_kernel_size
79relocate_new_kernel_size:
80 .long relocate_new_kernel_end - relocate_new_kernel
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 61362e6fa9e..7c0b3936ba4 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -652,7 +652,10 @@ einval: li v0, -EINVAL
652 sys sys_vmsplice 4 652 sys sys_vmsplice 4
653 sys sys_move_pages 6 653 sys sys_move_pages 6
654 sys sys_set_robust_list 2 654 sys sys_set_robust_list 2
655 sys sys_get_robust_list 3 655 sys sys_get_robust_list 3 /* 4310 */
656 sys sys_kexec_load 4
657 sys sys_getcpu 3
658 sys sys_epoll_pwait 6
656 .endm 659 .endm
657 660
658 /* We pre-compute the number of _instruction_ bytes needed to 661 /* 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 6c7b5ed0ea6..e569b846e9a 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -468,3 +468,6 @@ sys_call_table:
468 PTR sys_move_pages 468 PTR sys_move_pages
469 PTR sys_set_robust_list 469 PTR sys_set_robust_list
470 PTR sys_get_robust_list 470 PTR sys_get_robust_list
471 PTR sys_kexec_load /* 5270 */
472 PTR sys_getcpu
473 PTR sys_epoll_pwait
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 6d9f18727ac..5b18f265d75 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -280,7 +280,7 @@ EXPORT(sysn32_call_table)
280 PTR sys_sync 280 PTR sys_sync
281 PTR sys_acct 281 PTR sys_acct
282 PTR sys32_settimeofday 282 PTR sys32_settimeofday
283 PTR sys_mount /* 6160 */ 283 PTR compat_sys_mount /* 6160 */
284 PTR sys_umount 284 PTR sys_umount
285 PTR sys_swapon 285 PTR sys_swapon
286 PTR sys_swapoff 286 PTR sys_swapoff
@@ -394,3 +394,6 @@ EXPORT(sysn32_call_table)
394 PTR sys_move_pages 394 PTR sys_move_pages
395 PTR compat_sys_set_robust_list 395 PTR compat_sys_set_robust_list
396 PTR compat_sys_get_robust_list 396 PTR compat_sys_get_robust_list
397 PTR compat_sys_kexec_load
398 PTR sys_getcpu
399 PTR sys_epoll_pwait
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 2e6d0673163..e91379c1be1 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -226,7 +226,7 @@ sys_call_table:
226 PTR sys_ni_syscall /* was sys_stat */ 226 PTR sys_ni_syscall /* was sys_stat */
227 PTR sys_lseek 227 PTR sys_lseek
228 PTR sys_getpid /* 4020 */ 228 PTR sys_getpid /* 4020 */
229 PTR sys_mount 229 PTR compat_sys_mount
230 PTR sys_oldumount 230 PTR sys_oldumount
231 PTR sys_setuid 231 PTR sys_setuid
232 PTR sys_getuid 232 PTR sys_getuid
@@ -516,4 +516,7 @@ sys_call_table:
516 PTR compat_sys_move_pages 516 PTR compat_sys_move_pages
517 PTR compat_sys_set_robust_list 517 PTR compat_sys_set_robust_list
518 PTR compat_sys_get_robust_list /* 4310 */ 518 PTR compat_sys_get_robust_list /* 4310 */
519 PTR compat_sys_kexec_load
520 PTR sys_getcpu
521 PTR sys_epoll_pwait
519 .size sys_call_table,.-sys_call_table 522 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index fdbb508661c..89440a0d852 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -145,13 +145,12 @@ static int __init rd_start_early(char *p)
145 unsigned long start = memparse(p, &p); 145 unsigned long start = memparse(p, &p);
146 146
147#ifdef CONFIG_64BIT 147#ifdef CONFIG_64BIT
148 /* HACK: Guess if the sign extension was forgotten */ 148 /* Guess if the sign extension was forgotten by bootloader */
149 if (start > 0x0000000080000000 && start < 0x00000000ffffffff) 149 if (start < XKPHYS)
150 start |= 0xffffffff00000000UL; 150 start = (int)start;
151#endif 151#endif
152 initrd_start = start; 152 initrd_start = start;
153 initrd_end += start; 153 initrd_end += start;
154
155 return 0; 154 return 0;
156} 155}
157early_param("rd_start", rd_start_early); 156early_param("rd_start", rd_start_early);
@@ -159,41 +158,64 @@ early_param("rd_start", rd_start_early);
159static int __init rd_size_early(char *p) 158static int __init rd_size_early(char *p)
160{ 159{
161 initrd_end += memparse(p, &p); 160 initrd_end += memparse(p, &p);
162
163 return 0; 161 return 0;
164} 162}
165early_param("rd_size", rd_size_early); 163early_param("rd_size", rd_size_early);
166 164
165/* it returns the next free pfn after initrd */
167static unsigned long __init init_initrd(void) 166static unsigned long __init init_initrd(void)
168{ 167{
169 unsigned long tmp, end, size; 168 unsigned long end;
170 u32 *initrd_header; 169 u32 *initrd_header;
171 170
172 ROOT_DEV = Root_RAM0;
173
174 /* 171 /*
175 * Board specific code or command line parser should have 172 * Board specific code or command line parser should have
176 * already set up initrd_start and initrd_end. In these cases 173 * already set up initrd_start and initrd_end. In these cases
177 * perfom sanity checks and use them if all looks good. 174 * perfom sanity checks and use them if all looks good.
178 */ 175 */
179 size = initrd_end - initrd_start; 176 if (initrd_start && initrd_end > initrd_start)
180 if (initrd_end == 0 || size == 0) { 177 goto sanitize;
181 initrd_start = 0; 178
182 initrd_end = 0; 179 /*
183 } else 180 * See if initrd has been added to the kernel image by
184 return initrd_end; 181 * arch/mips/boot/addinitrd.c. In that case a header is
185 182 * prepended to initrd and is made up by 8 bytes. The fisrt
186 end = (unsigned long)&_end; 183 * word is a magic number and the second one is the size of
187 tmp = PAGE_ALIGN(end) - sizeof(u32) * 2; 184 * initrd. Initrd start must be page aligned in any cases.
188 if (tmp < end) 185 */
189 tmp += PAGE_SIZE; 186 initrd_header = __va(PAGE_ALIGN(__pa_symbol(&_end) + 8)) - 8;
190 187 if (initrd_header[0] != 0x494E5244)
191 initrd_header = (u32 *)tmp; 188 goto disable;
192 if (initrd_header[0] == 0x494E5244) { 189 initrd_start = (unsigned long)(initrd_header + 2);
193 initrd_start = (unsigned long)&initrd_header[2]; 190 initrd_end = initrd_start + initrd_header[1];
194 initrd_end = initrd_start + initrd_header[1]; 191
192sanitize:
193 if (initrd_start & ~PAGE_MASK) {
194 printk(KERN_ERR "initrd start must be page aligned\n");
195 goto disable;
195 } 196 }
196 return initrd_end; 197 if (initrd_start < PAGE_OFFSET) {
198 printk(KERN_ERR "initrd start < PAGE_OFFSET\n");
199 goto disable;
200 }
201
202 /*
203 * Sanitize initrd addresses. For example firmware
204 * can't guess if they need to pass them through
205 * 64-bits values if the kernel has been built in pure
206 * 32-bit. We need also to switch from KSEG0 to XKPHYS
207 * addresses now, so the code can now safely use __pa().
208 */
209 end = __pa(initrd_end);
210 initrd_end = (unsigned long)__va(end);
211 initrd_start = (unsigned long)__va(__pa(initrd_start));
212
213 ROOT_DEV = Root_RAM0;
214 return PFN_UP(end);
215disable:
216 initrd_start = 0;
217 initrd_end = 0;
218 return 0;
197} 219}
198 220
199static void __init finalize_initrd(void) 221static void __init finalize_initrd(void)
@@ -204,12 +226,12 @@ static void __init finalize_initrd(void)
204 printk(KERN_INFO "Initrd not found or empty"); 226 printk(KERN_INFO "Initrd not found or empty");
205 goto disable; 227 goto disable;
206 } 228 }
207 if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) { 229 if (__pa(initrd_end) > PFN_PHYS(max_low_pfn)) {
208 printk("Initrd extends beyond end of memory"); 230 printk("Initrd extends beyond end of memory");
209 goto disable; 231 goto disable;
210 } 232 }
211 233
212 reserve_bootmem(CPHYSADDR(initrd_start), size); 234 reserve_bootmem(__pa(initrd_start), size);
213 initrd_below_start_ok = 1; 235 initrd_below_start_ok = 1;
214 236
215 printk(KERN_INFO "Initial ramdisk at: 0x%lx (%lu bytes)\n", 237 printk(KERN_INFO "Initial ramdisk at: 0x%lx (%lu bytes)\n",
@@ -223,7 +245,11 @@ disable:
223 245
224#else /* !CONFIG_BLK_DEV_INITRD */ 246#else /* !CONFIG_BLK_DEV_INITRD */
225 247
226#define init_initrd() 0 248static unsigned long __init init_initrd(void)
249{
250 return 0;
251}
252
227#define finalize_initrd() do {} while (0) 253#define finalize_initrd() do {} while (0)
228 254
229#endif 255#endif
@@ -255,8 +281,7 @@ static void __init bootmem_init(void)
255 * not selected. Once that done we can determine the low bound 281 * not selected. Once that done we can determine the low bound
256 * of usable memory. 282 * of usable memory.
257 */ 283 */
258 reserved_end = init_initrd(); 284 reserved_end = max(init_initrd(), PFN_UP(__pa_symbol(&_end)));
259 reserved_end = PFN_UP(CPHYSADDR(max(reserved_end, (unsigned long)&_end)));
260 285
261 /* 286 /*
262 * Find the highest page frame number we have available. 287 * Find the highest page frame number we have available.
@@ -428,10 +453,10 @@ static void __init resource_init(void)
428 if (UNCAC_BASE != IO_BASE) 453 if (UNCAC_BASE != IO_BASE)
429 return; 454 return;
430 455
431 code_resource.start = virt_to_phys(&_text); 456 code_resource.start = __pa_symbol(&_text);
432 code_resource.end = virt_to_phys(&_etext) - 1; 457 code_resource.end = __pa_symbol(&_etext) - 1;
433 data_resource.start = virt_to_phys(&_etext); 458 data_resource.start = __pa_symbol(&_etext);
434 data_resource.end = virt_to_phys(&_edata) - 1; 459 data_resource.end = __pa_symbol(&_edata) - 1;
435 460
436 /* 461 /*
437 * Request address space for all standard RAM. 462 * Request address space for all standard RAM.
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index 477c5334ec1..a67c18555ed 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -17,7 +17,6 @@
17 */ 17 */
18#include <linux/cache.h> 18#include <linux/cache.h>
19#include <linux/sched.h> 19#include <linux/sched.h>
20#include <linux/sched.h>
21#include <linux/mm.h> 20#include <linux/mm.h>
22#include <linux/smp.h> 21#include <linux/smp.h>
23#include <linux/smp_lock.h> 22#include <linux/smp_lock.h>
diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c
index 3b5f3b63262..1ee689c0e0c 100644
--- a/arch/mips/kernel/smp-mt.c
+++ b/arch/mips/kernel/smp-mt.c
@@ -140,15 +140,90 @@ static struct irqaction irq_call = {
140 .name = "IPI_call" 140 .name = "IPI_call"
141}; 141};
142 142
143static void __init smp_copy_vpe_config(void)
144{
145 write_vpe_c0_status(
146 (read_c0_status() & ~(ST0_IM | ST0_IE | ST0_KSU)) | ST0_CU0);
147
148 /* set config to be the same as vpe0, particularly kseg0 coherency alg */
149 write_vpe_c0_config( read_c0_config());
150
151 /* make sure there are no software interrupts pending */
152 write_vpe_c0_cause(0);
153
154 /* Propagate Config7 */
155 write_vpe_c0_config7(read_c0_config7());
156
157 write_vpe_c0_count(read_c0_count());
158}
159
160static unsigned int __init smp_vpe_init(unsigned int tc, unsigned int mvpconf0,
161 unsigned int ncpu)
162{
163 if (tc > ((mvpconf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT))
164 return ncpu;
165
166 /* Deactivate all but VPE 0 */
167 if (tc != 0) {
168 unsigned long tmp = read_vpe_c0_vpeconf0();
169
170 tmp &= ~VPECONF0_VPA;
171
172 /* master VPE */
173 tmp |= VPECONF0_MVP;
174 write_vpe_c0_vpeconf0(tmp);
175
176 /* Record this as available CPU */
177 cpu_set(tc, phys_cpu_present_map);
178 __cpu_number_map[tc] = ++ncpu;
179 __cpu_logical_map[ncpu] = tc;
180 }
181
182 /* Disable multi-threading with TC's */
183 write_vpe_c0_vpecontrol(read_vpe_c0_vpecontrol() & ~VPECONTROL_TE);
184
185 if (tc != 0)
186 smp_copy_vpe_config();
187
188 return ncpu;
189}
190
191static void __init smp_tc_init(unsigned int tc, unsigned int mvpconf0)
192{
193 unsigned long tmp;
194
195 if (!tc)
196 return;
197
198 /* bind a TC to each VPE, May as well put all excess TC's
199 on the last VPE */
200 if (tc >= (((mvpconf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT)+1))
201 write_tc_c0_tcbind(read_tc_c0_tcbind() | ((mvpconf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT));
202 else {
203 write_tc_c0_tcbind(read_tc_c0_tcbind() | tc);
204
205 /* and set XTC */
206 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | (tc << VPECONF0_XTC_SHIFT));
207 }
208
209 tmp = read_tc_c0_tcstatus();
210
211 /* mark not allocated and not dynamically allocatable */
212 tmp &= ~(TCSTATUS_A | TCSTATUS_DA);
213 tmp |= TCSTATUS_IXMT; /* interrupt exempt */
214 write_tc_c0_tcstatus(tmp);
215
216 write_tc_c0_tchalt(TCHALT_H);
217}
218
143/* 219/*
144 * Common setup before any secondaries are started 220 * Common setup before any secondaries are started
145 * Make sure all CPU's are in a sensible state before we boot any of the 221 * Make sure all CPU's are in a sensible state before we boot any of the
146 * secondarys 222 * secondarys
147 */ 223 */
148void plat_smp_setup(void) 224void __init plat_smp_setup(void)
149{ 225{
150 unsigned long val; 226 unsigned int mvpconf0, ntc, tc, ncpu = 0;
151 int i, num;
152 227
153#ifdef CONFIG_MIPS_MT_FPAFF 228#ifdef CONFIG_MIPS_MT_FPAFF
154 /* If we have an FPU, enroll ourselves in the FPU-full mask */ 229 /* If we have an FPU, enroll ourselves in the FPU-full mask */
@@ -167,75 +242,16 @@ void plat_smp_setup(void)
167 /* Put MVPE's into 'configuration state' */ 242 /* Put MVPE's into 'configuration state' */
168 set_c0_mvpcontrol(MVPCONTROL_VPC); 243 set_c0_mvpcontrol(MVPCONTROL_VPC);
169 244
170 val = read_c0_mvpconf0(); 245 mvpconf0 = read_c0_mvpconf0();
246 ntc = (mvpconf0 & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT;
171 247
172 /* we'll always have more TC's than VPE's, so loop setting everything 248 /* we'll always have more TC's than VPE's, so loop setting everything
173 to a sensible state */ 249 to a sensible state */
174 for (i = 0, num = 0; i <= ((val & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT); i++) { 250 for (tc = 0; tc <= ntc; tc++) {
175 settc(i); 251 settc(tc);
176
177 /* VPE's */
178 if (i <= ((val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT)) {
179
180 /* deactivate all but vpe0 */
181 if (i != 0) {
182 unsigned long tmp = read_vpe_c0_vpeconf0();
183
184 tmp &= ~VPECONF0_VPA;
185
186 /* master VPE */
187 tmp |= VPECONF0_MVP;
188 write_vpe_c0_vpeconf0(tmp);
189
190 /* Record this as available CPU */
191 cpu_set(i, phys_cpu_present_map);
192 __cpu_number_map[i] = ++num;
193 __cpu_logical_map[num] = i;
194 }
195
196 /* disable multi-threading with TC's */
197 write_vpe_c0_vpecontrol(read_vpe_c0_vpecontrol() & ~VPECONTROL_TE);
198
199 if (i != 0) {
200 write_vpe_c0_status((read_c0_status() & ~(ST0_IM | ST0_IE | ST0_KSU)) | ST0_CU0);
201 252
202 /* set config to be the same as vpe0, particularly kseg0 coherency alg */ 253 smp_tc_init(tc, mvpconf0);
203 write_vpe_c0_config( read_c0_config()); 254 ncpu = smp_vpe_init(tc, mvpconf0, ncpu);
204
205 /* make sure there are no software interrupts pending */
206 write_vpe_c0_cause(0);
207
208 /* Propagate Config7 */
209 write_vpe_c0_config7(read_c0_config7());
210 }
211
212 }
213
214 /* TC's */
215
216 if (i != 0) {
217 unsigned long tmp;
218
219 /* bind a TC to each VPE, May as well put all excess TC's
220 on the last VPE */
221 if ( i >= (((val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT)+1) )
222 write_tc_c0_tcbind(read_tc_c0_tcbind() | ((val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT) );
223 else {
224 write_tc_c0_tcbind( read_tc_c0_tcbind() | i);
225
226 /* and set XTC */
227 write_vpe_c0_vpeconf0( read_vpe_c0_vpeconf0() | (i << VPECONF0_XTC_SHIFT));
228 }
229
230 tmp = read_tc_c0_tcstatus();
231
232 /* mark not allocated and not dynamically allocatable */
233 tmp &= ~(TCSTATUS_A | TCSTATUS_DA);
234 tmp |= TCSTATUS_IXMT; /* interrupt exempt */
235 write_tc_c0_tcstatus(tmp);
236
237 write_tc_c0_tchalt(TCHALT_H);
238 }
239 } 255 }
240 256
241 /* Release config state */ 257 /* Release config state */
@@ -243,7 +259,7 @@ void plat_smp_setup(void)
243 259
244 /* We'll wait until starting the secondaries before starting MVPE */ 260 /* We'll wait until starting the secondaries before starting MVPE */
245 261
246 printk(KERN_INFO "Detected %i available secondary CPU(s)\n", num); 262 printk(KERN_INFO "Detected %i available secondary CPU(s)\n", ncpu);
247} 263}
248 264
249void __init plat_prepare_cpus(unsigned int max_cpus) 265void __init plat_prepare_cpus(unsigned int max_cpus)
@@ -262,7 +278,9 @@ void __init plat_prepare_cpus(unsigned int max_cpus)
262 278
263 /* need to mark IPI's as IRQ_PER_CPU */ 279 /* need to mark IPI's as IRQ_PER_CPU */
264 irq_desc[cpu_ipi_resched_irq].status |= IRQ_PER_CPU; 280 irq_desc[cpu_ipi_resched_irq].status |= IRQ_PER_CPU;
281 set_irq_handler(cpu_ipi_resched_irq, handle_percpu_irq);
265 irq_desc[cpu_ipi_call_irq].status |= IRQ_PER_CPU; 282 irq_desc[cpu_ipi_call_irq].status |= IRQ_PER_CPU;
283 set_irq_handler(cpu_ipi_call_irq, handle_percpu_irq);
266} 284}
267 285
268/* 286/*
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index db80957ada8..49db516789e 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -463,28 +463,5 @@ void flush_tlb_one(unsigned long vaddr)
463 smp_on_each_tlb(flush_tlb_one_ipi, (void *) vaddr); 463 smp_on_each_tlb(flush_tlb_one_ipi, (void *) vaddr);
464} 464}
465 465
466static DEFINE_PER_CPU(struct cpu, cpu_devices);
467
468static int __init topology_init(void)
469{
470 int i, ret;
471
472#ifdef CONFIG_NUMA
473 for_each_online_node(i)
474 register_one_node(i);
475#endif /* CONFIG_NUMA */
476
477 for_each_present_cpu(i) {
478 ret = register_cpu(&per_cpu(cpu_devices, i), i);
479 if (ret)
480 printk(KERN_WARNING "topology_init: register_cpu %d "
481 "failed (%d)\n", i, ret);
482 }
483
484 return 0;
485}
486
487subsys_initcall(topology_init);
488
489EXPORT_SYMBOL(flush_tlb_page); 466EXPORT_SYMBOL(flush_tlb_page);
490EXPORT_SYMBOL(flush_tlb_one); 467EXPORT_SYMBOL(flush_tlb_one);
diff --git a/arch/mips/kernel/smtc-asm.S b/arch/mips/kernel/smtc-asm.S
index 1cb9441f147..921207c4a83 100644
--- a/arch/mips/kernel/smtc-asm.S
+++ b/arch/mips/kernel/smtc-asm.S
@@ -101,7 +101,9 @@ FEXPORT(__smtc_ipi_vector)
101 lw t0,PT_PADSLOT5(sp) 101 lw t0,PT_PADSLOT5(sp)
102 /* Argument from sender passed in stack pad slot 4 */ 102 /* Argument from sender passed in stack pad slot 4 */
103 lw a0,PT_PADSLOT4(sp) 103 lw a0,PT_PADSLOT4(sp)
104 PTR_LA ra, _ret_from_irq 104 LONG_L s0, TI_REGS($28)
105 LONG_S sp, TI_REGS($28)
106 PTR_LA ra, ret_from_irq
105 jr t0 107 jr t0
106 108
107/* 109/*
@@ -119,7 +121,10 @@ LEAF(self_ipi)
119 subu t1,sp,PT_SIZE 121 subu t1,sp,PT_SIZE
120 sw ra,PT_EPC(t1) 122 sw ra,PT_EPC(t1)
121 sw a0,PT_PADSLOT4(t1) 123 sw a0,PT_PADSLOT4(t1)
124 LONG_L s0, TI_REGS($28)
125 LONG_S sp, TI_REGS($28)
122 la t2,ipi_decode 126 la t2,ipi_decode
127 LONG_S s0, TI_REGS($28)
123 sw t2,PT_PADSLOT5(t1) 128 sw t2,PT_PADSLOT5(t1)
124 /* Save pre-disable value of TCStatus */ 129 /* Save pre-disable value of TCStatus */
125 sw t0,PT_TCSTATUS(t1) 130 sw t0,PT_TCSTATUS(t1)
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index cc1f7474f7d..802febed7df 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -476,6 +476,7 @@ void mipsmt_prepare_cpus(void)
476 write_vpe_c0_compare(0); 476 write_vpe_c0_compare(0);
477 /* Propagate Config7 */ 477 /* Propagate Config7 */
478 write_vpe_c0_config7(read_c0_config7()); 478 write_vpe_c0_config7(read_c0_config7());
479 write_vpe_c0_count(read_c0_count());
479 } 480 }
480 /* enable multi-threading within VPE */ 481 /* enable multi-threading within VPE */
481 write_vpe_c0_vpecontrol(read_vpe_c0_vpecontrol() | VPECONTROL_TE); 482 write_vpe_c0_vpecontrol(read_vpe_c0_vpecontrol() | VPECONTROL_TE);
@@ -1008,6 +1009,7 @@ void setup_cross_vpe_interrupts(void)
1008 setup_irq_smtc(cpu_ipi_irq, &irq_ipi, (0x100 << MIPS_CPU_IPI_IRQ)); 1009 setup_irq_smtc(cpu_ipi_irq, &irq_ipi, (0x100 << MIPS_CPU_IPI_IRQ));
1009 1010
1010 irq_desc[cpu_ipi_irq].status |= IRQ_PER_CPU; 1011 irq_desc[cpu_ipi_irq].status |= IRQ_PER_CPU;
1012 set_irq_handler(cpu_ipi_irq, handle_percpu_irq);
1011} 1013}
1012 1014
1013/* 1015/*
diff --git a/arch/mips/kernel/stacktrace.c b/arch/mips/kernel/stacktrace.c
index 4aabe526a68..a586aba337a 100644
--- a/arch/mips/kernel/stacktrace.c
+++ b/arch/mips/kernel/stacktrace.c
@@ -57,7 +57,7 @@ static void save_context_stack(struct stack_trace *trace,
57 pc = unwind_stack(task, &sp, pc, &ra); 57 pc = unwind_stack(task, &sp, pc, &ra);
58 } while (pc); 58 } while (pc);
59#else 59#else
60 save_raw_context_stack(sp); 60 save_raw_context_stack(trace, sp);
61#endif 61#endif
62} 62}
63 63
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index debe86c2f69..11aab6d6bfe 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -67,15 +67,9 @@ int (*rtc_mips_set_time)(unsigned long) = null_rtc_set_time;
67int (*rtc_mips_set_mmss)(unsigned long); 67int (*rtc_mips_set_mmss)(unsigned long);
68 68
69 69
70/* usecs per counter cycle, shifted to left by 32 bits */
71static unsigned int sll32_usecs_per_cycle;
72
73/* how many counter cycles in a jiffy */ 70/* how many counter cycles in a jiffy */
74static unsigned long cycles_per_jiffy __read_mostly; 71static unsigned long cycles_per_jiffy __read_mostly;
75 72
76/* Cycle counter value at the previous timer interrupt.. */
77static unsigned int timerhi, timerlo;
78
79/* expirelo is the count value for next CPU timer interrupt */ 73/* expirelo is the count value for next CPU timer interrupt */
80static unsigned int expirelo; 74static unsigned int expirelo;
81 75
@@ -88,17 +82,11 @@ static void null_timer_ack(void) { /* nothing */ }
88/* 82/*
89 * Null high precision timer functions for systems lacking one. 83 * Null high precision timer functions for systems lacking one.
90 */ 84 */
91static unsigned int null_hpt_read(void) 85static cycle_t null_hpt_read(void)
92{ 86{
93 return 0; 87 return 0;
94} 88}
95 89
96static void null_hpt_init(unsigned int count)
97{
98 /* nothing */
99}
100
101
102/* 90/*
103 * Timer ack for an R4k-compatible timer of a known frequency. 91 * Timer ack for an R4k-compatible timer of a known frequency.
104 */ 92 */
@@ -123,191 +111,20 @@ static void c0_timer_ack(void)
123/* 111/*
124 * High precision timer functions for a R4k-compatible timer. 112 * High precision timer functions for a R4k-compatible timer.
125 */ 113 */
126static unsigned int c0_hpt_read(void) 114static cycle_t c0_hpt_read(void)
127{ 115{
128 return read_c0_count(); 116 return read_c0_count();
129} 117}
130 118
131/* For use solely as a high precision timer. */
132static void c0_hpt_init(unsigned int count)
133{
134 write_c0_count(read_c0_count() - count);
135}
136
137/* For use both as a high precision timer and an interrupt source. */ 119/* For use both as a high precision timer and an interrupt source. */
138static void c0_hpt_timer_init(unsigned int count) 120static void __init c0_hpt_timer_init(void)
139{ 121{
140 count = read_c0_count() - count; 122 expirelo = read_c0_count() + cycles_per_jiffy;
141 expirelo = (count / cycles_per_jiffy + 1) * cycles_per_jiffy;
142 write_c0_count(expirelo - cycles_per_jiffy);
143 write_c0_compare(expirelo); 123 write_c0_compare(expirelo);
144 write_c0_count(count);
145} 124}
146 125
147int (*mips_timer_state)(void); 126int (*mips_timer_state)(void);
148void (*mips_timer_ack)(void); 127void (*mips_timer_ack)(void);
149unsigned int (*mips_hpt_read)(void);
150void (*mips_hpt_init)(unsigned int);
151
152/*
153 * Gettimeoffset routines. These routines returns the time duration
154 * since last timer interrupt in usecs.
155 *
156 * If the exact CPU counter frequency is known, use fixed_rate_gettimeoffset.
157 * Otherwise use calibrate_gettimeoffset()
158 *
159 * If the CPU does not have the counter register, you can either supply
160 * your own gettimeoffset() routine, or use null_gettimeoffset(), which
161 * gives the same resolution as HZ.
162 */
163
164static unsigned long null_gettimeoffset(void)
165{
166 return 0;
167}
168
169
170/* The function pointer to one of the gettimeoffset funcs. */
171unsigned long (*do_gettimeoffset)(void) = null_gettimeoffset;
172
173
174static unsigned long fixed_rate_gettimeoffset(void)
175{
176 u32 count;
177 unsigned long res;
178
179 /* Get last timer tick in absolute kernel time */
180 count = mips_hpt_read();
181
182 /* .. relative to previous jiffy (32 bits is enough) */
183 count -= timerlo;
184
185 __asm__("multu %1,%2"
186 : "=h" (res)
187 : "r" (count), "r" (sll32_usecs_per_cycle)
188 : "lo", GCC_REG_ACCUM);
189
190 /*
191 * Due to possible jiffies inconsistencies, we need to check
192 * the result so that we'll get a timer that is monotonic.
193 */
194 if (res >= USECS_PER_JIFFY)
195 res = USECS_PER_JIFFY - 1;
196
197 return res;
198}
199
200
201/*
202 * Cached "1/(clocks per usec) * 2^32" value.
203 * It has to be recalculated once each jiffy.
204 */
205static unsigned long cached_quotient;
206
207/* Last jiffy when calibrate_divXX_gettimeoffset() was called. */
208static unsigned long last_jiffies;
209
210/*
211 * This is moved from dec/time.c:do_ioasic_gettimeoffset() by Maciej.
212 */
213static unsigned long calibrate_div32_gettimeoffset(void)
214{
215 u32 count;
216 unsigned long res, tmp;
217 unsigned long quotient;
218
219 tmp = jiffies;
220
221 quotient = cached_quotient;
222
223 if (last_jiffies != tmp) {
224 last_jiffies = tmp;
225 if (last_jiffies != 0) {
226 unsigned long r0;
227 do_div64_32(r0, timerhi, timerlo, tmp);
228 do_div64_32(quotient, USECS_PER_JIFFY,
229 USECS_PER_JIFFY_FRAC, r0);
230 cached_quotient = quotient;
231 }
232 }
233
234 /* Get last timer tick in absolute kernel time */
235 count = mips_hpt_read();
236
237 /* .. relative to previous jiffy (32 bits is enough) */
238 count -= timerlo;
239
240 __asm__("multu %1,%2"
241 : "=h" (res)
242 : "r" (count), "r" (quotient)
243 : "lo", GCC_REG_ACCUM);
244
245 /*
246 * Due to possible jiffies inconsistencies, we need to check
247 * the result so that we'll get a timer that is monotonic.
248 */
249 if (res >= USECS_PER_JIFFY)
250 res = USECS_PER_JIFFY - 1;
251
252 return res;
253}
254
255static unsigned long calibrate_div64_gettimeoffset(void)
256{
257 u32 count;
258 unsigned long res, tmp;
259 unsigned long quotient;
260
261 tmp = jiffies;
262
263 quotient = cached_quotient;
264
265 if (last_jiffies != tmp) {
266 last_jiffies = tmp;
267 if (last_jiffies) {
268 unsigned long r0;
269 __asm__(".set push\n\t"
270 ".set mips3\n\t"
271 "lwu %0,%3\n\t"
272 "dsll32 %1,%2,0\n\t"
273 "or %1,%1,%0\n\t"
274 "ddivu $0,%1,%4\n\t"
275 "mflo %1\n\t"
276 "dsll32 %0,%5,0\n\t"
277 "or %0,%0,%6\n\t"
278 "ddivu $0,%0,%1\n\t"
279 "mflo %0\n\t"
280 ".set pop"
281 : "=&r" (quotient), "=&r" (r0)
282 : "r" (timerhi), "m" (timerlo),
283 "r" (tmp), "r" (USECS_PER_JIFFY),
284 "r" (USECS_PER_JIFFY_FRAC)
285 : "hi", "lo", GCC_REG_ACCUM);
286 cached_quotient = quotient;
287 }
288 }
289
290 /* Get last timer tick in absolute kernel time */
291 count = mips_hpt_read();
292
293 /* .. relative to previous jiffy (32 bits is enough) */
294 count -= timerlo;
295
296 __asm__("multu %1,%2"
297 : "=h" (res)
298 : "r" (count), "r" (quotient)
299 : "lo", GCC_REG_ACCUM);
300
301 /*
302 * Due to possible jiffies inconsistencies, we need to check
303 * the result so that we'll get a timer that is monotonic.
304 */
305 if (res >= USECS_PER_JIFFY)
306 res = USECS_PER_JIFFY - 1;
307
308 return res;
309}
310
311 128
312/* last time when xtime and rtc are sync'ed up */ 129/* last time when xtime and rtc are sync'ed up */
313static long last_rtc_update; 130static long last_rtc_update;
@@ -334,18 +151,10 @@ void local_timer_interrupt(int irq, void *dev_id)
334 */ 151 */
335irqreturn_t timer_interrupt(int irq, void *dev_id) 152irqreturn_t timer_interrupt(int irq, void *dev_id)
336{ 153{
337 unsigned long j;
338 unsigned int count;
339
340 write_seqlock(&xtime_lock); 154 write_seqlock(&xtime_lock);
341 155
342 count = mips_hpt_read();
343 mips_timer_ack(); 156 mips_timer_ack();
344 157
345 /* Update timerhi/timerlo for intra-jiffy calibration. */
346 timerhi += count < timerlo; /* Wrap around */
347 timerlo = count;
348
349 /* 158 /*
350 * call the generic timer interrupt handling 159 * call the generic timer interrupt handling
351 */ 160 */
@@ -368,47 +177,6 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
368 } 177 }
369 } 178 }
370 179
371 /*
372 * If jiffies has overflown in this timer_interrupt, we must
373 * update the timer[hi]/[lo] to make fast gettimeoffset funcs
374 * quotient calc still valid. -arca
375 *
376 * The first timer interrupt comes late as interrupts are
377 * enabled long after timers are initialized. Therefore the
378 * high precision timer is fast, leading to wrong gettimeoffset()
379 * calculations. We deal with it by setting it based on the
380 * number of its ticks between the second and the third interrupt.
381 * That is still somewhat imprecise, but it's a good estimate.
382 * --macro
383 */
384 j = jiffies;
385 if (j < 4) {
386 static unsigned int prev_count;
387 static int hpt_initialized;
388
389 switch (j) {
390 case 0:
391 timerhi = timerlo = 0;
392 mips_hpt_init(count);
393 break;
394 case 2:
395 prev_count = count;
396 break;
397 case 3:
398 if (!hpt_initialized) {
399 unsigned int c3 = 3 * (count - prev_count);
400
401 timerhi = 0;
402 timerlo = c3;
403 mips_hpt_init(count - c3);
404 hpt_initialized = 1;
405 }
406 break;
407 default:
408 break;
409 }
410 }
411
412 write_sequnlock(&xtime_lock); 180 write_sequnlock(&xtime_lock);
413 181
414 /* 182 /*
@@ -476,12 +244,11 @@ asmlinkage void ll_local_timer_interrupt(int irq)
476 * 1) board_time_init() - 244 * 1) board_time_init() -
477 * a) (optional) set up RTC routines, 245 * a) (optional) set up RTC routines,
478 * b) (optional) calibrate and set the mips_hpt_frequency 246 * b) (optional) calibrate and set the mips_hpt_frequency
479 * (only needed if you intended to use fixed_rate_gettimeoffset 247 * (only needed if you intended to use cpu counter as timer interrupt
480 * or use cpu counter as timer interrupt source) 248 * source)
481 * 2) setup xtime based on rtc_mips_get_time(). 249 * 2) setup xtime based on rtc_mips_get_time().
482 * 3) choose a appropriate gettimeoffset routine. 250 * 3) calculate a couple of cached variables for later usage
483 * 4) calculate a couple of cached variables for later usage 251 * 4) plat_timer_setup() -
484 * 5) plat_timer_setup() -
485 * a) (optional) over-write any choices made above by time_init(). 252 * a) (optional) over-write any choices made above by time_init().
486 * b) machine specific code should setup the timer irqaction. 253 * b) machine specific code should setup the timer irqaction.
487 * c) enable the timer interrupt 254 * c) enable the timer interrupt
@@ -499,8 +266,7 @@ static struct irqaction timer_irqaction = {
499 266
500static unsigned int __init calibrate_hpt(void) 267static unsigned int __init calibrate_hpt(void)
501{ 268{
502 u64 frequency; 269 cycle_t frequency, hpt_start, hpt_end, hpt_count, hz;
503 u32 hpt_start, hpt_end, hpt_count, hz;
504 270
505 const int loops = HZ / 10; 271 const int loops = HZ / 10;
506 int log_2_loops = 0; 272 int log_2_loops = 0;
@@ -526,20 +292,49 @@ static unsigned int __init calibrate_hpt(void)
526 * during the calculated number of periods between timer 292 * during the calculated number of periods between timer
527 * interrupts. 293 * interrupts.
528 */ 294 */
529 hpt_start = mips_hpt_read(); 295 hpt_start = clocksource_mips.read();
530 do { 296 do {
531 while (mips_timer_state()); 297 while (mips_timer_state());
532 while (!mips_timer_state()); 298 while (!mips_timer_state());
533 } while (--i); 299 } while (--i);
534 hpt_end = mips_hpt_read(); 300 hpt_end = clocksource_mips.read();
535 301
536 hpt_count = hpt_end - hpt_start; 302 hpt_count = (hpt_end - hpt_start) & clocksource_mips.mask;
537 hz = HZ; 303 hz = HZ;
538 frequency = (u64)hpt_count * (u64)hz; 304 frequency = hpt_count * hz;
539 305
540 return frequency >> log_2_loops; 306 return frequency >> log_2_loops;
541} 307}
542 308
309struct clocksource clocksource_mips = {
310 .name = "MIPS",
311 .mask = 0xffffffff,
312 .is_continuous = 1,
313};
314
315static void __init init_mips_clocksource(void)
316{
317 u64 temp;
318 u32 shift;
319
320 if (!mips_hpt_frequency || clocksource_mips.read == null_hpt_read)
321 return;
322
323 /* Calclate a somewhat reasonable rating value */
324 clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000;
325 /* Find a shift value */
326 for (shift = 32; shift > 0; shift--) {
327 temp = (u64) NSEC_PER_SEC << shift;
328 do_div(temp, mips_hpt_frequency);
329 if ((temp >> 32) == 0)
330 break;
331 }
332 clocksource_mips.shift = shift;
333 clocksource_mips.mult = (u32)temp;
334
335 clocksource_register(&clocksource_mips);
336}
337
543void __init time_init(void) 338void __init time_init(void)
544{ 339{
545 if (board_time_init) 340 if (board_time_init)
@@ -555,59 +350,36 @@ void __init time_init(void)
555 -xtime.tv_sec, -xtime.tv_nsec); 350 -xtime.tv_sec, -xtime.tv_nsec);
556 351
557 /* Choose appropriate high precision timer routines. */ 352 /* Choose appropriate high precision timer routines. */
558 if (!cpu_has_counter && !mips_hpt_read) { 353 if (!cpu_has_counter && !clocksource_mips.read)
559 /* No high precision timer -- sorry. */ 354 /* No high precision timer -- sorry. */
560 mips_hpt_read = null_hpt_read; 355 clocksource_mips.read = null_hpt_read;
561 mips_hpt_init = null_hpt_init; 356 else if (!mips_hpt_frequency && !mips_timer_state) {
562 } else if (!mips_hpt_frequency && !mips_timer_state) {
563 /* A high precision timer of unknown frequency. */ 357 /* A high precision timer of unknown frequency. */
564 if (!mips_hpt_read) { 358 if (!clocksource_mips.read)
565 /* No external high precision timer -- use R4k. */ 359 /* No external high precision timer -- use R4k. */
566 mips_hpt_read = c0_hpt_read; 360 clocksource_mips.read = c0_hpt_read;
567 mips_hpt_init = c0_hpt_init;
568 }
569
570 if (cpu_has_mips32r1 || cpu_has_mips32r2 ||
571 (current_cpu_data.isa_level == MIPS_CPU_ISA_I) ||
572 (current_cpu_data.isa_level == MIPS_CPU_ISA_II))
573 /*
574 * We need to calibrate the counter but we don't have
575 * 64-bit division.
576 */
577 do_gettimeoffset = calibrate_div32_gettimeoffset;
578 else
579 /*
580 * We need to calibrate the counter but we *do* have
581 * 64-bit division.
582 */
583 do_gettimeoffset = calibrate_div64_gettimeoffset;
584 } else { 361 } else {
585 /* We know counter frequency. Or we can get it. */ 362 /* We know counter frequency. Or we can get it. */
586 if (!mips_hpt_read) { 363 if (!clocksource_mips.read) {
587 /* No external high precision timer -- use R4k. */ 364 /* No external high precision timer -- use R4k. */
588 mips_hpt_read = c0_hpt_read; 365 clocksource_mips.read = c0_hpt_read;
589 366
590 if (mips_timer_state) 367 if (!mips_timer_state) {
591 mips_hpt_init = c0_hpt_init;
592 else {
593 /* No external timer interrupt -- use R4k. */ 368 /* No external timer interrupt -- use R4k. */
594 mips_hpt_init = c0_hpt_timer_init;
595 mips_timer_ack = c0_timer_ack; 369 mips_timer_ack = c0_timer_ack;
370 /* Calculate cache parameters. */
371 cycles_per_jiffy =
372 (mips_hpt_frequency + HZ / 2) / HZ;
373 /*
374 * This sets up the high precision
375 * timer for the first interrupt.
376 */
377 c0_hpt_timer_init();
596 } 378 }
597 } 379 }
598 if (!mips_hpt_frequency) 380 if (!mips_hpt_frequency)
599 mips_hpt_frequency = calibrate_hpt(); 381 mips_hpt_frequency = calibrate_hpt();
600 382
601 do_gettimeoffset = fixed_rate_gettimeoffset;
602
603 /* Calculate cache parameters. */
604 cycles_per_jiffy = (mips_hpt_frequency + HZ / 2) / HZ;
605
606 /* sll32_usecs_per_cycle = 10^6 * 2^32 / mips_counter_freq */
607 do_div64_32(sll32_usecs_per_cycle,
608 1000000, mips_hpt_frequency / 2,
609 mips_hpt_frequency);
610
611 /* Report the high precision timer rate for a reference. */ 383 /* Report the high precision timer rate for a reference. */
612 printk("Using %u.%03u MHz high precision timer.\n", 384 printk("Using %u.%03u MHz high precision timer.\n",
613 ((mips_hpt_frequency + 500) / 1000) / 1000, 385 ((mips_hpt_frequency + 500) / 1000) / 1000,
@@ -618,9 +390,6 @@ void __init time_init(void)
618 /* No timer interrupt ack (e.g. i8254). */ 390 /* No timer interrupt ack (e.g. i8254). */
619 mips_timer_ack = null_timer_ack; 391 mips_timer_ack = null_timer_ack;
620 392
621 /* This sets up the high precision timer for the first interrupt. */
622 mips_hpt_init(mips_hpt_read());
623
624 /* 393 /*
625 * Call board specific timer interrupt setup. 394 * Call board specific timer interrupt setup.
626 * 395 *
@@ -633,6 +402,8 @@ void __init time_init(void)
633 * is not invoked accidentally. 402 * is not invoked accidentally.
634 */ 403 */
635 plat_timer_setup(&timer_irqaction); 404 plat_timer_setup(&timer_irqaction);
405
406 init_mips_clocksource();
636} 407}
637 408
638#define FEBRUARY 2 409#define FEBRUARY 2
diff --git a/arch/mips/kernel/topology.c b/arch/mips/kernel/topology.c
new file mode 100644
index 00000000000..660e44ed44d
--- /dev/null
+++ b/arch/mips/kernel/topology.c
@@ -0,0 +1,29 @@
1#include <linux/cpu.h>
2#include <linux/cpumask.h>
3#include <linux/init.h>
4#include <linux/node.h>
5#include <linux/nodemask.h>
6#include <linux/percpu.h>
7
8static DEFINE_PER_CPU(struct cpu, cpu_devices);
9
10static int __init topology_init(void)
11{
12 int i, ret;
13
14#ifdef CONFIG_NUMA
15 for_each_online_node(i)
16 register_one_node(i);
17#endif /* CONFIG_NUMA */
18
19 for_each_present_cpu(i) {
20 ret = register_cpu(&per_cpu(cpu_devices, i), i);
21 if (ret)
22 printk(KERN_WARNING "topology_init: register_cpu %d "
23 "failed (%d)\n", i, ret);
24 }
25
26 return 0;
27}
28
29subsys_initcall(topology_init);
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index cce8313ec27..2a932cada24 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -54,6 +54,8 @@ extern asmlinkage void handle_dbe(void);
54extern asmlinkage void handle_sys(void); 54extern asmlinkage void handle_sys(void);
55extern asmlinkage void handle_bp(void); 55extern asmlinkage void handle_bp(void);
56extern asmlinkage void handle_ri(void); 56extern asmlinkage void handle_ri(void);
57extern asmlinkage void handle_ri_rdhwr_vivt(void);
58extern asmlinkage void handle_ri_rdhwr(void);
57extern asmlinkage void handle_cpu(void); 59extern asmlinkage void handle_cpu(void);
58extern asmlinkage void handle_ov(void); 60extern asmlinkage void handle_ov(void);
59extern asmlinkage void handle_tr(void); 61extern asmlinkage void handle_tr(void);
@@ -397,19 +399,6 @@ asmlinkage void do_be(struct pt_regs *regs)
397 force_sig(SIGBUS, current); 399 force_sig(SIGBUS, current);
398} 400}
399 401
400static inline int get_insn_opcode(struct pt_regs *regs, unsigned int *opcode)
401{
402 unsigned int __user *epc;
403
404 epc = (unsigned int __user *) regs->cp0_epc +
405 ((regs->cp0_cause & CAUSEF_BD) != 0);
406 if (!get_user(*opcode, epc))
407 return 0;
408
409 force_sig(SIGSEGV, current);
410 return 1;
411}
412
413/* 402/*
414 * ll/sc emulation 403 * ll/sc emulation
415 */ 404 */
@@ -544,8 +533,8 @@ static inline int simulate_llsc(struct pt_regs *regs)
544{ 533{
545 unsigned int opcode; 534 unsigned int opcode;
546 535
547 if (unlikely(get_insn_opcode(regs, &opcode))) 536 if (get_user(opcode, (unsigned int __user *) exception_epc(regs)))
548 return -EFAULT; 537 goto out_sigsegv;
549 538
550 if ((opcode & OPCODE) == LL) { 539 if ((opcode & OPCODE) == LL) {
551 simulate_ll(regs, opcode); 540 simulate_ll(regs, opcode);
@@ -557,6 +546,10 @@ static inline int simulate_llsc(struct pt_regs *regs)
557 } 546 }
558 547
559 return -EFAULT; /* Strange things going on ... */ 548 return -EFAULT; /* Strange things going on ... */
549
550out_sigsegv:
551 force_sig(SIGSEGV, current);
552 return -EFAULT;
560} 553}
561 554
562/* 555/*
@@ -569,8 +562,8 @@ static inline int simulate_rdhwr(struct pt_regs *regs)
569 struct thread_info *ti = task_thread_info(current); 562 struct thread_info *ti = task_thread_info(current);
570 unsigned int opcode; 563 unsigned int opcode;
571 564
572 if (unlikely(get_insn_opcode(regs, &opcode))) 565 if (get_user(opcode, (unsigned int __user *) exception_epc(regs)))
573 return -EFAULT; 566 goto out_sigsegv;
574 567
575 if (unlikely(compute_return_epc(regs))) 568 if (unlikely(compute_return_epc(regs)))
576 return -EFAULT; 569 return -EFAULT;
@@ -589,6 +582,10 @@ static inline int simulate_rdhwr(struct pt_regs *regs)
589 582
590 /* Not ours. */ 583 /* Not ours. */
591 return -EFAULT; 584 return -EFAULT;
585
586out_sigsegv:
587 force_sig(SIGSEGV, current);
588 return -EFAULT;
592} 589}
593 590
594asmlinkage void do_ov(struct pt_regs *regs) 591asmlinkage void do_ov(struct pt_regs *regs)
@@ -672,10 +669,8 @@ asmlinkage void do_bp(struct pt_regs *regs)
672 unsigned int opcode, bcode; 669 unsigned int opcode, bcode;
673 siginfo_t info; 670 siginfo_t info;
674 671
675 die_if_kernel("Break instruction in kernel code", regs); 672 if (get_user(opcode, (unsigned int __user *) exception_epc(regs)))
676 673 goto out_sigsegv;
677 if (get_insn_opcode(regs, &opcode))
678 return;
679 674
680 /* 675 /*
681 * There is the ancient bug in the MIPS assemblers that the break 676 * There is the ancient bug in the MIPS assemblers that the break
@@ -696,6 +691,7 @@ asmlinkage void do_bp(struct pt_regs *regs)
696 switch (bcode) { 691 switch (bcode) {
697 case BRK_OVERFLOW << 10: 692 case BRK_OVERFLOW << 10:
698 case BRK_DIVZERO << 10: 693 case BRK_DIVZERO << 10:
694 die_if_kernel("Break instruction in kernel code", regs);
699 if (bcode == (BRK_DIVZERO << 10)) 695 if (bcode == (BRK_DIVZERO << 10))
700 info.si_code = FPE_INTDIV; 696 info.si_code = FPE_INTDIV;
701 else 697 else
@@ -705,9 +701,16 @@ asmlinkage void do_bp(struct pt_regs *regs)
705 info.si_addr = (void __user *) regs->cp0_epc; 701 info.si_addr = (void __user *) regs->cp0_epc;
706 force_sig_info(SIGFPE, &info, current); 702 force_sig_info(SIGFPE, &info, current);
707 break; 703 break;
704 case BRK_BUG:
705 die("Kernel bug detected", regs);
706 break;
708 default: 707 default:
708 die_if_kernel("Break instruction in kernel code", regs);
709 force_sig(SIGTRAP, current); 709 force_sig(SIGTRAP, current);
710 } 710 }
711
712out_sigsegv:
713 force_sig(SIGSEGV, current);
711} 714}
712 715
713asmlinkage void do_tr(struct pt_regs *regs) 716asmlinkage void do_tr(struct pt_regs *regs)
@@ -715,10 +718,8 @@ asmlinkage void do_tr(struct pt_regs *regs)
715 unsigned int opcode, tcode = 0; 718 unsigned int opcode, tcode = 0;
716 siginfo_t info; 719 siginfo_t info;
717 720
718 die_if_kernel("Trap instruction in kernel code", regs); 721 if (get_user(opcode, (unsigned int __user *) exception_epc(regs)))
719 722 goto out_sigsegv;
720 if (get_insn_opcode(regs, &opcode))
721 return;
722 723
723 /* Immediate versions don't provide a code. */ 724 /* Immediate versions don't provide a code. */
724 if (!(opcode & OPCODE)) 725 if (!(opcode & OPCODE))
@@ -733,6 +734,7 @@ asmlinkage void do_tr(struct pt_regs *regs)
733 switch (tcode) { 734 switch (tcode) {
734 case BRK_OVERFLOW: 735 case BRK_OVERFLOW:
735 case BRK_DIVZERO: 736 case BRK_DIVZERO:
737 die_if_kernel("Trap instruction in kernel code", regs);
736 if (tcode == BRK_DIVZERO) 738 if (tcode == BRK_DIVZERO)
737 info.si_code = FPE_INTDIV; 739 info.si_code = FPE_INTDIV;
738 else 740 else
@@ -742,9 +744,16 @@ asmlinkage void do_tr(struct pt_regs *regs)
742 info.si_addr = (void __user *) regs->cp0_epc; 744 info.si_addr = (void __user *) regs->cp0_epc;
743 force_sig_info(SIGFPE, &info, current); 745 force_sig_info(SIGFPE, &info, current);
744 break; 746 break;
747 case BRK_BUG:
748 die("Kernel bug detected", regs);
749 break;
745 default: 750 default:
751 die_if_kernel("Trap instruction in kernel code", regs);
746 force_sig(SIGTRAP, current); 752 force_sig(SIGTRAP, current);
747 } 753 }
754
755out_sigsegv:
756 force_sig(SIGSEGV, current);
748} 757}
749 758
750asmlinkage void do_ri(struct pt_regs *regs) 759asmlinkage void do_ri(struct pt_regs *regs)
@@ -1111,7 +1120,7 @@ static struct shadow_registers {
1111static void mips_srs_init(void) 1120static void mips_srs_init(void)
1112{ 1121{
1113 shadow_registers.sr_supported = ((read_c0_srsctl() >> 26) & 0x0f) + 1; 1122 shadow_registers.sr_supported = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
1114 printk(KERN_INFO "%d MIPSR2 register sets available\n", 1123 printk(KERN_INFO "%ld MIPSR2 register sets available\n",
1115 shadow_registers.sr_supported); 1124 shadow_registers.sr_supported);
1116 shadow_registers.sr_allocated = 1; /* Set 0 used by kernel */ 1125 shadow_registers.sr_allocated = 1; /* Set 0 used by kernel */
1117} 1126}
@@ -1423,6 +1432,15 @@ void __init set_uncached_handler (unsigned long offset, void *addr, unsigned lon
1423 memcpy((void *)(uncached_ebase + offset), addr, size); 1432 memcpy((void *)(uncached_ebase + offset), addr, size);
1424} 1433}
1425 1434
1435static int __initdata rdhwr_noopt;
1436static int __init set_rdhwr_noopt(char *str)
1437{
1438 rdhwr_noopt = 1;
1439 return 1;
1440}
1441
1442__setup("rdhwr_noopt", set_rdhwr_noopt);
1443
1426void __init trap_init(void) 1444void __init trap_init(void)
1427{ 1445{
1428 extern char except_vec3_generic, except_vec3_r4000; 1446 extern char except_vec3_generic, except_vec3_r4000;
@@ -1502,7 +1520,9 @@ void __init trap_init(void)
1502 1520
1503 set_except_vector(8, handle_sys); 1521 set_except_vector(8, handle_sys);
1504 set_except_vector(9, handle_bp); 1522 set_except_vector(9, handle_bp);
1505 set_except_vector(10, handle_ri); 1523 set_except_vector(10, rdhwr_noopt ? handle_ri :
1524 (cpu_has_vtag_icache ?
1525 handle_ri_rdhwr_vivt : handle_ri_rdhwr));
1506 set_except_vector(11, handle_cpu); 1526 set_except_vector(11, handle_cpu);
1507 set_except_vector(12, handle_ov); 1527 set_except_vector(12, handle_ov);
1508 set_except_vector(13, handle_tr); 1528 set_except_vector(13, handle_tr);
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 0bb9cd88945..79f0317d84a 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -50,6 +50,16 @@ SECTIONS
50 /* writeable */ 50 /* writeable */
51 .data : { /* Data */ 51 .data : { /* Data */
52 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */ 52 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
53 /*
54 * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which
55 * limits the maximum alignment to at most 32kB and results in the following
56 * warning:
57 *
58 * CC arch/mips/kernel/init_task.o
59 * arch/mips/kernel/init_task.c:30: warning: alignment of ‘init_thread_union’
60 * is greater than maximum object file alignment. Using 32768
61 */
62 . = ALIGN(_PAGE_SIZE);
53 *(.data.init_task) 63 *(.data.init_task)
54 64
55 *(.data) 65 *(.data)
@@ -91,13 +101,7 @@ SECTIONS
91 101
92 __initcall_start = .; 102 __initcall_start = .;
93 .initcall.init : { 103 .initcall.init : {
94 *(.initcall1.init) 104 INITCALLS
95 *(.initcall2.init)
96 *(.initcall3.init)
97 *(.initcall4.init)
98 *(.initcall5.init)
99 *(.initcall6.init)
100 *(.initcall7.init)
101 } 105 }
102 __initcall_end = .; 106 __initcall_end = .;
103 107
diff --git a/arch/mips/lasat/interrupt.c b/arch/mips/lasat/interrupt.c
index a144a002dcc..4a84a7beac5 100644
--- a/arch/mips/lasat/interrupt.c
+++ b/arch/mips/lasat/interrupt.c
@@ -36,33 +36,14 @@ static volatile int lasat_int_mask_shift;
36 36
37void disable_lasat_irq(unsigned int irq_nr) 37void disable_lasat_irq(unsigned int irq_nr)
38{ 38{
39 unsigned long flags;
40
41 local_irq_save(flags);
42 *lasat_int_mask &= ~(1 << irq_nr) << lasat_int_mask_shift; 39 *lasat_int_mask &= ~(1 << irq_nr) << lasat_int_mask_shift;
43 local_irq_restore(flags);
44} 40}
45 41
46void enable_lasat_irq(unsigned int irq_nr) 42void enable_lasat_irq(unsigned int irq_nr)
47{ 43{
48 unsigned long flags;
49
50 local_irq_save(flags);
51 *lasat_int_mask |= (1 << irq_nr) << lasat_int_mask_shift; 44 *lasat_int_mask |= (1 << irq_nr) << lasat_int_mask_shift;
52 local_irq_restore(flags);
53} 45}
54 46
55static unsigned int startup_lasat_irq(unsigned int irq)
56{
57 enable_lasat_irq(irq);
58
59 return 0; /* never anything pending */
60}
61
62#define shutdown_lasat_irq disable_lasat_irq
63
64#define mask_and_ack_lasat_irq disable_lasat_irq
65
66static void end_lasat_irq(unsigned int irq) 47static void end_lasat_irq(unsigned int irq)
67{ 48{
68 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 49 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
@@ -71,11 +52,10 @@ static void end_lasat_irq(unsigned int irq)
71 52
72static struct irq_chip lasat_irq_type = { 53static struct irq_chip lasat_irq_type = {
73 .typename = "Lasat", 54 .typename = "Lasat",
74 .startup = startup_lasat_irq, 55 .ack = disable_lasat_irq,
75 .shutdown = shutdown_lasat_irq, 56 .mask = disable_lasat_irq,
76 .enable = enable_lasat_irq, 57 .mask_ack = disable_lasat_irq,
77 .disable = disable_lasat_irq, 58 .unmask = enable_lasat_irq,
78 .ack = mask_and_ack_lasat_irq,
79 .end = end_lasat_irq, 59 .end = end_lasat_irq,
80}; 60};
81 61
@@ -152,10 +132,6 @@ void __init arch_init_irq(void)
152 panic("arch_init_irq: mips_machtype incorrect"); 132 panic("arch_init_irq: mips_machtype incorrect");
153 } 133 }
154 134
155 for (i = 0; i <= LASATINT_END; i++) { 135 for (i = 0; i <= LASATINT_END; i++)
156 irq_desc[i].status = IRQ_DISABLED; 136 set_irq_chip_and_handler(i, &lasat_irq_type, handle_level_irq);
157 irq_desc[i].action = 0;
158 irq_desc[i].depth = 1;
159 irq_desc[i].chip = &lasat_irq_type;
160 }
161} 137}
diff --git a/arch/mips/lib-64/dump_tlb.c b/arch/mips/lib-64/dump_tlb.c
index be8261be679..594df1a05ec 100644
--- a/arch/mips/lib-64/dump_tlb.c
+++ b/arch/mips/lib-64/dump_tlb.c
@@ -149,7 +149,7 @@ void dump_list_process(struct task_struct *t, void *address)
149 printk("Addr == %08lx\n", addr); 149 printk("Addr == %08lx\n", addr);
150 printk("tasks->mm.pgd == %08lx\n", (unsigned long) t->mm->pgd); 150 printk("tasks->mm.pgd == %08lx\n", (unsigned long) t->mm->pgd);
151 151
152 page_dir = pgd_offset(t->mm, 0); 152 page_dir = pgd_offset(t->mm, 0UL);
153 printk("page_dir == %016lx\n", (unsigned long) page_dir); 153 printk("page_dir == %016lx\n", (unsigned long) page_dir);
154 154
155 pgd = pgd_offset(t->mm, addr); 155 pgd = pgd_offset(t->mm, addr);
@@ -184,13 +184,13 @@ void dump_list_current(void *address)
184 dump_list_process(current, address); 184 dump_list_process(current, address);
185} 185}
186 186
187unsigned int vtop(void *address) 187unsigned long vtop(void *address)
188{ 188{
189 pgd_t *pgd; 189 pgd_t *pgd;
190 pud_t *pud; 190 pud_t *pud;
191 pmd_t *pmd; 191 pmd_t *pmd;
192 pte_t *pte; 192 pte_t *pte;
193 unsigned int addr, paddr; 193 unsigned long addr, paddr;
194 194
195 addr = (unsigned long) address; 195 addr = (unsigned long) address;
196 pgd = pgd_offset(current->mm, addr); 196 pgd = pgd_offset(current->mm, addr);
diff --git a/arch/mips/lib/csum_partial_copy.c b/arch/mips/lib/csum_partial_copy.c
index 6e9f366f961..1720f2ceeea 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, 19__wsum csum_partial_copy_nocheck(const void *src,
20 unsigned char *dst, int len, unsigned int sum) 20 void *dst, int len, __wsum 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,
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 __user *src, 36__wsum csum_partial_copy_from_user (const void __user *src,
37 unsigned char *dst, int len, unsigned int sum, int *err_ptr) 37 void *dst, int len, __wsum sum, int *err_ptr)
38{ 38{
39 int missing; 39 int missing;
40 40
diff --git a/arch/mips/mips-boards/atlas/atlas_int.c b/arch/mips/mips-boards/atlas/atlas_int.c
index be624b8c3b0..43dba6ce660 100644
--- a/arch/mips/mips-boards/atlas/atlas_int.c
+++ b/arch/mips/mips-boards/atlas/atlas_int.c
@@ -62,16 +62,6 @@ void enable_atlas_irq(unsigned int irq_nr)
62 iob(); 62 iob();
63} 63}
64 64
65static unsigned int startup_atlas_irq(unsigned int irq)
66{
67 enable_atlas_irq(irq);
68 return 0; /* never anything pending */
69}
70
71#define shutdown_atlas_irq disable_atlas_irq
72
73#define mask_and_ack_atlas_irq disable_atlas_irq
74
75static void end_atlas_irq(unsigned int irq) 65static void end_atlas_irq(unsigned int irq)
76{ 66{
77 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 67 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
@@ -80,11 +70,11 @@ static void end_atlas_irq(unsigned int irq)
80 70
81static struct irq_chip atlas_irq_type = { 71static struct irq_chip atlas_irq_type = {
82 .typename = "Atlas", 72 .typename = "Atlas",
83 .startup = startup_atlas_irq, 73 .ack = disable_atlas_irq,
84 .shutdown = shutdown_atlas_irq, 74 .mask = disable_atlas_irq,
85 .enable = enable_atlas_irq, 75 .mask_ack = disable_atlas_irq,
86 .disable = disable_atlas_irq, 76 .unmask = enable_atlas_irq,
87 .ack = mask_and_ack_atlas_irq, 77 .eoi = enable_atlas_irq,
88 .end = end_atlas_irq, 78 .end = end_atlas_irq,
89}; 79};
90 80
@@ -217,13 +207,8 @@ static inline void init_atlas_irqs (int base)
217 */ 207 */
218 atlas_hw0_icregs->intrsten = 0xffffffff; 208 atlas_hw0_icregs->intrsten = 0xffffffff;
219 209
220 for (i = ATLAS_INT_BASE; i <= ATLAS_INT_END; i++) { 210 for (i = ATLAS_INT_BASE; i <= ATLAS_INT_END; i++)
221 irq_desc[i].status = IRQ_DISABLED; 211 set_irq_chip_and_handler(i, &atlas_irq_type, handle_level_irq);
222 irq_desc[i].action = 0;
223 irq_desc[i].depth = 1;
224 irq_desc[i].chip = &atlas_irq_type;
225 spin_lock_init(&irq_desc[i].lock);
226 }
227} 212}
228 213
229static struct irqaction atlasirq = { 214static struct irqaction atlasirq = {
diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c
index be80c5dd4a0..eeed944e0f8 100644
--- a/arch/mips/mips-boards/generic/memory.c
+++ b/arch/mips/mips-boards/generic/memory.c
@@ -176,7 +176,7 @@ unsigned long __init prom_free_prom_memory(void)
176 if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA) 176 if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA)
177 continue; 177 continue;
178 178
179 addr = boot_mem_map.map[i].addr; 179 addr = PAGE_ALIGN(boot_mem_map.map[i].addr);
180 while (addr < boot_mem_map.map[i].addr 180 while (addr < boot_mem_map.map[i].addr
181 + boot_mem_map.map[i].size) { 181 + boot_mem_map.map[i].size) {
182 ClearPageReserved(virt_to_page(__va(addr))); 182 ClearPageReserved(virt_to_page(__va(addr)));
diff --git a/arch/mips/mips-boards/generic/pci.c b/arch/mips/mips-boards/generic/pci.c
index 9337f6c8873..3192a14698c 100644
--- a/arch/mips/mips-boards/generic/pci.c
+++ b/arch/mips/mips-boards/generic/pci.c
@@ -90,7 +90,7 @@ static struct pci_controller msc_controller = {
90void __init mips_pcibios_init(void) 90void __init mips_pcibios_init(void)
91{ 91{
92 struct pci_controller *controller; 92 struct pci_controller *controller;
93 unsigned long start, end, map, start1, end1, map1, map2, map3, mask; 93 resource_size_t start, end, map, start1, end1, map1, map2, map3, mask;
94 94
95 switch (mips_revision_corid) { 95 switch (mips_revision_corid) {
96 case MIPS_REVISION_CORID_QED_RM5261: 96 case MIPS_REVISION_CORID_QED_RM5261:
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c
index 6f8a9fe7c1e..e4604c73f02 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -187,7 +187,7 @@ out:
187} 187}
188 188
189/* 189/*
190 * Estimate CPU frequency. Sets mips_counter_frequency as a side-effect 190 * Estimate CPU frequency. Sets mips_hpt_frequency as a side-effect
191 */ 191 */
192static unsigned int __init estimate_cpu_frequency(void) 192static unsigned int __init estimate_cpu_frequency(void)
193{ 193{
@@ -208,7 +208,8 @@ static unsigned int __init estimate_cpu_frequency(void)
208 count = 6000000; 208 count = 6000000;
209#endif 209#endif
210#if defined(CONFIG_MIPS_ATLAS) || defined(CONFIG_MIPS_MALTA) 210#if defined(CONFIG_MIPS_ATLAS) || defined(CONFIG_MIPS_MALTA)
211 unsigned int flags; 211 unsigned long flags;
212 unsigned int start;
212 213
213 local_irq_save(flags); 214 local_irq_save(flags);
214 215
@@ -217,13 +218,13 @@ static unsigned int __init estimate_cpu_frequency(void)
217 while (!(CMOS_READ(RTC_REG_A) & RTC_UIP)); 218 while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
218 219
219 /* Start r4k counter. */ 220 /* Start r4k counter. */
220 write_c0_count(0); 221 start = read_c0_count();
221 222
222 /* Read counter exactly on falling edge of update flag */ 223 /* Read counter exactly on falling edge of update flag */
223 while (CMOS_READ(RTC_REG_A) & RTC_UIP); 224 while (CMOS_READ(RTC_REG_A) & RTC_UIP);
224 while (!(CMOS_READ(RTC_REG_A) & RTC_UIP)); 225 while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
225 226
226 count = read_c0_count(); 227 count = read_c0_count() - start;
227 228
228 /* restore interrupts */ 229 /* restore interrupts */
229 local_irq_restore(flags); 230 local_irq_restore(flags);
@@ -287,6 +288,7 @@ void __init plat_timer_setup(struct irqaction *irq)
287 The effect is that the int remains disabled on the second cpu. 288 The effect is that the int remains disabled on the second cpu.
288 Mark the interrupt with IRQ_PER_CPU to avoid any confusion */ 289 Mark the interrupt with IRQ_PER_CPU to avoid any confusion */
289 irq_desc[mips_cpu_timer_irq].status |= IRQ_PER_CPU; 290 irq_desc[mips_cpu_timer_irq].status |= IRQ_PER_CPU;
291 set_irq_handler(mips_cpu_timer_irq, handle_percpu_irq);
290#endif 292#endif
291 293
292 /* to generate the first timer interrupt */ 294 /* to generate the first timer interrupt */
diff --git a/arch/mips/mips-boards/malta/malta_int.c b/arch/mips/mips-boards/malta/malta_int.c
index 6244d0e2c7d..90ad5bf3e2f 100644
--- a/arch/mips/mips-boards/malta/malta_int.c
+++ b/arch/mips/mips-boards/malta/malta_int.c
@@ -32,6 +32,7 @@
32#include <asm/i8259.h> 32#include <asm/i8259.h>
33#include <asm/irq_cpu.h> 33#include <asm/irq_cpu.h>
34#include <asm/io.h> 34#include <asm/io.h>
35#include <asm/irq_regs.h>
35#include <asm/mips-boards/malta.h> 36#include <asm/mips-boards/malta.h>
36#include <asm/mips-boards/maltaint.h> 37#include <asm/mips-boards/maltaint.h>
37#include <asm/mips-boards/piix4.h> 38#include <asm/mips-boards/piix4.h>
@@ -131,7 +132,7 @@ static void corehi_irqdispatch(void)
131 unsigned int intedge, intsteer, pcicmd, pcibadaddr; 132 unsigned int intedge, intsteer, pcicmd, pcibadaddr;
132 unsigned int pcimstat, intisr, inten, intpol; 133 unsigned int pcimstat, intisr, inten, intpol;
133 unsigned int intrcause,datalo,datahi; 134 unsigned int intrcause,datalo,datahi;
134 struct pt_regs *regs; 135 struct pt_regs *regs = get_irq_regs();
135 136
136 printk("CoreHI interrupt, shouldn't happen, so we die here!!!\n"); 137 printk("CoreHI interrupt, shouldn't happen, so we die here!!!\n");
137 printk("epc : %08lx\nStatus: %08lx\n" 138 printk("epc : %08lx\nStatus: %08lx\n"
diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c
index ab460f805be..282f3e52eea 100644
--- a/arch/mips/mips-boards/malta/malta_setup.c
+++ b/arch/mips/mips-boards/malta/malta_setup.c
@@ -159,7 +159,7 @@ void __init plat_mem_setup(void)
159 BONITO_PCIMEMBASECFG |= 159 BONITO_PCIMEMBASECFG |=
160 (BONITO_PCIMEMBASECFG_MEMBASE0_CACHED | 160 (BONITO_PCIMEMBASECFG_MEMBASE0_CACHED |
161 BONITO_PCIMEMBASECFG_MEMBASE1_CACHED); 161 BONITO_PCIMEMBASECFG_MEMBASE1_CACHED);
162 printk("Disabled Bonito IOBC coherency\n"); 162 printk("Enabled Bonito IOBC coherency\n");
163 } 163 }
164 } 164 }
165 else 165 else
diff --git a/arch/mips/mips-boards/sim/sim_time.c b/arch/mips/mips-boards/sim/sim_time.c
index c566b9bd042..30711d016fe 100644
--- a/arch/mips/mips-boards/sim/sim_time.c
+++ b/arch/mips/mips-boards/sim/sim_time.c
@@ -3,31 +3,24 @@
3#include <linux/kernel_stat.h> 3#include <linux/kernel_stat.h>
4#include <linux/sched.h> 4#include <linux/sched.h>
5#include <linux/spinlock.h> 5#include <linux/spinlock.h>
6
7#include <asm/mipsregs.h>
8#include <asm/ptrace.h>
9#include <asm/hardirq.h>
10#include <asm/div64.h>
11#include <asm/cpu.h>
12#include <asm/time.h>
13
14#include <linux/interrupt.h> 6#include <linux/interrupt.h>
15#include <linux/mc146818rtc.h> 7#include <linux/mc146818rtc.h>
16#include <linux/timex.h> 8#include <linux/timex.h>
9
17#include <asm/mipsregs.h> 10#include <asm/mipsregs.h>
11#include <asm/ptrace.h>
18#include <asm/hardirq.h> 12#include <asm/hardirq.h>
19#include <asm/irq.h>
20#include <asm/div64.h> 13#include <asm/div64.h>
21#include <asm/cpu.h> 14#include <asm/cpu.h>
22#include <asm/time.h> 15#include <asm/time.h>
16#include <asm/irq.h>
23#include <asm/mc146818-time.h> 17#include <asm/mc146818-time.h>
24#include <asm/msc01_ic.h> 18#include <asm/msc01_ic.h>
19#include <asm/smp.h>
25 20
26#include <asm/mips-boards/generic.h> 21#include <asm/mips-boards/generic.h>
27#include <asm/mips-boards/prom.h> 22#include <asm/mips-boards/prom.h>
28#include <asm/mips-boards/simint.h> 23#include <asm/mips-boards/simint.h>
29#include <asm/mc146818-time.h>
30#include <asm/smp.h>
31 24
32 25
33unsigned long cpu_khz; 26unsigned long cpu_khz;
@@ -102,7 +95,7 @@ irqreturn_t sim_timer_interrupt(int irq, void *dev_id)
102 95
103 96
104/* 97/*
105 * Estimate CPU frequency. Sets mips_counter_frequency as a side-effect 98 * Estimate CPU frequency. Sets mips_hpt_frequency as a side-effect
106 */ 99 */
107static unsigned int __init estimate_cpu_frequency(void) 100static unsigned int __init estimate_cpu_frequency(void)
108{ 101{
@@ -203,7 +196,8 @@ void __init plat_timer_setup(struct irqaction *irq)
203 on seperate cpu's the first one tries to handle the second interrupt. 196 on seperate cpu's the first one tries to handle the second interrupt.
204 The effect is that the int remains disabled on the second cpu. 197 The effect is that the int remains disabled on the second cpu.
205 Mark the interrupt with IRQ_PER_CPU to avoid any confusion */ 198 Mark the interrupt with IRQ_PER_CPU to avoid any confusion */
206 irq_desc[mips_cpu_timer_irq].status |= IRQ_PER_CPU; 199 irq_desc[mips_cpu_timer_irq].flags |= IRQ_PER_CPU;
200 set_irq_handler(mips_cpu_timer_irq, handle_percpu_irq);
207#endif 201#endif
208 202
209 /* to generate the first timer interrupt */ 203 /* to generate the first timer interrupt */
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index cc895dad71d..df04a315d83 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -323,7 +323,6 @@ static void __init r4k_blast_scache_setup(void)
323static inline void local_r4k_flush_cache_all(void * args) 323static inline void local_r4k_flush_cache_all(void * args)
324{ 324{
325 r4k_blast_dcache(); 325 r4k_blast_dcache();
326 r4k_blast_icache();
327} 326}
328 327
329static void r4k_flush_cache_all(void) 328static void r4k_flush_cache_all(void)
@@ -359,21 +358,19 @@ static void r4k___flush_cache_all(void)
359static inline void local_r4k_flush_cache_range(void * args) 358static inline void local_r4k_flush_cache_range(void * args)
360{ 359{
361 struct vm_area_struct *vma = args; 360 struct vm_area_struct *vma = args;
362 int exec;
363 361
364 if (!(cpu_context(smp_processor_id(), vma->vm_mm))) 362 if (!(cpu_context(smp_processor_id(), vma->vm_mm)))
365 return; 363 return;
366 364
367 exec = vma->vm_flags & VM_EXEC; 365 r4k_blast_dcache();
368 if (cpu_has_dc_aliases || exec)
369 r4k_blast_dcache();
370 if (exec)
371 r4k_blast_icache();
372} 366}
373 367
374static void r4k_flush_cache_range(struct vm_area_struct *vma, 368static void r4k_flush_cache_range(struct vm_area_struct *vma,
375 unsigned long start, unsigned long end) 369 unsigned long start, unsigned long end)
376{ 370{
371 if (!cpu_has_dc_aliases)
372 return;
373
377 r4k_on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1); 374 r4k_on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1);
378} 375}
379 376
@@ -384,18 +381,21 @@ static inline void local_r4k_flush_cache_mm(void * args)
384 if (!cpu_context(smp_processor_id(), mm)) 381 if (!cpu_context(smp_processor_id(), mm))
385 return; 382 return;
386 383
387 r4k_blast_dcache();
388 r4k_blast_icache();
389
390 /* 384 /*
391 * Kludge alert. For obscure reasons R4000SC and R4400SC go nuts if we 385 * Kludge alert. For obscure reasons R4000SC and R4400SC go nuts if we
392 * only flush the primary caches but R10000 and R12000 behave sane ... 386 * only flush the primary caches but R10000 and R12000 behave sane ...
387 * R4000SC and R4400SC indexed S-cache ops also invalidate primary
388 * caches, so we can bail out early.
393 */ 389 */
394 if (current_cpu_data.cputype == CPU_R4000SC || 390 if (current_cpu_data.cputype == CPU_R4000SC ||
395 current_cpu_data.cputype == CPU_R4000MC || 391 current_cpu_data.cputype == CPU_R4000MC ||
396 current_cpu_data.cputype == CPU_R4400SC || 392 current_cpu_data.cputype == CPU_R4400SC ||
397 current_cpu_data.cputype == CPU_R4400MC) 393 current_cpu_data.cputype == CPU_R4400MC) {
398 r4k_blast_scache(); 394 r4k_blast_scache();
395 return;
396 }
397
398 r4k_blast_dcache();
399} 399}
400 400
401static void r4k_flush_cache_mm(struct mm_struct *mm) 401static void r4k_flush_cache_mm(struct mm_struct *mm)
diff --git a/arch/mips/mm/c-sb1.c b/arch/mips/mm/c-sb1.c
index 5537558f19f..3a8afd47fea 100644
--- a/arch/mips/mm/c-sb1.c
+++ b/arch/mips/mm/c-sb1.c
@@ -19,6 +19,7 @@
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */ 20 */
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/hardirq.h>
22 23
23#include <asm/asm.h> 24#include <asm/asm.h>
24#include <asm/bootinfo.h> 25#include <asm/bootinfo.h>
@@ -49,6 +50,15 @@ static unsigned short dcache_sets;
49static unsigned int icache_range_cutoff; 50static unsigned int icache_range_cutoff;
50static unsigned int dcache_range_cutoff; 51static unsigned int dcache_range_cutoff;
51 52
53static inline void sb1_on_each_cpu(void (*func) (void *info), void *info,
54 int retry, int wait)
55{
56 preempt_disable();
57 smp_call_function(func, info, retry, wait);
58 func(info);
59 preempt_enable();
60}
61
52/* 62/*
53 * The dcache is fully coherent to the system, with one 63 * The dcache is fully coherent to the system, with one
54 * big caveat: the instruction stream. In other words, 64 * big caveat: the instruction stream. In other words,
@@ -226,13 +236,32 @@ static void sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr,
226 args.vma = vma; 236 args.vma = vma;
227 args.addr = addr; 237 args.addr = addr;
228 args.pfn = pfn; 238 args.pfn = pfn;
229 on_each_cpu(sb1_flush_cache_page_ipi, (void *) &args, 1, 1); 239 sb1_on_each_cpu(sb1_flush_cache_page_ipi, (void *) &args, 1, 1);
230} 240}
231#else 241#else
232void sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn) 242void sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn)
233 __attribute__((alias("local_sb1_flush_cache_page"))); 243 __attribute__((alias("local_sb1_flush_cache_page")));
234#endif 244#endif
235 245
246#ifdef CONFIG_SMP
247static void sb1_flush_cache_data_page_ipi(void *info)
248{
249 unsigned long start = (unsigned long)info;
250
251 __sb1_writeback_inv_dcache_range(start, start + PAGE_SIZE);
252}
253
254static void sb1_flush_cache_data_page(unsigned long addr)
255{
256 if (in_atomic())
257 __sb1_writeback_inv_dcache_range(addr, addr + PAGE_SIZE);
258 else
259 on_each_cpu(sb1_flush_cache_data_page_ipi, (void *) addr, 1, 1);
260}
261#else
262void sb1_flush_cache_data_page(unsigned long)
263 __attribute__((alias("local_sb1_flush_cache_data_page")));
264#endif
236 265
237/* 266/*
238 * Invalidate all caches on this CPU 267 * Invalidate all caches on this CPU
@@ -249,7 +278,7 @@ void sb1___flush_cache_all_ipi(void *ignored)
249 278
250static void sb1___flush_cache_all(void) 279static void sb1___flush_cache_all(void)
251{ 280{
252 on_each_cpu(sb1___flush_cache_all_ipi, 0, 1, 1); 281 sb1_on_each_cpu(sb1___flush_cache_all_ipi, 0, 1, 1);
253} 282}
254#else 283#else
255void sb1___flush_cache_all(void) 284void sb1___flush_cache_all(void)
@@ -299,7 +328,7 @@ void sb1_flush_icache_range(unsigned long start, unsigned long end)
299 328
300 args.start = start; 329 args.start = start;
301 args.end = end; 330 args.end = end;
302 on_each_cpu(sb1_flush_icache_range_ipi, &args, 1, 1); 331 sb1_on_each_cpu(sb1_flush_icache_range_ipi, &args, 1, 1);
303} 332}
304#else 333#else
305void sb1_flush_icache_range(unsigned long start, unsigned long end) 334void sb1_flush_icache_range(unsigned long start, unsigned long end)
@@ -326,7 +355,7 @@ static void sb1_flush_cache_sigtramp_ipi(void *info)
326 355
327static void sb1_flush_cache_sigtramp(unsigned long addr) 356static void sb1_flush_cache_sigtramp(unsigned long addr)
328{ 357{
329 on_each_cpu(sb1_flush_cache_sigtramp_ipi, (void *) addr, 1, 1); 358 sb1_on_each_cpu(sb1_flush_cache_sigtramp_ipi, (void *) addr, 1, 1);
330} 359}
331#else 360#else
332void sb1_flush_cache_sigtramp(unsigned long addr) 361void sb1_flush_cache_sigtramp(unsigned long addr)
@@ -444,7 +473,6 @@ static __init void probe_cache_sizes(void)
444void sb1_cache_init(void) 473void sb1_cache_init(void)
445{ 474{
446 extern char except_vec2_sb1; 475 extern char except_vec2_sb1;
447 extern char handle_vec2_sb1;
448 476
449 /* Special cache error handler for SB1 */ 477 /* Special cache error handler for SB1 */
450 set_uncached_handler (0x100, &except_vec2_sb1, 0x80); 478 set_uncached_handler (0x100, &except_vec2_sb1, 0x80);
@@ -473,7 +501,7 @@ void sb1_cache_init(void)
473 501
474 flush_cache_sigtramp = sb1_flush_cache_sigtramp; 502 flush_cache_sigtramp = sb1_flush_cache_sigtramp;
475 local_flush_data_cache_page = (void *) sb1_nop; 503 local_flush_data_cache_page = (void *) sb1_nop;
476 flush_data_cache_page = (void *) sb1_nop; 504 flush_data_cache_page = sb1_flush_cache_data_page;
477 505
478 /* Full flush */ 506 /* Full flush */
479 __flush_cache_all = sb1___flush_cache_all; 507 __flush_cache_all = sb1___flush_cache_all;
@@ -497,5 +525,5 @@ void sb1_cache_init(void)
497 : 525 :
498 : "memory"); 526 : "memory");
499 527
500 flush_cache_all(); 528 local_sb1___flush_cache_all();
501} 529}
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index 8423d859077..6f90e7ef66a 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -60,6 +60,10 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
60 */ 60 */
61 if (unlikely(address >= VMALLOC_START && address <= VMALLOC_END)) 61 if (unlikely(address >= VMALLOC_START && address <= VMALLOC_END))
62 goto vmalloc_fault; 62 goto vmalloc_fault;
63#ifdef MODULE_START
64 if (unlikely(address >= MODULE_START && address < MODULE_END))
65 goto vmalloc_fault;
66#endif
63 67
64 /* 68 /*
65 * If we're in an interrupt or have no user 69 * If we're in an interrupt or have no user
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 88b72c9a849..9e29ba9205f 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -30,11 +30,34 @@
30#include <asm/cachectl.h> 30#include <asm/cachectl.h>
31#include <asm/cpu.h> 31#include <asm/cpu.h>
32#include <asm/dma.h> 32#include <asm/dma.h>
33#include <asm/kmap_types.h>
33#include <asm/mmu_context.h> 34#include <asm/mmu_context.h>
34#include <asm/sections.h> 35#include <asm/sections.h>
35#include <asm/pgtable.h> 36#include <asm/pgtable.h>
36#include <asm/pgalloc.h> 37#include <asm/pgalloc.h>
37#include <asm/tlb.h> 38#include <asm/tlb.h>
39#include <asm/fixmap.h>
40
41/* Atomicity and interruptability */
42#ifdef CONFIG_MIPS_MT_SMTC
43
44#include <asm/mipsmtregs.h>
45
46#define ENTER_CRITICAL(flags) \
47 { \
48 unsigned int mvpflags; \
49 local_irq_save(flags);\
50 mvpflags = dvpe()
51#define EXIT_CRITICAL(flags) \
52 evpe(mvpflags); \
53 local_irq_restore(flags); \
54 }
55#else
56
57#define ENTER_CRITICAL(flags) local_irq_save(flags)
58#define EXIT_CRITICAL(flags) local_irq_restore(flags)
59
60#endif /* CONFIG_MIPS_MT_SMTC */
38 61
39DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 62DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
40 63
@@ -67,9 +90,9 @@ unsigned long setup_zero_pages(void)
67 if (!empty_zero_page) 90 if (!empty_zero_page)
68 panic("Oh boy, that early out of memory?"); 91 panic("Oh boy, that early out of memory?");
69 92
70 page = virt_to_page(empty_zero_page); 93 page = virt_to_page((void *)empty_zero_page);
71 split_page(page, order); 94 split_page(page, order);
72 while (page < virt_to_page(empty_zero_page + (PAGE_SIZE << order))) { 95 while (page < virt_to_page((void *)(empty_zero_page + (PAGE_SIZE << order)))) {
73 SetPageReserved(page); 96 SetPageReserved(page);
74 page++; 97 page++;
75 } 98 }
@@ -80,13 +103,142 @@ unsigned long setup_zero_pages(void)
80 return 1UL << order; 103 return 1UL << order;
81} 104}
82 105
83#ifdef CONFIG_HIGHMEM 106/*
84pte_t *kmap_pte; 107 * These are almost like kmap_atomic / kunmap_atmic except they take an
85pgprot_t kmap_prot; 108 * additional address argument as the hint.
109 */
86 110
87#define kmap_get_fixmap_pte(vaddr) \ 111#define kmap_get_fixmap_pte(vaddr) \
88 pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr)) 112 pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr))
89 113
114#ifdef CONFIG_MIPS_MT_SMTC
115static pte_t *kmap_coherent_pte;
116static void __init kmap_coherent_init(void)
117{
118 unsigned long vaddr;
119
120 /* cache the first coherent kmap pte */
121 vaddr = __fix_to_virt(FIX_CMAP_BEGIN);
122 kmap_coherent_pte = kmap_get_fixmap_pte(vaddr);
123}
124#else
125static inline void kmap_coherent_init(void) {}
126#endif
127
128static inline void *kmap_coherent(struct page *page, unsigned long addr)
129{
130 enum fixed_addresses idx;
131 unsigned long vaddr, flags, entrylo;
132 unsigned long old_ctx;
133 pte_t pte;
134 int tlbidx;
135
136 inc_preempt_count();
137 idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1);
138#ifdef CONFIG_MIPS_MT_SMTC
139 idx += FIX_N_COLOURS * smp_processor_id();
140#endif
141 vaddr = __fix_to_virt(FIX_CMAP_END - idx);
142 pte = mk_pte(page, PAGE_KERNEL);
143#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
144 entrylo = pte.pte_high;
145#else
146 entrylo = pte_val(pte) >> 6;
147#endif
148
149 ENTER_CRITICAL(flags);
150 old_ctx = read_c0_entryhi();
151 write_c0_entryhi(vaddr & (PAGE_MASK << 1));
152 write_c0_entrylo0(entrylo);
153 write_c0_entrylo1(entrylo);
154#ifdef CONFIG_MIPS_MT_SMTC
155 set_pte(kmap_coherent_pte - (FIX_CMAP_END - idx), pte);
156 /* preload TLB instead of local_flush_tlb_one() */
157 mtc0_tlbw_hazard();
158 tlb_probe();
159 tlb_probe_hazard();
160 tlbidx = read_c0_index();
161 mtc0_tlbw_hazard();
162 if (tlbidx < 0)
163 tlb_write_random();
164 else
165 tlb_write_indexed();
166#else
167 tlbidx = read_c0_wired();
168 write_c0_wired(tlbidx + 1);
169 write_c0_index(tlbidx);
170 mtc0_tlbw_hazard();
171 tlb_write_indexed();
172#endif
173 tlbw_use_hazard();
174 write_c0_entryhi(old_ctx);
175 EXIT_CRITICAL(flags);
176
177 return (void*) vaddr;
178}
179
180#define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
181
182static inline void kunmap_coherent(struct page *page)
183{
184#ifndef CONFIG_MIPS_MT_SMTC
185 unsigned int wired;
186 unsigned long flags, old_ctx;
187
188 ENTER_CRITICAL(flags);
189 old_ctx = read_c0_entryhi();
190 wired = read_c0_wired() - 1;
191 write_c0_wired(wired);
192 write_c0_index(wired);
193 write_c0_entryhi(UNIQUE_ENTRYHI(wired));
194 write_c0_entrylo0(0);
195 write_c0_entrylo1(0);
196 mtc0_tlbw_hazard();
197 tlb_write_indexed();
198 tlbw_use_hazard();
199 write_c0_entryhi(old_ctx);
200 EXIT_CRITICAL(flags);
201#endif
202 dec_preempt_count();
203 preempt_check_resched();
204}
205
206void copy_to_user_page(struct vm_area_struct *vma,
207 struct page *page, unsigned long vaddr, void *dst, const void *src,
208 unsigned long len)
209{
210 if (cpu_has_dc_aliases) {
211 void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
212 memcpy(vto, src, len);
213 kunmap_coherent(page);
214 } else
215 memcpy(dst, src, len);
216 if ((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc)
217 flush_cache_page(vma, vaddr, page_to_pfn(page));
218}
219
220EXPORT_SYMBOL(copy_to_user_page);
221
222void copy_from_user_page(struct vm_area_struct *vma,
223 struct page *page, unsigned long vaddr, void *dst, const void *src,
224 unsigned long len)
225{
226 if (cpu_has_dc_aliases) {
227 void *vfrom =
228 kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
229 memcpy(dst, vfrom, len);
230 kunmap_coherent(page);
231 } else
232 memcpy(dst, src, len);
233}
234
235EXPORT_SYMBOL(copy_from_user_page);
236
237
238#ifdef CONFIG_HIGHMEM
239pte_t *kmap_pte;
240pgprot_t kmap_prot;
241
90static void __init kmap_init(void) 242static void __init kmap_init(void)
91{ 243{
92 unsigned long kmap_vstart; 244 unsigned long kmap_vstart;
@@ -97,11 +249,12 @@ static void __init kmap_init(void)
97 249
98 kmap_prot = PAGE_KERNEL; 250 kmap_prot = PAGE_KERNEL;
99} 251}
252#endif /* CONFIG_HIGHMEM */
100 253
101#ifdef CONFIG_32BIT
102void __init fixrange_init(unsigned long start, unsigned long end, 254void __init fixrange_init(unsigned long start, unsigned long end,
103 pgd_t *pgd_base) 255 pgd_t *pgd_base)
104{ 256{
257#if defined(CONFIG_HIGHMEM) || defined(CONFIG_MIPS_MT_SMTC)
105 pgd_t *pgd; 258 pgd_t *pgd;
106 pud_t *pud; 259 pud_t *pud;
107 pmd_t *pmd; 260 pmd_t *pmd;
@@ -122,7 +275,7 @@ void __init fixrange_init(unsigned long start, unsigned long end,
122 for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) { 275 for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) {
123 if (pmd_none(*pmd)) { 276 if (pmd_none(*pmd)) {
124 pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); 277 pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
125 set_pmd(pmd, __pmd(pte)); 278 set_pmd(pmd, __pmd((unsigned long)pte));
126 if (pte != pte_offset_kernel(pmd, 0)) 279 if (pte != pte_offset_kernel(pmd, 0))
127 BUG(); 280 BUG();
128 } 281 }
@@ -132,9 +285,8 @@ void __init fixrange_init(unsigned long start, unsigned long end,
132 } 285 }
133 j = 0; 286 j = 0;
134 } 287 }
288#endif
135} 289}
136#endif /* CONFIG_32BIT */
137#endif /* CONFIG_HIGHMEM */
138 290
139#ifndef CONFIG_NEED_MULTIPLE_NODES 291#ifndef CONFIG_NEED_MULTIPLE_NODES
140extern void pagetable_init(void); 292extern void pagetable_init(void);
@@ -175,6 +327,7 @@ void __init paging_init(void)
175#ifdef CONFIG_HIGHMEM 327#ifdef CONFIG_HIGHMEM
176 kmap_init(); 328 kmap_init();
177#endif 329#endif
330 kmap_coherent_init();
178 331
179 max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; 332 max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
180 low = max_low_pfn; 333 low = max_low_pfn;
@@ -290,15 +443,18 @@ void __init mem_init(void)
290} 443}
291#endif /* !CONFIG_NEED_MULTIPLE_NODES */ 444#endif /* !CONFIG_NEED_MULTIPLE_NODES */
292 445
293void free_init_pages(char *what, unsigned long begin, unsigned long end) 446static void free_init_pages(char *what, unsigned long begin, unsigned long end)
294{ 447{
295 unsigned long addr; 448 unsigned long pfn;
449
450 for (pfn = PFN_UP(begin); pfn < PFN_DOWN(end); pfn++) {
451 struct page *page = pfn_to_page(pfn);
452 void *addr = phys_to_virt(PFN_PHYS(pfn));
296 453
297 for (addr = begin; addr < end; addr += PAGE_SIZE) { 454 ClearPageReserved(page);
298 ClearPageReserved(virt_to_page(addr)); 455 init_page_count(page);
299 init_page_count(virt_to_page(addr)); 456 memset(addr, POISON_FREE_INITMEM, PAGE_SIZE);
300 memset((void *)addr, 0xcc, PAGE_SIZE); 457 __free_page(page);
301 free_page(addr);
302 totalram_pages++; 458 totalram_pages++;
303 } 459 }
304 printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10); 460 printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10);
@@ -307,12 +463,9 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
307#ifdef CONFIG_BLK_DEV_INITRD 463#ifdef CONFIG_BLK_DEV_INITRD
308void free_initrd_mem(unsigned long start, unsigned long end) 464void free_initrd_mem(unsigned long start, unsigned long end)
309{ 465{
310#ifdef CONFIG_64BIT 466 free_init_pages("initrd memory",
311 /* Switch from KSEG0 to XKPHYS addresses */ 467 virt_to_phys((void *)start),
312 start = (unsigned long)phys_to_virt(CPHYSADDR(start)); 468 virt_to_phys((void *)end));
313 end = (unsigned long)phys_to_virt(CPHYSADDR(end));
314#endif
315 free_init_pages("initrd memory", start, end);
316} 469}
317#endif 470#endif
318 471
@@ -320,17 +473,13 @@ extern unsigned long prom_free_prom_memory(void);
320 473
321void free_initmem(void) 474void free_initmem(void)
322{ 475{
323 unsigned long start, end, freed; 476 unsigned long freed;
324 477
325 freed = prom_free_prom_memory(); 478 freed = prom_free_prom_memory();
326 if (freed) 479 if (freed)
327 printk(KERN_INFO "Freeing firmware memory: %ldk freed\n",freed); 480 printk(KERN_INFO "Freeing firmware memory: %ldk freed\n",freed);
328 481
329 start = (unsigned long)(&__init_begin); 482 free_init_pages("unused kernel memory",
330 end = (unsigned long)(&__init_end); 483 __pa_symbol(&__init_begin),
331#ifdef CONFIG_64BIT 484 __pa_symbol(&__init_end));
332 start = PAGE_OFFSET | CPHYSADDR(start);
333 end = PAGE_OFFSET | CPHYSADDR(end);
334#endif
335 free_init_pages("unused kernel memory", start, end);
336} 485}
diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c
index 3101d1db559..cea7d0ea36e 100644
--- a/arch/mips/mm/ioremap.c
+++ b/arch/mips/mm/ioremap.c
@@ -176,7 +176,7 @@ void __iomem * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags)
176 176
177#define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1) 177#define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1)
178 178
179void __iounmap(volatile void __iomem *addr) 179void __iounmap(const volatile void __iomem *addr)
180{ 180{
181 struct vm_struct *p; 181 struct vm_struct *p;
182 182
diff --git a/arch/mips/mm/pg-r4k.c b/arch/mips/mm/pg-r4k.c
index b7c749232ff..d41fc5885e8 100644
--- a/arch/mips/mm/pg-r4k.c
+++ b/arch/mips/mm/pg-r4k.c
@@ -270,6 +270,20 @@ static inline void build_addiu_a2_a0(unsigned long offset)
270 emit_instruction(mi); 270 emit_instruction(mi);
271} 271}
272 272
273static inline void build_addiu_a2(unsigned long offset)
274{
275 union mips_instruction mi;
276
277 BUG_ON(offset > 0x7fff);
278
279 mi.i_format.opcode = cpu_has_64bit_gp_regs ? daddiu_op : addiu_op;
280 mi.i_format.rs = 6; /* $a2 */
281 mi.i_format.rt = 6; /* $a2 */
282 mi.i_format.simmediate = offset;
283
284 emit_instruction(mi);
285}
286
273static inline void build_addiu_a1(unsigned long offset) 287static inline void build_addiu_a1(unsigned long offset)
274{ 288{
275 union mips_instruction mi; 289 union mips_instruction mi;
@@ -333,6 +347,7 @@ static inline void build_jr_ra(void)
333void __init build_clear_page(void) 347void __init build_clear_page(void)
334{ 348{
335 unsigned int loop_start; 349 unsigned int loop_start;
350 unsigned long off;
336 351
337 epc = (unsigned int *) &clear_page_array; 352 epc = (unsigned int *) &clear_page_array;
338 instruction_pending = 0; 353 instruction_pending = 0;
@@ -369,7 +384,12 @@ void __init build_clear_page(void)
369 } 384 }
370 } 385 }
371 386
372 build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_clear : 0)); 387 off = PAGE_SIZE - (cpu_has_prefetch ? pref_offset_clear : 0);
388 if (off > 0x7fff) {
389 build_addiu_a2_a0(off >> 1);
390 build_addiu_a2(off >> 1);
391 } else
392 build_addiu_a2_a0(off);
373 393
374 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) 394 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
375 build_insn_word(0x3c01a000); /* lui $at, 0xa000 */ 395 build_insn_word(0x3c01a000); /* lui $at, 0xa000 */
@@ -420,12 +440,18 @@ dest = label();
420void __init build_copy_page(void) 440void __init build_copy_page(void)
421{ 441{
422 unsigned int loop_start; 442 unsigned int loop_start;
443 unsigned long off;
423 444
424 epc = (unsigned int *) &copy_page_array; 445 epc = (unsigned int *) &copy_page_array;
425 store_offset = load_offset = 0; 446 store_offset = load_offset = 0;
426 instruction_pending = 0; 447 instruction_pending = 0;
427 448
428 build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_copy : 0)); 449 off = PAGE_SIZE - (cpu_has_prefetch ? pref_offset_copy : 0);
450 if (off > 0x7fff) {
451 build_addiu_a2_a0(off >> 1);
452 build_addiu_a2(off >> 1);
453 } else
454 build_addiu_a2_a0(off);
429 455
430 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) 456 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
431 build_insn_word(0x3c01a000); /* lui $at, 0xa000 */ 457 build_insn_word(0x3c01a000); /* lui $at, 0xa000 */
diff --git a/arch/mips/mm/pgtable-32.c b/arch/mips/mm/pgtable-32.c
index 4bdaa05f485..4a61e624b0e 100644
--- a/arch/mips/mm/pgtable-32.c
+++ b/arch/mips/mm/pgtable-32.c
@@ -31,9 +31,10 @@ void pgd_init(unsigned long page)
31 31
32void __init pagetable_init(void) 32void __init pagetable_init(void)
33{ 33{
34#ifdef CONFIG_HIGHMEM
35 unsigned long vaddr; 34 unsigned long vaddr;
36 pgd_t *pgd, *pgd_base; 35 pgd_t *pgd_base;
36#ifdef CONFIG_HIGHMEM
37 pgd_t *pgd;
37 pud_t *pud; 38 pud_t *pud;
38 pmd_t *pmd; 39 pmd_t *pmd;
39 pte_t *pte; 40 pte_t *pte;
@@ -44,7 +45,6 @@ void __init pagetable_init(void)
44 pgd_init((unsigned long)swapper_pg_dir 45 pgd_init((unsigned long)swapper_pg_dir
45 + sizeof(pgd_t) * USER_PTRS_PER_PGD); 46 + sizeof(pgd_t) * USER_PTRS_PER_PGD);
46 47
47#ifdef CONFIG_HIGHMEM
48 pgd_base = swapper_pg_dir; 48 pgd_base = swapper_pg_dir;
49 49
50 /* 50 /*
@@ -53,6 +53,7 @@ void __init pagetable_init(void)
53 vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; 53 vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
54 fixrange_init(vaddr, 0, pgd_base); 54 fixrange_init(vaddr, 0, pgd_base);
55 55
56#ifdef CONFIG_HIGHMEM
56 /* 57 /*
57 * Permanent kmaps: 58 * Permanent kmaps:
58 */ 59 */
diff --git a/arch/mips/mm/pgtable-64.c b/arch/mips/mm/pgtable-64.c
index 44b5e97fff6..c46eb651bf0 100644
--- a/arch/mips/mm/pgtable-64.c
+++ b/arch/mips/mm/pgtable-64.c
@@ -8,6 +8,7 @@
8 */ 8 */
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/mm.h> 10#include <linux/mm.h>
11#include <asm/fixmap.h>
11#include <asm/pgtable.h> 12#include <asm/pgtable.h>
12 13
13void pgd_init(unsigned long page) 14void pgd_init(unsigned long page)
@@ -52,7 +53,20 @@ void pmd_init(unsigned long addr, unsigned long pagetable)
52 53
53void __init pagetable_init(void) 54void __init pagetable_init(void)
54{ 55{
56 unsigned long vaddr;
57 pgd_t *pgd_base;
58
55 /* Initialize the entire pgd. */ 59 /* Initialize the entire pgd. */
56 pgd_init((unsigned long)swapper_pg_dir); 60 pgd_init((unsigned long)swapper_pg_dir);
61#ifdef MODULE_START
62 pgd_init((unsigned long)module_pg_dir);
63#endif
57 pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table); 64 pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table);
65
66 pgd_base = swapper_pg_dir;
67 /*
68 * Fixed mappings:
69 */
70 vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
71 fixrange_init(vaddr, 0, pgd_base);
58} 72}
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 6f8b25cfa6f..492c518e7ba 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -102,7 +102,7 @@ enum opcode {
102 insn_addu, insn_addiu, insn_and, insn_andi, insn_beq, 102 insn_addu, insn_addiu, insn_and, insn_andi, insn_beq,
103 insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, 103 insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl,
104 insn_bne, insn_daddu, insn_daddiu, insn_dmfc0, insn_dmtc0, 104 insn_bne, insn_daddu, insn_daddiu, insn_dmfc0, insn_dmtc0,
105 insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, 105 insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32,
106 insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld, 106 insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld,
107 insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, insn_mtc0, 107 insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, insn_mtc0,
108 insn_ori, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll, 108 insn_ori, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll,
@@ -145,6 +145,7 @@ static __initdata struct insn insn_table[] = {
145 { insn_dsll32, M(spec_op,0,0,0,0,dsll32_op), RT | RD | RE }, 145 { insn_dsll32, M(spec_op,0,0,0,0,dsll32_op), RT | RD | RE },
146 { insn_dsra, M(spec_op,0,0,0,0,dsra_op), RT | RD | RE }, 146 { insn_dsra, M(spec_op,0,0,0,0,dsra_op), RT | RD | RE },
147 { insn_dsrl, M(spec_op,0,0,0,0,dsrl_op), RT | RD | RE }, 147 { insn_dsrl, M(spec_op,0,0,0,0,dsrl_op), RT | RD | RE },
148 { insn_dsrl32, M(spec_op,0,0,0,0,dsrl32_op), RT | RD | RE },
148 { insn_dsubu, M(spec_op,0,0,0,0,dsubu_op), RS | RT | RD }, 149 { insn_dsubu, M(spec_op,0,0,0,0,dsubu_op), RS | RT | RD },
149 { insn_eret, M(cop0_op,cop_op,0,0,0,eret_op), 0 }, 150 { insn_eret, M(cop0_op,cop_op,0,0,0,eret_op), 0 },
150 { insn_j, M(j_op,0,0,0,0,0), JIMM }, 151 { insn_j, M(j_op,0,0,0,0,0), JIMM },
@@ -385,6 +386,7 @@ I_u2u1u3(_dsll);
385I_u2u1u3(_dsll32); 386I_u2u1u3(_dsll32);
386I_u2u1u3(_dsra); 387I_u2u1u3(_dsra);
387I_u2u1u3(_dsrl); 388I_u2u1u3(_dsrl);
389I_u2u1u3(_dsrl32);
388I_u3u1u2(_dsubu); 390I_u3u1u2(_dsubu);
389I_0(_eret); 391I_0(_eret);
390I_u1(_j); 392I_u1(_j);
@@ -421,6 +423,9 @@ enum label_id {
421 label_invalid, 423 label_invalid,
422 label_second_part, 424 label_second_part,
423 label_leave, 425 label_leave,
426#ifdef MODULE_START
427 label_module_alloc,
428#endif
424 label_vmalloc, 429 label_vmalloc,
425 label_vmalloc_done, 430 label_vmalloc_done,
426 label_tlbw_hazard, 431 label_tlbw_hazard,
@@ -453,6 +458,9 @@ static __init void build_label(struct label **lab, u32 *addr,
453 458
454L_LA(_second_part) 459L_LA(_second_part)
455L_LA(_leave) 460L_LA(_leave)
461#ifdef MODULE_START
462L_LA(_module_alloc)
463#endif
456L_LA(_vmalloc) 464L_LA(_vmalloc)
457L_LA(_vmalloc_done) 465L_LA(_vmalloc_done)
458L_LA(_tlbw_hazard) 466L_LA(_tlbw_hazard)
@@ -684,6 +692,13 @@ static void __init il_bgezl(u32 **p, struct reloc **r, unsigned int reg,
684 i_bgezl(p, reg, 0); 692 i_bgezl(p, reg, 0);
685} 693}
686 694
695static void __init __attribute__((unused))
696il_bgez(u32 **p, struct reloc **r, unsigned int reg, enum label_id l)
697{
698 r_mips_pc16(r, *p, l);
699 i_bgez(p, reg, 0);
700}
701
687/* The only general purpose registers allowed in TLB handlers. */ 702/* The only general purpose registers allowed in TLB handlers. */
688#define K0 26 703#define K0 26
689#define K1 27 704#define K1 27
@@ -968,7 +983,11 @@ build_get_pmde64(u32 **p, struct label **l, struct reloc **r,
968 * The vmalloc handling is not in the hotpath. 983 * The vmalloc handling is not in the hotpath.
969 */ 984 */
970 i_dmfc0(p, tmp, C0_BADVADDR); 985 i_dmfc0(p, tmp, C0_BADVADDR);
986#ifdef MODULE_START
987 il_bltz(p, r, tmp, label_module_alloc);
988#else
971 il_bltz(p, r, tmp, label_vmalloc); 989 il_bltz(p, r, tmp, label_vmalloc);
990#endif
972 /* No i_nop needed here, since the next insn doesn't touch TMP. */ 991 /* No i_nop needed here, since the next insn doesn't touch TMP. */
973 992
974#ifdef CONFIG_SMP 993#ifdef CONFIG_SMP
@@ -996,7 +1015,12 @@ build_get_pmde64(u32 **p, struct label **l, struct reloc **r,
996#endif 1015#endif
997 1016
998 l_vmalloc_done(l, *p); 1017 l_vmalloc_done(l, *p);
999 i_dsrl(p, tmp, tmp, PGDIR_SHIFT-3); /* get pgd offset in bytes */ 1018
1019 if (PGDIR_SHIFT - 3 < 32) /* get pgd offset in bytes */
1020 i_dsrl(p, tmp, tmp, PGDIR_SHIFT-3);
1021 else
1022 i_dsrl32(p, tmp, tmp, PGDIR_SHIFT - 3 - 32);
1023
1000 i_andi(p, tmp, tmp, (PTRS_PER_PGD - 1)<<3); 1024 i_andi(p, tmp, tmp, (PTRS_PER_PGD - 1)<<3);
1001 i_daddu(p, ptr, ptr, tmp); /* add in pgd offset */ 1025 i_daddu(p, ptr, ptr, tmp); /* add in pgd offset */
1002 i_dmfc0(p, tmp, C0_BADVADDR); /* get faulting address */ 1026 i_dmfc0(p, tmp, C0_BADVADDR); /* get faulting address */
@@ -1016,8 +1040,46 @@ build_get_pgd_vmalloc64(u32 **p, struct label **l, struct reloc **r,
1016{ 1040{
1017 long swpd = (long)swapper_pg_dir; 1041 long swpd = (long)swapper_pg_dir;
1018 1042
1043#ifdef MODULE_START
1044 long modd = (long)module_pg_dir;
1045
1046 l_module_alloc(l, *p);
1047 /*
1048 * Assumption:
1049 * VMALLOC_START >= 0xc000000000000000UL
1050 * MODULE_START >= 0xe000000000000000UL
1051 */
1052 i_SLL(p, ptr, bvaddr, 2);
1053 il_bgez(p, r, ptr, label_vmalloc);
1054
1055 if (in_compat_space_p(MODULE_START) && !rel_lo(MODULE_START)) {
1056 i_lui(p, ptr, rel_hi(MODULE_START)); /* delay slot */
1057 } else {
1058 /* unlikely configuration */
1059 i_nop(p); /* delay slot */
1060 i_LA(p, ptr, MODULE_START);
1061 }
1062 i_dsubu(p, bvaddr, bvaddr, ptr);
1063
1064 if (in_compat_space_p(modd) && !rel_lo(modd)) {
1065 il_b(p, r, label_vmalloc_done);
1066 i_lui(p, ptr, rel_hi(modd));
1067 } else {
1068 i_LA_mostly(p, ptr, modd);
1069 il_b(p, r, label_vmalloc_done);
1070 i_daddiu(p, ptr, ptr, rel_lo(modd));
1071 }
1072
1073 l_vmalloc(l, *p);
1074 if (in_compat_space_p(MODULE_START) && !rel_lo(MODULE_START) &&
1075 MODULE_START << 32 == VMALLOC_START)
1076 i_dsll32(p, ptr, ptr, 0); /* typical case */
1077 else
1078 i_LA(p, ptr, VMALLOC_START);
1079#else
1019 l_vmalloc(l, *p); 1080 l_vmalloc(l, *p);
1020 i_LA(p, ptr, VMALLOC_START); 1081 i_LA(p, ptr, VMALLOC_START);
1082#endif
1021 i_dsubu(p, bvaddr, bvaddr, ptr); 1083 i_dsubu(p, bvaddr, bvaddr, ptr);
1022 1084
1023 if (in_compat_space_p(swpd) && !rel_lo(swpd)) { 1085 if (in_compat_space_p(swpd) && !rel_lo(swpd)) {
@@ -1073,7 +1135,7 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr)
1073 1135
1074static __init void build_adjust_context(u32 **p, unsigned int ctx) 1136static __init void build_adjust_context(u32 **p, unsigned int ctx)
1075{ 1137{
1076 unsigned int shift = 4 - (PTE_T_LOG2 + 1); 1138 unsigned int shift = 4 - (PTE_T_LOG2 + 1) + PAGE_SHIFT - 12;
1077 unsigned int mask = (PTRS_PER_PTE / 2 - 1) << (PTE_T_LOG2 + 1); 1139 unsigned int mask = (PTRS_PER_PTE / 2 - 1) << (PTE_T_LOG2 + 1);
1078 1140
1079 switch (current_cpu_data.cputype) { 1141 switch (current_cpu_data.cputype) {
diff --git a/arch/mips/momentum/ocelot_3/Makefile b/arch/mips/momentum/ocelot_3/Makefile
index 8bcea64dd27..d5a090a85a1 100644
--- a/arch/mips/momentum/ocelot_3/Makefile
+++ b/arch/mips/momentum/ocelot_3/Makefile
@@ -5,4 +5,4 @@
5# removes any old dependencies. DON'T put your own dependencies here 5# removes any old dependencies. DON'T put your own dependencies here
6# unless it's something special (ie not a .c file). 6# unless it's something special (ie not a .c file).
7# 7#
8obj-y += irq.o prom.o reset.o setup.o 8obj-y += irq.o platform.o prom.o reset.o setup.o
diff --git a/arch/mips/momentum/ocelot_3/ocelot_3_fpga.h b/arch/mips/momentum/ocelot_3/ocelot_3_fpga.h
index 227e429fe72..5710a9029f1 100644
--- a/arch/mips/momentum/ocelot_3/ocelot_3_fpga.h
+++ b/arch/mips/momentum/ocelot_3/ocelot_3_fpga.h
@@ -51,7 +51,9 @@
51 51
52extern unsigned long ocelot_fpga_base; 52extern unsigned long ocelot_fpga_base;
53 53
54#define OCELOT_FPGA_WRITE(x, y) writeb(x, ocelot_fpga_base + OCELOT_3_REG_##y) 54#define __FPGA_REG_TO_ADDR(reg) \
55#define OCELOT_FPGA_READ(x) readb(ocelot_fpga_base + OCELOT_3_REG_##x) 55 ((void *) ocelot_fpga_base + OCELOT_3_REG_##reg)
56#define OCELOT_FPGA_WRITE(x, reg) writeb(x, __FPGA_REG_TO_ADDR(reg))
57#define OCELOT_FPGA_READ(reg) readb(__FPGA_REG_TO_ADDR(reg))
56 58
57#endif 59#endif
diff --git a/arch/mips/momentum/ocelot_3/platform.c b/arch/mips/momentum/ocelot_3/platform.c
new file mode 100644
index 00000000000..eefe5841fbb
--- /dev/null
+++ b/arch/mips/momentum/ocelot_3/platform.c
@@ -0,0 +1,235 @@
1#include <linux/delay.h>
2#include <linux/if_ether.h>
3#include <linux/ioport.h>
4#include <linux/mv643xx.h>
5#include <linux/platform_device.h>
6
7#include "ocelot_3_fpga.h"
8
9#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
10
11static struct resource mv643xx_eth_shared_resources[] = {
12 [0] = {
13 .name = "ethernet shared base",
14 .start = 0xf1000000 + MV643XX_ETH_SHARED_REGS,
15 .end = 0xf1000000 + MV643XX_ETH_SHARED_REGS +
16 MV643XX_ETH_SHARED_REGS_SIZE - 1,
17 .flags = IORESOURCE_MEM,
18 },
19};
20
21static struct platform_device mv643xx_eth_shared_device = {
22 .name = MV643XX_ETH_SHARED_NAME,
23 .id = 0,
24 .num_resources = ARRAY_SIZE(mv643xx_eth_shared_resources),
25 .resource = mv643xx_eth_shared_resources,
26};
27
28#define MV_SRAM_BASE 0xfe000000UL
29#define MV_SRAM_SIZE (256 * 1024)
30
31#define MV_SRAM_RXRING_SIZE (MV_SRAM_SIZE / 4)
32#define MV_SRAM_TXRING_SIZE (MV_SRAM_SIZE / 4)
33
34#define MV_SRAM_BASE_ETH0 MV_SRAM_BASE
35#define MV_SRAM_BASE_ETH1 (MV_SRAM_BASE + (MV_SRAM_SIZE / 2))
36
37#define MV64x60_IRQ_ETH_0 48
38#define MV64x60_IRQ_ETH_1 49
39#define MV64x60_IRQ_ETH_2 50
40
41#ifdef CONFIG_MV643XX_ETH_0
42
43static struct resource mv64x60_eth0_resources[] = {
44 [0] = {
45 .name = "eth0 irq",
46 .start = MV64x60_IRQ_ETH_0,
47 .end = MV64x60_IRQ_ETH_0,
48 .flags = IORESOURCE_IRQ,
49 },
50};
51
52static char eth0_mac_addr[ETH_ALEN];
53
54static struct mv643xx_eth_platform_data eth0_pd = {
55 .mac_addr = eth0_mac_addr,
56
57 .tx_sram_addr = MV_SRAM_BASE_ETH0,
58 .tx_sram_size = MV_SRAM_TXRING_SIZE,
59 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
60
61 .rx_sram_addr = MV_SRAM_BASE_ETH0 + MV_SRAM_TXRING_SIZE,
62 .rx_sram_size = MV_SRAM_RXRING_SIZE,
63 .rx_queue_size = MV_SRAM_RXRING_SIZE / 16,
64};
65
66static struct platform_device eth0_device = {
67 .name = MV643XX_ETH_NAME,
68 .id = 0,
69 .num_resources = ARRAY_SIZE(mv64x60_eth0_resources),
70 .resource = mv64x60_eth0_resources,
71 .dev = {
72 .platform_data = &eth0_pd,
73 },
74};
75#endif /* CONFIG_MV643XX_ETH_0 */
76
77#ifdef CONFIG_MV643XX_ETH_1
78
79static struct resource mv64x60_eth1_resources[] = {
80 [0] = {
81 .name = "eth1 irq",
82 .start = MV64x60_IRQ_ETH_1,
83 .end = MV64x60_IRQ_ETH_1,
84 .flags = IORESOURCE_IRQ,
85 },
86};
87
88static char eth1_mac_addr[ETH_ALEN];
89
90static struct mv643xx_eth_platform_data eth1_pd = {
91 .mac_addr = eth1_mac_addr,
92
93 .tx_sram_addr = MV_SRAM_BASE_ETH1,
94 .tx_sram_size = MV_SRAM_TXRING_SIZE,
95 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
96
97 .rx_sram_addr = MV_SRAM_BASE_ETH1 + MV_SRAM_TXRING_SIZE,
98 .rx_sram_size = MV_SRAM_RXRING_SIZE,
99 .rx_queue_size = MV_SRAM_RXRING_SIZE / 16,
100};
101
102static struct platform_device eth1_device = {
103 .name = MV643XX_ETH_NAME,
104 .id = 1,
105 .num_resources = ARRAY_SIZE(mv64x60_eth1_resources),
106 .resource = mv64x60_eth1_resources,
107 .dev = {
108 .platform_data = &eth1_pd,
109 },
110};
111#endif /* CONFIG_MV643XX_ETH_1 */
112
113#ifdef CONFIG_MV643XX_ETH_2
114
115static struct resource mv64x60_eth2_resources[] = {
116 [0] = {
117 .name = "eth2 irq",
118 .start = MV64x60_IRQ_ETH_2,
119 .end = MV64x60_IRQ_ETH_2,
120 .flags = IORESOURCE_IRQ,
121 },
122};
123
124static char eth2_mac_addr[ETH_ALEN];
125
126static struct mv643xx_eth_platform_data eth2_pd = {
127 .mac_addr = eth2_mac_addr,
128};
129
130static struct platform_device eth2_device = {
131 .name = MV643XX_ETH_NAME,
132 .id = 1,
133 .num_resources = ARRAY_SIZE(mv64x60_eth2_resources),
134 .resource = mv64x60_eth2_resources,
135 .dev = {
136 .platform_data = &eth2_pd,
137 },
138};
139#endif /* CONFIG_MV643XX_ETH_2 */
140
141static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
142 &mv643xx_eth_shared_device,
143#ifdef CONFIG_MV643XX_ETH_0
144 &eth0_device,
145#endif
146#ifdef CONFIG_MV643XX_ETH_1
147 &eth1_device,
148#endif
149#ifdef CONFIG_MV643XX_ETH_2
150 &eth2_device,
151#endif
152};
153
154static u8 __init exchange_bit(u8 val, u8 cs)
155{
156 /* place the data */
157 OCELOT_FPGA_WRITE((val << 2) | cs, EEPROM_MODE);
158 udelay(1);
159
160 /* turn the clock on */
161 OCELOT_FPGA_WRITE((val << 2) | cs | 0x2, EEPROM_MODE);
162 udelay(1);
163
164 /* turn the clock off and read-strobe */
165 OCELOT_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);
166
167 /* return the data */
168 return (OCELOT_FPGA_READ(EEPROM_MODE) >> 3) & 0x1;
169}
170
171static void __init get_mac(char dest[6])
172{
173 u8 read_opcode[12] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
174 int i,j;
175
176 for (i = 0; i < 12; i++)
177 exchange_bit(read_opcode[i], 1);
178
179 for (j = 0; j < 6; j++) {
180 dest[j] = 0;
181 for (i = 0; i < 8; i++) {
182 dest[j] <<= 1;
183 dest[j] |= exchange_bit(0, 1);
184 }
185 }
186
187 /* turn off CS */
188 exchange_bit(0,0);
189}
190
191/*
192 * Copy and increment ethernet MAC address by a small value.
193 *
194 * This is useful for systems where the only one MAC address is stored in
195 * non-volatile memory for multiple ports.
196 */
197static inline void eth_mac_add(unsigned char *dst, unsigned char *src,
198 unsigned int add)
199{
200 int i;
201
202 BUG_ON(add >= 256);
203
204 for (i = ETH_ALEN; i >= 0; i--) {
205 dst[i] = src[i] + add;
206 add = dst[i] < src[i]; /* compute carry */
207 }
208
209 WARN_ON(add);
210}
211
212static int __init mv643xx_eth_add_pds(void)
213{
214 unsigned char mac[ETH_ALEN];
215 int ret;
216
217 get_mac(mac);
218#ifdef CONFIG_MV643XX_ETH_0
219 eth_mac_add(eth1_mac_addr, mac, 0);
220#endif
221#ifdef CONFIG_MV643XX_ETH_1
222 eth_mac_add(eth1_mac_addr, mac, 1);
223#endif
224#ifdef CONFIG_MV643XX_ETH_2
225 eth_mac_add(eth2_mac_addr, mac, 2);
226#endif
227 ret = platform_add_devices(mv643xx_eth_pd_devs,
228 ARRAY_SIZE(mv643xx_eth_pd_devs));
229
230 return ret;
231}
232
233device_initcall(mv643xx_eth_add_pds);
234
235#endif /* defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE) */
diff --git a/arch/mips/momentum/ocelot_3/prom.c b/arch/mips/momentum/ocelot_3/prom.c
index 296d945bc24..6ce9b7fdb82 100644
--- a/arch/mips/momentum/ocelot_3/prom.c
+++ b/arch/mips/momentum/ocelot_3/prom.c
@@ -34,64 +34,11 @@ struct callvectors* debug_vectors;
34extern unsigned long marvell_base; 34extern unsigned long marvell_base;
35extern unsigned long cpu_clock; 35extern unsigned long cpu_clock;
36 36
37#ifdef CONFIG_MV643XX_ETH
38extern unsigned char prom_mac_addr_base[6];
39#endif
40
41const char *get_system_type(void) 37const char *get_system_type(void)
42{ 38{
43 return "Momentum Ocelot-3"; 39 return "Momentum Ocelot-3";
44} 40}
45 41
46#ifdef CONFIG_MV643XX_ETH
47void burn_clocks(void)
48{
49 int i;
50
51 /* this loop should burn at least 1us -- this should be plenty */
52 for (i = 0; i < 0x10000; i++)
53 ;
54}
55
56u8 exchange_bit(u8 val, u8 cs)
57{
58 /* place the data */
59 OCELOT_FPGA_WRITE((val << 2) | cs, EEPROM_MODE);
60 burn_clocks();
61
62 /* turn the clock on */
63 OCELOT_FPGA_WRITE((val << 2) | cs | 0x2, EEPROM_MODE);
64 burn_clocks();
65
66 /* turn the clock off and read-strobe */
67 OCELOT_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);
68
69 /* return the data */
70 return ((OCELOT_FPGA_READ(EEPROM_MODE) >> 3) & 0x1);
71}
72
73void get_mac(char dest[6])
74{
75 u8 read_opcode[12] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
76 int i,j;
77
78 for (i = 0; i < 12; i++)
79 exchange_bit(read_opcode[i], 1);
80
81 for (j = 0; j < 6; j++) {
82 dest[j] = 0;
83 for (i = 0; i < 8; i++) {
84 dest[j] <<= 1;
85 dest[j] |= exchange_bit(0, 1);
86 }
87 }
88
89 /* turn off CS */
90 exchange_bit(0,0);
91}
92#endif
93
94
95#ifdef CONFIG_64BIT 42#ifdef CONFIG_64BIT
96 43
97unsigned long signext(unsigned long addr) 44unsigned long signext(unsigned long addr)
@@ -228,11 +175,6 @@ void __init prom_init(void)
228 mips_machgroup = MACH_GROUP_MOMENCO; 175 mips_machgroup = MACH_GROUP_MOMENCO;
229 mips_machtype = MACH_MOMENCO_OCELOT_3; 176 mips_machtype = MACH_MOMENCO_OCELOT_3;
230 177
231#ifdef CONFIG_MV643XX_ETH
232 /* get the base MAC address for on-board ethernet ports */
233 get_mac(prom_mac_addr_base);
234#endif
235
236#ifndef CONFIG_64BIT 178#ifndef CONFIG_64BIT
237 debug_vectors->printf("Booting Linux kernel...\n"); 179 debug_vectors->printf("Booting Linux kernel...\n");
238#endif 180#endif
diff --git a/arch/mips/momentum/ocelot_3/setup.c b/arch/mips/momentum/ocelot_3/setup.c
index 7d74f8c5412..ff0829f8111 100644
--- a/arch/mips/momentum/ocelot_3/setup.c
+++ b/arch/mips/momentum/ocelot_3/setup.c
@@ -4,7 +4,7 @@
4 * BRIEF MODULE DESCRIPTION 4 * BRIEF MODULE DESCRIPTION
5 * Momentum Computer Ocelot-3 board dependent boot routines 5 * Momentum Computer Ocelot-3 board dependent boot routines
6 * 6 *
7 * Copyright (C) 1996, 1997, 01, 05 Ralf Baechle 7 * Copyright (C) 1996, 1997, 01, 05 - 06 Ralf Baechle
8 * Copyright (C) 2000 RidgeRun, Inc. 8 * Copyright (C) 2000 RidgeRun, Inc.
9 * Copyright (C) 2001 Red Hat, Inc. 9 * Copyright (C) 2001 Red Hat, Inc.
10 * Copyright (C) 2002 Momentum Computer 10 * Copyright (C) 2002 Momentum Computer
diff --git a/arch/mips/momentum/ocelot_c/Makefile b/arch/mips/momentum/ocelot_c/Makefile
index 94802b4db47..d69161aa167 100644
--- a/arch/mips/momentum/ocelot_c/Makefile
+++ b/arch/mips/momentum/ocelot_c/Makefile
@@ -2,7 +2,7 @@
2# Makefile for Momentum Computer's Ocelot-C and -CS boards. 2# Makefile for Momentum Computer's Ocelot-C and -CS boards.
3# 3#
4 4
5obj-y += cpci-irq.o irq.o prom.o reset.o \ 5obj-y += cpci-irq.o irq.o platform.o prom.o reset.o \
6 setup.o uart-irq.o 6 setup.o uart-irq.o
7 7
8obj-$(CONFIG_KGDB) += dbg_io.o 8obj-$(CONFIG_KGDB) += dbg_io.o
diff --git a/arch/mips/momentum/ocelot_c/cpci-irq.c b/arch/mips/momentum/ocelot_c/cpci-irq.c
index 47e3fa32b07..e5a4a0a8a7f 100644
--- a/arch/mips/momentum/ocelot_c/cpci-irq.c
+++ b/arch/mips/momentum/ocelot_c/cpci-irq.c
@@ -66,39 +66,6 @@ static inline void unmask_cpci_irq(unsigned int irq)
66} 66}
67 67
68/* 68/*
69 * Enables the IRQ in the FPGA
70 */
71static void enable_cpci_irq(unsigned int irq)
72{
73 unmask_cpci_irq(irq);
74}
75
76/*
77 * Initialize the IRQ in the FPGA
78 */
79static unsigned int startup_cpci_irq(unsigned int irq)
80{
81 unmask_cpci_irq(irq);
82 return 0;
83}
84
85/*
86 * Disables the IRQ in the FPGA
87 */
88static void disable_cpci_irq(unsigned int irq)
89{
90 mask_cpci_irq(irq);
91}
92
93/*
94 * Masks and ACKs an IRQ
95 */
96static void mask_and_ack_cpci_irq(unsigned int irq)
97{
98 mask_cpci_irq(irq);
99}
100
101/*
102 * End IRQ processing 69 * End IRQ processing
103 */ 70 */
104static void end_cpci_irq(unsigned int irq) 71static void end_cpci_irq(unsigned int irq)
@@ -125,15 +92,12 @@ void ll_cpci_irq(void)
125 do_IRQ(ls1bit8(irq_src) + CPCI_IRQ_BASE); 92 do_IRQ(ls1bit8(irq_src) + CPCI_IRQ_BASE);
126} 93}
127 94
128#define shutdown_cpci_irq disable_cpci_irq
129
130struct irq_chip cpci_irq_type = { 95struct irq_chip cpci_irq_type = {
131 .typename = "CPCI/FPGA", 96 .typename = "CPCI/FPGA",
132 .startup = startup_cpci_irq, 97 .ack = mask_cpci_irq,
133 .shutdown = shutdown_cpci_irq, 98 .mask = mask_cpci_irq,
134 .enable = enable_cpci_irq, 99 .mask_ack = mask_cpci_irq,
135 .disable = disable_cpci_irq, 100 .unmask = unmask_cpci_irq,
136 .ack = mask_and_ack_cpci_irq,
137 .end = end_cpci_irq, 101 .end = end_cpci_irq,
138}; 102};
139 103
@@ -141,11 +105,6 @@ void cpci_irq_init(void)
141{ 105{
142 int i; 106 int i;
143 107
144 /* Reset irq handlers pointers to NULL */ 108 for (i = CPCI_IRQ_BASE; i < (CPCI_IRQ_BASE + 8); i++)
145 for (i = CPCI_IRQ_BASE; i < (CPCI_IRQ_BASE + 8); i++) { 109 set_irq_chip_and_handler(i, &cpci_irq_type, handle_level_irq);
146 irq_desc[i].status = IRQ_DISABLED;
147 irq_desc[i].action = 0;
148 irq_desc[i].depth = 2;
149 irq_desc[i].chip = &cpci_irq_type;
150 }
151} 110}
diff --git a/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h b/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h
index 7228cd19e5e..f0f5581dcb5 100644
--- a/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h
+++ b/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h
@@ -53,7 +53,9 @@
53#define OCELOT_C_REG_INTSET 0xe 53#define OCELOT_C_REG_INTSET 0xe
54#define OCELOT_C_REG_INTCLR 0xf 54#define OCELOT_C_REG_INTCLR 0xf
55 55
56#define OCELOT_FPGA_WRITE(x, y) writeb(x, OCELOT_C_CS0_ADDR + OCELOT_C_REG_##y) 56#define __FPGA_REG_TO_ADDR(reg) \
57#define OCELOT_FPGA_READ(x) readb(OCELOT_C_CS0_ADDR + OCELOT_C_REG_##x) 57 ((void *) OCELOT_C_CS0_ADDR + OCELOT_C_REG_##reg)
58#define OCELOT_FPGA_WRITE(x, reg) writeb(x, __FPGA_REG_TO_ADDR(reg))
59#define OCELOT_FPGA_READ(reg) readb(__FPGA_REG_TO_ADDR(reg))
58 60
59#endif 61#endif
diff --git a/arch/mips/momentum/ocelot_c/platform.c b/arch/mips/momentum/ocelot_c/platform.c
new file mode 100644
index 00000000000..6c495b2f156
--- /dev/null
+++ b/arch/mips/momentum/ocelot_c/platform.c
@@ -0,0 +1,201 @@
1#include <linux/delay.h>
2#include <linux/if_ether.h>
3#include <linux/ioport.h>
4#include <linux/mv643xx.h>
5#include <linux/platform_device.h>
6
7#include "ocelot_c_fpga.h"
8
9#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
10
11static struct resource mv643xx_eth_shared_resources[] = {
12 [0] = {
13 .name = "ethernet shared base",
14 .start = 0xf1000000 + MV643XX_ETH_SHARED_REGS,
15 .end = 0xf1000000 + MV643XX_ETH_SHARED_REGS +
16 MV643XX_ETH_SHARED_REGS_SIZE - 1,
17 .flags = IORESOURCE_MEM,
18 },
19};
20
21static struct platform_device mv643xx_eth_shared_device = {
22 .name = MV643XX_ETH_SHARED_NAME,
23 .id = 0,
24 .num_resources = ARRAY_SIZE(mv643xx_eth_shared_resources),
25 .resource = mv643xx_eth_shared_resources,
26};
27
28#define MV_SRAM_BASE 0xfe000000UL
29#define MV_SRAM_SIZE (256 * 1024)
30
31#define MV_SRAM_RXRING_SIZE (MV_SRAM_SIZE / 4)
32#define MV_SRAM_TXRING_SIZE (MV_SRAM_SIZE / 4)
33
34#define MV_SRAM_BASE_ETH0 MV_SRAM_BASE
35#define MV_SRAM_BASE_ETH1 (MV_SRAM_BASE + (MV_SRAM_SIZE / 2))
36
37#define MV64x60_IRQ_ETH_0 48
38#define MV64x60_IRQ_ETH_1 49
39
40#ifdef CONFIG_MV643XX_ETH_0
41
42static struct resource mv64x60_eth0_resources[] = {
43 [0] = {
44 .name = "eth0 irq",
45 .start = MV64x60_IRQ_ETH_0,
46 .end = MV64x60_IRQ_ETH_0,
47 .flags = IORESOURCE_IRQ,
48 },
49};
50
51static char eth0_mac_addr[ETH_ALEN];
52
53static struct mv643xx_eth_platform_data eth0_pd = {
54 .mac_addr = eth0_mac_addr,
55
56 .tx_sram_addr = MV_SRAM_BASE_ETH0,
57 .tx_sram_size = MV_SRAM_TXRING_SIZE,
58 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
59
60 .rx_sram_addr = MV_SRAM_BASE_ETH0 + MV_SRAM_TXRING_SIZE,
61 .rx_sram_size = MV_SRAM_RXRING_SIZE,
62 .rx_queue_size = MV_SRAM_RXRING_SIZE / 16,
63};
64
65static struct platform_device eth0_device = {
66 .name = MV643XX_ETH_NAME,
67 .id = 0,
68 .num_resources = ARRAY_SIZE(mv64x60_eth0_resources),
69 .resource = mv64x60_eth0_resources,
70 .dev = {
71 .platform_data = &eth0_pd,
72 },
73};
74#endif /* CONFIG_MV643XX_ETH_0 */
75
76#ifdef CONFIG_MV643XX_ETH_1
77
78static struct resource mv64x60_eth1_resources[] = {
79 [0] = {
80 .name = "eth1 irq",
81 .start = MV64x60_IRQ_ETH_1,
82 .end = MV64x60_IRQ_ETH_1,
83 .flags = IORESOURCE_IRQ,
84 },
85};
86
87static char eth1_mac_addr[ETH_ALEN];
88
89static struct mv643xx_eth_platform_data eth1_pd = {
90 .mac_addr = eth1_mac_addr,
91
92 .tx_sram_addr = MV_SRAM_BASE_ETH1,
93 .tx_sram_size = MV_SRAM_TXRING_SIZE,
94 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
95
96 .rx_sram_addr = MV_SRAM_BASE_ETH1 + MV_SRAM_TXRING_SIZE,
97 .rx_sram_size = MV_SRAM_RXRING_SIZE,
98 .rx_queue_size = MV_SRAM_RXRING_SIZE / 16,
99};
100
101static struct platform_device eth1_device = {
102 .name = MV643XX_ETH_NAME,
103 .id = 1,
104 .num_resources = ARRAY_SIZE(mv64x60_eth1_resources),
105 .resource = mv64x60_eth1_resources,
106 .dev = {
107 .platform_data = &eth1_pd,
108 },
109};
110#endif /* CONFIG_MV643XX_ETH_1 */
111
112static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
113 &mv643xx_eth_shared_device,
114#ifdef CONFIG_MV643XX_ETH_0
115 &eth0_device,
116#endif
117#ifdef CONFIG_MV643XX_ETH_1
118 &eth1_device,
119#endif
120 /* The third port is not wired up on the Ocelot C */
121};
122
123static u8 __init exchange_bit(u8 val, u8 cs)
124{
125 /* place the data */
126 OCELOT_FPGA_WRITE((val << 2) | cs, EEPROM_MODE);
127 udelay(1);
128
129 /* turn the clock on */
130 OCELOT_FPGA_WRITE((val << 2) | cs | 0x2, EEPROM_MODE);
131 udelay(1);
132
133 /* turn the clock off and read-strobe */
134 OCELOT_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);
135
136 /* return the data */
137 return (OCELOT_FPGA_READ(EEPROM_MODE) >> 3) & 0x1;
138}
139
140static void __init get_mac(char dest[6])
141{
142 u8 read_opcode[12] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
143 int i,j;
144
145 for (i = 0; i < 12; i++)
146 exchange_bit(read_opcode[i], 1);
147
148 for (j = 0; j < 6; j++) {
149 dest[j] = 0;
150 for (i = 0; i < 8; i++) {
151 dest[j] <<= 1;
152 dest[j] |= exchange_bit(0, 1);
153 }
154 }
155
156 /* turn off CS */
157 exchange_bit(0,0);
158}
159
160/*
161 * Copy and increment ethernet MAC address by a small value.
162 *
163 * This is useful for systems where the only one MAC address is stored in
164 * non-volatile memory for multiple ports.
165 */
166static inline void eth_mac_add(unsigned char *dst, unsigned char *src,
167 unsigned int add)
168{
169 int i;
170
171 BUG_ON(add >= 256);
172
173 for (i = ETH_ALEN; i >= 0; i--) {
174 dst[i] = src[i] + add;
175 add = dst[i] < src[i]; /* compute carry */
176 }
177
178 WARN_ON(add);
179}
180
181static int __init mv643xx_eth_add_pds(void)
182{
183 unsigned char mac[ETH_ALEN];
184 int ret;
185
186 get_mac(mac);
187#ifdef CONFIG_MV643XX_ETH_0
188 eth_mac_add(eth1_mac_addr, mac, 0);
189#endif
190#ifdef CONFIG_MV643XX_ETH_1
191 eth_mac_add(eth1_mac_addr, mac, 1);
192#endif
193 ret = platform_add_devices(mv643xx_eth_pd_devs,
194 ARRAY_SIZE(mv643xx_eth_pd_devs));
195
196 return ret;
197}
198
199device_initcall(mv643xx_eth_add_pds);
200
201#endif /* defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE) */
diff --git a/arch/mips/momentum/ocelot_c/prom.c b/arch/mips/momentum/ocelot_c/prom.c
index 4c50a147f42..d0b77e101d7 100644
--- a/arch/mips/momentum/ocelot_c/prom.c
+++ b/arch/mips/momentum/ocelot_c/prom.c
@@ -29,11 +29,7 @@
29struct callvectors* debug_vectors; 29struct callvectors* debug_vectors;
30 30
31extern unsigned long marvell_base; 31extern unsigned long marvell_base;
32extern unsigned long cpu_clock; 32extern unsigned int cpu_clock;
33
34#ifdef CONFIG_MV643XX_ETH
35extern unsigned char prom_mac_addr_base[6];
36#endif
37 33
38const char *get_system_type(void) 34const char *get_system_type(void)
39{ 35{
@@ -44,55 +40,6 @@ const char *get_system_type(void)
44#endif 40#endif
45} 41}
46 42
47#ifdef CONFIG_MV643XX_ETH
48static void burn_clocks(void)
49{
50 int i;
51
52 /* this loop should burn at least 1us -- this should be plenty */
53 for (i = 0; i < 0x10000; i++)
54 ;
55}
56
57static u8 exchange_bit(u8 val, u8 cs)
58{
59 /* place the data */
60 OCELOT_FPGA_WRITE((val << 2) | cs, EEPROM_MODE);
61 burn_clocks();
62
63 /* turn the clock on */
64 OCELOT_FPGA_WRITE((val << 2) | cs | 0x2, EEPROM_MODE);
65 burn_clocks();
66
67 /* turn the clock off and read-strobe */
68 OCELOT_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);
69
70 /* return the data */
71 return ((OCELOT_FPGA_READ(EEPROM_MODE) >> 3) & 0x1);
72}
73
74void get_mac(char dest[6])
75{
76 u8 read_opcode[12] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
77 int i,j;
78
79 for (i = 0; i < 12; i++)
80 exchange_bit(read_opcode[i], 1);
81
82 for (j = 0; j < 6; j++) {
83 dest[j] = 0;
84 for (i = 0; i < 8; i++) {
85 dest[j] <<= 1;
86 dest[j] |= exchange_bit(0, 1);
87 }
88 }
89
90 /* turn off CS */
91 exchange_bit(0,0);
92}
93#endif
94
95
96#ifdef CONFIG_64BIT 43#ifdef CONFIG_64BIT
97 44
98unsigned long signext(unsigned long addr) 45unsigned long signext(unsigned long addr)
@@ -226,11 +173,6 @@ void __init prom_init(void)
226 mips_machgroup = MACH_GROUP_MOMENCO; 173 mips_machgroup = MACH_GROUP_MOMENCO;
227 mips_machtype = MACH_MOMENCO_OCELOT_C; 174 mips_machtype = MACH_MOMENCO_OCELOT_C;
228 175
229#ifdef CONFIG_MV643XX_ETH
230 /* get the base MAC address for on-board ethernet ports */
231 get_mac(prom_mac_addr_base);
232#endif
233
234#ifndef CONFIG_64BIT 176#ifndef CONFIG_64BIT
235 debug_vectors->printf("Booting Linux kernel...\n"); 177 debug_vectors->printf("Booting Linux kernel...\n");
236#endif 178#endif
diff --git a/arch/mips/momentum/ocelot_c/setup.c b/arch/mips/momentum/ocelot_c/setup.c
index 9c0c462af65..0b6b2338cfb 100644
--- a/arch/mips/momentum/ocelot_c/setup.c
+++ b/arch/mips/momentum/ocelot_c/setup.c
@@ -69,8 +69,7 @@
69#include "ocelot_c_fpga.h" 69#include "ocelot_c_fpga.h"
70 70
71unsigned long marvell_base; 71unsigned long marvell_base;
72extern unsigned long mv64340_sram_base; 72unsigned int cpu_clock;
73unsigned long cpu_clock;
74 73
75/* These functions are used for rebooting or halting the machine*/ 74/* These functions are used for rebooting or halting the machine*/
76extern void momenco_ocelot_restart(char *command); 75extern void momenco_ocelot_restart(char *command);
@@ -119,7 +118,6 @@ void PMON_v2_setup(void)
119 add_wired_entry(ENTRYLO(0xfe000000), ENTRYLO(0xff000000), 0xfffffffffe000000, PM_16M); 118 add_wired_entry(ENTRYLO(0xfe000000), ENTRYLO(0xff000000), 0xfffffffffe000000, PM_16M);
120 119
121 marvell_base = 0xfffffffff4000000; 120 marvell_base = 0xfffffffff4000000;
122 mv64340_sram_base = 0xfffffffffe000000;
123#else 121#else
124 /* marvell and extra space */ 122 /* marvell and extra space */
125 add_wired_entry(ENTRYLO(0xf4000000), ENTRYLO(0xf4010000), 0xf4000000, PM_64K); 123 add_wired_entry(ENTRYLO(0xf4000000), ENTRYLO(0xf4010000), 0xf4000000, PM_64K);
@@ -129,7 +127,6 @@ void PMON_v2_setup(void)
129 add_wired_entry(ENTRYLO(0xfe000000), ENTRYLO(0xff000000), 0xfe000000, PM_16M); 127 add_wired_entry(ENTRYLO(0xfe000000), ENTRYLO(0xff000000), 0xfe000000, PM_16M);
130 128
131 marvell_base = 0xf4000000; 129 marvell_base = 0xf4000000;
132 mv64340_sram_base = 0xfe000000;
133#endif 130#endif
134} 131}
135 132
@@ -346,22 +343,20 @@ void __init plat_mem_setup(void)
346 } 343 }
347} 344}
348 345
349#ifndef CONFIG_64BIT 346/*
350/* This needs to be one of the first initcalls, because no I/O port access 347 * This needs to be one of the first initcalls, because no I/O port access
351 can work before this */ 348 * can work before this
349 */
352static int io_base_ioremap(void) 350static int io_base_ioremap(void)
353{ 351{
354 /* we're mapping PCI accesses from 0xc0000000 to 0xf0000000 */ 352 void __iomem * io_remap_range = ioremap(0xc0000000UL, 0x10000);
355 void *io_remap_range = ioremap(0xc0000000, 0x30000000);
356 353
357 if (!io_remap_range) { 354 if (!io_remap_range)
358 panic("Could not ioremap I/O port range"); 355 panic("Could not ioremap I/O port range");
359 } 356
360 printk("io_remap_range set at 0x%08x\n", (uint32_t)io_remap_range); 357 set_io_port_base((unsigned long) io_remap_range);
361 set_io_port_base(io_remap_range - 0xc0000000);
362 358
363 return 0; 359 return 0;
364} 360}
365 361
366module_init(io_base_ioremap); 362module_init(io_base_ioremap);
367#endif
diff --git a/arch/mips/momentum/ocelot_c/uart-irq.c b/arch/mips/momentum/ocelot_c/uart-irq.c
index 510257dc205..0029f0008de 100644
--- a/arch/mips/momentum/ocelot_c/uart-irq.c
+++ b/arch/mips/momentum/ocelot_c/uart-irq.c
@@ -60,39 +60,6 @@ static inline void unmask_uart_irq(unsigned int irq)
60} 60}
61 61
62/* 62/*
63 * Enables the IRQ in the FPGA
64 */
65static void enable_uart_irq(unsigned int irq)
66{
67 unmask_uart_irq(irq);
68}
69
70/*
71 * Initialize the IRQ in the FPGA
72 */
73static unsigned int startup_uart_irq(unsigned int irq)
74{
75 unmask_uart_irq(irq);
76 return 0;
77}
78
79/*
80 * Disables the IRQ in the FPGA
81 */
82static void disable_uart_irq(unsigned int irq)
83{
84 mask_uart_irq(irq);
85}
86
87/*
88 * Masks and ACKs an IRQ
89 */
90static void mask_and_ack_uart_irq(unsigned int irq)
91{
92 mask_uart_irq(irq);
93}
94
95/*
96 * End IRQ processing 63 * End IRQ processing
97 */ 64 */
98static void end_uart_irq(unsigned int irq) 65static void end_uart_irq(unsigned int irq)
@@ -118,28 +85,17 @@ void ll_uart_irq(void)
118 do_IRQ(ls1bit8(irq_src) + 74); 85 do_IRQ(ls1bit8(irq_src) + 74);
119} 86}
120 87
121#define shutdown_uart_irq disable_uart_irq
122
123struct irq_chip uart_irq_type = { 88struct irq_chip uart_irq_type = {
124 .typename = "UART/FPGA", 89 .typename = "UART/FPGA",
125 .startup = startup_uart_irq, 90 .ack = mask_uart_irq,
126 .shutdown = shutdown_uart_irq, 91 .mask = mask_uart_irq,
127 .enable = enable_uart_irq, 92 .mask_ack = mask_uart_irq,
128 .disable = disable_uart_irq, 93 .unmask = unmask_uart_irq,
129 .ack = mask_and_ack_uart_irq,
130 .end = end_uart_irq, 94 .end = end_uart_irq,
131}; 95};
132 96
133void uart_irq_init(void) 97void uart_irq_init(void)
134{ 98{
135 /* Reset irq handlers pointers to NULL */ 99 set_irq_chip_and_handler(80, &uart_irq_type, handle_level_irq);
136 irq_desc[80].status = IRQ_DISABLED; 100 set_irq_chip_and_handler(81, &uart_irq_type, handle_level_irq);
137 irq_desc[80].action = 0;
138 irq_desc[80].depth = 2;
139 irq_desc[80].chip = &uart_irq_type;
140
141 irq_desc[81].status = IRQ_DISABLED;
142 irq_desc[81].action = 0;
143 irq_desc[81].depth = 2;
144 irq_desc[81].chip = &uart_irq_type;
145} 101}
diff --git a/arch/mips/momentum/ocelot_g/gt-irq.c b/arch/mips/momentum/ocelot_g/gt-irq.c
index 7b5cc6648f7..e5576bd50fa 100644
--- a/arch/mips/momentum/ocelot_g/gt-irq.c
+++ b/arch/mips/momentum/ocelot_g/gt-irq.c
@@ -27,7 +27,7 @@ unsigned long bus_clock;
27 * be handled and ack'ed differently than other MIPS interrupts. 27 * be handled and ack'ed differently than other MIPS interrupts.
28 */ 28 */
29 29
30#if CURRENTLY_UNUSED 30#if 0
31 31
32struct tq_struct irq_handlers[MAX_CAUSE_REGS][MAX_CAUSE_REG_WIDTH]; 32struct tq_struct irq_handlers[MAX_CAUSE_REGS][MAX_CAUSE_REG_WIDTH];
33void hook_irq_handler(int int_cause, int bit_num, void *isr_ptr); 33void hook_irq_handler(int int_cause, int bit_num, void *isr_ptr);
@@ -95,7 +95,7 @@ int disable_galileo_irq(int int_cause, int bit_num)
95 return 0; 95 return 0;
96 return 1; 96 return 1;
97} 97}
98#endif /* UNUSED */ 98#endif /* 0 */
99 99
100/* 100/*
101 * Interrupt handler for interrupts coming from the Galileo chip via P0_INT#. 101 * Interrupt handler for interrupts coming from the Galileo chip via P0_INT#.
@@ -196,7 +196,7 @@ void gt64240_time_init(void)
196 196
197void gt64240_irq_init(void) 197void gt64240_irq_init(void)
198{ 198{
199#if CURRENTLY_UNUSED 199#if 0
200 int i, j; 200 int i, j;
201 201
202 /* Reset irq handlers pointers to NULL */ 202 /* Reset irq handlers pointers to NULL */
@@ -208,5 +208,5 @@ void gt64240_irq_init(void)
208 irq_handlers[i][j].data = NULL; 208 irq_handlers[i][j].data = NULL;
209 } 209 }
210 } 210 }
211#endif 211#endif /* 0 */
212} 212}
diff --git a/arch/mips/momentum/ocelot_g/ocelot_pld.h b/arch/mips/momentum/ocelot_g/ocelot_pld.h
index fcb8275e219..95e0534026d 100644
--- a/arch/mips/momentum/ocelot_g/ocelot_pld.h
+++ b/arch/mips/momentum/ocelot_g/ocelot_pld.h
@@ -23,8 +23,8 @@
23#define OCELOT_REG_INTSET (12) 23#define OCELOT_REG_INTSET (12)
24#define OCELOT_REG_INTCLR (13) 24#define OCELOT_REG_INTCLR (13)
25 25
26#define OCELOT_PLD_WRITE(x, y) writeb(x, OCELOT_CS0_ADDR + OCELOT_REG_##y) 26#define __PLD_REG_TO_ADDR(reg) ((void *) OCELOT_CS0_ADDR + OCELOT_REG_##reg)
27#define OCELOT_PLD_READ(x) readb(OCELOT_CS0_ADDR + OCELOT_REG_##x) 27#define OCELOT_PLD_WRITE(x, reg) writeb(x, __PLD_REG_TO_ADDR(reg))
28 28#define OCELOT_PLD_READ(reg) readb(__PLD_REG_TO_ADDR(reg))
29 29
30#endif /* __MOMENCO_OCELOT_PLD_H__ */ 30#endif /* __MOMENCO_OCELOT_PLD_H__ */
diff --git a/arch/mips/momentum/ocelot_g/setup.c b/arch/mips/momentum/ocelot_g/setup.c
index 56ec47039c1..d288f7b0184 100644
--- a/arch/mips/momentum/ocelot_g/setup.c
+++ b/arch/mips/momentum/ocelot_g/setup.c
@@ -57,6 +57,7 @@
57#include <asm/gt64240.h> 57#include <asm/gt64240.h>
58#include <asm/irq.h> 58#include <asm/irq.h>
59#include <asm/pci.h> 59#include <asm/pci.h>
60#include <asm/pgtable.h>
60#include <asm/processor.h> 61#include <asm/processor.h>
61#include <asm/reboot.h> 62#include <asm/reboot.h>
62#include <linux/bootmem.h> 63#include <linux/bootmem.h>
@@ -160,6 +161,10 @@ static void __init setup_l3cache(unsigned long size)
160 printk("Done\n"); 161 printk("Done\n");
161} 162}
162 163
164void __init plat_timer_setup(struct irqaction *irq)
165{
166}
167
163void __init plat_mem_setup(void) 168void __init plat_mem_setup(void)
164{ 169{
165 void (*l3func)(unsigned long) = (void *) KSEG1ADDR(setup_l3cache); 170 void (*l3func)(unsigned long) = (void *) KSEG1ADDR(setup_l3cache);
diff --git a/arch/mips/oprofile/Makefile b/arch/mips/oprofile/Makefile
index 0a50aad5bbe..bf3be6fcf7f 100644
--- a/arch/mips/oprofile/Makefile
+++ b/arch/mips/oprofile/Makefile
@@ -12,5 +12,6 @@ oprofile-y := $(DRIVER_OBJS) common.o
12 12
13oprofile-$(CONFIG_CPU_MIPS32) += op_model_mipsxx.o 13oprofile-$(CONFIG_CPU_MIPS32) += op_model_mipsxx.o
14oprofile-$(CONFIG_CPU_MIPS64) += op_model_mipsxx.o 14oprofile-$(CONFIG_CPU_MIPS64) += op_model_mipsxx.o
15oprofile-$(CONFIG_CPU_R10000) += op_model_mipsxx.o
15oprofile-$(CONFIG_CPU_SB1) += op_model_mipsxx.o 16oprofile-$(CONFIG_CPU_SB1) += op_model_mipsxx.o
16oprofile-$(CONFIG_CPU_RM9000) += op_model_rm9000.o 17oprofile-$(CONFIG_CPU_RM9000) += op_model_rm9000.o
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c
index 65eb55400d7..4e0a90b3916 100644
--- a/arch/mips/oprofile/common.c
+++ b/arch/mips/oprofile/common.c
@@ -83,6 +83,9 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
83 case CPU_74K: 83 case CPU_74K:
84 case CPU_SB1: 84 case CPU_SB1:
85 case CPU_SB1A: 85 case CPU_SB1A:
86 case CPU_R10000:
87 case CPU_R12000:
88 case CPU_R14000:
86 lmodel = &op_model_mipsxx_ops; 89 lmodel = &op_model_mipsxx_ops;
87 break; 90 break;
88 91
diff --git a/arch/mips/oprofile/op_impl.h b/arch/mips/oprofile/op_impl.h
index 354e5449640..fa6b4aae752 100644
--- a/arch/mips/oprofile/op_impl.h
+++ b/arch/mips/oprofile/op_impl.h
@@ -10,8 +10,6 @@
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 int null_perf_irq(void); 13extern int null_perf_irq(void);
16extern int (*perf_irq)(void); 14extern int (*perf_irq)(void);
17 15
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index dd0aec9c3ce..455d76ad06d 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -18,7 +18,7 @@
18#define M_PERFCTL_SUPERVISOR (1UL << 2) 18#define M_PERFCTL_SUPERVISOR (1UL << 2)
19#define M_PERFCTL_USER (1UL << 3) 19#define M_PERFCTL_USER (1UL << 3)
20#define M_PERFCTL_INTERRUPT_ENABLE (1UL << 4) 20#define M_PERFCTL_INTERRUPT_ENABLE (1UL << 4)
21#define M_PERFCTL_EVENT(event) ((event) << 5) 21#define M_PERFCTL_EVENT(event) (((event) & 0x3f) << 5)
22#define M_PERFCTL_VPEID(vpe) ((vpe) << 16) 22#define M_PERFCTL_VPEID(vpe) ((vpe) << 16)
23#define M_PERFCTL_MT_EN(filter) ((filter) << 20) 23#define M_PERFCTL_MT_EN(filter) ((filter) << 20)
24#define M_TC_EN_ALL M_PERFCTL_MT_EN(0) 24#define M_TC_EN_ALL M_PERFCTL_MT_EN(0)
@@ -31,16 +31,18 @@
31#define M_COUNTER_OVERFLOW (1UL << 31) 31#define M_COUNTER_OVERFLOW (1UL << 31)
32 32
33#ifdef CONFIG_MIPS_MT_SMP 33#ifdef CONFIG_MIPS_MT_SMP
34#define WHAT (M_TC_EN_VPE | M_PERFCTL_VPEID(smp_processor_id())) 34#define WHAT (M_TC_EN_VPE | M_PERFCTL_VPEID(smp_processor_id()))
35#define vpe_id() smp_processor_id()
35#else 36#else
36#define WHAT 0 37#define WHAT 0
38#define vpe_id() smp_processor_id()
37#endif 39#endif
38 40
39#define __define_perf_accessors(r, n, np) \ 41#define __define_perf_accessors(r, n, np) \
40 \ 42 \
41static inline unsigned int r_c0_ ## r ## n(void) \ 43static inline unsigned int r_c0_ ## r ## n(void) \
42{ \ 44{ \
43 unsigned int cpu = smp_processor_id(); \ 45 unsigned int cpu = vpe_id(); \
44 \ 46 \
45 switch (cpu) { \ 47 switch (cpu) { \
46 case 0: \ 48 case 0: \
@@ -55,7 +57,7 @@ static inline unsigned int r_c0_ ## r ## n(void) \
55 \ 57 \
56static inline void w_c0_ ## r ## n(unsigned int value) \ 58static inline void w_c0_ ## r ## n(unsigned int value) \
57{ \ 59{ \
58 unsigned int cpu = smp_processor_id(); \ 60 unsigned int cpu = vpe_id(); \
59 \ 61 \
60 switch (cpu) { \ 62 switch (cpu) { \
61 case 0: \ 63 case 0: \
@@ -216,13 +218,23 @@ static inline int __n_counters(void)
216 218
217static inline int n_counters(void) 219static inline int n_counters(void)
218{ 220{
219 int counters = __n_counters(); 221 int counters;
220 222
221#ifndef CONFIG_SMP 223 switch (current_cpu_data.cputype) {
222 if (current_cpu_data.cputype == CPU_34K) 224 case CPU_R10000:
223 return counters >> 1; 225 counters = 2;
224#endif 226
227 case CPU_R12000:
228 case CPU_R14000:
229 counters = 4;
230
231 default:
232 counters = __n_counters();
233 }
225 234
235#ifdef CONFIG_MIPS_MT_SMP
236 counters >> 1;
237#endif
226 return counters; 238 return counters;
227} 239}
228 240
@@ -282,6 +294,18 @@ static int __init mipsxx_init(void)
282 op_model_mipsxx_ops.cpu_type = "mips/5K"; 294 op_model_mipsxx_ops.cpu_type = "mips/5K";
283 break; 295 break;
284 296
297 case CPU_R10000:
298 if ((current_cpu_data.processor_id & 0xff) == 0x20)
299 op_model_mipsxx_ops.cpu_type = "mips/r10000-v2.x";
300 else
301 op_model_mipsxx_ops.cpu_type = "mips/r10000";
302 break;
303
304 case CPU_R12000:
305 case CPU_R14000:
306 op_model_mipsxx_ops.cpu_type = "mips/r12000";
307 break;
308
285 case CPU_SB1: 309 case CPU_SB1:
286 case CPU_SB1A: 310 case CPU_SB1A:
287 op_model_mipsxx_ops.cpu_type = "mips/sb1"; 311 op_model_mipsxx_ops.cpu_type = "mips/sb1";
diff --git a/arch/mips/oprofile/op_model_rm9000.c b/arch/mips/oprofile/op_model_rm9000.c
index b7063fefa65..7dc9bf6f132 100644
--- a/arch/mips/oprofile/op_model_rm9000.c
+++ b/arch/mips/oprofile/op_model_rm9000.c
@@ -80,8 +80,7 @@ static void rm9000_cpu_stop(void *args)
80 write_c0_perfcontrol(0); 80 write_c0_perfcontrol(0);
81} 81}
82 82
83static irqreturn_t rm9000_perfcount_handler(int irq, void * dev_id, 83static irqreturn_t rm9000_perfcount_handler(int irq, void * dev_id)
84 struct pt_regs *regs)
85{ 84{
86 unsigned int control = read_c0_perfcontrol(); 85 unsigned int control = read_c0_perfcontrol();
87 uint32_t counter1, counter2; 86 uint32_t counter1, counter2;
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index 3cf0dd4ba54..70cb55b89df 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -26,7 +26,7 @@ obj-$(CONFIG_DDB5477) += fixup-ddb5477.o pci-ddb5477.o ops-ddb5477.o
26obj-$(CONFIG_LASAT) += pci-lasat.o 26obj-$(CONFIG_LASAT) += pci-lasat.o
27obj-$(CONFIG_MIPS_ATLAS) += fixup-atlas.o 27obj-$(CONFIG_MIPS_ATLAS) += fixup-atlas.o
28obj-$(CONFIG_MIPS_COBALT) += fixup-cobalt.o 28obj-$(CONFIG_MIPS_COBALT) += fixup-cobalt.o
29obj-$(CONFIG_MIPS_EV64120) += fixup-ev64120.o 29obj-$(CONFIG_MIPS_EV64120) += pci-ev64120.o
30obj-$(CONFIG_SOC_AU1500) += fixup-au1000.o ops-au1000.o 30obj-$(CONFIG_SOC_AU1500) += fixup-au1000.o ops-au1000.o
31obj-$(CONFIG_SOC_AU1550) += fixup-au1000.o ops-au1000.o 31obj-$(CONFIG_SOC_AU1550) += fixup-au1000.o ops-au1000.o
32obj-$(CONFIG_SOC_PNX8550) += fixup-pnx8550.o ops-pnx8550.o 32obj-$(CONFIG_SOC_PNX8550) += fixup-pnx8550.o ops-pnx8550.o
diff --git a/arch/mips/pci/fixup-cobalt.c b/arch/mips/pci/fixup-cobalt.c
index 75a01e76489..7d5f6bbf7a9 100644
--- a/arch/mips/pci/fixup-cobalt.c
+++ b/arch/mips/pci/fixup-cobalt.c
@@ -94,22 +94,21 @@ static void qube_raq_galileo_fixup(struct pci_dev *dev)
94#if 0 94#if 0
95 if (galileo_id >= 0x10) { 95 if (galileo_id >= 0x10) {
96 /* New Galileo, assumes PCI stop line to VIA is connected. */ 96 /* New Galileo, assumes PCI stop line to VIA is connected. */
97 GALILEO_OUTL(0x4020, GT_PCI0_TOR_OFS); 97 GT_WRITE(GT_PCI0_TOR_OFS, 0x4020);
98 } else if (galileo_id == 0x1 || galileo_id == 0x2) 98 } else if (galileo_id == 0x1 || galileo_id == 0x2)
99#endif 99#endif
100 { 100 {
101 signed int timeo; 101 signed int timeo;
102 /* XXX WE MUST DO THIS ELSE GALILEO LOCKS UP! -DaveM */ 102 /* XXX WE MUST DO THIS ELSE GALILEO LOCKS UP! -DaveM */
103 timeo = GALILEO_INL(GT_PCI0_TOR_OFS); 103 timeo = GT_READ(GT_PCI0_TOR_OFS);
104 /* Old Galileo, assumes PCI STOP line to VIA is disconnected. */ 104 /* Old Galileo, assumes PCI STOP line to VIA is disconnected. */
105 GALILEO_OUTL( 105 GT_WRITE(GT_PCI0_TOR_OFS,
106 (0xff << 16) | /* retry count */ 106 (0xff << 16) | /* retry count */
107 (0xff << 8) | /* timeout 1 */ 107 (0xff << 8) | /* timeout 1 */
108 0xff, /* timeout 0 */ 108 0xff); /* timeout 0 */
109 GT_PCI0_TOR_OFS);
110 109
111 /* enable PCI retry exceeded interrupt */ 110 /* enable PCI retry exceeded interrupt */
112 GALILEO_OUTL(GALILEO_INTR_RETRY_CTR | GALILEO_INL(GT_INTRMASK_OFS), GT_INTRMASK_OFS); 111 GT_WRITE(GT_INTRMASK_OFS, GT_INTR_RETRYCTR0_MSK | GT_READ(GT_INTRMASK_OFS));
113 } 112 }
114} 113}
115 114
diff --git a/arch/mips/pci/fixup-ev64120.c b/arch/mips/pci/fixup-ev64120.c
deleted file mode 100644
index 8dbb90d63f0..00000000000
--- a/arch/mips/pci/fixup-ev64120.c
+++ /dev/null
@@ -1,34 +0,0 @@
1#include <linux/pci.h>
2#include <linux/init.h>
3
4int pci_range_ck(unsigned char bus, unsigned char dev)
5{
6 if (((bus == 0) || (bus == 1)) && (dev >= 6) && (dev <= 8))
7 return 0;
8
9 return -1;
10}
11
12/*
13 * After detecting all agents over the PCI , this function is called
14 * in order to give an interrupt number for each PCI device starting
15 * from IRQ 20. It does also enables master for each device.
16 */
17void __devinit pcibios_fixup_bus(struct pci_bus *bus)
18{
19 unsigned int irq = 20;
20 struct pci_bus *current_bus = bus;
21 struct pci_dev *dev;
22 struct list_head *devices_link;
23
24 list_for_each(devices_link, &(current_bus->devices)) {
25 dev = pci_dev_b(devices_link);
26 if (dev != NULL) {
27 dev->irq = irq++;
28
29 /* Assign an interrupt number for the device */
30 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
31 pcibios_set_master(dev);
32 }
33 }
34}
diff --git a/arch/mips/pci/ops-gt64111.c b/arch/mips/pci/ops-gt64111.c
index 13de45940b1..ecd3991bd0e 100644
--- a/arch/mips/pci/ops-gt64111.c
+++ b/arch/mips/pci/ops-gt64111.c
@@ -38,18 +38,18 @@ static int gt64111_pci_read_config(struct pci_bus *bus, unsigned int devfn,
38 switch (size) { 38 switch (size) {
39 case 4: 39 case 4:
40 PCI_CFG_SET(devfn, where); 40 PCI_CFG_SET(devfn, where);
41 *val = GALILEO_INL(GT_PCI0_CFGDATA_OFS); 41 *val = GT_READ(GT_PCI0_CFGDATA_OFS);
42 return PCIBIOS_SUCCESSFUL; 42 return PCIBIOS_SUCCESSFUL;
43 43
44 case 2: 44 case 2:
45 PCI_CFG_SET(devfn, (where & ~0x3)); 45 PCI_CFG_SET(devfn, (where & ~0x3));
46 *val = GALILEO_INL(GT_PCI0_CFGDATA_OFS) 46 *val = GT_READ(GT_PCI0_CFGDATA_OFS)
47 >> ((where & 3) * 8); 47 >> ((where & 3) * 8);
48 return PCIBIOS_SUCCESSFUL; 48 return PCIBIOS_SUCCESSFUL;
49 49
50 case 1: 50 case 1:
51 PCI_CFG_SET(devfn, (where & ~0x3)); 51 PCI_CFG_SET(devfn, (where & ~0x3));
52 *val = GALILEO_INL(GT_PCI0_CFGDATA_OFS) 52 *val = GT_READ(GT_PCI0_CFGDATA_OFS)
53 >> ((where & 3) * 8); 53 >> ((where & 3) * 8);
54 return PCIBIOS_SUCCESSFUL; 54 return PCIBIOS_SUCCESSFUL;
55 } 55 }
@@ -68,25 +68,25 @@ static int gt64111_pci_write_config(struct pci_bus *bus, unsigned int devfn,
68 switch (size) { 68 switch (size) {
69 case 4: 69 case 4:
70 PCI_CFG_SET(devfn, where); 70 PCI_CFG_SET(devfn, where);
71 GALILEO_OUTL(val, GT_PCI0_CFGDATA_OFS); 71 GT_WRITE(GT_PCI0_CFGDATA_OFS, val);
72 72
73 return PCIBIOS_SUCCESSFUL; 73 return PCIBIOS_SUCCESSFUL;
74 74
75 case 2: 75 case 2:
76 PCI_CFG_SET(devfn, (where & ~0x3)); 76 PCI_CFG_SET(devfn, (where & ~0x3));
77 tmp = GALILEO_INL(GT_PCI0_CFGDATA_OFS); 77 tmp = GT_READ(GT_PCI0_CFGDATA_OFS);
78 tmp &= ~(0xffff << ((where & 0x3) * 8)); 78 tmp &= ~(0xffff << ((where & 0x3) * 8));
79 tmp |= (val << ((where & 0x3) * 8)); 79 tmp |= (val << ((where & 0x3) * 8));
80 GALILEO_OUTL(tmp, GT_PCI0_CFGDATA_OFS); 80 GT_WRITE(GT_PCI0_CFGDATA_OFS, tmp);
81 81
82 return PCIBIOS_SUCCESSFUL; 82 return PCIBIOS_SUCCESSFUL;
83 83
84 case 1: 84 case 1:
85 PCI_CFG_SET(devfn, (where & ~0x3)); 85 PCI_CFG_SET(devfn, (where & ~0x3));
86 tmp = GALILEO_INL(GT_PCI0_CFGDATA_OFS); 86 tmp = GT_READ(GT_PCI0_CFGDATA_OFS);
87 tmp &= ~(0xff << ((where & 0x3) * 8)); 87 tmp &= ~(0xff << ((where & 0x3) * 8));
88 tmp |= (val << ((where & 0x3) * 8)); 88 tmp |= (val << ((where & 0x3) * 8));
89 GALILEO_OUTL(tmp, GT_PCI0_CFGDATA_OFS); 89 GT_WRITE(GT_PCI0_CFGDATA_OFS, tmp);
90 90
91 return PCIBIOS_SUCCESSFUL; 91 return PCIBIOS_SUCCESSFUL;
92 } 92 }
diff --git a/arch/mips/pci/pci-ev64120.c b/arch/mips/pci/pci-ev64120.c
new file mode 100644
index 00000000000..9cd859ef184
--- /dev/null
+++ b/arch/mips/pci/pci-ev64120.c
@@ -0,0 +1,21 @@
1#include <linux/pci.h>
2
3int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
4{
5 int irq;
6
7 if (!pin)
8 return 0;
9
10 irq = allocate_irqno();
11 if (irq < 0)
12 return 0;
13
14 return irq;
15}
16
17/* Do platform specific device initialization at pci_enable_device() time */
18int pcibios_plat_dev_init(struct pci_dev *dev)
19{
20 return 0;
21}
diff --git a/arch/mips/philips/pnx8550/common/int.c b/arch/mips/philips/pnx8550/common/int.c
index 710611615ca..0dc23930edb 100644
--- a/arch/mips/philips/pnx8550/common/int.c
+++ b/arch/mips/philips/pnx8550/common/int.c
@@ -38,8 +38,6 @@
38#include <int.h> 38#include <int.h>
39#include <uart.h> 39#include <uart.h>
40 40
41static DEFINE_SPINLOCK(irq_lock);
42
43/* default prio for interrupts */ 41/* default prio for interrupts */
44/* first one is a no-no so therefore always prio 0 (disabled) */ 42/* first one is a no-no so therefore always prio 0 (disabled) */
45static char gic_prio[PNX8550_INT_GIC_TOTINT] = { 43static char gic_prio[PNX8550_INT_GIC_TOTINT] = {
@@ -149,38 +147,6 @@ static inline void unmask_irq(unsigned int irq_nr)
149 } 147 }
150} 148}
151 149
152#define pnx8550_disable pnx8550_ack
153static void pnx8550_ack(unsigned int irq)
154{
155 unsigned long flags;
156
157 spin_lock_irqsave(&irq_lock, flags);
158 mask_irq(irq);
159 spin_unlock_irqrestore(&irq_lock, flags);
160}
161
162#define pnx8550_enable pnx8550_unmask
163static void pnx8550_unmask(unsigned int irq)
164{
165 unsigned long flags;
166
167 spin_lock_irqsave(&irq_lock, flags);
168 unmask_irq(irq);
169 spin_unlock_irqrestore(&irq_lock, flags);
170}
171
172static unsigned int startup_irq(unsigned int irq_nr)
173{
174 pnx8550_unmask(irq_nr);
175 return 0;
176}
177
178static void shutdown_irq(unsigned int irq_nr)
179{
180 pnx8550_ack(irq_nr);
181 return;
182}
183
184int pnx8550_set_gic_priority(int irq, int priority) 150int pnx8550_set_gic_priority(int irq, int priority)
185{ 151{
186 int gic_irq = irq-PNX8550_INT_GIC_MIN; 152 int gic_irq = irq-PNX8550_INT_GIC_MIN;
@@ -192,26 +158,19 @@ int pnx8550_set_gic_priority(int irq, int priority)
192 return prev_priority; 158 return prev_priority;
193} 159}
194 160
195static inline void mask_and_ack_level_irq(unsigned int irq)
196{
197 pnx8550_disable(irq);
198 return;
199}
200
201static void end_irq(unsigned int irq) 161static void end_irq(unsigned int irq)
202{ 162{
203 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) { 163 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
204 pnx8550_enable(irq); 164 unmask_irq(irq);
205 } 165 }
206} 166}
207 167
208static struct irq_chip level_irq_type = { 168static struct irq_chip level_irq_type = {
209 .typename = "PNX Level IRQ", 169 .typename = "PNX Level IRQ",
210 .startup = startup_irq, 170 .ack = mask_irq,
211 .shutdown = shutdown_irq, 171 .mask = mask_irq,
212 .enable = pnx8550_enable, 172 .mask_ack = mask_irq,
213 .disable = pnx8550_disable, 173 .unmask = unmask_irq,
214 .ack = mask_and_ack_level_irq,
215 .end = end_irq, 174 .end = end_irq,
216}; 175};
217 176
@@ -233,8 +192,8 @@ void __init arch_init_irq(void)
233 int configPR; 192 int configPR;
234 193
235 for (i = 0; i < PNX8550_INT_CP0_TOTINT; i++) { 194 for (i = 0; i < PNX8550_INT_CP0_TOTINT; i++) {
236 irq_desc[i].chip = &level_irq_type; 195 set_irq_chip_and_handler(i, &level_irq_type, handle_level_irq);
237 pnx8550_ack(i); /* mask the irq just in case */ 196 mask_irq(i); /* mask the irq just in case */
238 } 197 }
239 198
240 /* init of GIC/IPC interrupts */ 199 /* init of GIC/IPC interrupts */
@@ -270,7 +229,7 @@ void __init arch_init_irq(void)
270 /* mask/priority is still 0 so we will not get any 229 /* mask/priority is still 0 so we will not get any
271 * interrupts until it is unmasked */ 230 * interrupts until it is unmasked */
272 231
273 irq_desc[i].chip = &level_irq_type; 232 set_irq_chip_and_handler(i, &level_irq_type, handle_level_irq);
274 } 233 }
275 234
276 /* Priority level 0 */ 235 /* Priority level 0 */
@@ -279,20 +238,21 @@ void __init arch_init_irq(void)
279 /* Set int vector table address */ 238 /* Set int vector table address */
280 PNX8550_GIC_VECTOR_0 = PNX8550_GIC_VECTOR_1 = 0; 239 PNX8550_GIC_VECTOR_0 = PNX8550_GIC_VECTOR_1 = 0;
281 240
282 irq_desc[MIPS_CPU_GIC_IRQ].chip = &level_irq_type; 241 set_irq_chip_and_handler(MIPS_CPU_GIC_IRQ, &level_irq_type,
242 handle_level_irq);
283 setup_irq(MIPS_CPU_GIC_IRQ, &gic_action); 243 setup_irq(MIPS_CPU_GIC_IRQ, &gic_action);
284 244
285 /* init of Timer interrupts */ 245 /* init of Timer interrupts */
286 for (i = PNX8550_INT_TIMER_MIN; i <= PNX8550_INT_TIMER_MAX; i++) { 246 for (i = PNX8550_INT_TIMER_MIN; i <= PNX8550_INT_TIMER_MAX; i++)
287 irq_desc[i].chip = &level_irq_type; 247 set_irq_chip_and_handler(i, &level_irq_type, handle_level_irq);
288 }
289 248
290 /* Stop Timer 1-3 */ 249 /* Stop Timer 1-3 */
291 configPR = read_c0_config7(); 250 configPR = read_c0_config7();
292 configPR |= 0x00000038; 251 configPR |= 0x00000038;
293 write_c0_config7(configPR); 252 write_c0_config7(configPR);
294 253
295 irq_desc[MIPS_CPU_TIMER_IRQ].chip = &level_irq_type; 254 set_irq_chip_and_handler(MIPS_CPU_TIMER_IRQ, &level_irq_type,
255 handle_level_irq);
296 setup_irq(MIPS_CPU_TIMER_IRQ, &timer_action); 256 setup_irq(MIPS_CPU_TIMER_IRQ, &timer_action);
297} 257}
298 258
diff --git a/arch/mips/philips/pnx8550/common/time.c b/arch/mips/philips/pnx8550/common/time.c
index 0af655b1f33..65c440e8480 100644
--- a/arch/mips/philips/pnx8550/common/time.c
+++ b/arch/mips/philips/pnx8550/common/time.c
@@ -41,8 +41,8 @@ extern unsigned int mips_hpt_frequency;
41 * 1) board_time_init() - 41 * 1) board_time_init() -
42 * a) (optional) set up RTC routines, 42 * a) (optional) set up RTC routines,
43 * b) (optional) calibrate and set the mips_hpt_frequency 43 * b) (optional) calibrate and set the mips_hpt_frequency
44 * (only needed if you intended to use fixed_rate_gettimeoffset 44 * (only needed if you intended to use cpu counter as timer interrupt
45 * or use cpu counter as timer interrupt source) 45 * source)
46 */ 46 */
47 47
48void pnx8550_time_init(void) 48void pnx8550_time_init(void)
diff --git a/arch/mips/pmc-sierra/yosemite/i2c-yosemite.c b/arch/mips/pmc-sierra/yosemite/i2c-yosemite.c
index 416da22b3bf..85b14c73c22 100644
--- a/arch/mips/pmc-sierra/yosemite/i2c-yosemite.c
+++ b/arch/mips/pmc-sierra/yosemite/i2c-yosemite.c
@@ -74,7 +74,7 @@ static int titan_i2c_poll(void)
74int titan_i2c_xfer(unsigned int slave_addr, titan_i2c_command * cmd, 74int titan_i2c_xfer(unsigned int slave_addr, titan_i2c_command * cmd,
75 int size, unsigned int *addr) 75 int size, unsigned int *addr)
76{ 76{
77 int loop = 0, bytes, i; 77 int loop, bytes = 0, i;
78 unsigned int *write_data, data, *read_data; 78 unsigned int *write_data, data, *read_data;
79 unsigned long reg_val, val; 79 unsigned long reg_val, val;
80 80
diff --git a/arch/mips/pmc-sierra/yosemite/smp.c b/arch/mips/pmc-sierra/yosemite/smp.c
index 65fa3a23ea5..305491e74db 100644
--- a/arch/mips/pmc-sierra/yosemite/smp.c
+++ b/arch/mips/pmc-sierra/yosemite/smp.c
@@ -3,9 +3,7 @@
3 3
4#include <asm/pmon.h> 4#include <asm/pmon.h>
5#include <asm/titan_dep.h> 5#include <asm/titan_dep.h>
6 6#include <asm/time.h>
7extern unsigned int (*mips_hpt_read)(void);
8extern void (*mips_hpt_init)(unsigned int);
9 7
10#define LAUNCHSTACK_SIZE 256 8#define LAUNCHSTACK_SIZE 256
11 9
@@ -101,8 +99,6 @@ void prom_cpus_done(void)
101 */ 99 */
102void prom_init_secondary(void) 100void prom_init_secondary(void)
103{ 101{
104 mips_hpt_init(mips_hpt_read());
105
106 set_c0_status(ST0_CO | ST0_IE | ST0_IM); 102 set_c0_status(ST0_CO | ST0_IE | ST0_IM);
107} 103}
108 104
diff --git a/arch/mips/sgi-ip22/ip22-eisa.c b/arch/mips/sgi-ip22/ip22-eisa.c
index 0d18ed47c47..a1a9af6da7b 100644
--- a/arch/mips/sgi-ip22/ip22-eisa.c
+++ b/arch/mips/sgi-ip22/ip22-eisa.c
@@ -95,16 +95,11 @@ static irqreturn_t ip22_eisa_intr(int irq, void *dev_id)
95 95
96static void enable_eisa1_irq(unsigned int irq) 96static void enable_eisa1_irq(unsigned int irq)
97{ 97{
98 unsigned long flags;
99 u8 mask; 98 u8 mask;
100 99
101 local_irq_save(flags);
102
103 mask = inb(EISA_INT1_MASK); 100 mask = inb(EISA_INT1_MASK);
104 mask &= ~((u8) (1 << irq)); 101 mask &= ~((u8) (1 << irq));
105 outb(mask, EISA_INT1_MASK); 102 outb(mask, EISA_INT1_MASK);
106
107 local_irq_restore(flags);
108} 103}
109 104
110static unsigned int startup_eisa1_irq(unsigned int irq) 105static unsigned int startup_eisa1_irq(unsigned int irq)
@@ -130,8 +125,6 @@ static void disable_eisa1_irq(unsigned int irq)
130 outb(mask, EISA_INT1_MASK); 125 outb(mask, EISA_INT1_MASK);
131} 126}
132 127
133#define shutdown_eisa1_irq disable_eisa1_irq
134
135static void mask_and_ack_eisa1_irq(unsigned int irq) 128static void mask_and_ack_eisa1_irq(unsigned int irq)
136{ 129{
137 disable_eisa1_irq(irq); 130 disable_eisa1_irq(irq);
@@ -148,25 +141,20 @@ static void end_eisa1_irq(unsigned int irq)
148static struct irq_chip ip22_eisa1_irq_type = { 141static struct irq_chip ip22_eisa1_irq_type = {
149 .typename = "IP22 EISA", 142 .typename = "IP22 EISA",
150 .startup = startup_eisa1_irq, 143 .startup = startup_eisa1_irq,
151 .shutdown = shutdown_eisa1_irq,
152 .enable = enable_eisa1_irq,
153 .disable = disable_eisa1_irq,
154 .ack = mask_and_ack_eisa1_irq, 144 .ack = mask_and_ack_eisa1_irq,
145 .mask = disable_eisa1_irq,
146 .mask_ack = mask_and_ack_eisa1_irq,
147 .unmask = enable_eisa1_irq,
155 .end = end_eisa1_irq, 148 .end = end_eisa1_irq,
156}; 149};
157 150
158static void enable_eisa2_irq(unsigned int irq) 151static void enable_eisa2_irq(unsigned int irq)
159{ 152{
160 unsigned long flags;
161 u8 mask; 153 u8 mask;
162 154
163 local_irq_save(flags);
164
165 mask = inb(EISA_INT2_MASK); 155 mask = inb(EISA_INT2_MASK);
166 mask &= ~((u8) (1 << (irq - 8))); 156 mask &= ~((u8) (1 << (irq - 8)));
167 outb(mask, EISA_INT2_MASK); 157 outb(mask, EISA_INT2_MASK);
168
169 local_irq_restore(flags);
170} 158}
171 159
172static unsigned int startup_eisa2_irq(unsigned int irq) 160static unsigned int startup_eisa2_irq(unsigned int irq)
@@ -192,8 +180,6 @@ static void disable_eisa2_irq(unsigned int irq)
192 outb(mask, EISA_INT2_MASK); 180 outb(mask, EISA_INT2_MASK);
193} 181}
194 182
195#define shutdown_eisa2_irq disable_eisa2_irq
196
197static void mask_and_ack_eisa2_irq(unsigned int irq) 183static void mask_and_ack_eisa2_irq(unsigned int irq)
198{ 184{
199 disable_eisa2_irq(irq); 185 disable_eisa2_irq(irq);
@@ -210,10 +196,10 @@ static void end_eisa2_irq(unsigned int irq)
210static struct irq_chip ip22_eisa2_irq_type = { 196static struct irq_chip ip22_eisa2_irq_type = {
211 .typename = "IP22 EISA", 197 .typename = "IP22 EISA",
212 .startup = startup_eisa2_irq, 198 .startup = startup_eisa2_irq,
213 .shutdown = shutdown_eisa2_irq,
214 .enable = enable_eisa2_irq,
215 .disable = disable_eisa2_irq,
216 .ack = mask_and_ack_eisa2_irq, 199 .ack = mask_and_ack_eisa2_irq,
200 .mask = disable_eisa2_irq,
201 .mask_ack = mask_and_ack_eisa2_irq,
202 .unmask = enable_eisa2_irq,
217 .end = end_eisa2_irq, 203 .end = end_eisa2_irq,
218}; 204};
219 205
@@ -275,13 +261,10 @@ int __init ip22_eisa_init(void)
275 outb(0, EISA_DMA2_WRITE_SINGLE); 261 outb(0, EISA_DMA2_WRITE_SINGLE);
276 262
277 for (i = SGINT_EISA; i < (SGINT_EISA + EISA_MAX_IRQ); i++) { 263 for (i = SGINT_EISA; i < (SGINT_EISA + EISA_MAX_IRQ); i++) {
278 irq_desc[i].status = IRQ_DISABLED;
279 irq_desc[i].action = 0;
280 irq_desc[i].depth = 1;
281 if (i < (SGINT_EISA + 8)) 264 if (i < (SGINT_EISA + 8))
282 irq_desc[i].chip = &ip22_eisa1_irq_type; 265 set_irq_chip(i, &ip22_eisa1_irq_type);
283 else 266 else
284 irq_desc[i].chip = &ip22_eisa2_irq_type; 267 set_irq_chip(i, &ip22_eisa2_irq_type);
285 } 268 }
286 269
287 /* Cannot use request_irq because of kmalloc not being ready at such 270 /* Cannot use request_irq because of kmalloc not being ready at such
diff --git a/arch/mips/sgi-ip22/ip22-int.c b/arch/mips/sgi-ip22/ip22-int.c
index af518898eaa..c7b13805315 100644
--- a/arch/mips/sgi-ip22/ip22-int.c
+++ b/arch/mips/sgi-ip22/ip22-int.c
@@ -40,34 +40,17 @@ extern int ip22_eisa_init(void);
40 40
41static void enable_local0_irq(unsigned int irq) 41static void enable_local0_irq(unsigned int irq)
42{ 42{
43 unsigned long flags;
44
45 local_irq_save(flags);
46 /* don't allow mappable interrupt to be enabled from setup_irq, 43 /* don't allow mappable interrupt to be enabled from setup_irq,
47 * we have our own way to do so */ 44 * we have our own way to do so */
48 if (irq != SGI_MAP_0_IRQ) 45 if (irq != SGI_MAP_0_IRQ)
49 sgint->imask0 |= (1 << (irq - SGINT_LOCAL0)); 46 sgint->imask0 |= (1 << (irq - SGINT_LOCAL0));
50 local_irq_restore(flags);
51}
52
53static unsigned int startup_local0_irq(unsigned int irq)
54{
55 enable_local0_irq(irq);
56 return 0; /* Never anything pending */
57} 47}
58 48
59static void disable_local0_irq(unsigned int irq) 49static void disable_local0_irq(unsigned int irq)
60{ 50{
61 unsigned long flags;
62
63 local_irq_save(flags);
64 sgint->imask0 &= ~(1 << (irq - SGINT_LOCAL0)); 51 sgint->imask0 &= ~(1 << (irq - SGINT_LOCAL0));
65 local_irq_restore(flags);
66} 52}
67 53
68#define shutdown_local0_irq disable_local0_irq
69#define mask_and_ack_local0_irq disable_local0_irq
70
71static void end_local0_irq (unsigned int irq) 54static void end_local0_irq (unsigned int irq)
72{ 55{
73 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 56 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
@@ -76,44 +59,26 @@ static void end_local0_irq (unsigned int irq)
76 59
77static struct irq_chip ip22_local0_irq_type = { 60static struct irq_chip ip22_local0_irq_type = {
78 .typename = "IP22 local 0", 61 .typename = "IP22 local 0",
79 .startup = startup_local0_irq, 62 .ack = disable_local0_irq,
80 .shutdown = shutdown_local0_irq, 63 .mask = disable_local0_irq,
81 .enable = enable_local0_irq, 64 .mask_ack = disable_local0_irq,
82 .disable = disable_local0_irq, 65 .unmask = enable_local0_irq,
83 .ack = mask_and_ack_local0_irq,
84 .end = end_local0_irq, 66 .end = end_local0_irq,
85}; 67};
86 68
87static void enable_local1_irq(unsigned int irq) 69static void enable_local1_irq(unsigned int irq)
88{ 70{
89 unsigned long flags;
90
91 local_irq_save(flags);
92 /* don't allow mappable interrupt to be enabled from setup_irq, 71 /* don't allow mappable interrupt to be enabled from setup_irq,
93 * we have our own way to do so */ 72 * we have our own way to do so */
94 if (irq != SGI_MAP_1_IRQ) 73 if (irq != SGI_MAP_1_IRQ)
95 sgint->imask1 |= (1 << (irq - SGINT_LOCAL1)); 74 sgint->imask1 |= (1 << (irq - SGINT_LOCAL1));
96 local_irq_restore(flags);
97}
98
99static unsigned int startup_local1_irq(unsigned int irq)
100{
101 enable_local1_irq(irq);
102 return 0; /* Never anything pending */
103} 75}
104 76
105void disable_local1_irq(unsigned int irq) 77void disable_local1_irq(unsigned int irq)
106{ 78{
107 unsigned long flags;
108
109 local_irq_save(flags);
110 sgint->imask1 &= ~(1 << (irq - SGINT_LOCAL1)); 79 sgint->imask1 &= ~(1 << (irq - SGINT_LOCAL1));
111 local_irq_restore(flags);
112} 80}
113 81
114#define shutdown_local1_irq disable_local1_irq
115#define mask_and_ack_local1_irq disable_local1_irq
116
117static void end_local1_irq (unsigned int irq) 82static void end_local1_irq (unsigned int irq)
118{ 83{
119 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 84 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
@@ -122,44 +87,26 @@ static void end_local1_irq (unsigned int irq)
122 87
123static struct irq_chip ip22_local1_irq_type = { 88static struct irq_chip ip22_local1_irq_type = {
124 .typename = "IP22 local 1", 89 .typename = "IP22 local 1",
125 .startup = startup_local1_irq, 90 .ack = disable_local1_irq,
126 .shutdown = shutdown_local1_irq, 91 .mask = disable_local1_irq,
127 .enable = enable_local1_irq, 92 .mask_ack = disable_local1_irq,
128 .disable = disable_local1_irq, 93 .unmask = enable_local1_irq,
129 .ack = mask_and_ack_local1_irq,
130 .end = end_local1_irq, 94 .end = end_local1_irq,
131}; 95};
132 96
133static void enable_local2_irq(unsigned int irq) 97static void enable_local2_irq(unsigned int irq)
134{ 98{
135 unsigned long flags;
136
137 local_irq_save(flags);
138 sgint->imask0 |= (1 << (SGI_MAP_0_IRQ - SGINT_LOCAL0)); 99 sgint->imask0 |= (1 << (SGI_MAP_0_IRQ - SGINT_LOCAL0));
139 sgint->cmeimask0 |= (1 << (irq - SGINT_LOCAL2)); 100 sgint->cmeimask0 |= (1 << (irq - SGINT_LOCAL2));
140 local_irq_restore(flags);
141}
142
143static unsigned int startup_local2_irq(unsigned int irq)
144{
145 enable_local2_irq(irq);
146 return 0; /* Never anything pending */
147} 101}
148 102
149void disable_local2_irq(unsigned int irq) 103void disable_local2_irq(unsigned int irq)
150{ 104{
151 unsigned long flags;
152
153 local_irq_save(flags);
154 sgint->cmeimask0 &= ~(1 << (irq - SGINT_LOCAL2)); 105 sgint->cmeimask0 &= ~(1 << (irq - SGINT_LOCAL2));
155 if (!sgint->cmeimask0) 106 if (!sgint->cmeimask0)
156 sgint->imask0 &= ~(1 << (SGI_MAP_0_IRQ - SGINT_LOCAL0)); 107 sgint->imask0 &= ~(1 << (SGI_MAP_0_IRQ - SGINT_LOCAL0));
157 local_irq_restore(flags);
158} 108}
159 109
160#define shutdown_local2_irq disable_local2_irq
161#define mask_and_ack_local2_irq disable_local2_irq
162
163static void end_local2_irq (unsigned int irq) 110static void end_local2_irq (unsigned int irq)
164{ 111{
165 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 112 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
@@ -168,44 +115,26 @@ static void end_local2_irq (unsigned int irq)
168 115
169static struct irq_chip ip22_local2_irq_type = { 116static struct irq_chip ip22_local2_irq_type = {
170 .typename = "IP22 local 2", 117 .typename = "IP22 local 2",
171 .startup = startup_local2_irq, 118 .ack = disable_local2_irq,
172 .shutdown = shutdown_local2_irq, 119 .mask = disable_local2_irq,
173 .enable = enable_local2_irq, 120 .mask_ack = disable_local2_irq,
174 .disable = disable_local2_irq, 121 .unmask = enable_local2_irq,
175 .ack = mask_and_ack_local2_irq,
176 .end = end_local2_irq, 122 .end = end_local2_irq,
177}; 123};
178 124
179static void enable_local3_irq(unsigned int irq) 125static void enable_local3_irq(unsigned int irq)
180{ 126{
181 unsigned long flags;
182
183 local_irq_save(flags);
184 sgint->imask1 |= (1 << (SGI_MAP_1_IRQ - SGINT_LOCAL1)); 127 sgint->imask1 |= (1 << (SGI_MAP_1_IRQ - SGINT_LOCAL1));
185 sgint->cmeimask1 |= (1 << (irq - SGINT_LOCAL3)); 128 sgint->cmeimask1 |= (1 << (irq - SGINT_LOCAL3));
186 local_irq_restore(flags);
187}
188
189static unsigned int startup_local3_irq(unsigned int irq)
190{
191 enable_local3_irq(irq);
192 return 0; /* Never anything pending */
193} 129}
194 130
195void disable_local3_irq(unsigned int irq) 131void disable_local3_irq(unsigned int irq)
196{ 132{
197 unsigned long flags;
198
199 local_irq_save(flags);
200 sgint->cmeimask1 &= ~(1 << (irq - SGINT_LOCAL3)); 133 sgint->cmeimask1 &= ~(1 << (irq - SGINT_LOCAL3));
201 if (!sgint->cmeimask1) 134 if (!sgint->cmeimask1)
202 sgint->imask1 &= ~(1 << (SGI_MAP_1_IRQ - SGINT_LOCAL1)); 135 sgint->imask1 &= ~(1 << (SGI_MAP_1_IRQ - SGINT_LOCAL1));
203 local_irq_restore(flags);
204} 136}
205 137
206#define shutdown_local3_irq disable_local3_irq
207#define mask_and_ack_local3_irq disable_local3_irq
208
209static void end_local3_irq (unsigned int irq) 138static void end_local3_irq (unsigned int irq)
210{ 139{
211 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 140 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
@@ -214,11 +143,10 @@ static void end_local3_irq (unsigned int irq)
214 143
215static struct irq_chip ip22_local3_irq_type = { 144static struct irq_chip ip22_local3_irq_type = {
216 .typename = "IP22 local 3", 145 .typename = "IP22 local 3",
217 .startup = startup_local3_irq, 146 .ack = disable_local3_irq,
218 .shutdown = shutdown_local3_irq, 147 .mask = disable_local3_irq,
219 .enable = enable_local3_irq, 148 .mask_ack = disable_local3_irq,
220 .disable = disable_local3_irq, 149 .unmask = enable_local3_irq,
221 .ack = mask_and_ack_local3_irq,
222 .end = end_local3_irq, 150 .end = end_local3_irq,
223}; 151};
224 152
@@ -430,10 +358,7 @@ void __init arch_init_irq(void)
430 else 358 else
431 handler = &ip22_local3_irq_type; 359 handler = &ip22_local3_irq_type;
432 360
433 irq_desc[i].status = IRQ_DISABLED; 361 set_irq_chip_and_handler(i, handler, handle_level_irq);
434 irq_desc[i].action = 0;
435 irq_desc[i].depth = 1;
436 irq_desc[i].chip = handler;
437 } 362 }
438 363
439 /* vector handler. this register the IRQ as non-sharable */ 364 /* vector handler. this register the IRQ as non-sharable */
diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c
index f01ba1f9077..5f8835b4e84 100644
--- a/arch/mips/sgi-ip27/ip27-irq.c
+++ b/arch/mips/sgi-ip27/ip27-irq.c
@@ -332,11 +332,6 @@ static inline void disable_bridge_irq(unsigned int irq)
332 intr_disconnect_level(cpu, swlevel); 332 intr_disconnect_level(cpu, swlevel);
333} 333}
334 334
335static void mask_and_ack_bridge_irq(unsigned int irq)
336{
337 disable_bridge_irq(irq);
338}
339
340static void end_bridge_irq(unsigned int irq) 335static void end_bridge_irq(unsigned int irq)
341{ 336{
342 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)) && 337 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)) &&
@@ -348,41 +343,16 @@ static struct irq_chip bridge_irq_type = {
348 .typename = "bridge", 343 .typename = "bridge",
349 .startup = startup_bridge_irq, 344 .startup = startup_bridge_irq,
350 .shutdown = shutdown_bridge_irq, 345 .shutdown = shutdown_bridge_irq,
351 .enable = enable_bridge_irq, 346 .ack = disable_bridge_irq,
352 .disable = disable_bridge_irq, 347 .mask = disable_bridge_irq,
353 .ack = mask_and_ack_bridge_irq, 348 .mask_ack = disable_bridge_irq,
349 .unmask = enable_bridge_irq,
354 .end = end_bridge_irq, 350 .end = end_bridge_irq,
355}; 351};
356 352
357static unsigned long irq_map[NR_IRQS / BITS_PER_LONG];
358
359int allocate_irqno(void)
360{
361 int irq;
362
363again:
364 irq = find_first_zero_bit(irq_map, NR_IRQS);
365
366 if (irq >= NR_IRQS)
367 return -ENOSPC;
368
369 if (test_and_set_bit(irq, irq_map))
370 goto again;
371
372 return irq;
373}
374
375void free_irqno(unsigned int irq)
376{
377 clear_bit(irq, irq_map);
378}
379
380void __devinit register_bridge_irq(unsigned int irq) 353void __devinit register_bridge_irq(unsigned int irq)
381{ 354{
382 irq_desc[irq].status = IRQ_DISABLED; 355 set_irq_chip_and_handler(irq, &bridge_irq_type, handle_level_irq);
383 irq_desc[irq].action = 0;
384 irq_desc[irq].depth = 1;
385 irq_desc[irq].chip = &bridge_irq_type;
386} 356}
387 357
388int __devinit request_bridge_irq(struct bridge_controller *bc) 358int __devinit request_bridge_irq(struct bridge_controller *bc)
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index 4e870fc4469..7d361726bbf 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -134,13 +134,6 @@ again:
134 irq_exit(); 134 irq_exit();
135} 135}
136 136
137unsigned long ip27_do_gettimeoffset(void)
138{
139 unsigned long ct_cur1;
140 ct_cur1 = REMOTE_HUB_L(cputonasid(0), PI_RT_COUNT) + CYCLES_PER_JIFFY;
141 return (ct_cur1 - ct_cur[0]) * NSEC_PER_CYCLE / 1000;
142}
143
144/* Includes for ioc3_init(). */ 137/* Includes for ioc3_init(). */
145#include <asm/sn/types.h> 138#include <asm/sn/types.h>
146#include <asm/sn/sn0/addrs.h> 139#include <asm/sn/sn0/addrs.h>
@@ -179,15 +172,6 @@ static __init unsigned long get_m48t35_time(void)
179 return mktime(year, month, date, hour, min, sec); 172 return mktime(year, month, date, hour, min, sec);
180} 173}
181 174
182static unsigned int startup_rt_irq(unsigned int irq)
183{
184 return 0;
185}
186
187static void shutdown_rt_irq(unsigned int irq)
188{
189}
190
191static void enable_rt_irq(unsigned int irq) 175static void enable_rt_irq(unsigned int irq)
192{ 176{
193} 177}
@@ -196,21 +180,17 @@ static void disable_rt_irq(unsigned int irq)
196{ 180{
197} 181}
198 182
199static void mask_and_ack_rt(unsigned int irq)
200{
201}
202
203static void end_rt_irq(unsigned int irq) 183static void end_rt_irq(unsigned int irq)
204{ 184{
205} 185}
206 186
207static struct irq_chip rt_irq_type = { 187static struct irq_chip rt_irq_type = {
208 .typename = "SN HUB RT timer", 188 .typename = "SN HUB RT timer",
209 .startup = startup_rt_irq, 189 .ack = disable_rt_irq,
210 .shutdown = shutdown_rt_irq, 190 .mask = disable_rt_irq,
211 .enable = enable_rt_irq, 191 .mask_ack = disable_rt_irq,
212 .disable = disable_rt_irq, 192 .unmask = enable_rt_irq,
213 .ack = mask_and_ack_rt, 193 .eoi = enable_rt_irq,
214 .end = end_rt_irq, 194 .end = end_rt_irq,
215}; 195};
216 196
@@ -221,8 +201,6 @@ static struct irqaction rt_irqaction = {
221 .name = "timer" 201 .name = "timer"
222}; 202};
223 203
224extern int allocate_irqno(void);
225
226void __init plat_timer_setup(struct irqaction *irq) 204void __init plat_timer_setup(struct irqaction *irq)
227{ 205{
228 int irqno = allocate_irqno(); 206 int irqno = allocate_irqno();
@@ -230,10 +208,7 @@ void __init plat_timer_setup(struct irqaction *irq)
230 if (irqno < 0) 208 if (irqno < 0)
231 panic("Can't allocate interrupt number for timer interrupt"); 209 panic("Can't allocate interrupt number for timer interrupt");
232 210
233 irq_desc[irqno].status = IRQ_DISABLED; 211 set_irq_chip_and_handler(irqno, &rt_irq_type, handle_percpu_irq);
234 irq_desc[irqno].action = NULL;
235 irq_desc[irqno].depth = 1;
236 irq_desc[irqno].chip = &rt_irq_type;
237 212
238 /* over-write the handler, we use our own way */ 213 /* over-write the handler, we use our own way */
239 irq->handler = no_action; 214 irq->handler = no_action;
@@ -248,12 +223,17 @@ void __init plat_timer_setup(struct irqaction *irq)
248 setup_irq(irqno, &rt_irqaction); 223 setup_irq(irqno, &rt_irqaction);
249} 224}
250 225
226static cycle_t ip27_hpt_read(void)
227{
228 return REMOTE_HUB_L(cputonasid(0), PI_RT_COUNT);
229}
230
251void __init ip27_time_init(void) 231void __init ip27_time_init(void)
252{ 232{
233 clocksource_mips.read = ip27_hpt_read;
234 mips_hpt_frequency = CYCLES_PER_SEC;
253 xtime.tv_sec = get_m48t35_time(); 235 xtime.tv_sec = get_m48t35_time();
254 xtime.tv_nsec = 0; 236 xtime.tv_nsec = 0;
255
256 do_gettimeoffset = ip27_do_gettimeoffset;
257} 237}
258 238
259void __init cpu_time_init(void) 239void __init cpu_time_init(void)
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index c9acadd0846..ae063864c02 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -113,12 +113,6 @@ static void inline flush_mace_bus(void)
113 * is quite different anyway. 113 * is quite different anyway.
114 */ 114 */
115 115
116/*
117 * IRQ spinlock - Ralf says not to disable CPU interrupts,
118 * and I think he knows better.
119 */
120static DEFINE_SPINLOCK(ip32_irq_lock);
121
122/* Some initial interrupts to set up */ 116/* Some initial interrupts to set up */
123extern irqreturn_t crime_memerr_intr(int irq, void *dev_id); 117extern irqreturn_t crime_memerr_intr(int irq, void *dev_id);
124extern irqreturn_t crime_cpuerr_intr(int irq, void *dev_id); 118extern irqreturn_t crime_cpuerr_intr(int irq, void *dev_id);
@@ -138,12 +132,6 @@ static void enable_cpu_irq(unsigned int irq)
138 set_c0_status(STATUSF_IP7); 132 set_c0_status(STATUSF_IP7);
139} 133}
140 134
141static unsigned int startup_cpu_irq(unsigned int irq)
142{
143 enable_cpu_irq(irq);
144 return 0;
145}
146
147static void disable_cpu_irq(unsigned int irq) 135static void disable_cpu_irq(unsigned int irq)
148{ 136{
149 clear_c0_status(STATUSF_IP7); 137 clear_c0_status(STATUSF_IP7);
@@ -155,16 +143,12 @@ static void end_cpu_irq(unsigned int irq)
155 enable_cpu_irq (irq); 143 enable_cpu_irq (irq);
156} 144}
157 145
158#define shutdown_cpu_irq disable_cpu_irq
159#define mask_and_ack_cpu_irq disable_cpu_irq
160
161static struct irq_chip ip32_cpu_interrupt = { 146static struct irq_chip ip32_cpu_interrupt = {
162 .typename = "IP32 CPU", 147 .typename = "IP32 CPU",
163 .startup = startup_cpu_irq, 148 .ack = disable_cpu_irq,
164 .shutdown = shutdown_cpu_irq, 149 .mask = disable_cpu_irq,
165 .enable = enable_cpu_irq, 150 .mask_ack = disable_cpu_irq,
166 .disable = disable_cpu_irq, 151 .unmask = enable_cpu_irq,
167 .ack = mask_and_ack_cpu_irq,
168 .end = end_cpu_irq, 152 .end = end_cpu_irq,
169}; 153};
170 154
@@ -177,45 +161,27 @@ static uint64_t crime_mask;
177 161
178static void enable_crime_irq(unsigned int irq) 162static void enable_crime_irq(unsigned int irq)
179{ 163{
180 unsigned long flags;
181
182 spin_lock_irqsave(&ip32_irq_lock, flags);
183 crime_mask |= 1 << (irq - 1); 164 crime_mask |= 1 << (irq - 1);
184 crime->imask = crime_mask; 165 crime->imask = crime_mask;
185 spin_unlock_irqrestore(&ip32_irq_lock, flags);
186}
187
188static unsigned int startup_crime_irq(unsigned int irq)
189{
190 enable_crime_irq(irq);
191 return 0; /* This is probably not right; we could have pending irqs */
192} 166}
193 167
194static void disable_crime_irq(unsigned int irq) 168static void disable_crime_irq(unsigned int irq)
195{ 169{
196 unsigned long flags;
197
198 spin_lock_irqsave(&ip32_irq_lock, flags);
199 crime_mask &= ~(1 << (irq - 1)); 170 crime_mask &= ~(1 << (irq - 1));
200 crime->imask = crime_mask; 171 crime->imask = crime_mask;
201 flush_crime_bus(); 172 flush_crime_bus();
202 spin_unlock_irqrestore(&ip32_irq_lock, flags);
203} 173}
204 174
205static void mask_and_ack_crime_irq(unsigned int irq) 175static void mask_and_ack_crime_irq(unsigned int irq)
206{ 176{
207 unsigned long flags;
208
209 /* Edge triggered interrupts must be cleared. */ 177 /* Edge triggered interrupts must be cleared. */
210 if ((irq >= CRIME_GBE0_IRQ && irq <= CRIME_GBE3_IRQ) 178 if ((irq >= CRIME_GBE0_IRQ && irq <= CRIME_GBE3_IRQ)
211 || (irq >= CRIME_RE_EMPTY_E_IRQ && irq <= CRIME_RE_IDLE_E_IRQ) 179 || (irq >= CRIME_RE_EMPTY_E_IRQ && irq <= CRIME_RE_IDLE_E_IRQ)
212 || (irq >= CRIME_SOFT0_IRQ && irq <= CRIME_SOFT2_IRQ)) { 180 || (irq >= CRIME_SOFT0_IRQ && irq <= CRIME_SOFT2_IRQ)) {
213 uint64_t crime_int; 181 uint64_t crime_int;
214 spin_lock_irqsave(&ip32_irq_lock, flags);
215 crime_int = crime->hard_int; 182 crime_int = crime->hard_int;
216 crime_int &= ~(1 << (irq - 1)); 183 crime_int &= ~(1 << (irq - 1));
217 crime->hard_int = crime_int; 184 crime->hard_int = crime_int;
218 spin_unlock_irqrestore(&ip32_irq_lock, flags);
219 } 185 }
220 disable_crime_irq(irq); 186 disable_crime_irq(irq);
221} 187}
@@ -226,15 +192,12 @@ static void end_crime_irq(unsigned int irq)
226 enable_crime_irq(irq); 192 enable_crime_irq(irq);
227} 193}
228 194
229#define shutdown_crime_irq disable_crime_irq
230
231static struct irq_chip ip32_crime_interrupt = { 195static struct irq_chip ip32_crime_interrupt = {
232 .typename = "IP32 CRIME", 196 .typename = "IP32 CRIME",
233 .startup = startup_crime_irq,
234 .shutdown = shutdown_crime_irq,
235 .enable = enable_crime_irq,
236 .disable = disable_crime_irq,
237 .ack = mask_and_ack_crime_irq, 197 .ack = mask_and_ack_crime_irq,
198 .mask = disable_crime_irq,
199 .mask_ack = mask_and_ack_crime_irq,
200 .unmask = enable_crime_irq,
238 .end = end_crime_irq, 201 .end = end_crime_irq,
239}; 202};
240 203
@@ -248,34 +211,20 @@ static unsigned long macepci_mask;
248 211
249static void enable_macepci_irq(unsigned int irq) 212static void enable_macepci_irq(unsigned int irq)
250{ 213{
251 unsigned long flags;
252
253 spin_lock_irqsave(&ip32_irq_lock, flags);
254 macepci_mask |= MACEPCI_CONTROL_INT(irq - 9); 214 macepci_mask |= MACEPCI_CONTROL_INT(irq - 9);
255 mace->pci.control = macepci_mask; 215 mace->pci.control = macepci_mask;
256 crime_mask |= 1 << (irq - 1); 216 crime_mask |= 1 << (irq - 1);
257 crime->imask = crime_mask; 217 crime->imask = crime_mask;
258 spin_unlock_irqrestore(&ip32_irq_lock, flags);
259}
260
261static unsigned int startup_macepci_irq(unsigned int irq)
262{
263 enable_macepci_irq (irq);
264 return 0;
265} 218}
266 219
267static void disable_macepci_irq(unsigned int irq) 220static void disable_macepci_irq(unsigned int irq)
268{ 221{
269 unsigned long flags;
270
271 spin_lock_irqsave(&ip32_irq_lock, flags);
272 crime_mask &= ~(1 << (irq - 1)); 222 crime_mask &= ~(1 << (irq - 1));
273 crime->imask = crime_mask; 223 crime->imask = crime_mask;
274 flush_crime_bus(); 224 flush_crime_bus();
275 macepci_mask &= ~MACEPCI_CONTROL_INT(irq - 9); 225 macepci_mask &= ~MACEPCI_CONTROL_INT(irq - 9);
276 mace->pci.control = macepci_mask; 226 mace->pci.control = macepci_mask;
277 flush_mace_bus(); 227 flush_mace_bus();
278 spin_unlock_irqrestore(&ip32_irq_lock, flags);
279} 228}
280 229
281static void end_macepci_irq(unsigned int irq) 230static void end_macepci_irq(unsigned int irq)
@@ -284,16 +233,12 @@ static void end_macepci_irq(unsigned int irq)
284 enable_macepci_irq(irq); 233 enable_macepci_irq(irq);
285} 234}
286 235
287#define shutdown_macepci_irq disable_macepci_irq
288#define mask_and_ack_macepci_irq disable_macepci_irq
289
290static struct irq_chip ip32_macepci_interrupt = { 236static struct irq_chip ip32_macepci_interrupt = {
291 .typename = "IP32 MACE PCI", 237 .typename = "IP32 MACE PCI",
292 .startup = startup_macepci_irq, 238 .ack = disable_macepci_irq,
293 .shutdown = shutdown_macepci_irq, 239 .mask = disable_macepci_irq,
294 .enable = enable_macepci_irq, 240 .mask_ack = disable_macepci_irq,
295 .disable = disable_macepci_irq, 241 .unmask = enable_macepci_irq,
296 .ack = mask_and_ack_macepci_irq,
297 .end = end_macepci_irq, 242 .end = end_macepci_irq,
298}; 243};
299 244
@@ -339,7 +284,6 @@ static unsigned long maceisa_mask;
339static void enable_maceisa_irq (unsigned int irq) 284static void enable_maceisa_irq (unsigned int irq)
340{ 285{
341 unsigned int crime_int = 0; 286 unsigned int crime_int = 0;
342 unsigned long flags;
343 287
344 DBG ("maceisa enable: %u\n", irq); 288 DBG ("maceisa enable: %u\n", irq);
345 289
@@ -355,26 +299,16 @@ static void enable_maceisa_irq (unsigned int irq)
355 break; 299 break;
356 } 300 }
357 DBG ("crime_int %08x enabled\n", crime_int); 301 DBG ("crime_int %08x enabled\n", crime_int);
358 spin_lock_irqsave(&ip32_irq_lock, flags);
359 crime_mask |= crime_int; 302 crime_mask |= crime_int;
360 crime->imask = crime_mask; 303 crime->imask = crime_mask;
361 maceisa_mask |= 1 << (irq - 33); 304 maceisa_mask |= 1 << (irq - 33);
362 mace->perif.ctrl.imask = maceisa_mask; 305 mace->perif.ctrl.imask = maceisa_mask;
363 spin_unlock_irqrestore(&ip32_irq_lock, flags);
364}
365
366static unsigned int startup_maceisa_irq(unsigned int irq)
367{
368 enable_maceisa_irq(irq);
369 return 0;
370} 306}
371 307
372static void disable_maceisa_irq(unsigned int irq) 308static void disable_maceisa_irq(unsigned int irq)
373{ 309{
374 unsigned int crime_int = 0; 310 unsigned int crime_int = 0;
375 unsigned long flags;
376 311
377 spin_lock_irqsave(&ip32_irq_lock, flags);
378 maceisa_mask &= ~(1 << (irq - 33)); 312 maceisa_mask &= ~(1 << (irq - 33));
379 if(!(maceisa_mask & MACEISA_AUDIO_INT)) 313 if(!(maceisa_mask & MACEISA_AUDIO_INT))
380 crime_int |= MACE_AUDIO_INT; 314 crime_int |= MACE_AUDIO_INT;
@@ -387,23 +321,20 @@ static void disable_maceisa_irq(unsigned int irq)
387 flush_crime_bus(); 321 flush_crime_bus();
388 mace->perif.ctrl.imask = maceisa_mask; 322 mace->perif.ctrl.imask = maceisa_mask;
389 flush_mace_bus(); 323 flush_mace_bus();
390 spin_unlock_irqrestore(&ip32_irq_lock, flags);
391} 324}
392 325
393static void mask_and_ack_maceisa_irq(unsigned int irq) 326static void mask_and_ack_maceisa_irq(unsigned int irq)
394{ 327{
395 unsigned long mace_int, flags; 328 unsigned long mace_int;
396 329
397 switch (irq) { 330 switch (irq) {
398 case MACEISA_PARALLEL_IRQ: 331 case MACEISA_PARALLEL_IRQ:
399 case MACEISA_SERIAL1_TDMAPR_IRQ: 332 case MACEISA_SERIAL1_TDMAPR_IRQ:
400 case MACEISA_SERIAL2_TDMAPR_IRQ: 333 case MACEISA_SERIAL2_TDMAPR_IRQ:
401 /* edge triggered */ 334 /* edge triggered */
402 spin_lock_irqsave(&ip32_irq_lock, flags);
403 mace_int = mace->perif.ctrl.istat; 335 mace_int = mace->perif.ctrl.istat;
404 mace_int &= ~(1 << (irq - 33)); 336 mace_int &= ~(1 << (irq - 33));
405 mace->perif.ctrl.istat = mace_int; 337 mace->perif.ctrl.istat = mace_int;
406 spin_unlock_irqrestore(&ip32_irq_lock, flags);
407 break; 338 break;
408 } 339 }
409 disable_maceisa_irq(irq); 340 disable_maceisa_irq(irq);
@@ -415,15 +346,12 @@ static void end_maceisa_irq(unsigned irq)
415 enable_maceisa_irq(irq); 346 enable_maceisa_irq(irq);
416} 347}
417 348
418#define shutdown_maceisa_irq disable_maceisa_irq
419
420static struct irq_chip ip32_maceisa_interrupt = { 349static struct irq_chip ip32_maceisa_interrupt = {
421 .typename = "IP32 MACE ISA", 350 .typename = "IP32 MACE ISA",
422 .startup = startup_maceisa_irq,
423 .shutdown = shutdown_maceisa_irq,
424 .enable = enable_maceisa_irq,
425 .disable = disable_maceisa_irq,
426 .ack = mask_and_ack_maceisa_irq, 351 .ack = mask_and_ack_maceisa_irq,
352 .mask = disable_maceisa_irq,
353 .mask_ack = mask_and_ack_maceisa_irq,
354 .unmask = enable_maceisa_irq,
427 .end = end_maceisa_irq, 355 .end = end_maceisa_irq,
428}; 356};
429 357
@@ -433,29 +361,15 @@ static struct irq_chip ip32_maceisa_interrupt = {
433 361
434static void enable_mace_irq(unsigned int irq) 362static void enable_mace_irq(unsigned int irq)
435{ 363{
436 unsigned long flags;
437
438 spin_lock_irqsave(&ip32_irq_lock, flags);
439 crime_mask |= 1 << (irq - 1); 364 crime_mask |= 1 << (irq - 1);
440 crime->imask = crime_mask; 365 crime->imask = crime_mask;
441 spin_unlock_irqrestore(&ip32_irq_lock, flags);
442}
443
444static unsigned int startup_mace_irq(unsigned int irq)
445{
446 enable_mace_irq(irq);
447 return 0;
448} 366}
449 367
450static void disable_mace_irq(unsigned int irq) 368static void disable_mace_irq(unsigned int irq)
451{ 369{
452 unsigned long flags;
453
454 spin_lock_irqsave(&ip32_irq_lock, flags);
455 crime_mask &= ~(1 << (irq - 1)); 370 crime_mask &= ~(1 << (irq - 1));
456 crime->imask = crime_mask; 371 crime->imask = crime_mask;
457 flush_crime_bus(); 372 flush_crime_bus();
458 spin_unlock_irqrestore(&ip32_irq_lock, flags);
459} 373}
460 374
461static void end_mace_irq(unsigned int irq) 375static void end_mace_irq(unsigned int irq)
@@ -464,16 +378,12 @@ static void end_mace_irq(unsigned int irq)
464 enable_mace_irq(irq); 378 enable_mace_irq(irq);
465} 379}
466 380
467#define shutdown_mace_irq disable_mace_irq
468#define mask_and_ack_mace_irq disable_mace_irq
469
470static struct irq_chip ip32_mace_interrupt = { 381static struct irq_chip ip32_mace_interrupt = {
471 .typename = "IP32 MACE", 382 .typename = "IP32 MACE",
472 .startup = startup_mace_irq, 383 .ack = disable_mace_irq,
473 .shutdown = shutdown_mace_irq, 384 .mask = disable_mace_irq,
474 .enable = enable_mace_irq, 385 .mask_ack = disable_mace_irq,
475 .disable = disable_mace_irq, 386 .unmask = enable_mace_irq,
476 .ack = mask_and_ack_mace_irq,
477 .end = end_mace_irq, 387 .end = end_mace_irq,
478}; 388};
479 389
@@ -586,10 +496,7 @@ void __init arch_init_irq(void)
586 else 496 else
587 controller = &ip32_maceisa_interrupt; 497 controller = &ip32_maceisa_interrupt;
588 498
589 irq_desc[irq].status = IRQ_DISABLED; 499 set_irq_chip(irq, controller);
590 irq_desc[irq].action = 0;
591 irq_desc[irq].depth = 0;
592 irq_desc[irq].chip = controller;
593 } 500 }
594 setup_irq(CRIME_MEMERR_IRQ, &memerr_irq); 501 setup_irq(CRIME_MEMERR_IRQ, &memerr_irq);
595 setup_irq(CRIME_CPUERR_IRQ, &cpuerr_irq); 502 setup_irq(CRIME_CPUERR_IRQ, &cpuerr_irq);
diff --git a/arch/mips/sgi-ip32/ip32-reset.c b/arch/mips/sgi-ip32/ip32-reset.c
index fd0932b2d52..db808441153 100644
--- a/arch/mips/sgi-ip32/ip32-reset.c
+++ b/arch/mips/sgi-ip32/ip32-reset.c
@@ -135,7 +135,7 @@ static inline void ip32_power_button(void)
135 add_timer(&power_timer); 135 add_timer(&power_timer);
136} 136}
137 137
138static irqreturn_t ip32_rtc_int(int irq, void *dev_id, struct pt_regs *regs) 138static irqreturn_t ip32_rtc_int(int irq, void *dev_id)
139{ 139{
140 volatile unsigned char reg_c; 140 volatile unsigned char reg_c;
141 141
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index 8b1f4148492..2e8f6b2e242 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -45,11 +45,9 @@
45 */ 45 */
46 46
47 47
48#define shutdown_bcm1480_irq disable_bcm1480_irq
49static void end_bcm1480_irq(unsigned int irq); 48static void end_bcm1480_irq(unsigned int irq);
50static void enable_bcm1480_irq(unsigned int irq); 49static void enable_bcm1480_irq(unsigned int irq);
51static void disable_bcm1480_irq(unsigned int irq); 50static void disable_bcm1480_irq(unsigned int irq);
52static unsigned int startup_bcm1480_irq(unsigned int irq);
53static void ack_bcm1480_irq(unsigned int irq); 51static void ack_bcm1480_irq(unsigned int irq);
54#ifdef CONFIG_SMP 52#ifdef CONFIG_SMP
55static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask); 53static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask);
@@ -85,11 +83,10 @@ extern char sb1250_duart_present[];
85 83
86static struct irq_chip bcm1480_irq_type = { 84static struct irq_chip bcm1480_irq_type = {
87 .typename = "BCM1480-IMR", 85 .typename = "BCM1480-IMR",
88 .startup = startup_bcm1480_irq,
89 .shutdown = shutdown_bcm1480_irq,
90 .enable = enable_bcm1480_irq,
91 .disable = disable_bcm1480_irq,
92 .ack = ack_bcm1480_irq, 86 .ack = ack_bcm1480_irq,
87 .mask = disable_bcm1480_irq,
88 .mask_ack = ack_bcm1480_irq,
89 .unmask = enable_bcm1480_irq,
93 .end = end_bcm1480_irq, 90 .end = end_bcm1480_irq,
94#ifdef CONFIG_SMP 91#ifdef CONFIG_SMP
95 .set_affinity = bcm1480_set_affinity 92 .set_affinity = bcm1480_set_affinity
@@ -188,14 +185,6 @@ static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask)
188 185
189/*****************************************************************************/ 186/*****************************************************************************/
190 187
191static unsigned int startup_bcm1480_irq(unsigned int irq)
192{
193 bcm1480_unmask_irq(bcm1480_irq_owner[irq], irq);
194
195 return 0; /* never anything pending */
196}
197
198
199static void disable_bcm1480_irq(unsigned int irq) 188static void disable_bcm1480_irq(unsigned int irq)
200{ 189{
201 bcm1480_mask_irq(bcm1480_irq_owner[irq], irq); 190 bcm1480_mask_irq(bcm1480_irq_owner[irq], irq);
@@ -270,16 +259,9 @@ void __init init_bcm1480_irqs(void)
270{ 259{
271 int i; 260 int i;
272 261
273 for (i = 0; i < NR_IRQS; i++) { 262 for (i = 0; i < BCM1480_NR_IRQS; i++) {
274 irq_desc[i].status = IRQ_DISABLED; 263 set_irq_chip(i, &bcm1480_irq_type);
275 irq_desc[i].action = 0; 264 bcm1480_irq_owner[i] = 0;
276 irq_desc[i].depth = 1;
277 if (i < BCM1480_NR_IRQS) {
278 irq_desc[i].chip = &bcm1480_irq_type;
279 bcm1480_irq_owner[i] = 0;
280 } else {
281 irq_desc[i].chip = &no_irq_chip;
282 }
283 } 265 }
284} 266}
285 267
diff --git a/arch/mips/sibyte/bcm1480/time.c b/arch/mips/sibyte/bcm1480/time.c
index bf12af46132..6f3f71bf424 100644
--- a/arch/mips/sibyte/bcm1480/time.c
+++ b/arch/mips/sibyte/bcm1480/time.c
@@ -47,6 +47,12 @@
47#define IMR_IP3_VAL K_BCM1480_INT_MAP_I1 47#define IMR_IP3_VAL K_BCM1480_INT_MAP_I1
48#define IMR_IP4_VAL K_BCM1480_INT_MAP_I2 48#define IMR_IP4_VAL K_BCM1480_INT_MAP_I2
49 49
50#ifdef CONFIG_SIMULATION
51#define BCM1480_HPT_VALUE 50000
52#else
53#define BCM1480_HPT_VALUE 1000000
54#endif
55
50extern int bcm1480_steal_irq(int irq); 56extern int bcm1480_steal_irq(int irq);
51 57
52void bcm1480_time_init(void) 58void bcm1480_time_init(void)
@@ -59,11 +65,6 @@ void bcm1480_time_init(void)
59 BUG(); 65 BUG();
60 } 66 }
61 67
62 if (!cpu) {
63 /* Use our own gettimeoffset() routine */
64 do_gettimeoffset = bcm1480_gettimeoffset;
65 }
66
67 bcm1480_mask_irq(cpu, irq); 68 bcm1480_mask_irq(cpu, irq);
68 69
69 /* Map the timer interrupt to ip[4] of this cpu */ 70 /* Map the timer interrupt to ip[4] of this cpu */
@@ -74,11 +75,7 @@ void bcm1480_time_init(void)
74 /* Disable the timer and set up the count */ 75 /* Disable the timer and set up the count */
75 __raw_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)));
76 __raw_writeq( 77 __raw_writeq(
77#ifndef CONFIG_SIMULATION 78 BCM1480_HPT_VALUE/HZ
78 1000000/HZ
79#else
80 50000/HZ
81#endif
82 , IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); 79 , IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)));
83 80
84 /* Set the timer running */ 81 /* Set the timer running */
@@ -97,8 +94,6 @@ void bcm1480_time_init(void)
97 */ 94 */
98} 95}
99 96
100#include <asm/sibyte/sb1250.h>
101
102void bcm1480_timer_interrupt(void) 97void bcm1480_timer_interrupt(void)
103{ 98{
104 int cpu = smp_processor_id(); 99 int cpu = smp_processor_id();
@@ -122,16 +117,16 @@ void bcm1480_timer_interrupt(void)
122 } 117 }
123} 118}
124 119
125/* 120static cycle_t bcm1480_hpt_read(void)
126 * We use our own do_gettimeoffset() instead of the generic one,
127 * because the generic one does not work for SMP case.
128 * In addition, since we use general timer 0 for system time,
129 * we can get accurate intra-jiffy offset without calibration.
130 */
131unsigned long bcm1480_gettimeoffset(void)
132{ 121{
122 /* We assume this function is called xtime_lock held. */
133 unsigned long count = 123 unsigned long count =
134 __raw_readq(IOADDR(A_SCD_TIMER_REGISTER(0, R_SCD_TIMER_CNT))); 124 __raw_readq(IOADDR(A_SCD_TIMER_REGISTER(0, R_SCD_TIMER_CNT)));
125 return (jiffies + 1) * (BCM1480_HPT_VALUE / HZ) - count;
126}
135 127
136 return 1000000/HZ - count; 128void __init bcm1480_hpt_setup(void)
129{
130 clocksource_mips.read = bcm1480_hpt_read;
131 mips_hpt_frequency = BCM1480_HPT_VALUE;
137} 132}
diff --git a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c
index 992e0d8dbb6..d1a906e683b 100644
--- a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c
+++ b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c
@@ -88,7 +88,7 @@ static void arm_tb(void)
88 sbp.tb_armed = 1; 88 sbp.tb_armed = 1;
89} 89}
90 90
91static irqreturn_t sbprof_tb_intr(int irq, void *dev_id, struct pt_regs *regs) 91static irqreturn_t sbprof_tb_intr(int irq, void *dev_id)
92{ 92{
93 int i; 93 int i;
94 DBG(printk(DEVNAME ": tb_intr\n")); 94 DBG(printk(DEVNAME ": tb_intr\n"));
@@ -138,7 +138,7 @@ static irqreturn_t sbprof_tb_intr(int irq, void *dev_id, struct pt_regs *regs)
138 return IRQ_HANDLED; 138 return IRQ_HANDLED;
139} 139}
140 140
141static irqreturn_t sbprof_pc_intr(int irq, void *dev_id, struct pt_regs *regs) 141static irqreturn_t sbprof_pc_intr(int irq, void *dev_id)
142{ 142{
143 printk(DEVNAME ": unexpected pc_intr"); 143 printk(DEVNAME ": unexpected pc_intr");
144 return IRQ_NONE; 144 return IRQ_NONE;
diff --git a/arch/mips/sibyte/sb1250/bus_watcher.c b/arch/mips/sibyte/sb1250/bus_watcher.c
index bb90649fbc4..45274bd3cd8 100644
--- a/arch/mips/sibyte/sb1250/bus_watcher.c
+++ b/arch/mips/sibyte/sb1250/bus_watcher.c
@@ -171,7 +171,7 @@ static void create_proc_decoder(struct bw_stats_struct *stats)
171 * notes: possible re-entry due to multiple sources 171 * notes: possible re-entry due to multiple sources
172 * should check/indicate saturation 172 * should check/indicate saturation
173 */ 173 */
174static irqreturn_t sibyte_bw_int(int irq, void *data, struct pt_regs *regs) 174static irqreturn_t sibyte_bw_int(int irq, void *data)
175{ 175{
176 struct bw_stats_struct *stats = data; 176 struct bw_stats_struct *stats = data;
177 unsigned long cntr; 177 unsigned long cntr;
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index d5d26770daf..82ce7533053 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -44,11 +44,9 @@
44 */ 44 */
45 45
46 46
47#define shutdown_sb1250_irq disable_sb1250_irq
48static void end_sb1250_irq(unsigned int irq); 47static void end_sb1250_irq(unsigned int irq);
49static void enable_sb1250_irq(unsigned int irq); 48static void enable_sb1250_irq(unsigned int irq);
50static void disable_sb1250_irq(unsigned int irq); 49static void disable_sb1250_irq(unsigned int irq);
51static unsigned int startup_sb1250_irq(unsigned int irq);
52static void ack_sb1250_irq(unsigned int irq); 50static void ack_sb1250_irq(unsigned int irq);
53#ifdef CONFIG_SMP 51#ifdef CONFIG_SMP
54static void sb1250_set_affinity(unsigned int irq, cpumask_t mask); 52static void sb1250_set_affinity(unsigned int irq, cpumask_t mask);
@@ -70,11 +68,10 @@ extern char sb1250_duart_present[];
70 68
71static struct irq_chip sb1250_irq_type = { 69static struct irq_chip sb1250_irq_type = {
72 .typename = "SB1250-IMR", 70 .typename = "SB1250-IMR",
73 .startup = startup_sb1250_irq,
74 .shutdown = shutdown_sb1250_irq,
75 .enable = enable_sb1250_irq,
76 .disable = disable_sb1250_irq,
77 .ack = ack_sb1250_irq, 71 .ack = ack_sb1250_irq,
72 .mask = disable_sb1250_irq,
73 .mask_ack = ack_sb1250_irq,
74 .unmask = enable_sb1250_irq,
78 .end = end_sb1250_irq, 75 .end = end_sb1250_irq,
79#ifdef CONFIG_SMP 76#ifdef CONFIG_SMP
80 .set_affinity = sb1250_set_affinity 77 .set_affinity = sb1250_set_affinity
@@ -163,14 +160,6 @@ static void sb1250_set_affinity(unsigned int irq, cpumask_t mask)
163 160
164/*****************************************************************************/ 161/*****************************************************************************/
165 162
166static unsigned int startup_sb1250_irq(unsigned int irq)
167{
168 sb1250_unmask_irq(sb1250_irq_owner[irq], irq);
169
170 return 0; /* never anything pending */
171}
172
173
174static void disable_sb1250_irq(unsigned int irq) 163static void disable_sb1250_irq(unsigned int irq)
175{ 164{
176 sb1250_mask_irq(sb1250_irq_owner[irq], irq); 165 sb1250_mask_irq(sb1250_irq_owner[irq], irq);
@@ -239,16 +228,9 @@ void __init init_sb1250_irqs(void)
239{ 228{
240 int i; 229 int i;
241 230
242 for (i = 0; i < NR_IRQS; i++) { 231 for (i = 0; i < SB1250_NR_IRQS; i++) {
243 irq_desc[i].status = IRQ_DISABLED; 232 set_irq_chip(i, &sb1250_irq_type);
244 irq_desc[i].action = 0; 233 sb1250_irq_owner[i] = 0;
245 irq_desc[i].depth = 1;
246 if (i < SB1250_NR_IRQS) {
247 irq_desc[i].chip = &sb1250_irq_type;
248 sb1250_irq_owner[i] = 0;
249 } else {
250 irq_desc[i].chip = &no_irq_chip;
251 }
252 } 234 }
253} 235}
254 236
diff --git a/arch/mips/sibyte/sb1250/time.c b/arch/mips/sibyte/sb1250/time.c
index 0ccf1796dd7..2efffe15ff2 100644
--- a/arch/mips/sibyte/sb1250/time.c
+++ b/arch/mips/sibyte/sb1250/time.c
@@ -47,15 +47,11 @@
47 47
48#define SB1250_HPT_NUM 3 48#define SB1250_HPT_NUM 3
49#define SB1250_HPT_VALUE M_SCD_TIMER_CNT /* max value */ 49#define SB1250_HPT_VALUE M_SCD_TIMER_CNT /* max value */
50#define SB1250_HPT_SHIFT ((sizeof(unsigned int)*8)-V_SCD_TIMER_WIDTH)
51 50
52 51
53extern int sb1250_steal_irq(int irq); 52extern int sb1250_steal_irq(int irq);
54 53
55static unsigned int sb1250_hpt_read(void); 54static cycle_t sb1250_hpt_read(void);
56static void sb1250_hpt_init(unsigned int);
57
58static unsigned int hpt_offset;
59 55
60void __init sb1250_hpt_setup(void) 56void __init sb1250_hpt_setup(void)
61{ 57{
@@ -69,13 +65,9 @@ void __init sb1250_hpt_setup(void)
69 __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS, 65 __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
70 IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, R_SCD_TIMER_CFG))); 66 IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, R_SCD_TIMER_CFG)));
71 67
72 /* 68 mips_hpt_frequency = V_SCD_TIMER_FREQ;
73 * we need to fill 32 bits, so just use the upper 23 bits and pretend 69 clocksource_mips.read = sb1250_hpt_read;
74 * the timer is going 512Mhz instead of 1Mhz 70 clocksource_mips.mask = M_SCD_TIMER_INIT;
75 */
76 mips_hpt_frequency = V_SCD_TIMER_FREQ << SB1250_HPT_SHIFT;
77 mips_hpt_init = sb1250_hpt_init;
78 mips_hpt_read = sb1250_hpt_read;
79 } 71 }
80} 72}
81 73
@@ -149,25 +141,13 @@ void sb1250_timer_interrupt(void)
149 141
150/* 142/*
151 * The HPT is free running from SB1250_HPT_VALUE down to 0 then starts over 143 * The HPT is free running from SB1250_HPT_VALUE down to 0 then starts over
152 * again. There's no easy way to set to a specific value so store init value 144 * again.
153 * in hpt_offset and subtract each time.
154 *
155 * Note: Timer isn't full 32bits so shift it into the upper part making
156 * it appear to run at a higher frequency.
157 */ 145 */
158static unsigned int sb1250_hpt_read(void) 146static cycle_t sb1250_hpt_read(void)
159{ 147{
160 unsigned int count; 148 unsigned int count;
161 149
162 count = G_SCD_TIMER_CNT(__raw_readq(IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, R_SCD_TIMER_CNT)))); 150 count = G_SCD_TIMER_CNT(__raw_readq(IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, R_SCD_TIMER_CNT))));
163 151
164 count = (SB1250_HPT_VALUE - count) << SB1250_HPT_SHIFT; 152 return SB1250_HPT_VALUE - count;
165
166 return count - hpt_offset;
167}
168
169static void sb1250_hpt_init(unsigned int count)
170{
171 hpt_offset = count;
172 return;
173} 153}
diff --git a/arch/mips/sni/irq.c b/arch/mips/sni/irq.c
index 48fb74a7aae..8511bcc6d99 100644
--- a/arch/mips/sni/irq.c
+++ b/arch/mips/sni/irq.c
@@ -11,44 +11,25 @@
11#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/irq.h> 12#include <linux/irq.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/spinlock.h>
15 14
16#include <asm/i8259.h> 15#include <asm/i8259.h>
17#include <asm/io.h> 16#include <asm/io.h>
18#include <asm/sni.h> 17#include <asm/sni.h>
19 18
20DEFINE_SPINLOCK(pciasic_lock);
21
22static void enable_pciasic_irq(unsigned int irq) 19static void enable_pciasic_irq(unsigned int irq)
23{ 20{
24 unsigned int mask = 1 << (irq - PCIMT_IRQ_INT2); 21 unsigned int mask = 1 << (irq - PCIMT_IRQ_INT2);
25 unsigned long flags;
26 22
27 spin_lock_irqsave(&pciasic_lock, flags);
28 *(volatile u8 *) PCIMT_IRQSEL |= mask; 23 *(volatile u8 *) PCIMT_IRQSEL |= mask;
29 spin_unlock_irqrestore(&pciasic_lock, flags);
30}
31
32static unsigned int startup_pciasic_irq(unsigned int irq)
33{
34 enable_pciasic_irq(irq);
35 return 0; /* never anything pending */
36} 24}
37 25
38#define shutdown_pciasic_irq disable_pciasic_irq
39
40void disable_pciasic_irq(unsigned int irq) 26void disable_pciasic_irq(unsigned int irq)
41{ 27{
42 unsigned int mask = ~(1 << (irq - PCIMT_IRQ_INT2)); 28 unsigned int mask = ~(1 << (irq - PCIMT_IRQ_INT2));
43 unsigned long flags;
44 29
45 spin_lock_irqsave(&pciasic_lock, flags);
46 *(volatile u8 *) PCIMT_IRQSEL &= mask; 30 *(volatile u8 *) PCIMT_IRQSEL &= mask;
47 spin_unlock_irqrestore(&pciasic_lock, flags);
48} 31}
49 32
50#define mask_and_ack_pciasic_irq disable_pciasic_irq
51
52static void end_pciasic_irq(unsigned int irq) 33static void end_pciasic_irq(unsigned int irq)
53{ 34{
54 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 35 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
@@ -57,11 +38,10 @@ static void end_pciasic_irq(unsigned int irq)
57 38
58static struct irq_chip pciasic_irq_type = { 39static struct irq_chip pciasic_irq_type = {
59 .typename = "ASIC-PCI", 40 .typename = "ASIC-PCI",
60 .startup = startup_pciasic_irq, 41 .ack = disable_pciasic_irq,
61 .shutdown = shutdown_pciasic_irq, 42 .mask = disable_pciasic_irq,
62 .enable = enable_pciasic_irq, 43 .mask_ack = disable_pciasic_irq,
63 .disable = disable_pciasic_irq, 44 .unmask = enable_pciasic_irq,
64 .ack = mask_and_ack_pciasic_irq,
65 .end = end_pciasic_irq, 45 .end = end_pciasic_irq,
66}; 46};
67 47
@@ -178,12 +158,8 @@ asmlinkage void plat_irq_dispatch(void)
178 158
179void __init init_pciasic(void) 159void __init init_pciasic(void)
180{ 160{
181 unsigned long flags;
182
183 spin_lock_irqsave(&pciasic_lock, flags);
184 * (volatile u8 *) PCIMT_IRQSEL = 161 * (volatile u8 *) PCIMT_IRQSEL =
185 IT_EISA | IT_INTA | IT_INTB | IT_INTC | IT_INTD; 162 IT_EISA | IT_INTA | IT_INTB | IT_INTC | IT_INTD;
186 spin_unlock_irqrestore(&pciasic_lock, flags);
187} 163}
188 164
189/* 165/*
@@ -199,12 +175,8 @@ void __init arch_init_irq(void)
199 init_pciasic(); 175 init_pciasic();
200 176
201 /* Actually we've got more interrupts to handle ... */ 177 /* Actually we've got more interrupts to handle ... */
202 for (i = PCIMT_IRQ_INT2; i <= PCIMT_IRQ_ETHERNET; i++) { 178 for (i = PCIMT_IRQ_INT2; i <= PCIMT_IRQ_ETHERNET; i++)
203 irq_desc[i].status = IRQ_DISABLED; 179 set_irq_chip(i, &pciasic_irq_type);
204 irq_desc[i].action = 0;
205 irq_desc[i].depth = 1;
206 irq_desc[i].chip = &pciasic_irq_type;
207 }
208 180
209 change_c0_status(ST0_IM, IE_IRQ1|IE_IRQ2|IE_IRQ3|IE_IRQ4); 181 change_c0_status(ST0_IM, IE_IRQ1|IE_IRQ2|IE_IRQ3|IE_IRQ4);
210} 182}
diff --git a/arch/mips/tx4927/common/smsc_fdc37m81x.c b/arch/mips/tx4927/common/smsc_fdc37m81x.c
new file mode 100644
index 00000000000..33f517bc9a0
--- /dev/null
+++ b/arch/mips/tx4927/common/smsc_fdc37m81x.c
@@ -0,0 +1,172 @@
1/*
2 * Interface for smsc fdc48m81x Super IO chip
3 *
4 * Author: MontaVista Software, Inc. source@mvista.com
5 *
6 * 2001-2003 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 * Copyright 2004 (c) MontaVista Software, Inc.
12 */
13#include <linux/init.h>
14#include <linux/types.h>
15#include <asm/io.h>
16#include <asm/tx4927/smsc_fdc37m81x.h>
17
18#define DEBUG
19
20/* Common Registers */
21#define SMSC_FDC37M81X_CONFIG_INDEX 0x00
22#define SMSC_FDC37M81X_CONFIG_DATA 0x01
23#define SMSC_FDC37M81X_CONF 0x02
24#define SMSC_FDC37M81X_INDEX 0x03
25#define SMSC_FDC37M81X_DNUM 0x07
26#define SMSC_FDC37M81X_DID 0x20
27#define SMSC_FDC37M81X_DREV 0x21
28#define SMSC_FDC37M81X_PCNT 0x22
29#define SMSC_FDC37M81X_PMGT 0x23
30#define SMSC_FDC37M81X_OSC 0x24
31#define SMSC_FDC37M81X_CONFPA0 0x26
32#define SMSC_FDC37M81X_CONFPA1 0x27
33#define SMSC_FDC37M81X_TEST4 0x2B
34#define SMSC_FDC37M81X_TEST5 0x2C
35#define SMSC_FDC37M81X_TEST1 0x2D
36#define SMSC_FDC37M81X_TEST2 0x2E
37#define SMSC_FDC37M81X_TEST3 0x2F
38
39/* Logical device numbers */
40#define SMSC_FDC37M81X_FDD 0x00
41#define SMSC_FDC37M81X_SERIAL1 0x04
42#define SMSC_FDC37M81X_SERIAL2 0x05
43#define SMSC_FDC37M81X_KBD 0x07
44
45/* Logical device Config Registers */
46#define SMSC_FDC37M81X_ACTIVE 0x30
47#define SMSC_FDC37M81X_BASEADDR0 0x60
48#define SMSC_FDC37M81X_BASEADDR1 0x61
49#define SMSC_FDC37M81X_INT 0x70
50#define SMSC_FDC37M81X_INT2 0x72
51#define SMSC_FDC37M81X_MODE 0xF0
52
53/* Chip Config Values */
54#define SMSC_FDC37M81X_CONFIG_ENTER 0x55
55#define SMSC_FDC37M81X_CONFIG_EXIT 0xaa
56#define SMSC_FDC37M81X_CHIP_ID 0x4d
57
58static unsigned long g_smsc_fdc37m81x_base = 0;
59
60static inline unsigned char smsc_fdc37m81x_rd(unsigned char index)
61{
62 outb(index, g_smsc_fdc37m81x_base + SMSC_FDC37M81X_CONFIG_INDEX);
63
64 return inb(g_smsc_fdc37m81x_base + SMSC_FDC37M81X_CONFIG_DATA);
65}
66
67static inline void smsc_dc37m81x_wr(unsigned char index, unsigned char data)
68{
69 outb(index, g_smsc_fdc37m81x_base + SMSC_FDC37M81X_CONFIG_INDEX);
70 outb(data, g_smsc_fdc37m81x_base + SMSC_FDC37M81X_CONFIG_DATA);
71}
72
73void smsc_fdc37m81x_config_beg(void)
74{
75 if (g_smsc_fdc37m81x_base) {
76 outb(SMSC_FDC37M81X_CONFIG_ENTER,
77 g_smsc_fdc37m81x_base + SMSC_FDC37M81X_CONFIG_INDEX);
78 }
79}
80
81void smsc_fdc37m81x_config_end(void)
82{
83 if (g_smsc_fdc37m81x_base)
84 outb(SMSC_FDC37M81X_CONFIG_EXIT,
85 g_smsc_fdc37m81x_base + SMSC_FDC37M81X_CONFIG_INDEX);
86}
87
88u8 smsc_fdc37m81x_config_get(u8 reg)
89{
90 u8 val = 0;
91
92 if (g_smsc_fdc37m81x_base)
93 val = smsc_fdc37m81x_rd(reg);
94
95 return val;
96}
97
98void smsc_fdc37m81x_config_set(u8 reg, u8 val)
99{
100 if (g_smsc_fdc37m81x_base)
101 smsc_dc37m81x_wr(reg, val);
102}
103
104unsigned long __init smsc_fdc37m81x_init(unsigned long port)
105{
106 const int field = sizeof(unsigned long) * 2;
107 u8 chip_id;
108
109 if (g_smsc_fdc37m81x_base)
110 printk("smsc_fdc37m81x_init() stepping on old base=0x%0*lx\n",
111 field, g_smsc_fdc37m81x_base);
112
113 g_smsc_fdc37m81x_base = port;
114
115 smsc_fdc37m81x_config_beg();
116
117 chip_id = smsc_fdc37m81x_rd(SMSC_FDC37M81X_DID);
118 if (chip_id == SMSC_FDC37M81X_CHIP_ID)
119 smsc_fdc37m81x_config_end();
120 else {
121 printk("smsc_fdc37m81x_init() unknow chip id 0x%02x\n",
122 chip_id);
123 g_smsc_fdc37m81x_base = 0;
124 }
125
126 return g_smsc_fdc37m81x_base;
127}
128
129#ifdef DEBUG
130void smsc_fdc37m81x_config_dump_one(char *key, u8 dev, u8 reg)
131{
132 printk("%s: dev=0x%02x reg=0x%02x val=0x%02x\n", key, dev, reg,
133 smsc_fdc37m81x_rd(reg));
134}
135
136void smsc_fdc37m81x_config_dump(void)
137{
138 u8 orig;
139 char *fname = "smsc_fdc37m81x_config_dump()";
140
141 smsc_fdc37m81x_config_beg();
142
143 orig = smsc_fdc37m81x_rd(SMSC_FDC37M81X_DNUM);
144
145 printk("%s: common\n", fname);
146 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
147 SMSC_FDC37M81X_DNUM);
148 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
149 SMSC_FDC37M81X_DID);
150 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
151 SMSC_FDC37M81X_DREV);
152 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
153 SMSC_FDC37M81X_PCNT);
154 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
155 SMSC_FDC37M81X_PMGT);
156
157 printk("%s: keyboard\n", fname);
158 smsc_dc37m81x_wr(SMSC_FDC37M81X_DNUM, SMSC_FDC37M81X_KBD);
159 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_KBD,
160 SMSC_FDC37M81X_ACTIVE);
161 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_KBD,
162 SMSC_FDC37M81X_INT);
163 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_KBD,
164 SMSC_FDC37M81X_INT2);
165 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_KBD,
166 SMSC_FDC37M81X_LDCR_F0);
167
168 smsc_dc37m81x_wr(SMSC_FDC37M81X_DNUM, orig);
169
170 smsc_fdc37m81x_config_end();
171}
172#endif
diff --git a/arch/mips/tx4927/common/tx4927_irq.c b/arch/mips/tx4927/common/tx4927_irq.c
index 8266a88a3f8..21873de49aa 100644
--- a/arch/mips/tx4927/common/tx4927_irq.c
+++ b/arch/mips/tx4927/common/tx4927_irq.c
@@ -64,19 +64,13 @@
64#define TX4927_IRQ_NEST4 ( 1 << 9 ) 64#define TX4927_IRQ_NEST4 ( 1 << 9 )
65 65
66#define TX4927_IRQ_CP0_INIT ( 1 << 10 ) 66#define TX4927_IRQ_CP0_INIT ( 1 << 10 )
67#define TX4927_IRQ_CP0_STARTUP ( 1 << 11 )
68#define TX4927_IRQ_CP0_SHUTDOWN ( 1 << 12 )
69#define TX4927_IRQ_CP0_ENABLE ( 1 << 13 ) 67#define TX4927_IRQ_CP0_ENABLE ( 1 << 13 )
70#define TX4927_IRQ_CP0_DISABLE ( 1 << 14 ) 68#define TX4927_IRQ_CP0_DISABLE ( 1 << 14 )
71#define TX4927_IRQ_CP0_MASK ( 1 << 15 )
72#define TX4927_IRQ_CP0_ENDIRQ ( 1 << 16 ) 69#define TX4927_IRQ_CP0_ENDIRQ ( 1 << 16 )
73 70
74#define TX4927_IRQ_PIC_INIT ( 1 << 20 ) 71#define TX4927_IRQ_PIC_INIT ( 1 << 20 )
75#define TX4927_IRQ_PIC_STARTUP ( 1 << 21 )
76#define TX4927_IRQ_PIC_SHUTDOWN ( 1 << 22 )
77#define TX4927_IRQ_PIC_ENABLE ( 1 << 23 ) 72#define TX4927_IRQ_PIC_ENABLE ( 1 << 23 )
78#define TX4927_IRQ_PIC_DISABLE ( 1 << 24 ) 73#define TX4927_IRQ_PIC_DISABLE ( 1 << 24 )
79#define TX4927_IRQ_PIC_MASK ( 1 << 25 )
80#define TX4927_IRQ_PIC_ENDIRQ ( 1 << 26 ) 74#define TX4927_IRQ_PIC_ENDIRQ ( 1 << 26 )
81 75
82#define TX4927_IRQ_ALL 0xffffffff 76#define TX4927_IRQ_ALL 0xffffffff
@@ -87,18 +81,12 @@ static const u32 tx4927_irq_debug_flag = (TX4927_IRQ_NONE
87 | TX4927_IRQ_INFO 81 | TX4927_IRQ_INFO
88 | TX4927_IRQ_WARN | TX4927_IRQ_EROR 82 | TX4927_IRQ_WARN | TX4927_IRQ_EROR
89// | TX4927_IRQ_CP0_INIT 83// | TX4927_IRQ_CP0_INIT
90// | TX4927_IRQ_CP0_STARTUP
91// | TX4927_IRQ_CP0_SHUTDOWN
92// | TX4927_IRQ_CP0_ENABLE 84// | TX4927_IRQ_CP0_ENABLE
93// | TX4927_IRQ_CP0_DISABLE 85// | TX4927_IRQ_CP0_DISABLE
94// | TX4927_IRQ_CP0_MASK
95// | TX4927_IRQ_CP0_ENDIRQ 86// | TX4927_IRQ_CP0_ENDIRQ
96// | TX4927_IRQ_PIC_INIT 87// | TX4927_IRQ_PIC_INIT
97// | TX4927_IRQ_PIC_STARTUP
98// | TX4927_IRQ_PIC_SHUTDOWN
99// | TX4927_IRQ_PIC_ENABLE 88// | TX4927_IRQ_PIC_ENABLE
100// | TX4927_IRQ_PIC_DISABLE 89// | TX4927_IRQ_PIC_DISABLE
101// | TX4927_IRQ_PIC_MASK
102// | TX4927_IRQ_PIC_ENDIRQ 90// | TX4927_IRQ_PIC_ENDIRQ
103// | TX4927_IRQ_INIT 91// | TX4927_IRQ_INIT
104// | TX4927_IRQ_NEST1 92// | TX4927_IRQ_NEST1
@@ -124,49 +112,36 @@ static const u32 tx4927_irq_debug_flag = (TX4927_IRQ_NONE
124 * Forwad definitions for all pic's 112 * Forwad definitions for all pic's
125 */ 113 */
126 114
127static unsigned int tx4927_irq_cp0_startup(unsigned int irq);
128static void tx4927_irq_cp0_shutdown(unsigned int irq);
129static void tx4927_irq_cp0_enable(unsigned int irq); 115static void tx4927_irq_cp0_enable(unsigned int irq);
130static void tx4927_irq_cp0_disable(unsigned int irq); 116static void tx4927_irq_cp0_disable(unsigned int irq);
131static void tx4927_irq_cp0_mask_and_ack(unsigned int irq);
132static void tx4927_irq_cp0_end(unsigned int irq); 117static void tx4927_irq_cp0_end(unsigned int irq);
133 118
134static unsigned int tx4927_irq_pic_startup(unsigned int irq);
135static void tx4927_irq_pic_shutdown(unsigned int irq);
136static void tx4927_irq_pic_enable(unsigned int irq); 119static void tx4927_irq_pic_enable(unsigned int irq);
137static void tx4927_irq_pic_disable(unsigned int irq); 120static void tx4927_irq_pic_disable(unsigned int irq);
138static void tx4927_irq_pic_mask_and_ack(unsigned int irq);
139static void tx4927_irq_pic_end(unsigned int irq); 121static void tx4927_irq_pic_end(unsigned int irq);
140 122
141/* 123/*
142 * Kernel structs for all pic's 124 * Kernel structs for all pic's
143 */ 125 */
144 126
145static DEFINE_SPINLOCK(tx4927_cp0_lock);
146static DEFINE_SPINLOCK(tx4927_pic_lock);
147
148#define TX4927_CP0_NAME "TX4927-CP0" 127#define TX4927_CP0_NAME "TX4927-CP0"
149static struct irq_chip tx4927_irq_cp0_type = { 128static struct irq_chip tx4927_irq_cp0_type = {
150 .typename = TX4927_CP0_NAME, 129 .typename = TX4927_CP0_NAME,
151 .startup = tx4927_irq_cp0_startup, 130 .ack = tx4927_irq_cp0_disable,
152 .shutdown = tx4927_irq_cp0_shutdown, 131 .mask = tx4927_irq_cp0_disable,
153 .enable = tx4927_irq_cp0_enable, 132 .mask_ack = tx4927_irq_cp0_disable,
154 .disable = tx4927_irq_cp0_disable, 133 .unmask = tx4927_irq_cp0_enable,
155 .ack = tx4927_irq_cp0_mask_and_ack,
156 .end = tx4927_irq_cp0_end, 134 .end = tx4927_irq_cp0_end,
157 .set_affinity = NULL
158}; 135};
159 136
160#define TX4927_PIC_NAME "TX4927-PIC" 137#define TX4927_PIC_NAME "TX4927-PIC"
161static struct irq_chip tx4927_irq_pic_type = { 138static struct irq_chip tx4927_irq_pic_type = {
162 .typename = TX4927_PIC_NAME, 139 .typename = TX4927_PIC_NAME,
163 .startup = tx4927_irq_pic_startup, 140 .ack = tx4927_irq_pic_disable,
164 .shutdown = tx4927_irq_pic_shutdown, 141 .mask = tx4927_irq_pic_disable,
165 .enable = tx4927_irq_pic_enable, 142 .mask_ack = tx4927_irq_pic_disable,
166 .disable = tx4927_irq_pic_disable, 143 .unmask = tx4927_irq_pic_enable,
167 .ack = tx4927_irq_pic_mask_and_ack,
168 .end = tx4927_irq_pic_end, 144 .end = tx4927_irq_pic_end,
169 .set_affinity = NULL
170}; 145};
171 146
172#define TX4927_PIC_ACTION(s) { no_action, 0, CPU_MASK_NONE, s, NULL, NULL } 147#define TX4927_PIC_ACTION(s) { no_action, 0, CPU_MASK_NONE, s, NULL, NULL }
@@ -211,8 +186,6 @@ tx4927_irq_cp0_modify(unsigned cp0_reg, unsigned clr_bits, unsigned set_bits)
211 break; 186 break;
212 } 187 }
213 } 188 }
214
215 return;
216} 189}
217 190
218static void __init tx4927_irq_cp0_init(void) 191static void __init tx4927_irq_cp0_init(void)
@@ -222,71 +195,23 @@ static void __init tx4927_irq_cp0_init(void)
222 TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_INIT, "beg=%d end=%d\n", 195 TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_INIT, "beg=%d end=%d\n",
223 TX4927_IRQ_CP0_BEG, TX4927_IRQ_CP0_END); 196 TX4927_IRQ_CP0_BEG, TX4927_IRQ_CP0_END);
224 197
225 for (i = TX4927_IRQ_CP0_BEG; i <= TX4927_IRQ_CP0_END; i++) { 198 for (i = TX4927_IRQ_CP0_BEG; i <= TX4927_IRQ_CP0_END; i++)
226 irq_desc[i].status = IRQ_DISABLED; 199 set_irq_chip_and_handler(i, &tx4927_irq_cp0_type,
227 irq_desc[i].action = 0; 200 handle_level_irq);
228 irq_desc[i].depth = 1;
229 irq_desc[i].chip = &tx4927_irq_cp0_type;
230 }
231
232 return;
233}
234
235static unsigned int tx4927_irq_cp0_startup(unsigned int irq)
236{
237 TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_STARTUP, "irq=%d \n", irq);
238
239 tx4927_irq_cp0_enable(irq);
240
241 return (0);
242}
243
244static void tx4927_irq_cp0_shutdown(unsigned int irq)
245{
246 TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_SHUTDOWN, "irq=%d \n", irq);
247
248 tx4927_irq_cp0_disable(irq);
249
250 return;
251} 201}
252 202
253static void tx4927_irq_cp0_enable(unsigned int irq) 203static void tx4927_irq_cp0_enable(unsigned int irq)
254{ 204{
255 unsigned long flags;
256
257 TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_ENABLE, "irq=%d \n", irq); 205 TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_ENABLE, "irq=%d \n", irq);
258 206
259 spin_lock_irqsave(&tx4927_cp0_lock, flags);
260
261 tx4927_irq_cp0_modify(CCP0_STATUS, 0, tx4927_irq_cp0_mask(irq)); 207 tx4927_irq_cp0_modify(CCP0_STATUS, 0, tx4927_irq_cp0_mask(irq));
262
263 spin_unlock_irqrestore(&tx4927_cp0_lock, flags);
264
265 return;
266} 208}
267 209
268static void tx4927_irq_cp0_disable(unsigned int irq) 210static void tx4927_irq_cp0_disable(unsigned int irq)
269{ 211{
270 unsigned long flags;
271
272 TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_DISABLE, "irq=%d \n", irq); 212 TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_DISABLE, "irq=%d \n", irq);
273 213
274 spin_lock_irqsave(&tx4927_cp0_lock, flags);
275
276 tx4927_irq_cp0_modify(CCP0_STATUS, tx4927_irq_cp0_mask(irq), 0); 214 tx4927_irq_cp0_modify(CCP0_STATUS, tx4927_irq_cp0_mask(irq), 0);
277
278 spin_unlock_irqrestore(&tx4927_cp0_lock, flags);
279
280 return;
281}
282
283static void tx4927_irq_cp0_mask_and_ack(unsigned int irq)
284{
285 TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_MASK, "irq=%d \n", irq);
286
287 tx4927_irq_cp0_disable(irq);
288
289 return;
290} 215}
291 216
292static void tx4927_irq_cp0_end(unsigned int irq) 217static void tx4927_irq_cp0_end(unsigned int irq)
@@ -296,8 +221,6 @@ static void tx4927_irq_cp0_end(unsigned int irq)
296 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { 221 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
297 tx4927_irq_cp0_enable(irq); 222 tx4927_irq_cp0_enable(irq);
298 } 223 }
299
300 return;
301} 224}
302 225
303/* 226/*
@@ -418,94 +341,39 @@ static void tx4927_irq_pic_modify(unsigned pic_reg, unsigned clr_bits,
418 val &= (~clr_bits); 341 val &= (~clr_bits);
419 val |= (set_bits); 342 val |= (set_bits);
420 TX4927_WR(pic_reg, val); 343 TX4927_WR(pic_reg, val);
421
422 return;
423} 344}
424 345
425static void __init tx4927_irq_pic_init(void) 346static void __init tx4927_irq_pic_init(void)
426{ 347{
427 unsigned long flags;
428 int i; 348 int i;
429 349
430 TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_INIT, "beg=%d end=%d\n", 350 TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_INIT, "beg=%d end=%d\n",
431 TX4927_IRQ_PIC_BEG, TX4927_IRQ_PIC_END); 351 TX4927_IRQ_PIC_BEG, TX4927_IRQ_PIC_END);
432 352
433 for (i = TX4927_IRQ_PIC_BEG; i <= TX4927_IRQ_PIC_END; i++) { 353 for (i = TX4927_IRQ_PIC_BEG; i <= TX4927_IRQ_PIC_END; i++)
434 irq_desc[i].status = IRQ_DISABLED; 354 set_irq_chip_and_handler(i, &tx4927_irq_pic_type,
435 irq_desc[i].action = 0; 355 handle_level_irq);
436 irq_desc[i].depth = 2;
437 irq_desc[i].chip = &tx4927_irq_pic_type;
438 }
439 356
440 setup_irq(TX4927_IRQ_NEST_PIC_ON_CP0, &tx4927_irq_pic_action); 357 setup_irq(TX4927_IRQ_NEST_PIC_ON_CP0, &tx4927_irq_pic_action);
441 358
442 spin_lock_irqsave(&tx4927_pic_lock, flags);
443
444 TX4927_WR(0xff1ff640, 0x6); /* irq level mask -- only accept hightest */ 359 TX4927_WR(0xff1ff640, 0x6); /* irq level mask -- only accept hightest */
445 TX4927_WR(0xff1ff600, TX4927_RD(0xff1ff600) | 0x1); /* irq enable */ 360 TX4927_WR(0xff1ff600, TX4927_RD(0xff1ff600) | 0x1); /* irq enable */
446
447 spin_unlock_irqrestore(&tx4927_pic_lock, flags);
448
449 return;
450}
451
452static unsigned int tx4927_irq_pic_startup(unsigned int irq)
453{
454 TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_STARTUP, "irq=%d\n", irq);
455
456 tx4927_irq_pic_enable(irq);
457
458 return (0);
459}
460
461static void tx4927_irq_pic_shutdown(unsigned int irq)
462{
463 TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_SHUTDOWN, "irq=%d\n", irq);
464
465 tx4927_irq_pic_disable(irq);
466
467 return;
468} 361}
469 362
470static void tx4927_irq_pic_enable(unsigned int irq) 363static void tx4927_irq_pic_enable(unsigned int irq)
471{ 364{
472 unsigned long flags;
473
474 TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_ENABLE, "irq=%d\n", irq); 365 TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_ENABLE, "irq=%d\n", irq);
475 366
476 spin_lock_irqsave(&tx4927_pic_lock, flags);
477
478 tx4927_irq_pic_modify(tx4927_irq_pic_addr(irq), 0, 367 tx4927_irq_pic_modify(tx4927_irq_pic_addr(irq), 0,
479 tx4927_irq_pic_mask(irq)); 368 tx4927_irq_pic_mask(irq));
480
481 spin_unlock_irqrestore(&tx4927_pic_lock, flags);
482
483 return;
484} 369}
485 370
486static void tx4927_irq_pic_disable(unsigned int irq) 371static void tx4927_irq_pic_disable(unsigned int irq)
487{ 372{
488 unsigned long flags;
489
490 TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_DISABLE, "irq=%d\n", irq); 373 TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_DISABLE, "irq=%d\n", irq);
491 374
492 spin_lock_irqsave(&tx4927_pic_lock, flags);
493
494 tx4927_irq_pic_modify(tx4927_irq_pic_addr(irq), 375 tx4927_irq_pic_modify(tx4927_irq_pic_addr(irq),
495 tx4927_irq_pic_mask(irq), 0); 376 tx4927_irq_pic_mask(irq), 0);
496
497 spin_unlock_irqrestore(&tx4927_pic_lock, flags);
498
499 return;
500}
501
502static void tx4927_irq_pic_mask_and_ack(unsigned int irq)
503{
504 TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_MASK, "irq=%d\n", irq);
505
506 tx4927_irq_pic_disable(irq);
507
508 return;
509} 377}
510 378
511static void tx4927_irq_pic_end(unsigned int irq) 379static void tx4927_irq_pic_end(unsigned int irq)
@@ -515,8 +383,6 @@ static void tx4927_irq_pic_end(unsigned int irq)
515 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { 383 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
516 tx4927_irq_pic_enable(irq); 384 tx4927_irq_pic_enable(irq);
517 } 385 }
518
519 return;
520} 386}
521 387
522/* 388/*
@@ -533,8 +399,6 @@ void __init tx4927_irq_init(void)
533 tx4927_irq_pic_init(); 399 tx4927_irq_pic_init();
534 400
535 TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "+\n"); 401 TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "+\n");
536
537 return;
538} 402}
539 403
540static int tx4927_irq_nested(void) 404static int tx4927_irq_nested(void)
diff --git a/arch/mips/tx4927/common/tx4927_setup.c b/arch/mips/tx4927/common/tx4927_setup.c
index 4658b2ae483..941c441729b 100644
--- a/arch/mips/tx4927/common/tx4927_setup.c
+++ b/arch/mips/tx4927/common/tx4927_setup.c
@@ -112,8 +112,6 @@ void print_cp0(char *key, int num, char *name, u32 val)
112 return; 112 return;
113} 113}
114 114
115indent: Standard input:25: Error:Unexpected end of file
116
117void 115void
118dump_cp0(char *key) 116dump_cp0(char *key)
119{ 117{
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
index 0c3c3f66823..34cdb2a240e 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
@@ -151,16 +151,11 @@ JP7 is not bus master -- do NOT use -- only 4 pci bus master's allowed -- SouthB
151#define TOSHIBA_RBTX4927_IRQ_EROR ( 1 << 2 ) 151#define TOSHIBA_RBTX4927_IRQ_EROR ( 1 << 2 )
152 152
153#define TOSHIBA_RBTX4927_IRQ_IOC_INIT ( 1 << 10 ) 153#define TOSHIBA_RBTX4927_IRQ_IOC_INIT ( 1 << 10 )
154#define TOSHIBA_RBTX4927_IRQ_IOC_STARTUP ( 1 << 11 )
155#define TOSHIBA_RBTX4927_IRQ_IOC_SHUTDOWN ( 1 << 12 )
156#define TOSHIBA_RBTX4927_IRQ_IOC_ENABLE ( 1 << 13 ) 154#define TOSHIBA_RBTX4927_IRQ_IOC_ENABLE ( 1 << 13 )
157#define TOSHIBA_RBTX4927_IRQ_IOC_DISABLE ( 1 << 14 ) 155#define TOSHIBA_RBTX4927_IRQ_IOC_DISABLE ( 1 << 14 )
158#define TOSHIBA_RBTX4927_IRQ_IOC_MASK ( 1 << 15 )
159#define TOSHIBA_RBTX4927_IRQ_IOC_ENDIRQ ( 1 << 16 ) 156#define TOSHIBA_RBTX4927_IRQ_IOC_ENDIRQ ( 1 << 16 )
160 157
161#define TOSHIBA_RBTX4927_IRQ_ISA_INIT ( 1 << 20 ) 158#define TOSHIBA_RBTX4927_IRQ_ISA_INIT ( 1 << 20 )
162#define TOSHIBA_RBTX4927_IRQ_ISA_STARTUP ( 1 << 21 )
163#define TOSHIBA_RBTX4927_IRQ_ISA_SHUTDOWN ( 1 << 22 )
164#define TOSHIBA_RBTX4927_IRQ_ISA_ENABLE ( 1 << 23 ) 159#define TOSHIBA_RBTX4927_IRQ_ISA_ENABLE ( 1 << 23 )
165#define TOSHIBA_RBTX4927_IRQ_ISA_DISABLE ( 1 << 24 ) 160#define TOSHIBA_RBTX4927_IRQ_ISA_DISABLE ( 1 << 24 )
166#define TOSHIBA_RBTX4927_IRQ_ISA_MASK ( 1 << 25 ) 161#define TOSHIBA_RBTX4927_IRQ_ISA_MASK ( 1 << 25 )
@@ -175,15 +170,10 @@ static const u32 toshiba_rbtx4927_irq_debug_flag =
175 (TOSHIBA_RBTX4927_IRQ_NONE | TOSHIBA_RBTX4927_IRQ_INFO | 170 (TOSHIBA_RBTX4927_IRQ_NONE | TOSHIBA_RBTX4927_IRQ_INFO |
176 TOSHIBA_RBTX4927_IRQ_WARN | TOSHIBA_RBTX4927_IRQ_EROR 171 TOSHIBA_RBTX4927_IRQ_WARN | TOSHIBA_RBTX4927_IRQ_EROR
177// | TOSHIBA_RBTX4927_IRQ_IOC_INIT 172// | TOSHIBA_RBTX4927_IRQ_IOC_INIT
178// | TOSHIBA_RBTX4927_IRQ_IOC_STARTUP
179// | TOSHIBA_RBTX4927_IRQ_IOC_SHUTDOWN
180// | TOSHIBA_RBTX4927_IRQ_IOC_ENABLE 173// | TOSHIBA_RBTX4927_IRQ_IOC_ENABLE
181// | TOSHIBA_RBTX4927_IRQ_IOC_DISABLE 174// | TOSHIBA_RBTX4927_IRQ_IOC_DISABLE
182// | TOSHIBA_RBTX4927_IRQ_IOC_MASK
183// | TOSHIBA_RBTX4927_IRQ_IOC_ENDIRQ 175// | TOSHIBA_RBTX4927_IRQ_IOC_ENDIRQ
184// | TOSHIBA_RBTX4927_IRQ_ISA_INIT 176// | TOSHIBA_RBTX4927_IRQ_ISA_INIT
185// | TOSHIBA_RBTX4927_IRQ_ISA_STARTUP
186// | TOSHIBA_RBTX4927_IRQ_ISA_SHUTDOWN
187// | TOSHIBA_RBTX4927_IRQ_ISA_ENABLE 177// | TOSHIBA_RBTX4927_IRQ_ISA_ENABLE
188// | TOSHIBA_RBTX4927_IRQ_ISA_DISABLE 178// | TOSHIBA_RBTX4927_IRQ_ISA_DISABLE
189// | TOSHIBA_RBTX4927_IRQ_ISA_MASK 179// | TOSHIBA_RBTX4927_IRQ_ISA_MASK
@@ -231,35 +221,25 @@ extern void disable_8259A_irq(unsigned int irq);
231extern void mask_and_ack_8259A(unsigned int irq); 221extern void mask_and_ack_8259A(unsigned int irq);
232#endif 222#endif
233 223
234static unsigned int toshiba_rbtx4927_irq_ioc_startup(unsigned int irq);
235static void toshiba_rbtx4927_irq_ioc_shutdown(unsigned int irq);
236static void toshiba_rbtx4927_irq_ioc_enable(unsigned int irq); 224static void toshiba_rbtx4927_irq_ioc_enable(unsigned int irq);
237static void toshiba_rbtx4927_irq_ioc_disable(unsigned int irq); 225static void toshiba_rbtx4927_irq_ioc_disable(unsigned int irq);
238static void toshiba_rbtx4927_irq_ioc_mask_and_ack(unsigned int irq);
239static void toshiba_rbtx4927_irq_ioc_end(unsigned int irq); 226static void toshiba_rbtx4927_irq_ioc_end(unsigned int irq);
240 227
241#ifdef CONFIG_TOSHIBA_FPCIB0 228#ifdef CONFIG_TOSHIBA_FPCIB0
242static unsigned int toshiba_rbtx4927_irq_isa_startup(unsigned int irq);
243static void toshiba_rbtx4927_irq_isa_shutdown(unsigned int irq);
244static void toshiba_rbtx4927_irq_isa_enable(unsigned int irq); 229static void toshiba_rbtx4927_irq_isa_enable(unsigned int irq);
245static void toshiba_rbtx4927_irq_isa_disable(unsigned int irq); 230static void toshiba_rbtx4927_irq_isa_disable(unsigned int irq);
246static void toshiba_rbtx4927_irq_isa_mask_and_ack(unsigned int irq); 231static void toshiba_rbtx4927_irq_isa_mask_and_ack(unsigned int irq);
247static void toshiba_rbtx4927_irq_isa_end(unsigned int irq); 232static void toshiba_rbtx4927_irq_isa_end(unsigned int irq);
248#endif 233#endif
249 234
250static DEFINE_SPINLOCK(toshiba_rbtx4927_ioc_lock);
251
252
253#define TOSHIBA_RBTX4927_IOC_NAME "RBTX4927-IOC" 235#define TOSHIBA_RBTX4927_IOC_NAME "RBTX4927-IOC"
254static struct irq_chip toshiba_rbtx4927_irq_ioc_type = { 236static struct irq_chip toshiba_rbtx4927_irq_ioc_type = {
255 .typename = TOSHIBA_RBTX4927_IOC_NAME, 237 .typename = TOSHIBA_RBTX4927_IOC_NAME,
256 .startup = toshiba_rbtx4927_irq_ioc_startup, 238 .ack = toshiba_rbtx4927_irq_ioc_disable,
257 .shutdown = toshiba_rbtx4927_irq_ioc_shutdown, 239 .mask = toshiba_rbtx4927_irq_ioc_disable,
258 .enable = toshiba_rbtx4927_irq_ioc_enable, 240 .mask_ack = toshiba_rbtx4927_irq_ioc_disable,
259 .disable = toshiba_rbtx4927_irq_ioc_disable, 241 .unmask = toshiba_rbtx4927_irq_ioc_enable,
260 .ack = toshiba_rbtx4927_irq_ioc_mask_and_ack,
261 .end = toshiba_rbtx4927_irq_ioc_end, 242 .end = toshiba_rbtx4927_irq_ioc_end,
262 .set_affinity = NULL
263}; 243};
264#define TOSHIBA_RBTX4927_IOC_INTR_ENAB 0xbc002000 244#define TOSHIBA_RBTX4927_IOC_INTR_ENAB 0xbc002000
265#define TOSHIBA_RBTX4927_IOC_INTR_STAT 0xbc002006 245#define TOSHIBA_RBTX4927_IOC_INTR_STAT 0xbc002006
@@ -269,13 +249,11 @@ static struct irq_chip toshiba_rbtx4927_irq_ioc_type = {
269#define TOSHIBA_RBTX4927_ISA_NAME "RBTX4927-ISA" 249#define TOSHIBA_RBTX4927_ISA_NAME "RBTX4927-ISA"
270static struct irq_chip toshiba_rbtx4927_irq_isa_type = { 250static struct irq_chip toshiba_rbtx4927_irq_isa_type = {
271 .typename = TOSHIBA_RBTX4927_ISA_NAME, 251 .typename = TOSHIBA_RBTX4927_ISA_NAME,
272 .startup = toshiba_rbtx4927_irq_isa_startup,
273 .shutdown = toshiba_rbtx4927_irq_isa_shutdown,
274 .enable = toshiba_rbtx4927_irq_isa_enable,
275 .disable = toshiba_rbtx4927_irq_isa_disable,
276 .ack = toshiba_rbtx4927_irq_isa_mask_and_ack, 252 .ack = toshiba_rbtx4927_irq_isa_mask_and_ack,
253 .mask = toshiba_rbtx4927_irq_isa_disable,
254 .mask_ack = toshiba_rbtx4927_irq_isa_mask_and_ack,
255 .unmask = toshiba_rbtx4927_irq_isa_enable,
277 .end = toshiba_rbtx4927_irq_isa_end, 256 .end = toshiba_rbtx4927_irq_isa_end,
278 .set_affinity = NULL
279}; 257};
280#endif 258#endif
281 259
@@ -363,58 +341,16 @@ static void __init toshiba_rbtx4927_irq_ioc_init(void)
363 TOSHIBA_RBTX4927_IRQ_IOC_END); 341 TOSHIBA_RBTX4927_IRQ_IOC_END);
364 342
365 for (i = TOSHIBA_RBTX4927_IRQ_IOC_BEG; 343 for (i = TOSHIBA_RBTX4927_IRQ_IOC_BEG;
366 i <= TOSHIBA_RBTX4927_IRQ_IOC_END; i++) { 344 i <= TOSHIBA_RBTX4927_IRQ_IOC_END; i++)
367 irq_desc[i].status = IRQ_DISABLED; 345 set_irq_chip_and_handler(i, &toshiba_rbtx4927_irq_ioc_type,
368 irq_desc[i].action = 0; 346 handle_level_irq);
369 irq_desc[i].depth = 3;
370 irq_desc[i].chip = &toshiba_rbtx4927_irq_ioc_type;
371 }
372 347
373 setup_irq(TOSHIBA_RBTX4927_IRQ_NEST_IOC_ON_PIC, 348 setup_irq(TOSHIBA_RBTX4927_IRQ_NEST_IOC_ON_PIC,
374 &toshiba_rbtx4927_irq_ioc_action); 349 &toshiba_rbtx4927_irq_ioc_action);
375
376 return;
377} 350}
378 351
379static unsigned int toshiba_rbtx4927_irq_ioc_startup(unsigned int irq)
380{
381 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_IOC_STARTUP,
382 "irq=%d\n", irq);
383
384 if (irq < TOSHIBA_RBTX4927_IRQ_IOC_BEG
385 || irq > TOSHIBA_RBTX4927_IRQ_IOC_END) {
386 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_EROR,
387 "bad irq=%d\n", irq);
388 panic("\n");
389 }
390
391 toshiba_rbtx4927_irq_ioc_enable(irq);
392
393 return (0);
394}
395
396
397static void toshiba_rbtx4927_irq_ioc_shutdown(unsigned int irq)
398{
399 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_IOC_SHUTDOWN,
400 "irq=%d\n", irq);
401
402 if (irq < TOSHIBA_RBTX4927_IRQ_IOC_BEG
403 || irq > TOSHIBA_RBTX4927_IRQ_IOC_END) {
404 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_EROR,
405 "bad irq=%d\n", irq);
406 panic("\n");
407 }
408
409 toshiba_rbtx4927_irq_ioc_disable(irq);
410
411 return;
412}
413
414
415static void toshiba_rbtx4927_irq_ioc_enable(unsigned int irq) 352static void toshiba_rbtx4927_irq_ioc_enable(unsigned int irq)
416{ 353{
417 unsigned long flags;
418 volatile unsigned char v; 354 volatile unsigned char v;
419 355
420 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_IOC_ENABLE, 356 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_IOC_ENABLE,
@@ -427,21 +363,14 @@ static void toshiba_rbtx4927_irq_ioc_enable(unsigned int irq)
427 panic("\n"); 363 panic("\n");
428 } 364 }
429 365
430 spin_lock_irqsave(&toshiba_rbtx4927_ioc_lock, flags);
431
432 v = TX4927_RD08(TOSHIBA_RBTX4927_IOC_INTR_ENAB); 366 v = TX4927_RD08(TOSHIBA_RBTX4927_IOC_INTR_ENAB);
433 v |= (1 << (irq - TOSHIBA_RBTX4927_IRQ_IOC_BEG)); 367 v |= (1 << (irq - TOSHIBA_RBTX4927_IRQ_IOC_BEG));
434 TOSHIBA_RBTX4927_WR08(TOSHIBA_RBTX4927_IOC_INTR_ENAB, v); 368 TOSHIBA_RBTX4927_WR08(TOSHIBA_RBTX4927_IOC_INTR_ENAB, v);
435
436 spin_unlock_irqrestore(&toshiba_rbtx4927_ioc_lock, flags);
437
438 return;
439} 369}
440 370
441 371
442static void toshiba_rbtx4927_irq_ioc_disable(unsigned int irq) 372static void toshiba_rbtx4927_irq_ioc_disable(unsigned int irq)
443{ 373{
444 unsigned long flags;
445 volatile unsigned char v; 374 volatile unsigned char v;
446 375
447 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_IOC_DISABLE, 376 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_IOC_DISABLE,
@@ -454,36 +383,11 @@ static void toshiba_rbtx4927_irq_ioc_disable(unsigned int irq)
454 panic("\n"); 383 panic("\n");
455 } 384 }
456 385
457 spin_lock_irqsave(&toshiba_rbtx4927_ioc_lock, flags);
458
459 v = TX4927_RD08(TOSHIBA_RBTX4927_IOC_INTR_ENAB); 386 v = TX4927_RD08(TOSHIBA_RBTX4927_IOC_INTR_ENAB);
460 v &= ~(1 << (irq - TOSHIBA_RBTX4927_IRQ_IOC_BEG)); 387 v &= ~(1 << (irq - TOSHIBA_RBTX4927_IRQ_IOC_BEG));
461 TOSHIBA_RBTX4927_WR08(TOSHIBA_RBTX4927_IOC_INTR_ENAB, v); 388 TOSHIBA_RBTX4927_WR08(TOSHIBA_RBTX4927_IOC_INTR_ENAB, v);
462
463 spin_unlock_irqrestore(&toshiba_rbtx4927_ioc_lock, flags);
464
465 return;
466} 389}
467 390
468
469static void toshiba_rbtx4927_irq_ioc_mask_and_ack(unsigned int irq)
470{
471 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_IOC_MASK,
472 "irq=%d\n", irq);
473
474 if (irq < TOSHIBA_RBTX4927_IRQ_IOC_BEG
475 || irq > TOSHIBA_RBTX4927_IRQ_IOC_END) {
476 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_EROR,
477 "bad irq=%d\n", irq);
478 panic("\n");
479 }
480
481 toshiba_rbtx4927_irq_ioc_disable(irq);
482
483 return;
484}
485
486
487static void toshiba_rbtx4927_irq_ioc_end(unsigned int irq) 391static void toshiba_rbtx4927_irq_ioc_end(unsigned int irq)
488{ 392{
489 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_IOC_ENDIRQ, 393 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_IOC_ENDIRQ,
@@ -499,8 +403,6 @@ static void toshiba_rbtx4927_irq_ioc_end(unsigned int irq)
499 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { 403 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
500 toshiba_rbtx4927_irq_ioc_enable(irq); 404 toshiba_rbtx4927_irq_ioc_enable(irq);
501 } 405 }
502
503 return;
504} 406}
505 407
506 408
@@ -520,13 +422,8 @@ static void __init toshiba_rbtx4927_irq_isa_init(void)
520 TOSHIBA_RBTX4927_IRQ_ISA_END); 422 TOSHIBA_RBTX4927_IRQ_ISA_END);
521 423
522 for (i = TOSHIBA_RBTX4927_IRQ_ISA_BEG; 424 for (i = TOSHIBA_RBTX4927_IRQ_ISA_BEG;
523 i <= TOSHIBA_RBTX4927_IRQ_ISA_END; i++) { 425 i <= TOSHIBA_RBTX4927_IRQ_ISA_END; i++)
524 irq_desc[i].status = IRQ_DISABLED; 426 set_irq_chip(i, &toshiba_rbtx4927_irq_isa_type);
525 irq_desc[i].action = 0;
526 irq_desc[i].depth =
527 ((i < TOSHIBA_RBTX4927_IRQ_ISA_MID) ? (4) : (5));
528 irq_desc[i].chip = &toshiba_rbtx4927_irq_isa_type;
529 }
530 427
531 setup_irq(TOSHIBA_RBTX4927_IRQ_NEST_ISA_ON_IOC, 428 setup_irq(TOSHIBA_RBTX4927_IRQ_NEST_ISA_ON_IOC,
532 &toshiba_rbtx4927_irq_isa_master); 429 &toshiba_rbtx4927_irq_isa_master);
@@ -536,48 +433,6 @@ static void __init toshiba_rbtx4927_irq_isa_init(void)
536 /* make sure we are looking at IRR (not ISR) */ 433 /* make sure we are looking at IRR (not ISR) */
537 outb(0x0A, 0x20); 434 outb(0x0A, 0x20);
538 outb(0x0A, 0xA0); 435 outb(0x0A, 0xA0);
539
540 return;
541}
542#endif
543
544
545#ifdef CONFIG_TOSHIBA_FPCIB0
546static unsigned int toshiba_rbtx4927_irq_isa_startup(unsigned int irq)
547{
548 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_ISA_STARTUP,
549 "irq=%d\n", irq);
550
551 if (irq < TOSHIBA_RBTX4927_IRQ_ISA_BEG
552 || irq > TOSHIBA_RBTX4927_IRQ_ISA_END) {
553 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_EROR,
554 "bad irq=%d\n", irq);
555 panic("\n");
556 }
557
558 toshiba_rbtx4927_irq_isa_enable(irq);
559
560 return (0);
561}
562#endif
563
564
565#ifdef CONFIG_TOSHIBA_FPCIB0
566static void toshiba_rbtx4927_irq_isa_shutdown(unsigned int irq)
567{
568 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_ISA_SHUTDOWN,
569 "irq=%d\n", irq);
570
571 if (irq < TOSHIBA_RBTX4927_IRQ_ISA_BEG
572 || irq > TOSHIBA_RBTX4927_IRQ_ISA_END) {
573 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_EROR,
574 "bad irq=%d\n", irq);
575 panic("\n");
576 }
577
578 toshiba_rbtx4927_irq_isa_disable(irq);
579
580 return;
581} 436}
582#endif 437#endif
583 438
@@ -596,8 +451,6 @@ static void toshiba_rbtx4927_irq_isa_enable(unsigned int irq)
596 } 451 }
597 452
598 enable_8259A_irq(irq); 453 enable_8259A_irq(irq);
599
600 return;
601} 454}
602#endif 455#endif
603 456
@@ -616,8 +469,6 @@ static void toshiba_rbtx4927_irq_isa_disable(unsigned int irq)
616 } 469 }
617 470
618 disable_8259A_irq(irq); 471 disable_8259A_irq(irq);
619
620 return;
621} 472}
622#endif 473#endif
623 474
@@ -636,8 +487,6 @@ static void toshiba_rbtx4927_irq_isa_mask_and_ack(unsigned int irq)
636 } 487 }
637 488
638 mask_and_ack_8259A(irq); 489 mask_and_ack_8259A(irq);
639
640 return;
641} 490}
642#endif 491#endif
643 492
@@ -658,8 +507,6 @@ static void toshiba_rbtx4927_irq_isa_end(unsigned int irq)
658 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { 507 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
659 toshiba_rbtx4927_irq_isa_enable(irq); 508 toshiba_rbtx4927_irq_isa_enable(irq);
660 } 509 }
661
662 return;
663} 510}
664#endif 511#endif
665 512
@@ -668,8 +515,6 @@ void __init arch_init_irq(void)
668{ 515{
669 extern void tx4927_irq_init(void); 516 extern void tx4927_irq_init(void);
670 517
671 local_irq_disable();
672
673 tx4927_irq_init(); 518 tx4927_irq_init();
674 toshiba_rbtx4927_irq_ioc_init(); 519 toshiba_rbtx4927_irq_ioc_init();
675#ifdef CONFIG_TOSHIBA_FPCIB0 520#ifdef CONFIG_TOSHIBA_FPCIB0
@@ -681,8 +526,6 @@ void __init arch_init_irq(void)
681#endif 526#endif
682 527
683 wbflush(); 528 wbflush();
684
685 return;
686} 529}
687 530
688void toshiba_rbtx4927_irq_dump(char *key) 531void toshiba_rbtx4927_irq_dump(char *key)
@@ -715,7 +558,6 @@ void toshiba_rbtx4927_irq_dump(char *key)
715 } 558 }
716 } 559 }
717#endif 560#endif
718 return;
719} 561}
720 562
721void toshiba_rbtx4927_irq_dump_pics(char *s) 563void toshiba_rbtx4927_irq_dump_pics(char *s)
@@ -780,6 +622,4 @@ void toshiba_rbtx4927_irq_dump_pics(char *s)
780 level5_s); 622 level5_s);
781 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_INFO, "[%s]\n", 623 TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_INFO, "[%s]\n",
782 s); 624 s);
783
784 return;
785} 625}
diff --git a/arch/mips/tx4938/common/irq.c b/arch/mips/tx4938/common/irq.c
index 77fe2454f5b..42e127683ae 100644
--- a/arch/mips/tx4938/common/irq.c
+++ b/arch/mips/tx4938/common/irq.c
@@ -37,48 +37,36 @@
37/* Forwad definitions for all pic's */ 37/* Forwad definitions for all pic's */
38/**********************************************************************************/ 38/**********************************************************************************/
39 39
40static unsigned int tx4938_irq_cp0_startup(unsigned int irq);
41static void tx4938_irq_cp0_shutdown(unsigned int irq);
42static void tx4938_irq_cp0_enable(unsigned int irq); 40static void tx4938_irq_cp0_enable(unsigned int irq);
43static void tx4938_irq_cp0_disable(unsigned int irq); 41static void tx4938_irq_cp0_disable(unsigned int irq);
44static void tx4938_irq_cp0_mask_and_ack(unsigned int irq);
45static void tx4938_irq_cp0_end(unsigned int irq); 42static void tx4938_irq_cp0_end(unsigned int irq);
46 43
47static unsigned int tx4938_irq_pic_startup(unsigned int irq);
48static void tx4938_irq_pic_shutdown(unsigned int irq);
49static void tx4938_irq_pic_enable(unsigned int irq); 44static void tx4938_irq_pic_enable(unsigned int irq);
50static void tx4938_irq_pic_disable(unsigned int irq); 45static void tx4938_irq_pic_disable(unsigned int irq);
51static void tx4938_irq_pic_mask_and_ack(unsigned int irq);
52static void tx4938_irq_pic_end(unsigned int irq); 46static void tx4938_irq_pic_end(unsigned int irq);
53 47
54/**********************************************************************************/ 48/**********************************************************************************/
55/* Kernel structs for all pic's */ 49/* Kernel structs for all pic's */
56/**********************************************************************************/ 50/**********************************************************************************/
57DEFINE_SPINLOCK(tx4938_cp0_lock);
58DEFINE_SPINLOCK(tx4938_pic_lock);
59 51
60#define TX4938_CP0_NAME "TX4938-CP0" 52#define TX4938_CP0_NAME "TX4938-CP0"
61static struct irq_chip tx4938_irq_cp0_type = { 53static struct irq_chip tx4938_irq_cp0_type = {
62 .typename = TX4938_CP0_NAME, 54 .typename = TX4938_CP0_NAME,
63 .startup = tx4938_irq_cp0_startup, 55 .ack = tx4938_irq_cp0_disable,
64 .shutdown = tx4938_irq_cp0_shutdown, 56 .mask = tx4938_irq_cp0_disable,
65 .enable = tx4938_irq_cp0_enable, 57 .mask_ack = tx4938_irq_cp0_disable,
66 .disable = tx4938_irq_cp0_disable, 58 .unmask = tx4938_irq_cp0_enable,
67 .ack = tx4938_irq_cp0_mask_and_ack,
68 .end = tx4938_irq_cp0_end, 59 .end = tx4938_irq_cp0_end,
69 .set_affinity = NULL
70}; 60};
71 61
72#define TX4938_PIC_NAME "TX4938-PIC" 62#define TX4938_PIC_NAME "TX4938-PIC"
73static struct irq_chip tx4938_irq_pic_type = { 63static struct irq_chip tx4938_irq_pic_type = {
74 .typename = TX4938_PIC_NAME, 64 .typename = TX4938_PIC_NAME,
75 .startup = tx4938_irq_pic_startup, 65 .ack = tx4938_irq_pic_disable,
76 .shutdown = tx4938_irq_pic_shutdown, 66 .mask = tx4938_irq_pic_disable,
77 .enable = tx4938_irq_pic_enable, 67 .mask_ack = tx4938_irq_pic_disable,
78 .disable = tx4938_irq_pic_disable, 68 .unmask = tx4938_irq_pic_enable,
79 .ack = tx4938_irq_pic_mask_and_ack,
80 .end = tx4938_irq_pic_end, 69 .end = tx4938_irq_pic_end,
81 .set_affinity = NULL
82}; 70};
83 71
84static struct irqaction tx4938_irq_pic_action = { 72static struct irqaction tx4938_irq_pic_action = {
@@ -99,56 +87,21 @@ tx4938_irq_cp0_init(void)
99{ 87{
100 int i; 88 int i;
101 89
102 for (i = TX4938_IRQ_CP0_BEG; i <= TX4938_IRQ_CP0_END; i++) { 90 for (i = TX4938_IRQ_CP0_BEG; i <= TX4938_IRQ_CP0_END; i++)
103 irq_desc[i].status = IRQ_DISABLED; 91 set_irq_chip_and_handler(i, &tx4938_irq_cp0_type,
104 irq_desc[i].action = 0; 92 handle_level_irq);
105 irq_desc[i].depth = 1;
106 irq_desc[i].chip = &tx4938_irq_cp0_type;
107 }
108}
109
110static unsigned int
111tx4938_irq_cp0_startup(unsigned int irq)
112{
113 tx4938_irq_cp0_enable(irq);
114
115 return 0;
116}
117
118static void
119tx4938_irq_cp0_shutdown(unsigned int irq)
120{
121 tx4938_irq_cp0_disable(irq);
122} 93}
123 94
124static void 95static void
125tx4938_irq_cp0_enable(unsigned int irq) 96tx4938_irq_cp0_enable(unsigned int irq)
126{ 97{
127 unsigned long flags;
128
129 spin_lock_irqsave(&tx4938_cp0_lock, flags);
130
131 set_c0_status(tx4938_irq_cp0_mask(irq)); 98 set_c0_status(tx4938_irq_cp0_mask(irq));
132
133 spin_unlock_irqrestore(&tx4938_cp0_lock, flags);
134} 99}
135 100
136static void 101static void
137tx4938_irq_cp0_disable(unsigned int irq) 102tx4938_irq_cp0_disable(unsigned int irq)
138{ 103{
139 unsigned long flags;
140
141 spin_lock_irqsave(&tx4938_cp0_lock, flags);
142
143 clear_c0_status(tx4938_irq_cp0_mask(irq)); 104 clear_c0_status(tx4938_irq_cp0_mask(irq));
144
145 spin_unlock_irqrestore(&tx4938_cp0_lock, flags);
146}
147
148static void
149tx4938_irq_cp0_mask_and_ack(unsigned int irq)
150{
151 tx4938_irq_cp0_disable(irq);
152} 105}
153 106
154static void 107static void
@@ -290,70 +243,30 @@ tx4938_irq_pic_modify(unsigned pic_reg, unsigned clr_bits, unsigned set_bits)
290static void __init 243static void __init
291tx4938_irq_pic_init(void) 244tx4938_irq_pic_init(void)
292{ 245{
293 unsigned long flags;
294 int i; 246 int i;
295 247
296 for (i = TX4938_IRQ_PIC_BEG; i <= TX4938_IRQ_PIC_END; i++) { 248 for (i = TX4938_IRQ_PIC_BEG; i <= TX4938_IRQ_PIC_END; i++)
297 irq_desc[i].status = IRQ_DISABLED; 249 set_irq_chip_and_handler(i, &tx4938_irq_pic_type,
298 irq_desc[i].action = 0; 250 handle_level_irq);
299 irq_desc[i].depth = 2;
300 irq_desc[i].chip = &tx4938_irq_pic_type;
301 }
302 251
303 setup_irq(TX4938_IRQ_NEST_PIC_ON_CP0, &tx4938_irq_pic_action); 252 setup_irq(TX4938_IRQ_NEST_PIC_ON_CP0, &tx4938_irq_pic_action);
304 253
305 spin_lock_irqsave(&tx4938_pic_lock, flags);
306
307 TX4938_WR(0xff1ff640, 0x6); /* irq level mask -- only accept hightest */ 254 TX4938_WR(0xff1ff640, 0x6); /* irq level mask -- only accept hightest */
308 TX4938_WR(0xff1ff600, TX4938_RD(0xff1ff600) | 0x1); /* irq enable */ 255 TX4938_WR(0xff1ff600, TX4938_RD(0xff1ff600) | 0x1); /* irq enable */
309
310 spin_unlock_irqrestore(&tx4938_pic_lock, flags);
311}
312
313static unsigned int
314tx4938_irq_pic_startup(unsigned int irq)
315{
316 tx4938_irq_pic_enable(irq);
317
318 return 0;
319}
320
321static void
322tx4938_irq_pic_shutdown(unsigned int irq)
323{
324 tx4938_irq_pic_disable(irq);
325} 256}
326 257
327static void 258static void
328tx4938_irq_pic_enable(unsigned int irq) 259tx4938_irq_pic_enable(unsigned int irq)
329{ 260{
330 unsigned long flags;
331
332 spin_lock_irqsave(&tx4938_pic_lock, flags);
333
334 tx4938_irq_pic_modify(tx4938_irq_pic_addr(irq), 0, 261 tx4938_irq_pic_modify(tx4938_irq_pic_addr(irq), 0,
335 tx4938_irq_pic_mask(irq)); 262 tx4938_irq_pic_mask(irq));
336
337 spin_unlock_irqrestore(&tx4938_pic_lock, flags);
338} 263}
339 264
340static void 265static void
341tx4938_irq_pic_disable(unsigned int irq) 266tx4938_irq_pic_disable(unsigned int irq)
342{ 267{
343 unsigned long flags;
344
345 spin_lock_irqsave(&tx4938_pic_lock, flags);
346
347 tx4938_irq_pic_modify(tx4938_irq_pic_addr(irq), 268 tx4938_irq_pic_modify(tx4938_irq_pic_addr(irq),
348 tx4938_irq_pic_mask(irq), 0); 269 tx4938_irq_pic_mask(irq), 0);
349
350 spin_unlock_irqrestore(&tx4938_pic_lock, flags);
351}
352
353static void
354tx4938_irq_pic_mask_and_ack(unsigned int irq)
355{
356 tx4938_irq_pic_disable(irq);
357} 270}
358 271
359static void 272static void
diff --git a/arch/mips/tx4938/common/setup.c b/arch/mips/tx4938/common/setup.c
index f415a1f18fb..dc87d92bb08 100644
--- a/arch/mips/tx4938/common/setup.c
+++ b/arch/mips/tx4938/common/setup.c
@@ -31,7 +31,6 @@
31#include <asm/mipsregs.h> 31#include <asm/mipsregs.h>
32#include <asm/system.h> 32#include <asm/system.h>
33#include <asm/time.h> 33#include <asm/time.h>
34#include <asm/time.h>
35#include <asm/tx4938/rbtx4938.h> 34#include <asm/tx4938/rbtx4938.h>
36 35
37extern void toshiba_rbtx4938_setup(void); 36extern void toshiba_rbtx4938_setup(void);
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/irq.c b/arch/mips/tx4938/toshiba_rbtx4938/irq.c
index 102e473c10a..8c87a35f306 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/irq.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/irq.c
@@ -87,25 +87,18 @@ IRQ Device
87#include <linux/bootmem.h> 87#include <linux/bootmem.h>
88#include <asm/tx4938/rbtx4938.h> 88#include <asm/tx4938/rbtx4938.h>
89 89
90static unsigned int toshiba_rbtx4938_irq_ioc_startup(unsigned int irq);
91static void toshiba_rbtx4938_irq_ioc_shutdown(unsigned int irq);
92static void toshiba_rbtx4938_irq_ioc_enable(unsigned int irq); 90static void toshiba_rbtx4938_irq_ioc_enable(unsigned int irq);
93static void toshiba_rbtx4938_irq_ioc_disable(unsigned int irq); 91static void toshiba_rbtx4938_irq_ioc_disable(unsigned int irq);
94static void toshiba_rbtx4938_irq_ioc_mask_and_ack(unsigned int irq);
95static void toshiba_rbtx4938_irq_ioc_end(unsigned int irq); 92static void toshiba_rbtx4938_irq_ioc_end(unsigned int irq);
96 93
97DEFINE_SPINLOCK(toshiba_rbtx4938_ioc_lock);
98
99#define TOSHIBA_RBTX4938_IOC_NAME "RBTX4938-IOC" 94#define TOSHIBA_RBTX4938_IOC_NAME "RBTX4938-IOC"
100static struct irq_chip toshiba_rbtx4938_irq_ioc_type = { 95static struct irq_chip toshiba_rbtx4938_irq_ioc_type = {
101 .typename = TOSHIBA_RBTX4938_IOC_NAME, 96 .typename = TOSHIBA_RBTX4938_IOC_NAME,
102 .startup = toshiba_rbtx4938_irq_ioc_startup, 97 .ack = toshiba_rbtx4938_irq_ioc_disable,
103 .shutdown = toshiba_rbtx4938_irq_ioc_shutdown, 98 .mask = toshiba_rbtx4938_irq_ioc_disable,
104 .enable = toshiba_rbtx4938_irq_ioc_enable, 99 .mask_ack = toshiba_rbtx4938_irq_ioc_disable,
105 .disable = toshiba_rbtx4938_irq_ioc_disable, 100 .unmask = toshiba_rbtx4938_irq_ioc_enable,
106 .ack = toshiba_rbtx4938_irq_ioc_mask_and_ack,
107 .end = toshiba_rbtx4938_irq_ioc_end, 101 .end = toshiba_rbtx4938_irq_ioc_end,
108 .set_affinity = NULL
109}; 102};
110 103
111#define TOSHIBA_RBTX4938_IOC_INTR_ENAB 0xb7f02000 104#define TOSHIBA_RBTX4938_IOC_INTR_ENAB 0xb7f02000
@@ -142,69 +135,36 @@ toshiba_rbtx4938_irq_ioc_init(void)
142 int i; 135 int i;
143 136
144 for (i = TOSHIBA_RBTX4938_IRQ_IOC_BEG; 137 for (i = TOSHIBA_RBTX4938_IRQ_IOC_BEG;
145 i <= TOSHIBA_RBTX4938_IRQ_IOC_END; i++) { 138 i <= TOSHIBA_RBTX4938_IRQ_IOC_END; i++)
146 irq_desc[i].status = IRQ_DISABLED; 139 set_irq_chip_and_handler(i, &toshiba_rbtx4938_irq_ioc_type,
147 irq_desc[i].action = 0; 140 handle_level_irq);
148 irq_desc[i].depth = 3;
149 irq_desc[i].chip = &toshiba_rbtx4938_irq_ioc_type;
150 }
151 141
152 setup_irq(RBTX4938_IRQ_IOCINT, 142 setup_irq(RBTX4938_IRQ_IOCINT,
153 &toshiba_rbtx4938_irq_ioc_action); 143 &toshiba_rbtx4938_irq_ioc_action);
154} 144}
155 145
156static unsigned int
157toshiba_rbtx4938_irq_ioc_startup(unsigned int irq)
158{
159 toshiba_rbtx4938_irq_ioc_enable(irq);
160
161 return 0;
162}
163
164static void
165toshiba_rbtx4938_irq_ioc_shutdown(unsigned int irq)
166{
167 toshiba_rbtx4938_irq_ioc_disable(irq);
168}
169
170static void 146static void
171toshiba_rbtx4938_irq_ioc_enable(unsigned int irq) 147toshiba_rbtx4938_irq_ioc_enable(unsigned int irq)
172{ 148{
173 unsigned long flags;
174 volatile unsigned char v; 149 volatile unsigned char v;
175 150
176 spin_lock_irqsave(&toshiba_rbtx4938_ioc_lock, flags);
177
178 v = TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB); 151 v = TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB);
179 v |= (1 << (irq - TOSHIBA_RBTX4938_IRQ_IOC_BEG)); 152 v |= (1 << (irq - TOSHIBA_RBTX4938_IRQ_IOC_BEG));
180 TX4938_WR08(TOSHIBA_RBTX4938_IOC_INTR_ENAB, v); 153 TX4938_WR08(TOSHIBA_RBTX4938_IOC_INTR_ENAB, v);
181 mmiowb(); 154 mmiowb();
182 TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB); 155 TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB);
183
184 spin_unlock_irqrestore(&toshiba_rbtx4938_ioc_lock, flags);
185} 156}
186 157
187static void 158static void
188toshiba_rbtx4938_irq_ioc_disable(unsigned int irq) 159toshiba_rbtx4938_irq_ioc_disable(unsigned int irq)
189{ 160{
190 unsigned long flags;
191 volatile unsigned char v; 161 volatile unsigned char v;
192 162
193 spin_lock_irqsave(&toshiba_rbtx4938_ioc_lock, flags);
194
195 v = TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB); 163 v = TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB);
196 v &= ~(1 << (irq - TOSHIBA_RBTX4938_IRQ_IOC_BEG)); 164 v &= ~(1 << (irq - TOSHIBA_RBTX4938_IRQ_IOC_BEG));
197 TX4938_WR08(TOSHIBA_RBTX4938_IOC_INTR_ENAB, v); 165 TX4938_WR08(TOSHIBA_RBTX4938_IOC_INTR_ENAB, v);
198 mmiowb(); 166 mmiowb();
199 TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB); 167 TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB);
200
201 spin_unlock_irqrestore(&toshiba_rbtx4938_ioc_lock, flags);
202}
203
204static void
205toshiba_rbtx4938_irq_ioc_mask_and_ack(unsigned int irq)
206{
207 toshiba_rbtx4938_irq_ioc_disable(irq);
208} 168}
209 169
210static void 170static void
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c b/arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c
index b926e6a75c2..08b20cdfd7b 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c
@@ -36,14 +36,18 @@ void __init txx9_spi_init(unsigned long base, int (*cs_func)(int chipid, int on)
36 36
37static DECLARE_WAIT_QUEUE_HEAD(txx9_spi_wait); 37static DECLARE_WAIT_QUEUE_HEAD(txx9_spi_wait);
38 38
39static void txx9_spi_interrupt(int irq, void *dev_id) 39static irqreturn_t txx9_spi_interrupt(int irq, void *dev_id)
40{ 40{
41 /* disable rx intr */ 41 /* disable rx intr */
42 tx4938_spiptr->cr0 &= ~TXx9_SPCR0_RBSIE; 42 tx4938_spiptr->cr0 &= ~TXx9_SPCR0_RBSIE;
43 wake_up(&txx9_spi_wait); 43 wake_up(&txx9_spi_wait);
44
45 return IRQ_HANDLED;
44} 46}
47
45static struct irqaction txx9_spi_action = { 48static struct irqaction txx9_spi_action = {
46 txx9_spi_interrupt, 0, 0, "spi", NULL, NULL, 49 .handler = txx9_spi_interrupt,
50 .name = "spi",
47}; 51};
48 52
49void __init txx9_spi_irqinit(int irc_irq) 53void __init txx9_spi_irqinit(int irc_irq)
diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c
index c215c0d39fa..54b92a74c7a 100644
--- a/arch/mips/vr41xx/common/icu.c
+++ b/arch/mips/vr41xx/common/icu.c
@@ -417,14 +417,7 @@ void vr41xx_disable_bcuint(void)
417 417
418EXPORT_SYMBOL(vr41xx_disable_bcuint); 418EXPORT_SYMBOL(vr41xx_disable_bcuint);
419 419
420static unsigned int startup_sysint1_irq(unsigned int irq) 420static void disable_sysint1_irq(unsigned int irq)
421{
422 icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq));
423
424 return 0; /* never anything pending */
425}
426
427static void shutdown_sysint1_irq(unsigned int irq)
428{ 421{
429 icu1_clear(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq)); 422 icu1_clear(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq));
430} 423}
@@ -434,9 +427,6 @@ static void enable_sysint1_irq(unsigned int irq)
434 icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq)); 427 icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq));
435} 428}
436 429
437#define disable_sysint1_irq shutdown_sysint1_irq
438#define ack_sysint1_irq shutdown_sysint1_irq
439
440static void end_sysint1_irq(unsigned int irq) 430static void end_sysint1_irq(unsigned int irq)
441{ 431{
442 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 432 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
@@ -445,22 +435,14 @@ static void end_sysint1_irq(unsigned int irq)
445 435
446static struct irq_chip sysint1_irq_type = { 436static struct irq_chip sysint1_irq_type = {
447 .typename = "SYSINT1", 437 .typename = "SYSINT1",
448 .startup = startup_sysint1_irq, 438 .ack = disable_sysint1_irq,
449 .shutdown = shutdown_sysint1_irq, 439 .mask = disable_sysint1_irq,
450 .enable = enable_sysint1_irq, 440 .mask_ack = disable_sysint1_irq,
451 .disable = disable_sysint1_irq, 441 .unmask = enable_sysint1_irq,
452 .ack = ack_sysint1_irq,
453 .end = end_sysint1_irq, 442 .end = end_sysint1_irq,
454}; 443};
455 444
456static unsigned int startup_sysint2_irq(unsigned int irq) 445static void disable_sysint2_irq(unsigned int irq)
457{
458 icu2_set(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(irq));
459
460 return 0; /* never anything pending */
461}
462
463static void shutdown_sysint2_irq(unsigned int irq)
464{ 446{
465 icu2_clear(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(irq)); 447 icu2_clear(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(irq));
466} 448}
@@ -470,9 +452,6 @@ static void enable_sysint2_irq(unsigned int irq)
470 icu2_set(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(irq)); 452 icu2_set(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(irq));
471} 453}
472 454
473#define disable_sysint2_irq shutdown_sysint2_irq
474#define ack_sysint2_irq shutdown_sysint2_irq
475
476static void end_sysint2_irq(unsigned int irq) 455static void end_sysint2_irq(unsigned int irq)
477{ 456{
478 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 457 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
@@ -481,11 +460,10 @@ static void end_sysint2_irq(unsigned int irq)
481 460
482static struct irq_chip sysint2_irq_type = { 461static struct irq_chip sysint2_irq_type = {
483 .typename = "SYSINT2", 462 .typename = "SYSINT2",
484 .startup = startup_sysint2_irq, 463 .ack = disable_sysint2_irq,
485 .shutdown = shutdown_sysint2_irq, 464 .mask = disable_sysint2_irq,
486 .enable = enable_sysint2_irq, 465 .mask_ack = disable_sysint2_irq,
487 .disable = disable_sysint2_irq, 466 .unmask = enable_sysint2_irq,
488 .ack = ack_sysint2_irq,
489 .end = end_sysint2_irq, 467 .end = end_sysint2_irq,
490}; 468};
491 469
@@ -723,10 +701,12 @@ static int __init vr41xx_icu_init(void)
723 icu2_write(MGIUINTHREG, 0xffff); 701 icu2_write(MGIUINTHREG, 0xffff);
724 702
725 for (i = SYSINT1_IRQ_BASE; i <= SYSINT1_IRQ_LAST; i++) 703 for (i = SYSINT1_IRQ_BASE; i <= SYSINT1_IRQ_LAST; i++)
726 irq_desc[i].chip = &sysint1_irq_type; 704 set_irq_chip_and_handler(i, &sysint1_irq_type,
705 handle_level_irq);
727 706
728 for (i = SYSINT2_IRQ_BASE; i <= SYSINT2_IRQ_LAST; i++) 707 for (i = SYSINT2_IRQ_BASE; i <= SYSINT2_IRQ_LAST; i++)
729 irq_desc[i].chip = &sysint2_irq_type; 708 set_irq_chip_and_handler(i, &sysint2_irq_type,
709 handle_level_irq);
730 710
731 cascade_irq(INT0_IRQ, icu_get_irq); 711 cascade_irq(INT0_IRQ, icu_get_irq);
732 cascade_irq(INT1_IRQ, icu_get_irq); 712 cascade_irq(INT1_IRQ, icu_get_irq);
diff --git a/arch/mips/vr41xx/nec-cmbvr4133/irq.c b/arch/mips/vr41xx/nec-cmbvr4133/irq.c
index 2483487344c..a039bb7251f 100644
--- a/arch/mips/vr41xx/nec-cmbvr4133/irq.c
+++ b/arch/mips/vr41xx/nec-cmbvr4133/irq.c
@@ -30,17 +30,6 @@ extern void init_8259A(int hoge);
30 30
31extern int vr4133_rockhopper; 31extern int vr4133_rockhopper;
32 32
33static unsigned int startup_i8259_irq(unsigned int irq)
34{
35 enable_8259A_irq(irq - I8259_IRQ_BASE);
36 return 0;
37}
38
39static void shutdown_i8259_irq(unsigned int irq)
40{
41 disable_8259A_irq(irq - I8259_IRQ_BASE);
42}
43
44static void enable_i8259_irq(unsigned int irq) 33static void enable_i8259_irq(unsigned int irq)
45{ 34{
46 enable_8259A_irq(irq - I8259_IRQ_BASE); 35 enable_8259A_irq(irq - I8259_IRQ_BASE);
@@ -64,11 +53,10 @@ static void end_i8259_irq(unsigned int irq)
64 53
65static struct irq_chip i8259_irq_type = { 54static struct irq_chip i8259_irq_type = {
66 .typename = "XT-PIC", 55 .typename = "XT-PIC",
67 .startup = startup_i8259_irq,
68 .shutdown = shutdown_i8259_irq,
69 .enable = enable_i8259_irq,
70 .disable = disable_i8259_irq,
71 .ack = ack_i8259_irq, 56 .ack = ack_i8259_irq,
57 .mask = disable_i8259_irq,
58 .mask_ack = ack_i8259_irq,
59 .unmask = enable_i8259_irq,
72 .end = end_i8259_irq, 60 .end = end_i8259_irq,
73}; 61};
74 62
@@ -104,7 +92,7 @@ void __init rockhopper_init_irq(void)
104 } 92 }
105 93
106 for (i = I8259_IRQ_BASE; i <= I8259_IRQ_LAST; i++) 94 for (i = I8259_IRQ_BASE; i <= I8259_IRQ_LAST; i++)
107 irq_desc[i].chip = &i8259_irq_type; 95 set_irq_chip(i, &i8259_irq_type);
108 96
109 setup_irq(I8259_SLAVE_IRQ, &i8259_slave_cascade); 97 setup_irq(I8259_SLAVE_IRQ, &i8259_slave_cascade);
110 98
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index b3677fc8eef..7b943b45f7c 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -153,13 +153,7 @@ SECTIONS
153 __setup_end = .; 153 __setup_end = .;
154 __initcall_start = .; 154 __initcall_start = .;
155 .initcall.init : { 155 .initcall.init : {
156 *(.initcall1.init) 156 INITCALLS
157 *(.initcall2.init)
158 *(.initcall3.init)
159 *(.initcall4.init)
160 *(.initcall5.init)
161 *(.initcall6.init)
162 *(.initcall7.init)
163 } 157 }
164 __initcall_end = .; 158 __initcall_end = .;
165 __con_initcall_start = .; 159 __con_initcall_start = .;
diff --git a/arch/parisc/lib/checksum.c b/arch/parisc/lib/checksum.c
index 8a1e08068e7..462696d30d3 100644
--- a/arch/parisc/lib/checksum.c
+++ b/arch/parisc/lib/checksum.c
@@ -101,11 +101,14 @@ out:
101/* 101/*
102 * computes a partial checksum, e.g. for TCP/UDP fragments 102 * computes a partial checksum, e.g. for TCP/UDP fragments
103 */ 103 */
104unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum) 104/*
105 * why bother folding?
106 */
107__wsum csum_partial(const void *buff, int len, __wsum sum)
105{ 108{
106 unsigned int result = do_csum(buff, len); 109 unsigned int result = do_csum(buff, len);
107 addc(result, sum); 110 addc(result, sum);
108 return from32to16(result); 111 return (__force __wsum)from32to16(result);
109} 112}
110 113
111EXPORT_SYMBOL(csum_partial); 114EXPORT_SYMBOL(csum_partial);
@@ -113,8 +116,8 @@ EXPORT_SYMBOL(csum_partial);
113/* 116/*
114 * copy while checksumming, otherwise like csum_partial 117 * copy while checksumming, otherwise like csum_partial
115 */ 118 */
116unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, 119__wsum csum_partial_copy_nocheck(const void *src, void *dst,
117 int len, unsigned int sum) 120 int len, __wsum sum)
118{ 121{
119 /* 122 /*
120 * It's 2:30 am and I don't feel like doing it real ... 123 * It's 2:30 am and I don't feel like doing it real ...
@@ -131,9 +134,9 @@ EXPORT_SYMBOL(csum_partial_copy_nocheck);
131 * Copy from userspace and compute checksum. If we catch an exception 134 * Copy from userspace and compute checksum. If we catch an exception
132 * then zero the rest of the buffer. 135 * then zero the rest of the buffer.
133 */ 136 */
134unsigned int csum_partial_copy_from_user(const unsigned char __user *src, 137__wsum csum_partial_copy_from_user(const void __user *src,
135 unsigned char *dst, int len, 138 void *dst, int len,
136 unsigned int sum, int *err_ptr) 139 __wsum sum, int *err_ptr)
137{ 140{
138 int missing; 141 int missing;
139 142
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index a41d191bf1b..96316c86610 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -433,7 +433,7 @@ config PPC_MAPLE
433 default n 433 default n
434 help 434 help
435 This option enables support for the Maple 970FX Evaluation Board. 435 This option enables support for the Maple 970FX Evaluation Board.
436 For more informations, refer to <http://www.970eval.com> 436 For more information, refer to <http://www.970eval.com>
437 437
438config PPC_PASEMI 438config PPC_PASEMI
439 depends on PPC_MULTIPLATFORM && PPC64 439 depends on PPC_MULTIPLATFORM && PPC64
@@ -742,7 +742,7 @@ config ARCH_SPARSEMEM_ENABLE
742 742
743config ARCH_SPARSEMEM_DEFAULT 743config ARCH_SPARSEMEM_DEFAULT
744 def_bool y 744 def_bool y
745 depends on SMP && PPC_PSERIES 745 depends on (SMP && PPC_PSERIES) || PPC_CELL
746 746
747config ARCH_POPULATES_NODE_MAP 747config ARCH_POPULATES_NODE_MAP
748 def_bool y 748 def_bool y
@@ -753,6 +753,15 @@ config ARCH_MEMORY_PROBE
753 def_bool y 753 def_bool y
754 depends on MEMORY_HOTPLUG 754 depends on MEMORY_HOTPLUG
755 755
756# Some NUMA nodes have memory ranges that span
757# other nodes. Even though a pfn is valid and
758# between a node's start and end pfns, it may not
759# reside on that node. See memmap_init_zone()
760# for details.
761config NODES_SPAN_OTHER_NODES
762 def_bool y
763 depends on NEED_MULTIPLE_NODES
764
756config PPC_64K_PAGES 765config PPC_64K_PAGES
757 bool "64k page size" 766 bool "64k page size"
758 depends on PPC64 767 depends on PPC64
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 042bac319be..4a6f0f054b7 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -116,7 +116,7 @@ endif
116quiet_cmd_wrap = WRAP $@ 116quiet_cmd_wrap = WRAP $@
117 cmd_wrap =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) vmlinux 117 cmd_wrap =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) vmlinux
118quiet_cmd_wrap_initrd = WRAP $@ 118quiet_cmd_wrap_initrd = WRAP $@
119 cmd_wrap_initrd =$(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \ 119 cmd_wrap_initrd =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
120 -i $(obj)/ramdisk.image.gz vmlinux 120 -i $(obj)/ramdisk.image.gz vmlinux
121 121
122$(obj)/zImage.chrp: vmlinux $(wrapperbits) 122$(obj)/zImage.chrp: vmlinux $(wrapperbits)
diff --git a/arch/powerpc/configs/cell_defconfig b/arch/powerpc/configs/cell_defconfig
index c5c54f49ae5..dbcd4e3329d 100644
--- a/arch/powerpc/configs/cell_defconfig
+++ b/arch/powerpc/configs/cell_defconfig
@@ -268,6 +268,7 @@ CONFIG_SYN_COOKIES=y
268CONFIG_INET_TUNNEL=y 268CONFIG_INET_TUNNEL=y
269CONFIG_INET_XFRM_MODE_TRANSPORT=y 269CONFIG_INET_XFRM_MODE_TRANSPORT=y
270CONFIG_INET_XFRM_MODE_TUNNEL=y 270CONFIG_INET_XFRM_MODE_TUNNEL=y
271# CONFIG_INET_XFRM_MODE_BEET is not set
271CONFIG_INET_DIAG=y 272CONFIG_INET_DIAG=y
272CONFIG_INET_TCP_DIAG=y 273CONFIG_INET_TCP_DIAG=y
273# CONFIG_TCP_CONG_ADVANCED is not set 274# CONFIG_TCP_CONG_ADVANCED is not set
@@ -289,7 +290,9 @@ CONFIG_INET6_XFRM_TUNNEL=m
289CONFIG_INET6_TUNNEL=m 290CONFIG_INET6_TUNNEL=m
290CONFIG_INET6_XFRM_MODE_TRANSPORT=y 291CONFIG_INET6_XFRM_MODE_TRANSPORT=y
291CONFIG_INET6_XFRM_MODE_TUNNEL=y 292CONFIG_INET6_XFRM_MODE_TUNNEL=y
293# CONFIG_INET6_XFRM_MODE_BEET is not set
292# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set 294# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
295# CONFIG_IPV6_SIT is not set
293CONFIG_IPV6_TUNNEL=m 296CONFIG_IPV6_TUNNEL=m
294# CONFIG_IPV6_SUBTREES is not set 297# CONFIG_IPV6_SUBTREES is not set
295# CONFIG_IPV6_MULTIPLE_TABLES is not set 298# CONFIG_IPV6_MULTIPLE_TABLES is not set
@@ -420,6 +423,12 @@ CONFIG_BLK_DEV_INITRD=y
420# CONFIG_ATA_OVER_ETH is not set 423# CONFIG_ATA_OVER_ETH is not set
421 424
422# 425#
426# Misc devices
427#
428# CONFIG_SGI_IOC4 is not set
429# CONFIG_TIFM_CORE is not set
430
431#
423# ATA/ATAPI/MFM/RLL support 432# ATA/ATAPI/MFM/RLL support
424# 433#
425CONFIG_IDE=y 434CONFIG_IDE=y
@@ -752,7 +761,6 @@ CONFIG_GEN_RTC=y
752# TPM devices 761# TPM devices
753# 762#
754# CONFIG_TCG_TPM is not set 763# CONFIG_TCG_TPM is not set
755# CONFIG_TELCLOCK is not set
756 764
757# 765#
758# I2C support 766# I2C support
@@ -816,6 +824,7 @@ CONFIG_I2C_ALGOBIT=y
816# 824#
817# Dallas's 1-wire bus 825# Dallas's 1-wire bus
818# 826#
827# CONFIG_W1 is not set
819 828
820# 829#
821# Hardware Monitoring support 830# Hardware Monitoring support
@@ -824,14 +833,9 @@ CONFIG_I2C_ALGOBIT=y
824# CONFIG_HWMON_VID is not set 833# CONFIG_HWMON_VID is not set
825 834
826# 835#
827# Misc devices
828#
829
830#
831# Multimedia devices 836# Multimedia devices
832# 837#
833# CONFIG_VIDEO_DEV is not set 838# CONFIG_VIDEO_DEV is not set
834CONFIG_VIDEO_V4L2=y
835 839
836# 840#
837# Digital Video Broadcasting Devices 841# Digital Video Broadcasting Devices
@@ -937,6 +941,7 @@ CONFIG_EXT3_FS=y
937CONFIG_EXT3_FS_XATTR=y 941CONFIG_EXT3_FS_XATTR=y
938# CONFIG_EXT3_FS_POSIX_ACL is not set 942# CONFIG_EXT3_FS_POSIX_ACL is not set
939# CONFIG_EXT3_FS_SECURITY is not set 943# CONFIG_EXT3_FS_SECURITY is not set
944# CONFIG_EXT4DEV_FS is not set
940CONFIG_JBD=y 945CONFIG_JBD=y
941# CONFIG_JBD_DEBUG is not set 946# CONFIG_JBD_DEBUG is not set
942CONFIG_FS_MBCACHE=y 947CONFIG_FS_MBCACHE=y
@@ -944,6 +949,7 @@ CONFIG_FS_MBCACHE=y
944# CONFIG_JFS_FS is not set 949# CONFIG_JFS_FS is not set
945CONFIG_FS_POSIX_ACL=y 950CONFIG_FS_POSIX_ACL=y
946# CONFIG_XFS_FS is not set 951# CONFIG_XFS_FS is not set
952# CONFIG_GFS2_FS is not set
947# CONFIG_OCFS2_FS is not set 953# CONFIG_OCFS2_FS is not set
948# CONFIG_MINIX_FS is not set 954# CONFIG_MINIX_FS is not set
949# CONFIG_ROMFS_FS is not set 955# CONFIG_ROMFS_FS is not set
@@ -1143,6 +1149,7 @@ CONFIG_DEBUG_FS=y
1143# CONFIG_DEBUG_VM is not set 1149# CONFIG_DEBUG_VM is not set
1144# CONFIG_DEBUG_LIST is not set 1150# CONFIG_DEBUG_LIST is not set
1145# CONFIG_FORCED_INLINING is not set 1151# CONFIG_FORCED_INLINING is not set
1152# CONFIG_HEADERS_CHECK is not set
1146# CONFIG_RCU_TORTURE_TEST is not set 1153# CONFIG_RCU_TORTURE_TEST is not set
1147# CONFIG_DEBUG_STACKOVERFLOW is not set 1154# CONFIG_DEBUG_STACKOVERFLOW is not set
1148# CONFIG_DEBUG_STACK_USAGE is not set 1155# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index 9828663652e..d2833c1a1f3 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -184,6 +184,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
184CONFIG_MIGRATION=y 184CONFIG_MIGRATION=y
185CONFIG_RESOURCES_64BIT=y 185CONFIG_RESOURCES_64BIT=y
186CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y 186CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
187CONFIG_NODES_SPAN_OTHER_NODES=y
187# CONFIG_PPC_64K_PAGES is not set 188# CONFIG_PPC_64K_PAGES is not set
188CONFIG_SCHED_SMT=y 189CONFIG_SCHED_SMT=y
189CONFIG_PROC_DEVICETREE=y 190CONFIG_PROC_DEVICETREE=y
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 82c223852e6..d8240ce2212 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -37,7 +37,6 @@ obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
37obj-$(CONFIG_TAU) += tau_6xx.o 37obj-$(CONFIG_TAU) += tau_6xx.o
38obj32-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_32.o 38obj32-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_32.o
39obj32-$(CONFIG_MODULES) += module_32.o 39obj32-$(CONFIG_MODULES) += module_32.o
40obj-$(CONFIG_E500) += perfmon_fsl_booke.o
41 40
42ifeq ($(CONFIG_PPC_MERGE),y) 41ifeq ($(CONFIG_PPC_MERGE),y)
43 42
diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
index 995fcef156f..93f21aaf7c8 100644
--- a/arch/powerpc/kernel/btext.c
+++ b/arch/powerpc/kernel/btext.c
@@ -182,7 +182,7 @@ int btext_initialize(struct device_node *np)
182 prop = get_property(np, "linux,bootx-linebytes", NULL); 182 prop = get_property(np, "linux,bootx-linebytes", NULL);
183 if (prop == NULL) 183 if (prop == NULL)
184 prop = get_property(np, "linebytes", NULL); 184 prop = get_property(np, "linebytes", NULL);
185 if (prop) 185 if (prop && *prop != 0xffffffffu)
186 pitch = *prop; 186 pitch = *prop;
187 if (pitch == 1) 187 if (pitch == 1)
188 pitch = 0x1000; 188 pitch = 0x1000;
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index f02b402c66d..1e4ed0731d1 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -18,6 +18,7 @@
18 18
19#include <asm/oprofile_impl.h> 19#include <asm/oprofile_impl.h>
20#include <asm/cputable.h> 20#include <asm/cputable.h>
21#include <asm/prom.h> /* for PTRRELOC on ARCH=ppc */
21 22
22struct cpu_spec* cur_cpu_spec = NULL; 23struct cpu_spec* cur_cpu_spec = NULL;
23EXPORT_SYMBOL(cur_cpu_spec); 24EXPORT_SYMBOL(cur_cpu_spec);
@@ -74,7 +75,7 @@ extern void __restore_cpu_ppc970(void);
74#define PPC_FEATURE_SPE_COMP 0 75#define PPC_FEATURE_SPE_COMP 0
75#endif 76#endif
76 77
77struct cpu_spec cpu_specs[] = { 78static struct cpu_spec cpu_specs[] = {
78#ifdef CONFIG_PPC64 79#ifdef CONFIG_PPC64
79 { /* Power3 */ 80 { /* Power3 */
80 .pvr_mask = 0xffff0000, 81 .pvr_mask = 0xffff0000,
@@ -228,6 +229,21 @@ struct cpu_spec cpu_specs[] = {
228 .oprofile_type = PPC_OPROFILE_POWER4, 229 .oprofile_type = PPC_OPROFILE_POWER4,
229 .platform = "ppc970", 230 .platform = "ppc970",
230 }, 231 },
232 { /* PPC970GX */
233 .pvr_mask = 0xffff0000,
234 .pvr_value = 0x00450000,
235 .cpu_name = "PPC970GX",
236 .cpu_features = CPU_FTRS_PPC970,
237 .cpu_user_features = COMMON_USER_POWER4 |
238 PPC_FEATURE_HAS_ALTIVEC_COMP,
239 .icache_bsize = 128,
240 .dcache_bsize = 128,
241 .num_pmcs = 8,
242 .cpu_setup = __setup_cpu_ppc970,
243 .oprofile_cpu_type = "ppc64/970",
244 .oprofile_type = PPC_OPROFILE_POWER4,
245 .platform = "ppc970",
246 },
231 { /* Power5 GR */ 247 { /* Power5 GR */
232 .pvr_mask = 0xffff0000, 248 .pvr_mask = 0xffff0000,
233 .pvr_value = 0x003a0000, 249 .pvr_value = 0x003a0000,
@@ -1153,3 +1169,71 @@ struct cpu_spec cpu_specs[] = {
1153#endif /* !CLASSIC_PPC */ 1169#endif /* !CLASSIC_PPC */
1154#endif /* CONFIG_PPC32 */ 1170#endif /* CONFIG_PPC32 */
1155}; 1171};
1172
1173struct cpu_spec *identify_cpu(unsigned long offset)
1174{
1175 struct cpu_spec *s = cpu_specs;
1176 struct cpu_spec **cur = &cur_cpu_spec;
1177 unsigned int pvr = mfspr(SPRN_PVR);
1178 int i;
1179
1180 s = PTRRELOC(s);
1181 cur = PTRRELOC(cur);
1182
1183 if (*cur != NULL)
1184 return PTRRELOC(*cur);
1185
1186 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1187 if ((pvr & s->pvr_mask) == s->pvr_value) {
1188 *cur = cpu_specs + i;
1189#ifdef CONFIG_PPC64
1190 /* ppc64 expects identify_cpu to also call setup_cpu
1191 * for that processor. I will consolidate that at a
1192 * later time, for now, just use our friend #ifdef.
1193 * we also don't need to PTRRELOC the function pointer
1194 * on ppc64 as we are running at 0 in real mode.
1195 */
1196 if (s->cpu_setup) {
1197 s->cpu_setup(offset, s);
1198 }
1199#endif /* CONFIG_PPC64 */
1200 return s;
1201 }
1202 BUG();
1203 return NULL;
1204}
1205
1206void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
1207{
1208 struct fixup_entry {
1209 unsigned long mask;
1210 unsigned long value;
1211 long start_off;
1212 long end_off;
1213 } *fcur, *fend;
1214
1215 fcur = fixup_start;
1216 fend = fixup_end;
1217
1218 for (; fcur < fend; fcur++) {
1219 unsigned int *pstart, *pend, *p;
1220
1221 if ((value & fcur->mask) == fcur->value)
1222 continue;
1223
1224 /* These PTRRELOCs will disappear once the new scheme for
1225 * modules and vdso is implemented
1226 */
1227 pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
1228 pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
1229
1230 for (p = pstart; p < pend; p++) {
1231 *p = 0x60000000u;
1232 asm volatile ("dcbst 0, %0" : : "r" (p));
1233 }
1234 asm volatile ("sync" : : : "memory");
1235 for (p = pstart; p < pend; p++)
1236 asm volatile ("icbi 0,%0" : : "r" (p));
1237 asm volatile ("sync; isync" : : : "memory");
1238 }
1239}
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 76d1c81afe5..8cdff5a1f3e 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -503,7 +503,7 @@ BEGIN_FTR_SECTION
503 rlwimi r13,r12,16,0x20 503 rlwimi r13,r12,16,0x20
504 mfcr r12 504 mfcr r12
505 cmpwi r13,0x2c 505 cmpwi r13,0x2c
506 beq .do_stab_bolted_pSeries 506 beq do_stab_bolted_pSeries
507 mtcrf 0x80,r12 507 mtcrf 0x80,r12
508 mfspr r12,SPRN_SPRG2 508 mfspr r12,SPRN_SPRG2
509END_FTR_SECTION_IFCLR(CPU_FTR_SLB) 509END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
@@ -633,7 +633,7 @@ masked_interrupt:
633 b . 633 b .
634 634
635 .align 7 635 .align 7
636_GLOBAL(do_stab_bolted_pSeries) 636do_stab_bolted_pSeries:
637 mtcrf 0x80,r12 637 mtcrf 0x80,r12
638 mfspr r12,SPRN_SPRG2 638 mfspr r12,SPRN_SPRG2
639 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted) 639 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted)
@@ -1088,7 +1088,7 @@ slb_miss_fault:
1088 li r5,0 1088 li r5,0
1089 std r4,_DAR(r1) 1089 std r4,_DAR(r1)
1090 std r5,_DSISR(r1) 1090 std r5,_DSISR(r1)
1091 b .handle_page_fault 1091 b handle_page_fault
1092 1092
1093unrecov_user_slb: 1093unrecov_user_slb:
1094 EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN) 1094 EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN)
@@ -1216,12 +1216,13 @@ program_check_common:
1216 .globl fp_unavailable_common 1216 .globl fp_unavailable_common
1217fp_unavailable_common: 1217fp_unavailable_common:
1218 EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN) 1218 EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN)
1219 bne .load_up_fpu /* if from user, just load it up */ 1219 bne 1f /* if from user, just load it up */
1220 bl .save_nvgprs 1220 bl .save_nvgprs
1221 addi r3,r1,STACK_FRAME_OVERHEAD 1221 addi r3,r1,STACK_FRAME_OVERHEAD
1222 ENABLE_INTS 1222 ENABLE_INTS
1223 bl .kernel_fp_unavailable_exception 1223 bl .kernel_fp_unavailable_exception
1224 BUG_OPCODE 1224 BUG_OPCODE
12251: b .load_up_fpu
1225 1226
1226 .align 7 1227 .align 7
1227 .globl altivec_unavailable_common 1228 .globl altivec_unavailable_common
@@ -1321,10 +1322,10 @@ _GLOBAL(do_hash_page)
1321 std r4,_DSISR(r1) 1322 std r4,_DSISR(r1)
1322 1323
1323 andis. r0,r4,0xa450 /* weird error? */ 1324 andis. r0,r4,0xa450 /* weird error? */
1324 bne- .handle_page_fault /* if not, try to insert a HPTE */ 1325 bne- handle_page_fault /* if not, try to insert a HPTE */
1325BEGIN_FTR_SECTION 1326BEGIN_FTR_SECTION
1326 andis. r0,r4,0x0020 /* Is it a segment table fault? */ 1327 andis. r0,r4,0x0020 /* Is it a segment table fault? */
1327 bne- .do_ste_alloc /* If so handle it */ 1328 bne- do_ste_alloc /* If so handle it */
1328END_FTR_SECTION_IFCLR(CPU_FTR_SLB) 1329END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
1329 1330
1330 /* 1331 /*
@@ -1366,7 +1367,7 @@ BEGIN_FW_FTR_SECTION
1366 * because ret_from_except_lite will check for and handle pending 1367 * because ret_from_except_lite will check for and handle pending
1367 * interrupts if necessary. 1368 * interrupts if necessary.
1368 */ 1369 */
1369 beq .ret_from_except_lite 1370 beq 13f
1370END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) 1371END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
1371#endif 1372#endif
1372BEGIN_FW_FTR_SECTION 1373BEGIN_FW_FTR_SECTION
@@ -1390,14 +1391,14 @@ END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
1390 b 11f 1391 b 11f
1391 1392
1392/* Here we have a page fault that hash_page can't handle. */ 1393/* Here we have a page fault that hash_page can't handle. */
1393_GLOBAL(handle_page_fault) 1394handle_page_fault:
1394 ENABLE_INTS 1395 ENABLE_INTS
139511: ld r4,_DAR(r1) 139611: ld r4,_DAR(r1)
1396 ld r5,_DSISR(r1) 1397 ld r5,_DSISR(r1)
1397 addi r3,r1,STACK_FRAME_OVERHEAD 1398 addi r3,r1,STACK_FRAME_OVERHEAD
1398 bl .do_page_fault 1399 bl .do_page_fault
1399 cmpdi r3,0 1400 cmpdi r3,0
1400 beq+ .ret_from_except_lite 1401 beq+ 13f
1401 bl .save_nvgprs 1402 bl .save_nvgprs
1402 mr r5,r3 1403 mr r5,r3
1403 addi r3,r1,STACK_FRAME_OVERHEAD 1404 addi r3,r1,STACK_FRAME_OVERHEAD
@@ -1405,6 +1406,8 @@ _GLOBAL(handle_page_fault)
1405 bl .bad_page_fault 1406 bl .bad_page_fault
1406 b .ret_from_except 1407 b .ret_from_except
1407 1408
140913: b .ret_from_except_lite
1410
1408/* We have a page fault that hash_page could handle but HV refused 1411/* We have a page fault that hash_page could handle but HV refused
1409 * the PTE insertion 1412 * the PTE insertion
1410 */ 1413 */
@@ -1415,11 +1418,11 @@ _GLOBAL(handle_page_fault)
1415 b .ret_from_except 1418 b .ret_from_except
1416 1419
1417 /* here we have a segment miss */ 1420 /* here we have a segment miss */
1418_GLOBAL(do_ste_alloc) 1421do_ste_alloc:
1419 bl .ste_allocate /* try to insert stab entry */ 1422 bl .ste_allocate /* try to insert stab entry */
1420 cmpdi r3,0 1423 cmpdi r3,0
1421 beq+ fast_exception_return 1424 bne- handle_page_fault
1422 b .handle_page_fault 1425 b fast_exception_return
1423 1426
1424/* 1427/*
1425 * r13 points to the PACA, r9 contains the saved CR, 1428 * r13 points to the PACA, r9 contains the saved CR,
@@ -1624,11 +1627,6 @@ _STATIC(__start_initialization_iSeries)
1624 li r0,0 1627 li r0,0
1625 stdu r0,-STACK_FRAME_OVERHEAD(r1) 1628 stdu r0,-STACK_FRAME_OVERHEAD(r1)
1626 1629
1627 LOAD_REG_IMMEDIATE(r3,cpu_specs)
1628 LOAD_REG_IMMEDIATE(r4,cur_cpu_spec)
1629 li r5,0
1630 bl .identify_cpu
1631
1632 LOAD_REG_IMMEDIATE(r2,__toc_start) 1630 LOAD_REG_IMMEDIATE(r2,__toc_start)
1633 addi r2,r2,0x4000 1631 addi r2,r2,0x4000
1634 addi r2,r2,0x4000 1632 addi r2,r2,0x4000
@@ -1687,6 +1685,8 @@ _GLOBAL(__start_initialization_multiplatform)
1687 cmpwi r0,0x3c /* 970FX */ 1685 cmpwi r0,0x3c /* 970FX */
1688 beq 1f 1686 beq 1f
1689 cmpwi r0,0x44 /* 970MP */ 1687 cmpwi r0,0x44 /* 970MP */
1688 beq 1f
1689 cmpwi r0,0x45 /* 970GX */
1690 bne 2f 1690 bne 2f
16911: bl .__cpu_preinit_ppc970 16911: bl .__cpu_preinit_ppc970
16922: 16922:
@@ -2005,13 +2005,6 @@ _STATIC(start_here_multiplatform)
2005 addi r2,r2,0x4000 2005 addi r2,r2,0x4000
2006 add r2,r2,r26 2006 add r2,r2,r26
2007 2007
2008 LOAD_REG_IMMEDIATE(r3, cpu_specs)
2009 add r3,r3,r26
2010 LOAD_REG_IMMEDIATE(r4,cur_cpu_spec)
2011 add r4,r4,r26
2012 mr r5,r26
2013 bl .identify_cpu
2014
2015 /* Do very early kernel initializations, including initial hash table, 2008 /* Do very early kernel initializations, including initial hash table,
2016 * stab and slb setup before we turn on relocation. */ 2009 * stab and slb setup before we turn on relocation. */
2017 2010
@@ -2040,13 +2033,6 @@ _STATIC(start_here_common)
2040 li r0,0 2033 li r0,0
2041 stdu r0,-STACK_FRAME_OVERHEAD(r1) 2034 stdu r0,-STACK_FRAME_OVERHEAD(r1)
2042 2035
2043 /* Apply the CPUs-specific fixups (nop out sections not relevant
2044 * to this CPU
2045 */
2046 li r3,0
2047 bl .do_cpu_ftr_fixups
2048 bl .do_fw_ftr_fixups
2049
2050 /* ptr to current */ 2036 /* ptr to current */
2051 LOAD_REG_IMMEDIATE(r4, init_task) 2037 LOAD_REG_IMMEDIATE(r4, init_task)
2052 std r4,PACACURRENT(r13) 2038 std r4,PACACURRENT(r13)
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index f88a2a675d9..ba6b7256084 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -47,6 +47,17 @@ static int novmerge = 0;
47static int novmerge = 1; 47static int novmerge = 1;
48#endif 48#endif
49 49
50static inline unsigned long iommu_num_pages(unsigned long vaddr,
51 unsigned long slen)
52{
53 unsigned long npages;
54
55 npages = IOMMU_PAGE_ALIGN(vaddr + slen) - (vaddr & IOMMU_PAGE_MASK);
56 npages >>= IOMMU_PAGE_SHIFT;
57
58 return npages;
59}
60
50static int __init setup_iommu(char *str) 61static int __init setup_iommu(char *str)
51{ 62{
52 if (!strcmp(str, "novmerge")) 63 if (!strcmp(str, "novmerge"))
@@ -178,10 +189,10 @@ static dma_addr_t iommu_alloc(struct iommu_table *tbl, void *page,
178 } 189 }
179 190
180 entry += tbl->it_offset; /* Offset into real TCE table */ 191 entry += tbl->it_offset; /* Offset into real TCE table */
181 ret = entry << PAGE_SHIFT; /* Set the return dma address */ 192 ret = entry << IOMMU_PAGE_SHIFT; /* Set the return dma address */
182 193
183 /* Put the TCEs in the HW table */ 194 /* Put the TCEs in the HW table */
184 ppc_md.tce_build(tbl, entry, npages, (unsigned long)page & PAGE_MASK, 195 ppc_md.tce_build(tbl, entry, npages, (unsigned long)page & IOMMU_PAGE_MASK,
185 direction); 196 direction);
186 197
187 198
@@ -203,7 +214,7 @@ static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
203 unsigned long entry, free_entry; 214 unsigned long entry, free_entry;
204 unsigned long i; 215 unsigned long i;
205 216
206 entry = dma_addr >> PAGE_SHIFT; 217 entry = dma_addr >> IOMMU_PAGE_SHIFT;
207 free_entry = entry - tbl->it_offset; 218 free_entry = entry - tbl->it_offset;
208 219
209 if (((free_entry + npages) > tbl->it_size) || 220 if (((free_entry + npages) > tbl->it_size) ||
@@ -270,7 +281,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
270 /* Init first segment length for backout at failure */ 281 /* Init first segment length for backout at failure */
271 outs->dma_length = 0; 282 outs->dma_length = 0;
272 283
273 DBG("mapping %d elements:\n", nelems); 284 DBG("sg mapping %d elements:\n", nelems);
274 285
275 spin_lock_irqsave(&(tbl->it_lock), flags); 286 spin_lock_irqsave(&(tbl->it_lock), flags);
276 287
@@ -285,9 +296,8 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
285 } 296 }
286 /* Allocate iommu entries for that segment */ 297 /* Allocate iommu entries for that segment */
287 vaddr = (unsigned long)page_address(s->page) + s->offset; 298 vaddr = (unsigned long)page_address(s->page) + s->offset;
288 npages = PAGE_ALIGN(vaddr + slen) - (vaddr & PAGE_MASK); 299 npages = iommu_num_pages(vaddr, slen);
289 npages >>= PAGE_SHIFT; 300 entry = iommu_range_alloc(tbl, npages, &handle, mask >> IOMMU_PAGE_SHIFT, 0);
290 entry = iommu_range_alloc(tbl, npages, &handle, mask >> PAGE_SHIFT, 0);
291 301
292 DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen); 302 DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen);
293 303
@@ -301,14 +311,14 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
301 311
302 /* Convert entry to a dma_addr_t */ 312 /* Convert entry to a dma_addr_t */
303 entry += tbl->it_offset; 313 entry += tbl->it_offset;
304 dma_addr = entry << PAGE_SHIFT; 314 dma_addr = entry << IOMMU_PAGE_SHIFT;
305 dma_addr |= s->offset; 315 dma_addr |= (s->offset & ~IOMMU_PAGE_MASK);
306 316
307 DBG(" - %lx pages, entry: %lx, dma_addr: %lx\n", 317 DBG(" - %lu pages, entry: %lx, dma_addr: %lx\n",
308 npages, entry, dma_addr); 318 npages, entry, dma_addr);
309 319
310 /* Insert into HW table */ 320 /* Insert into HW table */
311 ppc_md.tce_build(tbl, entry, npages, vaddr & PAGE_MASK, direction); 321 ppc_md.tce_build(tbl, entry, npages, vaddr & IOMMU_PAGE_MASK, direction);
312 322
313 /* If we are in an open segment, try merging */ 323 /* If we are in an open segment, try merging */
314 if (segstart != s) { 324 if (segstart != s) {
@@ -323,7 +333,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
323 DBG(" can't merge, new segment.\n"); 333 DBG(" can't merge, new segment.\n");
324 } else { 334 } else {
325 outs->dma_length += s->length; 335 outs->dma_length += s->length;
326 DBG(" merged, new len: %lx\n", outs->dma_length); 336 DBG(" merged, new len: %ux\n", outs->dma_length);
327 } 337 }
328 } 338 }
329 339
@@ -367,9 +377,8 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
367 if (s->dma_length != 0) { 377 if (s->dma_length != 0) {
368 unsigned long vaddr, npages; 378 unsigned long vaddr, npages;
369 379
370 vaddr = s->dma_address & PAGE_MASK; 380 vaddr = s->dma_address & IOMMU_PAGE_MASK;
371 npages = (PAGE_ALIGN(s->dma_address + s->dma_length) - vaddr) 381 npages = iommu_num_pages(s->dma_address, s->dma_length);
372 >> PAGE_SHIFT;
373 __iommu_free(tbl, vaddr, npages); 382 __iommu_free(tbl, vaddr, npages);
374 s->dma_address = DMA_ERROR_CODE; 383 s->dma_address = DMA_ERROR_CODE;
375 s->dma_length = 0; 384 s->dma_length = 0;
@@ -398,8 +407,7 @@ void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
398 407
399 if (sglist->dma_length == 0) 408 if (sglist->dma_length == 0)
400 break; 409 break;
401 npages = (PAGE_ALIGN(dma_handle + sglist->dma_length) 410 npages = iommu_num_pages(dma_handle,sglist->dma_length);
402 - (dma_handle & PAGE_MASK)) >> PAGE_SHIFT;
403 __iommu_free(tbl, dma_handle, npages); 411 __iommu_free(tbl, dma_handle, npages);
404 sglist++; 412 sglist++;
405 } 413 }
@@ -532,12 +540,11 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
532 BUG_ON(direction == DMA_NONE); 540 BUG_ON(direction == DMA_NONE);
533 541
534 uaddr = (unsigned long)vaddr; 542 uaddr = (unsigned long)vaddr;
535 npages = PAGE_ALIGN(uaddr + size) - (uaddr & PAGE_MASK); 543 npages = iommu_num_pages(uaddr, size);
536 npages >>= PAGE_SHIFT;
537 544
538 if (tbl) { 545 if (tbl) {
539 dma_handle = iommu_alloc(tbl, vaddr, npages, direction, 546 dma_handle = iommu_alloc(tbl, vaddr, npages, direction,
540 mask >> PAGE_SHIFT, 0); 547 mask >> IOMMU_PAGE_SHIFT, 0);
541 if (dma_handle == DMA_ERROR_CODE) { 548 if (dma_handle == DMA_ERROR_CODE) {
542 if (printk_ratelimit()) { 549 if (printk_ratelimit()) {
543 printk(KERN_INFO "iommu_alloc failed, " 550 printk(KERN_INFO "iommu_alloc failed, "
@@ -545,7 +552,7 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
545 tbl, vaddr, npages); 552 tbl, vaddr, npages);
546 } 553 }
547 } else 554 } else
548 dma_handle |= (uaddr & ~PAGE_MASK); 555 dma_handle |= (uaddr & ~IOMMU_PAGE_MASK);
549 } 556 }
550 557
551 return dma_handle; 558 return dma_handle;
@@ -554,11 +561,14 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
554void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle, 561void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
555 size_t size, enum dma_data_direction direction) 562 size_t size, enum dma_data_direction direction)
556{ 563{
564 unsigned int npages;
565
557 BUG_ON(direction == DMA_NONE); 566 BUG_ON(direction == DMA_NONE);
558 567
559 if (tbl) 568 if (tbl) {
560 iommu_free(tbl, dma_handle, (PAGE_ALIGN(dma_handle + size) - 569 npages = iommu_num_pages(dma_handle, size);
561 (dma_handle & PAGE_MASK)) >> PAGE_SHIFT); 570 iommu_free(tbl, dma_handle, npages);
571 }
562} 572}
563 573
564/* Allocates a contiguous real buffer and creates mappings over it. 574/* Allocates a contiguous real buffer and creates mappings over it.
@@ -570,11 +580,11 @@ void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
570{ 580{
571 void *ret = NULL; 581 void *ret = NULL;
572 dma_addr_t mapping; 582 dma_addr_t mapping;
573 unsigned int npages, order; 583 unsigned int order;
584 unsigned int nio_pages, io_order;
574 struct page *page; 585 struct page *page;
575 586
576 size = PAGE_ALIGN(size); 587 size = PAGE_ALIGN(size);
577 npages = size >> PAGE_SHIFT;
578 order = get_order(size); 588 order = get_order(size);
579 589
580 /* 590 /*
@@ -598,8 +608,10 @@ void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
598 memset(ret, 0, size); 608 memset(ret, 0, size);
599 609
600 /* Set up tces to cover the allocated range */ 610 /* Set up tces to cover the allocated range */
601 mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL, 611 nio_pages = size >> IOMMU_PAGE_SHIFT;
602 mask >> PAGE_SHIFT, order); 612 io_order = get_iommu_order(size);
613 mapping = iommu_alloc(tbl, ret, nio_pages, DMA_BIDIRECTIONAL,
614 mask >> IOMMU_PAGE_SHIFT, io_order);
603 if (mapping == DMA_ERROR_CODE) { 615 if (mapping == DMA_ERROR_CODE) {
604 free_pages((unsigned long)ret, order); 616 free_pages((unsigned long)ret, order);
605 return NULL; 617 return NULL;
@@ -611,12 +623,13 @@ void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
611void iommu_free_coherent(struct iommu_table *tbl, size_t size, 623void iommu_free_coherent(struct iommu_table *tbl, size_t size,
612 void *vaddr, dma_addr_t dma_handle) 624 void *vaddr, dma_addr_t dma_handle)
613{ 625{
614 unsigned int npages;
615
616 if (tbl) { 626 if (tbl) {
627 unsigned int nio_pages;
628
629 size = PAGE_ALIGN(size);
630 nio_pages = size >> IOMMU_PAGE_SHIFT;
631 iommu_free(tbl, dma_handle, nio_pages);
617 size = PAGE_ALIGN(size); 632 size = PAGE_ALIGN(size);
618 npages = size >> PAGE_SHIFT;
619 iommu_free(tbl, dma_handle, npages);
620 free_pages((unsigned long)vaddr, get_order(size)); 633 free_pages((unsigned long)vaddr, get_order(size));
621 } 634 }
622} 635}
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 88fd73fdf04..412bea3cf81 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -102,80 +102,6 @@ _GLOBAL(reloc_got2)
102 blr 102 blr
103 103
104/* 104/*
105 * identify_cpu,
106 * called with r3 = data offset and r4 = CPU number
107 * doesn't change r3
108 */
109_GLOBAL(identify_cpu)
110 addis r8,r3,cpu_specs@ha
111 addi r8,r8,cpu_specs@l
112 mfpvr r7
1131:
114 lwz r5,CPU_SPEC_PVR_MASK(r8)
115 and r5,r5,r7
116 lwz r6,CPU_SPEC_PVR_VALUE(r8)
117 cmplw 0,r6,r5
118 beq 1f
119 addi r8,r8,CPU_SPEC_ENTRY_SIZE
120 b 1b
1211:
122 addis r6,r3,cur_cpu_spec@ha
123 addi r6,r6,cur_cpu_spec@l
124 sub r8,r8,r3
125 stw r8,0(r6)
126 blr
127
128/*
129 * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
130 * and writes nop's over sections of code that don't apply for this cpu.
131 * r3 = data offset (not changed)
132 */
133_GLOBAL(do_cpu_ftr_fixups)
134 /* Get CPU 0 features */
135 addis r6,r3,cur_cpu_spec@ha
136 addi r6,r6,cur_cpu_spec@l
137 lwz r4,0(r6)
138 add r4,r4,r3
139 lwz r4,CPU_SPEC_FEATURES(r4)
140
141 /* Get the fixup table */
142 addis r6,r3,__start___ftr_fixup@ha
143 addi r6,r6,__start___ftr_fixup@l
144 addis r7,r3,__stop___ftr_fixup@ha
145 addi r7,r7,__stop___ftr_fixup@l
146
147 /* Do the fixup */
1481: cmplw 0,r6,r7
149 bgelr
150 addi r6,r6,16
151 lwz r8,-16(r6) /* mask */
152 and r8,r8,r4
153 lwz r9,-12(r6) /* value */
154 cmplw 0,r8,r9
155 beq 1b
156 lwz r8,-8(r6) /* section begin */
157 lwz r9,-4(r6) /* section end */
158 subf. r9,r8,r9
159 beq 1b
160 /* write nops over the section of code */
161 /* todo: if large section, add a branch at the start of it */
162 srwi r9,r9,2
163 mtctr r9
164 add r8,r8,r3
165 lis r0,0x60000000@h /* nop */
1663: stw r0,0(r8)
167 andi. r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
168 beq 2f
169 dcbst 0,r8 /* suboptimal, but simpler */
170 sync
171 icbi 0,r8
1722: addi r8,r8,4
173 bdnz 3b
174 sync /* additional sync needed on g4 */
175 isync
176 b 1b
177
178/*
179 * call_setup_cpu - call the setup_cpu function for this cpu 105 * call_setup_cpu - call the setup_cpu function for this cpu
180 * r3 = data offset, r24 = cpu number 106 * r3 = data offset, r24 = cpu number
181 * 107 *
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index c70e20708a1..21fd2c662a9 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -246,130 +246,6 @@ _GLOBAL(__flush_dcache_icache)
246 isync 246 isync
247 blr 247 blr
248 248
249/*
250 * identify_cpu and calls setup_cpu
251 * In: r3 = base of the cpu_specs array
252 * r4 = address of cur_cpu_spec
253 * r5 = relocation offset
254 */
255_GLOBAL(identify_cpu)
256 mfpvr r7
2571:
258 lwz r8,CPU_SPEC_PVR_MASK(r3)
259 and r8,r8,r7
260 lwz r9,CPU_SPEC_PVR_VALUE(r3)
261 cmplw 0,r9,r8
262 beq 1f
263 addi r3,r3,CPU_SPEC_ENTRY_SIZE
264 b 1b
2651:
266 sub r0,r3,r5
267 std r0,0(r4)
268 ld r4,CPU_SPEC_SETUP(r3)
269 cmpdi 0,r4,0
270 add r4,r4,r5
271 beqlr
272 ld r4,0(r4)
273 add r4,r4,r5
274 mtctr r4
275 /* Calling convention for cpu setup is r3=offset, r4=cur_cpu_spec */
276 mr r4,r3
277 mr r3,r5
278 bctr
279
280/*
281 * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
282 * and writes nop's over sections of code that don't apply for this cpu.
283 * r3 = data offset (not changed)
284 */
285_GLOBAL(do_cpu_ftr_fixups)
286 /* Get CPU 0 features */
287 LOAD_REG_IMMEDIATE(r6,cur_cpu_spec)
288 sub r6,r6,r3
289 ld r4,0(r6)
290 sub r4,r4,r3
291 ld r4,CPU_SPEC_FEATURES(r4)
292 /* Get the fixup table */
293 LOAD_REG_IMMEDIATE(r6,__start___ftr_fixup)
294 sub r6,r6,r3
295 LOAD_REG_IMMEDIATE(r7,__stop___ftr_fixup)
296 sub r7,r7,r3
297 /* Do the fixup */
2981: cmpld r6,r7
299 bgelr
300 addi r6,r6,32
301 ld r8,-32(r6) /* mask */
302 and r8,r8,r4
303 ld r9,-24(r6) /* value */
304 cmpld r8,r9
305 beq 1b
306 ld r8,-16(r6) /* section begin */
307 ld r9,-8(r6) /* section end */
308 subf. r9,r8,r9
309 beq 1b
310 /* write nops over the section of code */
311 /* todo: if large section, add a branch at the start of it */
312 srwi r9,r9,2
313 mtctr r9
314 sub r8,r8,r3
315 lis r0,0x60000000@h /* nop */
3163: stw r0,0(r8)
317 andi. r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
318 beq 2f
319 dcbst 0,r8 /* suboptimal, but simpler */
320 sync
321 icbi 0,r8
3222: addi r8,r8,4
323 bdnz 3b
324 sync /* additional sync needed on g4 */
325 isync
326 b 1b
327
328/*
329 * do_fw_ftr_fixups - goes through the list of firmware feature fixups
330 * and writes nop's over sections of code that don't apply for this firmware.
331 * r3 = data offset (not changed)
332 */
333_GLOBAL(do_fw_ftr_fixups)
334 /* Get firmware features */
335 LOAD_REG_IMMEDIATE(r6,powerpc_firmware_features)
336 sub r6,r6,r3
337 ld r4,0(r6)
338 /* Get the fixup table */
339 LOAD_REG_IMMEDIATE(r6,__start___fw_ftr_fixup)
340 sub r6,r6,r3
341 LOAD_REG_IMMEDIATE(r7,__stop___fw_ftr_fixup)
342 sub r7,r7,r3
343 /* Do the fixup */
3441: cmpld r6,r7
345 bgelr
346 addi r6,r6,32
347 ld r8,-32(r6) /* mask */
348 and r8,r8,r4
349 ld r9,-24(r6) /* value */
350 cmpld r8,r9
351 beq 1b
352 ld r8,-16(r6) /* section begin */
353 ld r9,-8(r6) /* section end */
354 subf. r9,r8,r9
355 beq 1b
356 /* write nops over the section of code */
357 /* todo: if large section, add a branch at the start of it */
358 srwi r9,r9,2
359 mtctr r9
360 sub r8,r8,r3
361 lis r0,0x60000000@h /* nop */
3623: stw r0,0(r8)
363BEGIN_FTR_SECTION
364 dcbst 0,r8 /* suboptimal, but simpler */
365 sync
366 icbi 0,r8
367END_FTR_SECTION_IFSET(CPU_FTR_SPLIT_ID_CACHE)
368 addi r8,r8,4
369 bdnz 3b
370 sync /* additional sync needed on g4 */
371 isync
372 b 1b
373 249
374#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) 250#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE)
375/* 251/*
diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c
index 92f4e5f64f0..e2c3c6a85f3 100644
--- a/arch/powerpc/kernel/module_32.c
+++ b/arch/powerpc/kernel/module_32.c
@@ -24,6 +24,8 @@
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25#include <linux/cache.h> 25#include <linux/cache.h>
26 26
27#include "setup.h"
28
27#if 0 29#if 0
28#define DEBUGP printk 30#define DEBUGP printk
29#else 31#else
@@ -269,33 +271,50 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
269 return 0; 271 return 0;
270} 272}
271 273
274static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
275 const Elf_Shdr *sechdrs,
276 const char *name)
277{
278 char *secstrings;
279 unsigned int i;
280
281 secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
282 for (i = 1; i < hdr->e_shnum; i++)
283 if (strcmp(secstrings+sechdrs[i].sh_name, name) == 0)
284 return &sechdrs[i];
285 return NULL;
286}
287
272int module_finalize(const Elf_Ehdr *hdr, 288int module_finalize(const Elf_Ehdr *hdr,
273 const Elf_Shdr *sechdrs, 289 const Elf_Shdr *sechdrs,
274 struct module *me) 290 struct module *me)
275{ 291{
276 char *secstrings; 292 const Elf_Shdr *sect;
277 unsigned int i;
278 293
279 me->arch.bug_table = NULL; 294 me->arch.bug_table = NULL;
280 me->arch.num_bugs = 0; 295 me->arch.num_bugs = 0;
281 296
282 /* Find the __bug_table section, if present */ 297 /* Find the __bug_table section, if present */
283 secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 298 sect = find_section(hdr, sechdrs, "__bug_table");
284 for (i = 1; i < hdr->e_shnum; i++) { 299 if (sect != NULL) {
285 if (strcmp(secstrings+sechdrs[i].sh_name, "__bug_table")) 300 me->arch.bug_table = (void *) sect->sh_addr;
286 continue; 301 me->arch.num_bugs = sect->sh_size / sizeof(struct bug_entry);
287 me->arch.bug_table = (void *) sechdrs[i].sh_addr;
288 me->arch.num_bugs = sechdrs[i].sh_size / sizeof(struct bug_entry);
289 break;
290 } 302 }
291 303
292 /* 304 /*
293 * Strictly speaking this should have a spinlock to protect against 305 * Strictly speaking this should have a spinlock to protect against
294 * traversals, but since we only traverse on BUG()s, a spinlock 306 * traversals, but since we only traverse on BUG()s, a spinlock
295 * could potentially lead to deadlock and thus be counter-productive. 307 * could potentially lead to deadlock and thus be counter-productive.
296 */ 308 */
297 list_add(&me->arch.bug_list, &module_bug_list); 309 list_add(&me->arch.bug_list, &module_bug_list);
298 310
311 /* Apply feature fixups */
312 sect = find_section(hdr, sechdrs, "__ftr_fixup");
313 if (sect != NULL)
314 do_feature_fixups(cur_cpu_spec->cpu_features,
315 (void *)sect->sh_addr,
316 (void *)sect->sh_addr + sect->sh_size);
317
299 return 0; 318 return 0;
300} 319}
301 320
diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c
index ba34001fca8..8dd1f0aae5d 100644
--- a/arch/powerpc/kernel/module_64.c
+++ b/arch/powerpc/kernel/module_64.c
@@ -22,6 +22,9 @@
22#include <linux/vmalloc.h> 22#include <linux/vmalloc.h>
23#include <asm/module.h> 23#include <asm/module.h>
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25#include <asm/firmware.h>
26
27#include "setup.h"
25 28
26/* FIXME: We don't do .init separately. To do this, we'd need to have 29/* FIXME: We don't do .init separately. To do this, we'd need to have
27 a separate r2 value in the init and core section, and stub between 30 a separate r2 value in the init and core section, and stub between
@@ -400,6 +403,11 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
400 | (value & 0x03fffffc); 403 | (value & 0x03fffffc);
401 break; 404 break;
402 405
406 case R_PPC64_REL64:
407 /* 64 bits relative (used by features fixups) */
408 *location = value - (unsigned long)location;
409 break;
410
403 default: 411 default:
404 printk("%s: Unknown ADD relocation: %lu\n", 412 printk("%s: Unknown ADD relocation: %lu\n",
405 me->name, 413 me->name,
@@ -413,23 +421,33 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
413 421
414LIST_HEAD(module_bug_list); 422LIST_HEAD(module_bug_list);
415 423
416int module_finalize(const Elf_Ehdr *hdr, 424static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
417 const Elf_Shdr *sechdrs, struct module *me) 425 const Elf_Shdr *sechdrs,
426 const char *name)
418{ 427{
419 char *secstrings; 428 char *secstrings;
420 unsigned int i; 429 unsigned int i;
421 430
431 secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
432 for (i = 1; i < hdr->e_shnum; i++)
433 if (strcmp(secstrings+sechdrs[i].sh_name, name) == 0)
434 return &sechdrs[i];
435 return NULL;
436}
437
438int module_finalize(const Elf_Ehdr *hdr,
439 const Elf_Shdr *sechdrs, struct module *me)
440{
441 const Elf_Shdr *sect;
442
422 me->arch.bug_table = NULL; 443 me->arch.bug_table = NULL;
423 me->arch.num_bugs = 0; 444 me->arch.num_bugs = 0;
424 445
425 /* Find the __bug_table section, if present */ 446 /* Find the __bug_table section, if present */
426 secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 447 sect = find_section(hdr, sechdrs, "__bug_table");
427 for (i = 1; i < hdr->e_shnum; i++) { 448 if (sect != NULL) {
428 if (strcmp(secstrings+sechdrs[i].sh_name, "__bug_table")) 449 me->arch.bug_table = (void *) sect->sh_addr;
429 continue; 450 me->arch.num_bugs = sect->sh_size / sizeof(struct bug_entry);
430 me->arch.bug_table = (void *) sechdrs[i].sh_addr;
431 me->arch.num_bugs = sechdrs[i].sh_size / sizeof(struct bug_entry);
432 break;
433 } 451 }
434 452
435 /* 453 /*
@@ -439,6 +457,19 @@ int module_finalize(const Elf_Ehdr *hdr,
439 */ 457 */
440 list_add(&me->arch.bug_list, &module_bug_list); 458 list_add(&me->arch.bug_list, &module_bug_list);
441 459
460 /* Apply feature fixups */
461 sect = find_section(hdr, sechdrs, "__ftr_fixup");
462 if (sect != NULL)
463 do_feature_fixups(cur_cpu_spec->cpu_features,
464 (void *)sect->sh_addr,
465 (void *)sect->sh_addr + sect->sh_size);
466
467 sect = find_section(hdr, sechdrs, "__fw_ftr_fixup");
468 if (sect != NULL)
469 do_feature_fixups(powerpc_firmware_features,
470 (void *)sect->sh_addr,
471 (void *)sect->sh_addr + sect->sh_size);
472
442 return 0; 473 return 0;
443} 474}
444 475
diff --git a/arch/powerpc/kernel/perfmon_fsl_booke.c b/arch/powerpc/kernel/perfmon_fsl_booke.c
deleted file mode 100644
index e0dcf2b41fb..00000000000
--- a/arch/powerpc/kernel/perfmon_fsl_booke.c
+++ /dev/null
@@ -1,221 +0,0 @@
1/* arch/powerpc/kernel/perfmon_fsl_booke.c
2 * Freescale Book-E Performance Monitor code
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/init.h>
25#include <linux/module.h>
26#include <linux/prctl.h>
27
28#include <asm/pgtable.h>
29#include <asm/uaccess.h>
30#include <asm/system.h>
31#include <asm/io.h>
32#include <asm/reg.h>
33#include <asm/xmon.h>
34#include <asm/pmc.h>
35
36static inline u32 get_pmlca(int ctr);
37static inline void set_pmlca(int ctr, u32 pmlca);
38
39static inline u32 get_pmlca(int ctr)
40{
41 u32 pmlca;
42
43 switch (ctr) {
44 case 0:
45 pmlca = mfpmr(PMRN_PMLCA0);
46 break;
47 case 1:
48 pmlca = mfpmr(PMRN_PMLCA1);
49 break;
50 case 2:
51 pmlca = mfpmr(PMRN_PMLCA2);
52 break;
53 case 3:
54 pmlca = mfpmr(PMRN_PMLCA3);
55 break;
56 default:
57 panic("Bad ctr number\n");
58 }
59
60 return pmlca;
61}
62
63static inline void set_pmlca(int ctr, u32 pmlca)
64{
65 switch (ctr) {
66 case 0:
67 mtpmr(PMRN_PMLCA0, pmlca);
68 break;
69 case 1:
70 mtpmr(PMRN_PMLCA1, pmlca);
71 break;
72 case 2:
73 mtpmr(PMRN_PMLCA2, pmlca);
74 break;
75 case 3:
76 mtpmr(PMRN_PMLCA3, pmlca);
77 break;
78 default:
79 panic("Bad ctr number\n");
80 }
81}
82
83void init_pmc_stop(int ctr)
84{
85 u32 pmlca = (PMLCA_FC | PMLCA_FCS | PMLCA_FCU |
86 PMLCA_FCM1 | PMLCA_FCM0);
87 u32 pmlcb = 0;
88
89 switch (ctr) {
90 case 0:
91 mtpmr(PMRN_PMLCA0, pmlca);
92 mtpmr(PMRN_PMLCB0, pmlcb);
93 break;
94 case 1:
95 mtpmr(PMRN_PMLCA1, pmlca);
96 mtpmr(PMRN_PMLCB1, pmlcb);
97 break;
98 case 2:
99 mtpmr(PMRN_PMLCA2, pmlca);
100 mtpmr(PMRN_PMLCB2, pmlcb);
101 break;
102 case 3:
103 mtpmr(PMRN_PMLCA3, pmlca);
104 mtpmr(PMRN_PMLCB3, pmlcb);
105 break;
106 default:
107 panic("Bad ctr number!\n");
108 }
109}
110
111void set_pmc_event(int ctr, int event)
112{
113 u32 pmlca;
114
115 pmlca = get_pmlca(ctr);
116
117 pmlca = (pmlca & ~PMLCA_EVENT_MASK) |
118 ((event << PMLCA_EVENT_SHIFT) &
119 PMLCA_EVENT_MASK);
120
121 set_pmlca(ctr, pmlca);
122}
123
124void set_pmc_user_kernel(int ctr, int user, int kernel)
125{
126 u32 pmlca;
127
128 pmlca = get_pmlca(ctr);
129
130 if(user)
131 pmlca &= ~PMLCA_FCU;
132 else
133 pmlca |= PMLCA_FCU;
134
135 if(kernel)
136 pmlca &= ~PMLCA_FCS;
137 else
138 pmlca |= PMLCA_FCS;
139
140 set_pmlca(ctr, pmlca);
141}
142
143void set_pmc_marked(int ctr, int mark0, int mark1)
144{
145 u32 pmlca = get_pmlca(ctr);
146
147 if(mark0)
148 pmlca &= ~PMLCA_FCM0;
149 else
150 pmlca |= PMLCA_FCM0;
151
152 if(mark1)
153 pmlca &= ~PMLCA_FCM1;
154 else
155 pmlca |= PMLCA_FCM1;
156
157 set_pmlca(ctr, pmlca);
158}
159
160void pmc_start_ctr(int ctr, int enable)
161{
162 u32 pmlca = get_pmlca(ctr);
163
164 pmlca &= ~PMLCA_FC;
165
166 if (enable)
167 pmlca |= PMLCA_CE;
168 else
169 pmlca &= ~PMLCA_CE;
170
171 set_pmlca(ctr, pmlca);
172}
173
174void pmc_start_ctrs(int enable)
175{
176 u32 pmgc0 = mfpmr(PMRN_PMGC0);
177
178 pmgc0 &= ~PMGC0_FAC;
179 pmgc0 |= PMGC0_FCECE;
180
181 if (enable)
182 pmgc0 |= PMGC0_PMIE;
183 else
184 pmgc0 &= ~PMGC0_PMIE;
185
186 mtpmr(PMRN_PMGC0, pmgc0);
187}
188
189void pmc_stop_ctrs(void)
190{
191 u32 pmgc0 = mfpmr(PMRN_PMGC0);
192
193 pmgc0 |= PMGC0_FAC;
194
195 pmgc0 &= ~(PMGC0_PMIE | PMGC0_FCECE);
196
197 mtpmr(PMRN_PMGC0, pmgc0);
198}
199
200void dump_pmcs(void)
201{
202 printk("pmgc0: %x\n", mfpmr(PMRN_PMGC0));
203 printk("pmc\t\tpmlca\t\tpmlcb\n");
204 printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC0),
205 mfpmr(PMRN_PMLCA0), mfpmr(PMRN_PMLCB0));
206 printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC1),
207 mfpmr(PMRN_PMLCA1), mfpmr(PMRN_PMLCB1));
208 printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC2),
209 mfpmr(PMRN_PMLCA2), mfpmr(PMRN_PMLCB2));
210 printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC3),
211 mfpmr(PMRN_PMLCA3), mfpmr(PMRN_PMLCB3));
212}
213
214EXPORT_SYMBOL(init_pmc_stop);
215EXPORT_SYMBOL(set_pmc_event);
216EXPORT_SYMBOL(set_pmc_user_kernel);
217EXPORT_SYMBOL(set_pmc_marked);
218EXPORT_SYMBOL(pmc_start_ctr);
219EXPORT_SYMBOL(pmc_start_ctrs);
220EXPORT_SYMBOL(pmc_stop_ctrs);
221EXPORT_SYMBOL(dump_pmcs);
diff --git a/arch/powerpc/kernel/pmc.c b/arch/powerpc/kernel/pmc.c
index a0a2efadeab..3d8f6f44641 100644
--- a/arch/powerpc/kernel/pmc.c
+++ b/arch/powerpc/kernel/pmc.c
@@ -71,7 +71,7 @@ int reserve_pmc_hardware(perf_irq_t new_perf_irq)
71 } 71 }
72 72
73 pmc_owner_caller = __builtin_return_address(0); 73 pmc_owner_caller = __builtin_return_address(0);
74 perf_irq = new_perf_irq ? : dummy_perf; 74 perf_irq = new_perf_irq ? new_perf_irq : dummy_perf;
75 75
76 out: 76 out:
77 spin_unlock(&pmc_owner_lock); 77 spin_unlock(&pmc_owner_lock);
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index f8e44c029d9..16d29d16b96 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1014,7 +1014,7 @@ EXPORT_SYMBOL(find_all_nodes);
1014/** Checks if the given "compat" string matches one of the strings in 1014/** Checks if the given "compat" string matches one of the strings in
1015 * the device's "compatible" property 1015 * the device's "compatible" property
1016 */ 1016 */
1017int device_is_compatible(struct device_node *device, const char *compat) 1017int device_is_compatible(const struct device_node *device, const char *compat)
1018{ 1018{
1019 const char* cp; 1019 const char* cp;
1020 int cplen, l; 1020 int cplen, l;
@@ -1491,7 +1491,8 @@ static int __init prom_reconfig_setup(void)
1491__initcall(prom_reconfig_setup); 1491__initcall(prom_reconfig_setup);
1492#endif 1492#endif
1493 1493
1494struct property *of_find_property(struct device_node *np, const char *name, 1494struct property *of_find_property(const struct device_node *np,
1495 const char *name,
1495 int *lenp) 1496 int *lenp)
1496{ 1497{
1497 struct property *pp; 1498 struct property *pp;
@@ -1512,7 +1513,8 @@ struct property *of_find_property(struct device_node *np, const char *name,
1512 * Find a property with a given name for a given node 1513 * Find a property with a given name for a given node
1513 * and return the value. 1514 * and return the value.
1514 */ 1515 */
1515const void *get_property(struct device_node *np, const char *name, int *lenp) 1516const void *get_property(const struct device_node *np, const char *name,
1517 int *lenp)
1516{ 1518{
1517 struct property *pp = of_find_property(np,name,lenp); 1519 struct property *pp = of_find_property(np,name,lenp);
1518 return pp ? pp->value : NULL; 1520 return pp ? pp->value : NULL;
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
index 1442b63a75d..6f6fc977cb3 100644
--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -72,6 +72,10 @@
72#define VALIDATE_BUF_SIZE 4096 72#define VALIDATE_BUF_SIZE 4096
73#define RTAS_MSG_MAXLEN 64 73#define RTAS_MSG_MAXLEN 64
74 74
75/* Quirk - RTAS requires 4k list length and block size */
76#define RTAS_BLKLIST_LENGTH 4096
77#define RTAS_BLK_SIZE 4096
78
75struct flash_block { 79struct flash_block {
76 char *data; 80 char *data;
77 unsigned long length; 81 unsigned long length;
@@ -83,7 +87,7 @@ struct flash_block {
83 * into a version/length and translate the pointers 87 * into a version/length and translate the pointers
84 * to absolute. 88 * to absolute.
85 */ 89 */
86#define FLASH_BLOCKS_PER_NODE ((PAGE_SIZE - 16) / sizeof(struct flash_block)) 90#define FLASH_BLOCKS_PER_NODE ((RTAS_BLKLIST_LENGTH - 16) / sizeof(struct flash_block))
87struct flash_block_list { 91struct flash_block_list {
88 unsigned long num_blocks; 92 unsigned long num_blocks;
89 struct flash_block_list *next; 93 struct flash_block_list *next;
@@ -96,6 +100,9 @@ struct flash_block_list_header { /* just the header of flash_block_list */
96 100
97static struct flash_block_list_header rtas_firmware_flash_list = {0, NULL}; 101static struct flash_block_list_header rtas_firmware_flash_list = {0, NULL};
98 102
103/* Use slab cache to guarantee 4k alignment */
104static kmem_cache_t *flash_block_cache = NULL;
105
99#define FLASH_BLOCK_LIST_VERSION (1UL) 106#define FLASH_BLOCK_LIST_VERSION (1UL)
100 107
101/* Local copy of the flash block list. 108/* Local copy of the flash block list.
@@ -153,7 +160,7 @@ static int flash_list_valid(struct flash_block_list *flist)
153 return FLASH_IMG_NULL_DATA; 160 return FLASH_IMG_NULL_DATA;
154 } 161 }
155 block_size = f->blocks[i].length; 162 block_size = f->blocks[i].length;
156 if (block_size <= 0 || block_size > PAGE_SIZE) { 163 if (block_size <= 0 || block_size > RTAS_BLK_SIZE) {
157 return FLASH_IMG_BAD_LEN; 164 return FLASH_IMG_BAD_LEN;
158 } 165 }
159 image_size += block_size; 166 image_size += block_size;
@@ -177,9 +184,9 @@ static void free_flash_list(struct flash_block_list *f)
177 184
178 while (f) { 185 while (f) {
179 for (i = 0; i < f->num_blocks; i++) 186 for (i = 0; i < f->num_blocks; i++)
180 free_page((unsigned long)(f->blocks[i].data)); 187 kmem_cache_free(flash_block_cache, f->blocks[i].data);
181 next = f->next; 188 next = f->next;
182 free_page((unsigned long)f); 189 kmem_cache_free(flash_block_cache, f);
183 f = next; 190 f = next;
184 } 191 }
185} 192}
@@ -278,6 +285,12 @@ static ssize_t rtas_flash_read(struct file *file, char __user *buf,
278 return msglen; 285 return msglen;
279} 286}
280 287
288/* constructor for flash_block_cache */
289void rtas_block_ctor(void *ptr, kmem_cache_t *cache, unsigned long flags)
290{
291 memset(ptr, 0, RTAS_BLK_SIZE);
292}
293
281/* We could be much more efficient here. But to keep this function 294/* We could be much more efficient here. But to keep this function
282 * simple we allocate a page to the block list no matter how small the 295 * simple we allocate a page to the block list no matter how small the
283 * count is. If the system is low on memory it will be just as well 296 * count is. If the system is low on memory it will be just as well
@@ -302,7 +315,7 @@ static ssize_t rtas_flash_write(struct file *file, const char __user *buffer,
302 * proc file 315 * proc file
303 */ 316 */
304 if (uf->flist == NULL) { 317 if (uf->flist == NULL) {
305 uf->flist = (struct flash_block_list *) get_zeroed_page(GFP_KERNEL); 318 uf->flist = kmem_cache_alloc(flash_block_cache, GFP_KERNEL);
306 if (!uf->flist) 319 if (!uf->flist)
307 return -ENOMEM; 320 return -ENOMEM;
308 } 321 }
@@ -313,21 +326,21 @@ static ssize_t rtas_flash_write(struct file *file, const char __user *buffer,
313 next_free = fl->num_blocks; 326 next_free = fl->num_blocks;
314 if (next_free == FLASH_BLOCKS_PER_NODE) { 327 if (next_free == FLASH_BLOCKS_PER_NODE) {
315 /* Need to allocate another block_list */ 328 /* Need to allocate another block_list */
316 fl->next = (struct flash_block_list *)get_zeroed_page(GFP_KERNEL); 329 fl->next = kmem_cache_alloc(flash_block_cache, GFP_KERNEL);
317 if (!fl->next) 330 if (!fl->next)
318 return -ENOMEM; 331 return -ENOMEM;
319 fl = fl->next; 332 fl = fl->next;
320 next_free = 0; 333 next_free = 0;
321 } 334 }
322 335
323 if (count > PAGE_SIZE) 336 if (count > RTAS_BLK_SIZE)
324 count = PAGE_SIZE; 337 count = RTAS_BLK_SIZE;
325 p = (char *)get_zeroed_page(GFP_KERNEL); 338 p = kmem_cache_alloc(flash_block_cache, GFP_KERNEL);
326 if (!p) 339 if (!p)
327 return -ENOMEM; 340 return -ENOMEM;
328 341
329 if(copy_from_user(p, buffer, count)) { 342 if(copy_from_user(p, buffer, count)) {
330 free_page((unsigned long)p); 343 kmem_cache_free(flash_block_cache, p);
331 return -EFAULT; 344 return -EFAULT;
332 } 345 }
333 fl->blocks[next_free].data = p; 346 fl->blocks[next_free].data = p;
@@ -791,6 +804,16 @@ int __init rtas_flash_init(void)
791 goto cleanup; 804 goto cleanup;
792 805
793 rtas_flash_term_hook = rtas_flash_firmware; 806 rtas_flash_term_hook = rtas_flash_firmware;
807
808 flash_block_cache = kmem_cache_create("rtas_flash_cache",
809 RTAS_BLK_SIZE, RTAS_BLK_SIZE, 0,
810 rtas_block_ctor, NULL);
811 if (!flash_block_cache) {
812 printk(KERN_ERR "%s: failed to create block cache\n",
813 __FUNCTION__);
814 rc = -ENOMEM;
815 goto cleanup;
816 }
794 return 0; 817 return 0;
795 818
796cleanup: 819cleanup:
@@ -805,6 +828,10 @@ cleanup:
805void __exit rtas_flash_cleanup(void) 828void __exit rtas_flash_cleanup(void)
806{ 829{
807 rtas_flash_term_hook = NULL; 830 rtas_flash_term_hook = NULL;
831
832 if (flash_block_cache)
833 kmem_cache_destroy(flash_block_cache);
834
808 remove_flash_pde(firmware_flash_pde); 835 remove_flash_pde(firmware_flash_pde);
809 remove_flash_pde(firmware_update_pde); 836 remove_flash_pde(firmware_update_pde);
810 remove_flash_pde(validate_pde); 837 remove_flash_pde(validate_pde);
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 517ed1b1b16..04df53a3c86 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -87,6 +87,7 @@ int ucache_bsize;
87unsigned long __init early_init(unsigned long dt_ptr) 87unsigned long __init early_init(unsigned long dt_ptr)
88{ 88{
89 unsigned long offset = reloc_offset(); 89 unsigned long offset = reloc_offset();
90 struct cpu_spec *spec;
90 91
91 /* First zero the BSS -- use memset_io, some platforms don't have 92 /* First zero the BSS -- use memset_io, some platforms don't have
92 * caches on yet */ 93 * caches on yet */
@@ -96,8 +97,11 @@ unsigned long __init early_init(unsigned long dt_ptr)
96 * Identify the CPU type and fix up code sections 97 * Identify the CPU type and fix up code sections
97 * that depend on which cpu we have. 98 * that depend on which cpu we have.
98 */ 99 */
99 identify_cpu(offset, 0); 100 spec = identify_cpu(offset);
100 do_cpu_ftr_fixups(offset); 101
102 do_feature_fixups(spec->cpu_features,
103 PTRRELOC(&__start___ftr_fixup),
104 PTRRELOC(&__stop___ftr_fixup));
101 105
102 return KERNELBASE + offset; 106 return KERNELBASE + offset;
103} 107}
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 2fef772edfc..b0f1c82df99 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -169,6 +169,9 @@ void __init setup_paca(int cpu)
169 169
170void __init early_setup(unsigned long dt_ptr) 170void __init early_setup(unsigned long dt_ptr)
171{ 171{
172 /* Identify CPU type */
173 identify_cpu(0);
174
172 /* Assume we're on cpu 0 for now. Don't write to the paca yet! */ 175 /* Assume we're on cpu 0 for now. Don't write to the paca yet! */
173 setup_paca(0); 176 setup_paca(0);
174 177
@@ -347,6 +350,14 @@ void __init setup_system(void)
347{ 350{
348 DBG(" -> setup_system()\n"); 351 DBG(" -> setup_system()\n");
349 352
353 /* Apply the CPUs-specific and firmware specific fixups to kernel
354 * text (nop out sections not relevant to this CPU or this firmware)
355 */
356 do_feature_fixups(cur_cpu_spec->cpu_features,
357 &__start___ftr_fixup, &__stop___ftr_fixup);
358 do_feature_fixups(powerpc_firmware_features,
359 &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup);
360
350 /* 361 /*
351 * Unflatten the device-tree passed by prom_init or kexec 362 * Unflatten the device-tree passed by prom_init or kexec
352 */ 363 */
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 5b59bc18dfe..46a24de36fe 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -220,11 +220,8 @@ static void account_process_time(struct pt_regs *regs)
220 */ 220 */
221struct cpu_purr_data { 221struct cpu_purr_data {
222 int initialized; /* thread is running */ 222 int initialized; /* thread is running */
223 u64 tb0; /* timebase at origin time */
224 u64 purr0; /* PURR at origin time */
225 u64 tb; /* last TB value read */ 223 u64 tb; /* last TB value read */
226 u64 purr; /* last PURR value read */ 224 u64 purr; /* last PURR value read */
227 u64 stolen; /* stolen time so far */
228 spinlock_t lock; 225 spinlock_t lock;
229}; 226};
230 227
@@ -234,10 +231,8 @@ static void snapshot_tb_and_purr(void *data)
234{ 231{
235 struct cpu_purr_data *p = &__get_cpu_var(cpu_purr_data); 232 struct cpu_purr_data *p = &__get_cpu_var(cpu_purr_data);
236 233
237 p->tb0 = mftb(); 234 p->tb = mftb();
238 p->purr0 = mfspr(SPRN_PURR); 235 p->purr = mfspr(SPRN_PURR);
239 p->tb = p->tb0;
240 p->purr = 0;
241 wmb(); 236 wmb();
242 p->initialized = 1; 237 p->initialized = 1;
243} 238}
@@ -258,37 +253,24 @@ void snapshot_timebases(void)
258 253
259void calculate_steal_time(void) 254void calculate_steal_time(void)
260{ 255{
261 u64 tb, purr, t0; 256 u64 tb, purr;
262 s64 stolen; 257 s64 stolen;
263 struct cpu_purr_data *p0, *pme, *phim; 258 struct cpu_purr_data *pme;
264 int cpu;
265 259
266 if (!cpu_has_feature(CPU_FTR_PURR)) 260 if (!cpu_has_feature(CPU_FTR_PURR))
267 return; 261 return;
268 cpu = smp_processor_id(); 262 pme = &per_cpu(cpu_purr_data, smp_processor_id());
269 pme = &per_cpu(cpu_purr_data, cpu);
270 if (!pme->initialized) 263 if (!pme->initialized)
271 return; /* this can happen in early boot */ 264 return; /* this can happen in early boot */
272 p0 = &per_cpu(cpu_purr_data, cpu & ~1); 265 spin_lock(&pme->lock);
273 phim = &per_cpu(cpu_purr_data, cpu ^ 1);
274 spin_lock(&p0->lock);
275 tb = mftb(); 266 tb = mftb();
276 purr = mfspr(SPRN_PURR) - pme->purr0; 267 purr = mfspr(SPRN_PURR);
277 if (!phim->initialized || !cpu_online(cpu ^ 1)) { 268 stolen = (tb - pme->tb) - (purr - pme->purr);
278 stolen = (tb - pme->tb) - (purr - pme->purr); 269 if (stolen > 0)
279 } else {
280 t0 = pme->tb0;
281 if (phim->tb0 < t0)
282 t0 = phim->tb0;
283 stolen = phim->tb - t0 - phim->purr - purr - p0->stolen;
284 }
285 if (stolen > 0) {
286 account_steal_time(current, stolen); 270 account_steal_time(current, stolen);
287 p0->stolen += stolen;
288 }
289 pme->tb = tb; 271 pme->tb = tb;
290 pme->purr = purr; 272 pme->purr = purr;
291 spin_unlock(&p0->lock); 273 spin_unlock(&pme->lock);
292} 274}
293 275
294/* 276/*
@@ -297,30 +279,17 @@ void calculate_steal_time(void)
297 */ 279 */
298static void snapshot_purr(void) 280static void snapshot_purr(void)
299{ 281{
300 int cpu; 282 struct cpu_purr_data *pme;
301 u64 purr;
302 struct cpu_purr_data *p0, *pme, *phim;
303 unsigned long flags; 283 unsigned long flags;
304 284
305 if (!cpu_has_feature(CPU_FTR_PURR)) 285 if (!cpu_has_feature(CPU_FTR_PURR))
306 return; 286 return;
307 cpu = smp_processor_id(); 287 pme = &per_cpu(cpu_purr_data, smp_processor_id());
308 pme = &per_cpu(cpu_purr_data, cpu); 288 spin_lock_irqsave(&pme->lock, flags);
309 p0 = &per_cpu(cpu_purr_data, cpu & ~1); 289 pme->tb = mftb();
310 phim = &per_cpu(cpu_purr_data, cpu ^ 1); 290 pme->purr = mfspr(SPRN_PURR);
311 spin_lock_irqsave(&p0->lock, flags);
312 pme->tb = pme->tb0 = mftb();
313 purr = mfspr(SPRN_PURR);
314 if (!phim->initialized) {
315 pme->purr = 0;
316 pme->purr0 = purr;
317 } else {
318 /* set p->purr and p->purr0 for no change in p0->stolen */
319 pme->purr = phim->tb - phim->tb0 - phim->purr - p0->stolen;
320 pme->purr0 = purr - pme->purr;
321 }
322 pme->initialized = 1; 291 pme->initialized = 1;
323 spin_unlock_irqrestore(&p0->lock, flags); 292 spin_unlock_irqrestore(&pme->lock, flags);
324} 293}
325 294
326#endif /* CONFIG_PPC_SPLPAR */ 295#endif /* CONFIG_PPC_SPLPAR */
@@ -1045,48 +1014,6 @@ void __init time_init(void)
1045 set_dec(tb_ticks_per_jiffy); 1014 set_dec(tb_ticks_per_jiffy);
1046} 1015}
1047 1016
1048#ifdef CONFIG_RTC_CLASS
1049static int set_rtc_class_time(struct rtc_time *tm)
1050{
1051 int err;
1052 struct class_device *class_dev =
1053 rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
1054
1055 if (class_dev == NULL)
1056 return -ENODEV;
1057
1058 err = rtc_set_time(class_dev, tm);
1059
1060 rtc_class_close(class_dev);
1061
1062 return 0;
1063}
1064
1065static void get_rtc_class_time(struct rtc_time *tm)
1066{
1067 int err;
1068 struct class_device *class_dev =
1069 rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
1070
1071 if (class_dev == NULL)
1072 return;
1073
1074 err = rtc_read_time(class_dev, tm);
1075
1076 rtc_class_close(class_dev);
1077
1078 return;
1079}
1080
1081int __init rtc_class_hookup(void)
1082{
1083 ppc_md.get_rtc_time = get_rtc_class_time;
1084 ppc_md.set_rtc_time = set_rtc_class_time;
1085
1086 return 0;
1087}
1088#endif /* CONFIG_RTC_CLASS */
1089
1090 1017
1091#define FEBRUARY 2 1018#define FEBRUARY 2
1092#define STARTOFTIME 1970 1019#define STARTOFTIME 1970
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 5ed4c2ceb5c..c66b4771ef4 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -843,7 +843,7 @@ void __kprobes program_check_exception(struct pt_regs *regs)
843 843
844void alignment_exception(struct pt_regs *regs) 844void alignment_exception(struct pt_regs *regs)
845{ 845{
846 int fixed = 0; 846 int sig, code, fixed = 0;
847 847
848 /* we don't implement logging of alignment exceptions */ 848 /* we don't implement logging of alignment exceptions */
849 if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS)) 849 if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS))
@@ -857,14 +857,16 @@ void alignment_exception(struct pt_regs *regs)
857 857
858 /* Operand address was bad */ 858 /* Operand address was bad */
859 if (fixed == -EFAULT) { 859 if (fixed == -EFAULT) {
860 if (user_mode(regs)) 860 sig = SIGSEGV;
861 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar); 861 code = SEGV_ACCERR;
862 else 862 } else {
863 /* Search exception table */ 863 sig = SIGBUS;
864 bad_page_fault(regs, regs->dar, SIGSEGV); 864 code = BUS_ADRALN;
865 return;
866 } 865 }
867 _exception(SIGBUS, regs, BUS_ADRALN, regs->dar); 866 if (user_mode(regs))
867 _exception(sig, regs, code, regs->dar);
868 else
869 bad_page_fault(regs, regs->dar, sig);
868} 870}
869 871
870void StackOverflow(struct pt_regs *regs) 872void StackOverflow(struct pt_regs *regs)
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index 1a7e19cdab3..c913ad5cad2 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -36,6 +36,8 @@
36#include <asm/vdso.h> 36#include <asm/vdso.h>
37#include <asm/vdso_datapage.h> 37#include <asm/vdso_datapage.h>
38 38
39#include "setup.h"
40
39#undef DEBUG 41#undef DEBUG
40 42
41#ifdef DEBUG 43#ifdef DEBUG
@@ -586,6 +588,43 @@ static __init int vdso_fixup_datapage(struct lib32_elfinfo *v32,
586 return 0; 588 return 0;
587} 589}
588 590
591
592static __init int vdso_fixup_features(struct lib32_elfinfo *v32,
593 struct lib64_elfinfo *v64)
594{
595 void *start32;
596 unsigned long size32;
597
598#ifdef CONFIG_PPC64
599 void *start64;
600 unsigned long size64;
601
602 start64 = find_section64(v64->hdr, "__ftr_fixup", &size64);
603 if (start64)
604 do_feature_fixups(cur_cpu_spec->cpu_features,
605 start64, start64 + size64);
606
607 start64 = find_section64(v64->hdr, "__fw_ftr_fixup", &size64);
608 if (start64)
609 do_feature_fixups(powerpc_firmware_features,
610 start64, start64 + size64);
611#endif /* CONFIG_PPC64 */
612
613 start32 = find_section32(v32->hdr, "__ftr_fixup", &size32);
614 if (start32)
615 do_feature_fixups(cur_cpu_spec->cpu_features,
616 start32, start32 + size32);
617
618#ifdef CONFIG_PPC64
619 start32 = find_section32(v32->hdr, "__fw_ftr_fixup", &size32);
620 if (start32)
621 do_feature_fixups(powerpc_firmware_features,
622 start32, start32 + size32);
623#endif /* CONFIG_PPC64 */
624
625 return 0;
626}
627
589static __init int vdso_fixup_alt_funcs(struct lib32_elfinfo *v32, 628static __init int vdso_fixup_alt_funcs(struct lib32_elfinfo *v32,
590 struct lib64_elfinfo *v64) 629 struct lib64_elfinfo *v64)
591{ 630{
@@ -634,6 +673,9 @@ static __init int vdso_setup(void)
634 if (vdso_fixup_datapage(&v32, &v64)) 673 if (vdso_fixup_datapage(&v32, &v64))
635 return -1; 674 return -1;
636 675
676 if (vdso_fixup_features(&v32, &v64))
677 return -1;
678
637 if (vdso_fixup_alt_funcs(&v32, &v64)) 679 if (vdso_fixup_alt_funcs(&v32, &v64))
638 return -1; 680 return -1;
639 681
@@ -714,6 +756,7 @@ void __init vdso_init(void)
714 * Setup the syscall map in the vDOS 756 * Setup the syscall map in the vDOS
715 */ 757 */
716 vdso_setup_syscall_map(); 758 vdso_setup_syscall_map();
759
717 /* 760 /*
718 * Initialize the vDSO images in memory, that is do necessary 761 * Initialize the vDSO images in memory, that is do necessary
719 * fixups of vDSO symbols, locate trampolines, etc... 762 * fixups of vDSO symbols, locate trampolines, etc...
diff --git a/arch/powerpc/kernel/vdso32/vdso32.lds.S b/arch/powerpc/kernel/vdso32/vdso32.lds.S
index 6187af2d54c..26e138c4ce1 100644
--- a/arch/powerpc/kernel/vdso32/vdso32.lds.S
+++ b/arch/powerpc/kernel/vdso32/vdso32.lds.S
@@ -32,6 +32,18 @@ SECTIONS
32 PROVIDE (_etext = .); 32 PROVIDE (_etext = .);
33 PROVIDE (etext = .); 33 PROVIDE (etext = .);
34 34
35 . = ALIGN(8);
36 __ftr_fixup : {
37 *(__ftr_fixup)
38 }
39
40#ifdef CONFIG_PPC64
41 . = ALIGN(8);
42 __fw_ftr_fixup : {
43 *(__fw_ftr_fixup)
44 }
45#endif
46
35 /* Other stuff is appended to the text segment: */ 47 /* Other stuff is appended to the text segment: */
36 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 48 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
37 .rodata1 : { *(.rodata1) } 49 .rodata1 : { *(.rodata1) }
diff --git a/arch/powerpc/kernel/vdso64/gettimeofday.S b/arch/powerpc/kernel/vdso64/gettimeofday.S
index 56e76ff5498..40ffd9b6cef 100644
--- a/arch/powerpc/kernel/vdso64/gettimeofday.S
+++ b/arch/powerpc/kernel/vdso64/gettimeofday.S
@@ -229,8 +229,10 @@ V_FUNCTION_BEGIN(__do_get_xsec)
229 xor r0,r8,r8 /* create dependency */ 229 xor r0,r8,r8 /* create dependency */
230 add r3,r3,r0 230 add r3,r3,r0
231 231
232 /* Get TB & offset it */ 232 /* Get TB & offset it. We use the MFTB macro which will generate
233 mftb r7 233 * workaround code for Cell.
234 */
235 MFTB(r7)
234 ld r9,CFG_TB_ORIG_STAMP(r3) 236 ld r9,CFG_TB_ORIG_STAMP(r3)
235 subf r7,r9,r7 237 subf r7,r9,r7
236 238
diff --git a/arch/powerpc/kernel/vdso64/vdso64.lds.S b/arch/powerpc/kernel/vdso64/vdso64.lds.S
index 4a2b6dc0960..2d70f35d50b 100644
--- a/arch/powerpc/kernel/vdso64/vdso64.lds.S
+++ b/arch/powerpc/kernel/vdso64/vdso64.lds.S
@@ -31,6 +31,16 @@ SECTIONS
31 PROVIDE (_etext = .); 31 PROVIDE (_etext = .);
32 PROVIDE (etext = .); 32 PROVIDE (etext = .);
33 33
34 . = ALIGN(8);
35 __ftr_fixup : {
36 *(__ftr_fixup)
37 }
38
39 . = ALIGN(8);
40 __fw_ftr_fixup : {
41 *(__fw_ftr_fixup)
42 }
43
34 /* Other stuff is appended to the text segment: */ 44 /* Other stuff is appended to the text segment: */
35 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 45 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
36 .rodata1 : { *(.rodata1) } 46 .rodata1 : { *(.rodata1) }
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index cb87e71eec6..ed007878d1b 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -92,9 +92,9 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
92 &tbl->it_index, &offset, &size); 92 &tbl->it_index, &offset, &size);
93 93
94 /* TCE table size - measured in tce entries */ 94 /* TCE table size - measured in tce entries */
95 tbl->it_size = size >> PAGE_SHIFT; 95 tbl->it_size = size >> IOMMU_PAGE_SHIFT;
96 /* offset for VIO should always be 0 */ 96 /* offset for VIO should always be 0 */
97 tbl->it_offset = offset >> PAGE_SHIFT; 97 tbl->it_offset = offset >> IOMMU_PAGE_SHIFT;
98 tbl->it_busno = 0; 98 tbl->it_busno = 0;
99 tbl->it_type = TCE_VB; 99 tbl->it_type = TCE_VB;
100 100
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index cb0e8d46c3e..e8342d86753 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -108,13 +108,7 @@ SECTIONS
108 108
109 .initcall.init : { 109 .initcall.init : {
110 __initcall_start = .; 110 __initcall_start = .;
111 *(.initcall1.init) 111 INITCALLS
112 *(.initcall2.init)
113 *(.initcall3.init)
114 *(.initcall4.init)
115 *(.initcall5.init)
116 *(.initcall6.init)
117 *(.initcall7.init)
118 __initcall_end = .; 112 __initcall_end = .;
119 } 113 }
120 114
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 9590ba780b9..7e8ded051b5 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -9,6 +9,7 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/kprobes.h>
12#include <linux/ptrace.h> 13#include <linux/ptrace.h>
13#include <asm/sstep.h> 14#include <asm/sstep.h>
14#include <asm/processor.h> 15#include <asm/processor.h>
@@ -25,7 +26,7 @@ extern char system_call_common[];
25/* 26/*
26 * Determine whether a conditional branch instruction would branch. 27 * Determine whether a conditional branch instruction would branch.
27 */ 28 */
28static int branch_taken(unsigned int instr, struct pt_regs *regs) 29static int __kprobes branch_taken(unsigned int instr, struct pt_regs *regs)
29{ 30{
30 unsigned int bo = (instr >> 21) & 0x1f; 31 unsigned int bo = (instr >> 21) & 0x1f;
31 unsigned int bi; 32 unsigned int bi;
@@ -51,7 +52,7 @@ static int branch_taken(unsigned int instr, struct pt_regs *regs)
51 * or -1 if the instruction is one that should not be stepped, 52 * or -1 if the instruction is one that should not be stepped,
52 * such as an rfid, or a mtmsrd that would clear MSR_RI. 53 * such as an rfid, or a mtmsrd that would clear MSR_RI.
53 */ 54 */
54int emulate_step(struct pt_regs *regs, unsigned int instr) 55int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
55{ 56{
56 unsigned int opcode, rd; 57 unsigned int opcode, rd;
57 unsigned long int imm; 58 unsigned long int imm;
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 5615acc2952..506d89768d4 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -480,9 +480,6 @@ static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas)
480 480
481 mm->context.high_htlb_areas |= newareas; 481 mm->context.high_htlb_areas |= newareas;
482 482
483 /* update the paca copy of the context struct */
484 get_paca()->context = mm->context;
485
486 /* the context change must make it to memory before the flush, 483 /* the context change must make it to memory before the flush,
487 * so that further SLB misses do the right thing. */ 484 * so that further SLB misses do the right thing. */
488 mb(); 485 mb();
@@ -494,11 +491,15 @@ static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas)
494 return 0; 491 return 0;
495} 492}
496 493
497int prepare_hugepage_range(unsigned long addr, unsigned long len) 494int prepare_hugepage_range(unsigned long addr, unsigned long len, pgoff_t pgoff)
498{ 495{
499 int err = 0; 496 int err = 0;
500 497
501 if ( (addr+len) < addr ) 498 if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT))
499 return -EINVAL;
500 if (len & ~HPAGE_MASK)
501 return -EINVAL;
502 if (addr & ~HPAGE_MASK)
502 return -EINVAL; 503 return -EINVAL;
503 504
504 if (addr < 0x100000000UL) 505 if (addr < 0x100000000UL)
diff --git a/arch/powerpc/oprofile/Makefile b/arch/powerpc/oprofile/Makefile
index 3145d610b5b..0b5df9c96ae 100644
--- a/arch/powerpc/oprofile/Makefile
+++ b/arch/powerpc/oprofile/Makefile
@@ -13,4 +13,4 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
13oprofile-y := $(DRIVER_OBJS) common.o backtrace.o 13oprofile-y := $(DRIVER_OBJS) common.o backtrace.o
14oprofile-$(CONFIG_PPC64) += op_model_rs64.o op_model_power4.o 14oprofile-$(CONFIG_PPC64) += op_model_rs64.o op_model_power4.o
15oprofile-$(CONFIG_FSL_BOOKE) += op_model_fsl_booke.o 15oprofile-$(CONFIG_FSL_BOOKE) += op_model_fsl_booke.o
16oprofile-$(CONFIG_PPC32) += op_model_7450.o 16oprofile-$(CONFIG_6xx) += op_model_7450.o
diff --git a/arch/powerpc/oprofile/common.c b/arch/powerpc/oprofile/common.c
index fd0bbbe7a4d..63bbef3b63f 100644
--- a/arch/powerpc/oprofile/common.c
+++ b/arch/powerpc/oprofile/common.c
@@ -34,6 +34,11 @@ static void op_handle_interrupt(struct pt_regs *regs)
34 model->handle_interrupt(regs, ctr); 34 model->handle_interrupt(regs, ctr);
35} 35}
36 36
37static void op_powerpc_cpu_setup(void *dummy)
38{
39 model->cpu_setup(ctr);
40}
41
37static int op_powerpc_setup(void) 42static int op_powerpc_setup(void)
38{ 43{
39 int err; 44 int err;
@@ -47,7 +52,7 @@ static int op_powerpc_setup(void)
47 model->reg_setup(ctr, &sys, model->num_counters); 52 model->reg_setup(ctr, &sys, model->num_counters);
48 53
49 /* Configure the registers on all cpus. */ 54 /* Configure the registers on all cpus. */
50 on_each_cpu(model->cpu_setup, NULL, 0, 1); 55 on_each_cpu(op_powerpc_cpu_setup, NULL, 0, 1);
51 56
52 return 0; 57 return 0;
53} 58}
@@ -142,7 +147,8 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
142 case PPC_OPROFILE_POWER4: 147 case PPC_OPROFILE_POWER4:
143 model = &op_model_power4; 148 model = &op_model_power4;
144 break; 149 break;
145#else 150#endif
151#ifdef CONFIG_6xx
146 case PPC_OPROFILE_G4: 152 case PPC_OPROFILE_G4:
147 model = &op_model_7450; 153 model = &op_model_7450;
148 break; 154 break;
diff --git a/arch/powerpc/oprofile/op_model_7450.c b/arch/powerpc/oprofile/op_model_7450.c
index d8ee3aea83f..f481c0ed5e6 100644
--- a/arch/powerpc/oprofile/op_model_7450.c
+++ b/arch/powerpc/oprofile/op_model_7450.c
@@ -81,7 +81,7 @@ static void pmc_stop_ctrs(void)
81 81
82/* Configures the counters on this CPU based on the global 82/* Configures the counters on this CPU based on the global
83 * settings */ 83 * settings */
84static void fsl7450_cpu_setup(void *unused) 84static void fsl7450_cpu_setup(struct op_counter_config *ctr)
85{ 85{
86 /* freeze all counters */ 86 /* freeze all counters */
87 pmc_stop_ctrs(); 87 pmc_stop_ctrs();
diff --git a/arch/powerpc/oprofile/op_model_fsl_booke.c b/arch/powerpc/oprofile/op_model_fsl_booke.c
index e29dede3142..0b3c31f5209 100644
--- a/arch/powerpc/oprofile/op_model_fsl_booke.c
+++ b/arch/powerpc/oprofile/op_model_fsl_booke.c
@@ -32,42 +32,152 @@ static unsigned long reset_value[OP_MAX_COUNTER];
32static int num_counters; 32static int num_counters;
33static int oprofile_running; 33static int oprofile_running;
34 34
35static inline unsigned int ctr_read(unsigned int i) 35static void init_pmc_stop(int ctr)
36{ 36{
37 switch(i) { 37 u32 pmlca = (PMLCA_FC | PMLCA_FCS | PMLCA_FCU |
38 case 0: 38 PMLCA_FCM1 | PMLCA_FCM0);
39 return mfpmr(PMRN_PMC0); 39 u32 pmlcb = 0;
40 case 1:
41 return mfpmr(PMRN_PMC1);
42 case 2:
43 return mfpmr(PMRN_PMC2);
44 case 3:
45 return mfpmr(PMRN_PMC3);
46 default:
47 return 0;
48 }
49}
50 40
51static inline void ctr_write(unsigned int i, unsigned int val) 41 switch (ctr) {
52{
53 switch(i) {
54 case 0: 42 case 0:
55 mtpmr(PMRN_PMC0, val); 43 mtpmr(PMRN_PMLCA0, pmlca);
44 mtpmr(PMRN_PMLCB0, pmlcb);
56 break; 45 break;
57 case 1: 46 case 1:
58 mtpmr(PMRN_PMC1, val); 47 mtpmr(PMRN_PMLCA1, pmlca);
48 mtpmr(PMRN_PMLCB1, pmlcb);
59 break; 49 break;
60 case 2: 50 case 2:
61 mtpmr(PMRN_PMC2, val); 51 mtpmr(PMRN_PMLCA2, pmlca);
52 mtpmr(PMRN_PMLCB2, pmlcb);
62 break; 53 break;
63 case 3: 54 case 3:
64 mtpmr(PMRN_PMC3, val); 55 mtpmr(PMRN_PMLCA3, pmlca);
56 mtpmr(PMRN_PMLCB3, pmlcb);
65 break; 57 break;
66 default: 58 default:
67 break; 59 panic("Bad ctr number!\n");
68 } 60 }
69} 61}
70 62
63static void set_pmc_event(int ctr, int event)
64{
65 u32 pmlca;
66
67 pmlca = get_pmlca(ctr);
68
69 pmlca = (pmlca & ~PMLCA_EVENT_MASK) |
70 ((event << PMLCA_EVENT_SHIFT) &
71 PMLCA_EVENT_MASK);
72
73 set_pmlca(ctr, pmlca);
74}
75
76static void set_pmc_user_kernel(int ctr, int user, int kernel)
77{
78 u32 pmlca;
79
80 pmlca = get_pmlca(ctr);
81
82 if(user)
83 pmlca &= ~PMLCA_FCU;
84 else
85 pmlca |= PMLCA_FCU;
86
87 if(kernel)
88 pmlca &= ~PMLCA_FCS;
89 else
90 pmlca |= PMLCA_FCS;
91
92 set_pmlca(ctr, pmlca);
93}
94
95static void set_pmc_marked(int ctr, int mark0, int mark1)
96{
97 u32 pmlca = get_pmlca(ctr);
98
99 if(mark0)
100 pmlca &= ~PMLCA_FCM0;
101 else
102 pmlca |= PMLCA_FCM0;
103
104 if(mark1)
105 pmlca &= ~PMLCA_FCM1;
106 else
107 pmlca |= PMLCA_FCM1;
108
109 set_pmlca(ctr, pmlca);
110}
111
112static void pmc_start_ctr(int ctr, int enable)
113{
114 u32 pmlca = get_pmlca(ctr);
115
116 pmlca &= ~PMLCA_FC;
117
118 if (enable)
119 pmlca |= PMLCA_CE;
120 else
121 pmlca &= ~PMLCA_CE;
122
123 set_pmlca(ctr, pmlca);
124}
125
126static void pmc_start_ctrs(int enable)
127{
128 u32 pmgc0 = mfpmr(PMRN_PMGC0);
129
130 pmgc0 &= ~PMGC0_FAC;
131 pmgc0 |= PMGC0_FCECE;
132
133 if (enable)
134 pmgc0 |= PMGC0_PMIE;
135 else
136 pmgc0 &= ~PMGC0_PMIE;
137
138 mtpmr(PMRN_PMGC0, pmgc0);
139}
140
141static void pmc_stop_ctrs(void)
142{
143 u32 pmgc0 = mfpmr(PMRN_PMGC0);
144
145 pmgc0 |= PMGC0_FAC;
146
147 pmgc0 &= ~(PMGC0_PMIE | PMGC0_FCECE);
148
149 mtpmr(PMRN_PMGC0, pmgc0);
150}
151
152static void dump_pmcs(void)
153{
154 printk("pmgc0: %x\n", mfpmr(PMRN_PMGC0));
155 printk("pmc\t\tpmlca\t\tpmlcb\n");
156 printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC0),
157 mfpmr(PMRN_PMLCA0), mfpmr(PMRN_PMLCB0));
158 printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC1),
159 mfpmr(PMRN_PMLCA1), mfpmr(PMRN_PMLCB1));
160 printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC2),
161 mfpmr(PMRN_PMLCA2), mfpmr(PMRN_PMLCB2));
162 printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC3),
163 mfpmr(PMRN_PMLCA3), mfpmr(PMRN_PMLCB3));
164}
165
166static void fsl_booke_cpu_setup(struct op_counter_config *ctr)
167{
168 int i;
169
170 /* freeze all counters */
171 pmc_stop_ctrs();
172
173 for (i = 0;i < num_counters;i++) {
174 init_pmc_stop(i);
175
176 set_pmc_event(i, ctr[i].event);
177
178 set_pmc_user_kernel(i, ctr[i].user, ctr[i].kernel);
179 }
180}
71 181
72static void fsl_booke_reg_setup(struct op_counter_config *ctr, 182static void fsl_booke_reg_setup(struct op_counter_config *ctr,
73 struct op_system_config *sys, 183 struct op_system_config *sys,
@@ -77,23 +187,14 @@ static void fsl_booke_reg_setup(struct op_counter_config *ctr,
77 187
78 num_counters = num_ctrs; 188 num_counters = num_ctrs;
79 189
80 /* freeze all counters */
81 pmc_stop_ctrs();
82
83 /* Our counters count up, and "count" refers to 190 /* Our counters count up, and "count" refers to
84 * how much before the next interrupt, and we interrupt 191 * how much before the next interrupt, and we interrupt
85 * on overflow. So we calculate the starting value 192 * on overflow. So we calculate the starting value
86 * which will give us "count" until overflow. 193 * which will give us "count" until overflow.
87 * Then we set the events on the enabled counters */ 194 * Then we set the events on the enabled counters */
88 for (i = 0; i < num_counters; ++i) { 195 for (i = 0; i < num_counters; ++i)
89 reset_value[i] = 0x80000000UL - ctr[i].count; 196 reset_value[i] = 0x80000000UL - ctr[i].count;
90 197
91 init_pmc_stop(i);
92
93 set_pmc_event(i, ctr[i].event);
94
95 set_pmc_user_kernel(i, ctr[i].user, ctr[i].kernel);
96 }
97} 198}
98 199
99static void fsl_booke_start(struct op_counter_config *ctr) 200static void fsl_booke_start(struct op_counter_config *ctr)
@@ -105,8 +206,8 @@ static void fsl_booke_start(struct op_counter_config *ctr)
105 for (i = 0; i < num_counters; ++i) { 206 for (i = 0; i < num_counters; ++i) {
106 if (ctr[i].enabled) { 207 if (ctr[i].enabled) {
107 ctr_write(i, reset_value[i]); 208 ctr_write(i, reset_value[i]);
108 /* Set Each enabled counterd to only 209 /* Set each enabled counter to only
109 * count when the Mark bit is not set */ 210 * count when the Mark bit is *not* set */
110 set_pmc_marked(i, 1, 0); 211 set_pmc_marked(i, 1, 0);
111 pmc_start_ctr(i, 1); 212 pmc_start_ctr(i, 1);
112 } else { 213 } else {
@@ -177,6 +278,7 @@ static void fsl_booke_handle_interrupt(struct pt_regs *regs,
177 278
178struct op_powerpc_model op_model_fsl_booke = { 279struct op_powerpc_model op_model_fsl_booke = {
179 .reg_setup = fsl_booke_reg_setup, 280 .reg_setup = fsl_booke_reg_setup,
281 .cpu_setup = fsl_booke_cpu_setup,
180 .start = fsl_booke_start, 282 .start = fsl_booke_start,
181 .stop = fsl_booke_stop, 283 .stop = fsl_booke_stop,
182 .handle_interrupt = fsl_booke_handle_interrupt, 284 .handle_interrupt = fsl_booke_handle_interrupt,
diff --git a/arch/powerpc/oprofile/op_model_power4.c b/arch/powerpc/oprofile/op_model_power4.c
index 506f6b79f89..356709d515b 100644
--- a/arch/powerpc/oprofile/op_model_power4.c
+++ b/arch/powerpc/oprofile/op_model_power4.c
@@ -76,13 +76,13 @@ static inline int mmcra_must_set_sample(void)
76{ 76{
77 if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p) || 77 if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p) ||
78 __is_processor(PV_970) || __is_processor(PV_970FX) || 78 __is_processor(PV_970) || __is_processor(PV_970FX) ||
79 __is_processor(PV_970MP)) 79 __is_processor(PV_970MP) || __is_processor(PV_970GX))
80 return 1; 80 return 1;
81 81
82 return 0; 82 return 0;
83} 83}
84 84
85static void power4_cpu_setup(void *unused) 85static void power4_cpu_setup(struct op_counter_config *ctr)
86{ 86{
87 unsigned int mmcr0 = mmcr0_val; 87 unsigned int mmcr0 = mmcr0_val;
88 unsigned long mmcra = mmcra_val; 88 unsigned long mmcra = mmcra_val;
diff --git a/arch/powerpc/oprofile/op_model_rs64.c b/arch/powerpc/oprofile/op_model_rs64.c
index 042f8f4867a..19c5ee089bc 100644
--- a/arch/powerpc/oprofile/op_model_rs64.c
+++ b/arch/powerpc/oprofile/op_model_rs64.c
@@ -102,7 +102,7 @@ static void rs64_reg_setup(struct op_counter_config *ctr,
102 /* XXX setup user and kernel profiling */ 102 /* XXX setup user and kernel profiling */
103} 103}
104 104
105static void rs64_cpu_setup(void *unused) 105static void rs64_cpu_setup(struct op_counter_config *ctr)
106{ 106{
107 unsigned int mmcr0; 107 unsigned int mmcr0;
108 108
diff --git a/arch/powerpc/platforms/83xx/Kconfig b/arch/powerpc/platforms/83xx/Kconfig
index 7edb6b46138..edcd5b875b6 100644
--- a/arch/powerpc/platforms/83xx/Kconfig
+++ b/arch/powerpc/platforms/83xx/Kconfig
@@ -21,7 +21,7 @@ config MPC834x_SYS
21 Be aware that PCI buses can only function when SYS board is plugged 21 Be aware that PCI buses can only function when SYS board is plugged
22 into the PIB (Platform IO Board) board from Freescale which provide 22 into the PIB (Platform IO Board) board from Freescale which provide
23 3 PCI slots. The PIBs PCI initialization is the bootloader's 23 3 PCI slots. The PIBs PCI initialization is the bootloader's
24 responsiblilty. 24 responsibility.
25 25
26config MPC834x_ITX 26config MPC834x_ITX
27 bool "Freescale MPC834x ITX" 27 bool "Freescale MPC834x ITX"
@@ -30,7 +30,7 @@ config MPC834x_ITX
30 This option enables support for the MPC 834x ITX evaluation board. 30 This option enables support for the MPC 834x ITX evaluation board.
31 31
32 Be aware that PCI initialization is the bootloader's 32 Be aware that PCI initialization is the bootloader's
33 responsiblilty. 33 responsibility.
34 34
35config MPC8360E_PB 35config MPC8360E_PB
36 bool "Freescale MPC8360E PB" 36 bool "Freescale MPC8360E PB"
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 54dea9d42dc..a43ac71ab74 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -24,6 +24,7 @@
24#include <linux/root_dev.h> 24#include <linux/root_dev.h>
25#include <linux/initrd.h> 25#include <linux/initrd.h>
26 26
27#include <asm/of_device.h>
27#include <asm/system.h> 28#include <asm/system.h>
28#include <asm/atomic.h> 29#include <asm/atomic.h>
29#include <asm/time.h> 30#include <asm/time.h>
@@ -136,6 +137,24 @@ static void __init mpc832x_sys_setup_arch(void)
136#endif 137#endif
137} 138}
138 139
140static int __init mpc832x_declare_of_platform_devices(void)
141{
142 struct device_node *np;
143
144 for (np = NULL; (np = of_find_compatible_node(np, "network",
145 "ucc_geth")) != NULL;) {
146 int ucc_num;
147 char bus_id[BUS_ID_SIZE];
148
149 ucc_num = *((uint *) get_property(np, "device-id", NULL)) - 1;
150 snprintf(bus_id, BUS_ID_SIZE, "ucc_geth.%u", ucc_num);
151 of_platform_device_create(np, bus_id, NULL);
152 }
153
154 return 0;
155}
156device_initcall(mpc832x_declare_of_platform_devices);
157
139void __init mpc832x_sys_init_IRQ(void) 158void __init mpc832x_sys_init_IRQ(void)
140{ 159{
141 160
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 5446bab08ec..e2bcaaf6b32 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -108,10 +108,6 @@ static int __init mpc834x_itx_probe(void)
108 return 1; 108 return 1;
109} 109}
110 110
111#ifdef CONFIG_RTC_CLASS
112late_initcall(rtc_class_hookup);
113#endif
114
115define_machine(mpc834x_itx) { 111define_machine(mpc834x_itx) {
116 .name = "MPC834x ITX", 112 .name = "MPC834x ITX",
117 .probe = mpc834x_itx_probe, 113 .probe = mpc834x_itx_probe,
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 032bc923342..d5aeb3c6dd4 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -668,14 +668,19 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
668 668
669 for (i=0; i < 3; i++) { 669 for (i=0; i < 3; i++) {
670 ret = of_irq_map_one(np, i, &oirq); 670 ret = of_irq_map_one(np, i, &oirq);
671 if (ret) 671 if (ret) {
672 pr_debug("spu_new: failed to get irq %d\n", i);
672 goto err; 673 goto err;
673 674 }
674 ret = -EINVAL; 675 ret = -EINVAL;
676 pr_debug(" irq %d no 0x%x on %s\n", i, oirq.specifier[0],
677 oirq.controller->full_name);
675 spu->irqs[i] = irq_create_of_mapping(oirq.controller, 678 spu->irqs[i] = irq_create_of_mapping(oirq.controller,
676 oirq.specifier, oirq.size); 679 oirq.specifier, oirq.size);
677 if (spu->irqs[i] == NO_IRQ) 680 if (spu->irqs[i] == NO_IRQ) {
681 pr_debug("spu_new: failed to map it !\n");
678 goto err; 682 goto err;
683 }
679 } 684 }
680 return 0; 685 return 0;
681 686
@@ -694,7 +699,7 @@ static int spu_map_resource(struct device_node *node, int nr,
694 struct resource resource = { }; 699 struct resource resource = { };
695 int ret; 700 int ret;
696 701
697 ret = of_address_to_resource(node, 0, &resource); 702 ret = of_address_to_resource(node, nr, &resource);
698 if (ret) 703 if (ret)
699 goto out; 704 goto out;
700 705
@@ -717,22 +722,42 @@ static int __init spu_map_device(struct spu *spu, struct device_node *node)
717 722
718 ret = spu_map_resource(node, 0, (void __iomem**)&spu->local_store, 723 ret = spu_map_resource(node, 0, (void __iomem**)&spu->local_store,
719 &spu->local_store_phys); 724 &spu->local_store_phys);
720 if (ret) 725 if (ret) {
726 pr_debug("spu_new: failed to map %s resource 0\n",
727 node->full_name);
721 goto out; 728 goto out;
729 }
722 ret = spu_map_resource(node, 1, (void __iomem**)&spu->problem, 730 ret = spu_map_resource(node, 1, (void __iomem**)&spu->problem,
723 &spu->problem_phys); 731 &spu->problem_phys);
724 if (ret) 732 if (ret) {
733 pr_debug("spu_new: failed to map %s resource 1\n",
734 node->full_name);
725 goto out_unmap; 735 goto out_unmap;
736 }
726 ret = spu_map_resource(node, 2, (void __iomem**)&spu->priv2, 737 ret = spu_map_resource(node, 2, (void __iomem**)&spu->priv2,
727 NULL); 738 NULL);
728 if (ret) 739 if (ret) {
740 pr_debug("spu_new: failed to map %s resource 2\n",
741 node->full_name);
729 goto out_unmap; 742 goto out_unmap;
743 }
730 744
731 if (!firmware_has_feature(FW_FEATURE_LPAR)) 745 if (!firmware_has_feature(FW_FEATURE_LPAR))
732 ret = spu_map_resource(node, 3, (void __iomem**)&spu->priv1, 746 ret = spu_map_resource(node, 3, (void __iomem**)&spu->priv1,
733 NULL); 747 NULL);
734 if (ret) 748 if (ret) {
749 pr_debug("spu_new: failed to map %s resource 3\n",
750 node->full_name);
735 goto out_unmap; 751 goto out_unmap;
752 }
753 pr_debug("spu_new: %s maps:\n", node->full_name);
754 pr_debug(" local store : 0x%016lx -> 0x%p\n",
755 spu->local_store_phys, spu->local_store);
756 pr_debug(" problem state : 0x%016lx -> 0x%p\n",
757 spu->problem_phys, spu->problem);
758 pr_debug(" priv2 : 0x%p\n", spu->priv2);
759 pr_debug(" priv1 : 0x%p\n", spu->priv1);
760
736 return 0; 761 return 0;
737 762
738out_unmap: 763out_unmap:
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 5b8ba6c3aa3..0ea2361865a 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -385,7 +385,7 @@ static ssize_t spufs_mbox_read(struct file *file, char __user *buf,
385 udata = (void __user *)buf; 385 udata = (void __user *)buf;
386 386
387 spu_acquire(ctx); 387 spu_acquire(ctx);
388 for (count = 0; count <= len; count += 4, udata++) { 388 for (count = 0; (count + 4) <= len; count += 4, udata++) {
389 int ret; 389 int ret;
390 ret = ctx->ops->mbox_read(ctx, &mbox_data); 390 ret = ctx->ops->mbox_read(ctx, &mbox_data);
391 if (ret == 0) 391 if (ret == 0)
diff --git a/arch/powerpc/platforms/cell/spufs/hw_ops.c b/arch/powerpc/platforms/cell/spufs/hw_ops.c
index 2ad534a04be..59c87f12da5 100644
--- a/arch/powerpc/platforms/cell/spufs/hw_ops.c
+++ b/arch/powerpc/platforms/cell/spufs/hw_ops.c
@@ -147,7 +147,7 @@ static void spu_hw_signal1_write(struct spu_context *ctx, u32 data)
147 147
148static u32 spu_hw_signal2_read(struct spu_context *ctx) 148static u32 spu_hw_signal2_read(struct spu_context *ctx)
149{ 149{
150 return in_be32(&ctx->spu->problem->signal_notify1); 150 return in_be32(&ctx->spu->problem->signal_notify2);
151} 151}
152 152
153static void spu_hw_signal2_write(struct spu_context *ctx, u32 data) 153static void spu_hw_signal2_write(struct spu_context *ctx, u32 data)
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index cae3d13229b..49b8dabcbc9 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -477,8 +477,10 @@ static void __init chrp_find_8259(void)
477 " address, polling\n"); 477 " address, polling\n");
478 478
479 i8259_init(pic, chrp_int_ack); 479 i8259_init(pic, chrp_int_ack);
480 if (ppc_md.get_irq == NULL) 480 if (ppc_md.get_irq == NULL) {
481 ppc_md.get_irq = i8259_irq; 481 ppc_md.get_irq = i8259_irq;
482 irq_set_default_host(i8259_get_host());
483 }
482 if (chrp_mpic != NULL) { 484 if (chrp_mpic != NULL) {
483 cascade_irq = irq_of_parse_and_map(pic, 0); 485 cascade_irq = irq_of_parse_and_map(pic, 0);
484 if (cascade_irq == NO_IRQ) 486 if (cascade_irq == NO_IRQ)
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index f4cbbcf8773..218817d13c5 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -43,9 +43,6 @@ static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
43 u64 rc; 43 u64 rc;
44 u64 tce, rpn; 44 u64 tce, rpn;
45 45
46 index <<= TCE_PAGE_FACTOR;
47 npages <<= TCE_PAGE_FACTOR;
48
49 while (npages--) { 46 while (npages--) {
50 rpn = virt_to_abs(uaddr) >> TCE_SHIFT; 47 rpn = virt_to_abs(uaddr) >> TCE_SHIFT;
51 tce = (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT; 48 tce = (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT;
@@ -75,9 +72,6 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages)
75{ 72{
76 u64 rc; 73 u64 rc;
77 74
78 npages <<= TCE_PAGE_FACTOR;
79 index <<= TCE_PAGE_FACTOR;
80
81 while (npages--) { 75 while (npages--) {
82 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0); 76 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0);
83 if (rc) 77 if (rc)
@@ -136,10 +130,9 @@ void iommu_table_getparms_iSeries(unsigned long busno,
136 panic("PCI_DMA: parms->size is zero, parms is 0x%p", parms); 130 panic("PCI_DMA: parms->size is zero, parms is 0x%p", parms);
137 131
138 /* itc_size is in pages worth of table, it_size is in # of entries */ 132 /* itc_size is in pages worth of table, it_size is in # of entries */
139 tbl->it_size = ((parms->itc_size * TCE_PAGE_SIZE) / 133 tbl->it_size = (parms->itc_size * TCE_PAGE_SIZE) / TCE_ENTRY_SIZE;
140 TCE_ENTRY_SIZE) >> TCE_PAGE_FACTOR;
141 tbl->it_busno = parms->itc_busno; 134 tbl->it_busno = parms->itc_busno;
142 tbl->it_offset = parms->itc_offset >> TCE_PAGE_FACTOR; 135 tbl->it_offset = parms->itc_offset;
143 tbl->it_index = parms->itc_index; 136 tbl->it_index = parms->itc_index;
144 tbl->it_blocksize = 1; 137 tbl->it_blocksize = 1;
145 tbl->it_type = virtbus ? TCE_VB : TCE_PCI; 138 tbl->it_type = virtbus ? TCE_VB : TCE_PCI;
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 08d14734617..cd8965ec9dd 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -662,6 +662,11 @@ void * __init iSeries_early_setup(void)
662{ 662{
663 unsigned long phys_mem_size; 663 unsigned long phys_mem_size;
664 664
665 /* Identify CPU type. This is done again by the common code later
666 * on but calling this function multiple times is fine.
667 */
668 identify_cpu(0);
669
665 powerpc_firmware_features |= FW_FEATURE_ISERIES; 670 powerpc_firmware_features |= FW_FEATURE_ISERIES;
666 powerpc_firmware_features |= FW_FEATURE_LPAR; 671 powerpc_firmware_features |= FW_FEATURE_LPAR;
667 672
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 9923adc5248..257dc906846 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -48,7 +48,6 @@ static struct pci_controller *u3_ht;
48static int has_second_ohare; 48static int has_second_ohare;
49#endif /* CONFIG_PPC64 */ 49#endif /* CONFIG_PPC64 */
50 50
51extern u8 pci_cache_line_size;
52extern int pcibios_assign_bus_offset; 51extern int pcibios_assign_bus_offset;
53 52
54struct device_node *k2_skiplist[2]; 53struct device_node *k2_skiplist[2];
diff --git a/arch/powerpc/platforms/powermac/sleep.S b/arch/powerpc/platforms/powermac/sleep.S
index 1174ca128ef..adee28da353 100644
--- a/arch/powerpc/platforms/powermac/sleep.S
+++ b/arch/powerpc/platforms/powermac/sleep.S
@@ -45,7 +45,8 @@
45 .section .text 45 .section .text
46 .align 5 46 .align 5
47 47
48#if defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ_PMAC) 48#if defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ_PMAC) || \
49 (defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32))
49 50
50/* This gets called by via-pmu.c late during the sleep process. 51/* This gets called by via-pmu.c late during the sleep process.
51 * The PMU was already send the sleep command and will shut us down 52 * The PMU was already send the sleep command and will shut us down
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index d24ba547e53..556c279a789 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -57,9 +57,6 @@ static void tce_build_pSeries(struct iommu_table *tbl, long index,
57 u64 *tcep; 57 u64 *tcep;
58 u64 rpn; 58 u64 rpn;
59 59
60 index <<= TCE_PAGE_FACTOR;
61 npages <<= TCE_PAGE_FACTOR;
62
63 proto_tce = TCE_PCI_READ; // Read allowed 60 proto_tce = TCE_PCI_READ; // Read allowed
64 61
65 if (direction != DMA_TO_DEVICE) 62 if (direction != DMA_TO_DEVICE)
@@ -82,9 +79,6 @@ static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages)
82{ 79{
83 u64 *tcep; 80 u64 *tcep;
84 81
85 npages <<= TCE_PAGE_FACTOR;
86 index <<= TCE_PAGE_FACTOR;
87
88 tcep = ((u64 *)tbl->it_base) + index; 82 tcep = ((u64 *)tbl->it_base) + index;
89 83
90 while (npages--) 84 while (npages--)
@@ -95,7 +89,6 @@ static unsigned long tce_get_pseries(struct iommu_table *tbl, long index)
95{ 89{
96 u64 *tcep; 90 u64 *tcep;
97 91
98 index <<= TCE_PAGE_FACTOR;
99 tcep = ((u64 *)tbl->it_base) + index; 92 tcep = ((u64 *)tbl->it_base) + index;
100 93
101 return *tcep; 94 return *tcep;
@@ -109,9 +102,6 @@ static void tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
109 u64 proto_tce, tce; 102 u64 proto_tce, tce;
110 u64 rpn; 103 u64 rpn;
111 104
112 tcenum <<= TCE_PAGE_FACTOR;
113 npages <<= TCE_PAGE_FACTOR;
114
115 rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT; 105 rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
116 proto_tce = TCE_PCI_READ; 106 proto_tce = TCE_PCI_READ;
117 if (direction != DMA_TO_DEVICE) 107 if (direction != DMA_TO_DEVICE)
@@ -146,7 +136,7 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
146 u64 rpn; 136 u64 rpn;
147 long l, limit; 137 long l, limit;
148 138
149 if (TCE_PAGE_FACTOR == 0 && npages == 1) 139 if (npages == 1)
150 return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr, 140 return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
151 direction); 141 direction);
152 142
@@ -164,9 +154,6 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
164 __get_cpu_var(tce_page) = tcep; 154 __get_cpu_var(tce_page) = tcep;
165 } 155 }
166 156
167 tcenum <<= TCE_PAGE_FACTOR;
168 npages <<= TCE_PAGE_FACTOR;
169
170 rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT; 157 rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
171 proto_tce = TCE_PCI_READ; 158 proto_tce = TCE_PCI_READ;
172 if (direction != DMA_TO_DEVICE) 159 if (direction != DMA_TO_DEVICE)
@@ -207,9 +194,6 @@ static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages
207{ 194{
208 u64 rc; 195 u64 rc;
209 196
210 tcenum <<= TCE_PAGE_FACTOR;
211 npages <<= TCE_PAGE_FACTOR;
212
213 while (npages--) { 197 while (npages--) {
214 rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0); 198 rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0);
215 199
@@ -229,9 +213,6 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n
229{ 213{
230 u64 rc; 214 u64 rc;
231 215
232 tcenum <<= TCE_PAGE_FACTOR;
233 npages <<= TCE_PAGE_FACTOR;
234
235 rc = plpar_tce_stuff((u64)tbl->it_index, (u64)tcenum << 12, 0, npages); 216 rc = plpar_tce_stuff((u64)tbl->it_index, (u64)tcenum << 12, 0, npages);
236 217
237 if (rc && printk_ratelimit()) { 218 if (rc && printk_ratelimit()) {
@@ -248,7 +229,6 @@ static unsigned long tce_get_pSeriesLP(struct iommu_table *tbl, long tcenum)
248 u64 rc; 229 u64 rc;
249 unsigned long tce_ret; 230 unsigned long tce_ret;
250 231
251 tcenum <<= TCE_PAGE_FACTOR;
252 rc = plpar_tce_get((u64)tbl->it_index, (u64)tcenum << 12, &tce_ret); 232 rc = plpar_tce_get((u64)tbl->it_index, (u64)tcenum << 12, &tce_ret);
253 233
254 if (rc && printk_ratelimit()) { 234 if (rc && printk_ratelimit()) {
@@ -289,7 +269,7 @@ static void iommu_table_setparms(struct pci_controller *phb,
289 tbl->it_busno = phb->bus->number; 269 tbl->it_busno = phb->bus->number;
290 270
291 /* Units of tce entries */ 271 /* Units of tce entries */
292 tbl->it_offset = phb->dma_window_base_cur >> PAGE_SHIFT; 272 tbl->it_offset = phb->dma_window_base_cur >> IOMMU_PAGE_SHIFT;
293 273
294 /* Test if we are going over 2GB of DMA space */ 274 /* Test if we are going over 2GB of DMA space */
295 if (phb->dma_window_base_cur + phb->dma_window_size > 0x80000000ul) { 275 if (phb->dma_window_base_cur + phb->dma_window_size > 0x80000000ul) {
@@ -300,7 +280,7 @@ static void iommu_table_setparms(struct pci_controller *phb,
300 phb->dma_window_base_cur += phb->dma_window_size; 280 phb->dma_window_base_cur += phb->dma_window_size;
301 281
302 /* Set the tce table size - measured in entries */ 282 /* Set the tce table size - measured in entries */
303 tbl->it_size = phb->dma_window_size >> PAGE_SHIFT; 283 tbl->it_size = phb->dma_window_size >> IOMMU_PAGE_SHIFT;
304 284
305 tbl->it_index = 0; 285 tbl->it_index = 0;
306 tbl->it_blocksize = 16; 286 tbl->it_blocksize = 16;
@@ -325,8 +305,8 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,
325 tbl->it_base = 0; 305 tbl->it_base = 0;
326 tbl->it_blocksize = 16; 306 tbl->it_blocksize = 16;
327 tbl->it_type = TCE_PCI; 307 tbl->it_type = TCE_PCI;
328 tbl->it_offset = offset >> PAGE_SHIFT; 308 tbl->it_offset = offset >> IOMMU_PAGE_SHIFT;
329 tbl->it_size = size >> PAGE_SHIFT; 309 tbl->it_size = size >> IOMMU_PAGE_SHIFT;
330} 310}
331 311
332static void iommu_bus_setup_pSeries(struct pci_bus *bus) 312static void iommu_bus_setup_pSeries(struct pci_bus *bus)
@@ -522,8 +502,6 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
522 const void *dma_window = NULL; 502 const void *dma_window = NULL;
523 struct pci_dn *pci; 503 struct pci_dn *pci;
524 504
525 DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, pci_name(dev));
526
527 /* dev setup for LPAR is a little tricky, since the device tree might 505 /* dev setup for LPAR is a little tricky, since the device tree might
528 * contain the dma-window properties per-device and not neccesarily 506 * contain the dma-window properties per-device and not neccesarily
529 * for the bus. So we need to search upwards in the tree until we 507 * for the bus. So we need to search upwards in the tree until we
@@ -532,6 +510,9 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
532 */ 510 */
533 dn = pci_device_to_OF_node(dev); 511 dn = pci_device_to_OF_node(dev);
534 512
513 DBG("iommu_dev_setup_pSeriesLP, dev %p (%s) %s\n",
514 dev, pci_name(dev), dn->full_name);
515
535 for (pdn = dn; pdn && PCI_DN(pdn) && !PCI_DN(pdn)->iommu_table; 516 for (pdn = dn; pdn && PCI_DN(pdn) && !PCI_DN(pdn)->iommu_table;
536 pdn = pdn->parent) { 517 pdn = pdn->parent) {
537 dma_window = get_property(pdn, "ibm,dma-window", NULL); 518 dma_window = get_property(pdn, "ibm,dma-window", NULL);
diff --git a/arch/powerpc/sysdev/dart.h b/arch/powerpc/sysdev/dart.h
index 1c8817c4835..ff202edb059 100644
--- a/arch/powerpc/sysdev/dart.h
+++ b/arch/powerpc/sysdev/dart.h
@@ -72,7 +72,6 @@
72 72
73#define DART_PAGE_SHIFT 12 73#define DART_PAGE_SHIFT 12
74#define DART_PAGE_SIZE (1 << DART_PAGE_SHIFT) 74#define DART_PAGE_SIZE (1 << DART_PAGE_SHIFT)
75#define DART_PAGE_FACTOR (PAGE_SHIFT - DART_PAGE_SHIFT)
76 75
77 76
78#endif /* _POWERPC_SYSDEV_DART_H */ 77#endif /* _POWERPC_SYSDEV_DART_H */
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
index 03b4477dd7f..572b7846cc7 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -156,9 +156,6 @@ static void dart_build(struct iommu_table *tbl, long index,
156 156
157 DBG("dart: build at: %lx, %lx, addr: %x\n", index, npages, uaddr); 157 DBG("dart: build at: %lx, %lx, addr: %x\n", index, npages, uaddr);
158 158
159 index <<= DART_PAGE_FACTOR;
160 npages <<= DART_PAGE_FACTOR;
161
162 dp = ((unsigned int*)tbl->it_base) + index; 159 dp = ((unsigned int*)tbl->it_base) + index;
163 160
164 /* On U3, all memory is contigous, so we can move this 161 /* On U3, all memory is contigous, so we can move this
@@ -199,9 +196,6 @@ static void dart_free(struct iommu_table *tbl, long index, long npages)
199 196
200 DBG("dart: free at: %lx, %lx\n", index, npages); 197 DBG("dart: free at: %lx, %lx\n", index, npages);
201 198
202 index <<= DART_PAGE_FACTOR;
203 npages <<= DART_PAGE_FACTOR;
204
205 dp = ((unsigned int *)tbl->it_base) + index; 199 dp = ((unsigned int *)tbl->it_base) + index;
206 200
207 while (npages--) 201 while (npages--)
@@ -281,7 +275,7 @@ static void iommu_table_dart_setup(void)
281 iommu_table_dart.it_busno = 0; 275 iommu_table_dart.it_busno = 0;
282 iommu_table_dart.it_offset = 0; 276 iommu_table_dart.it_offset = 0;
283 /* it_size is in number of entries */ 277 /* it_size is in number of entries */
284 iommu_table_dart.it_size = (dart_tablesize / sizeof(u32)) >> DART_PAGE_FACTOR; 278 iommu_table_dart.it_size = dart_tablesize / sizeof(u32);
285 279
286 /* Initialize the common IOMMU code */ 280 /* Initialize the common IOMMU code */
287 iommu_table_dart.it_base = (unsigned long)dart_vbase; 281 iommu_table_dart.it_base = (unsigned long)dart_vbase;
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c
index 0450265d73b..ad87adc975b 100644
--- a/arch/powerpc/sysdev/i8259.c
+++ b/arch/powerpc/sysdev/i8259.c
@@ -224,6 +224,11 @@ static struct irq_host_ops i8259_host_ops = {
224 .xlate = i8259_host_xlate, 224 .xlate = i8259_host_xlate,
225}; 225};
226 226
227struct irq_host *i8259_get_host(void)
228{
229 return i8259_host;
230}
231
227/** 232/**
228 * i8259_init - Initialize the legacy controller 233 * i8259_init - Initialize the legacy controller
229 * @node: device node of the legacy PIC (can be NULL, but then, it will match 234 * @node: device node of the legacy PIC (can be NULL, but then, it will match
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index bc4d4a7f965..746f78c1537 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -473,9 +473,9 @@ static int ipic_set_irq_type(unsigned int virq, unsigned int flow_type)
473 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK; 473 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
474 if (flow_type & IRQ_TYPE_LEVEL_LOW) { 474 if (flow_type & IRQ_TYPE_LEVEL_LOW) {
475 desc->status |= IRQ_LEVEL; 475 desc->status |= IRQ_LEVEL;
476 set_irq_handler(virq, handle_level_irq); 476 desc->handle_irq = handle_level_irq;
477 } else { 477 } else {
478 set_irq_handler(virq, handle_edge_irq); 478 desc->handle_irq = handle_edge_irq;
479 } 479 }
480 480
481 /* only EXT IRQ senses are programmable on ipic 481 /* only EXT IRQ senses are programmable on ipic
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 812c87c73bb..e3d71e083f3 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -122,8 +122,7 @@ int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input)
122 mcn_shift = QE_CR_MCN_NORMAL_SHIFT; 122 mcn_shift = QE_CR_MCN_NORMAL_SHIFT;
123 } 123 }
124 124
125 out_be32(&qe_immr->cp.cecdr, 125 out_be32(&qe_immr->cp.cecdr, cmd_input);
126 immrbar_virt_to_phys((void *)cmd_input));
127 out_be32(&qe_immr->cp.cecr, 126 out_be32(&qe_immr->cp.cecr,
128 (cmd | QE_CR_FLG | ((u32) device << dev_shift) | (u32) 127 (cmd | QE_CR_FLG | ((u32) device << dev_shift) | (u32)
129 mcn_protocol << mcn_shift)); 128 mcn_protocol << mcn_shift));
diff --git a/arch/powerpc/sysdev/qe_lib/ucc.c b/arch/powerpc/sysdev/qe_lib/ucc.c
index 916c9e5df57..ac12a44d516 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc.c
@@ -207,6 +207,7 @@ int ucc_set_qe_mux_rxtx(int ucc_num, enum qe_clock clock, enum comm_dir mode)
207 case QE_CLK18: source = 8; break; 207 case QE_CLK18: source = 8; break;
208 case QE_CLK7: source = 9; break; 208 case QE_CLK7: source = 9; break;
209 case QE_CLK8: source = 10; break; 209 case QE_CLK8: source = 10; break;
210 case QE_CLK16: source = 11; break;
210 default: source = -1; break; 211 default: source = -1; break;
211 } 212 }
212 break; 213 break;
@@ -222,6 +223,7 @@ int ucc_set_qe_mux_rxtx(int ucc_num, enum qe_clock clock, enum comm_dir mode)
222 case QE_CLK22: source = 8; break; 223 case QE_CLK22: source = 8; break;
223 case QE_CLK7: source = 9; break; 224 case QE_CLK7: source = 9; break;
224 case QE_CLK8: source = 10; break; 225 case QE_CLK8: source = 10; break;
226 case QE_CLK16: source = 11; break;
225 default: source = -1; break; 227 default: source = -1; break;
226 } 228 }
227 break; 229 break;
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
index c2be7348fcb..75fa3104a43 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
@@ -163,7 +163,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
163 163
164 /* check if the UCC port number is in range. */ 164 /* check if the UCC port number is in range. */
165 if ((uf_info->ucc_num < 0) || (uf_info->ucc_num > UCC_MAX_NUM - 1)) { 165 if ((uf_info->ucc_num < 0) || (uf_info->ucc_num > UCC_MAX_NUM - 1)) {
166 uccf_err("ucc_fast_init: Illagal UCC number!"); 166 uccf_err("ucc_fast_init: Illegal UCC number!");
167 return -EINVAL; 167 return -EINVAL;
168 } 168 }
169 169
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
index 1fb88ef7cf0..a49da6b73ec 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
@@ -152,7 +152,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
152 152
153 /* check if the UCC port number is in range. */ 153 /* check if the UCC port number is in range. */
154 if ((us_info->ucc_num < 0) || (us_info->ucc_num > UCC_MAX_NUM - 1)) { 154 if ((us_info->ucc_num < 0) || (us_info->ucc_num > UCC_MAX_NUM - 1)) {
155 uccs_err("ucc_slow_init: Illagal UCC number!"); 155 uccs_err("ucc_slow_init: Illegal UCC number!");
156 return -EINVAL; 156 return -EINVAL;
157 } 157 }
158 158
diff --git a/arch/powerpc/sysdev/tsi108_dev.c b/arch/powerpc/sysdev/tsi108_dev.c
index 11de090eb90..97f37ef4bbb 100644
--- a/arch/powerpc/sysdev/tsi108_dev.c
+++ b/arch/powerpc/sysdev/tsi108_dev.c
@@ -48,7 +48,7 @@ phys_addr_t get_csrbase(void)
48 tsi = of_find_node_by_type(NULL, "tsi-bridge"); 48 tsi = of_find_node_by_type(NULL, "tsi-bridge");
49 if (tsi) { 49 if (tsi) {
50 unsigned int size; 50 unsigned int size;
51 void *prop = get_property(tsi, "reg", &size); 51 const void *prop = get_property(tsi, "reg", &size);
52 tsi108_csr_base = of_translate_address(tsi, prop); 52 tsi108_csr_base = of_translate_address(tsi, prop);
53 of_node_put(tsi); 53 of_node_put(tsi);
54 }; 54 };
@@ -79,7 +79,7 @@ static int __init tsi108_eth_of_init(void)
79 hw_info tsi_eth_data; 79 hw_info tsi_eth_data;
80 unsigned int *id; 80 unsigned int *id;
81 unsigned int *phy_id; 81 unsigned int *phy_id;
82 void *mac_addr; 82 const void *mac_addr;
83 phandle *ph; 83 phandle *ph;
84 84
85 memset(r, 0, sizeof(r)); 85 memset(r, 0, sizeof(r));
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 077711e6310..ef018e25fb0 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -724,7 +724,7 @@ config MPC834x_SYS
724 Be aware that PCI buses can only function when SYS board is plugged 724 Be aware that PCI buses can only function when SYS board is plugged
725 into the PIB (Platform IO Board) board from Freescale which provide 725 into the PIB (Platform IO Board) board from Freescale which provide
726 3 PCI slots. The PIBs PCI initialization is the bootloader's 726 3 PCI slots. The PIBs PCI initialization is the bootloader's
727 responsiblilty. 727 responsibility.
728 728
729config EV64360 729config EV64360
730 bool "Marvell-EV64360BP" 730 bool "Marvell-EV64360BP"
diff --git a/arch/ppc/boot/simple/relocate.S b/arch/ppc/boot/simple/relocate.S
index 0c021556d78..1bbbcd2f2bc 100644
--- a/arch/ppc/boot/simple/relocate.S
+++ b/arch/ppc/boot/simple/relocate.S
@@ -154,8 +154,8 @@ do_relocate_out:
154 154
155start_ldr: 155start_ldr:
156/* Clear all of BSS and set up stack for C calls */ 156/* Clear all of BSS and set up stack for C calls */
157 lis r3,edata@h 157 lis r3,__bss_start@h
158 ori r3,r3,edata@l 158 ori r3,r3,__bss_start@l
159 lis r4,end@h 159 lis r4,end@h
160 ori r4,r4,end@l 160 ori r4,r4,end@l
161 subi r3,r3,4 161 subi r3,r3,4
@@ -163,7 +163,7 @@ start_ldr:
163 li r0,0 163 li r0,0
16450: stwu r0,4(r3) 16450: stwu r0,4(r3)
165 cmpw cr0,r3,r4 165 cmpw cr0,r3,r4
166 bne 50b 166 blt 50b
16790: mr r9,r1 /* Save old stack pointer (in case it matters) */ 16790: mr r9,r1 /* Save old stack pointer (in case it matters) */
168 lis r1,.stack@h 168 lis r1,.stack@h
169 ori r1,r1,.stack@l 169 ori r1,r1,.stack@l
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 5f6684012de..d319f9ba237 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -110,80 +110,6 @@ _GLOBAL(reloc_got2)
110 blr 110 blr
111 111
112/* 112/*
113 * identify_cpu,
114 * called with r3 = data offset and r4 = CPU number
115 * doesn't change r3
116 */
117_GLOBAL(identify_cpu)
118 addis r8,r3,cpu_specs@ha
119 addi r8,r8,cpu_specs@l
120 mfpvr r7
1211:
122 lwz r5,CPU_SPEC_PVR_MASK(r8)
123 and r5,r5,r7
124 lwz r6,CPU_SPEC_PVR_VALUE(r8)
125 cmplw 0,r6,r5
126 beq 1f
127 addi r8,r8,CPU_SPEC_ENTRY_SIZE
128 b 1b
1291:
130 addis r6,r3,cur_cpu_spec@ha
131 addi r6,r6,cur_cpu_spec@l
132 sub r8,r8,r3
133 stw r8,0(r6)
134 blr
135
136/*
137 * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
138 * and writes nop's over sections of code that don't apply for this cpu.
139 * r3 = data offset (not changed)
140 */
141_GLOBAL(do_cpu_ftr_fixups)
142 /* Get CPU 0 features */
143 addis r6,r3,cur_cpu_spec@ha
144 addi r6,r6,cur_cpu_spec@l
145 lwz r4,0(r6)
146 add r4,r4,r3
147 lwz r4,CPU_SPEC_FEATURES(r4)
148
149 /* Get the fixup table */
150 addis r6,r3,__start___ftr_fixup@ha
151 addi r6,r6,__start___ftr_fixup@l
152 addis r7,r3,__stop___ftr_fixup@ha
153 addi r7,r7,__stop___ftr_fixup@l
154
155 /* Do the fixup */
1561: cmplw 0,r6,r7
157 bgelr
158 addi r6,r6,16
159 lwz r8,-16(r6) /* mask */
160 and r8,r8,r4
161 lwz r9,-12(r6) /* value */
162 cmplw 0,r8,r9
163 beq 1b
164 lwz r8,-8(r6) /* section begin */
165 lwz r9,-4(r6) /* section end */
166 subf. r9,r8,r9
167 beq 1b
168 /* write nops over the section of code */
169 /* todo: if large section, add a branch at the start of it */
170 srwi r9,r9,2
171 mtctr r9
172 add r8,r8,r3
173 lis r0,0x60000000@h /* nop */
1743: stw r0,0(r8)
175 andi. r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
176 beq 2f
177 dcbst 0,r8 /* suboptimal, but simpler */
178 sync
179 icbi 0,r8
1802: addi r8,r8,4
181 bdnz 3b
182 sync /* additional sync needed on g4 */
183 isync
184 b 1b
185
186/*
187 * call_setup_cpu - call the setup_cpu function for this cpu 113 * call_setup_cpu - call the setup_cpu function for this cpu
188 * r3 = data offset, r24 = cpu number 114 * r3 = data offset, r24 = cpu number
189 * 115 *
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 75fe13815be..27faeca2c7a 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -38,6 +38,7 @@
38#include <asm/nvram.h> 38#include <asm/nvram.h>
39#include <asm/xmon.h> 39#include <asm/xmon.h>
40#include <asm/ocp.h> 40#include <asm/ocp.h>
41#include <asm/prom.h>
41 42
42#define USES_PPC_SYS (defined(CONFIG_85xx) || defined(CONFIG_83xx) || \ 43#define USES_PPC_SYS (defined(CONFIG_85xx) || defined(CONFIG_83xx) || \
43 defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \ 44 defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \
@@ -53,8 +54,6 @@
53 54
54extern void platform_init(unsigned long r3, unsigned long r4, 55extern void platform_init(unsigned long r3, unsigned long r4,
55 unsigned long r5, unsigned long r6, unsigned long r7); 56 unsigned long r5, unsigned long r6, unsigned long r7);
56extern void identify_cpu(unsigned long offset, unsigned long cpu);
57extern void do_cpu_ftr_fixups(unsigned long offset);
58extern void reloc_got2(unsigned long offset); 57extern void reloc_got2(unsigned long offset);
59 58
60extern void ppc6xx_idle(void); 59extern void ppc6xx_idle(void);
@@ -301,6 +300,7 @@ early_init(int r3, int r4, int r5)
301{ 300{
302 unsigned long phys; 301 unsigned long phys;
303 unsigned long offset = reloc_offset(); 302 unsigned long offset = reloc_offset();
303 struct cpu_spec *spec;
304 304
305 /* Default */ 305 /* Default */
306 phys = offset + KERNELBASE; 306 phys = offset + KERNELBASE;
@@ -313,8 +313,10 @@ early_init(int r3, int r4, int r5)
313 * Identify the CPU type and fix up code sections 313 * Identify the CPU type and fix up code sections
314 * that depend on which cpu we have. 314 * that depend on which cpu we have.
315 */ 315 */
316 identify_cpu(offset, 0); 316 spec = identify_cpu(offset);
317 do_cpu_ftr_fixups(offset); 317 do_feature_fixups(spec->cpu_features,
318 PTRRELOC(&__start___ftr_fixup),
319 PTRRELOC(&__stop___ftr_fixup));
318 320
319 return phys; 321 return phys;
320} 322}
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index aafc8e8893d..9661a91183b 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -708,7 +708,7 @@ void single_step_exception(struct pt_regs *regs)
708 708
709void alignment_exception(struct pt_regs *regs) 709void alignment_exception(struct pt_regs *regs)
710{ 710{
711 int fixed; 711 int sig, code, fixed = 0;
712 712
713 fixed = fix_alignment(regs); 713 fixed = fix_alignment(regs);
714 if (fixed == 1) { 714 if (fixed == 1) {
@@ -717,14 +717,16 @@ void alignment_exception(struct pt_regs *regs)
717 return; 717 return;
718 } 718 }
719 if (fixed == -EFAULT) { 719 if (fixed == -EFAULT) {
720 /* fixed == -EFAULT means the operand address was bad */ 720 sig = SIGSEGV;
721 if (user_mode(regs)) 721 code = SEGV_ACCERR;
722 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar); 722 } else {
723 else 723 sig = SIGBUS;
724 bad_page_fault(regs, regs->dar, SIGSEGV); 724 code = BUS_ADRALN;
725 return;
726 } 725 }
727 _exception(SIGBUS, regs, BUS_ADRALN, regs->dar); 726 if (user_mode(regs))
727 _exception(sig, regs, code, regs->dar);
728 else
729 bad_page_fault(regs, regs->dar, sig);
728} 730}
729 731
730void StackOverflow(struct pt_regs *regs) 732void StackOverflow(struct pt_regs *regs)
diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
index 095fd332332..16e8661e1fe 100644
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -115,13 +115,7 @@ SECTIONS
115 __setup_end = .; 115 __setup_end = .;
116 __initcall_start = .; 116 __initcall_start = .;
117 .initcall.init : { 117 .initcall.init : {
118 *(.initcall1.init) 118 INITCALLS
119 *(.initcall2.init)
120 *(.initcall3.init)
121 *(.initcall4.init)
122 *(.initcall5.init)
123 *(.initcall6.init)
124 *(.initcall7.init)
125 } 119 }
126 __initcall_end = .; 120 __initcall_end = .;
127 121
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 608193cfe43..245b81bc715 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -236,9 +236,6 @@ config WARN_STACK_SIZE
236 This allows you to specify the maximum frame size a function may 236 This allows you to specify the maximum frame size a function may
237 have without the compiler complaining about it. 237 have without the compiler complaining about it.
238 238
239config ARCH_POPULATES_NODE_MAP
240 def_bool y
241
242source "mm/Kconfig" 239source "mm/Kconfig"
243 240
244comment "I/O subsystem configuration" 241comment "I/O subsystem configuration"
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 45c9fa7d754..af1e8fc7d98 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -310,6 +310,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
310 if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len)) { 310 if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len)) {
311 return -EFAULT; 311 return -EFAULT;
312 } 312 }
313 interval = 0;
313 sscanf(buf, "%i", &interval); 314 sscanf(buf, "%i", &interval);
314 if (interval <= 0) { 315 if (interval <= 0) {
315 P_ERROR("Timer CPU interval has to be > 0!\n"); 316 P_ERROR("Timer CPU interval has to be > 0!\n");
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index a3257398ea8..7cd51e73e27 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/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.18 3# Linux kernel version: 2.6.19-rc2
4# Wed Oct 4 19:45:46 2006 4# Wed Oct 18 17:11:10 2006
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_LOCKDEP_SUPPORT=y 7CONFIG_LOCKDEP_SUPPORT=y
@@ -119,7 +119,6 @@ CONFIG_PACK_STACK=y
119CONFIG_CHECK_STACK=y 119CONFIG_CHECK_STACK=y
120CONFIG_STACK_GUARD=256 120CONFIG_STACK_GUARD=256
121# CONFIG_WARN_STACK is not set 121# CONFIG_WARN_STACK is not set
122CONFIG_ARCH_POPULATES_NODE_MAP=y
123CONFIG_SELECT_MEMORY_MODEL=y 122CONFIG_SELECT_MEMORY_MODEL=y
124CONFIG_FLATMEM_MANUAL=y 123CONFIG_FLATMEM_MANUAL=y
125# CONFIG_DISCONTIGMEM_MANUAL is not set 124# CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -211,6 +210,7 @@ CONFIG_INET6_XFRM_MODE_TRANSPORT=y
211CONFIG_INET6_XFRM_MODE_TUNNEL=y 210CONFIG_INET6_XFRM_MODE_TUNNEL=y
212CONFIG_INET6_XFRM_MODE_BEET=y 211CONFIG_INET6_XFRM_MODE_BEET=y
213# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set 212# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
213CONFIG_IPV6_SIT=y
214# CONFIG_IPV6_TUNNEL is not set 214# CONFIG_IPV6_TUNNEL is not set
215# CONFIG_IPV6_SUBTREES is not set 215# CONFIG_IPV6_SUBTREES is not set
216# CONFIG_IPV6_MULTIPLE_TABLES is not set 216# CONFIG_IPV6_MULTIPLE_TABLES is not set
@@ -528,6 +528,7 @@ CONFIG_EXT3_FS=y
528CONFIG_EXT3_FS_XATTR=y 528CONFIG_EXT3_FS_XATTR=y
529# CONFIG_EXT3_FS_POSIX_ACL is not set 529# CONFIG_EXT3_FS_POSIX_ACL is not set
530# CONFIG_EXT3_FS_SECURITY is not set 530# CONFIG_EXT3_FS_SECURITY is not set
531# CONFIG_EXT4DEV_FS is not set
531CONFIG_JBD=y 532CONFIG_JBD=y
532# CONFIG_JBD_DEBUG is not set 533# CONFIG_JBD_DEBUG is not set
533CONFIG_FS_MBCACHE=y 534CONFIG_FS_MBCACHE=y
@@ -646,10 +647,6 @@ CONFIG_MSDOS_PARTITION=y
646# CONFIG_NLS is not set 647# CONFIG_NLS is not set
647 648
648# 649#
649# Distributed Lock Manager
650#
651
652#
653# Instrumentation Support 650# Instrumentation Support
654# 651#
655 652
@@ -669,7 +666,6 @@ CONFIG_MAGIC_SYSRQ=y
669# CONFIG_UNUSED_SYMBOLS is not set 666# CONFIG_UNUSED_SYMBOLS is not set
670CONFIG_DEBUG_KERNEL=y 667CONFIG_DEBUG_KERNEL=y
671CONFIG_LOG_BUF_SHIFT=17 668CONFIG_LOG_BUF_SHIFT=17
672# CONFIG_DETECT_SOFTLOCKUP is not set
673# CONFIG_SCHEDSTATS is not set 669# CONFIG_SCHEDSTATS is not set
674# CONFIG_DEBUG_SLAB is not set 670# CONFIG_DEBUG_SLAB is not set
675CONFIG_DEBUG_PREEMPT=y 671CONFIG_DEBUG_PREEMPT=y
@@ -690,6 +686,7 @@ CONFIG_DEBUG_FS=y
690# CONFIG_FRAME_POINTER is not set 686# CONFIG_FRAME_POINTER is not set
691# CONFIG_UNWIND_INFO is not set 687# CONFIG_UNWIND_INFO is not set
692CONFIG_FORCED_INLINING=y 688CONFIG_FORCED_INLINING=y
689CONFIG_HEADERS_CHECK=y
693# CONFIG_RCU_TORTURE_TEST is not set 690# CONFIG_RCU_TORTURE_TEST is not set
694# CONFIG_LKDTM is not set 691# CONFIG_LKDTM is not set
695 692
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index e15e1489aef..5b33f823863 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -295,6 +295,7 @@ static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i)
295 * 295 *
296 * This is really horribly ugly. 296 * This is really horribly ugly.
297 */ 297 */
298#ifdef CONFIG_SYSVIPC
298asmlinkage long sys32_ipc(u32 call, int first, int second, int third, u32 ptr) 299asmlinkage long sys32_ipc(u32 call, int first, int second, int third, u32 ptr)
299{ 300{
300 if (call >> 16) /* hack for backward compatibility */ 301 if (call >> 16) /* hack for backward compatibility */
@@ -338,6 +339,7 @@ asmlinkage long sys32_ipc(u32 call, int first, int second, int third, u32 ptr)
338 339
339 return -ENOSYS; 340 return -ENOSYS;
340} 341}
342#endif
341 343
342asmlinkage long sys32_truncate64(const char __user * path, unsigned long high, unsigned long low) 344asmlinkage long sys32_truncate64(const char __user * path, unsigned long high, unsigned long low)
343{ 345{
@@ -755,7 +757,9 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
755 put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp))) 757 put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)))
756 error = -EFAULT; 758 error = -EFAULT;
757 } 759 }
758 copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); 760 if (copy_to_user(args->__unused, tmp.__unused,
761 sizeof(tmp.__unused)))
762 error = -EFAULT;
759 } 763 }
760 return error; 764 return error;
761} 765}
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index d49b876a83b..861888ab8c1 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -169,12 +169,12 @@ sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
169 compat_old_sigset_t mask; 169 compat_old_sigset_t mask;
170 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 170 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
171 __get_user(sa_handler, &act->sa_handler) || 171 __get_user(sa_handler, &act->sa_handler) ||
172 __get_user(sa_restorer, &act->sa_restorer)) 172 __get_user(sa_restorer, &act->sa_restorer) ||
173 __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
174 __get_user(mask, &act->sa_mask))
173 return -EFAULT; 175 return -EFAULT;
174 new_ka.sa.sa_handler = (__sighandler_t) sa_handler; 176 new_ka.sa.sa_handler = (__sighandler_t) sa_handler;
175 new_ka.sa.sa_restorer = (void (*)(void)) sa_restorer; 177 new_ka.sa.sa_restorer = (void (*)(void)) sa_restorer;
176 __get_user(new_ka.sa.sa_flags, &act->sa_flags);
177 __get_user(mask, &act->sa_mask);
178 siginitset(&new_ka.sa.sa_mask, mask); 178 siginitset(&new_ka.sa.sa_mask, mask);
179 } 179 }
180 180
@@ -185,10 +185,10 @@ sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
185 sa_restorer = (unsigned long) old_ka.sa.sa_restorer; 185 sa_restorer = (unsigned long) old_ka.sa.sa_restorer;
186 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 186 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
187 __put_user(sa_handler, &oact->sa_handler) || 187 __put_user(sa_handler, &oact->sa_handler) ||
188 __put_user(sa_restorer, &oact->sa_restorer)) 188 __put_user(sa_restorer, &oact->sa_restorer) ||
189 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
190 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
189 return -EFAULT; 191 return -EFAULT;
190 __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
191 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
192 } 192 }
193 193
194 return ret; 194 return ret;
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index cb0efae6802..71e54ef0931 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1664,4 +1664,4 @@ sys_getcpu_wrapper:
1664 llgtr %r2,%r2 # unsigned * 1664 llgtr %r2,%r2 # unsigned *
1665 llgtr %r3,%r3 # unsigned * 1665 llgtr %r3,%r3 # unsigned *
1666 llgtr %r4,%r4 # struct getcpu_cache * 1666 llgtr %r4,%r4 # struct getcpu_cache *
1667 jg sys_tee 1667 jg sys_getcpu
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 49f2b68e32b..2aa13e8e000 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -70,6 +70,7 @@ struct {
70#define CHUNK_READ_WRITE 0 70#define CHUNK_READ_WRITE 0
71#define CHUNK_READ_ONLY 1 71#define CHUNK_READ_ONLY 1
72volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */ 72volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */
73unsigned long __initdata zholes_size[MAX_NR_ZONES];
73static unsigned long __initdata memory_end; 74static unsigned long __initdata memory_end;
74 75
75/* 76/*
@@ -357,6 +358,21 @@ void machine_power_off(void)
357 */ 358 */
358void (*pm_power_off)(void) = machine_power_off; 359void (*pm_power_off)(void) = machine_power_off;
359 360
361static void __init
362add_memory_hole(unsigned long start, unsigned long end)
363{
364 unsigned long dma_pfn = MAX_DMA_ADDRESS >> PAGE_SHIFT;
365
366 if (end <= dma_pfn)
367 zholes_size[ZONE_DMA] += end - start + 1;
368 else if (start > dma_pfn)
369 zholes_size[ZONE_NORMAL] += end - start + 1;
370 else {
371 zholes_size[ZONE_DMA] += dma_pfn - start + 1;
372 zholes_size[ZONE_NORMAL] += end - dma_pfn;
373 }
374}
375
360static int __init early_parse_mem(char *p) 376static int __init early_parse_mem(char *p)
361{ 377{
362 memory_end = memparse(p, &p); 378 memory_end = memparse(p, &p);
@@ -434,7 +450,7 @@ setup_lowcore(void)
434 lc->extended_save_area_addr = (__u32) 450 lc->extended_save_area_addr = (__u32)
435 __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, 0); 451 __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, 0);
436 /* enable extended save area */ 452 /* enable extended save area */
437 ctl_set_bit(14, 29); 453 __ctl_set_bit(14, 29);
438 } 454 }
439#endif 455#endif
440 set_prefix((u32)(unsigned long) lc); 456 set_prefix((u32)(unsigned long) lc);
@@ -478,6 +494,7 @@ setup_memory(void)
478{ 494{
479 unsigned long bootmap_size; 495 unsigned long bootmap_size;
480 unsigned long start_pfn, end_pfn, init_pfn; 496 unsigned long start_pfn, end_pfn, init_pfn;
497 unsigned long last_rw_end;
481 int i; 498 int i;
482 499
483 /* 500 /*
@@ -533,27 +550,39 @@ setup_memory(void)
533 /* 550 /*
534 * Register RAM areas with the bootmem allocator. 551 * Register RAM areas with the bootmem allocator.
535 */ 552 */
553 last_rw_end = start_pfn;
536 554
537 for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) { 555 for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) {
538 unsigned long start_chunk, end_chunk, pfn; 556 unsigned long start_chunk, end_chunk;
539 557
540 if (memory_chunk[i].type != CHUNK_READ_WRITE) 558 if (memory_chunk[i].type != CHUNK_READ_WRITE)
541 continue; 559 continue;
542 start_chunk = PFN_DOWN(memory_chunk[i].addr); 560 start_chunk = (memory_chunk[i].addr + PAGE_SIZE - 1);
543 end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size) - 1; 561 start_chunk >>= PAGE_SHIFT;
544 end_chunk = min(end_chunk, end_pfn); 562 end_chunk = (memory_chunk[i].addr + memory_chunk[i].size);
545 if (start_chunk >= end_chunk) 563 end_chunk >>= PAGE_SHIFT;
546 continue; 564 if (start_chunk < start_pfn)
547 add_active_range(0, start_chunk, end_chunk); 565 start_chunk = start_pfn;
548 pfn = max(start_chunk, start_pfn); 566 if (end_chunk > end_pfn)
549 for (; pfn <= end_chunk; pfn++) 567 end_chunk = end_pfn;
550 page_set_storage_key(PFN_PHYS(pfn), PAGE_DEFAULT_KEY); 568 if (start_chunk < end_chunk) {
569 /* Initialize storage key for RAM pages */
570 for (init_pfn = start_chunk ; init_pfn < end_chunk;
571 init_pfn++)
572 page_set_storage_key(init_pfn << PAGE_SHIFT,
573 PAGE_DEFAULT_KEY);
574 free_bootmem(start_chunk << PAGE_SHIFT,
575 (end_chunk - start_chunk) << PAGE_SHIFT);
576 if (last_rw_end < start_chunk)
577 add_memory_hole(last_rw_end, start_chunk - 1);
578 last_rw_end = end_chunk;
579 }
551 } 580 }
552 581
553 psw_set_key(PAGE_DEFAULT_KEY); 582 psw_set_key(PAGE_DEFAULT_KEY);
554 583
555 free_bootmem_with_active_regions(0, max_pfn); 584 if (last_rw_end < end_pfn - 1)
556 reserve_bootmem(0, PFN_PHYS(start_pfn)); 585 add_memory_hole(last_rw_end, end_pfn - 1);
557 586
558 /* 587 /*
559 * Reserve the bootmem bitmap itself as well. We do this in two 588 * Reserve the bootmem bitmap itself as well. We do this in two
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index 4392a77cbae..4c8a7954ef4 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -80,10 +80,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
80 old_sigset_t mask; 80 old_sigset_t mask;
81 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 81 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
82 __get_user(new_ka.sa.sa_handler, &act->sa_handler) || 82 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
83 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) 83 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
84 __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
85 __get_user(mask, &act->sa_mask))
84 return -EFAULT; 86 return -EFAULT;
85 __get_user(new_ka.sa.sa_flags, &act->sa_flags);
86 __get_user(mask, &act->sa_mask);
87 siginitset(&new_ka.sa.sa_mask, mask); 87 siginitset(&new_ka.sa.sa_mask, mask);
88 } 88 }
89 89
@@ -92,10 +92,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
92 if (!ret && oact) { 92 if (!ret && oact) {
93 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 93 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
94 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || 94 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
95 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) 95 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
96 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
97 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
96 return -EFAULT; 98 return -EFAULT;
97 __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
98 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
99 } 99 }
100 100
101 return ret; 101 return ret;
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index e59baec5652..a4ceae3dbcf 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -320,3 +320,4 @@ SYSCALL(sys_tee,sys_tee,sys_tee_wrapper)
320SYSCALL(sys_vmsplice,sys_vmsplice,compat_sys_vmsplice_wrapper) 320SYSCALL(sys_vmsplice,sys_vmsplice,compat_sys_vmsplice_wrapper)
321NI_SYSCALL /* 310 sys_move_pages */ 321NI_SYSCALL /* 310 sys_move_pages */
322SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper) 322SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper)
323SYSCALL(sys_epoll_pwait,sys_epoll_pwait,sys_ni_syscall)
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 66375a5e3d1..92ecffbc8d8 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -462,7 +462,8 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
462 local_irq_enable(); 462 local_irq_enable();
463 463
464 if (regs->psw.mask & PSW_MASK_PSTATE) { 464 if (regs->psw.mask & PSW_MASK_PSTATE) {
465 get_user(*((__u16 *) opcode), (__u16 __user *) location); 465 if (get_user(*((__u16 *) opcode), (__u16 __user *) location))
466 return;
466 if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) { 467 if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) {
467 if (current->ptrace & PT_PTRACED) 468 if (current->ptrace & PT_PTRACED)
468 force_sig(SIGTRAP, current); 469 force_sig(SIGTRAP, current);
@@ -470,20 +471,25 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
470 signal = SIGILL; 471 signal = SIGILL;
471#ifdef CONFIG_MATHEMU 472#ifdef CONFIG_MATHEMU
472 } else if (opcode[0] == 0xb3) { 473 } else if (opcode[0] == 0xb3) {
473 get_user(*((__u16 *) (opcode+2)), location+1); 474 if (get_user(*((__u16 *) (opcode+2)), location+1))
475 return;
474 signal = math_emu_b3(opcode, regs); 476 signal = math_emu_b3(opcode, regs);
475 } else if (opcode[0] == 0xed) { 477 } else if (opcode[0] == 0xed) {
476 get_user(*((__u32 *) (opcode+2)), 478 if (get_user(*((__u32 *) (opcode+2)),
477 (__u32 __user *)(location+1)); 479 (__u32 __user *)(location+1)))
480 return;
478 signal = math_emu_ed(opcode, regs); 481 signal = math_emu_ed(opcode, regs);
479 } else if (*((__u16 *) opcode) == 0xb299) { 482 } else if (*((__u16 *) opcode) == 0xb299) {
480 get_user(*((__u16 *) (opcode+2)), location+1); 483 if (get_user(*((__u16 *) (opcode+2)), location+1))
484 return;
481 signal = math_emu_srnm(opcode, regs); 485 signal = math_emu_srnm(opcode, regs);
482 } else if (*((__u16 *) opcode) == 0xb29c) { 486 } else if (*((__u16 *) opcode) == 0xb29c) {
483 get_user(*((__u16 *) (opcode+2)), location+1); 487 if (get_user(*((__u16 *) (opcode+2)), location+1))
488 return;
484 signal = math_emu_stfpc(opcode, regs); 489 signal = math_emu_stfpc(opcode, regs);
485 } else if (*((__u16 *) opcode) == 0xb29d) { 490 } else if (*((__u16 *) opcode) == 0xb29d) {
486 get_user(*((__u16 *) (opcode+2)), location+1); 491 if (get_user(*((__u16 *) (opcode+2)), location+1))
492 return;
487 signal = math_emu_lfpc(opcode, regs); 493 signal = math_emu_lfpc(opcode, regs);
488#endif 494#endif
489 } else 495 } else
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index af9e69a0301..fe0f2e97ba7 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -83,13 +83,7 @@ SECTIONS
83 __setup_end = .; 83 __setup_end = .;
84 __initcall_start = .; 84 __initcall_start = .;
85 .initcall.init : { 85 .initcall.init : {
86 *(.initcall1.init) 86 INITCALLS
87 *(.initcall2.init)
88 *(.initcall3.init)
89 *(.initcall4.init)
90 *(.initcall5.init)
91 *(.initcall6.init)
92 *(.initcall7.init)
93 } 87 }
94 __initcall_end = .; 88 __initcall_end = .;
95 __con_initcall_start = .; 89 __con_initcall_start = .;
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index d9989171870..e1881c31b1c 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -84,6 +84,7 @@ void show_mem(void)
84 printk("%d pages swap cached\n",cached); 84 printk("%d pages swap cached\n",cached);
85} 85}
86 86
87extern unsigned long __initdata zholes_size[];
87/* 88/*
88 * paging_init() sets up the page tables 89 * paging_init() sets up the page tables
89 */ 90 */
@@ -100,15 +101,16 @@ void __init paging_init(void)
100 unsigned long pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERNSEG_TABLE; 101 unsigned long pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERNSEG_TABLE;
101 static const int ssm_mask = 0x04000000L; 102 static const int ssm_mask = 0x04000000L;
102 unsigned long ro_start_pfn, ro_end_pfn; 103 unsigned long ro_start_pfn, ro_end_pfn;
103 unsigned long max_zone_pfns[MAX_NR_ZONES]; 104 unsigned long zones_size[MAX_NR_ZONES];
104 105
105 ro_start_pfn = PFN_DOWN((unsigned long)&__start_rodata); 106 ro_start_pfn = PFN_DOWN((unsigned long)&__start_rodata);
106 ro_end_pfn = PFN_UP((unsigned long)&__end_rodata); 107 ro_end_pfn = PFN_UP((unsigned long)&__end_rodata);
107 108
108 memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); 109 memset(zones_size, 0, sizeof(zones_size));
109 max_zone_pfns[ZONE_DMA] = max_low_pfn; 110 zones_size[ZONE_DMA] = max_low_pfn;
110 max_zone_pfns[ZONE_NORMAL] = max_low_pfn; 111 free_area_init_node(0, &contig_page_data, zones_size,
111 free_area_init_nodes(max_zone_pfns); 112 __pa(PAGE_OFFSET) >> PAGE_SHIFT,
113 zholes_size);
112 114
113 /* unmap whole virtual address space */ 115 /* unmap whole virtual address space */
114 116
@@ -168,16 +170,26 @@ void __init paging_init(void)
168 unsigned long pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | 170 unsigned long pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) |
169 _KERN_REGION_TABLE; 171 _KERN_REGION_TABLE;
170 static const int ssm_mask = 0x04000000L; 172 static const int ssm_mask = 0x04000000L;
173 unsigned long zones_size[MAX_NR_ZONES];
174 unsigned long dma_pfn, high_pfn;
171 unsigned long ro_start_pfn, ro_end_pfn; 175 unsigned long ro_start_pfn, ro_end_pfn;
172 unsigned long max_zone_pfns[MAX_NR_ZONES];
173 176
177 memset(zones_size, 0, sizeof(zones_size));
178 dma_pfn = MAX_DMA_ADDRESS >> PAGE_SHIFT;
179 high_pfn = max_low_pfn;
174 ro_start_pfn = PFN_DOWN((unsigned long)&__start_rodata); 180 ro_start_pfn = PFN_DOWN((unsigned long)&__start_rodata);
175 ro_end_pfn = PFN_UP((unsigned long)&__end_rodata); 181 ro_end_pfn = PFN_UP((unsigned long)&__end_rodata);
176 182
177 memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); 183 if (dma_pfn > high_pfn)
178 max_zone_pfns[ZONE_DMA] = PFN_DOWN(MAX_DMA_ADDRESS); 184 zones_size[ZONE_DMA] = high_pfn;
179 max_zone_pfns[ZONE_NORMAL] = max_low_pfn; 185 else {
180 free_area_init_nodes(max_zone_pfns); 186 zones_size[ZONE_DMA] = dma_pfn;
187 zones_size[ZONE_NORMAL] = high_pfn - dma_pfn;
188 }
189
190 /* Initialize mem_map[]. */
191 free_area_init_node(0, &contig_page_data, zones_size,
192 __pa(PAGE_OFFSET) >> PAGE_SHIFT, zholes_size);
181 193
182 /* 194 /*
183 * map whole physical memory to virtual memory (identity mapping) 195 * map whole physical memory to virtual memory (identity mapping)
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 6a461d4caef..bffc7e17697 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -217,7 +217,7 @@ config SH_SHMIN
217 bool "SHMIN" 217 bool "SHMIN"
218 select CPU_SUBTYPE_SH7706 218 select CPU_SUBTYPE_SH7706
219 help 219 help
220 Select SHMIN if configureing for the SHMIN board 220 Select SHMIN if configuring for the SHMIN board.
221 221
222config SH_UNKNOWN 222config SH_UNKNOWN
223 bool "BareCPU" 223 bool "BareCPU"
diff --git a/arch/sh/boards/hp6xx/hp6xx_apm.c b/arch/sh/boards/hp6xx/hp6xx_apm.c
index 219179114f0..d146cdaa0b8 100644
--- a/arch/sh/boards/hp6xx/hp6xx_apm.c
+++ b/arch/sh/boards/hp6xx/hp6xx_apm.c
@@ -14,7 +14,7 @@
14#include <asm/io.h> 14#include <asm/io.h>
15#include <asm/apm.h> 15#include <asm/apm.h>
16#include <asm/adc.h> 16#include <asm/adc.h>
17#include <asm/hp6xx/hp6xx.h> 17#include <asm/hp6xx.h>
18 18
19#define SH7709_PGDR 0xa400012c 19#define SH7709_PGDR 0xa400012c
20 20
diff --git a/arch/sh/boards/hp6xx/pm.c b/arch/sh/boards/hp6xx/pm.c
index 83d32721206..d1947732fb3 100644
--- a/arch/sh/boards/hp6xx/pm.c
+++ b/arch/sh/boards/hp6xx/pm.c
@@ -12,7 +12,7 @@
12#include <linux/time.h> 12#include <linux/time.h>
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/hd64461.h> 14#include <asm/hd64461.h>
15#include <asm/hp6xx/hp6xx.h> 15#include <asm/hp6xx.h>
16#include <asm/cpu/dac.h> 16#include <asm/cpu/dac.h>
17#include <asm/pm.h> 17#include <asm/pm.h>
18 18
diff --git a/arch/sh/boards/hp6xx/setup.c b/arch/sh/boards/hp6xx/setup.c
index 2d3a5b4faf5..b5a96649ed2 100644
--- a/arch/sh/boards/hp6xx/setup.c
+++ b/arch/sh/boards/hp6xx/setup.c
@@ -13,7 +13,7 @@
13#include <asm/hd64461.h> 13#include <asm/hd64461.h>
14#include <asm/io.h> 14#include <asm/io.h>
15#include <asm/irq.h> 15#include <asm/irq.h>
16#include <asm/hp6xx/hp6xx.h> 16#include <asm/hp6xx.h>
17#include <asm/cpu/dac.h> 17#include <asm/cpu/dac.h>
18 18
19#define SCPCR 0xa4000116 19#define SCPCR 0xa4000116
diff --git a/arch/sh/boards/renesas/hs7751rvoip/io.c b/arch/sh/boards/renesas/hs7751rvoip/io.c
index 51f3f657421..bb9aa0d6285 100644
--- a/arch/sh/boards/renesas/hs7751rvoip/io.c
+++ b/arch/sh/boards/renesas/hs7751rvoip/io.c
@@ -15,7 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/pci.h> 16#include <linux/pci.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/hs7751rvoip/hs7751rvoip.h> 18#include <asm/hs7751rvoip.h>
19#include <asm/addrspace.h> 19#include <asm/addrspace.h>
20 20
21extern void *area6_io8_base; /* Area 6 8bit I/O Base address */ 21extern void *area6_io8_base; /* Area 6 8bit I/O Base address */
diff --git a/arch/sh/boards/renesas/hs7751rvoip/irq.c b/arch/sh/boards/renesas/hs7751rvoip/irq.c
index c617b188258..943f93aa605 100644
--- a/arch/sh/boards/renesas/hs7751rvoip/irq.c
+++ b/arch/sh/boards/renesas/hs7751rvoip/irq.c
@@ -14,7 +14,7 @@
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/irq.h> 16#include <asm/irq.h>
17#include <asm/hs7751rvoip/hs7751rvoip.h> 17#include <asm/hs7751rvoip.h>
18 18
19static int mask_pos[] = {8, 9, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7}; 19static int mask_pos[] = {8, 9, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7};
20 20
diff --git a/arch/sh/boards/renesas/hs7751rvoip/setup.c b/arch/sh/boards/renesas/hs7751rvoip/setup.c
index 0414c15c345..f7d0e304d89 100644
--- a/arch/sh/boards/renesas/hs7751rvoip/setup.c
+++ b/arch/sh/boards/renesas/hs7751rvoip/setup.c
@@ -10,22 +10,21 @@
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/irq.h> 11#include <linux/irq.h>
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/vmalloc.h>
14#include <linux/hdreg.h>
15#include <linux/ide.h>
16#include <linux/pm.h> 13#include <linux/pm.h>
14#include <asm/hs7751rvoip.h>
17#include <asm/io.h> 15#include <asm/io.h>
18#include <asm/hs7751rvoip/hs7751rvoip.h>
19#include <asm/machvec.h> 16#include <asm/machvec.h>
20#include <asm/rtc.h>
21#include <asm/irq.h>
22 17
23static void __init hs7751rvoip_init_irq(void) 18static struct ipr_data hs77501rvoip_ipr_map[] = {
24{
25#if defined(CONFIG_HS7751RVOIP_CODEC) 19#if defined(CONFIG_HS7751RVOIP_CODEC)
26 make_ipr_irq(DMTE0_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY); 20 { DMTE0_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
27 make_ipr_irq(DMTE1_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY); 21 { DMTE1_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
28#endif 22#endif
23};
24
25static void __init hs7751rvoip_init_irq(void)
26{
27 make_ipr_irq(hs77501rvoip_ipr_map, ARRAY_SIZE(hs77501rvoip_ipr_map));
29 28
30 init_hs7751rvoip_IRQ(); 29 init_hs7751rvoip_IRQ();
31} 30}
diff --git a/arch/sh/boards/renesas/r7780rp/io.c b/arch/sh/boards/renesas/r7780rp/io.c
index db92d6e6ae9..311ccccba71 100644
--- a/arch/sh/boards/renesas/r7780rp/io.c
+++ b/arch/sh/boards/renesas/r7780rp/io.c
@@ -11,7 +11,7 @@
11#include <linux/pci.h> 11#include <linux/pci.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/types.h> 13#include <linux/types.h>
14#include <asm/r7780rp/r7780rp.h> 14#include <asm/r7780rp.h>
15#include <asm/addrspace.h> 15#include <asm/addrspace.h>
16#include <asm/io.h> 16#include <asm/io.h>
17 17
diff --git a/arch/sh/boards/renesas/r7780rp/irq.c b/arch/sh/boards/renesas/r7780rp/irq.c
index b544772cbc7..aa15ec5bc69 100644
--- a/arch/sh/boards/renesas/r7780rp/irq.c
+++ b/arch/sh/boards/renesas/r7780rp/irq.c
@@ -10,7 +10,8 @@
10 */ 10 */
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/irq.h> 12#include <linux/irq.h>
13#include <asm/io.h> 13#include <linux/io.h>
14#include <asm/r7780rp.h>
14 15
15#ifdef CONFIG_SH_R7780MP 16#ifdef CONFIG_SH_R7780MP
16static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0}; 17static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0};
@@ -32,7 +33,7 @@ static void disable_r7780rp_irq(unsigned int irq)
32} 33}
33 34
34static struct irq_chip r7780rp_irq_chip __read_mostly = { 35static struct irq_chip r7780rp_irq_chip __read_mostly = {
35 .name = "r7780rp", 36 .name = "R7780RP",
36 .mask = disable_r7780rp_irq, 37 .mask = disable_r7780rp_irq,
37 .unmask = enable_r7780rp_irq, 38 .unmask = enable_r7780rp_irq,
38 .mask_ack = disable_r7780rp_irq, 39 .mask_ack = disable_r7780rp_irq,
@@ -47,8 +48,8 @@ void __init init_r7780rp_IRQ(void)
47 48
48 for (i = 0; i < 15; i++) { 49 for (i = 0; i < 15; i++) {
49 disable_irq_nosync(i); 50 disable_irq_nosync(i);
50 set_irq_chip_and_handler(i, &r7780rp_irq_chip, 51 set_irq_chip_and_handler_name(i, &r7780rp_irq_chip,
51 handle_level_irq); 52 handle_level_irq, "level");
52 enable_r7780rp_irq(i); 53 enable_r7780rp_irq(i);
53 } 54 }
54} 55}
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c
index b941aa0aa34..c331caeb694 100644
--- a/arch/sh/boards/renesas/r7780rp/setup.c
+++ b/arch/sh/boards/renesas/r7780rp/setup.c
@@ -13,7 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <asm/machvec.h> 15#include <asm/machvec.h>
16#include <asm/r7780rp/r7780rp.h> 16#include <asm/r7780rp.h>
17#include <asm/clock.h> 17#include <asm/clock.h>
18#include <asm/io.h> 18#include <asm/io.h>
19 19
diff --git a/arch/sh/boards/renesas/rts7751r2d/io.c b/arch/sh/boards/renesas/rts7751r2d/io.c
index 135aa0b5e62..f2507a80497 100644
--- a/arch/sh/boards/renesas/rts7751r2d/io.c
+++ b/arch/sh/boards/renesas/rts7751r2d/io.c
@@ -11,8 +11,8 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/pci.h> 13#include <linux/pci.h>
14#include <asm/rts7751r2d/rts7751r2d.h> 14#include <linux/io.h>
15#include <asm/io.h> 15#include <asm/rts7751r2d.h>
16#include <asm/addrspace.h> 16#include <asm/addrspace.h>
17 17
18/* 18/*
diff --git a/arch/sh/boards/renesas/rts7751r2d/irq.c b/arch/sh/boards/renesas/rts7751r2d/irq.c
index c915e7a3693..cb0eb20d1b4 100644
--- a/arch/sh/boards/renesas/rts7751r2d/irq.c
+++ b/arch/sh/boards/renesas/rts7751r2d/irq.c
@@ -8,12 +8,10 @@
8 * Modified for RTS7751R2D by 8 * Modified for RTS7751R2D by
9 * Atom Create Engineering Co., Ltd. 2002. 9 * Atom Create Engineering Co., Ltd. 2002.
10 */ 10 */
11
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/irq.h> 12#include <linux/irq.h>
14#include <asm/io.h> 13#include <linux/io.h>
15#include <asm/irq.h> 14#include <asm/rts7751r2d.h>
16#include <asm/rts7751r2d/rts7751r2d.h>
17 15
18#if defined(CONFIG_RTS7751R2D_REV11) 16#if defined(CONFIG_RTS7751R2D_REV11)
19static int mask_pos[] = {11, 9, 8, 12, 10, 6, 5, 4, 7, 14, 13, 0, 0, 0, 0}; 17static int mask_pos[] = {11, 9, 8, 12, 10, 6, 5, 4, 7, 14, 13, 0, 0, 0, 0};
diff --git a/arch/sh/boards/renesas/rts7751r2d/led.c b/arch/sh/boards/renesas/rts7751r2d/led.c
index a7ce66c1e4f..509f548bdce 100644
--- a/arch/sh/boards/renesas/rts7751r2d/led.c
+++ b/arch/sh/boards/renesas/rts7751r2d/led.c
@@ -8,13 +8,9 @@
8 * 8 *
9 * This file contains Renesas Technology Sales RTS7751R2D specific LED code. 9 * This file contains Renesas Technology Sales RTS7751R2D specific LED code.
10 */ 10 */
11 11#include <linux/io.h>
12#include <asm/io.h>
13#include <asm/rts7751r2d/rts7751r2d.h>
14
15#ifdef CONFIG_HEARTBEAT
16
17#include <linux/sched.h> 12#include <linux/sched.h>
13#include <asm/rts7751r2d.h>
18 14
19/* Cycle the LED's in the clasic Knightriger/Sun pattern */ 15/* Cycle the LED's in the clasic Knightriger/Sun pattern */
20void heartbeat_rts7751r2d(void) 16void heartbeat_rts7751r2d(void)
@@ -46,10 +42,3 @@ void heartbeat_rts7751r2d(void)
46 else 42 else
47 bit--; 43 bit--;
48} 44}
49#endif /* CONFIG_HEARTBEAT */
50
51void rts7751r2d_led(unsigned short value)
52{
53 ctrl_outw(value, PA_OUTPORT);
54}
55
diff --git a/arch/sh/boards/renesas/rts7751r2d/setup.c b/arch/sh/boards/renesas/rts7751r2d/setup.c
index 20597a6e670..5c042d35ec9 100644
--- a/arch/sh/boards/renesas/rts7751r2d/setup.c
+++ b/arch/sh/boards/renesas/rts7751r2d/setup.c
@@ -12,9 +12,9 @@
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/serial_8250.h> 13#include <linux/serial_8250.h>
14#include <linux/pm.h> 14#include <linux/pm.h>
15#include <asm/io.h>
16#include <asm/machvec.h> 15#include <asm/machvec.h>
17#include <asm/mach/rts7751r2d.h> 16#include <asm/mach/rts7751r2d.h>
17#include <asm/io.h>
18#include <asm/voyagergx.h> 18#include <asm/voyagergx.h>
19 19
20extern void heartbeat_rts7751r2d(void); 20extern void heartbeat_rts7751r2d(void);
diff --git a/arch/sh/boards/renesas/sh7710voipgw/setup.c b/arch/sh/boards/renesas/sh7710voipgw/setup.c
index e57e7afab8c..180810b1210 100644
--- a/arch/sh/boards/renesas/sh7710voipgw/setup.c
+++ b/arch/sh/boards/renesas/sh7710voipgw/setup.c
@@ -13,6 +13,51 @@
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/irq.h> 14#include <asm/irq.h>
15 15
16static struct ipr_data sh7710voipgw_ipr_map[] = {
17 { TIMER2_IRQ, TIMER2_IPR_ADDR, TIMER2_IPR_POS, TIMER2_PRIORITY },
18 { WDT_IRQ, WDT_IPR_ADDR, WDT_IPR_POS, WDT_PRIORITY },
19
20 /* SCIF0 */
21 { SCIF0_ERI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
22 { SCIF0_RXI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
23 { SCIF0_BRI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
24 { SCIF0_TXI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
25
26 /* DMAC-1 */
27 { DMTE0_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
28 { DMTE1_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
29 { DMTE2_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
30 { DMTE3_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
31
32 /* DMAC-2 */
33 { DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY },
34 { DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY },
35
36 /* IPSEC */
37 { IPSEC_IRQ, IPSEC_IPR_ADDR, IPSEC_IPR_POS, IPSEC_PRIORITY },
38
39 /* EDMAC */
40 { EDMAC0_IRQ, EDMAC0_IPR_ADDR, EDMAC0_IPR_POS, EDMAC0_PRIORITY },
41 { EDMAC1_IRQ, EDMAC1_IPR_ADDR, EDMAC1_IPR_POS, EDMAC1_PRIORITY },
42 { EDMAC2_IRQ, EDMAC2_IPR_ADDR, EDMAC2_IPR_POS, EDMAC2_PRIORITY },
43
44 /* SIOF0 */
45 { SIOF0_ERI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
46 { SIOF0_TXI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
47 { SIOF0_RXI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
48 { SIOF0_CCI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
49
50 /* SIOF1 */
51 { SIOF1_ERI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY },
52 { SIOF1_TXI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY },
53 { SIOF1_RXI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY },
54 { SIOF1_CCI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY },
55
56 /* SLIC IRQ's */
57 { IRQ1_IRQ, IRQ1_IPR_ADDR, IRQ1_IPR_POS, IRQ1_PRIORITY },
58 { IRQ2_IRQ, IRQ2_IPR_ADDR, IRQ2_IPR_POS, IRQ2_PRIORITY },
59};
60
16/* 61/*
17 * Initialize IRQ setting 62 * Initialize IRQ setting
18 */ 63 */
@@ -37,65 +82,7 @@ static void __init sh7710voipgw_init_irq(void)
37 */ 82 */
38 ctrl_outw(0x2aa, INTC_ICR1); 83 ctrl_outw(0x2aa, INTC_ICR1);
39 84
40 /* Now make IPR interrupts */ 85 make_ipr_irq(sh7710voipgw_ipr_map, ARRAY_SIZE(sh7710voipgw_ipr_map));
41 make_ipr_irq(TIMER2_IRQ, TIMER2_IPR_ADDR,
42 TIMER2_IPR_POS, TIMER2_PRIORITY);
43 make_ipr_irq(WDT_IRQ, WDT_IPR_ADDR, WDT_IPR_POS, WDT_PRIORITY);
44
45 /* SCIF0 */
46 make_ipr_irq(SCIF0_ERI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS,
47 SCIF0_PRIORITY);
48 make_ipr_irq(SCIF0_RXI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS,
49 SCIF0_PRIORITY);
50 make_ipr_irq(SCIF0_BRI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS,
51 SCIF0_PRIORITY);
52 make_ipr_irq(SCIF0_TXI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS,
53 SCIF0_PRIORITY);
54
55 /* DMAC-1 */
56 make_ipr_irq(DMTE0_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
57 make_ipr_irq(DMTE1_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
58 make_ipr_irq(DMTE2_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
59 make_ipr_irq(DMTE3_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
60
61 /* DMAC-2 */
62 make_ipr_irq(DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY);
63 make_ipr_irq(DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY);
64
65 /* IPSEC */
66 make_ipr_irq(IPSEC_IRQ, IPSEC_IPR_ADDR, IPSEC_IPR_POS, IPSEC_PRIORITY);
67
68 /* EDMAC */
69 make_ipr_irq(EDMAC0_IRQ, EDMAC0_IPR_ADDR, EDMAC0_IPR_POS,
70 EDMAC0_PRIORITY);
71 make_ipr_irq(EDMAC1_IRQ, EDMAC1_IPR_ADDR, EDMAC1_IPR_POS,
72 EDMAC1_PRIORITY);
73 make_ipr_irq(EDMAC2_IRQ, EDMAC2_IPR_ADDR, EDMAC2_IPR_POS,
74 EDMAC2_PRIORITY);
75
76 /* SIOF0 */
77 make_ipr_irq(SIOF0_ERI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS,
78 SIOF0_PRIORITY);
79 make_ipr_irq(SIOF0_TXI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS,
80 SIOF0_PRIORITY);
81 make_ipr_irq(SIOF0_RXI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS,
82 SIOF0_PRIORITY);
83 make_ipr_irq(SIOF0_CCI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS,
84 SIOF0_PRIORITY);
85
86 /* SIOF1 */
87 make_ipr_irq(SIOF1_ERI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS,
88 SIOF1_PRIORITY);
89 make_ipr_irq(SIOF1_TXI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS,
90 SIOF1_PRIORITY);
91 make_ipr_irq(SIOF1_RXI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS,
92 SIOF1_PRIORITY);
93 make_ipr_irq(SIOF1_CCI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS,
94 SIOF1_PRIORITY);
95
96 /* SLIC IRQ's */
97 make_ipr_irq(IRQ1_IRQ, IRQ1_IPR_ADDR, IRQ1_IPR_POS, IRQ1_PRIORITY);
98 make_ipr_irq(IRQ2_IRQ, IRQ2_IPR_ADDR, IRQ2_IPR_POS, IRQ2_PRIORITY);
99} 86}
100 87
101/* 88/*
diff --git a/arch/sh/boards/se/7300/irq.c b/arch/sh/boards/se/7300/irq.c
index ad1034f98a2..1279d776d60 100644
--- a/arch/sh/boards/se/7300/irq.c
+++ b/arch/sh/boards/se/7300/irq.c
@@ -13,6 +13,17 @@
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/se7300.h> 14#include <asm/se7300.h>
15 15
16static struct ipr_data se7300_ipr_map[] = {
17 /* PC_IRQ[0-3] -> IRQ0 (32) */
18 { IRQ0_IRQ, IRQ0_IPR_ADDR, IRQ0_IPR_POS, 0x0f - IRQ0_IRQ },
19 /* A_IRQ[0-3] -> IRQ1 (33) */
20 { IRQ1_IRQ, IRQ1_IPR_ADDR, IRQ1_IPR_POS, 0x0f - IRQ1_IRQ },
21 { SIOF0_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
22 { DMTE2_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY },
23 { DMTE3_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY },
24 { VIO_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY },
25};
26
16/* 27/*
17 * Initialize IRQ setting 28 * Initialize IRQ setting
18 */ 29 */
@@ -23,14 +34,7 @@ init_7300se_IRQ(void)
23 ctrl_outw(0xa000, INTC_ICR1); /* IRQ mode; IRQ0,1 enable. */ 34 ctrl_outw(0xa000, INTC_ICR1); /* IRQ mode; IRQ0,1 enable. */
24 ctrl_outw(0x0000, PORT_PFCR); /* use F for IRQ[3:0] and SIU. */ 35 ctrl_outw(0x0000, PORT_PFCR); /* use F for IRQ[3:0] and SIU. */
25 36
26 /* PC_IRQ[0-3] -> IRQ0 (32) */ 37 make_ipr_irq(se7300_ipr_map, ARRAY_SIZE(se7300_ipr_map));
27 make_ipr_irq(IRQ0_IRQ, IRQ0_IPR_ADDR, IRQ0_IPR_POS, 0x0f - IRQ0_IRQ);
28 /* A_IRQ[0-3] -> IRQ1 (33) */
29 make_ipr_irq(IRQ1_IRQ, IRQ1_IPR_ADDR, IRQ1_IPR_POS, 0x0f - IRQ1_IRQ);
30 make_ipr_irq(SIOF0_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY);
31 make_ipr_irq(DMTE2_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
32 make_ipr_irq(DMTE3_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
33 make_ipr_irq(VIO_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY);
34 38
35 ctrl_outw(0x2000, PA_MRSHPC + 0x0c); /* mrshpc irq enable */ 39 ctrl_outw(0x2000, PA_MRSHPC + 0x0c); /* mrshpc irq enable */
36} 40}
diff --git a/arch/sh/boards/se/73180/irq.c b/arch/sh/boards/se/73180/irq.c
index 2c62b8ea350..e7200c56bb4 100644
--- a/arch/sh/boards/se/73180/irq.c
+++ b/arch/sh/boards/se/73180/irq.c
@@ -87,13 +87,38 @@ shmse_irq_demux(int irq)
87 return irq; 87 return irq;
88} 88}
89 89
90static struct ipr_data se73180_siof0_ipr_map[] = {
91 { SIOF0_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
92};
93static struct ipr_data se73180_vpu_ipr_map[] = {
94 { VPU_IRQ, VPU_IPR_ADDR, VPU_IPR_POS, 8 },
95};
96static struct ipr_data se73180_other_ipr_map[] = {
97 { DMTE2_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY },
98 { DMTE3_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY },
99 { DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY },
100 { IIC0_ALI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY },
101 { IIC0_TACKI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY },
102 { IIC0_WAITI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY },
103 { IIC0_DTEI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY },
104 { SIOF0_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
105 { SIU_IRQ, SIU_IPR_ADDR, SIU_IPR_POS, SIU_PRIORITY },
106
107 /* VIO interrupt */
108 { CEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY },
109 { BEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY },
110 { VEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY },
111
112 { LCDC_IRQ, LCDC_IPR_ADDR, LCDC_IPR_POS, LCDC_PRIORITY },
113};
114
90/* 115/*
91 * Initialize IRQ setting 116 * Initialize IRQ setting
92 */ 117 */
93void __init 118void __init
94init_73180se_IRQ(void) 119init_73180se_IRQ(void)
95{ 120{
96 make_ipr_irq(SIOF0_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY); 121 make_ipr_irq(se73180_siof0_ipr_map, ARRAY_SIZE(se73180_siof0_ipr_map));
97 122
98 ctrl_outw(0x2000, 0xb03fffec); /* mrshpc irq enable */ 123 ctrl_outw(0x2000, 0xb03fffec); /* mrshpc irq enable */
99 ctrl_outw(0x2000, 0xb07fffec); /* mrshpc irq enable */ 124 ctrl_outw(0x2000, 0xb07fffec); /* mrshpc irq enable */
@@ -101,27 +126,11 @@ init_73180se_IRQ(void)
101 ctrl_outw(2 << ((7 - 5) * 2), INTC_ICR1); /* low-level irq */ 126 ctrl_outw(2 << ((7 - 5) * 2), INTC_ICR1); /* low-level irq */
102 make_intreq_irq(10); 127 make_intreq_irq(10);
103 128
104 make_ipr_irq(VPU_IRQ, VPU_IPR_ADDR, VPU_IPR_POS, 8); 129 make_ipr_irq(se73180_vpu_ipr_map, ARRAY_SIZE(se73180_vpu_ipr_map));
105 130
106 ctrl_outb(0x0f, INTC_IMCR5); /* enable SCIF IRQ */ 131 ctrl_outb(0x0f, INTC_IMCR5); /* enable SCIF IRQ */
107 132
108 make_ipr_irq(DMTE2_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY); 133 make_ipr_irq(se73180_other_ipr_map, ARRAY_SIZE(se73180_other_ipr_map));
109 make_ipr_irq(DMTE3_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
110 make_ipr_irq(DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY);
111 make_ipr_irq(IIC0_ALI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY);
112 make_ipr_irq(IIC0_TACKI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS,
113 IIC0_PRIORITY);
114 make_ipr_irq(IIC0_WAITI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS,
115 IIC0_PRIORITY);
116 make_ipr_irq(IIC0_DTEI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY);
117 make_ipr_irq(SIOF0_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY);
118 make_ipr_irq(SIU_IRQ, SIU_IPR_ADDR, SIU_IPR_POS, SIU_PRIORITY);
119
120 /* VIO interrupt */
121 make_ipr_irq(CEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY);
122 make_ipr_irq(BEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY);
123 make_ipr_irq(VEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY);
124 134
125 make_ipr_irq(LCDC_IRQ, LCDC_IPR_ADDR, LCDC_IPR_POS, LCDC_PRIORITY);
126 ctrl_outw(0x2000, PA_MRSHPC + 0x0c); /* mrshpc irq enable */ 135 ctrl_outw(0x2000, PA_MRSHPC + 0x0c); /* mrshpc irq enable */
127} 136}
diff --git a/arch/sh/boards/se/7343/irq.c b/arch/sh/boards/se/7343/irq.c
index 288b62f5941..360153ecc55 100644
--- a/arch/sh/boards/se/7343/irq.c
+++ b/arch/sh/boards/se/7343/irq.c
@@ -102,6 +102,51 @@ shmse_irq_demux(int irq)
102static struct irqaction irq5 = { no_action, 0, CPU_MASK_NONE, "IRQ5-cascade", 102static struct irqaction irq5 = { no_action, 0, CPU_MASK_NONE, "IRQ5-cascade",
103 NULL, NULL}; 103 NULL, NULL};
104 104
105static struct ipr_data se7343_irq5_ipr_map[] = {
106 { IRQ5_IRQ, IRQ5_IPR_ADDR+2, IRQ5_IPR_POS, IRQ5_PRIORITY },
107};
108static struct ipr_data se7343_siof0_vpu_ipr_map[] = {
109 { SIOF0_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
110 { VPU_IRQ, VPU_IPR_ADDR, VPU_IPR_POS, 8 },
111};
112static struct ipr_data se7343_other_ipr_map[] = {
113 { DMTE0_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY },
114 { DMTE1_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY },
115 { DMTE2_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY },
116 { DMTE3_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY },
117 { DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY },
118 { DMTE5_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY },
119
120 /* I2C block */
121 { IIC0_ALI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY },
122 { IIC0_TACKI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY },
123 { IIC0_WAITI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY },
124 { IIC0_DTEI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY },
125
126 { IIC1_ALI_IRQ, IIC1_IPR_ADDR, IIC1_IPR_POS, IIC1_PRIORITY },
127 { IIC1_TACKI_IRQ, IIC1_IPR_ADDR, IIC1_IPR_POS, IIC1_PRIORITY },
128 { IIC1_WAITI_IRQ, IIC1_IPR_ADDR, IIC1_IPR_POS, IIC1_PRIORITY },
129 { IIC1_DTEI_IRQ, IIC1_IPR_ADDR, IIC1_IPR_POS, IIC1_PRIORITY },
130
131 /* SIOF */
132 { SIOF0_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
133
134 /* SIU */
135 { SIU_IRQ, SIU_IPR_ADDR, SIU_IPR_POS, SIU_PRIORITY },
136
137 /* VIO interrupt */
138 { CEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY },
139 { BEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY },
140 { VEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY },
141
142 /*MFI interrupt*/
143
144 { MFI_IRQ, MFI_IPR_ADDR, MFI_IPR_POS, MFI_PRIORITY },
145
146 /* LCD controller */
147 { LCDC_IRQ, LCDC_IPR_ADDR, LCDC_IPR_POS, LCDC_PRIORITY },
148};
149
105/* 150/*
106 * Initialize IRQ setting 151 * Initialize IRQ setting
107 */ 152 */
@@ -138,54 +183,17 @@ init_7343se_IRQ(void)
138 /* Setup all external interrupts to be active low */ 183 /* Setup all external interrupts to be active low */
139 ctrl_outw(0xaaaa, INTC_ICR1); 184 ctrl_outw(0xaaaa, INTC_ICR1);
140 185
141 make_ipr_irq(IRQ5_IRQ, IRQ5_IPR_ADDR+2, IRQ5_IPR_POS, IRQ5_PRIORITY); 186 make_ipr_irq(se7343_irq5_ipr_map, ARRAY_SIZE(se7343_irq5_ipr_map));
187
142 setup_irq(IRQ5_IRQ, &irq5); 188 setup_irq(IRQ5_IRQ, &irq5);
143 /* Set port control to use IRQ5 */ 189 /* Set port control to use IRQ5 */
144 *(u16 *)0xA4050108 &= ~0xc; 190 *(u16 *)0xA4050108 &= ~0xc;
145 191
146 make_ipr_irq(SIOF0_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY); 192 make_ipr_irq(se7343_siof0_vpu_ipr_map, ARRAY_SIZE(se7343_siof0_vpu_ipr_map));
147 make_ipr_irq(VPU_IRQ, VPU_IPR_ADDR, VPU_IPR_POS, 8);
148 193
149 ctrl_outb(0x0f, INTC_IMCR5); /* enable SCIF IRQ */ 194 ctrl_outb(0x0f, INTC_IMCR5); /* enable SCIF IRQ */
150 195
151 make_ipr_irq(DMTE0_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY); 196 make_ipr_irq(se7343_other_ipr_map, ARRAY_SIZE(se7343_other_ipr_map));
152 make_ipr_irq(DMTE1_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
153 make_ipr_irq(DMTE2_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
154 make_ipr_irq(DMTE3_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
155 make_ipr_irq(DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY);
156 make_ipr_irq(DMTE5_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY);
157
158 /* I2C block */
159 make_ipr_irq(IIC0_ALI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY);
160 make_ipr_irq(IIC0_TACKI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS,
161 IIC0_PRIORITY);
162 make_ipr_irq(IIC0_WAITI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS,
163 IIC0_PRIORITY);
164 make_ipr_irq(IIC0_DTEI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY);
165
166 make_ipr_irq(IIC1_ALI_IRQ, IIC1_IPR_ADDR, IIC1_IPR_POS, IIC1_PRIORITY);
167 make_ipr_irq(IIC1_TACKI_IRQ, IIC1_IPR_ADDR, IIC1_IPR_POS,
168 IIC1_PRIORITY);
169 make_ipr_irq(IIC1_WAITI_IRQ, IIC1_IPR_ADDR, IIC1_IPR_POS,
170 IIC1_PRIORITY);
171 make_ipr_irq(IIC1_DTEI_IRQ, IIC1_IPR_ADDR, IIC1_IPR_POS, IIC1_PRIORITY);
172
173 /* SIOF */
174 make_ipr_irq(SIOF0_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY);
175 197
176 /* SIU */
177 make_ipr_irq(SIU_IRQ, SIU_IPR_ADDR, SIU_IPR_POS, SIU_PRIORITY);
178
179 /* VIO interrupt */
180 make_ipr_irq(CEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY);
181 make_ipr_irq(BEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY);
182 make_ipr_irq(VEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY);
183
184 /*MFI interrupt*/
185
186 make_ipr_irq(MFI_IRQ, MFI_IPR_ADDR, MFI_IPR_POS, MFI_PRIORITY);
187
188 /* LCD controller */
189 make_ipr_irq(LCDC_IRQ, LCDC_IPR_ADDR, LCDC_IPR_POS, LCDC_PRIORITY);
190 ctrl_outw(0x2000, PA_MRSHPC + 0x0c); /* mrshpc irq enable */ 198 ctrl_outw(0x2000, PA_MRSHPC + 0x0c); /* mrshpc irq enable */
191} 199}
diff --git a/arch/sh/boards/se/770x/irq.c b/arch/sh/boards/se/770x/irq.c
index cff6700bbaf..fcd7cd7fa05 100644
--- a/arch/sh/boards/se/770x/irq.c
+++ b/arch/sh/boards/se/770x/irq.c
@@ -13,6 +13,48 @@
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/se.h> 14#include <asm/se.h>
15 15
16static struct ipr_data se770x_ipr_map[] = {
17#if defined(CONFIG_CPU_SUBTYPE_SH7705)
18 /* This is default value */
19 { 0xf-0x2, BCR_ILCRA, 2, 0x2 },
20 { 0xf-0xa, BCR_ILCRA, 1, 0xa },
21 { 0xf-0x5, BCR_ILCRB, 0, 0x5 },
22 { 0xf-0x8, BCR_ILCRC, 1, 0x8 },
23 { 0xf-0xc, BCR_ILCRC, 0, 0xc },
24 { 0xf-0xe, BCR_ILCRD, 3, 0xe },
25 { 0xf-0x3, BCR_ILCRD, 1, 0x3 }, /* LAN */
26 { 0xf-0xd, BCR_ILCRE, 2, 0xd },
27 { 0xf-0x9, BCR_ILCRE, 1, 0x9 },
28 { 0xf-0x1, BCR_ILCRE, 0, 0x1 },
29 { 0xf-0xf, BCR_ILCRF, 3, 0xf },
30 { 0xf-0xb, BCR_ILCRF, 1, 0xb },
31 { 0xf-0x7, BCR_ILCRG, 3, 0x7 },
32 { 0xf-0x6, BCR_ILCRG, 2, 0x6 },
33 { 0xf-0x4, BCR_ILCRG, 1, 0x4 },
34#else
35 { 14, BCR_ILCRA, 2, 0x0f-14 },
36 { 12, BCR_ILCRA, 1, 0x0f-12 },
37 { 8, BCR_ILCRB, 1, 0x0f- 8 },
38 { 6, BCR_ILCRC, 3, 0x0f- 6 },
39 { 5, BCR_ILCRC, 2, 0x0f- 5 },
40 { 4, BCR_ILCRC, 1, 0x0f- 4 },
41 { 3, BCR_ILCRC, 0, 0x0f- 3 },
42 { 1, BCR_ILCRD, 3, 0x0f- 1 },
43
44 { 10, BCR_ILCRD, 1, 0x0f-10 }, /* LAN */
45
46 { 0, BCR_ILCRE, 3, 0x0f- 0 }, /* PCIRQ3 */
47 { 11, BCR_ILCRE, 2, 0x0f-11 }, /* PCIRQ2 */
48 { 9, BCR_ILCRE, 1, 0x0f- 9 }, /* PCIRQ1 */
49 { 7, BCR_ILCRE, 0, 0x0f- 7 }, /* PCIRQ0 */
50
51 /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */
52 /* NOTE: #2 and #13 are not used on PC */
53 { 13, BCR_ILCRG, 1, 0x0f-13 }, /* SLOTIRQ2 */
54 { 2, BCR_ILCRG, 0, 0x0f- 2 }, /* SLOTIRQ1 */
55#endif
56};
57
16/* 58/*
17 * Initialize IRQ setting 59 * Initialize IRQ setting
18 */ 60 */
@@ -38,42 +80,6 @@ void __init init_se_IRQ(void)
38 ctrl_outw(0, BCR_ILCRE); 80 ctrl_outw(0, BCR_ILCRE);
39 ctrl_outw(0, BCR_ILCRF); 81 ctrl_outw(0, BCR_ILCRF);
40 ctrl_outw(0, BCR_ILCRG); 82 ctrl_outw(0, BCR_ILCRG);
41 /* This is default value */
42 make_ipr_irq(0xf-0x2, BCR_ILCRA, 2, 0x2);
43 make_ipr_irq(0xf-0xa, BCR_ILCRA, 1, 0xa);
44 make_ipr_irq(0xf-0x5, BCR_ILCRB, 0, 0x5);
45 make_ipr_irq(0xf-0x8, BCR_ILCRC, 1, 0x8);
46 make_ipr_irq(0xf-0xc, BCR_ILCRC, 0, 0xc);
47 make_ipr_irq(0xf-0xe, BCR_ILCRD, 3, 0xe);
48 make_ipr_irq(0xf-0x3, BCR_ILCRD, 1, 0x3); /* LAN */
49 make_ipr_irq(0xf-0xd, BCR_ILCRE, 2, 0xd);
50 make_ipr_irq(0xf-0x9, BCR_ILCRE, 1, 0x9);
51 make_ipr_irq(0xf-0x1, BCR_ILCRE, 0, 0x1);
52 make_ipr_irq(0xf-0xf, BCR_ILCRF, 3, 0xf);
53 make_ipr_irq(0xf-0xb, BCR_ILCRF, 1, 0xb);
54 make_ipr_irq(0xf-0x7, BCR_ILCRG, 3, 0x7);
55 make_ipr_irq(0xf-0x6, BCR_ILCRG, 2, 0x6);
56 make_ipr_irq(0xf-0x4, BCR_ILCRG, 1, 0x4);
57#else
58 make_ipr_irq(14, BCR_ILCRA, 2, 0x0f-14);
59 make_ipr_irq(12, BCR_ILCRA, 1, 0x0f-12);
60 make_ipr_irq( 8, BCR_ILCRB, 1, 0x0f- 8);
61 make_ipr_irq( 6, BCR_ILCRC, 3, 0x0f- 6);
62 make_ipr_irq( 5, BCR_ILCRC, 2, 0x0f- 5);
63 make_ipr_irq( 4, BCR_ILCRC, 1, 0x0f- 4);
64 make_ipr_irq( 3, BCR_ILCRC, 0, 0x0f- 3);
65 make_ipr_irq( 1, BCR_ILCRD, 3, 0x0f- 1);
66
67 make_ipr_irq(10, BCR_ILCRD, 1, 0x0f-10); /* LAN */
68
69 make_ipr_irq( 0, BCR_ILCRE, 3, 0x0f- 0); /* PCIRQ3 */
70 make_ipr_irq(11, BCR_ILCRE, 2, 0x0f-11); /* PCIRQ2 */
71 make_ipr_irq( 9, BCR_ILCRE, 1, 0x0f- 9); /* PCIRQ1 */
72 make_ipr_irq( 7, BCR_ILCRE, 0, 0x0f- 7); /* PCIRQ0 */
73
74 /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */
75 /* NOTE: #2 and #13 are not used on PC */
76 make_ipr_irq(13, BCR_ILCRG, 1, 0x0f-13); /* SLOTIRQ2 */
77 make_ipr_irq( 2, BCR_ILCRG, 0, 0x0f- 2); /* SLOTIRQ1 */
78#endif 83#endif
84 make_ipr_irq(se770x_ipr_map, ARRAY_SIZE(se770x_ipr_map));
79} 85}
diff --git a/arch/sh/boards/se/7751/irq.c b/arch/sh/boards/se/7751/irq.c
index c607b0a4847..e4c63a48296 100644
--- a/arch/sh/boards/se/7751/irq.c
+++ b/arch/sh/boards/se/7751/irq.c
@@ -14,53 +14,50 @@
14#include <asm/irq.h> 14#include <asm/irq.h>
15#include <asm/se7751.h> 15#include <asm/se7751.h>
16 16
17/* 17static struct ipr_data se7751_ipr_map[] = {
18 * Initialize IRQ setting
19 */
20void __init init_7751se_IRQ(void)
21{
22
23 /* Leave old Solution Engine code in for reference. */ 18 /* Leave old Solution Engine code in for reference. */
24#if defined(CONFIG_SH_SOLUTION_ENGINE) 19#if defined(CONFIG_SH_SOLUTION_ENGINE)
25 /* 20 /*
26 * Super I/O (Just mimic PC): 21 * Super I/O (Just mimic PC):
27 * 1: keyboard 22 * 1: keyboard
28 * 3: serial 0 23 * 3: serial 0
29 * 4: serial 1 24 * 4: serial 1
30 * 5: printer 25 * 5: printer
31 * 6: floppy 26 * 6: floppy
32 * 8: rtc 27 * 8: rtc
33 * 12: mouse 28 * 12: mouse
34 * 14: ide0 29 * 14: ide0
35 */ 30 */
36 make_ipr_irq(14, BCR_ILCRA, 2, 0x0f-14); 31 { 14, BCR_ILCRA, 2, 0x0f-14 },
37 make_ipr_irq(12, BCR_ILCRA, 1, 0x0f-12); 32 { 12, BCR_ILCRA, 1, 0x0f-12 },
38 make_ipr_irq( 8, BCR_ILCRB, 1, 0x0f- 8); 33 { 8, BCR_ILCRB, 1, 0x0f- 8 },
39 make_ipr_irq( 6, BCR_ILCRC, 3, 0x0f- 6); 34 { 6, BCR_ILCRC, 3, 0x0f- 6 },
40 make_ipr_irq( 5, BCR_ILCRC, 2, 0x0f- 5); 35 { 5, BCR_ILCRC, 2, 0x0f- 5 },
41 make_ipr_irq( 4, BCR_ILCRC, 1, 0x0f- 4); 36 { 4, BCR_ILCRC, 1, 0x0f- 4 },
42 make_ipr_irq( 3, BCR_ILCRC, 0, 0x0f- 3); 37 { 3, BCR_ILCRC, 0, 0x0f- 3 },
43 make_ipr_irq( 1, BCR_ILCRD, 3, 0x0f- 1); 38 { 1, BCR_ILCRD, 3, 0x0f- 1 },
44 39
45 make_ipr_irq(10, BCR_ILCRD, 1, 0x0f-10); /* LAN */ 40 { 10, BCR_ILCRD, 1, 0x0f-10 }, /* LAN */
46 41
47 make_ipr_irq( 0, BCR_ILCRE, 3, 0x0f- 0); /* PCIRQ3 */ 42 { 0, BCR_ILCRE, 3, 0x0f- 0 }, /* PCIRQ3 */
48 make_ipr_irq(11, BCR_ILCRE, 2, 0x0f-11); /* PCIRQ2 */ 43 { 11, BCR_ILCRE, 2, 0x0f-11 }, /* PCIRQ2 */
49 make_ipr_irq( 9, BCR_ILCRE, 1, 0x0f- 9); /* PCIRQ1 */ 44 { 9, BCR_ILCRE, 1, 0x0f- 9 }, /* PCIRQ1 */
50 make_ipr_irq( 7, BCR_ILCRE, 0, 0x0f- 7); /* PCIRQ0 */ 45 { 7, BCR_ILCRE, 0, 0x0f- 7 }, /* PCIRQ0 */
51 46
52 /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */ 47 /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */
53 /* NOTE: #2 and #13 are not used on PC */ 48 /* NOTE: #2 and #13 are not used on PC */
54 make_ipr_irq(13, BCR_ILCRG, 1, 0x0f-13); /* SLOTIRQ2 */ 49 { 13, BCR_ILCRG, 1, 0x0f-13 }, /* SLOTIRQ2 */
55 make_ipr_irq( 2, BCR_ILCRG, 0, 0x0f- 2); /* SLOTIRQ1 */ 50 { 2, BCR_ILCRG, 0, 0x0f- 2 }, /* SLOTIRQ1 */
56
57#elif defined(CONFIG_SH_7751_SOLUTION_ENGINE) 51#elif defined(CONFIG_SH_7751_SOLUTION_ENGINE)
58 52 { 13, BCR_ILCRD, 3, 2 },
59 make_ipr_irq(13, BCR_ILCRD, 3, 2); 53 /* Add additional entries here as drivers are added and tested. */
60
61 /* Add additional calls to make_ipr_irq() as drivers are added
62 * and tested.
63 */
64#endif 54#endif
55};
65 56
57/*
58 * Initialize IRQ setting
59 */
60void __init init_7751se_IRQ(void)
61{
62 make_ipr_irq(se7751_ipr_map, ARRAY_SIZE(se7751_ipr_map));
66} 63}
diff --git a/arch/sh/boards/sh03/setup.c b/arch/sh/boards/sh03/setup.c
index 137e2ba9243..5ad1e19771b 100644
--- a/arch/sh/boards/sh03/setup.c
+++ b/arch/sh/boards/sh03/setup.c
@@ -14,14 +14,17 @@
14#include <asm/sh03/sh03.h> 14#include <asm/sh03/sh03.h>
15#include <asm/addrspace.h> 15#include <asm/addrspace.h>
16 16
17static struct ipr_data sh03_ipr_map[] = {
18 { IRL0_IRQ, IRL0_IPR_ADDR, IRL0_IPR_POS, IRL0_PRIORITY },
19 { IRL1_IRQ, IRL1_IPR_ADDR, IRL1_IPR_POS, IRL1_PRIORITY },
20 { IRL2_IRQ, IRL2_IPR_ADDR, IRL2_IPR_POS, IRL2_PRIORITY },
21 { IRL3_IRQ, IRL3_IPR_ADDR, IRL3_IPR_POS, IRL3_PRIORITY },
22};
23
17static void __init init_sh03_IRQ(void) 24static void __init init_sh03_IRQ(void)
18{ 25{
19 ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR); 26 ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR);
20 27 make_ipr_irq(sh03_ipr_map, ARRAY_SIZE(sh03_ipr_map));
21 make_ipr_irq(IRL0_IRQ, IRL0_IPR_ADDR, IRL0_IPR_POS, IRL0_PRIORITY);
22 make_ipr_irq(IRL1_IRQ, IRL1_IPR_ADDR, IRL1_IPR_POS, IRL1_PRIORITY);
23 make_ipr_irq(IRL2_IRQ, IRL2_IPR_ADDR, IRL2_IPR_POS, IRL2_PRIORITY);
24 make_ipr_irq(IRL3_IRQ, IRL3_IPR_ADDR, IRL3_IPR_POS, IRL3_PRIORITY);
25} 28}
26 29
27extern void *cf_io_base; 30extern void *cf_io_base;
diff --git a/arch/sh/boards/shmin/setup.c b/arch/sh/boards/shmin/setup.c
index 2f0c19706cf..a31a1d1e268 100644
--- a/arch/sh/boards/shmin/setup.c
+++ b/arch/sh/boards/shmin/setup.c
@@ -7,7 +7,7 @@
7 */ 7 */
8#include <linux/init.h> 8#include <linux/init.h>
9#include <asm/machvec.h> 9#include <asm/machvec.h>
10#include <asm/shmin/shmin.h> 10#include <asm/shmin.h>
11#include <asm/clock.h> 11#include <asm/clock.h>
12#include <asm/irq.h> 12#include <asm/irq.h>
13#include <asm/io.h> 13#include <asm/io.h>
diff --git a/arch/sh/boards/snapgear/setup.c b/arch/sh/boards/snapgear/setup.c
index 540d0bf1644..650fb364594 100644
--- a/arch/sh/boards/snapgear/setup.c
+++ b/arch/sh/boards/snapgear/setup.c
@@ -68,6 +68,13 @@ module_init(eraseconfig_init);
68 * IRL3 = crypto 68 * IRL3 = crypto
69 */ 69 */
70 70
71static struct ipr_data snapgear_ipr_map[] = {
72 make_ipr_irq(IRL0_IRQ, IRL0_IPR_ADDR, IRL0_IPR_POS, IRL0_PRIORITY);
73 make_ipr_irq(IRL1_IRQ, IRL1_IPR_ADDR, IRL1_IPR_POS, IRL1_PRIORITY);
74 make_ipr_irq(IRL2_IRQ, IRL2_IPR_ADDR, IRL2_IPR_POS, IRL2_PRIORITY);
75 make_ipr_irq(IRL3_IRQ, IRL3_IPR_ADDR, IRL3_IPR_POS, IRL3_PRIORITY);
76};
77
71static void __init init_snapgear_IRQ(void) 78static void __init init_snapgear_IRQ(void)
72{ 79{
73 /* enable individual interrupt mode for externals */ 80 /* enable individual interrupt mode for externals */
@@ -75,10 +82,7 @@ static void __init init_snapgear_IRQ(void)
75 82
76 printk("Setup SnapGear IRQ/IPR ...\n"); 83 printk("Setup SnapGear IRQ/IPR ...\n");
77 84
78 make_ipr_irq(IRL0_IRQ, IRL0_IPR_ADDR, IRL0_IPR_POS, IRL0_PRIORITY); 85 make_ipr_irq(snapgear_ipr_map, ARRAY_SIZE(snapgear_ipr_map));
79 make_ipr_irq(IRL1_IRQ, IRL1_IPR_ADDR, IRL1_IPR_POS, IRL1_PRIORITY);
80 make_ipr_irq(IRL2_IRQ, IRL2_IPR_ADDR, IRL2_IPR_POS, IRL2_PRIORITY);
81 make_ipr_irq(IRL3_IRQ, IRL3_IPR_ADDR, IRL3_IPR_POS, IRL3_PRIORITY);
82} 86}
83 87
84/* 88/*
diff --git a/arch/sh/boards/titan/setup.c b/arch/sh/boards/titan/setup.c
index 52b66d8b8d2..a6046d93758 100644
--- a/arch/sh/boards/titan/setup.c
+++ b/arch/sh/boards/titan/setup.c
@@ -9,15 +9,19 @@
9 9
10extern void __init pcibios_init_platform(void); 10extern void __init pcibios_init_platform(void);
11 11
12static struct ipr_data titan_ipr_map[] = {
13 { TITAN_IRQ_WAN, IRL0_IPR_ADDR, IRL0_IPR_POS, IRL0_PRIORITY },
14 { TITAN_IRQ_LAN, IRL1_IPR_ADDR, IRL1_IPR_POS, IRL1_PRIORITY },
15 { TITAN_IRQ_MPCIA, IRL2_IPR_ADDR, IRL2_IPR_POS, IRL2_PRIORITY },
16 { TITAN_IRQ_USB, IRL3_IPR_ADDR, IRL3_IPR_POS, IRL3_PRIORITY },
17};
18
12static void __init init_titan_irq(void) 19static void __init init_titan_irq(void)
13{ 20{
14 /* enable individual interrupt mode for externals */ 21 /* enable individual interrupt mode for externals */
15 ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR); 22 ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR);
16 23
17 make_ipr_irq( TITAN_IRQ_WAN, IRL0_IPR_ADDR, IRL0_IPR_POS, IRL0_PRIORITY); /* PCIRQ0 */ 24 make_ipr_irq(titan_ipr_map, ARRAY_SIZE(titan_ipr_map));
18 make_ipr_irq( TITAN_IRQ_LAN, IRL1_IPR_ADDR, IRL1_IPR_POS, IRL1_PRIORITY); /* PCIRQ1 */
19 make_ipr_irq( TITAN_IRQ_MPCIA, IRL2_IPR_ADDR, IRL2_IPR_POS, IRL2_PRIORITY); /* PCIRQ2 */
20 make_ipr_irq( TITAN_IRQ_USB, IRL3_IPR_ADDR, IRL3_IPR_POS, IRL3_PRIORITY); /* PCIRQ3 */
21} 25}
22 26
23struct sh_machine_vector mv_titan __initmv = { 27struct sh_machine_vector mv_titan __initmv = {
diff --git a/arch/sh/cchips/voyagergx/irq.c b/arch/sh/cchips/voyagergx/irq.c
index bf1b28feca0..f7ea700d05a 100644
--- a/arch/sh/cchips/voyagergx/irq.c
+++ b/arch/sh/cchips/voyagergx/irq.c
@@ -17,29 +17,18 @@
17 17
18 Copyright 2003 (c) Lineo uSolutions,Inc. 18 Copyright 2003 (c) Lineo uSolutions,Inc.
19*/ 19*/
20/* -------------------------------------------------------------------- */
21
22#undef DEBUG
23
24#include <linux/sched.h>
25#include <linux/module.h>
26#include <linux/kernel.h>
27#include <linux/param.h>
28#include <linux/ioport.h>
29#include <linux/interrupt.h> 20#include <linux/interrupt.h>
30#include <linux/init.h> 21#include <linux/init.h>
31#include <linux/irq.h> 22#include <linux/io.h>
32
33#include <asm/io.h>
34#include <asm/irq.h>
35#include <asm/voyagergx.h> 23#include <asm/voyagergx.h>
24#include <asm/rts7751r2d.h>
36 25
37static void disable_voyagergx_irq(unsigned int irq) 26static void disable_voyagergx_irq(unsigned int irq)
38{ 27{
39 unsigned long val; 28 unsigned long val;
40 unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE); 29 unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE);
41 30
42 pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask); 31 pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask);
43 val = inl(VOYAGER_INT_MASK); 32 val = inl(VOYAGER_INT_MASK);
44 val &= ~mask; 33 val &= ~mask;
45 outl(val, VOYAGER_INT_MASK); 34 outl(val, VOYAGER_INT_MASK);
@@ -50,7 +39,7 @@ static void enable_voyagergx_irq(unsigned int irq)
50 unsigned long val; 39 unsigned long val;
51 unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE); 40 unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE);
52 41
53 pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask); 42 pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask);
54 val = inl(VOYAGER_INT_MASK); 43 val = inl(VOYAGER_INT_MASK);
55 val |= mask; 44 val |= mask;
56 outl(val, VOYAGER_INT_MASK); 45 outl(val, VOYAGER_INT_MASK);
@@ -137,7 +126,7 @@ int voyagergx_irq_demux(int irq)
137 } else { 126 } else {
138 printk("Unexpected IRQ irq = %d status = 0x%08lx\n", irq, val); 127 printk("Unexpected IRQ irq = %d status = 0x%08lx\n", irq, val);
139 } 128 }
140 pr_debug("voyagergx_irq_demux %d \n", i); 129 pr_debug("voyagergx_irq_demux %ld\n", i);
141#else 130#else
142 for (bit = 1, i = 0 ; i < VOYAGER_IRQ_NUM ; bit <<= 1, i++) 131 for (bit = 1, i = 0 ; i < VOYAGER_IRQ_NUM ; bit <<= 1, i++)
143 if (val & bit) 132 if (val & bit)
@@ -185,4 +174,3 @@ void __init setup_voyagergx_irq(void)
185 174
186 setup_irq(IRQ_VOYAGER, &irq0); 175 setup_irq(IRQ_VOYAGER, &irq0);
187} 176}
188
diff --git a/arch/sh/configs/r7780rp_defconfig b/arch/sh/configs/r7780rp_defconfig
index 2470364948e..34e2046c321 100644
--- a/arch/sh/configs/r7780rp_defconfig
+++ b/arch/sh/configs/r7780rp_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.18 3# Linux kernel version: 2.6.19-rc3
4# Tue Oct 3 11:32:47 2006 4# Tue Oct 31 12:32:06 2006
5# 5#
6CONFIG_SUPERH=y 6CONFIG_SUPERH=y
7CONFIG_RWSEM_GENERIC_SPINLOCK=y 7CONFIG_RWSEM_GENERIC_SPINLOCK=y
@@ -10,6 +10,7 @@ CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_GENERIC_IRQ_PROBE=y 11CONFIG_GENERIC_IRQ_PROBE=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y 12CONFIG_GENERIC_CALIBRATE_DELAY=y
13# CONFIG_GENERIC_TIME is not set
13CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 14CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
14 15
15# 16#
@@ -178,7 +179,7 @@ CONFIG_MMU=y
178CONFIG_PAGE_OFFSET=0x80000000 179CONFIG_PAGE_OFFSET=0x80000000
179CONFIG_MEMORY_START=0x08000000 180CONFIG_MEMORY_START=0x08000000
180CONFIG_MEMORY_SIZE=0x08000000 181CONFIG_MEMORY_SIZE=0x08000000
181CONFIG_32BIT=y 182# CONFIG_32BIT is not set
182CONFIG_VSYSCALL=y 183CONFIG_VSYSCALL=y
183CONFIG_HUGETLB_PAGE_SIZE_64K=y 184CONFIG_HUGETLB_PAGE_SIZE_64K=y
184# CONFIG_HUGETLB_PAGE_SIZE_1MB is not set 185# CONFIG_HUGETLB_PAGE_SIZE_1MB is not set
@@ -229,9 +230,7 @@ CONFIG_SH_PCLK_FREQ=32000000
229# 230#
230# DMA support 231# DMA support
231# 232#
232CONFIG_SH_DMA=y 233# CONFIG_SH_DMA is not set
233CONFIG_NR_ONCHIP_DMA_CHANNELS=6
234# CONFIG_NR_DMA_CHANNELS_BOOL is not set
235 234
236# 235#
237# Companion Chips 236# Companion Chips
@@ -259,7 +258,7 @@ CONFIG_ZERO_PAGE_OFFSET=0x00001000
259CONFIG_BOOT_LINK_OFFSET=0x00800000 258CONFIG_BOOT_LINK_OFFSET=0x00800000
260# CONFIG_UBC_WAKEUP is not set 259# CONFIG_UBC_WAKEUP is not set
261CONFIG_CMDLINE_BOOL=y 260CONFIG_CMDLINE_BOOL=y
262CONFIG_CMDLINE="mem=128M console=ttySC0,115200 root=/dev/hda1" 261CONFIG_CMDLINE="mem=128M console=ttySC0,115200 root=/dev/sda1"
263 262
264# 263#
265# Bus options 264# Bus options
@@ -336,6 +335,7 @@ CONFIG_IP_PNP_DHCP=y
336# CONFIG_INET_TUNNEL is not set 335# CONFIG_INET_TUNNEL is not set
337CONFIG_INET_XFRM_MODE_TRANSPORT=y 336CONFIG_INET_XFRM_MODE_TRANSPORT=y
338CONFIG_INET_XFRM_MODE_TUNNEL=y 337CONFIG_INET_XFRM_MODE_TUNNEL=y
338CONFIG_INET_XFRM_MODE_BEET=y
339CONFIG_INET_DIAG=y 339CONFIG_INET_DIAG=y
340CONFIG_INET_TCP_DIAG=y 340CONFIG_INET_TCP_DIAG=y
341# CONFIG_TCP_CONG_ADVANCED is not set 341# CONFIG_TCP_CONG_ADVANCED is not set
@@ -441,76 +441,28 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
441# CONFIG_ATA_OVER_ETH is not set 441# CONFIG_ATA_OVER_ETH is not set
442 442
443# 443#
444# Misc devices
445#
446# CONFIG_SGI_IOC4 is not set
447# CONFIG_TIFM_CORE is not set
448
449#
444# ATA/ATAPI/MFM/RLL support 450# ATA/ATAPI/MFM/RLL support
445# 451#
446CONFIG_IDE=m 452# CONFIG_IDE is not set
447CONFIG_IDE_MAX_HWIFS=4
448CONFIG_BLK_DEV_IDE=m
449
450#
451# Please see Documentation/ide.txt for help/info on IDE drives
452#
453CONFIG_BLK_DEV_IDE_SATA=y
454CONFIG_BLK_DEV_IDEDISK=m
455CONFIG_IDEDISK_MULTI_MODE=y
456# CONFIG_BLK_DEV_IDECD is not set
457# CONFIG_BLK_DEV_IDETAPE is not set
458# CONFIG_BLK_DEV_IDEFLOPPY is not set
459CONFIG_BLK_DEV_IDESCSI=m
460# CONFIG_IDE_TASK_IOCTL is not set
461
462#
463# IDE chipset support/bugfixes
464#
465CONFIG_IDE_GENERIC=m
466CONFIG_BLK_DEV_IDEPCI=y
467CONFIG_IDEPCI_SHARE_IRQ=y
468# CONFIG_BLK_DEV_OFFBOARD is not set
469CONFIG_BLK_DEV_GENERIC=m
470# CONFIG_BLK_DEV_OPTI621 is not set
471CONFIG_BLK_DEV_IDEDMA_PCI=y
472# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
473CONFIG_IDEDMA_PCI_AUTO=y
474# CONFIG_IDEDMA_ONLYDISK is not set
475CONFIG_BLK_DEV_AEC62XX=m
476# CONFIG_BLK_DEV_ALI15X3 is not set
477# CONFIG_BLK_DEV_AMD74XX is not set
478# CONFIG_BLK_DEV_CMD64X is not set
479# CONFIG_BLK_DEV_TRIFLEX is not set
480# CONFIG_BLK_DEV_CY82C693 is not set
481# CONFIG_BLK_DEV_CS5520 is not set
482# CONFIG_BLK_DEV_CS5530 is not set
483# CONFIG_BLK_DEV_HPT34X is not set
484# CONFIG_BLK_DEV_HPT366 is not set
485# CONFIG_BLK_DEV_SC1200 is not set
486# CONFIG_BLK_DEV_PIIX is not set
487# CONFIG_BLK_DEV_IT821X is not set
488# CONFIG_BLK_DEV_NS87415 is not set
489# CONFIG_BLK_DEV_PDC202XX_OLD is not set
490CONFIG_BLK_DEV_PDC202XX_NEW=m
491# CONFIG_BLK_DEV_SVWKS is not set
492CONFIG_BLK_DEV_SIIMAGE=m
493# CONFIG_BLK_DEV_SLC90E66 is not set
494# CONFIG_BLK_DEV_TRM290 is not set
495# CONFIG_BLK_DEV_VIA82CXXX is not set
496# CONFIG_IDE_ARM is not set
497CONFIG_BLK_DEV_IDEDMA=y
498# CONFIG_IDEDMA_IVB is not set
499CONFIG_IDEDMA_AUTO=y
500# CONFIG_BLK_DEV_HD is not set
501 453
502# 454#
503# SCSI device support 455# SCSI device support
504# 456#
505# CONFIG_RAID_ATTRS is not set 457# CONFIG_RAID_ATTRS is not set
506CONFIG_SCSI=m 458CONFIG_SCSI=y
507# CONFIG_SCSI_NETLINK is not set 459# CONFIG_SCSI_NETLINK is not set
508CONFIG_SCSI_PROC_FS=y 460CONFIG_SCSI_PROC_FS=y
509 461
510# 462#
511# SCSI support type (disk, tape, CD-ROM) 463# SCSI support type (disk, tape, CD-ROM)
512# 464#
513CONFIG_BLK_DEV_SD=m 465CONFIG_BLK_DEV_SD=y
514# CONFIG_CHR_DEV_ST is not set 466# CONFIG_CHR_DEV_ST is not set
515# CONFIG_CHR_DEV_OSST is not set 467# CONFIG_CHR_DEV_OSST is not set
516# CONFIG_BLK_DEV_SR is not set 468# CONFIG_BLK_DEV_SR is not set
@@ -561,6 +513,7 @@ CONFIG_CHR_DEV_SG=m
561# CONFIG_SCSI_IPR is not set 513# CONFIG_SCSI_IPR is not set
562# CONFIG_SCSI_QLOGIC_1280 is not set 514# CONFIG_SCSI_QLOGIC_1280 is not set
563# CONFIG_SCSI_QLA_FC is not set 515# CONFIG_SCSI_QLA_FC is not set
516# CONFIG_SCSI_QLA_ISCSI is not set
564# CONFIG_SCSI_LPFC is not set 517# CONFIG_SCSI_LPFC is not set
565# CONFIG_SCSI_DC395x is not set 518# CONFIG_SCSI_DC395x is not set
566# CONFIG_SCSI_DC390T is not set 519# CONFIG_SCSI_DC390T is not set
@@ -570,7 +523,55 @@ CONFIG_CHR_DEV_SG=m
570# 523#
571# Serial ATA (prod) and Parallel ATA (experimental) drivers 524# Serial ATA (prod) and Parallel ATA (experimental) drivers
572# 525#
573# CONFIG_ATA is not set 526CONFIG_ATA=y
527# CONFIG_SATA_AHCI is not set
528# CONFIG_SATA_SVW is not set
529# CONFIG_ATA_PIIX is not set
530# CONFIG_SATA_MV is not set
531# CONFIG_SATA_NV is not set
532# CONFIG_PDC_ADMA is not set
533# CONFIG_SATA_QSTOR is not set
534# CONFIG_SATA_PROMISE is not set
535# CONFIG_SATA_SX4 is not set
536CONFIG_SATA_SIL=y
537# CONFIG_SATA_SIL24 is not set
538# CONFIG_SATA_SIS is not set
539# CONFIG_SATA_ULI is not set
540# CONFIG_SATA_VIA is not set
541# CONFIG_SATA_VITESSE is not set
542# CONFIG_PATA_ALI is not set
543# CONFIG_PATA_AMD is not set
544# CONFIG_PATA_ARTOP is not set
545# CONFIG_PATA_ATIIXP is not set
546# CONFIG_PATA_CMD64X is not set
547# CONFIG_PATA_CS5520 is not set
548# CONFIG_PATA_CS5530 is not set
549# CONFIG_PATA_CYPRESS is not set
550# CONFIG_PATA_EFAR is not set
551# CONFIG_ATA_GENERIC is not set
552# CONFIG_PATA_HPT366 is not set
553# CONFIG_PATA_HPT37X is not set
554# CONFIG_PATA_HPT3X2N is not set
555# CONFIG_PATA_HPT3X3 is not set
556# CONFIG_PATA_IT821X is not set
557# CONFIG_PATA_JMICRON is not set
558# CONFIG_PATA_TRIFLEX is not set
559# CONFIG_PATA_MPIIX is not set
560# CONFIG_PATA_OLDPIIX is not set
561# CONFIG_PATA_NETCELL is not set
562# CONFIG_PATA_NS87410 is not set
563# CONFIG_PATA_OPTI is not set
564# CONFIG_PATA_OPTIDMA is not set
565# CONFIG_PATA_PDC_OLD is not set
566# CONFIG_PATA_RADISYS is not set
567# CONFIG_PATA_RZ1000 is not set
568# CONFIG_PATA_SC1200 is not set
569# CONFIG_PATA_SERVERWORKS is not set
570# CONFIG_PATA_PDC2027X is not set
571# CONFIG_PATA_SIL680 is not set
572# CONFIG_PATA_SIS is not set
573# CONFIG_PATA_VIA is not set
574# CONFIG_PATA_WINBOND is not set
574 575
575# 576#
576# Multi-device support (RAID and LVM) 577# Multi-device support (RAID and LVM)
@@ -840,7 +841,6 @@ CONFIG_HW_RANDOM=y
840# TPM devices 841# TPM devices
841# 842#
842# CONFIG_TCG_TPM is not set 843# CONFIG_TCG_TPM is not set
843# CONFIG_TELCLOCK is not set
844 844
845# 845#
846# I2C support 846# I2C support
@@ -856,6 +856,7 @@ CONFIG_HW_RANDOM=y
856# 856#
857# Dallas's 1-wire bus 857# Dallas's 1-wire bus
858# 858#
859# CONFIG_W1 is not set
859 860
860# 861#
861# Hardware Monitoring support 862# Hardware Monitoring support
@@ -868,14 +869,9 @@ CONFIG_HWMON=y
868# CONFIG_HWMON_DEBUG_CHIP is not set 869# CONFIG_HWMON_DEBUG_CHIP is not set
869 870
870# 871#
871# Misc devices
872#
873
874#
875# Multimedia devices 872# Multimedia devices
876# 873#
877# CONFIG_VIDEO_DEV is not set 874# CONFIG_VIDEO_DEV is not set
878CONFIG_VIDEO_V4L2=y
879 875
880# 876#
881# Digital Video Broadcasting Devices 877# Digital Video Broadcasting Devices
@@ -959,7 +955,29 @@ CONFIG_USB_ARCH_HAS_EHCI=y
959# 955#
960# Real Time Clock 956# Real Time Clock
961# 957#
962# CONFIG_RTC_CLASS is not set 958CONFIG_RTC_LIB=y
959CONFIG_RTC_CLASS=y
960CONFIG_RTC_HCTOSYS=y
961CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
962# CONFIG_RTC_DEBUG is not set
963
964#
965# RTC interfaces
966#
967CONFIG_RTC_INTF_SYSFS=y
968CONFIG_RTC_INTF_PROC=y
969CONFIG_RTC_INTF_DEV=y
970# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
971
972#
973# RTC drivers
974#
975# CONFIG_RTC_DRV_DS1553 is not set
976# CONFIG_RTC_DRV_DS1742 is not set
977# CONFIG_RTC_DRV_M48T86 is not set
978CONFIG_RTC_DRV_SH=y
979# CONFIG_RTC_DRV_TEST is not set
980# CONFIG_RTC_DRV_V3020 is not set
963 981
964# 982#
965# DMA Engine support 983# DMA Engine support
@@ -984,6 +1002,7 @@ CONFIG_EXT3_FS=y
984CONFIG_EXT3_FS_XATTR=y 1002CONFIG_EXT3_FS_XATTR=y
985# CONFIG_EXT3_FS_POSIX_ACL is not set 1003# CONFIG_EXT3_FS_POSIX_ACL is not set
986# CONFIG_EXT3_FS_SECURITY is not set 1004# CONFIG_EXT3_FS_SECURITY is not set
1005# CONFIG_EXT4DEV_FS is not set
987CONFIG_JBD=y 1006CONFIG_JBD=y
988# CONFIG_JBD_DEBUG is not set 1007# CONFIG_JBD_DEBUG is not set
989CONFIG_FS_MBCACHE=y 1008CONFIG_FS_MBCACHE=y
@@ -991,6 +1010,7 @@ CONFIG_FS_MBCACHE=y
991# CONFIG_JFS_FS is not set 1010# CONFIG_JFS_FS is not set
992CONFIG_FS_POSIX_ACL=y 1011CONFIG_FS_POSIX_ACL=y
993# CONFIG_XFS_FS is not set 1012# CONFIG_XFS_FS is not set
1013# CONFIG_GFS2_FS is not set
994# CONFIG_OCFS2_FS is not set 1014# CONFIG_OCFS2_FS is not set
995CONFIG_MINIX_FS=y 1015CONFIG_MINIX_FS=y
996# CONFIG_ROMFS_FS is not set 1016# CONFIG_ROMFS_FS is not set
@@ -1027,7 +1047,8 @@ CONFIG_PROC_FS=y
1027CONFIG_PROC_KCORE=y 1047CONFIG_PROC_KCORE=y
1028CONFIG_PROC_SYSCTL=y 1048CONFIG_PROC_SYSCTL=y
1029CONFIG_SYSFS=y 1049CONFIG_SYSFS=y
1030# CONFIG_TMPFS is not set 1050CONFIG_TMPFS=y
1051# CONFIG_TMPFS_POSIX_ACL is not set
1031CONFIG_HUGETLBFS=y 1052CONFIG_HUGETLBFS=y
1032CONFIG_HUGETLB_PAGE=y 1053CONFIG_HUGETLB_PAGE=y
1033CONFIG_RAMFS=y 1054CONFIG_RAMFS=y
@@ -1159,6 +1180,7 @@ CONFIG_DEBUG_FS=y
1159# CONFIG_DEBUG_LIST is not set 1180# CONFIG_DEBUG_LIST is not set
1160CONFIG_FRAME_POINTER=y 1181CONFIG_FRAME_POINTER=y
1161CONFIG_FORCED_INLINING=y 1182CONFIG_FORCED_INLINING=y
1183# CONFIG_HEADERS_CHECK is not set
1162# CONFIG_RCU_TORTURE_TEST is not set 1184# CONFIG_RCU_TORTURE_TEST is not set
1163# CONFIG_SH_STANDARD_BIOS is not set 1185# CONFIG_SH_STANDARD_BIOS is not set
1164# CONFIG_EARLY_SCIF_CONSOLE is not set 1186# CONFIG_EARLY_SCIF_CONSOLE is not set
@@ -1178,9 +1200,9 @@ CONFIG_FORCED_INLINING=y
1178# 1200#
1179CONFIG_CRYPTO=y 1201CONFIG_CRYPTO=y
1180CONFIG_CRYPTO_ALGAPI=y 1202CONFIG_CRYPTO_ALGAPI=y
1181CONFIG_CRYPTO_BLKCIPHER=m 1203CONFIG_CRYPTO_BLKCIPHER=y
1182CONFIG_CRYPTO_HASH=y 1204CONFIG_CRYPTO_HASH=y
1183CONFIG_CRYPTO_MANAGER=m 1205CONFIG_CRYPTO_MANAGER=y
1184CONFIG_CRYPTO_HMAC=y 1206CONFIG_CRYPTO_HMAC=y
1185# CONFIG_CRYPTO_NULL is not set 1207# CONFIG_CRYPTO_NULL is not set
1186# CONFIG_CRYPTO_MD4 is not set 1208# CONFIG_CRYPTO_MD4 is not set
@@ -1191,7 +1213,7 @@ CONFIG_CRYPTO_MD5=y
1191# CONFIG_CRYPTO_WP512 is not set 1213# CONFIG_CRYPTO_WP512 is not set
1192# CONFIG_CRYPTO_TGR192 is not set 1214# CONFIG_CRYPTO_TGR192 is not set
1193CONFIG_CRYPTO_ECB=m 1215CONFIG_CRYPTO_ECB=m
1194CONFIG_CRYPTO_CBC=m 1216CONFIG_CRYPTO_CBC=y
1195CONFIG_CRYPTO_DES=y 1217CONFIG_CRYPTO_DES=y
1196# CONFIG_CRYPTO_BLOWFISH is not set 1218# CONFIG_CRYPTO_BLOWFISH is not set
1197# CONFIG_CRYPTO_TWOFISH is not set 1219# CONFIG_CRYPTO_TWOFISH is not set
diff --git a/arch/sh/configs/titan_defconfig b/arch/sh/configs/titan_defconfig
index 5e817546113..41049cf14b7 100644
--- a/arch/sh/configs/titan_defconfig
+++ b/arch/sh/configs/titan_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.18 3# Linux kernel version: 2.6.19-rc3
4# Tue Oct 3 12:59:14 2006 4# Mon Oct 30 18:04:49 2006
5# 5#
6CONFIG_SUPERH=y 6CONFIG_SUPERH=y
7CONFIG_RWSEM_GENERIC_SPINLOCK=y 7CONFIG_RWSEM_GENERIC_SPINLOCK=y
@@ -10,6 +10,7 @@ CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_GENERIC_IRQ_PROBE=y 11CONFIG_GENERIC_IRQ_PROBE=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y 12CONFIG_GENERIC_CALIBRATE_DELAY=y
13# CONFIG_GENERIC_TIME is not set
13CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 14CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
14 15
15# 16#
@@ -23,7 +24,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
23# General setup 24# General setup
24# 25#
25CONFIG_LOCALVERSION="" 26CONFIG_LOCALVERSION=""
26CONFIG_LOCALVERSION_AUTO=y 27# CONFIG_LOCALVERSION_AUTO is not set
27CONFIG_SWAP=y 28CONFIG_SWAP=y
28CONFIG_SYSVIPC=y 29CONFIG_SYSVIPC=y
29# CONFIG_IPC_NS is not set 30# CONFIG_IPC_NS is not set
@@ -236,8 +237,8 @@ CONFIG_HZ_250=y
236CONFIG_HZ=250 237CONFIG_HZ=250
237# CONFIG_KEXEC is not set 238# CONFIG_KEXEC is not set
238# CONFIG_SMP is not set 239# CONFIG_SMP is not set
239CONFIG_PREEMPT_NONE=y 240# CONFIG_PREEMPT_NONE is not set
240# CONFIG_PREEMPT_VOLUNTARY is not set 241CONFIG_PREEMPT_VOLUNTARY=y
241# CONFIG_PREEMPT is not set 242# CONFIG_PREEMPT is not set
242 243
243# 244#
@@ -247,7 +248,7 @@ CONFIG_ZERO_PAGE_OFFSET=0x00001000
247CONFIG_BOOT_LINK_OFFSET=0x009e0000 248CONFIG_BOOT_LINK_OFFSET=0x009e0000
248# CONFIG_UBC_WAKEUP is not set 249# CONFIG_UBC_WAKEUP is not set
249CONFIG_CMDLINE_BOOL=y 250CONFIG_CMDLINE_BOOL=y
250CONFIG_CMDLINE="console=ttySC1,38400N81 root=/dev/nfs ip=:::::eth1:autoconf" 251CONFIG_CMDLINE="console=ttySC1,38400N81 root=/dev/nfs ip=:::::eth1:autoconf rw"
251 252
252# 253#
253# Bus options 254# Bus options
@@ -334,6 +335,7 @@ CONFIG_INET_XFRM_TUNNEL=y
334CONFIG_INET_TUNNEL=y 335CONFIG_INET_TUNNEL=y
335CONFIG_INET_XFRM_MODE_TRANSPORT=y 336CONFIG_INET_XFRM_MODE_TRANSPORT=y
336CONFIG_INET_XFRM_MODE_TUNNEL=y 337CONFIG_INET_XFRM_MODE_TUNNEL=y
338CONFIG_INET_XFRM_MODE_BEET=y
337CONFIG_INET_DIAG=m 339CONFIG_INET_DIAG=m
338CONFIG_INET_TCP_DIAG=m 340CONFIG_INET_TCP_DIAG=m
339# CONFIG_TCP_CONG_ADVANCED is not set 341# CONFIG_TCP_CONG_ADVANCED is not set
@@ -355,9 +357,10 @@ CONFIG_INET6_XFRM_TUNNEL=y
355CONFIG_INET6_TUNNEL=y 357CONFIG_INET6_TUNNEL=y
356CONFIG_INET6_XFRM_MODE_TRANSPORT=y 358CONFIG_INET6_XFRM_MODE_TRANSPORT=y
357CONFIG_INET6_XFRM_MODE_TUNNEL=y 359CONFIG_INET6_XFRM_MODE_TUNNEL=y
360CONFIG_INET6_XFRM_MODE_BEET=y
358# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set 361# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
362CONFIG_IPV6_SIT=m
359CONFIG_IPV6_TUNNEL=y 363CONFIG_IPV6_TUNNEL=y
360# CONFIG_IPV6_SUBTREES is not set
361# CONFIG_IPV6_MULTIPLE_TABLES is not set 364# CONFIG_IPV6_MULTIPLE_TABLES is not set
362# CONFIG_NETWORK_SECMARK is not set 365# CONFIG_NETWORK_SECMARK is not set
363CONFIG_NETFILTER=y 366CONFIG_NETFILTER=y
@@ -714,6 +717,12 @@ CONFIG_BLK_DEV_INITRD=y
714CONFIG_ATA_OVER_ETH=m 717CONFIG_ATA_OVER_ETH=m
715 718
716# 719#
720# Misc devices
721#
722# CONFIG_SGI_IOC4 is not set
723# CONFIG_TIFM_CORE is not set
724
725#
717# ATA/ATAPI/MFM/RLL support 726# ATA/ATAPI/MFM/RLL support
718# 727#
719# CONFIG_IDE is not set 728# CONFIG_IDE is not set
@@ -778,9 +787,9 @@ CONFIG_CHR_DEV_SG=m
778# CONFIG_SCSI_INIA100 is not set 787# CONFIG_SCSI_INIA100 is not set
779# CONFIG_SCSI_STEX is not set 788# CONFIG_SCSI_STEX is not set
780# CONFIG_SCSI_SYM53C8XX_2 is not set 789# CONFIG_SCSI_SYM53C8XX_2 is not set
781# CONFIG_SCSI_IPR is not set
782# CONFIG_SCSI_QLOGIC_1280 is not set 790# CONFIG_SCSI_QLOGIC_1280 is not set
783# CONFIG_SCSI_QLA_FC is not set 791# CONFIG_SCSI_QLA_FC is not set
792# CONFIG_SCSI_QLA_ISCSI is not set
784# CONFIG_SCSI_LPFC is not set 793# CONFIG_SCSI_LPFC is not set
785# CONFIG_SCSI_DC395x is not set 794# CONFIG_SCSI_DC395x is not set
786# CONFIG_SCSI_DC390T is not set 795# CONFIG_SCSI_DC390T is not set
@@ -1095,7 +1104,6 @@ CONFIG_HW_RANDOM=y
1095# TPM devices 1104# TPM devices
1096# 1105#
1097# CONFIG_TCG_TPM is not set 1106# CONFIG_TCG_TPM is not set
1098# CONFIG_TELCLOCK is not set
1099 1107
1100# 1108#
1101# I2C support 1109# I2C support
@@ -1124,14 +1132,9 @@ CONFIG_HWMON=y
1124# CONFIG_HWMON_DEBUG_CHIP is not set 1132# CONFIG_HWMON_DEBUG_CHIP is not set
1125 1133
1126# 1134#
1127# Misc devices
1128#
1129
1130#
1131# Multimedia devices 1135# Multimedia devices
1132# 1136#
1133# CONFIG_VIDEO_DEV is not set 1137# CONFIG_VIDEO_DEV is not set
1134CONFIG_VIDEO_V4L2=y
1135 1138
1136# 1139#
1137# Digital Video Broadcasting Devices 1140# Digital Video Broadcasting Devices
@@ -1177,9 +1180,9 @@ CONFIG_USB_DEVICEFS=y
1177# USB Host Controller Drivers 1180# USB Host Controller Drivers
1178# 1181#
1179CONFIG_USB_EHCI_HCD=y 1182CONFIG_USB_EHCI_HCD=y
1180# CONFIG_USB_EHCI_SPLIT_ISO is not set 1183CONFIG_USB_EHCI_SPLIT_ISO=y
1181# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1184CONFIG_USB_EHCI_ROOT_HUB_TT=y
1182# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1185CONFIG_USB_EHCI_TT_NEWSCHED=y
1183# CONFIG_USB_ISP116X_HCD is not set 1186# CONFIG_USB_ISP116X_HCD is not set
1184CONFIG_USB_OHCI_HCD=y 1187CONFIG_USB_OHCI_HCD=y
1185# CONFIG_USB_OHCI_BIG_ENDIAN is not set 1188# CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -1235,7 +1238,6 @@ CONFIG_USB_STORAGE=y
1235# CONFIG_USB_ATI_REMOTE2 is not set 1238# CONFIG_USB_ATI_REMOTE2 is not set
1236# CONFIG_USB_KEYSPAN_REMOTE is not set 1239# CONFIG_USB_KEYSPAN_REMOTE is not set
1237# CONFIG_USB_APPLETOUCH is not set 1240# CONFIG_USB_APPLETOUCH is not set
1238# CONFIG_USB_TRANCEVIBRATOR is not set
1239 1241
1240# 1242#
1241# USB Imaging devices 1243# USB Imaging devices
@@ -1246,11 +1248,20 @@ CONFIG_USB_STORAGE=y
1246# 1248#
1247# USB Network Adapters 1249# USB Network Adapters
1248# 1250#
1249# CONFIG_USB_CATC is not set 1251CONFIG_USB_CATC=m
1250# CONFIG_USB_KAWETH is not set 1252CONFIG_USB_KAWETH=m
1251# CONFIG_USB_PEGASUS is not set 1253CONFIG_USB_PEGASUS=m
1252# CONFIG_USB_RTL8150 is not set 1254CONFIG_USB_RTL8150=m
1253# CONFIG_USB_USBNET is not set 1255CONFIG_USB_USBNET=m
1256CONFIG_USB_NET_AX8817X=m
1257CONFIG_USB_NET_CDCETHER=m
1258# CONFIG_USB_NET_GL620A is not set
1259CONFIG_USB_NET_NET1080=m
1260CONFIG_USB_NET_PLUSB=m
1261# CONFIG_USB_NET_MCS7830 is not set
1262# CONFIG_USB_NET_RNDIS_HOST is not set
1263# CONFIG_USB_NET_CDC_SUBSET is not set
1264CONFIG_USB_NET_ZAURUS=m
1254CONFIG_USB_MON=y 1265CONFIG_USB_MON=y
1255 1266
1256# 1267#
@@ -1285,6 +1296,7 @@ CONFIG_USB_SERIAL_ARK3116=m
1285# CONFIG_USB_SERIAL_KLSI is not set 1296# CONFIG_USB_SERIAL_KLSI is not set
1286# CONFIG_USB_SERIAL_KOBIL_SCT is not set 1297# CONFIG_USB_SERIAL_KOBIL_SCT is not set
1287# CONFIG_USB_SERIAL_MCT_U232 is not set 1298# CONFIG_USB_SERIAL_MCT_U232 is not set
1299# CONFIG_USB_SERIAL_MOS7720 is not set
1288# CONFIG_USB_SERIAL_MOS7840 is not set 1300# CONFIG_USB_SERIAL_MOS7840 is not set
1289# CONFIG_USB_SERIAL_NAVMAN is not set 1301# CONFIG_USB_SERIAL_NAVMAN is not set
1290CONFIG_USB_SERIAL_PL2303=m 1302CONFIG_USB_SERIAL_PL2303=m
@@ -1316,6 +1328,7 @@ CONFIG_USB_SERIAL_PL2303=m
1316# CONFIG_USB_APPLEDISPLAY is not set 1328# CONFIG_USB_APPLEDISPLAY is not set
1317# CONFIG_USB_SISUSBVGA is not set 1329# CONFIG_USB_SISUSBVGA is not set
1318# CONFIG_USB_LD is not set 1330# CONFIG_USB_LD is not set
1331# CONFIG_USB_TRANCEVIBRATOR is not set
1319# CONFIG_USB_TEST is not set 1332# CONFIG_USB_TEST is not set
1320 1333
1321# 1334#
@@ -1357,7 +1370,26 @@ CONFIG_USB_SERIAL_PL2303=m
1357# 1370#
1358# Real Time Clock 1371# Real Time Clock
1359# 1372#
1360# CONFIG_RTC_CLASS is not set 1373CONFIG_RTC_LIB=m
1374CONFIG_RTC_CLASS=m
1375
1376#
1377# RTC interfaces
1378#
1379CONFIG_RTC_INTF_SYSFS=m
1380CONFIG_RTC_INTF_PROC=m
1381CONFIG_RTC_INTF_DEV=m
1382# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1383
1384#
1385# RTC drivers
1386#
1387# CONFIG_RTC_DRV_DS1553 is not set
1388# CONFIG_RTC_DRV_DS1742 is not set
1389# CONFIG_RTC_DRV_M48T86 is not set
1390CONFIG_RTC_DRV_SH=m
1391# CONFIG_RTC_DRV_TEST is not set
1392# CONFIG_RTC_DRV_V3020 is not set
1361 1393
1362# 1394#
1363# DMA Engine support 1395# DMA Engine support
@@ -1380,8 +1412,12 @@ CONFIG_EXT2_FS=y
1380# CONFIG_EXT2_FS_XIP is not set 1412# CONFIG_EXT2_FS_XIP is not set
1381CONFIG_EXT3_FS=y 1413CONFIG_EXT3_FS=y
1382# CONFIG_EXT3_FS_XATTR is not set 1414# CONFIG_EXT3_FS_XATTR is not set
1415CONFIG_EXT4DEV_FS=m
1416# CONFIG_EXT4DEV_FS_XATTR is not set
1383CONFIG_JBD=y 1417CONFIG_JBD=y
1384# CONFIG_JBD_DEBUG is not set 1418# CONFIG_JBD_DEBUG is not set
1419CONFIG_JBD2=m
1420# CONFIG_JBD2_DEBUG is not set
1385CONFIG_REISERFS_FS=m 1421CONFIG_REISERFS_FS=m
1386# CONFIG_REISERFS_CHECK is not set 1422# CONFIG_REISERFS_CHECK is not set
1387# CONFIG_REISERFS_PROC_INFO is not set 1423# CONFIG_REISERFS_PROC_INFO is not set
@@ -1393,9 +1429,10 @@ CONFIG_XFS_FS=m
1393# CONFIG_XFS_SECURITY is not set 1429# CONFIG_XFS_SECURITY is not set
1394# CONFIG_XFS_POSIX_ACL is not set 1430# CONFIG_XFS_POSIX_ACL is not set
1395# CONFIG_XFS_RT is not set 1431# CONFIG_XFS_RT is not set
1432# CONFIG_GFS2_FS is not set
1396# CONFIG_OCFS2_FS is not set 1433# CONFIG_OCFS2_FS is not set
1397# CONFIG_MINIX_FS is not set 1434# CONFIG_MINIX_FS is not set
1398# CONFIG_ROMFS_FS is not set 1435CONFIG_ROMFS_FS=y
1399CONFIG_INOTIFY=y 1436CONFIG_INOTIFY=y
1400CONFIG_INOTIFY_USER=y 1437CONFIG_INOTIFY_USER=y
1401# CONFIG_QUOTA is not set 1438# CONFIG_QUOTA is not set
@@ -1480,7 +1517,12 @@ CONFIG_SUNRPC=y
1480# CONFIG_RPCSEC_GSS_SPKM3 is not set 1517# CONFIG_RPCSEC_GSS_SPKM3 is not set
1481CONFIG_SMB_FS=m 1518CONFIG_SMB_FS=m
1482# CONFIG_SMB_NLS_DEFAULT is not set 1519# CONFIG_SMB_NLS_DEFAULT is not set
1483# CONFIG_CIFS is not set 1520CONFIG_CIFS=m
1521# CONFIG_CIFS_STATS is not set
1522CONFIG_CIFS_WEAK_PW_HASH=y
1523# CONFIG_CIFS_XATTR is not set
1524# CONFIG_CIFS_DEBUG2 is not set
1525# CONFIG_CIFS_EXPERIMENTAL is not set
1484# CONFIG_NCP_FS is not set 1526# CONFIG_NCP_FS is not set
1485# CONFIG_CODA_FS is not set 1527# CONFIG_CODA_FS is not set
1486# CONFIG_AFS_FS is not set 1528# CONFIG_AFS_FS is not set
@@ -1583,9 +1625,10 @@ CONFIG_LOG_BUF_SHIFT=16
1583# CONFIG_DEBUG_LIST is not set 1625# CONFIG_DEBUG_LIST is not set
1584# CONFIG_FRAME_POINTER is not set 1626# CONFIG_FRAME_POINTER is not set
1585# CONFIG_FORCED_INLINING is not set 1627# CONFIG_FORCED_INLINING is not set
1628# CONFIG_HEADERS_CHECK is not set
1586# CONFIG_RCU_TORTURE_TEST is not set 1629# CONFIG_RCU_TORTURE_TEST is not set
1587# CONFIG_SH_STANDARD_BIOS is not set 1630# CONFIG_SH_STANDARD_BIOS is not set
1588CONFIG_EARLY_SCIF_CONSOLE=y 1631# CONFIG_EARLY_SCIF_CONSOLE is not set
1589# CONFIG_EARLY_PRINTK is not set 1632# CONFIG_EARLY_PRINTK is not set
1590# CONFIG_DEBUG_STACKOVERFLOW is not set 1633# CONFIG_DEBUG_STACKOVERFLOW is not set
1591# CONFIG_DEBUG_STACK_USAGE is not set 1634# CONFIG_DEBUG_STACK_USAGE is not set
@@ -1605,7 +1648,7 @@ CONFIG_CRYPTO=y
1605CONFIG_CRYPTO_ALGAPI=y 1648CONFIG_CRYPTO_ALGAPI=y
1606CONFIG_CRYPTO_BLKCIPHER=y 1649CONFIG_CRYPTO_BLKCIPHER=y
1607CONFIG_CRYPTO_HASH=y 1650CONFIG_CRYPTO_HASH=y
1608CONFIG_CRYPTO_MANAGER=m 1651CONFIG_CRYPTO_MANAGER=y
1609CONFIG_CRYPTO_HMAC=y 1652CONFIG_CRYPTO_HMAC=y
1610CONFIG_CRYPTO_NULL=m 1653CONFIG_CRYPTO_NULL=m
1611CONFIG_CRYPTO_MD4=m 1654CONFIG_CRYPTO_MD4=m
@@ -1615,7 +1658,7 @@ CONFIG_CRYPTO_SHA256=m
1615CONFIG_CRYPTO_SHA512=m 1658CONFIG_CRYPTO_SHA512=m
1616CONFIG_CRYPTO_WP512=m 1659CONFIG_CRYPTO_WP512=m
1617CONFIG_CRYPTO_TGR192=m 1660CONFIG_CRYPTO_TGR192=m
1618CONFIG_CRYPTO_ECB=m 1661CONFIG_CRYPTO_ECB=y
1619CONFIG_CRYPTO_CBC=y 1662CONFIG_CRYPTO_CBC=y
1620CONFIG_CRYPTO_DES=y 1663CONFIG_CRYPTO_DES=y
1621CONFIG_CRYPTO_BLOWFISH=m 1664CONFIG_CRYPTO_BLOWFISH=m
diff --git a/arch/sh/drivers/dma/dma-sh.c b/arch/sh/drivers/dma/dma-sh.c
index d8ece20bb2c..66078601335 100644
--- a/arch/sh/drivers/dma/dma-sh.c
+++ b/arch/sh/drivers/dma/dma-sh.c
@@ -19,23 +19,34 @@
19#include <asm/io.h> 19#include <asm/io.h>
20#include "dma-sh.h" 20#include "dma-sh.h"
21 21
22static inline unsigned int get_dmte_irq(unsigned int chan)
23{
24 unsigned int irq = 0;
25 22
23
24#ifdef CONFIG_CPU_SH4
25static struct ipr_data dmae_ipr_map[] = {
26 { DMAE_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
27};
28#endif
29static struct ipr_data dmte_ipr_map[] = {
26 /* 30 /*
27 * Normally we could just do DMTE0_IRQ + chan outright, though in the 31 * Normally we could just do DMTE0_IRQ + chan outright, though in the
28 * case of the 7751R, the DMTE IRQs for channels > 4 start right above 32 * case of the 7751R, the DMTE IRQs for channels > 4 start right above
29 * the SCIF 33 * the SCIF
30 */ 34 */
31 if (chan < 4) { 35 { DMTE0_IRQ + 0, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
32 irq = DMTE0_IRQ + chan; 36 { DMTE0_IRQ + 1, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
33 } else { 37 { DMTE0_IRQ + 2, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
34#ifdef DMTE4_IRQ 38 { DMTE0_IRQ + 3, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
35 irq = DMTE4_IRQ + chan - 4; 39 { DMTE4_IRQ + 0, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
36#endif 40 { DMTE4_IRQ + 1, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
37 } 41 { DMTE4_IRQ + 2, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
42 { DMTE4_IRQ + 3, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
43};
38 44
45static inline unsigned int get_dmte_irq(unsigned int chan)
46{
47 unsigned int irq = 0;
48 if (chan < ARRAY_SIZE(dmte_ipr_map))
49 irq = dmte_ipr_map[chan].irq;
39 return irq; 50 return irq;
40} 51}
41 52
@@ -258,17 +269,16 @@ static int __init sh_dmac_init(void)
258 int i; 269 int i;
259 270
260#ifdef CONFIG_CPU_SH4 271#ifdef CONFIG_CPU_SH4
261 make_ipr_irq(DMAE_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY); 272 make_ipr_irq(dmae_ipr_map, ARRAY_SIZE(dmae_ipr_map));
262 i = request_irq(DMAE_IRQ, dma_err, IRQF_DISABLED, "DMAC Address Error", 0); 273 i = request_irq(DMAE_IRQ, dma_err, IRQF_DISABLED, "DMAC Address Error", 0);
263 if (unlikely(i < 0)) 274 if (unlikely(i < 0))
264 return i; 275 return i;
265#endif 276#endif
266 277
267 for (i = 0; i < info->nr_channels; i++) { 278 i = info->nr_channels;
268 int irq = get_dmte_irq(i); 279 if (i > ARRAY_SIZE(dmte_ipr_map))
269 280 i = ARRAY_SIZE(dmte_ipr_map);
270 make_ipr_irq(irq, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY); 281 make_ipr_irq(dmte_ipr_map, i);
271 }
272 282
273 /* 283 /*
274 * Initialize DMAOR, and clean up any error flags that may have 284 * Initialize DMAOR, and clean up any error flags that may have
diff --git a/arch/sh/drivers/pci/ops-r7780rp.c b/arch/sh/drivers/pci/ops-r7780rp.c
index 6e3ba9c65b4..eeea1577e11 100644
--- a/arch/sh/drivers/pci/ops-r7780rp.c
+++ b/arch/sh/drivers/pci/ops-r7780rp.c
@@ -13,7 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/delay.h> 14#include <linux/delay.h>
15#include <linux/pci.h> 15#include <linux/pci.h>
16#include <asm/r7780rp/r7780rp.h> 16#include <asm/r7780rp.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include "pci-sh4.h" 18#include "pci-sh4.h"
19 19
diff --git a/arch/sh/drivers/pci/ops-rts7751r2d.c b/arch/sh/drivers/pci/ops-rts7751r2d.c
index b68824c8b81..4a518d94804 100644
--- a/arch/sh/drivers/pci/ops-rts7751r2d.c
+++ b/arch/sh/drivers/pci/ops-rts7751r2d.c
@@ -10,28 +10,24 @@
10 * 10 *
11 * PCI initialization for the Renesas SH7751R RTS7751R2D board 11 * PCI initialization for the Renesas SH7751R RTS7751R2D board
12 */ 12 */
13
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/delay.h>
18#include <linux/pci.h> 16#include <linux/pci.h>
19#include <linux/module.h> 17#include <linux/io.h>
20#include <asm/rts7751r2d/rts7751r2d.h> 18#include <asm/rts7751r2d.h>
21#include <asm/io.h>
22#include "pci-sh4.h" 19#include "pci-sh4.h"
23 20
21static u8 rts7751r2d_irq_tab[] __initdata = {
22 IRQ_PCISLOT1,
23 IRQ_PCISLOT2,
24 IRQ_PCMCIA,
25 IRQ_PCIETH,
26};
27
24int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) 28int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
25{ 29{
26 switch (slot) { 30 return rts7751r2d_irq_tab[slot];
27 case 0: return IRQ_PCISLOT1; /* PCI Extend slot #1 */
28 case 1: return IRQ_PCISLOT2; /* PCI Extend slot #2 */
29 case 2: return IRQ_PCMCIA; /* PCI Cardbus Bridge */
30 case 3: return IRQ_PCIETH; /* Realtek Ethernet controller */
31 default:
32 printk("PCI: Bad IRQ mapping request for slot %d\n", slot);
33 return -1;
34 }
35} 31}
36 32
37static struct resource sh7751_io_resource = { 33static struct resource sh7751_io_resource = {
diff --git a/arch/sh/kernel/cpu/irq/intc2.c b/arch/sh/kernel/cpu/irq/intc2.c
index d4b2bb7e08c..74ca576a7ce 100644
--- a/arch/sh/kernel/cpu/irq/intc2.c
+++ b/arch/sh/kernel/cpu/irq/intc2.c
@@ -11,10 +11,9 @@
11 * Hitachi 7751, the STM ST40 STB1, SH7760, and SH7780. 11 * Hitachi 7751, the STM ST40 STB1, SH7760, and SH7780.
12 */ 12 */
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/io.h>
16#include <asm/system.h> 16#include <asm/system.h>
17#include <asm/io.h>
18 17
19static void disable_intc2_irq(unsigned int irq) 18static void disable_intc2_irq(unsigned int irq)
20{ 19{
@@ -31,7 +30,7 @@ static void enable_intc2_irq(unsigned int irq)
31} 30}
32 31
33static struct irq_chip intc2_irq_chip = { 32static struct irq_chip intc2_irq_chip = {
34 .typename = "intc2", 33 .name = "INTC2",
35 .mask = disable_intc2_irq, 34 .mask = disable_intc2_irq,
36 .unmask = enable_intc2_irq, 35 .unmask = enable_intc2_irq,
37 .mask_ack = disable_intc2_irq, 36 .mask_ack = disable_intc2_irq,
@@ -45,150 +44,36 @@ static struct irq_chip intc2_irq_chip = {
45 * PIO1 which is INTPRI00[19,16] and INTMSK00[13] 44 * PIO1 which is INTPRI00[19,16] and INTMSK00[13]
46 * would be: ^ ^ ^ ^ 45 * would be: ^ ^ ^ ^
47 * | | | | 46 * | | | |
48 * make_intc2_irq(84, 0, 16, 0, 13); 47 * { 84, 0, 16, 0, 13 },
48 *
49 * in the intc2_data table.
49 */ 50 */
50void make_intc2_irq(struct intc2_data *p) 51void make_intc2_irq(struct intc2_data *table, unsigned int nr_irqs)
51{ 52{
52 unsigned int flags; 53 int i;
53 unsigned long ipr;
54
55 disable_irq_nosync(p->irq);
56
57 /* Set the priority level */
58 local_irq_save(flags);
59
60 ipr = ctrl_inl(INTC2_BASE + INTC2_INTPRI_OFFSET + p->ipr_offset);
61 ipr &= ~(0xf << p->ipr_shift);
62 ipr |= p->priority << p->ipr_shift;
63 ctrl_outl(ipr, INTC2_BASE + INTC2_INTPRI_OFFSET + p->ipr_offset);
64
65 local_irq_restore(flags);
66 54
67 set_irq_chip_and_handler(p->irq, &intc2_irq_chip, handle_level_irq); 55 for (i = 0; i < nr_irqs; i++) {
68 set_irq_chip_data(p->irq, p); 56 unsigned long ipr, flags;
57 struct intc2_data *p = table + i;
69 58
70 enable_intc2_irq(p->irq); 59 disable_irq_nosync(p->irq);
71}
72 60
73static struct intc2_data intc2_irq_table[] = { 61 /* Set the priority level */
74#if defined(CONFIG_CPU_SUBTYPE_ST40) 62 local_irq_save(flags);
75 {64, 0, 0, 0, 0, 13}, /* PCI serr */
76 {65, 0, 4, 0, 1, 13}, /* PCI err */
77 {66, 0, 4, 0, 2, 13}, /* PCI ad */
78 {67, 0, 4, 0, 3, 13}, /* PCI pwd down */
79 {72, 0, 8, 0, 5, 13}, /* DMAC INT0 */
80 {73, 0, 8, 0, 6, 13}, /* DMAC INT1 */
81 {74, 0, 8, 0, 7, 13}, /* DMAC INT2 */
82 {75, 0, 8, 0, 8, 13}, /* DMAC INT3 */
83 {76, 0, 8, 0, 9, 13}, /* DMAC INT4 */
84 {78, 0, 8, 0, 11, 13}, /* DMAC ERR */
85 {80, 0, 12, 0, 12, 13}, /* PIO0 */
86 {84, 0, 16, 0, 13, 13}, /* PIO1 */
87 {88, 0, 20, 0, 14, 13}, /* PIO2 */
88 {112, 4, 0, 4, 0, 13}, /* Mailbox */
89 #ifdef CONFIG_CPU_SUBTYPE_ST40GX1
90 {116, 4, 4, 4, 4, 13}, /* SSC0 */
91 {120, 4, 8, 4, 8, 13}, /* IR Blaster */
92 {124, 4, 12, 4, 12, 13}, /* USB host */
93 {128, 4, 16, 4, 16, 13}, /* Video processor BLITTER */
94 {132, 4, 20, 4, 20, 13}, /* UART0 */
95 {134, 4, 20, 4, 22, 13}, /* UART2 */
96 {136, 4, 24, 4, 24, 13}, /* IO_PIO0 */
97 {140, 4, 28, 4, 28, 13}, /* EMPI */
98 {144, 8, 0, 8, 0, 13}, /* MAFE */
99 {148, 8, 4, 8, 4, 13}, /* PWM */
100 {152, 8, 8, 8, 8, 13}, /* SSC1 */
101 {156, 8, 12, 8, 12, 13}, /* IO_PIO1 */
102 {160, 8, 16, 8, 16, 13}, /* USB target */
103 {164, 8, 20, 8, 20, 13}, /* UART1 */
104 {168, 8, 24, 8, 24, 13}, /* Teletext */
105 {172, 8, 28, 8, 28, 13}, /* VideoSync VTG */
106 {173, 8, 28, 8, 29, 13}, /* VideoSync DVP0 */
107 {174, 8, 28, 8, 30, 13}, /* VideoSync DVP1 */
108#endif
109#elif defined(CONFIG_CPU_SUBTYPE_SH7760)
110/*
111 * SH7760 INTC2-Style interrupts, vectors IRQ48-111 INTEVT 0x800-0xFE0
112 */
113 /* INTPRIO0 | INTMSK0 */
114 {48, 0, 28, 0, 31, 3}, /* IRQ 4 */
115 {49, 0, 24, 0, 30, 3}, /* IRQ 3 */
116 {50, 0, 20, 0, 29, 3}, /* IRQ 2 */
117 {51, 0, 16, 0, 28, 3}, /* IRQ 1 */
118 /* 52-55 (INTEVT 0x880-0x8E0) unused/reserved */
119 /* INTPRIO4 | INTMSK0 */
120 {56, 4, 28, 0, 25, 3}, /* HCAN2_CHAN0 */
121 {57, 4, 24, 0, 24, 3}, /* HCAN2_CHAN1 */
122 {58, 4, 20, 0, 23, 3}, /* I2S_CHAN0 */
123 {59, 4, 16, 0, 22, 3}, /* I2S_CHAN1 */
124 {60, 4, 12, 0, 21, 3}, /* AC97_CHAN0 */
125 {61, 4, 8, 0, 20, 3}, /* AC97_CHAN1 */
126 {62, 4, 4, 0, 19, 3}, /* I2C_CHAN0 */
127 {63, 4, 0, 0, 18, 3}, /* I2C_CHAN1 */
128 /* INTPRIO8 | INTMSK0 */
129 {52, 8, 16, 0, 11, 3}, /* SCIF0_ERI_IRQ */
130 {53, 8, 16, 0, 10, 3}, /* SCIF0_RXI_IRQ */
131 {54, 8, 16, 0, 9, 3}, /* SCIF0_BRI_IRQ */
132 {55, 8, 16, 0, 8, 3}, /* SCIF0_TXI_IRQ */
133 {64, 8, 28, 0, 17, 3}, /* USBHI_IRQ */
134 {65, 8, 24, 0, 16, 3}, /* LCDC */
135 /* 66, 67 unused */
136 {68, 8, 20, 0, 14, 13}, /* DMABRGI0_IRQ */
137 {69, 8, 20, 0, 13, 13}, /* DMABRGI1_IRQ */
138 {70, 8, 20, 0, 12, 13}, /* DMABRGI2_IRQ */
139 /* 71 unused */
140 {72, 8, 12, 0, 7, 3}, /* SCIF1_ERI_IRQ */
141 {73, 8, 12, 0, 6, 3}, /* SCIF1_RXI_IRQ */
142 {74, 8, 12, 0, 5, 3}, /* SCIF1_BRI_IRQ */
143 {75, 8, 12, 0, 4, 3}, /* SCIF1_TXI_IRQ */
144 {76, 8, 8, 0, 3, 3}, /* SCIF2_ERI_IRQ */
145 {77, 8, 8, 0, 2, 3}, /* SCIF2_RXI_IRQ */
146 {78, 8, 8, 0, 1, 3}, /* SCIF2_BRI_IRQ */
147 {79, 8, 8, 0, 0, 3}, /* SCIF2_TXI_IRQ */
148 /* | INTMSK4 */
149 {80, 8, 4, 4, 23, 3}, /* SIM_ERI */
150 {81, 8, 4, 4, 22, 3}, /* SIM_RXI */
151 {82, 8, 4, 4, 21, 3}, /* SIM_TXI */
152 {83, 8, 4, 4, 20, 3}, /* SIM_TEI */
153 {84, 8, 0, 4, 19, 3}, /* HSPII */
154 /* INTPRIOC | INTMSK4 */
155 /* 85-87 unused/reserved */
156 {88, 12, 20, 4, 18, 3}, /* MMCI0 */
157 {89, 12, 20, 4, 17, 3}, /* MMCI1 */
158 {90, 12, 20, 4, 16, 3}, /* MMCI2 */
159 {91, 12, 20, 4, 15, 3}, /* MMCI3 */
160 {92, 12, 12, 4, 6, 3}, /* MFI (unsure, bug? in my 7760 manual*/
161 /* 93-107 reserved/undocumented */
162 {108,12, 4, 4, 1, 3}, /* ADC */
163 {109,12, 0, 4, 0, 3}, /* CMTI */
164 /* 110-111 reserved/unused */
165#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
166 { TIMER_IRQ, 0, 24, 0, INTC_TMU0_MSK, 2},
167 { 21, 1, 0, 0, INTC_RTC_MSK, TIMER_PRIORITY },
168 { 22, 1, 1, 0, INTC_RTC_MSK, TIMER_PRIORITY },
169 { 23, 1, 2, 0, INTC_RTC_MSK, TIMER_PRIORITY },
170 { SCIF0_ERI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
171 { SCIF0_RXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
172 { SCIF0_BRI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
173 { SCIF0_TXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
174 63
175 { SCIF1_ERI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY }, 64 ipr = ctrl_inl(INTC2_BASE + INTC2_INTPRI_OFFSET +
176 { SCIF1_RXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY }, 65 p->ipr_offset);
177 { SCIF1_BRI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY }, 66 ipr &= ~(0xf << p->ipr_shift);
178 { SCIF1_TXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY }, 67 ipr |= p->priority << p->ipr_shift;
68 ctrl_outl(ipr, INTC2_BASE + INTC2_INTPRI_OFFSET +
69 p->ipr_offset);
179 70
180 { PCIC0_IRQ, 0x10, 8, 0, INTC_PCIC0_MSK, PCIC0_PRIORITY }, 71 local_irq_restore(flags);
181 { PCIC1_IRQ, 0x10, 0, 0, INTC_PCIC1_MSK, PCIC1_PRIORITY },
182 { PCIC2_IRQ, 0x14, 24, 0, INTC_PCIC2_MSK, PCIC2_PRIORITY },
183 { PCIC3_IRQ, 0x14, 16, 0, INTC_PCIC3_MSK, PCIC3_PRIORITY },
184 { PCIC4_IRQ, 0x14, 8, 0, INTC_PCIC4_MSK, PCIC4_PRIORITY },
185#endif
186};
187 72
188void __init init_IRQ_intc2(void) 73 set_irq_chip_and_handler_name(p->irq, &intc2_irq_chip,
189{ 74 handle_level_irq, "level");
190 int i; 75 set_irq_chip_data(p->irq, p);
191 76
192 for (i = 0; i < ARRAY_SIZE(intc2_irq_table); i++) 77 enable_intc2_irq(p->irq);
193 make_intc2_irq(intc2_irq_table + i); 78 }
194} 79}
diff --git a/arch/sh/kernel/cpu/irq/ipr.c b/arch/sh/kernel/cpu/irq/ipr.c
index 8944abdf6e1..a0089563cbf 100644
--- a/arch/sh/kernel/cpu/irq/ipr.c
+++ b/arch/sh/kernel/cpu/irq/ipr.c
@@ -23,93 +23,81 @@
23#include <asm/io.h> 23#include <asm/io.h>
24#include <asm/machvec.h> 24#include <asm/machvec.h>
25 25
26struct ipr_data {
27 unsigned int addr; /* Address of Interrupt Priority Register */
28 int shift; /* Shifts of the 16-bit data */
29 int priority; /* The priority */
30};
31 26
32static void disable_ipr_irq(unsigned int irq) 27static void disable_ipr_irq(unsigned int irq)
33{ 28{
34 struct ipr_data *p = get_irq_chip_data(irq); 29 struct ipr_data *p = get_irq_chip_data(irq);
30 int shift = p->shift*4;
35 /* Set the priority in IPR to 0 */ 31 /* Set the priority in IPR to 0 */
36 ctrl_outw(ctrl_inw(p->addr) & (0xffff ^ (0xf << p->shift)), p->addr); 32 ctrl_outw(ctrl_inw(p->addr) & (0xffff ^ (0xf << shift)), p->addr);
37} 33}
38 34
39static void enable_ipr_irq(unsigned int irq) 35static void enable_ipr_irq(unsigned int irq)
40{ 36{
41 struct ipr_data *p = get_irq_chip_data(irq); 37 struct ipr_data *p = get_irq_chip_data(irq);
38 int shift = p->shift*4;
42 /* Set priority in IPR back to original value */ 39 /* Set priority in IPR back to original value */
43 ctrl_outw(ctrl_inw(p->addr) | (p->priority << p->shift), p->addr); 40 ctrl_outw(ctrl_inw(p->addr) | (p->priority << shift), p->addr);
44} 41}
45 42
46static struct irq_chip ipr_irq_chip = { 43static struct irq_chip ipr_irq_chip = {
47 .name = "ipr", 44 .name = "IPR",
48 .mask = disable_ipr_irq, 45 .mask = disable_ipr_irq,
49 .unmask = enable_ipr_irq, 46 .unmask = enable_ipr_irq,
50 .mask_ack = disable_ipr_irq, 47 .mask_ack = disable_ipr_irq,
51}; 48};
52 49
53void make_ipr_irq(unsigned int irq, unsigned int addr, int pos, int priority) 50void make_ipr_irq(struct ipr_data *table, unsigned int nr_irqs)
54{ 51{
55 struct ipr_data ipr_data; 52 int i;
56 53
57 disable_irq_nosync(irq); 54 for (i = 0; i < nr_irqs; i++) {
58 55 unsigned int irq = table[i].irq;
59 ipr_data.addr = addr; 56 disable_irq_nosync(irq);
60 ipr_data.shift = pos*4; /* POSition (0-3) x 4 means shift */ 57 set_irq_chip_and_handler_name(irq, &ipr_irq_chip,
61 ipr_data.priority = priority; 58 handle_level_irq, "level");
62 59 set_irq_chip_data(irq, &table[i]);
63 set_irq_chip_and_handler(irq, &ipr_irq_chip, handle_level_irq); 60 enable_ipr_irq(irq);
64 set_irq_chip_data(irq, &ipr_data); 61 }
65
66 enable_ipr_irq(irq);
67} 62}
63EXPORT_SYMBOL(make_ipr_irq);
68 64
69/* XXX: This needs to die a horrible death.. */ 65static struct ipr_data sys_ipr_map[] = {
70void __init init_IRQ(void)
71{
72#ifndef CONFIG_CPU_SUBTYPE_SH7780 66#ifndef CONFIG_CPU_SUBTYPE_SH7780
73 make_ipr_irq(TIMER_IRQ, TIMER_IPR_ADDR, TIMER_IPR_POS, TIMER_PRIORITY); 67 { TIMER_IRQ, TIMER_IPR_ADDR, TIMER_IPR_POS, TIMER_PRIORITY },
74 make_ipr_irq(TIMER1_IRQ, TIMER1_IPR_ADDR, TIMER1_IPR_POS, TIMER1_PRIORITY); 68 { TIMER1_IRQ, TIMER1_IPR_ADDR, TIMER1_IPR_POS, TIMER1_PRIORITY },
75#ifdef RTC_IRQ 69#ifdef RTC_IRQ
76 make_ipr_irq(RTC_IRQ, RTC_IPR_ADDR, RTC_IPR_POS, RTC_PRIORITY); 70 { RTC_IRQ, RTC_IPR_ADDR, RTC_IPR_POS, RTC_PRIORITY },
77#endif 71#endif
78
79#ifdef SCI_ERI_IRQ 72#ifdef SCI_ERI_IRQ
80 make_ipr_irq(SCI_ERI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY); 73 { SCI_ERI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY },
81 make_ipr_irq(SCI_RXI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY); 74 { SCI_RXI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY },
82 make_ipr_irq(SCI_TXI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY); 75 { SCI_TXI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY },
83#endif 76#endif
84
85#ifdef SCIF1_ERI_IRQ 77#ifdef SCIF1_ERI_IRQ
86 make_ipr_irq(SCIF1_ERI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY); 78 { SCIF1_ERI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY },
87 make_ipr_irq(SCIF1_RXI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY); 79 { SCIF1_RXI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY },
88 make_ipr_irq(SCIF1_BRI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY); 80 { SCIF1_BRI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY },
89 make_ipr_irq(SCIF1_TXI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY); 81 { SCIF1_TXI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY },
90#endif 82#endif
91
92#if defined(CONFIG_CPU_SUBTYPE_SH7300) 83#if defined(CONFIG_CPU_SUBTYPE_SH7300)
93 make_ipr_irq(SCIF0_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY); 84 { SCIF0_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
94 make_ipr_irq(DMTE2_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY); 85 { DMTE2_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY },
95 make_ipr_irq(DMTE3_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY); 86 { DMTE3_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY },
96 make_ipr_irq(VIO_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY); 87 { VIO_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY },
97#endif 88#endif
98
99#ifdef SCIF_ERI_IRQ 89#ifdef SCIF_ERI_IRQ
100 make_ipr_irq(SCIF_ERI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY); 90 { SCIF_ERI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY },
101 make_ipr_irq(SCIF_RXI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY); 91 { SCIF_RXI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY },
102 make_ipr_irq(SCIF_BRI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY); 92 { SCIF_BRI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY },
103 make_ipr_irq(SCIF_TXI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY); 93 { SCIF_TXI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY },
104#endif 94#endif
105
106#ifdef IRDA_ERI_IRQ 95#ifdef IRDA_ERI_IRQ
107 make_ipr_irq(IRDA_ERI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY); 96 { IRDA_ERI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY },
108 make_ipr_irq(IRDA_RXI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY); 97 { IRDA_RXI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY },
109 make_ipr_irq(IRDA_BRI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY); 98 { IRDA_BRI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY },
110 make_ipr_irq(IRDA_TXI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY); 99 { IRDA_TXI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY },
111#endif 100#endif
112
113#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \ 101#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \
114 defined(CONFIG_CPU_SUBTYPE_SH7706) || \ 102 defined(CONFIG_CPU_SUBTYPE_SH7706) || \
115 defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705) 103 defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705)
@@ -123,14 +111,19 @@ void __init init_IRQ(void)
123 * You should set corresponding bits of PFC to "00" 111 * You should set corresponding bits of PFC to "00"
124 * to enable these interrupts. 112 * to enable these interrupts.
125 */ 113 */
126 make_ipr_irq(IRQ0_IRQ, IRQ0_IPR_ADDR, IRQ0_IPR_POS, IRQ0_PRIORITY); 114 { IRQ0_IRQ, IRQ0_IPR_ADDR, IRQ0_IPR_POS, IRQ0_PRIORITY },
127 make_ipr_irq(IRQ1_IRQ, IRQ1_IPR_ADDR, IRQ1_IPR_POS, IRQ1_PRIORITY); 115 { IRQ1_IRQ, IRQ1_IPR_ADDR, IRQ1_IPR_POS, IRQ1_PRIORITY },
128 make_ipr_irq(IRQ2_IRQ, IRQ2_IPR_ADDR, IRQ2_IPR_POS, IRQ2_PRIORITY); 116 { IRQ2_IRQ, IRQ2_IPR_ADDR, IRQ2_IPR_POS, IRQ2_PRIORITY },
129 make_ipr_irq(IRQ3_IRQ, IRQ3_IPR_ADDR, IRQ3_IPR_POS, IRQ3_PRIORITY); 117 { IRQ3_IRQ, IRQ3_IPR_ADDR, IRQ3_IPR_POS, IRQ3_PRIORITY },
130 make_ipr_irq(IRQ4_IRQ, IRQ4_IPR_ADDR, IRQ4_IPR_POS, IRQ4_PRIORITY); 118 { IRQ4_IRQ, IRQ4_IPR_ADDR, IRQ4_IPR_POS, IRQ4_PRIORITY },
131 make_ipr_irq(IRQ5_IRQ, IRQ5_IPR_ADDR, IRQ5_IPR_POS, IRQ5_PRIORITY); 119 { IRQ5_IRQ, IRQ5_IPR_ADDR, IRQ5_IPR_POS, IRQ5_PRIORITY },
132#endif 120#endif
133#endif 121#endif
122};
123
124void __init init_IRQ(void)
125{
126 make_ipr_irq(sys_ipr_map, ARRAY_SIZE(sys_ipr_map));
134 127
135#ifdef CONFIG_CPU_HAS_PINT_IRQ 128#ifdef CONFIG_CPU_HAS_PINT_IRQ
136 init_IRQ_pint(); 129 init_IRQ_pint();
@@ -152,5 +145,3 @@ int ipr_irq_demux(int irq)
152 return irq; 145 return irq;
153} 146}
154#endif 147#endif
155
156EXPORT_SYMBOL(make_ipr_irq);
diff --git a/arch/sh/kernel/cpu/irq/pint.c b/arch/sh/kernel/cpu/irq/pint.c
index 17f47b373d6..f60007783a2 100644
--- a/arch/sh/kernel/cpu/irq/pint.c
+++ b/arch/sh/kernel/cpu/irq/pint.c
@@ -84,12 +84,16 @@ void make_pint_irq(unsigned int irq)
84 disable_pint_irq(irq); 84 disable_pint_irq(irq);
85} 85}
86 86
87static struct ipr_data pint_ipr_map[] = {
88 { PINT0_IRQ, PINT0_IPR_ADDR, PINT0_IPR_POS, PINT0_PRIORITY },
89 { PINT8_IRQ, PINT8_IPR_ADDR, PINT8_IPR_POS, PINT8_PRIORITY },
90};
91
87void __init init_IRQ_pint(void) 92void __init init_IRQ_pint(void)
88{ 93{
89 int i; 94 int i;
90 95
91 make_ipr_irq(PINT0_IRQ, PINT0_IPR_ADDR, PINT0_IPR_POS, PINT0_PRIORITY); 96 make_ipr_irq(pint_ipr_map, ARRAY_SIZE(pint_ipr_map));
92 make_ipr_irq(PINT8_IRQ, PINT8_IPR_ADDR, PINT8_IPR_POS, PINT8_PRIORITY);
93 97
94 enable_irq(PINT0_IRQ); 98 enable_irq(PINT0_IRQ);
95 enable_irq(PINT8_IRQ); 99 enable_irq(PINT8_IRQ);
diff --git a/arch/sh/kernel/cpu/sh3/ex.S b/arch/sh/kernel/cpu/sh3/ex.S
index 6be46f0686b..ba3082d640b 100644
--- a/arch/sh/kernel/cpu/sh3/ex.S
+++ b/arch/sh/kernel/cpu/sh3/ex.S
@@ -4,7 +4,7 @@
4 * The SH-3 exception vector table. 4 * The SH-3 exception vector table.
5 5
6 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka 6 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka
7 * Copyright (C) 2003 Paul Mundt 7 * Copyright (C) 2003 - 2006 Paul Mundt
8 * 8 *
9 * This file is subject to the terms and conditions of the GNU General Public 9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive 10 * License. See the file "COPYING" in the main directory of this archive
@@ -49,3 +49,10 @@ ENTRY(nmi_slot)
49#endif 49#endif
50ENTRY(user_break_point_trap) 50ENTRY(user_break_point_trap)
51 .long break_point_trap /* 1E0 */ 51 .long break_point_trap /* 1E0 */
52
53 /*
54 * Pad the remainder of the table out, exceptions residing in far
55 * away offsets can be manually inserted in to their appropriate
56 * location via set_exception_table_{evt,vec}().
57 */
58 .balign 4096,0,4096
diff --git a/arch/sh/kernel/cpu/sh4/ex.S b/arch/sh/kernel/cpu/sh4/ex.S
index 3f4cd043e90..ac8ab57413c 100644
--- a/arch/sh/kernel/cpu/sh4/ex.S
+++ b/arch/sh/kernel/cpu/sh4/ex.S
@@ -4,7 +4,7 @@
4 * The SH-4 exception vector table. 4 * The SH-4 exception vector table.
5 5
6 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka 6 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka
7 * Copyright (C) 2003 Paul Mundt 7 * Copyright (C) 2003 - 2006 Paul Mundt
8 * 8 *
9 * This file is subject to the terms and conditions of the GNU General Public 9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive 10 * License. See the file "COPYING" in the main directory of this archive
@@ -53,3 +53,10 @@ ENTRY(nmi_slot)
53#endif 53#endif
54ENTRY(user_break_point_trap) 54ENTRY(user_break_point_trap)
55 .long break_point_trap /* 1E0 */ 55 .long break_point_trap /* 1E0 */
56
57 /*
58 * Pad the remainder of the table out, exceptions residing in far
59 * away offsets can be manually inserted in to their appropriate
60 * location via set_exception_table_{evt,vec}().
61 */
62 .balign 4096,0,4096
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7760.c b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
index 97f1c9af35d..07e5377bf55 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7760.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
@@ -51,3 +51,66 @@ static int __init sh7760_devices_setup(void)
51 ARRAY_SIZE(sh7760_devices)); 51 ARRAY_SIZE(sh7760_devices));
52} 52}
53__initcall(sh7760_devices_setup); 53__initcall(sh7760_devices_setup);
54
55/*
56 * SH7760 INTC2-Style interrupts, vectors IRQ48-111 INTEVT 0x800-0xFE0
57 */
58static struct intc2_data intc2_irq_table[] = {
59 /* INTPRIO0 | INTMSK0 */
60 {48, 0, 28, 0, 31, 3}, /* IRQ 4 */
61 {49, 0, 24, 0, 30, 3}, /* IRQ 3 */
62 {50, 0, 20, 0, 29, 3}, /* IRQ 2 */
63 {51, 0, 16, 0, 28, 3}, /* IRQ 1 */
64 /* 52-55 (INTEVT 0x880-0x8E0) unused/reserved */
65 /* INTPRIO4 | INTMSK0 */
66 {56, 4, 28, 0, 25, 3}, /* HCAN2_CHAN0 */
67 {57, 4, 24, 0, 24, 3}, /* HCAN2_CHAN1 */
68 {58, 4, 20, 0, 23, 3}, /* I2S_CHAN0 */
69 {59, 4, 16, 0, 22, 3}, /* I2S_CHAN1 */
70 {60, 4, 12, 0, 21, 3}, /* AC97_CHAN0 */
71 {61, 4, 8, 0, 20, 3}, /* AC97_CHAN1 */
72 {62, 4, 4, 0, 19, 3}, /* I2C_CHAN0 */
73 {63, 4, 0, 0, 18, 3}, /* I2C_CHAN1 */
74 /* INTPRIO8 | INTMSK0 */
75 {52, 8, 16, 0, 11, 3}, /* SCIF0_ERI_IRQ */
76 {53, 8, 16, 0, 10, 3}, /* SCIF0_RXI_IRQ */
77 {54, 8, 16, 0, 9, 3}, /* SCIF0_BRI_IRQ */
78 {55, 8, 16, 0, 8, 3}, /* SCIF0_TXI_IRQ */
79 {64, 8, 28, 0, 17, 3}, /* USBHI_IRQ */
80 {65, 8, 24, 0, 16, 3}, /* LCDC */
81 /* 66, 67 unused */
82 {68, 8, 20, 0, 14, 13}, /* DMABRGI0_IRQ */
83 {69, 8, 20, 0, 13, 13}, /* DMABRGI1_IRQ */
84 {70, 8, 20, 0, 12, 13}, /* DMABRGI2_IRQ */
85 /* 71 unused */
86 {72, 8, 12, 0, 7, 3}, /* SCIF1_ERI_IRQ */
87 {73, 8, 12, 0, 6, 3}, /* SCIF1_RXI_IRQ */
88 {74, 8, 12, 0, 5, 3}, /* SCIF1_BRI_IRQ */
89 {75, 8, 12, 0, 4, 3}, /* SCIF1_TXI_IRQ */
90 {76, 8, 8, 0, 3, 3}, /* SCIF2_ERI_IRQ */
91 {77, 8, 8, 0, 2, 3}, /* SCIF2_RXI_IRQ */
92 {78, 8, 8, 0, 1, 3}, /* SCIF2_BRI_IRQ */
93 {79, 8, 8, 0, 0, 3}, /* SCIF2_TXI_IRQ */
94 /* | INTMSK4 */
95 {80, 8, 4, 4, 23, 3}, /* SIM_ERI */
96 {81, 8, 4, 4, 22, 3}, /* SIM_RXI */
97 {82, 8, 4, 4, 21, 3}, /* SIM_TXI */
98 {83, 8, 4, 4, 20, 3}, /* SIM_TEI */
99 {84, 8, 0, 4, 19, 3}, /* HSPII */
100 /* INTPRIOC | INTMSK4 */
101 /* 85-87 unused/reserved */
102 {88, 12, 20, 4, 18, 3}, /* MMCI0 */
103 {89, 12, 20, 4, 17, 3}, /* MMCI1 */
104 {90, 12, 20, 4, 16, 3}, /* MMCI2 */
105 {91, 12, 20, 4, 15, 3}, /* MMCI3 */
106 {92, 12, 12, 4, 6, 3}, /* MFI (unsure, bug? in my 7760 manual*/
107 /* 93-107 reserved/undocumented */
108 {108,12, 4, 4, 1, 3}, /* ADC */
109 {109,12, 0, 4, 0, 3}, /* CMTI */
110 /* 110-111 reserved/unused */
111};
112
113void __init init_IRQ_intc2(void)
114{
115 make_intc2_irq(intc2_irq_table, ARRAY_SIZE(intc2_irq_table));
116}
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7780.c b/arch/sh/kernel/cpu/sh4/setup-sh7780.c
index 72493f259ed..814ddb22653 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7780.c
@@ -77,3 +77,30 @@ static int __init sh7780_devices_setup(void)
77 ARRAY_SIZE(sh7780_devices)); 77 ARRAY_SIZE(sh7780_devices));
78} 78}
79__initcall(sh7780_devices_setup); 79__initcall(sh7780_devices_setup);
80
81static struct intc2_data intc2_irq_table[] = {
82 { TIMER_IRQ, 0, 24, 0, INTC_TMU0_MSK, 2 },
83 { 21, 1, 0, 0, INTC_RTC_MSK, TIMER_PRIORITY },
84 { 22, 1, 1, 0, INTC_RTC_MSK, TIMER_PRIORITY },
85 { 23, 1, 2, 0, INTC_RTC_MSK, TIMER_PRIORITY },
86 { SCIF0_ERI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
87 { SCIF0_RXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
88 { SCIF0_BRI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
89 { SCIF0_TXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
90
91 { SCIF1_ERI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
92 { SCIF1_RXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
93 { SCIF1_BRI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
94 { SCIF1_TXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
95
96 { PCIC0_IRQ, 0x10, 8, 0, INTC_PCIC0_MSK, PCIC0_PRIORITY },
97 { PCIC1_IRQ, 0x10, 0, 0, INTC_PCIC1_MSK, PCIC1_PRIORITY },
98 { PCIC2_IRQ, 0x14, 24, 0, INTC_PCIC2_MSK, PCIC2_PRIORITY },
99 { PCIC3_IRQ, 0x14, 16, 0, INTC_PCIC3_MSK, PCIC3_PRIORITY },
100 { PCIC4_IRQ, 0x14, 8, 0, INTC_PCIC4_MSK, PCIC4_PRIORITY },
101};
102
103void __init init_IRQ_intc2(void)
104{
105 make_intc2_irq(intc2_irq_table, ARRAY_SIZE(intc2_irq_table));
106}
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index acf2602569c..944128ce970 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -54,7 +54,7 @@ int show_interrupts(struct seq_file *p, void *v)
54 for_each_online_cpu(j) 54 for_each_online_cpu(j)
55 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 55 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
56 seq_printf(p, " %14s", irq_desc[i].chip->name); 56 seq_printf(p, " %14s", irq_desc[i].chip->name);
57 seq_printf(p, "-%s", handle_irq_name(irq_desc[i].handle_irq)); 57 seq_printf(p, "-%-8s", irq_desc[i].name);
58 seq_printf(p, " %s", action->name); 58 seq_printf(p, " %s", action->name);
59 59
60 for (action=action->next; action; action = action->next) 60 for (action=action->next; action; action = action->next)
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 91516dca4a8..a52b13ac6b7 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -105,7 +105,7 @@ void show_regs(struct pt_regs * regs)
105{ 105{
106 printk("\n"); 106 printk("\n");
107 printk("Pid : %d, Comm: %20s\n", current->pid, current->comm); 107 printk("Pid : %d, Comm: %20s\n", current->pid, current->comm);
108 print_symbol("PC is at %s\n", regs->pc); 108 print_symbol("PC is at %s\n", instruction_pointer(regs));
109 printk("PC : %08lx SP : %08lx SR : %08lx ", 109 printk("PC : %08lx SP : %08lx SR : %08lx ",
110 regs->pc, regs->regs[15], regs->sr); 110 regs->pc, regs->regs[15], regs->sr);
111#ifdef CONFIG_MMU 111#ifdef CONFIG_MMU
@@ -130,15 +130,7 @@ void show_regs(struct pt_regs * regs)
130 printk("MACH: %08lx MACL: %08lx GBR : %08lx PR : %08lx\n", 130 printk("MACH: %08lx MACL: %08lx GBR : %08lx PR : %08lx\n",
131 regs->mach, regs->macl, regs->gbr, regs->pr); 131 regs->mach, regs->macl, regs->gbr, regs->pr);
132 132
133 /* 133 show_trace(NULL, (unsigned long *)regs->regs[15], regs);
134 * If we're in kernel mode, dump the stack too..
135 */
136 if (!user_mode(regs)) {
137 extern void show_task(unsigned long *sp);
138 unsigned long sp = regs->regs[15];
139
140 show_task((unsigned long *)sp);
141 }
142} 134}
143 135
144/* 136/*
diff --git a/arch/sh/kernel/sh_ksyms.c b/arch/sh/kernel/sh_ksyms.c
index 9daad70bc30..8a2fd19dc9e 100644
--- a/arch/sh/kernel/sh_ksyms.c
+++ b/arch/sh/kernel/sh_ksyms.c
@@ -18,7 +18,6 @@
18#include <asm/delay.h> 18#include <asm/delay.h>
19#include <asm/tlbflush.h> 19#include <asm/tlbflush.h>
20#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
21#include <asm/checksum.h>
22 21
23extern int dump_fpu(struct pt_regs *, elf_fpregset_t *); 22extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
24extern struct hw_interrupt_type no_irq_type; 23extern struct hw_interrupt_type no_irq_type;
diff --git a/arch/sh/kernel/syscalls.S b/arch/sh/kernel/syscalls.S
index 768334e9507..ca81976e9e3 100644
--- a/arch/sh/kernel/syscalls.S
+++ b/arch/sh/kernel/syscalls.S
@@ -351,3 +351,6 @@ ENTRY(sys_call_table)
351 .long sys_sync_file_range 351 .long sys_sync_file_range
352 .long sys_tee /* 315 */ 352 .long sys_tee /* 315 */
353 .long sys_vmsplice 353 .long sys_vmsplice
354 .long sys_move_pages
355 .long sys_getcpu
356 .long sys_epoll_pwait
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
index c2c597e0948..53dfa55f315 100644
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -1,38 +1,25 @@
1/* $Id: traps.c,v 1.17 2004/05/02 01:46:30 sugioka Exp $ 1/*
2 * 2 * 'traps.c' handles hardware traps and faults after we have saved some
3 * linux/arch/sh/traps.c 3 * state in 'entry.S'.
4 * 4 *
5 * SuperH version: Copyright (C) 1999 Niibe Yutaka 5 * SuperH version: Copyright (C) 1999 Niibe Yutaka
6 * Copyright (C) 2000 Philipp Rumpf 6 * Copyright (C) 2000 Philipp Rumpf
7 * Copyright (C) 2000 David Howells 7 * Copyright (C) 2000 David Howells
8 * Copyright (C) 2002, 2003 Paul Mundt 8 * Copyright (C) 2002 - 2006 Paul Mundt
9 */ 9 *
10 10 * This file is subject to the terms and conditions of the GNU General Public
11/* 11 * License. See the file "COPYING" in the main directory of this archive
12 * 'Traps.c' handles hardware traps and faults after we have saved some 12 * for more details.
13 * state in 'entry.S'.
14 */ 13 */
15#include <linux/sched.h>
16#include <linux/kernel.h> 14#include <linux/kernel.h>
17#include <linux/string.h>
18#include <linux/errno.h>
19#include <linux/ptrace.h> 15#include <linux/ptrace.h>
20#include <linux/timer.h>
21#include <linux/mm.h>
22#include <linux/smp.h>
23#include <linux/smp_lock.h>
24#include <linux/init.h> 16#include <linux/init.h>
25#include <linux/delay.h>
26#include <linux/spinlock.h> 17#include <linux/spinlock.h>
27#include <linux/module.h> 18#include <linux/module.h>
28#include <linux/kallsyms.h> 19#include <linux/kallsyms.h>
29 20#include <linux/io.h>
30#include <asm/system.h> 21#include <asm/system.h>
31#include <asm/uaccess.h> 22#include <asm/uaccess.h>
32#include <asm/io.h>
33#include <asm/atomic.h>
34#include <asm/processor.h>
35#include <asm/sections.h>
36 23
37#ifdef CONFIG_SH_KGDB 24#ifdef CONFIG_SH_KGDB
38#include <asm/kgdb.h> 25#include <asm/kgdb.h>
@@ -53,13 +40,32 @@
53#define TRAP_ILLEGAL_SLOT_INST 13 40#define TRAP_ILLEGAL_SLOT_INST 13
54#endif 41#endif
55 42
56/* 43static void dump_mem(const char *str, unsigned long bottom, unsigned long top)
57 * These constants are for searching for possible module text 44{
58 * segments. VMALLOC_OFFSET comes from mm/vmalloc.c; MODULE_RANGE is 45 unsigned long p;
59 * a guess of how much space is likely to be vmalloced. 46 int i;
60 */ 47
61#define VMALLOC_OFFSET (8*1024*1024) 48 printk("%s(0x%08lx to 0x%08lx)\n", str, bottom, top);
62#define MODULE_RANGE (8*1024*1024) 49
50 for (p = bottom & ~31; p < top; ) {
51 printk("%04lx: ", p & 0xffff);
52
53 for (i = 0; i < 8; i++, p += 4) {
54 unsigned int val;
55
56 if (p < bottom || p >= top)
57 printk(" ");
58 else {
59 if (__get_user(val, (unsigned int __user *)p)) {
60 printk("\n");
61 return;
62 }
63 printk("%08x ", val);
64 }
65 }
66 printk("\n");
67 }
68}
63 69
64DEFINE_SPINLOCK(die_lock); 70DEFINE_SPINLOCK(die_lock);
65 71
@@ -69,14 +75,28 @@ void die(const char * str, struct pt_regs * regs, long err)
69 75
70 console_verbose(); 76 console_verbose();
71 spin_lock_irq(&die_lock); 77 spin_lock_irq(&die_lock);
78 bust_spinlocks(1);
79
72 printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); 80 printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
81
73 CHK_REMOTE_DEBUG(regs); 82 CHK_REMOTE_DEBUG(regs);
83 print_modules();
74 show_regs(regs); 84 show_regs(regs);
85
86 printk("Process: %s (pid: %d, stack limit = %p)\n",
87 current->comm, current->pid, task_stack_page(current) + 1);
88
89 if (!user_mode(regs) || in_interrupt())
90 dump_mem("Stack: ", regs->regs[15], THREAD_SIZE +
91 (unsigned long)task_stack_page(current));
92
93 bust_spinlocks(0);
75 spin_unlock_irq(&die_lock); 94 spin_unlock_irq(&die_lock);
76 do_exit(SIGSEGV); 95 do_exit(SIGSEGV);
77} 96}
78 97
79static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err) 98static inline void die_if_kernel(const char *str, struct pt_regs *regs,
99 long err)
80{ 100{
81 if (!user_mode(regs)) 101 if (!user_mode(regs))
82 die(str, regs, err); 102 die(str, regs, err);
@@ -93,8 +113,7 @@ static int handle_unaligned_notify_count = 10;
93 */ 113 */
94static int die_if_no_fixup(const char * str, struct pt_regs * regs, long err) 114static int die_if_no_fixup(const char * str, struct pt_regs * regs, long err)
95{ 115{
96 if (!user_mode(regs)) 116 if (!user_mode(regs)) {
97 {
98 const struct exception_table_entry *fixup; 117 const struct exception_table_entry *fixup;
99 fixup = search_exception_tables(regs->pc); 118 fixup = search_exception_tables(regs->pc);
100 if (fixup) { 119 if (fixup) {
@@ -550,7 +569,10 @@ int is_dsp_inst(struct pt_regs *regs)
550#define is_dsp_inst(regs) (0) 569#define is_dsp_inst(regs) (0)
551#endif /* CONFIG_SH_DSP */ 570#endif /* CONFIG_SH_DSP */
552 571
553extern int do_fpu_inst(unsigned short, struct pt_regs*); 572/* arch/sh/kernel/cpu/sh4/fpu.c */
573extern int do_fpu_inst(unsigned short, struct pt_regs *);
574extern asmlinkage void do_fpu_state_restore(unsigned long r4, unsigned long r5,
575 unsigned long r6, unsigned long r7, struct pt_regs regs);
554 576
555asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5, 577asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5,
556 unsigned long r6, unsigned long r7, 578 unsigned long r6, unsigned long r7,
@@ -709,14 +731,20 @@ void __init per_cpu_trap_init(void)
709 : "memory"); 731 : "memory");
710} 732}
711 733
712void __init trap_init(void) 734void *set_exception_table_vec(unsigned int vec, void *handler)
713{ 735{
714 extern void *exception_handling_table[]; 736 extern void *exception_handling_table[];
737 void *old_handler;
738
739 old_handler = exception_handling_table[vec];
740 exception_handling_table[vec] = handler;
741 return old_handler;
742}
715 743
716 exception_handling_table[TRAP_RESERVED_INST] 744void __init trap_init(void)
717 = (void *)do_reserved_inst; 745{
718 exception_handling_table[TRAP_ILLEGAL_SLOT_INST] 746 set_exception_table_vec(TRAP_RESERVED_INST, do_reserved_inst);
719 = (void *)do_illegal_slot_inst; 747 set_exception_table_vec(TRAP_ILLEGAL_SLOT_INST, do_illegal_slot_inst);
720 748
721#if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_FPU) || \ 749#if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_FPU) || \
722 defined(CONFIG_SH_FPU_EMU) 750 defined(CONFIG_SH_FPU_EMU)
@@ -725,61 +753,54 @@ void __init trap_init(void)
725 * reserved. They'll be handled in the math-emu case, or faulted on 753 * reserved. They'll be handled in the math-emu case, or faulted on
726 * otherwise. 754 * otherwise.
727 */ 755 */
728 /* entry 64 corresponds to EXPEVT=0x800 */ 756 set_exception_table_evt(0x800, do_reserved_inst);
729 exception_handling_table[64] = (void *)do_reserved_inst; 757 set_exception_table_evt(0x820, do_illegal_slot_inst);
730 exception_handling_table[65] = (void *)do_illegal_slot_inst; 758#elif defined(CONFIG_SH_FPU)
759 set_exception_table_evt(0x800, do_fpu_state_restore);
760 set_exception_table_evt(0x820, do_fpu_state_restore);
731#endif 761#endif
732 762
733 /* Setup VBR for boot cpu */ 763 /* Setup VBR for boot cpu */
734 per_cpu_trap_init(); 764 per_cpu_trap_init();
735} 765}
736 766
737void show_stack(struct task_struct *tsk, unsigned long *sp) 767void show_trace(struct task_struct *tsk, unsigned long *sp,
768 struct pt_regs *regs)
738{ 769{
739 unsigned long *stack, addr; 770 unsigned long addr;
740 unsigned long module_start = VMALLOC_START;
741 unsigned long module_end = VMALLOC_END;
742 int i = 1;
743
744 if (!tsk)
745 tsk = current;
746 if (tsk == current)
747 sp = (unsigned long *)current_stack_pointer;
748 else
749 sp = (unsigned long *)tsk->thread.sp;
750 771
751 stack = sp; 772 if (regs && user_mode(regs))
773 return;
752 774
753 printk("\nCall trace: "); 775 printk("\nCall trace: ");
754#ifdef CONFIG_KALLSYMS 776#ifdef CONFIG_KALLSYMS
755 printk("\n"); 777 printk("\n");
756#endif 778#endif
757 779
758 while (!kstack_end(stack)) { 780 while (!kstack_end(sp)) {
759 addr = *stack++; 781 addr = *sp++;
760 if (((addr >= (unsigned long)_text) && 782 if (kernel_text_address(addr))
761 (addr <= (unsigned long)_etext)) || 783 print_ip_sym(addr);
762 ((addr >= module_start) && (addr <= module_end))) {
763 /*
764 * For 80-columns display, 6 entry is maximum.
765 * NOTE: '[<8c00abcd>] ' consumes 13 columns .
766 */
767#ifndef CONFIG_KALLSYMS
768 if (i && ((i % 6) == 0))
769 printk("\n ");
770#endif
771 printk("[<%08lx>] ", addr);
772 print_symbol("%s\n", addr);
773 i++;
774 }
775 } 784 }
776 785
777 printk("\n"); 786 printk("\n");
778} 787}
779 788
780void show_task(unsigned long *sp) 789void show_stack(struct task_struct *tsk, unsigned long *sp)
781{ 790{
782 show_stack(NULL, sp); 791 unsigned long stack;
792
793 if (!tsk)
794 tsk = current;
795 if (tsk == current)
796 sp = (unsigned long *)current_stack_pointer;
797 else
798 sp = (unsigned long *)tsk->thread.sp;
799
800 stack = (unsigned long)sp;
801 dump_mem("Stack: ", stack, THREAD_SIZE +
802 (unsigned long)task_stack_page(tsk));
803 show_trace(tsk, sp, NULL);
783} 804}
784 805
785void dump_stack(void) 806void dump_stack(void)
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index 5eb93091818..77b4026d568 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -76,13 +76,7 @@ SECTIONS
76 __setup_end = .; 76 __setup_end = .;
77 __initcall_start = .; 77 __initcall_start = .;
78 .initcall.init : { 78 .initcall.init : {
79 *(.initcall1.init) 79 INITCALLS
80 *(.initcall2.init)
81 *(.initcall3.init)
82 *(.initcall4.init)
83 *(.initcall5.init)
84 *(.initcall6.init)
85 *(.initcall7.init)
86 } 80 }
87 __initcall_end = .; 81 __initcall_end = .;
88 __con_initcall_start = .; 82 __con_initcall_start = .;
diff --git a/arch/sh64/kernel/sh_ksyms.c b/arch/sh64/kernel/sh_ksyms.c
index 4b2df7247b5..7aa4b4f7bc5 100644
--- a/arch/sh64/kernel/sh_ksyms.c
+++ b/arch/sh64/kernel/sh_ksyms.c
@@ -38,7 +38,7 @@ EXPORT_SYMBOL(disable_irq);
38EXPORT_SYMBOL(kernel_thread); 38EXPORT_SYMBOL(kernel_thread);
39 39
40/* Networking helper routines. */ 40/* Networking helper routines. */
41EXPORT_SYMBOL(csum_partial_copy); 41EXPORT_SYMBOL(csum_partial_copy_nocheck);
42 42
43EXPORT_SYMBOL(strstr); 43EXPORT_SYMBOL(strstr);
44 44
diff --git a/arch/sh64/kernel/vmlinux.lds.S b/arch/sh64/kernel/vmlinux.lds.S
index a8fcc3a7158..95c4d753e35 100644
--- a/arch/sh64/kernel/vmlinux.lds.S
+++ b/arch/sh64/kernel/vmlinux.lds.S
@@ -108,13 +108,7 @@ SECTIONS
108 __setup_end = .; 108 __setup_end = .;
109 __initcall_start = .; 109 __initcall_start = .;
110 .initcall.init : C_PHYS(.initcall.init) { 110 .initcall.init : C_PHYS(.initcall.init) {
111 *(.initcall1.init) 111 INITCALLS
112 *(.initcall2.init)
113 *(.initcall3.init)
114 *(.initcall4.init)
115 *(.initcall5.init)
116 *(.initcall6.init)
117 *(.initcall7.init)
118 } 112 }
119 __initcall_end = .; 113 __initcall_end = .;
120 __con_initcall_start = .; 114 __con_initcall_start = .;
diff --git a/arch/sh64/lib/c-checksum.c b/arch/sh64/lib/c-checksum.c
index 0e8a742abf8..4b2676380de 100644
--- a/arch/sh64/lib/c-checksum.c
+++ b/arch/sh64/lib/c-checksum.c
@@ -118,24 +118,24 @@ static unsigned long do_csum(const unsigned char *buff, int len)
118 118
119/* computes the checksum of a memory block at buff, length len, 119/* computes the checksum of a memory block at buff, length len,
120 and adds in "sum" (32-bit) */ 120 and adds in "sum" (32-bit) */
121unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum) 121__wsum csum_partial(const void *buff, int len, __wsum sum)
122{ 122{
123 unsigned long long result = do_csum(buff, len); 123 unsigned long long result = do_csum(buff, len);
124 124
125 /* add in old sum, and carry.. */ 125 /* add in old sum, and carry.. */
126 result += sum; 126 result += (__force u32)sum;
127 /* 32+c bits -> 32 bits */ 127 /* 32+c bits -> 32 bits */
128 result = (result & 0xffffffff) + (result >> 32); 128 result = (result & 0xffffffff) + (result >> 32);
129 129
130 pr_debug("csum_partial, buff %p len %d sum 0x%x result=0x%016Lx\n", 130 pr_debug("csum_partial, buff %p len %d sum 0x%x result=0x%016Lx\n",
131 buff, len, sum, result); 131 buff, len, sum, result);
132 132
133 return result; 133 return (__force __wsum)result;
134} 134}
135 135
136/* Copy while checksumming, otherwise like csum_partial. */ 136/* Copy while checksumming, otherwise like csum_partial. */
137unsigned int 137__wsum
138csum_partial_copy(const unsigned char *src, unsigned char *dst, int len, unsigned int sum) 138csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
139{ 139{
140 sum = csum_partial(src, len, sum); 140 sum = csum_partial(src, len, sum);
141 memcpy(dst, src, len); 141 memcpy(dst, src, len);
@@ -145,9 +145,9 @@ csum_partial_copy(const unsigned char *src, unsigned char *dst, int len, unsigne
145 145
146/* Copy from userspace and compute checksum. If we catch an exception 146/* Copy from userspace and compute checksum. If we catch an exception
147 then zero the rest of the buffer. */ 147 then zero the rest of the buffer. */
148unsigned int 148__wsum
149csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, int len, 149csum_partial_copy_from_user(const void __user *src, void *dst, int len,
150 unsigned int sum, int *err_ptr) 150 __wsum sum, int *err_ptr)
151{ 151{
152 int missing; 152 int missing;
153 153
@@ -166,9 +166,9 @@ csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, int le
166} 166}
167 167
168/* Copy to userspace and compute checksum. */ 168/* Copy to userspace and compute checksum. */
169unsigned int 169__wsum
170csum_partial_copy_to_user(const unsigned char *src, unsigned char *dst, int len, 170csum_partial_copy_to_user(const unsigned char *src, unsigned char *dst, int len,
171 unsigned int sum, int *err_ptr) 171 __wsum sum, int *err_ptr)
172{ 172{
173 sum = csum_partial(src, len, sum); 173 sum = csum_partial(src, len, sum);
174 174
@@ -182,28 +182,24 @@ csum_partial_copy_to_user(const unsigned char *src, unsigned char *dst, int len,
182 * This is a version of ip_compute_csum() optimized for IP headers, 182 * This is a version of ip_compute_csum() optimized for IP headers,
183 * which always checksum on 4 octet boundaries. 183 * which always checksum on 4 octet boundaries.
184 */ 184 */
185unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) 185__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
186{ 186{
187 pr_debug("ip_fast_csum %p,%d\n", iph, ihl); 187 pr_debug("ip_fast_csum %p,%d\n", iph, ihl);
188 188
189 return ~do_csum(iph, ihl * 4); 189 return (__force __sum16)~do_csum(iph, ihl * 4);
190} 190}
191 191
192unsigned int csum_tcpudp_nofold(unsigned long saddr, 192__wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
193 unsigned long daddr,
194 unsigned short len, 193 unsigned short len,
195 unsigned short proto, unsigned int sum) 194 unsigned short proto, __wsum sum)
196{ 195{
197 unsigned long long result; 196 unsigned long long result;
198 197
199 pr_debug("ntohs(0x%x)=0x%x\n", 0xdead, ntohs(0xdead)); 198 pr_debug("ntohs(0x%x)=0x%x\n", 0xdead, ntohs(0xdead));
200 pr_debug("htons(0x%x)=0x%x\n", 0xdead, htons(0xdead)); 199 pr_debug("htons(0x%x)=0x%x\n", 0xdead, htons(0xdead));
201 200
202 result = ((unsigned long long) saddr + 201 result = (__force u64) saddr + (__force u64) daddr +
203 (unsigned long long) daddr + 202 (__force u64) sum + ((len + proto) << 8);
204 (unsigned long long) sum +
205 ((unsigned long long) ntohs(len) << 16) +
206 ((unsigned long long) proto << 8));
207 203
208 /* Fold down to 32-bits so we don't loose in the typedef-less 204 /* Fold down to 32-bits so we don't loose in the typedef-less
209 network stack. */ 205 network stack. */
@@ -215,16 +211,5 @@ unsigned int csum_tcpudp_nofold(unsigned long saddr,
215 pr_debug("%s saddr %x daddr %x len %x proto %x sum %x result %08Lx\n", 211 pr_debug("%s saddr %x daddr %x len %x proto %x sum %x result %08Lx\n",
216 __FUNCTION__, saddr, daddr, len, proto, sum, result); 212 __FUNCTION__, saddr, daddr, len, proto, sum, result);
217 213
218 return result; 214 return (__wsum)result;
219}
220
221// Post SIM:
222unsigned int
223csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, int len, unsigned int sum)
224{
225 // unsigned dummy;
226 pr_debug("csum_partial_copy_nocheck src %p dst %p len %d\n", src, dst,
227 len);
228
229 return csum_partial_copy(src, dst, len, sum);
230} 215}
diff --git a/arch/sh64/lib/dbg.c b/arch/sh64/lib/dbg.c
index 1326f45f31e..4310fc87444 100644
--- a/arch/sh64/lib/dbg.c
+++ b/arch/sh64/lib/dbg.c
@@ -383,7 +383,7 @@ void show_excp_regs(char *from, int trapnr, int signr, struct pt_regs *regs)
383/* ======================================================================= */ 383/* ======================================================================= */
384 384
385/* 385/*
386** Depending on <base> scan the MMU, Data or Instrction side 386** Depending on <base> scan the MMU, Data or Instruction side
387** looking for a valid mapping matching Eaddr & asid. 387** looking for a valid mapping matching Eaddr & asid.
388** Return -1 if not found or the TLB id entry otherwise. 388** Return -1 if not found or the TLB id entry otherwise.
389** Note: it works only for 4k pages! 389** Note: it works only for 4k pages!
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 9431e967aa4..92a7c8a636d 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -212,8 +212,8 @@ config SPARC_LED
212 tristate "Sun4m LED driver" 212 tristate "Sun4m LED driver"
213 help 213 help
214 This driver toggles the front-panel LED on sun4m systems 214 This driver toggles the front-panel LED on sun4m systems
215 in a user-specifyable manner. It's state can be probed 215 in a user-specifiable manner. Its state can be probed
216 by reading /proc/led and it's blinking mode can be changed 216 by reading /proc/led and its blinking mode can be changed
217 via writes to /proc/led 217 via writes to /proc/led
218 218
219source "fs/Kconfig.binfmt" 219source "fs/Kconfig.binfmt"
@@ -289,6 +289,13 @@ endmenu
289 289
290source "fs/Kconfig" 290source "fs/Kconfig"
291 291
292menu "Instrumentation Support"
293 depends on EXPERIMENTAL
294
295source "arch/sparc/oprofile/Kconfig"
296
297endmenu
298
292source "arch/sparc/Kconfig.debug" 299source "arch/sparc/Kconfig.debug"
293 300
294source "security/Kconfig" 301source "security/Kconfig"
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index 4cdbb2d59ed..f33c3817f01 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -30,6 +30,8 @@ HEAD_Y := $(head-y)
30core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/ 30core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/
31libs-y += arch/sparc/prom/ arch/sparc/lib/ 31libs-y += arch/sparc/prom/ arch/sparc/lib/
32 32
33drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/
34
33# Export what is needed by arch/sparc/boot/Makefile 35# Export what is needed by arch/sparc/boot/Makefile
34# Renaming is done to avoid confusing pattern matching rules in 2.5.45 (multy-) 36# Renaming is done to avoid confusing pattern matching rules in 2.5.45 (multy-)
35INIT_Y := $(patsubst %/, %/built-in.o, $(init-y)) 37INIT_Y := $(patsubst %/, %/built-in.o, $(init-y))
diff --git a/arch/sparc/kernel/ebus.c b/arch/sparc/kernel/ebus.c
index 75ac24d229b..ba58c3a061f 100644
--- a/arch/sparc/kernel/ebus.c
+++ b/arch/sparc/kernel/ebus.c
@@ -237,12 +237,12 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d
237 dev->ofdev.node = dp; 237 dev->ofdev.node = dp;
238 dev->ofdev.dev.parent = &dev->bus->ofdev.dev; 238 dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
239 dev->ofdev.dev.bus = &ebus_bus_type; 239 dev->ofdev.dev.bus = &ebus_bus_type;
240 strcpy(dev->ofdev.dev.bus_id, dp->path_component_name); 240 sprintf(dev->ofdev.dev.bus_id, "ebus[%08x]", dp->node);
241 241
242 /* Register with core */ 242 /* Register with core */
243 if (of_device_register(&dev->ofdev) != 0) 243 if (of_device_register(&dev->ofdev) != 0)
244 printk(KERN_DEBUG "ebus: device registration error for %s!\n", 244 printk(KERN_DEBUG "ebus: device registration error for %s!\n",
245 dev->ofdev.dev.bus_id); 245 dp->path_component_name);
246 246
247 if ((dp = dp->child) != NULL) { 247 if ((dp = dp->child) != NULL) {
248 dev->children = (struct linux_ebus_child *) 248 dev->children = (struct linux_ebus_child *)
@@ -332,12 +332,12 @@ void __init ebus_init(void)
332 ebus->ofdev.node = dp; 332 ebus->ofdev.node = dp;
333 ebus->ofdev.dev.parent = &pdev->dev; 333 ebus->ofdev.dev.parent = &pdev->dev;
334 ebus->ofdev.dev.bus = &ebus_bus_type; 334 ebus->ofdev.dev.bus = &ebus_bus_type;
335 strcpy(ebus->ofdev.dev.bus_id, dp->path_component_name); 335 sprintf(ebus->ofdev.dev.bus_id, "ebus%d", num_ebus);
336 336
337 /* Register with core */ 337 /* Register with core */
338 if (of_device_register(&ebus->ofdev) != 0) 338 if (of_device_register(&ebus->ofdev) != 0)
339 printk(KERN_DEBUG "ebus: device registration error for %s!\n", 339 printk(KERN_DEBUG "ebus: device registration error for %s!\n",
340 ebus->ofdev.dev.bus_id); 340 dp->path_component_name);
341 341
342 342
343 nd = dp->child; 343 nd = dp->child;
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index a4edff4c3be..831f540251f 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -32,13 +32,12 @@
32#include <asm/mxcc.h> 32#include <asm/mxcc.h>
33#include <asm/thread_info.h> 33#include <asm/thread_info.h>
34#include <asm/param.h> 34#include <asm/param.h>
35#include <asm/unistd.h>
35 36
36#include <asm/asmmacro.h> 37#include <asm/asmmacro.h>
37 38
38#define curptr g6 39#define curptr g6
39 40
40#define NR_SYSCALLS 300 /* Each OS is different... */
41
42/* These are just handy. */ 41/* These are just handy. */
43#define _SV save %sp, -STACKFRAME_SZ, %sp 42#define _SV save %sp, -STACKFRAME_SZ, %sp
44#define _RS restore 43#define _RS restore
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index b3b6680a2a3..c8cb211b907 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -351,7 +351,7 @@ void handler_irq(int irq, struct pt_regs * regs)
351} 351}
352 352
353#ifdef CONFIG_BLK_DEV_FD 353#ifdef CONFIG_BLK_DEV_FD
354extern void floppy_interrupt(int irq, void *dev_id) 354extern void floppy_interrupt(int irq, void *dev_id);
355 355
356void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs) 356void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
357{ 357{
diff --git a/arch/sparc/kernel/of_device.c b/arch/sparc/kernel/of_device.c
index 74bef2a2d37..46200c43ffb 100644
--- a/arch/sparc/kernel/of_device.c
+++ b/arch/sparc/kernel/of_device.c
@@ -651,7 +651,7 @@ build_resources:
651 if (!parent) 651 if (!parent)
652 strcpy(op->dev.bus_id, "root"); 652 strcpy(op->dev.bus_id, "root");
653 else 653 else
654 strcpy(op->dev.bus_id, dp->path_component_name); 654 sprintf(op->dev.bus_id, "%08x", dp->node);
655 655
656 if (of_device_register(op)) { 656 if (of_device_register(op)) {
657 printk("%s: Could not register of device.\n", 657 printk("%s: Could not register of device.\n",
diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
index f5ee1ac834b..383526ad94f 100644
--- a/arch/sparc/kernel/setup.c
+++ b/arch/sparc/kernel/setup.c
@@ -103,7 +103,6 @@ void prom_sync_me(void)
103 103
104unsigned int boot_flags __initdata = 0; 104unsigned int boot_flags __initdata = 0;
105#define BOOTME_DEBUG 0x1 105#define BOOTME_DEBUG 0x1
106#define BOOTME_SINGLE 0x2
107 106
108/* Exported for mm/init.c:paging_init. */ 107/* Exported for mm/init.c:paging_init. */
109unsigned long cmdline_memory_size __initdata = 0; 108unsigned long cmdline_memory_size __initdata = 0;
@@ -132,7 +131,6 @@ static void __init process_switch(char c)
132 boot_flags |= BOOTME_DEBUG; 131 boot_flags |= BOOTME_DEBUG;
133 break; 132 break;
134 case 's': 133 case 's':
135 boot_flags |= BOOTME_SINGLE;
136 break; 134 break;
137 case 'h': 135 case 'h':
138 prom_printf("boot_flags_init: Halt!\n"); 136 prom_printf("boot_flags_init: Halt!\n");
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S
index 10df38eeae0..ea75ca56905 100644
--- a/arch/sparc/kernel/systbls.S
+++ b/arch/sparc/kernel/systbls.S
@@ -78,7 +78,7 @@ sys_call_table:
78/*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 78/*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
79/*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 79/*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
80/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 80/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
81/*300*/ .long sys_set_robust_list, sys_get_robust_list 81/*300*/ .long sys_set_robust_list, sys_get_robust_list, sys_migrate_pages
82 82
83#ifdef CONFIG_SUNOS_EMUL 83#ifdef CONFIG_SUNOS_EMUL
84 /* Now the SunOS syscall table. */ 84 /* Now the SunOS syscall table. */
@@ -190,6 +190,7 @@ sunos_sys_table:
190/*290*/ .long sunos_nosys, sunos_nosys, sunos_nosys 190/*290*/ .long sunos_nosys, sunos_nosys, sunos_nosys
191 .long sunos_nosys, sunos_nosys, sunos_nosys 191 .long sunos_nosys, sunos_nosys, sunos_nosys
192 .long sunos_nosys, sunos_nosys, sunos_nosys 192 .long sunos_nosys, sunos_nosys, sunos_nosys
193 .long sunos_nosys, sunos_nosys, sunos_nosys 193 .long sunos_nosys
194/*300*/ .long sunos_nosys, sunos_nosys, sunos_nosys
194 195
195#endif 196#endif
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index 7dcd1a16c6e..6c7aa51b590 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -95,6 +95,8 @@ unsigned long profile_pc(struct pt_regs *regs)
95 return pc; 95 return pc;
96} 96}
97 97
98EXPORT_SYMBOL(profile_pc);
99
98__volatile__ unsigned int *master_l10_counter; 100__volatile__ unsigned int *master_l10_counter;
99__volatile__ unsigned int *master_l10_limit; 101__volatile__ unsigned int *master_l10_limit;
100 102
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index 1dd78c84888..5cc5ff7f882 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -49,13 +49,7 @@ SECTIONS
49 __setup_end = .; 49 __setup_end = .;
50 __initcall_start = .; 50 __initcall_start = .;
51 .initcall.init : { 51 .initcall.init : {
52 *(.initcall1.init) 52 INITCALLS
53 *(.initcall2.init)
54 *(.initcall3.init)
55 *(.initcall4.init)
56 *(.initcall5.init)
57 *(.initcall6.init)
58 *(.initcall7.init)
59 } 53 }
60 __initcall_end = .; 54 __initcall_end = .;
61 __con_initcall_start = .; 55 __con_initcall_start = .;
diff --git a/arch/sparc/oprofile/Kconfig b/arch/sparc/oprofile/Kconfig
new file mode 100644
index 00000000000..d8a84088471
--- /dev/null
+++ b/arch/sparc/oprofile/Kconfig
@@ -0,0 +1,17 @@
1config PROFILING
2 bool "Profiling support (EXPERIMENTAL)"
3 help
4 Say Y here to enable the extended profiling support mechanisms used
5 by profilers such as OProfile.
6
7
8config OPROFILE
9 tristate "OProfile system profiling (EXPERIMENTAL)"
10 depends on PROFILING
11 help
12 OProfile is a profiling system capable of profiling the
13 whole system, include the kernel, kernel modules, libraries,
14 and applications.
15
16 If unsure, say N.
17
diff --git a/arch/sparc/oprofile/Makefile b/arch/sparc/oprofile/Makefile
new file mode 100644
index 00000000000..e9feca1ca28
--- /dev/null
+++ b/arch/sparc/oprofile/Makefile
@@ -0,0 +1,9 @@
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) init.o
diff --git a/arch/sparc/oprofile/init.c b/arch/sparc/oprofile/init.c
new file mode 100644
index 00000000000..9ab815b95b5
--- /dev/null
+++ b/arch/sparc/oprofile/init.c
@@ -0,0 +1,23 @@
1/**
2 * @file init.c
3 *
4 * @remark Copyright 2002 OProfile authors
5 * @remark Read the file COPYING
6 *
7 * @author John Levon <levon@movementarian.org>
8 */
9
10#include <linux/kernel.h>
11#include <linux/oprofile.h>
12#include <linux/errno.h>
13#include <linux/init.h>
14
15int __init oprofile_arch_init(struct oprofile_operations * ops)
16{
17 return -ENODEV;
18}
19
20
21void oprofile_arch_exit(void)
22{
23}
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index dcae559879a..2f4612fa81f 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/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.19-rc1 3# Linux kernel version: 2.6.19-rc2
4# Thu Oct 5 02:08:41 2006 4# Tue Oct 17 19:29:20 2006
5# 5#
6CONFIG_SPARC=y 6CONFIG_SPARC=y
7CONFIG_SPARC64=y 7CONFIG_SPARC64=y
@@ -217,6 +217,7 @@ CONFIG_INET6_XFRM_MODE_TRANSPORT=m
217CONFIG_INET6_XFRM_MODE_TUNNEL=m 217CONFIG_INET6_XFRM_MODE_TUNNEL=m
218CONFIG_INET6_XFRM_MODE_BEET=m 218CONFIG_INET6_XFRM_MODE_BEET=m
219# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set 219# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
220CONFIG_IPV6_SIT=m
220CONFIG_IPV6_TUNNEL=m 221CONFIG_IPV6_TUNNEL=m
221# CONFIG_IPV6_SUBTREES is not set 222# CONFIG_IPV6_SUBTREES is not set
222# CONFIG_IPV6_MULTIPLE_TABLES is not set 223# CONFIG_IPV6_MULTIPLE_TABLES is not set
@@ -334,6 +335,12 @@ CONFIG_CDROM_PKTCDVD_WCACHE=y
334CONFIG_ATA_OVER_ETH=m 335CONFIG_ATA_OVER_ETH=m
335 336
336# 337#
338# Misc devices
339#
340# CONFIG_SGI_IOC4 is not set
341# CONFIG_TIFM_CORE is not set
342
343#
337# ATA/ATAPI/MFM/RLL support 344# ATA/ATAPI/MFM/RLL support
338# 345#
339CONFIG_IDE=y 346CONFIG_IDE=y
@@ -728,7 +735,6 @@ CONFIG_RTC=y
728# TPM devices 735# TPM devices
729# 736#
730# CONFIG_TCG_TPM is not set 737# CONFIG_TCG_TPM is not set
731# CONFIG_TELCLOCK is not set
732 738
733# 739#
734# I2C support 740# I2C support
@@ -842,11 +848,6 @@ CONFIG_HWMON=y
842# CONFIG_HWMON_DEBUG_CHIP is not set 848# CONFIG_HWMON_DEBUG_CHIP is not set
843 849
844# 850#
845# Misc devices
846#
847# CONFIG_TIFM_CORE is not set
848
849#
850# Multimedia devices 851# Multimedia devices
851# 852#
852# CONFIG_VIDEO_DEV is not set 853# CONFIG_VIDEO_DEV is not set
@@ -1104,7 +1105,6 @@ CONFIG_USB_HIDDEV=y
1104# CONFIG_USB_ATI_REMOTE2 is not set 1105# CONFIG_USB_ATI_REMOTE2 is not set
1105# CONFIG_USB_KEYSPAN_REMOTE is not set 1106# CONFIG_USB_KEYSPAN_REMOTE is not set
1106# CONFIG_USB_APPLETOUCH is not set 1107# CONFIG_USB_APPLETOUCH is not set
1107# CONFIG_USB_TRANCEVIBRATOR is not set
1108 1108
1109# 1109#
1110# USB Imaging devices 1110# USB Imaging devices
@@ -1150,6 +1150,7 @@ CONFIG_USB_HIDDEV=y
1150# CONFIG_USB_APPLEDISPLAY is not set 1150# CONFIG_USB_APPLEDISPLAY is not set
1151# CONFIG_USB_SISUSBVGA is not set 1151# CONFIG_USB_SISUSBVGA is not set
1152# CONFIG_USB_LD is not set 1152# CONFIG_USB_LD is not set
1153# CONFIG_USB_TRANCEVIBRATOR is not set
1153# CONFIG_USB_TEST is not set 1154# CONFIG_USB_TEST is not set
1154 1155
1155# 1156#
@@ -1234,6 +1235,7 @@ CONFIG_EXT3_FS=y
1234CONFIG_EXT3_FS_XATTR=y 1235CONFIG_EXT3_FS_XATTR=y
1235CONFIG_EXT3_FS_POSIX_ACL=y 1236CONFIG_EXT3_FS_POSIX_ACL=y
1236CONFIG_EXT3_FS_SECURITY=y 1237CONFIG_EXT3_FS_SECURITY=y
1238# CONFIG_EXT4DEV_FS is not set
1237CONFIG_JBD=y 1239CONFIG_JBD=y
1238# CONFIG_JBD_DEBUG is not set 1240# CONFIG_JBD_DEBUG is not set
1239CONFIG_FS_MBCACHE=y 1241CONFIG_FS_MBCACHE=y
@@ -1362,10 +1364,6 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1362# CONFIG_NLS_UTF8 is not set 1364# CONFIG_NLS_UTF8 is not set
1363 1365
1364# 1366#
1365# Distributed Lock Manager
1366#
1367
1368#
1369# Instrumentation Support 1367# Instrumentation Support
1370# 1368#
1371CONFIG_PROFILING=y 1369CONFIG_PROFILING=y
@@ -1399,6 +1397,7 @@ CONFIG_DEBUG_FS=y
1399# CONFIG_DEBUG_LIST is not set 1397# CONFIG_DEBUG_LIST is not set
1400# CONFIG_UNWIND_INFO is not set 1398# CONFIG_UNWIND_INFO is not set
1401CONFIG_FORCED_INLINING=y 1399CONFIG_FORCED_INLINING=y
1400# CONFIG_HEADERS_CHECK is not set
1402# CONFIG_RCU_TORTURE_TEST is not set 1401# CONFIG_RCU_TORTURE_TEST is not set
1403# CONFIG_LKDTM is not set 1402# CONFIG_LKDTM is not set
1404# CONFIG_DEBUG_STACK_USAGE is not set 1403# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/sparc64/kernel/central.c b/arch/sparc64/kernel/central.c
index b66336db00e..e724c54af02 100644
--- a/arch/sparc64/kernel/central.c
+++ b/arch/sparc64/kernel/central.c
@@ -126,6 +126,10 @@ static void probe_other_fhcs(void)
126 int board; 126 int board;
127 u32 tmp; 127 u32 tmp;
128 128
129 if (dp->parent &&
130 dp->parent->parent != NULL)
131 continue;
132
129 fhc = (struct linux_fhc *) 133 fhc = (struct linux_fhc *)
130 central_alloc_bootmem(sizeof(struct linux_fhc)); 134 central_alloc_bootmem(sizeof(struct linux_fhc));
131 if (fhc == NULL) 135 if (fhc == NULL)
diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c
index 2df25c2b407..35bf895fdee 100644
--- a/arch/sparc64/kernel/ebus.c
+++ b/arch/sparc64/kernel/ebus.c
@@ -389,12 +389,12 @@ static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_de
389 dev->ofdev.node = dp; 389 dev->ofdev.node = dp;
390 dev->ofdev.dev.parent = &dev->bus->ofdev.dev; 390 dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
391 dev->ofdev.dev.bus = &ebus_bus_type; 391 dev->ofdev.dev.bus = &ebus_bus_type;
392 strcpy(dev->ofdev.dev.bus_id, dp->path_component_name); 392 sprintf(dev->ofdev.dev.bus_id, "ebus[%08x]", dp->node);
393 393
394 /* Register with core */ 394 /* Register with core */
395 if (of_device_register(&dev->ofdev) != 0) 395 if (of_device_register(&dev->ofdev) != 0)
396 printk(KERN_DEBUG "ebus: device registration error for %s!\n", 396 printk(KERN_DEBUG "ebus: device registration error for %s!\n",
397 dev->ofdev.dev.bus_id); 397 dp->path_component_name);
398 398
399 dp = dp->child; 399 dp = dp->child;
400 if (dp) { 400 if (dp) {
@@ -494,12 +494,12 @@ void __init ebus_init(void)
494 ebus->ofdev.node = dp; 494 ebus->ofdev.node = dp;
495 ebus->ofdev.dev.parent = &pdev->dev; 495 ebus->ofdev.dev.parent = &pdev->dev;
496 ebus->ofdev.dev.bus = &ebus_bus_type; 496 ebus->ofdev.dev.bus = &ebus_bus_type;
497 strcpy(ebus->ofdev.dev.bus_id, dp->path_component_name); 497 sprintf(ebus->ofdev.dev.bus_id, "ebus%d", num_ebus);
498 498
499 /* Register with core */ 499 /* Register with core */
500 if (of_device_register(&ebus->ofdev) != 0) 500 if (of_device_register(&ebus->ofdev) != 0)
501 printk(KERN_DEBUG "ebus: device registration error for %s!\n", 501 printk(KERN_DEBUG "ebus: device registration error for %s!\n",
502 ebus->ofdev.dev.bus_id); 502 dp->path_component_name);
503 503
504 504
505 child = dp->child; 505 child = dp->child;
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index 0aaa35fc5a9..6f28bec0a9b 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -22,11 +22,10 @@
22#include <asm/auxio.h> 22#include <asm/auxio.h>
23#include <asm/sfafsr.h> 23#include <asm/sfafsr.h>
24#include <asm/pil.h> 24#include <asm/pil.h>
25#include <asm/unistd.h>
25 26
26#define curptr g6 27#define curptr g6
27 28
28#define NR_SYSCALLS 300 /* Each OS is different... */
29
30 .text 29 .text
31 .align 32 30 .align 32
32 31
diff --git a/arch/sparc64/kernel/isa.c b/arch/sparc64/kernel/isa.c
index 0f3aec72ef5..f028e68b23f 100644
--- a/arch/sparc64/kernel/isa.c
+++ b/arch/sparc64/kernel/isa.c
@@ -115,12 +115,12 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
115 isa_dev->ofdev.node = dp; 115 isa_dev->ofdev.node = dp;
116 isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev; 116 isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev;
117 isa_dev->ofdev.dev.bus = &isa_bus_type; 117 isa_dev->ofdev.dev.bus = &isa_bus_type;
118 strcpy(isa_dev->ofdev.dev.bus_id, dp->path_component_name); 118 sprintf(isa_dev->ofdev.dev.bus_id, "isa[%08x]", dp->node);
119 119
120 /* Register with core */ 120 /* Register with core */
121 if (of_device_register(&isa_dev->ofdev) != 0) { 121 if (of_device_register(&isa_dev->ofdev) != 0) {
122 printk(KERN_DEBUG "isa: device registration error for %s!\n", 122 printk(KERN_DEBUG "isa: device registration error for %s!\n",
123 isa_dev->ofdev.dev.bus_id); 123 dp->path_component_name);
124 kfree(isa_dev); 124 kfree(isa_dev);
125 goto next_sibling; 125 goto next_sibling;
126 } 126 }
@@ -191,12 +191,12 @@ void __init isa_init(void)
191 isa_br->ofdev.node = dp; 191 isa_br->ofdev.node = dp;
192 isa_br->ofdev.dev.parent = &pdev->dev; 192 isa_br->ofdev.dev.parent = &pdev->dev;
193 isa_br->ofdev.dev.bus = &isa_bus_type; 193 isa_br->ofdev.dev.bus = &isa_bus_type;
194 strcpy(isa_br->ofdev.dev.bus_id, dp->path_component_name); 194 sprintf(isa_br->ofdev.dev.bus_id, "isa%d", index);
195 195
196 /* Register with core */ 196 /* Register with core */
197 if (of_device_register(&isa_br->ofdev) != 0) { 197 if (of_device_register(&isa_br->ofdev) != 0) {
198 printk(KERN_DEBUG "isa: device registration error for %s!\n", 198 printk(KERN_DEBUG "isa: device registration error for %s!\n",
199 isa_br->ofdev.dev.bus_id); 199 dp->path_component_name);
200 kfree(isa_br); 200 kfree(isa_br);
201 return; 201 return;
202 } 202 }
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index d822c7c18e1..8cc14fc6b6f 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -131,8 +131,13 @@ static int of_device_resume(struct device * dev)
131void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name) 131void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name)
132{ 132{
133 unsigned long ret = res->start + offset; 133 unsigned long ret = res->start + offset;
134 struct resource *r;
134 135
135 if (!request_region(ret, size, name)) 136 if (res->flags & IORESOURCE_MEM)
137 r = request_mem_region(ret, size, name);
138 else
139 r = request_region(ret, size, name);
140 if (!r)
136 ret = 0; 141 ret = 0;
137 142
138 return (void __iomem *) ret; 143 return (void __iomem *) ret;
@@ -397,16 +402,22 @@ static void of_bus_sbus_count_cells(struct device_node *child,
397 *sizec = 1; 402 *sizec = 1;
398} 403}
399 404
400static int of_bus_sbus_map(u32 *addr, const u32 *range, int na, int ns, int pna) 405/*
401{ 406 * FHC/Central bus specific translator.
402 return of_bus_default_map(addr, range, na, ns, pna); 407 *
403} 408 * This is just needed to hard-code the address and size cell
404 409 * counts. 'fhc' and 'central' nodes lack the #address-cells and
405static unsigned int of_bus_sbus_get_flags(u32 *addr) 410 * #size-cells properties, and if you walk to the root on such
411 * Enterprise boxes all you'll get is a #size-cells of 2 which is
412 * not what we want to use.
413 */
414static int of_bus_fhc_match(struct device_node *np)
406{ 415{
407 return IORESOURCE_MEM; 416 return !strcmp(np->name, "fhc") ||
417 !strcmp(np->name, "central");
408} 418}
409 419
420#define of_bus_fhc_count_cells of_bus_sbus_count_cells
410 421
411/* 422/*
412 * Array of bus specific translators 423 * Array of bus specific translators
@@ -428,8 +439,17 @@ static struct of_bus of_busses[] = {
428 .addr_prop_name = "reg", 439 .addr_prop_name = "reg",
429 .match = of_bus_sbus_match, 440 .match = of_bus_sbus_match,
430 .count_cells = of_bus_sbus_count_cells, 441 .count_cells = of_bus_sbus_count_cells,
431 .map = of_bus_sbus_map, 442 .map = of_bus_default_map,
432 .get_flags = of_bus_sbus_get_flags, 443 .get_flags = of_bus_default_get_flags,
444 },
445 /* FHC */
446 {
447 .name = "fhc",
448 .addr_prop_name = "reg",
449 .match = of_bus_fhc_match,
450 .count_cells = of_bus_fhc_count_cells,
451 .map = of_bus_default_map,
452 .get_flags = of_bus_default_get_flags,
433 }, 453 },
434 /* Default */ 454 /* Default */
435 { 455 {
@@ -841,7 +861,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
841 if (!parent) 861 if (!parent)
842 strcpy(op->dev.bus_id, "root"); 862 strcpy(op->dev.bus_id, "root");
843 else 863 else
844 sprintf(op->dev.bus_id, "%s@%08x", dp->name, dp->node); 864 sprintf(op->dev.bus_id, "%08x", dp->node);
845 865
846 if (of_device_register(op)) { 866 if (of_device_register(op)) {
847 printk("%s: Could not register of device.\n", 867 printk("%s: Could not register of device.\n",
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index e02f01b644a..dfc41cd4bb5 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -646,13 +646,4 @@ int pci_domain_nr(struct pci_bus *pbus)
646} 646}
647EXPORT_SYMBOL(pci_domain_nr); 647EXPORT_SYMBOL(pci_domain_nr);
648 648
649int pcibios_prep_mwi(struct pci_dev *dev)
650{
651 /* We set correct PCI_CACHE_LINE_SIZE register values for every
652 * device probed on this platform. So there is nothing to check
653 * and this always succeeds.
654 */
655 return 0;
656}
657
658#endif /* !(CONFIG_PCI) */ 649#endif /* !(CONFIG_PCI) */
diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c
index 7a59cc72c84..827ae30aa49 100644
--- a/arch/sparc64/kernel/pci_common.c
+++ b/arch/sparc64/kernel/pci_common.c
@@ -330,19 +330,6 @@ __init get_device_resource(struct linux_prom_pci_registers *ap,
330 return res; 330 return res;
331} 331}
332 332
333static int __init pdev_resource_collisions_expected(struct pci_dev *pdev)
334{
335 if (pdev->vendor != PCI_VENDOR_ID_SUN)
336 return 0;
337
338 if (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS ||
339 pdev->device == PCI_DEVICE_ID_SUN_RIO_1394 ||
340 pdev->device == PCI_DEVICE_ID_SUN_RIO_USB)
341 return 1;
342
343 return 0;
344}
345
346static void __init pdev_record_assignments(struct pci_pbm_info *pbm, 333static void __init pdev_record_assignments(struct pci_pbm_info *pbm,
347 struct pci_dev *pdev) 334 struct pci_dev *pdev)
348{ 335{
@@ -400,19 +387,23 @@ static void __init pdev_record_assignments(struct pci_pbm_info *pbm,
400 pbm->parent->resource_adjust(pdev, res, root); 387 pbm->parent->resource_adjust(pdev, res, root);
401 388
402 if (request_resource(root, res) < 0) { 389 if (request_resource(root, res) < 0) {
390 int rnum;
391
403 /* OK, there is some conflict. But this is fine 392 /* OK, there is some conflict. But this is fine
404 * since we'll reassign it in the fixup pass. 393 * since we'll reassign it in the fixup pass.
405 * 394 *
406 * We notify the user that OBP made an error if it 395 * Do not print the warning for ROM resources
407 * is a case we don't expect. 396 * as such a conflict is quite common and
397 * harmless as the ROM bar is disabled.
408 */ 398 */
409 if (!pdev_resource_collisions_expected(pdev)) { 399 rnum = (res - &pdev->resource[0]);
410 printk(KERN_ERR "PCI: Address space collision on region %ld " 400 if (rnum != PCI_ROM_RESOURCE)
401 printk(KERN_ERR "PCI: Resource collision, "
402 "region %d "
411 "[%016lx:%016lx] of device %s\n", 403 "[%016lx:%016lx] of device %s\n",
412 (res - &pdev->resource[0]), 404 rnum,
413 res->start, res->end, 405 res->start, res->end,
414 pci_name(pdev)); 406 pci_name(pdev));
415 }
416 } 407 }
417 } 408 }
418} 409}
diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c
index 82e5455134c..2e7f1427088 100644
--- a/arch/sparc64/kernel/pci_iommu.c
+++ b/arch/sparc64/kernel/pci_iommu.c
@@ -281,7 +281,7 @@ static void pci_4u_free_consistent(struct pci_dev *pdev, size_t size, void *cpu,
281 281
282 spin_lock_irqsave(&iommu->lock, flags); 282 spin_lock_irqsave(&iommu->lock, flags);
283 283
284 free_npages(iommu, dvma, npages); 284 free_npages(iommu, dvma - iommu->page_table_map_base, npages);
285 285
286 spin_unlock_irqrestore(&iommu->lock, flags); 286 spin_unlock_irqrestore(&iommu->lock, flags);
287 287
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c
index 6ec569828c2..94bb681f232 100644
--- a/arch/sparc64/kernel/pci_sabre.c
+++ b/arch/sparc64/kernel/pci_sabre.c
@@ -1196,7 +1196,7 @@ static void pbm_register_toplevel_resources(struct pci_controller_info *p,
1196 &pbm->mem_space); 1196 &pbm->mem_space);
1197} 1197}
1198 1198
1199static void sabre_pbm_init(struct pci_controller_info *p, struct device_node *dp, u32 dma_begin) 1199static void sabre_pbm_init(struct pci_controller_info *p, struct device_node *dp, u32 dma_start, u32 dma_end)
1200{ 1200{
1201 struct pci_pbm_info *pbm; 1201 struct pci_pbm_info *pbm;
1202 struct device_node *node; 1202 struct device_node *node;
@@ -1261,6 +1261,8 @@ static void sabre_pbm_init(struct pci_controller_info *p, struct device_node *dp
1261 node = node->sibling; 1261 node = node->sibling;
1262 } 1262 }
1263 if (simbas_found == 0) { 1263 if (simbas_found == 0) {
1264 struct resource *rp;
1265
1264 /* No APBs underneath, probably this is a hummingbird 1266 /* No APBs underneath, probably this is a hummingbird
1265 * system. 1267 * system.
1266 */ 1268 */
@@ -1302,8 +1304,10 @@ static void sabre_pbm_init(struct pci_controller_info *p, struct device_node *dp
1302 pbm->io_space.end = pbm->io_space.start + (1UL << 24) - 1UL; 1304 pbm->io_space.end = pbm->io_space.start + (1UL << 24) - 1UL;
1303 pbm->io_space.flags = IORESOURCE_IO; 1305 pbm->io_space.flags = IORESOURCE_IO;
1304 1306
1305 pbm->mem_space.start = p->pbm_A.controller_regs + SABRE_MEMSPACE; 1307 pbm->mem_space.start =
1306 pbm->mem_space.end = pbm->mem_space.start + (unsigned long)dma_begin - 1UL; 1308 (p->pbm_A.controller_regs + SABRE_MEMSPACE);
1309 pbm->mem_space.end =
1310 (pbm->mem_space.start + ((1UL << 32UL) - 1UL));
1307 pbm->mem_space.flags = IORESOURCE_MEM; 1311 pbm->mem_space.flags = IORESOURCE_MEM;
1308 1312
1309 if (request_resource(&ioport_resource, &pbm->io_space) < 0) { 1313 if (request_resource(&ioport_resource, &pbm->io_space) < 0) {
@@ -1315,6 +1319,17 @@ static void sabre_pbm_init(struct pci_controller_info *p, struct device_node *dp
1315 prom_halt(); 1319 prom_halt();
1316 } 1320 }
1317 1321
1322 rp = kmalloc(sizeof(*rp), GFP_KERNEL);
1323 if (!rp) {
1324 prom_printf("Cannot allocate IOMMU resource.\n");
1325 prom_halt();
1326 }
1327 rp->name = "IOMMU";
1328 rp->start = pbm->mem_space.start + (unsigned long) dma_start;
1329 rp->end = pbm->mem_space.start + (unsigned long) dma_end - 1UL;
1330 rp->flags = IORESOURCE_BUSY;
1331 request_resource(&pbm->mem_space, rp);
1332
1318 pci_register_legacy_regions(&pbm->io_space, 1333 pci_register_legacy_regions(&pbm->io_space,
1319 &pbm->mem_space); 1334 &pbm->mem_space);
1320 } 1335 }
@@ -1450,5 +1465,5 @@ void sabre_init(struct device_node *dp, char *model_name)
1450 /* 1465 /*
1451 * Look for APB underneath. 1466 * Look for APB underneath.
1452 */ 1467 */
1453 sabre_pbm_init(p, dp, vdma[0]); 1468 sabre_pbm_init(p, dp, vdma[0], vdma[0] + vdma[1]);
1454} 1469}
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index e21cd6afa70..0917c24c4f0 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -793,7 +793,7 @@ static unsigned int schizo_irq_build(struct device_node *dp,
793 return virt_irq; 793 return virt_irq;
794} 794}
795 795
796static void schizo_irq_trans_init(struct device_node *dp) 796static void __schizo_irq_trans_init(struct device_node *dp, int is_tomatillo)
797{ 797{
798 struct linux_prom64_registers *regs; 798 struct linux_prom64_registers *regs;
799 struct schizo_irq_data *irq_data; 799 struct schizo_irq_data *irq_data;
@@ -807,11 +807,24 @@ static void schizo_irq_trans_init(struct device_node *dp)
807 dp->irq_trans->data = irq_data; 807 dp->irq_trans->data = irq_data;
808 808
809 irq_data->pbm_regs = regs[0].phys_addr; 809 irq_data->pbm_regs = regs[0].phys_addr;
810 irq_data->sync_reg = regs[3].phys_addr + 0x1a18UL; 810 if (is_tomatillo)
811 irq_data->sync_reg = regs[3].phys_addr + 0x1a18UL;
812 else
813 irq_data->sync_reg = 0UL;
811 irq_data->portid = of_getintprop_default(dp, "portid", 0); 814 irq_data->portid = of_getintprop_default(dp, "portid", 0);
812 irq_data->chip_version = of_getintprop_default(dp, "version#", 0); 815 irq_data->chip_version = of_getintprop_default(dp, "version#", 0);
813} 816}
814 817
818static void schizo_irq_trans_init(struct device_node *dp)
819{
820 __schizo_irq_trans_init(dp, 0);
821}
822
823static void tomatillo_irq_trans_init(struct device_node *dp)
824{
825 __schizo_irq_trans_init(dp, 1);
826}
827
815static unsigned int pci_sun4v_irq_build(struct device_node *dp, 828static unsigned int pci_sun4v_irq_build(struct device_node *dp,
816 unsigned int devino, 829 unsigned int devino,
817 void *_data) 830 void *_data)
@@ -1050,8 +1063,8 @@ static struct irq_trans pci_irq_trans_table[] = {
1050 { "pci108e,8001", schizo_irq_trans_init }, 1063 { "pci108e,8001", schizo_irq_trans_init },
1051 { "SUNW,schizo+", schizo_irq_trans_init }, 1064 { "SUNW,schizo+", schizo_irq_trans_init },
1052 { "pci108e,8002", schizo_irq_trans_init }, 1065 { "pci108e,8002", schizo_irq_trans_init },
1053 { "SUNW,tomatillo", schizo_irq_trans_init }, 1066 { "SUNW,tomatillo", tomatillo_irq_trans_init },
1054 { "pci108e,a801", schizo_irq_trans_init }, 1067 { "pci108e,a801", tomatillo_irq_trans_init },
1055 { "SUNW,sun4v-pci", pci_sun4v_irq_trans_init }, 1068 { "SUNW,sun4v-pci", pci_sun4v_irq_trans_init },
1056}; 1069};
1057#endif 1070#endif
@@ -1079,23 +1092,22 @@ static void sun4v_vdev_irq_trans_init(struct device_node *dp)
1079 1092
1080static void irq_trans_init(struct device_node *dp) 1093static void irq_trans_init(struct device_node *dp)
1081{ 1094{
1082 const char *model;
1083#ifdef CONFIG_PCI 1095#ifdef CONFIG_PCI
1096 const char *model;
1084 int i; 1097 int i;
1085#endif 1098#endif
1086 1099
1100#ifdef CONFIG_PCI
1087 model = of_get_property(dp, "model", NULL); 1101 model = of_get_property(dp, "model", NULL);
1088 if (!model) 1102 if (!model)
1089 model = of_get_property(dp, "compatible", NULL); 1103 model = of_get_property(dp, "compatible", NULL);
1090 if (!model) 1104 if (model) {
1091 return; 1105 for (i = 0; i < ARRAY_SIZE(pci_irq_trans_table); i++) {
1092 1106 struct irq_trans *t = &pci_irq_trans_table[i];
1093#ifdef CONFIG_PCI
1094 for (i = 0; i < ARRAY_SIZE(pci_irq_trans_table); i++) {
1095 struct irq_trans *t = &pci_irq_trans_table[i];
1096 1107
1097 if (!strcmp(model, t->name)) 1108 if (!strcmp(model, t->name))
1098 return t->init(dp); 1109 return t->init(dp);
1110 }
1099 } 1111 }
1100#endif 1112#endif
1101#ifdef CONFIG_SBUS 1113#ifdef CONFIG_SBUS
@@ -1103,8 +1115,9 @@ static void irq_trans_init(struct device_node *dp)
1103 !strcmp(dp->name, "sbi")) 1115 !strcmp(dp->name, "sbi"))
1104 return sbus_irq_trans_init(dp); 1116 return sbus_irq_trans_init(dp);
1105#endif 1117#endif
1106 if (!strcmp(dp->name, "central")) 1118 if (!strcmp(dp->name, "fhc") &&
1107 return central_irq_trans_init(dp->child); 1119 !strcmp(dp->parent->name, "central"))
1120 return central_irq_trans_init(dp);
1108 if (!strcmp(dp->name, "virtual-devices")) 1121 if (!strcmp(dp->name, "virtual-devices"))
1109 return sun4v_vdev_irq_trans_init(dp); 1122 return sun4v_vdev_irq_trans_init(dp);
1110} 1123}
@@ -1516,7 +1529,7 @@ static char * __init get_one_property(phandle node, const char *name)
1516 return buf; 1529 return buf;
1517} 1530}
1518 1531
1519static struct device_node * __init create_node(phandle node) 1532static struct device_node * __init create_node(phandle node, struct device_node *parent)
1520{ 1533{
1521 struct device_node *dp; 1534 struct device_node *dp;
1522 1535
@@ -1525,6 +1538,7 @@ static struct device_node * __init create_node(phandle node)
1525 1538
1526 dp = prom_early_alloc(sizeof(*dp)); 1539 dp = prom_early_alloc(sizeof(*dp));
1527 dp->unique_id = unique_id++; 1540 dp->unique_id = unique_id++;
1541 dp->parent = parent;
1528 1542
1529 kref_init(&dp->kref); 1543 kref_init(&dp->kref);
1530 1544
@@ -1543,12 +1557,11 @@ static struct device_node * __init build_tree(struct device_node *parent, phandl
1543{ 1557{
1544 struct device_node *dp; 1558 struct device_node *dp;
1545 1559
1546 dp = create_node(node); 1560 dp = create_node(node, parent);
1547 if (dp) { 1561 if (dp) {
1548 *(*nextp) = dp; 1562 *(*nextp) = dp;
1549 *nextp = &dp->allnext; 1563 *nextp = &dp->allnext;
1550 1564
1551 dp->parent = parent;
1552 dp->path_component_name = build_path_component(dp); 1565 dp->path_component_name = build_path_component(dp);
1553 dp->full_name = build_full_name(dp); 1566 dp->full_name = build_full_name(dp);
1554 1567
@@ -1564,7 +1577,7 @@ void __init prom_build_devicetree(void)
1564{ 1577{
1565 struct device_node **nextp; 1578 struct device_node **nextp;
1566 1579
1567 allnodes = create_node(prom_root_node); 1580 allnodes = create_node(prom_root_node, NULL);
1568 allnodes->path_component_name = ""; 1581 allnodes->path_component_name = "";
1569 allnodes->full_name = "/"; 1582 allnodes->full_name = "/";
1570 1583
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index cc8ad480a20..bf033b31d43 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -74,7 +74,6 @@ prom_console_write(struct console *con, const char *s, unsigned n)
74 74
75unsigned int boot_flags = 0; 75unsigned int boot_flags = 0;
76#define BOOTME_DEBUG 0x1 76#define BOOTME_DEBUG 0x1
77#define BOOTME_SINGLE 0x2
78 77
79/* Exported for mm/init.c:paging_init. */ 78/* Exported for mm/init.c:paging_init. */
80unsigned long cmdline_memory_size = 0; 79unsigned long cmdline_memory_size = 0;
@@ -102,7 +101,6 @@ static void __init process_switch(char c)
102 boot_flags |= BOOTME_DEBUG; 101 boot_flags |= BOOTME_DEBUG;
103 break; 102 break;
104 case 's': 103 case 's':
105 boot_flags |= BOOTME_SINGLE;
106 break; 104 break;
107 case 'h': 105 case 'h':
108 prom_printf("boot_flags_init: Halt!\n"); 106 prom_printf("boot_flags_init: Halt!\n");
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index 419a63fca17..9a8026797ac 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -79,7 +79,7 @@ sys_call_table32:
79 .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 79 .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64
80/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 80/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
81 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare 81 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare
82/*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list 82/*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list, compat_sys_migrate_pages
83 83
84#endif /* CONFIG_COMPAT */ 84#endif /* CONFIG_COMPAT */
85 85
@@ -149,7 +149,7 @@ sys_call_table:
149 .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 149 .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
150/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 150/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
151 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 151 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
152/*300*/ .word sys_set_robust_list, sys_get_robust_list 152/*300*/ .word sys_set_robust_list, sys_get_robust_list, sys_migrate_pages
153 153
154#if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ 154#if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \
155 defined(CONFIG_SOLARIS_EMUL_MODULE) 155 defined(CONFIG_SOLARIS_EMUL_MODULE)
@@ -262,5 +262,7 @@ sunos_sys_table:
262/*290*/ .word sunos_nosys, sunos_nosys, sunos_nosys 262/*290*/ .word sunos_nosys, sunos_nosys, sunos_nosys
263 .word sunos_nosys, sunos_nosys, sunos_nosys 263 .word sunos_nosys, sunos_nosys, sunos_nosys
264 .word sunos_nosys, sunos_nosys, sunos_nosys 264 .word sunos_nosys, sunos_nosys, sunos_nosys
265 .word sunos_nosys, sunos_nosys, sunos_nosys 265 .word sunos_nosys
266/*300*/ .word sunos_nosys, sunos_nosys, sunos_nosys
267
266#endif 268#endif
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index 68420e2dad0..fe1796c939c 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -87,6 +87,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p)
87 i + 1, 87 i + 1,
88 p->trapstack[i].tstate, p->trapstack[i].tpc, 88 p->trapstack[i].tstate, p->trapstack[i].tpc,
89 p->trapstack[i].tnpc, p->trapstack[i].tt); 89 p->trapstack[i].tnpc, p->trapstack[i].tt);
90 print_symbol("TRAPLOG: TPC<%s>\n", p->trapstack[i].tpc);
90 } 91 }
91} 92}
92 93
@@ -1134,6 +1135,9 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in
1134 printk("%s" "ERROR(%d): TPC[%lx] TNPC[%lx] O7[%lx] TSTATE[%lx]\n", 1135 printk("%s" "ERROR(%d): TPC[%lx] TNPC[%lx] O7[%lx] TSTATE[%lx]\n",
1135 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1136 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1136 regs->tpc, regs->tnpc, regs->u_regs[UREG_I7], regs->tstate); 1137 regs->tpc, regs->tnpc, regs->u_regs[UREG_I7], regs->tstate);
1138 printk("%s" "ERROR(%d): ",
1139 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id());
1140 print_symbol("TPC<%s>\n", regs->tpc);
1137 printk("%s" "ERROR(%d): M_SYND(%lx), E_SYND(%lx)%s%s\n", 1141 printk("%s" "ERROR(%d): M_SYND(%lx), E_SYND(%lx)%s%s\n",
1138 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1142 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1139 (afsr & CHAFSR_M_SYNDROME) >> CHAFSR_M_SYNDROME_SHIFT, 1143 (afsr & CHAFSR_M_SYNDROME) >> CHAFSR_M_SYNDROME_SHIFT,
@@ -1741,6 +1745,7 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs)
1741 smp_processor_id(), 1745 smp_processor_id(),
1742 (type & 0x1) ? 'I' : 'D', 1746 (type & 0x1) ? 'I' : 'D',
1743 regs->tpc); 1747 regs->tpc);
1748 print_symbol(KERN_EMERG "TPC<%s>\n", regs->tpc);
1744 panic("Irrecoverable Cheetah+ parity error."); 1749 panic("Irrecoverable Cheetah+ parity error.");
1745 } 1750 }
1746 1751
@@ -1748,6 +1753,7 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs)
1748 smp_processor_id(), 1753 smp_processor_id(),
1749 (type & 0x1) ? 'I' : 'D', 1754 (type & 0x1) ? 'I' : 'D',
1750 regs->tpc); 1755 regs->tpc);
1756 print_symbol(KERN_WARNING "TPC<%s>\n", regs->tpc);
1751} 1757}
1752 1758
1753struct sun4v_error_entry { 1759struct sun4v_error_entry {
@@ -1946,6 +1952,7 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
1946 1952
1947 printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n", 1953 printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
1948 regs->tpc, tl); 1954 regs->tpc, tl);
1955 print_symbol(KERN_EMERG "SUN4V-ITLB: TPC<%s>\n", regs->tpc);
1949 printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] " 1956 printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] "
1950 "pte[%lx] error[%lx]\n", 1957 "pte[%lx] error[%lx]\n",
1951 sun4v_err_itlb_vaddr, sun4v_err_itlb_ctx, 1958 sun4v_err_itlb_vaddr, sun4v_err_itlb_ctx,
@@ -1966,6 +1973,7 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl)
1966 1973
1967 printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n", 1974 printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n",
1968 regs->tpc, tl); 1975 regs->tpc, tl);
1976 print_symbol(KERN_EMERG "SUN4V-DTLB: TPC<%s>\n", regs->tpc);
1969 printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] " 1977 printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] "
1970 "pte[%lx] error[%lx]\n", 1978 "pte[%lx] error[%lx]\n",
1971 sun4v_err_dtlb_vaddr, sun4v_err_dtlb_ctx, 1979 sun4v_err_dtlb_vaddr, sun4v_err_dtlb_ctx,
diff --git a/arch/sparc64/kernel/vmlinux.lds.S b/arch/sparc64/kernel/vmlinux.lds.S
index b097379a49a..bd9de8c2a2a 100644
--- a/arch/sparc64/kernel/vmlinux.lds.S
+++ b/arch/sparc64/kernel/vmlinux.lds.S
@@ -57,13 +57,7 @@ SECTIONS
57 __setup_end = .; 57 __setup_end = .;
58 __initcall_start = .; 58 __initcall_start = .;
59 .initcall.init : { 59 .initcall.init : {
60 *(.initcall1.init) 60 INITCALLS
61 *(.initcall2.init)
62 *(.initcall3.init)
63 *(.initcall4.init)
64 *(.initcall5.init)
65 *(.initcall6.init)
66 *(.initcall7.init)
67 } 61 }
68 __initcall_end = .; 62 __initcall_end = .;
69 __con_initcall_start = .; 63 __con_initcall_start = .;
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 78fb619bdb7..5ac1f2963ae 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -1,3 +1,8 @@
1config DEFCONFIG_LIST
2 string
3 option defconfig_list
4 default "arch/$ARCH/defconfig"
5
1# UML uses the generic IRQ sugsystem 6# UML uses the generic IRQ sugsystem
2config GENERIC_HARDIRQS 7config GENERIC_HARDIRQS
3 bool 8 bool
@@ -52,6 +57,7 @@ menu "UML-specific options"
52config MODE_TT 57config MODE_TT
53 bool "Tracing thread support (DEPRECATED)" 58 bool "Tracing thread support (DEPRECATED)"
54 default n 59 default n
60 depends on BROKEN
55 help 61 help
56 This option controls whether tracing thread support is compiled 62 This option controls whether tracing thread support is compiled
57 into UML. This option is largely obsolete, given that skas0 provides 63 into UML. This option is largely obsolete, given that skas0 provides
diff --git a/arch/um/Kconfig.char b/arch/um/Kconfig.char
index 62d87b71179..e03e40c7aac 100644
--- a/arch/um/Kconfig.char
+++ b/arch/um/Kconfig.char
@@ -190,6 +190,11 @@ config HOSTAUDIO
190 tristate 190 tristate
191 default UML_SOUND 191 default UML_SOUND
192 192
193#It is selected elsewhere, so kconfig would warn without this.
194config HW_RANDOM
195 tristate
196 default n
197
193config UML_RANDOM 198config UML_RANDOM
194 tristate "Hardware random number generator" 199 tristate "Hardware random number generator"
195 help 200 help
diff --git a/arch/um/Makefile b/arch/um/Makefile
index c8016a98483..5d5ed726faa 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -64,9 +64,14 @@ CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
64 64
65AFLAGS += $(ARCH_INCLUDE) 65AFLAGS += $(ARCH_INCLUDE)
66 66
67USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) 67USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
68USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ 68 $(patsubst -I%,,$(CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
69 $(MODE_INCLUDE) -D_FILE_OFFSET_BITS=64 69 -D_FILE_OFFSET_BITS=64
70
71include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
72
73#This will adjust *FLAGS accordingly to the platform.
74include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
70 75
71# -Derrno=kernel_errno - This turns all kernel references to errno into 76# -Derrno=kernel_errno - This turns all kernel references to errno into
72# kernel_errno to separate them from the libc errno. This allows -fno-common 77# kernel_errno to separate them from the libc errno. This allows -fno-common
@@ -74,15 +79,11 @@ USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
74# errnos. 79# errnos.
75# These apply to kernelspace only. 80# These apply to kernelspace only.
76 81
77CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ 82KERNEL_DEFINES = -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \
78 -Dmktime=kernel_mktime 83 -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)
84CFLAGS += $(KERNEL_DEFINES)
79CFLAGS += $(call cc-option,-fno-unit-at-a-time,) 85CFLAGS += $(call cc-option,-fno-unit-at-a-time,)
80 86
81include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
82
83#This will adjust *FLAGS accordingly to the platform.
84include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
85
86# These are needed for clean and mrproper, since in that case .config is not 87# These are needed for clean and mrproper, since in that case .config is not
87# included; the values here are meaningless 88# included; the values here are meaningless
88 89
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
index b65ca115ef7..c9f1c5b24c9 100644
--- a/arch/um/Makefile-i386
+++ b/arch/um/Makefile-i386
@@ -16,7 +16,6 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S
16ifeq ("$(origin SUBARCH)", "command line") 16ifeq ("$(origin SUBARCH)", "command line")
17ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)") 17ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
18CFLAGS += $(call cc-option,-m32) 18CFLAGS += $(call cc-option,-m32)
19USER_CFLAGS += $(call cc-option,-m32)
20AFLAGS += $(call cc-option,-m32) 19AFLAGS += $(call cc-option,-m32)
21LINK-y += $(call cc-option,-m32) 20LINK-y += $(call cc-option,-m32)
22UML_OBJCOPYFLAGS += -F $(ELF_FORMAT) 21UML_OBJCOPYFLAGS += -F $(ELF_FORMAT)
@@ -25,7 +24,7 @@ export LDFLAGS HOSTCFLAGS HOSTLDFLAGS UML_OBJCOPYFLAGS
25endif 24endif
26endif 25endif
27 26
28CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH) 27ARCH_KERNEL_DEFINES += -U__$(SUBARCH)__ -U$(SUBARCH)
29 28
30# First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y. 29# First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
31include $(srctree)/arch/i386/Makefile.cpu 30include $(srctree)/arch/i386/Makefile.cpu
@@ -38,4 +37,3 @@ cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
38cflags-y += -ffreestanding 37cflags-y += -ffreestanding
39 38
40CFLAGS += $(cflags-y) 39CFLAGS += $(cflags-y)
41USER_CFLAGS += $(cflags-y)
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64
index d278682dd79..69ecea63fda 100644
--- a/arch/um/Makefile-x86_64
+++ b/arch/um/Makefile-x86_64
@@ -8,8 +8,8 @@ _extra_flags_ = -fno-builtin -m64
8 8
9#We #undef __x86_64__ for kernelspace, not for userspace where 9#We #undef __x86_64__ for kernelspace, not for userspace where
10#it's needed for headers to work! 10#it's needed for headers to work!
11CFLAGS += -U__$(SUBARCH)__ $(_extra_flags_) 11ARCH_KERNEL_DEFINES = -U__$(SUBARCH)__
12USER_CFLAGS += $(_extra_flags_) 12CFLAGS += $(_extra_flags_)
13 13
14CHECKFLAGS += -m64 14CHECKFLAGS += -m64
15AFLAGS += -m64 15AFLAGS += -m64
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index 2f880cb167a..0cad3546cb8 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -120,7 +120,7 @@ static int winch_thread(void *arg)
120 /* These are synchronization calls between various UML threads on the 120 /* These are synchronization calls between various UML threads on the
121 * host - since they are not different kernel threads, we cannot use 121 * host - since they are not different kernel threads, we cannot use
122 * kernel semaphores. We don't use SysV semaphores because they are 122 * kernel semaphores. We don't use SysV semaphores because they are
123 * persistant. */ 123 * persistent. */
124 count = os_read_file(pipe_fd, &c, sizeof(c)); 124 count = os_read_file(pipe_fd, &c, sizeof(c));
125 if(count != sizeof(c)) 125 if(count != sizeof(c))
126 printk("winch_thread : failed to read synchronization byte, " 126 printk("winch_thread : failed to read synchronization byte, "
diff --git a/arch/um/drivers/cow_sys.h b/arch/um/drivers/cow_sys.h
index 7a5b4afde69..c6a308464ac 100644
--- a/arch/um/drivers/cow_sys.h
+++ b/arch/um/drivers/cow_sys.h
@@ -5,6 +5,7 @@
5#include "user_util.h" 5#include "user_util.h"
6#include "os.h" 6#include "os.h"
7#include "user.h" 7#include "user.h"
8#include "um_malloc.h"
8 9
9static inline void *cow_malloc(int size) 10static inline void *cow_malloc(int size)
10{ 11{
diff --git a/arch/um/drivers/daemon_user.c b/arch/um/drivers/daemon_user.c
index 77954ea7704..310af0f1e49 100644
--- a/arch/um/drivers/daemon_user.c
+++ b/arch/um/drivers/daemon_user.c
@@ -17,6 +17,7 @@
17#include "user_util.h" 17#include "user_util.h"
18#include "user.h" 18#include "user.h"
19#include "os.h" 19#include "os.h"
20#include "um_malloc.h"
20 21
21#define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER) 22#define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER)
22 23
diff --git a/arch/um/drivers/fd.c b/arch/um/drivers/fd.c
index 108b7dafbd0..218aa0e9b79 100644
--- a/arch/um/drivers/fd.c
+++ b/arch/um/drivers/fd.c
@@ -12,6 +12,7 @@
12#include "user_util.h" 12#include "user_util.h"
13#include "chan_user.h" 13#include "chan_user.h"
14#include "os.h" 14#include "os.h"
15#include "um_malloc.h"
15 16
16struct fd_chan { 17struct fd_chan {
17 int fd; 18 int fd;
diff --git a/arch/um/drivers/mcast_user.c b/arch/um/drivers/mcast_user.c
index 4d2bd39a85b..8138f5ea1bf 100644
--- a/arch/um/drivers/mcast_user.c
+++ b/arch/um/drivers/mcast_user.c
@@ -23,6 +23,7 @@
23#include "user_util.h" 23#include "user_util.h"
24#include "user.h" 24#include "user.h"
25#include "os.h" 25#include "os.h"
26#include "um_malloc.h"
26 27
27#define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER) 28#define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER)
28 29
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index d08bd036ccb..7b172160fe0 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -79,7 +79,7 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id)
79 /* long to avoid size mismatch warnings from gcc */ 79 /* long to avoid size mismatch warnings from gcc */
80 long fd; 80 long fd;
81 struct mconsole_entry *new; 81 struct mconsole_entry *new;
82 struct mc_request req; 82 static struct mc_request req; /* that's OK */
83 83
84 fd = (long) dev_id; 84 fd = (long) dev_id;
85 while (mconsole_get_request(fd, &req)){ 85 while (mconsole_get_request(fd, &req)){
@@ -91,6 +91,7 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id)
91 mconsole_reply(&req, "Out of memory", 1, 0); 91 mconsole_reply(&req, "Out of memory", 1, 0);
92 else { 92 else {
93 new->request = req; 93 new->request = req;
94 new->request.regs = get_irq_regs()->regs;
94 list_add(&new->list, &mc_requests); 95 list_add(&new->list, &mc_requests);
95 } 96 }
96 } 97 }
@@ -314,9 +315,21 @@ void mconsole_stop(struct mc_request *req)
314{ 315{
315 deactivate_fd(req->originating_fd, MCONSOLE_IRQ); 316 deactivate_fd(req->originating_fd, MCONSOLE_IRQ);
316 os_set_fd_block(req->originating_fd, 1); 317 os_set_fd_block(req->originating_fd, 1);
317 mconsole_reply(req, "", 0, 0); 318 mconsole_reply(req, "stopped", 0, 0);
318 while(mconsole_get_request(req->originating_fd, req)){ 319 while (mconsole_get_request(req->originating_fd, req)) {
319 if(req->cmd->handler == mconsole_go) break; 320 if (req->cmd->handler == mconsole_go)
321 break;
322 if (req->cmd->handler == mconsole_stop) {
323 mconsole_reply(req, "Already stopped", 1, 0);
324 continue;
325 }
326 if (req->cmd->handler == mconsole_sysrq) {
327 struct pt_regs *old_regs;
328 old_regs = set_irq_regs((struct pt_regs *)&req->regs);
329 mconsole_sysrq(req);
330 set_irq_regs(old_regs);
331 continue;
332 }
320 (*req->cmd->handler)(req); 333 (*req->cmd->handler)(req);
321 } 334 }
322 os_set_fd_block(req->originating_fd, 0); 335 os_set_fd_block(req->originating_fd, 0);
@@ -673,9 +686,7 @@ static void with_console(struct mc_request *req, void (*proc)(void *),
673static void sysrq_proc(void *arg) 686static void sysrq_proc(void *arg)
674{ 687{
675 char *op = arg; 688 char *op = arg;
676 struct pt_regs *old_regs = set_irq_regs(&current->thread.regs);
677 handle_sysrq(*op, NULL); 689 handle_sysrq(*op, NULL);
678 set_irq_regs(old_regs);
679} 690}
680 691
681void mconsole_sysrq(struct mc_request *req) 692void mconsole_sysrq(struct mc_request *req)
diff --git a/arch/um/drivers/mconsole_user.c b/arch/um/drivers/mconsole_user.c
index 17068eb746c..75aef6f7ef6 100644
--- a/arch/um/drivers/mconsole_user.c
+++ b/arch/um/drivers/mconsole_user.c
@@ -14,6 +14,7 @@
14#include <sys/un.h> 14#include <sys/un.h>
15#include <unistd.h> 15#include <unistd.h>
16#include "user.h" 16#include "user.h"
17#include "sysdep/ptrace.h"
17#include "mconsole.h" 18#include "mconsole.h"
18#include "umid.h" 19#include "umid.h"
19#include "user_util.h" 20#include "user_util.h"
diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c
index 9a3b5daf625..df3516e47d4 100644
--- a/arch/um/drivers/mmapper_kern.c
+++ b/arch/um/drivers/mmapper_kern.c
@@ -95,7 +95,8 @@ static const struct file_operations mmapper_fops = {
95 .release = mmapper_release, 95 .release = mmapper_release,
96}; 96};
97 97
98static const struct miscdevice mmapper_dev = { 98/* No locking needed - only used (and modified) by below initcall and exitcall. */
99static struct miscdevice mmapper_dev = {
99 .minor = MISC_DYNAMIC_MINOR, 100 .minor = MISC_DYNAMIC_MINOR,
100 .name = "mmapper", 101 .name = "mmapper",
101 .fops = &mmapper_fops 102 .fops = &mmapper_fops
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c
index f3a3f8a29c7..0ffd7ac295d 100644
--- a/arch/um/drivers/net_user.c
+++ b/arch/um/drivers/net_user.c
@@ -18,6 +18,7 @@
18#include "kern_util.h" 18#include "kern_util.h"
19#include "net_user.h" 19#include "net_user.h"
20#include "os.h" 20#include "os.h"
21#include "um_malloc.h"
21 22
22int tap_open_common(void *dev, char *gate_addr) 23int tap_open_common(void *dev, char *gate_addr)
23{ 24{
diff --git a/arch/um/drivers/pcap_user.c b/arch/um/drivers/pcap_user.c
index 2ef641ded96..11921a7baa7 100644
--- a/arch/um/drivers/pcap_user.c
+++ b/arch/um/drivers/pcap_user.c
@@ -12,6 +12,7 @@
12#include "net_user.h" 12#include "net_user.h"
13#include "pcap_user.h" 13#include "pcap_user.h"
14#include "user.h" 14#include "user.h"
15#include "um_malloc.h"
15 16
16#define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER) 17#define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER)
17 18
diff --git a/arch/um/drivers/port_user.c b/arch/um/drivers/port_user.c
index f2e8fc42ecc..bc6afaf74c1 100644
--- a/arch/um/drivers/port_user.c
+++ b/arch/um/drivers/port_user.c
@@ -19,6 +19,7 @@
19#include "chan_user.h" 19#include "chan_user.h"
20#include "port.h" 20#include "port.h"
21#include "os.h" 21#include "os.h"
22#include "um_malloc.h"
22 23
23struct port_chan { 24struct port_chan {
24 int raw; 25 int raw;
diff --git a/arch/um/drivers/pty.c b/arch/um/drivers/pty.c
index abec620e838..829a5eca8c0 100644
--- a/arch/um/drivers/pty.c
+++ b/arch/um/drivers/pty.c
@@ -13,6 +13,7 @@
13#include "user_util.h" 13#include "user_util.h"
14#include "kern_util.h" 14#include "kern_util.h"
15#include "os.h" 15#include "os.h"
16#include "um_malloc.h"
16 17
17struct pty_chan { 18struct pty_chan {
18 void (*announce)(char *dev_name, int dev); 19 void (*announce)(char *dev_name, int dev);
diff --git a/arch/um/drivers/slip_user.c b/arch/um/drivers/slip_user.c
index 8460285c69a..7eddacc53b6 100644
--- a/arch/um/drivers/slip_user.c
+++ b/arch/um/drivers/slip_user.c
@@ -15,6 +15,7 @@
15#include "slip.h" 15#include "slip.h"
16#include "slip_common.h" 16#include "slip_common.h"
17#include "os.h" 17#include "os.h"
18#include "um_malloc.h"
18 19
19void slip_user_init(void *data, void *dev) 20void slip_user_init(void *data, void *dev)
20{ 21{
diff --git a/arch/um/drivers/tty.c b/arch/um/drivers/tty.c
index 11de3ac1eb5..d95d64309ea 100644
--- a/arch/um/drivers/tty.c
+++ b/arch/um/drivers/tty.c
@@ -11,6 +11,7 @@
11#include "user_util.h" 11#include "user_util.h"
12#include "user.h" 12#include "user.h"
13#include "os.h" 13#include "os.h"
14#include "um_malloc.h"
14 15
15struct tty_chan { 16struct tty_chan {
16 char *dev; 17 char *dev;
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index bc458f57921..49c047b75cc 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -106,10 +106,15 @@ static inline void ubd_set_bit(__u64 bit, unsigned char *data)
106 106
107#define DRIVER_NAME "uml-blkdev" 107#define DRIVER_NAME "uml-blkdev"
108 108
109/* Can be taken in interrupt context, and is passed to the block layer to lock
110 * the request queue. Kernel side code knows that. */
109static DEFINE_SPINLOCK(ubd_io_lock); 111static DEFINE_SPINLOCK(ubd_io_lock);
110static DEFINE_SPINLOCK(ubd_lock);
111 112
112static void (*do_ubd)(void); 113static DEFINE_MUTEX(ubd_lock);
114
115/* XXX - this made sense in 2.4 days, now it's only used as a boolean, and
116 * probably it doesn't make sense even for that. */
117static int do_ubd;
113 118
114static int ubd_open(struct inode * inode, struct file * filp); 119static int ubd_open(struct inode * inode, struct file * filp);
115static int ubd_release(struct inode * inode, struct file * file); 120static int ubd_release(struct inode * inode, struct file * file);
@@ -117,7 +122,7 @@ static int ubd_ioctl(struct inode * inode, struct file * file,
117 unsigned int cmd, unsigned long arg); 122 unsigned int cmd, unsigned long arg);
118static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo); 123static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo);
119 124
120#define MAX_DEV (8) 125#define MAX_DEV (16)
121 126
122static struct block_device_operations ubd_blops = { 127static struct block_device_operations ubd_blops = {
123 .owner = THIS_MODULE, 128 .owner = THIS_MODULE,
@@ -150,8 +155,9 @@ static struct gendisk *fake_gendisk[MAX_DEV];
150static struct openflags global_openflags = OPEN_FLAGS; 155static struct openflags global_openflags = OPEN_FLAGS;
151 156
152struct cow { 157struct cow {
153 /* This is the backing file, actually */ 158 /* backing file name */
154 char *file; 159 char *file;
160 /* backing file fd */
155 int fd; 161 int fd;
156 unsigned long *bitmap; 162 unsigned long *bitmap;
157 unsigned long bitmap_len; 163 unsigned long bitmap_len;
@@ -160,14 +166,16 @@ struct cow {
160}; 166};
161 167
162struct ubd { 168struct ubd {
169 /* name (and fd, below) of the file opened for writing, either the
170 * backing or the cow file. */
163 char *file; 171 char *file;
164 int count; 172 int count;
165 int fd; 173 int fd;
166 __u64 size; 174 __u64 size;
167 struct openflags boot_openflags; 175 struct openflags boot_openflags;
168 struct openflags openflags; 176 struct openflags openflags;
169 int shared; 177 unsigned shared:1;
170 int no_cow; 178 unsigned no_cow:1;
171 struct cow cow; 179 struct cow cow;
172 struct platform_device pdev; 180 struct platform_device pdev;
173}; 181};
@@ -192,18 +200,7 @@ struct ubd {
192 .cow = DEFAULT_COW, \ 200 .cow = DEFAULT_COW, \
193} 201}
194 202
195struct ubd ubd_dev[MAX_DEV] = { [ 0 ... MAX_DEV - 1 ] = DEFAULT_UBD }; 203struct ubd ubd_devs[MAX_DEV] = { [ 0 ... MAX_DEV - 1 ] = DEFAULT_UBD };
196
197static int ubd0_init(void)
198{
199 struct ubd *dev = &ubd_dev[0];
200
201 if(dev->file == NULL)
202 dev->file = "root_fs";
203 return(0);
204}
205
206__initcall(ubd0_init);
207 204
208/* Only changed by fake_ide_setup which is a setup */ 205/* Only changed by fake_ide_setup which is a setup */
209static int fake_ide = 0; 206static int fake_ide = 0;
@@ -277,7 +274,7 @@ static int parse_unit(char **ptr)
277 return(-1); 274 return(-1);
278 *ptr = end; 275 *ptr = end;
279 } 276 }
280 else if (('a' <= *str) && (*str <= 'h')) { 277 else if (('a' <= *str) && (*str <= 'z')) {
281 n = *str - 'a'; 278 n = *str - 'a';
282 str++; 279 str++;
283 *ptr = str; 280 *ptr = str;
@@ -285,9 +282,13 @@ static int parse_unit(char **ptr)
285 return(n); 282 return(n);
286} 283}
287 284
285/* If *index_out == -1 at exit, the passed option was a general one;
286 * otherwise, the str pointer is used (and owned) inside ubd_devs array, so it
287 * should not be freed on exit.
288 */
288static int ubd_setup_common(char *str, int *index_out) 289static int ubd_setup_common(char *str, int *index_out)
289{ 290{
290 struct ubd *dev; 291 struct ubd *ubd_dev;
291 struct openflags flags = global_openflags; 292 struct openflags flags = global_openflags;
292 char *backing_file; 293 char *backing_file;
293 int n, err, i; 294 int n, err, i;
@@ -311,7 +312,7 @@ static int ubd_setup_common(char *str, int *index_out)
311 } 312 }
312 313
313 err = 1; 314 err = 1;
314 spin_lock(&ubd_lock); 315 mutex_lock(&ubd_lock);
315 if(fake_major != MAJOR_NR){ 316 if(fake_major != MAJOR_NR){
316 printk(KERN_ERR "Can't assign a fake major twice\n"); 317 printk(KERN_ERR "Can't assign a fake major twice\n");
317 goto out1; 318 goto out1;
@@ -323,7 +324,7 @@ static int ubd_setup_common(char *str, int *index_out)
323 major); 324 major);
324 err = 0; 325 err = 0;
325 out1: 326 out1:
326 spin_unlock(&ubd_lock); 327 mutex_unlock(&ubd_lock);
327 return(err); 328 return(err);
328 } 329 }
329 330
@@ -340,10 +341,10 @@ static int ubd_setup_common(char *str, int *index_out)
340 } 341 }
341 342
342 err = 1; 343 err = 1;
343 spin_lock(&ubd_lock); 344 mutex_lock(&ubd_lock);
344 345
345 dev = &ubd_dev[n]; 346 ubd_dev = &ubd_devs[n];
346 if(dev->file != NULL){ 347 if(ubd_dev->file != NULL){
347 printk(KERN_ERR "ubd_setup : device already configured\n"); 348 printk(KERN_ERR "ubd_setup : device already configured\n");
348 goto out; 349 goto out;
349 } 350 }
@@ -360,10 +361,10 @@ static int ubd_setup_common(char *str, int *index_out)
360 flags.s = 1; 361 flags.s = 1;
361 break; 362 break;
362 case 'd': 363 case 'd':
363 dev->no_cow = 1; 364 ubd_dev->no_cow = 1;
364 break; 365 break;
365 case 'c': 366 case 'c':
366 dev->shared = 1; 367 ubd_dev->shared = 1;
367 break; 368 break;
368 case '=': 369 case '=':
369 str++; 370 str++;
@@ -390,7 +391,7 @@ break_loop:
390 } 391 }
391 392
392 if(backing_file){ 393 if(backing_file){
393 if(dev->no_cow) 394 if(ubd_dev->no_cow)
394 printk(KERN_ERR "Can't specify both 'd' and a " 395 printk(KERN_ERR "Can't specify both 'd' and a "
395 "cow file\n"); 396 "cow file\n");
396 else { 397 else {
@@ -398,11 +399,11 @@ break_loop:
398 backing_file++; 399 backing_file++;
399 } 400 }
400 } 401 }
401 dev->file = str; 402 ubd_dev->file = str;
402 dev->cow.file = backing_file; 403 ubd_dev->cow.file = backing_file;
403 dev->boot_openflags = flags; 404 ubd_dev->boot_openflags = flags;
404out: 405out:
405 spin_unlock(&ubd_lock); 406 mutex_unlock(&ubd_lock);
406 return(err); 407 return(err);
407} 408}
408 409
@@ -472,8 +473,9 @@ int thread_fd = -1;
472 473
473/* Changed by ubd_handler, which is serialized because interrupts only 474/* Changed by ubd_handler, which is serialized because interrupts only
474 * happen on CPU 0. 475 * happen on CPU 0.
476 * XXX: currently unused.
475 */ 477 */
476int intr_count = 0; 478static int intr_count = 0;
477 479
478/* call ubd_finish if you need to serialize */ 480/* call ubd_finish if you need to serialize */
479static void __ubd_finish(struct request *req, int error) 481static void __ubd_finish(struct request *req, int error)
@@ -493,6 +495,8 @@ static void __ubd_finish(struct request *req, int error)
493 end_request(req, 1); 495 end_request(req, 1);
494} 496}
495 497
498/* Callable only from interrupt context - otherwise you need to do
499 * spin_lock_irq()/spin_lock_irqsave() */
496static inline void ubd_finish(struct request *req, int error) 500static inline void ubd_finish(struct request *req, int error)
497{ 501{
498 spin_lock(&ubd_io_lock); 502 spin_lock(&ubd_io_lock);
@@ -500,14 +504,15 @@ static inline void ubd_finish(struct request *req, int error)
500 spin_unlock(&ubd_io_lock); 504 spin_unlock(&ubd_io_lock);
501} 505}
502 506
503/* Called without ubd_io_lock held */ 507/* XXX - move this inside ubd_intr. */
508/* Called without ubd_io_lock held, and only in interrupt context. */
504static void ubd_handler(void) 509static void ubd_handler(void)
505{ 510{
506 struct io_thread_req req; 511 struct io_thread_req req;
507 struct request *rq = elv_next_request(ubd_queue); 512 struct request *rq = elv_next_request(ubd_queue);
508 int n; 513 int n;
509 514
510 do_ubd = NULL; 515 do_ubd = 0;
511 intr_count++; 516 intr_count++;
512 n = os_read_file(thread_fd, &req, sizeof(req)); 517 n = os_read_file(thread_fd, &req, sizeof(req));
513 if(n != sizeof(req)){ 518 if(n != sizeof(req)){
@@ -521,7 +526,9 @@ static void ubd_handler(void)
521 526
522 ubd_finish(rq, req.error); 527 ubd_finish(rq, req.error);
523 reactivate_fd(thread_fd, UBD_IRQ); 528 reactivate_fd(thread_fd, UBD_IRQ);
529 spin_lock(&ubd_io_lock);
524 do_ubd_request(ubd_queue); 530 do_ubd_request(ubd_queue);
531 spin_unlock(&ubd_io_lock);
525} 532}
526 533
527static irqreturn_t ubd_intr(int irq, void *dev) 534static irqreturn_t ubd_intr(int irq, void *dev)
@@ -541,87 +548,90 @@ void kill_io_thread(void)
541 548
542__uml_exitcall(kill_io_thread); 549__uml_exitcall(kill_io_thread);
543 550
544static int ubd_file_size(struct ubd *dev, __u64 *size_out) 551static inline int ubd_file_size(struct ubd *ubd_dev, __u64 *size_out)
545{ 552{
546 char *file; 553 char *file;
547 554
548 file = dev->cow.file ? dev->cow.file : dev->file; 555 file = ubd_dev->cow.file ? ubd_dev->cow.file : ubd_dev->file;
549 return(os_file_size(file, size_out)); 556 return(os_file_size(file, size_out));
550} 557}
551 558
552static void ubd_close(struct ubd *dev) 559static void ubd_close_dev(struct ubd *ubd_dev)
553{ 560{
554 os_close_file(dev->fd); 561 os_close_file(ubd_dev->fd);
555 if(dev->cow.file == NULL) 562 if(ubd_dev->cow.file == NULL)
556 return; 563 return;
557 564
558 os_close_file(dev->cow.fd); 565 os_close_file(ubd_dev->cow.fd);
559 vfree(dev->cow.bitmap); 566 vfree(ubd_dev->cow.bitmap);
560 dev->cow.bitmap = NULL; 567 ubd_dev->cow.bitmap = NULL;
561} 568}
562 569
563static int ubd_open_dev(struct ubd *dev) 570static int ubd_open_dev(struct ubd *ubd_dev)
564{ 571{
565 struct openflags flags; 572 struct openflags flags;
566 char **back_ptr; 573 char **back_ptr;
567 int err, create_cow, *create_ptr; 574 int err, create_cow, *create_ptr;
575 int fd;
568 576
569 dev->openflags = dev->boot_openflags; 577 ubd_dev->openflags = ubd_dev->boot_openflags;
570 create_cow = 0; 578 create_cow = 0;
571 create_ptr = (dev->cow.file != NULL) ? &create_cow : NULL; 579 create_ptr = (ubd_dev->cow.file != NULL) ? &create_cow : NULL;
572 back_ptr = dev->no_cow ? NULL : &dev->cow.file; 580 back_ptr = ubd_dev->no_cow ? NULL : &ubd_dev->cow.file;
573 dev->fd = open_ubd_file(dev->file, &dev->openflags, dev->shared, 581
574 back_ptr, &dev->cow.bitmap_offset, 582 fd = open_ubd_file(ubd_dev->file, &ubd_dev->openflags, ubd_dev->shared,
575 &dev->cow.bitmap_len, &dev->cow.data_offset, 583 back_ptr, &ubd_dev->cow.bitmap_offset,
584 &ubd_dev->cow.bitmap_len, &ubd_dev->cow.data_offset,
576 create_ptr); 585 create_ptr);
577 586
578 if((dev->fd == -ENOENT) && create_cow){ 587 if((fd == -ENOENT) && create_cow){
579 dev->fd = create_cow_file(dev->file, dev->cow.file, 588 fd = create_cow_file(ubd_dev->file, ubd_dev->cow.file,
580 dev->openflags, 1 << 9, PAGE_SIZE, 589 ubd_dev->openflags, 1 << 9, PAGE_SIZE,
581 &dev->cow.bitmap_offset, 590 &ubd_dev->cow.bitmap_offset,
582 &dev->cow.bitmap_len, 591 &ubd_dev->cow.bitmap_len,
583 &dev->cow.data_offset); 592 &ubd_dev->cow.data_offset);
584 if(dev->fd >= 0){ 593 if(fd >= 0){
585 printk(KERN_INFO "Creating \"%s\" as COW file for " 594 printk(KERN_INFO "Creating \"%s\" as COW file for "
586 "\"%s\"\n", dev->file, dev->cow.file); 595 "\"%s\"\n", ubd_dev->file, ubd_dev->cow.file);
587 } 596 }
588 } 597 }
589 598
590 if(dev->fd < 0){ 599 if(fd < 0){
591 printk("Failed to open '%s', errno = %d\n", dev->file, 600 printk("Failed to open '%s', errno = %d\n", ubd_dev->file,
592 -dev->fd); 601 -fd);
593 return(dev->fd); 602 return fd;
594 } 603 }
604 ubd_dev->fd = fd;
595 605
596 if(dev->cow.file != NULL){ 606 if(ubd_dev->cow.file != NULL){
597 err = -ENOMEM; 607 err = -ENOMEM;
598 dev->cow.bitmap = (void *) vmalloc(dev->cow.bitmap_len); 608 ubd_dev->cow.bitmap = (void *) vmalloc(ubd_dev->cow.bitmap_len);
599 if(dev->cow.bitmap == NULL){ 609 if(ubd_dev->cow.bitmap == NULL){
600 printk(KERN_ERR "Failed to vmalloc COW bitmap\n"); 610 printk(KERN_ERR "Failed to vmalloc COW bitmap\n");
601 goto error; 611 goto error;
602 } 612 }
603 flush_tlb_kernel_vm(); 613 flush_tlb_kernel_vm();
604 614
605 err = read_cow_bitmap(dev->fd, dev->cow.bitmap, 615 err = read_cow_bitmap(ubd_dev->fd, ubd_dev->cow.bitmap,
606 dev->cow.bitmap_offset, 616 ubd_dev->cow.bitmap_offset,
607 dev->cow.bitmap_len); 617 ubd_dev->cow.bitmap_len);
608 if(err < 0) 618 if(err < 0)
609 goto error; 619 goto error;
610 620
611 flags = dev->openflags; 621 flags = ubd_dev->openflags;
612 flags.w = 0; 622 flags.w = 0;
613 err = open_ubd_file(dev->cow.file, &flags, dev->shared, NULL, 623 err = open_ubd_file(ubd_dev->cow.file, &flags, ubd_dev->shared, NULL,
614 NULL, NULL, NULL, NULL); 624 NULL, NULL, NULL, NULL);
615 if(err < 0) goto error; 625 if(err < 0) goto error;
616 dev->cow.fd = err; 626 ubd_dev->cow.fd = err;
617 } 627 }
618 return(0); 628 return(0);
619 error: 629 error:
620 os_close_file(dev->fd); 630 os_close_file(ubd_dev->fd);
621 return(err); 631 return(err);
622} 632}
623 633
624static int ubd_new_disk(int major, u64 size, int unit, 634static int ubd_disk_register(int major, u64 size, int unit,
625 struct gendisk **disk_out) 635 struct gendisk **disk_out)
626 636
627{ 637{
@@ -642,13 +652,13 @@ static int ubd_new_disk(int major, u64 size, int unit,
642 652
643 /* sysfs register (not for ide fake devices) */ 653 /* sysfs register (not for ide fake devices) */
644 if (major == MAJOR_NR) { 654 if (major == MAJOR_NR) {
645 ubd_dev[unit].pdev.id = unit; 655 ubd_devs[unit].pdev.id = unit;
646 ubd_dev[unit].pdev.name = DRIVER_NAME; 656 ubd_devs[unit].pdev.name = DRIVER_NAME;
647 platform_device_register(&ubd_dev[unit].pdev); 657 platform_device_register(&ubd_devs[unit].pdev);
648 disk->driverfs_dev = &ubd_dev[unit].pdev.dev; 658 disk->driverfs_dev = &ubd_devs[unit].pdev.dev;
649 } 659 }
650 660
651 disk->private_data = &ubd_dev[unit]; 661 disk->private_data = &ubd_devs[unit];
652 disk->queue = ubd_queue; 662 disk->queue = ubd_queue;
653 add_disk(disk); 663 add_disk(disk);
654 664
@@ -660,25 +670,25 @@ static int ubd_new_disk(int major, u64 size, int unit,
660 670
661static int ubd_add(int n) 671static int ubd_add(int n)
662{ 672{
663 struct ubd *dev = &ubd_dev[n]; 673 struct ubd *ubd_dev = &ubd_devs[n];
664 int err; 674 int err;
665 675
666 err = -ENODEV; 676 err = -ENODEV;
667 if(dev->file == NULL) 677 if(ubd_dev->file == NULL)
668 goto out; 678 goto out;
669 679
670 err = ubd_file_size(dev, &dev->size); 680 err = ubd_file_size(ubd_dev, &ubd_dev->size);
671 if(err < 0) 681 if(err < 0)
672 goto out; 682 goto out;
673 683
674 dev->size = ROUND_BLOCK(dev->size); 684 ubd_dev->size = ROUND_BLOCK(ubd_dev->size);
675 685
676 err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]); 686 err = ubd_disk_register(MAJOR_NR, ubd_dev->size, n, &ubd_gendisk[n]);
677 if(err) 687 if(err)
678 goto out; 688 goto out;
679 689
680 if(fake_major != MAJOR_NR) 690 if(fake_major != MAJOR_NR)
681 ubd_new_disk(fake_major, dev->size, n, 691 ubd_disk_register(fake_major, ubd_dev->size, n,
682 &fake_gendisk[n]); 692 &fake_gendisk[n]);
683 693
684 /* perhaps this should also be under the "if (fake_major)" above */ 694 /* perhaps this should also be under the "if (fake_major)" above */
@@ -693,32 +703,41 @@ out:
693 703
694static int ubd_config(char *str) 704static int ubd_config(char *str)
695{ 705{
696 int n, err; 706 int n, ret;
697 707
698 str = kstrdup(str, GFP_KERNEL); 708 str = kstrdup(str, GFP_KERNEL);
699 if(str == NULL){ 709 if (str == NULL) {
700 printk(KERN_ERR "ubd_config failed to strdup string\n"); 710 printk(KERN_ERR "ubd_config failed to strdup string\n");
701 return(1); 711 ret = 1;
712 goto out;
702 } 713 }
703 err = ubd_setup_common(str, &n); 714 ret = ubd_setup_common(str, &n);
704 if(err){ 715 if (ret) {
705 kfree(str); 716 ret = -1;
706 return(-1); 717 goto err_free;
718 }
719 if (n == -1) {
720 ret = 0;
721 goto err_free;
707 } 722 }
708 if(n == -1) return(0);
709 723
710 spin_lock(&ubd_lock); 724 mutex_lock(&ubd_lock);
711 err = ubd_add(n); 725 ret = ubd_add(n);
712 if(err) 726 if (ret)
713 ubd_dev[n].file = NULL; 727 ubd_devs[n].file = NULL;
714 spin_unlock(&ubd_lock); 728 mutex_unlock(&ubd_lock);
715 729
716 return(err); 730out:
731 return ret;
732
733err_free:
734 kfree(str);
735 goto out;
717} 736}
718 737
719static int ubd_get_config(char *name, char *str, int size, char **error_out) 738static int ubd_get_config(char *name, char *str, int size, char **error_out)
720{ 739{
721 struct ubd *dev; 740 struct ubd *ubd_dev;
722 int n, len = 0; 741 int n, len = 0;
723 742
724 n = parse_unit(&name); 743 n = parse_unit(&name);
@@ -727,24 +746,24 @@ static int ubd_get_config(char *name, char *str, int size, char **error_out)
727 return(-1); 746 return(-1);
728 } 747 }
729 748
730 dev = &ubd_dev[n]; 749 ubd_dev = &ubd_devs[n];
731 spin_lock(&ubd_lock); 750 mutex_lock(&ubd_lock);
732 751
733 if(dev->file == NULL){ 752 if(ubd_dev->file == NULL){
734 CONFIG_CHUNK(str, size, len, "", 1); 753 CONFIG_CHUNK(str, size, len, "", 1);
735 goto out; 754 goto out;
736 } 755 }
737 756
738 CONFIG_CHUNK(str, size, len, dev->file, 0); 757 CONFIG_CHUNK(str, size, len, ubd_dev->file, 0);
739 758
740 if(dev->cow.file != NULL){ 759 if(ubd_dev->cow.file != NULL){
741 CONFIG_CHUNK(str, size, len, ",", 0); 760 CONFIG_CHUNK(str, size, len, ",", 0);
742 CONFIG_CHUNK(str, size, len, dev->cow.file, 1); 761 CONFIG_CHUNK(str, size, len, ubd_dev->cow.file, 1);
743 } 762 }
744 else CONFIG_CHUNK(str, size, len, "", 1); 763 else CONFIG_CHUNK(str, size, len, "", 1);
745 764
746 out: 765 out:
747 spin_unlock(&ubd_lock); 766 mutex_unlock(&ubd_lock);
748 return(len); 767 return(len);
749} 768}
750 769
@@ -760,22 +779,22 @@ static int ubd_id(char **str, int *start_out, int *end_out)
760 779
761static int ubd_remove(int n) 780static int ubd_remove(int n)
762{ 781{
763 struct ubd *dev; 782 struct ubd *ubd_dev;
764 int err = -ENODEV; 783 int err = -ENODEV;
765 784
766 spin_lock(&ubd_lock); 785 mutex_lock(&ubd_lock);
767 786
768 if(ubd_gendisk[n] == NULL) 787 if(ubd_gendisk[n] == NULL)
769 goto out; 788 goto out;
770 789
771 dev = &ubd_dev[n]; 790 ubd_dev = &ubd_devs[n];
772 791
773 if(dev->file == NULL) 792 if(ubd_dev->file == NULL)
774 goto out; 793 goto out;
775 794
776 /* you cannot remove a open disk */ 795 /* you cannot remove a open disk */
777 err = -EBUSY; 796 err = -EBUSY;
778 if(dev->count > 0) 797 if(ubd_dev->count > 0)
779 goto out; 798 goto out;
780 799
781 del_gendisk(ubd_gendisk[n]); 800 del_gendisk(ubd_gendisk[n]);
@@ -788,14 +807,15 @@ static int ubd_remove(int n)
788 fake_gendisk[n] = NULL; 807 fake_gendisk[n] = NULL;
789 } 808 }
790 809
791 platform_device_unregister(&dev->pdev); 810 platform_device_unregister(&ubd_dev->pdev);
792 *dev = ((struct ubd) DEFAULT_UBD); 811 *ubd_dev = ((struct ubd) DEFAULT_UBD);
793 err = 0; 812 err = 0;
794out: 813out:
795 spin_unlock(&ubd_lock); 814 mutex_unlock(&ubd_lock);
796 return err; 815 return err;
797} 816}
798 817
818/* All these are called by mconsole in process context and without ubd-specific locks. */
799static struct mc_device ubd_mc = { 819static struct mc_device ubd_mc = {
800 .name = "ubd", 820 .name = "ubd",
801 .config = ubd_config, 821 .config = ubd_config,
@@ -804,7 +824,7 @@ static struct mc_device ubd_mc = {
804 .remove = ubd_remove, 824 .remove = ubd_remove,
805}; 825};
806 826
807static int ubd_mc_init(void) 827static int __init ubd_mc_init(void)
808{ 828{
809 mconsole_register_dev(&ubd_mc); 829 mconsole_register_dev(&ubd_mc);
810 return 0; 830 return 0;
@@ -812,13 +832,24 @@ static int ubd_mc_init(void)
812 832
813__initcall(ubd_mc_init); 833__initcall(ubd_mc_init);
814 834
835static int __init ubd0_init(void)
836{
837 struct ubd *ubd_dev = &ubd_devs[0];
838
839 if(ubd_dev->file == NULL)
840 ubd_dev->file = "root_fs";
841 return(0);
842}
843
844__initcall(ubd0_init);
845
815static struct platform_driver ubd_driver = { 846static struct platform_driver ubd_driver = {
816 .driver = { 847 .driver = {
817 .name = DRIVER_NAME, 848 .name = DRIVER_NAME,
818 }, 849 },
819}; 850};
820 851
821int ubd_init(void) 852static int __init ubd_init(void)
822{ 853{
823 int i; 854 int i;
824 855
@@ -846,7 +877,7 @@ int ubd_init(void)
846 877
847late_initcall(ubd_init); 878late_initcall(ubd_init);
848 879
849int ubd_driver_init(void){ 880static int __init ubd_driver_init(void){
850 unsigned long stack; 881 unsigned long stack;
851 int err; 882 int err;
852 883
@@ -867,7 +898,7 @@ int ubd_driver_init(void){
867 return(0); 898 return(0);
868 } 899 }
869 err = um_request_irq(UBD_IRQ, thread_fd, IRQ_READ, ubd_intr, 900 err = um_request_irq(UBD_IRQ, thread_fd, IRQ_READ, ubd_intr,
870 IRQF_DISABLED, "ubd", ubd_dev); 901 IRQF_DISABLED, "ubd", ubd_devs);
871 if(err != 0) 902 if(err != 0)
872 printk(KERN_ERR "um_request_irq failed - errno = %d\n", -err); 903 printk(KERN_ERR "um_request_irq failed - errno = %d\n", -err);
873 return 0; 904 return 0;
@@ -878,24 +909,24 @@ device_initcall(ubd_driver_init);
878static int ubd_open(struct inode *inode, struct file *filp) 909static int ubd_open(struct inode *inode, struct file *filp)
879{ 910{
880 struct gendisk *disk = inode->i_bdev->bd_disk; 911 struct gendisk *disk = inode->i_bdev->bd_disk;
881 struct ubd *dev = disk->private_data; 912 struct ubd *ubd_dev = disk->private_data;
882 int err = 0; 913 int err = 0;
883 914
884 if(dev->count == 0){ 915 if(ubd_dev->count == 0){
885 err = ubd_open_dev(dev); 916 err = ubd_open_dev(ubd_dev);
886 if(err){ 917 if(err){
887 printk(KERN_ERR "%s: Can't open \"%s\": errno = %d\n", 918 printk(KERN_ERR "%s: Can't open \"%s\": errno = %d\n",
888 disk->disk_name, dev->file, -err); 919 disk->disk_name, ubd_dev->file, -err);
889 goto out; 920 goto out;
890 } 921 }
891 } 922 }
892 dev->count++; 923 ubd_dev->count++;
893 set_disk_ro(disk, !dev->openflags.w); 924 set_disk_ro(disk, !ubd_dev->openflags.w);
894 925
895 /* This should no more be needed. And it didn't work anyway to exclude 926 /* This should no more be needed. And it didn't work anyway to exclude
896 * read-write remounting of filesystems.*/ 927 * read-write remounting of filesystems.*/
897 /*if((filp->f_mode & FMODE_WRITE) && !dev->openflags.w){ 928 /*if((filp->f_mode & FMODE_WRITE) && !ubd_dev->openflags.w){
898 if(--dev->count == 0) ubd_close(dev); 929 if(--ubd_dev->count == 0) ubd_close_dev(ubd_dev);
899 err = -EROFS; 930 err = -EROFS;
900 }*/ 931 }*/
901 out: 932 out:
@@ -905,10 +936,10 @@ static int ubd_open(struct inode *inode, struct file *filp)
905static int ubd_release(struct inode * inode, struct file * file) 936static int ubd_release(struct inode * inode, struct file * file)
906{ 937{
907 struct gendisk *disk = inode->i_bdev->bd_disk; 938 struct gendisk *disk = inode->i_bdev->bd_disk;
908 struct ubd *dev = disk->private_data; 939 struct ubd *ubd_dev = disk->private_data;
909 940
910 if(--dev->count == 0) 941 if(--ubd_dev->count == 0)
911 ubd_close(dev); 942 ubd_close_dev(ubd_dev);
912 return(0); 943 return(0);
913} 944}
914 945
@@ -976,12 +1007,12 @@ static void cowify_req(struct io_thread_req *req, unsigned long *bitmap,
976static int prepare_request(struct request *req, struct io_thread_req *io_req) 1007static int prepare_request(struct request *req, struct io_thread_req *io_req)
977{ 1008{
978 struct gendisk *disk = req->rq_disk; 1009 struct gendisk *disk = req->rq_disk;
979 struct ubd *dev = disk->private_data; 1010 struct ubd *ubd_dev = disk->private_data;
980 __u64 offset; 1011 __u64 offset;
981 int len; 1012 int len;
982 1013
983 /* This should be impossible now */ 1014 /* This should be impossible now */
984 if((rq_data_dir(req) == WRITE) && !dev->openflags.w){ 1015 if((rq_data_dir(req) == WRITE) && !ubd_dev->openflags.w){
985 printk("Write attempted on readonly ubd device %s\n", 1016 printk("Write attempted on readonly ubd device %s\n",
986 disk->disk_name); 1017 disk->disk_name);
987 end_request(req, 0); 1018 end_request(req, 0);
@@ -991,8 +1022,8 @@ static int prepare_request(struct request *req, struct io_thread_req *io_req)
991 offset = ((__u64) req->sector) << 9; 1022 offset = ((__u64) req->sector) << 9;
992 len = req->current_nr_sectors << 9; 1023 len = req->current_nr_sectors << 9;
993 1024
994 io_req->fds[0] = (dev->cow.file != NULL) ? dev->cow.fd : dev->fd; 1025 io_req->fds[0] = (ubd_dev->cow.file != NULL) ? ubd_dev->cow.fd : ubd_dev->fd;
995 io_req->fds[1] = dev->fd; 1026 io_req->fds[1] = ubd_dev->fd;
996 io_req->cow_offset = -1; 1027 io_req->cow_offset = -1;
997 io_req->offset = offset; 1028 io_req->offset = offset;
998 io_req->length = len; 1029 io_req->length = len;
@@ -1001,13 +1032,13 @@ static int prepare_request(struct request *req, struct io_thread_req *io_req)
1001 1032
1002 io_req->op = (rq_data_dir(req) == READ) ? UBD_READ : UBD_WRITE; 1033 io_req->op = (rq_data_dir(req) == READ) ? UBD_READ : UBD_WRITE;
1003 io_req->offsets[0] = 0; 1034 io_req->offsets[0] = 0;
1004 io_req->offsets[1] = dev->cow.data_offset; 1035 io_req->offsets[1] = ubd_dev->cow.data_offset;
1005 io_req->buffer = req->buffer; 1036 io_req->buffer = req->buffer;
1006 io_req->sectorsize = 1 << 9; 1037 io_req->sectorsize = 1 << 9;
1007 1038
1008 if(dev->cow.file != NULL) 1039 if(ubd_dev->cow.file != NULL)
1009 cowify_req(io_req, dev->cow.bitmap, dev->cow.bitmap_offset, 1040 cowify_req(io_req, ubd_dev->cow.bitmap, ubd_dev->cow.bitmap_offset,
1010 dev->cow.bitmap_len); 1041 ubd_dev->cow.bitmap_len);
1011 1042
1012 return(0); 1043 return(0);
1013} 1044}
@@ -1033,7 +1064,7 @@ static void do_ubd_request(request_queue_t *q)
1033 return; 1064 return;
1034 err = prepare_request(req, &io_req); 1065 err = prepare_request(req, &io_req);
1035 if(!err){ 1066 if(!err){
1036 do_ubd = ubd_handler; 1067 do_ubd = 1;
1037 n = os_write_file(thread_fd, (char *) &io_req, 1068 n = os_write_file(thread_fd, (char *) &io_req,
1038 sizeof(io_req)); 1069 sizeof(io_req));
1039 if(n != sizeof(io_req)) 1070 if(n != sizeof(io_req))
@@ -1045,18 +1076,18 @@ static void do_ubd_request(request_queue_t *q)
1045 1076
1046static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo) 1077static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
1047{ 1078{
1048 struct ubd *dev = bdev->bd_disk->private_data; 1079 struct ubd *ubd_dev = bdev->bd_disk->private_data;
1049 1080
1050 geo->heads = 128; 1081 geo->heads = 128;
1051 geo->sectors = 32; 1082 geo->sectors = 32;
1052 geo->cylinders = dev->size / (128 * 32 * 512); 1083 geo->cylinders = ubd_dev->size / (128 * 32 * 512);
1053 return 0; 1084 return 0;
1054} 1085}
1055 1086
1056static int ubd_ioctl(struct inode * inode, struct file * file, 1087static int ubd_ioctl(struct inode * inode, struct file * file,
1057 unsigned int cmd, unsigned long arg) 1088 unsigned int cmd, unsigned long arg)
1058{ 1089{
1059 struct ubd *dev = inode->i_bdev->bd_disk->private_data; 1090 struct ubd *ubd_dev = inode->i_bdev->bd_disk->private_data;
1060 struct hd_driveid ubd_id = { 1091 struct hd_driveid ubd_id = {
1061 .cyls = 0, 1092 .cyls = 0,
1062 .heads = 128, 1093 .heads = 128,
@@ -1066,7 +1097,7 @@ static int ubd_ioctl(struct inode * inode, struct file * file,
1066 switch (cmd) { 1097 switch (cmd) {
1067 struct cdrom_volctrl volume; 1098 struct cdrom_volctrl volume;
1068 case HDIO_GET_IDENTITY: 1099 case HDIO_GET_IDENTITY:
1069 ubd_id.cyls = dev->size / (128 * 32 * 512); 1100 ubd_id.cyls = ubd_dev->size / (128 * 32 * 512);
1070 if(copy_to_user((char __user *) arg, (char *) &ubd_id, 1101 if(copy_to_user((char __user *) arg, (char *) &ubd_id,
1071 sizeof(ubd_id))) 1102 sizeof(ubd_id)))
1072 return(-EFAULT); 1103 return(-EFAULT);
@@ -1353,8 +1384,8 @@ void do_io(struct io_thread_req *req)
1353 */ 1384 */
1354int kernel_fd = -1; 1385int kernel_fd = -1;
1355 1386
1356/* Only changed by the io thread */ 1387/* Only changed by the io thread. XXX: currently unused. */
1357int io_count = 0; 1388static int io_count = 0;
1358 1389
1359int io_thread(void *arg) 1390int io_thread(void *arg)
1360{ 1391{
diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c
index 386f8b95298..850221d9b4c 100644
--- a/arch/um/drivers/xterm.c
+++ b/arch/um/drivers/xterm.c
@@ -136,8 +136,6 @@ int xterm_open(int input, int output, int primary, void *d,
136 return(pid); 136 return(pid);
137 } 137 }
138 138
139 if(data->stack == 0) free_stack(stack, 0);
140
141 if (data->direct_rcv) { 139 if (data->direct_rcv) {
142 new = os_rcv_fd(fd, &data->helper_pid); 140 new = os_rcv_fd(fd, &data->helper_pid);
143 } else { 141 } else {
diff --git a/arch/um/include/mconsole.h b/arch/um/include/mconsole.h
index 58f67d39110..2666815b6af 100644
--- a/arch/um/include/mconsole.h
+++ b/arch/um/include/mconsole.h
@@ -61,6 +61,7 @@ struct mc_request
61 61
62 struct mconsole_request request; 62 struct mconsole_request request;
63 struct mconsole_command *cmd; 63 struct mconsole_command *cmd;
64 union uml_pt_regs regs;
64}; 65};
65 66
66extern char mconsole_socket_name[]; 67extern char mconsole_socket_name[];
diff --git a/arch/um/include/mconsole_kern.h b/arch/um/include/mconsole_kern.h
index d0b690197fd..1ea6d928e1c 100644
--- a/arch/um/include/mconsole_kern.h
+++ b/arch/um/include/mconsole_kern.h
@@ -14,6 +14,7 @@ struct mconsole_entry {
14 struct mc_request request; 14 struct mc_request request;
15}; 15};
16 16
17/* All these methods are called in process context. */
17struct mc_device { 18struct mc_device {
18 struct list_head list; 19 struct list_head list;
19 char *name; 20 char *name;
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index 6516f6dca96..13a86bd383d 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -233,6 +233,8 @@ extern unsigned long __do_user_copy(void *to, const void *from, int n,
233 void (*op)(void *to, const void *from, 233 void (*op)(void *to, const void *from,
234 int n), int *faulted_out); 234 int n), int *faulted_out);
235 235
236/* execvp.c */
237extern int execvp_noalloc(char *buf, const char *file, char *const argv[]);
236/* helper.c */ 238/* helper.c */
237extern int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv, 239extern int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
238 unsigned long *stack_out); 240 unsigned long *stack_out);
diff --git a/arch/um/include/sysdep-i386/barrier.h b/arch/um/include/sysdep-i386/barrier.h
new file mode 100644
index 00000000000..b58d52c5b2f
--- /dev/null
+++ b/arch/um/include/sysdep-i386/barrier.h
@@ -0,0 +1,9 @@
1#ifndef __SYSDEP_I386_BARRIER_H
2#define __SYSDEP_I386_BARRIER_H
3
4/* Copied from include/asm-i386 for use by userspace. i386 has the option
5 * of using mfence, but I'm just using this, which works everywhere, for now.
6 */
7#define mb() asm volatile("lock; addl $0,0(%esp)")
8
9#endif
diff --git a/arch/um/include/sysdep-i386/checksum.h b/arch/um/include/sysdep-i386/checksum.h
index 052bb061a97..0cb4645cbeb 100644
--- a/arch/um/include/sysdep-i386/checksum.h
+++ b/arch/um/include/sysdep-i386/checksum.h
@@ -20,8 +20,7 @@
20 * 20 *
21 * it's best to have buff aligned on a 32-bit boundary 21 * it's best to have buff aligned on a 32-bit boundary
22 */ 22 */
23unsigned int csum_partial(const unsigned char * buff, int len, 23__wsum csum_partial(const void *buff, int len, __wsum sum);
24 unsigned int sum);
25 24
26/* 25/*
27 * Note: when you get a NULL pointer exception here this means someone 26 * Note: when you get a NULL pointer exception here this means someone
@@ -32,8 +31,8 @@ unsigned int csum_partial(const unsigned char * buff, int len,
32 */ 31 */
33 32
34static __inline__ 33static __inline__
35unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, 34__wsum csum_partial_copy_nocheck(const void *src, void *dst,
36 int len, int sum) 35 int len, __wsum sum)
37{ 36{
38 memcpy(dst, src, len); 37 memcpy(dst, src, len);
39 return csum_partial(dst, len, sum); 38 return csum_partial(dst, len, sum);
@@ -48,36 +47,25 @@ unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *
48 */ 47 */
49 48
50static __inline__ 49static __inline__
51unsigned int csum_partial_copy_from_user(const unsigned char __user *src, 50__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
52 unsigned char *dst, 51 int len, __wsum sum, int *err_ptr)
53 int len, int sum, int *err_ptr)
54{ 52{
55 if(copy_from_user(dst, src, len)){ 53 if (copy_from_user(dst, src, len)) {
56 *err_ptr = -EFAULT; 54 *err_ptr = -EFAULT;
57 return(-1); 55 return (__force __wsum)-1;
58 } 56 }
59 57
60 return csum_partial(dst, len, sum); 58 return csum_partial(dst, len, sum);
61} 59}
62 60
63/* 61/*
64 * These are the old (and unsafe) way of doing checksums, a warning message
65 * will be printed if they are used and an exception occurs.
66 *
67 * these functions should go away after some time.
68 */
69
70#define csum_partial_copy_fromuser csum_partial_copy_from_user
71
72/*
73 * This is a version of ip_compute_csum() optimized for IP headers, 62 * This is a version of ip_compute_csum() optimized for IP headers,
74 * which always checksum on 4 octet boundaries. 63 * which always checksum on 4 octet boundaries.
75 * 64 *
76 * By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by 65 * By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by
77 * Arnt Gulbrandsen. 66 * Arnt Gulbrandsen.
78 */ 67 */
79static inline unsigned short ip_fast_csum(unsigned char * iph, 68static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
80 unsigned int ihl)
81{ 69{
82 unsigned int sum; 70 unsigned int sum;
83 71
@@ -105,29 +93,29 @@ static inline unsigned short ip_fast_csum(unsigned char * iph,
105 : "=r" (sum), "=r" (iph), "=r" (ihl) 93 : "=r" (sum), "=r" (iph), "=r" (ihl)
106 : "1" (iph), "2" (ihl) 94 : "1" (iph), "2" (ihl)
107 : "memory"); 95 : "memory");
108 return sum; 96 return (__force __sum16)sum;
109} 97}
110 98
111/* 99/*
112 * Fold a partial checksum 100 * Fold a partial checksum
113 */ 101 */
114 102
115static inline unsigned int csum_fold(unsigned int sum) 103static inline __sum16 csum_fold(__wsum sum)
116{ 104{
117 __asm__( 105 __asm__(
118 "addl %1, %0 ;\n" 106 "addl %1, %0 ;\n"
119 "adcl $0xffff, %0 ;\n" 107 "adcl $0xffff, %0 ;\n"
120 : "=r" (sum) 108 : "=r" (sum)
121 : "r" (sum << 16), "0" (sum & 0xffff0000) 109 : "r" ((__force u32)sum << 16),
110 "0" ((__force u32)sum & 0xffff0000)
122 ); 111 );
123 return (~sum) >> 16; 112 return (__force __sum16)(~(__force u32)sum >> 16);
124} 113}
125 114
126static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, 115static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
127 unsigned long daddr,
128 unsigned short len, 116 unsigned short len,
129 unsigned short proto, 117 unsigned short proto,
130 unsigned int sum) 118 __wsum sum)
131{ 119{
132 __asm__( 120 __asm__(
133 "addl %1, %0 ;\n" 121 "addl %1, %0 ;\n"
@@ -135,7 +123,7 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
135 "adcl %3, %0 ;\n" 123 "adcl %3, %0 ;\n"
136 "adcl $0, %0 ;\n" 124 "adcl $0, %0 ;\n"
137 : "=r" (sum) 125 : "=r" (sum)
138 : "g" (daddr), "g"(saddr), "g"((ntohs(len)<<16)+proto*256), "0"(sum)); 126 : "g" (daddr), "g"(saddr), "g"((len + proto) << 8), "0"(sum));
139 return sum; 127 return sum;
140} 128}
141 129
@@ -143,11 +131,10 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
143 * computes the checksum of the TCP/UDP pseudo-header 131 * computes the checksum of the TCP/UDP pseudo-header
144 * returns a 16-bit checksum, already complemented 132 * returns a 16-bit checksum, already complemented
145 */ 133 */
146static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, 134static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
147 unsigned long daddr,
148 unsigned short len, 135 unsigned short len,
149 unsigned short proto, 136 unsigned short proto,
150 unsigned int sum) 137 __wsum sum)
151{ 138{
152 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); 139 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
153} 140}
@@ -157,17 +144,16 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
157 * in icmp.c 144 * in icmp.c
158 */ 145 */
159 146
160static inline unsigned short ip_compute_csum(unsigned char * buff, int len) 147static inline __sum16 ip_compute_csum(const void *buff, int len)
161{ 148{
162 return csum_fold (csum_partial(buff, len, 0)); 149 return csum_fold (csum_partial(buff, len, 0));
163} 150}
164 151
165#define _HAVE_ARCH_IPV6_CSUM 152#define _HAVE_ARCH_IPV6_CSUM
166static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, 153static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
167 struct in6_addr *daddr, 154 const struct in6_addr *daddr,
168 __u32 len, 155 __u32 len, unsigned short proto,
169 unsigned short proto, 156 __wsum sum)
170 unsigned int sum)
171{ 157{
172 __asm__( 158 __asm__(
173 "addl 0(%1), %0 ;\n" 159 "addl 0(%1), %0 ;\n"
@@ -192,14 +178,14 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
192 * Copy and checksum to user 178 * Copy and checksum to user
193 */ 179 */
194#define HAVE_CSUM_COPY_USER 180#define HAVE_CSUM_COPY_USER
195static __inline__ unsigned int csum_and_copy_to_user(const unsigned char *src, 181static __inline__ __wsum csum_and_copy_to_user(const void *src,
196 unsigned char __user *dst, 182 void __user *dst,
197 int len, int sum, int *err_ptr) 183 int len, __wsum sum, int *err_ptr)
198{ 184{
199 if (access_ok(VERIFY_WRITE, dst, len)){ 185 if (access_ok(VERIFY_WRITE, dst, len)) {
200 if(copy_to_user(dst, src, len)){ 186 if (copy_to_user(dst, src, len)) {
201 *err_ptr = -EFAULT; 187 *err_ptr = -EFAULT;
202 return(-1); 188 return (__force __wsum)-1;
203 } 189 }
204 190
205 return csum_partial(src, len, sum); 191 return csum_partial(src, len, sum);
@@ -208,7 +194,7 @@ static __inline__ unsigned int csum_and_copy_to_user(const unsigned char *src,
208 if (len) 194 if (len)
209 *err_ptr = -EFAULT; 195 *err_ptr = -EFAULT;
210 196
211 return -1; /* invalid checksum */ 197 return (__force __wsum)-1; /* invalid checksum */
212} 198}
213 199
214#endif 200#endif
diff --git a/arch/um/include/sysdep-x86_64/barrier.h b/arch/um/include/sysdep-x86_64/barrier.h
new file mode 100644
index 00000000000..7b610befdc8
--- /dev/null
+++ b/arch/um/include/sysdep-x86_64/barrier.h
@@ -0,0 +1,7 @@
1#ifndef __SYSDEP_X86_64_BARRIER_H
2#define __SYSDEP_X86_64_BARRIER_H
3
4/* Copied from include/asm-x86_64 for use by userspace. */
5#define mb() asm volatile("mfence":::"memory")
6
7#endif
diff --git a/arch/um/include/sysdep-x86_64/checksum.h b/arch/um/include/sysdep-x86_64/checksum.h
index ea97005af69..a5be9031ea8 100644
--- a/arch/um/include/sysdep-x86_64/checksum.h
+++ b/arch/um/include/sysdep-x86_64/checksum.h
@@ -9,8 +9,7 @@
9#include "linux/in6.h" 9#include "linux/in6.h"
10#include "asm/uaccess.h" 10#include "asm/uaccess.h"
11 11
12extern unsigned csum_partial(const unsigned char *buff, unsigned len, 12extern __wsum csum_partial(const void *buff, int len, __wsum sum);
13 unsigned sum);
14 13
15/* 14/*
16 * Note: when you get a NULL pointer exception here this means someone 15 * Note: when you get a NULL pointer exception here this means someone
@@ -21,21 +20,21 @@ extern unsigned csum_partial(const unsigned char *buff, unsigned len,
21 */ 20 */
22 21
23static __inline__ 22static __inline__
24unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, 23__wsum csum_partial_copy_nocheck(const void *src, void *dst,
25 int len, int sum) 24 int len, __wsum sum)
26{ 25{
27 memcpy(dst, src, len); 26 memcpy(dst, src, len);
28 return(csum_partial(dst, len, sum)); 27 return(csum_partial(dst, len, sum));
29} 28}
30 29
31static __inline__ 30static __inline__
32unsigned int csum_partial_copy_from_user(const unsigned char *src, 31__wsum csum_partial_copy_from_user(const void __user *src,
33 unsigned char *dst, int len, int sum, 32 void *dst, int len, __wsum sum,
34 int *err_ptr) 33 int *err_ptr)
35{ 34{
36 if(copy_from_user(dst, src, len)){ 35 if (copy_from_user(dst, src, len)) {
37 *err_ptr = -EFAULT; 36 *err_ptr = -EFAULT;
38 return(-1); 37 return (__force __wsum)-1;
39 } 38 }
40 return csum_partial(dst, len, sum); 39 return csum_partial(dst, len, sum);
41} 40}
@@ -48,15 +47,16 @@ unsigned int csum_partial_copy_from_user(const unsigned char *src,
48 * the last step before putting a checksum into a packet. 47 * the last step before putting a checksum into a packet.
49 * Make sure not to mix with 64bit checksums. 48 * Make sure not to mix with 64bit checksums.
50 */ 49 */
51static inline unsigned int csum_fold(unsigned int sum) 50static inline __sum16 csum_fold(__wsum sum)
52{ 51{
53 __asm__( 52 __asm__(
54 " addl %1,%0\n" 53 " addl %1,%0\n"
55 " adcl $0xffff,%0" 54 " adcl $0xffff,%0"
56 : "=r" (sum) 55 : "=r" (sum)
57 : "r" (sum << 16), "0" (sum & 0xffff0000) 56 : "r" ((__force u32)sum << 16),
57 "0" ((__force u32)sum & 0xffff0000)
58 ); 58 );
59 return (~sum) >> 16; 59 return (__force __sum16)(~(__force u32)sum >> 16);
60} 60}
61 61
62/** 62/**
@@ -70,28 +70,27 @@ static inline unsigned int csum_fold(unsigned int sum)
70 * Returns the pseudo header checksum the input data. Result is 70 * Returns the pseudo header checksum the input data. Result is
71 * 32bit unfolded. 71 * 32bit unfolded.
72 */ 72 */
73static inline unsigned long 73static inline __wsum
74csum_tcpudp_nofold(unsigned saddr, unsigned daddr, unsigned short len, 74csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
75 unsigned short proto, unsigned int sum) 75 unsigned short proto, __wsum sum)
76{ 76{
77 asm(" addl %1, %0\n" 77 asm(" addl %1, %0\n"
78 " adcl %2, %0\n" 78 " adcl %2, %0\n"
79 " adcl %3, %0\n" 79 " adcl %3, %0\n"
80 " adcl $0, %0\n" 80 " adcl $0, %0\n"
81 : "=r" (sum) 81 : "=r" (sum)
82 : "g" (daddr), "g" (saddr), "g" ((ntohs(len)<<16)+proto*256), "0" (sum)); 82 : "g" (daddr), "g" (saddr), "g" ((len + proto) << 8), "0" (sum));
83 return sum; 83 return sum;
84} 84}
85 85
86/* 86/*
87 * computes the checksum of the TCP/UDP pseudo-header 87 * computes the checksum of the TCP/UDP pseudo-header
88 * returns a 16-bit checksum, already complemented 88 * returns a 16-bit checksum, already complemented
89 */ 89 */
90static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, 90static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
91 unsigned long daddr, 91 unsigned short len,
92 unsigned short len, 92 unsigned short proto,
93 unsigned short proto, 93 __wsum sum)
94 unsigned int sum)
95{ 94{
96 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); 95 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
97} 96}
@@ -101,7 +100,7 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
101 * iph: ipv4 header 100 * iph: ipv4 header
102 * ihl: length of header / 4 101 * ihl: length of header / 4
103 */ 102 */
104static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) 103static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
105{ 104{
106 unsigned int sum; 105 unsigned int sum;
107 106
@@ -128,7 +127,7 @@ static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl)
128 : "=r" (sum), "=r" (iph), "=r" (ihl) 127 : "=r" (sum), "=r" (iph), "=r" (ihl)
129 : "1" (iph), "2" (ihl) 128 : "1" (iph), "2" (ihl)
130 : "memory"); 129 : "memory");
131 return(sum); 130 return (__force __sum16)sum;
132} 131}
133 132
134static inline unsigned add32_with_carry(unsigned a, unsigned b) 133static inline unsigned add32_with_carry(unsigned a, unsigned b)
@@ -140,6 +139,6 @@ static inline unsigned add32_with_carry(unsigned a, unsigned b)
140 return a; 139 return a;
141} 140}
142 141
143extern unsigned short ip_compute_csum(unsigned char * buff, int len); 142extern __sum16 ip_compute_csum(const void *buff, int len);
144 143
145#endif 144#endif
diff --git a/arch/um/include/um_malloc.h b/arch/um/include/um_malloc.h
new file mode 100644
index 00000000000..0363a9b53f8
--- /dev/null
+++ b/arch/um/include/um_malloc.h
@@ -0,0 +1,17 @@
1/*
2 * Copyright (C) 2005 Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
3 * Licensed under the GPL
4 */
5
6#ifndef __UM_MALLOC_H__
7#define __UM_MALLOC_H__
8
9extern void *um_kmalloc(int size);
10extern void *um_kmalloc_atomic(int size);
11extern void kfree(const void *ptr);
12
13extern void *um_vmalloc(int size);
14extern void *um_vmalloc_atomic(int size);
15extern void vfree(void *ptr);
16
17#endif /* __UM_MALLOC_H__ */
diff --git a/arch/um/include/user.h b/arch/um/include/user.h
index 39f8c880107..acadce3f271 100644
--- a/arch/um/include/user.h
+++ b/arch/um/include/user.h
@@ -11,17 +11,11 @@ extern void panic(const char *fmt, ...)
11extern int printk(const char *fmt, ...) 11extern int printk(const char *fmt, ...)
12 __attribute__ ((format (printf, 1, 2))); 12 __attribute__ ((format (printf, 1, 2)));
13extern void schedule(void); 13extern void schedule(void);
14extern void *um_kmalloc(int size);
15extern void *um_kmalloc_atomic(int size);
16extern void kfree(void *ptr);
17extern int in_aton(char *str); 14extern int in_aton(char *str);
18extern int open_gdb_chan(void); 15extern int open_gdb_chan(void);
19/* These use size_t, however unsigned long is correct on both i386 and x86_64. */ 16/* These use size_t, however unsigned long is correct on both i386 and x86_64. */
20extern unsigned long strlcpy(char *, const char *, unsigned long); 17extern unsigned long strlcpy(char *, const char *, unsigned long);
21extern unsigned long strlcat(char *, const char *, unsigned long); 18extern unsigned long strlcat(char *, const char *, unsigned long);
22extern void *um_vmalloc(int size);
23extern void *um_vmalloc_atomic(int size);
24extern void vfree(void *ptr);
25 19
26#endif 20#endif
27 21
diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h
index 802d7842514..06625fefef3 100644
--- a/arch/um/include/user_util.h
+++ b/arch/um/include/user_util.h
@@ -52,7 +52,6 @@ extern int linux_main(int argc, char **argv);
52extern void set_cmdline(char *cmd); 52extern void set_cmdline(char *cmd);
53extern void input_cb(void (*proc)(void *), void *arg, int arg_len); 53extern void input_cb(void (*proc)(void *), void *arg, int arg_len);
54extern int get_pty(void); 54extern int get_pty(void);
55extern void *um_kmalloc(int size);
56extern int switcheroo(int fd, int prot, void *from, void *to, int size); 55extern int switcheroo(int fd, int prot, void *from, void *to, int size);
57extern void do_exec(int old_pid, int new_pid); 56extern void do_exec(int old_pid, int new_pid);
58extern void tracer_panic(char *msg, ...) 57extern void tracer_panic(char *msg, ...)
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index 68ed24df5c8..e36f92b463c 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -14,6 +14,7 @@ SECTIONS
14 * is remapped.*/ 14 * is remapped.*/
15 __binary_start = .; 15 __binary_start = .;
16 . = ALIGN(4096); /* Init code and data */ 16 . = ALIGN(4096); /* Init code and data */
17 _text = .;
17 _stext = .; 18 _stext = .;
18 __init_begin = .; 19 __init_begin = .;
19 .init.text : { 20 .init.text : {
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index ef259569fd8..5c1e611f628 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -31,6 +31,7 @@
31#include "irq_kern.h" 31#include "irq_kern.h"
32#include "os.h" 32#include "os.h"
33#include "sigio.h" 33#include "sigio.h"
34#include "um_malloc.h"
34#include "misc_constants.h" 35#include "misc_constants.h"
35 36
36/* 37/*
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index fe6c64abda5..348b272bb76 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -46,6 +46,7 @@
46#include "mode.h" 46#include "mode.h"
47#include "mode_kern.h" 47#include "mode_kern.h"
48#include "choose-mode.h" 48#include "choose-mode.h"
49#include "um_malloc.h"
49 50
50/* This is a per-cpu array. A processor only modifies its entry and it only 51/* This is a per-cpu array. A processor only modifies its entry and it only
51 * cares about its entry, so it's OK if another processor is modifying its 52 * cares about its entry, so it's OK if another processor is modifying its
diff --git a/arch/um/kernel/tt/tracer.c b/arch/um/kernel/tt/tracer.c
index 9882342206e..b9195355075 100644
--- a/arch/um/kernel/tt/tracer.c
+++ b/arch/um/kernel/tt/tracer.c
@@ -176,7 +176,6 @@ struct {
176int signal_index[32]; 176int signal_index[32];
177int nsignals = 0; 177int nsignals = 0;
178int debug_trace = 0; 178int debug_trace = 0;
179extern int io_nsignals, io_count, intr_count;
180 179
181extern void signal_usr1(int sig); 180extern void signal_usr1(int sig);
182 181
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index 8eca47a6ff0..f6301274cf3 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -25,6 +25,7 @@ SECTIONS
25 . = ALIGN(4096); /* Init code and data */ 25 . = ALIGN(4096); /* Init code and data */
26#endif 26#endif
27 27
28 _text = .;
28 _stext = .; 29 _stext = .;
29 __init_begin = .; 30 __init_begin = .;
30 .init.text : { 31 .init.text : {
diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile
index b4183929b32..2f8c7946401 100644
--- a/arch/um/os-Linux/Makefile
+++ b/arch/um/os-Linux/Makefile
@@ -3,8 +3,8 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6obj-y = aio.o elf_aux.o file.o helper.o irq.o main.o mem.o process.o sigio.o \ 6obj-y = aio.o elf_aux.o execvp.o file.o helper.o irq.o main.o mem.o process.o \
7 signal.o start_up.o time.o trap.o tty.o uaccess.o umid.o tls.o \ 7 sigio.o signal.o start_up.o time.o trap.o tty.o uaccess.o umid.o tls.o \
8 user_syms.o util.o drivers/ sys-$(SUBARCH)/ 8 user_syms.o util.o drivers/ sys-$(SUBARCH)/
9 9
10obj-$(CONFIG_MODE_SKAS) += skas/ 10obj-$(CONFIG_MODE_SKAS) += skas/
@@ -15,9 +15,9 @@ user-objs-$(CONFIG_MODE_TT) += tt.o
15obj-$(CONFIG_TTY_LOG) += tty_log.o 15obj-$(CONFIG_TTY_LOG) += tty_log.o
16user-objs-$(CONFIG_TTY_LOG) += tty_log.o 16user-objs-$(CONFIG_TTY_LOG) += tty_log.o
17 17
18USER_OBJS := $(user-objs-y) aio.o elf_aux.o file.o helper.o irq.o main.o mem.o \ 18USER_OBJS := $(user-objs-y) aio.o elf_aux.o execvp.o file.o helper.o irq.o \
19 process.o sigio.o signal.o start_up.o time.o trap.o tty.o tls.o \ 19 main.o mem.o process.o sigio.o signal.o start_up.o time.o trap.o tty.o \
20 uaccess.o umid.o util.o 20 tls.o uaccess.o umid.o util.o
21 21
22CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH) 22CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
23 23
diff --git a/arch/um/os-Linux/drivers/ethertap_user.c b/arch/um/os-Linux/drivers/ethertap_user.c
index f559bdf746e..863981ba146 100644
--- a/arch/um/os-Linux/drivers/ethertap_user.c
+++ b/arch/um/os-Linux/drivers/ethertap_user.c
@@ -20,6 +20,7 @@
20#include "net_user.h" 20#include "net_user.h"
21#include "etap.h" 21#include "etap.h"
22#include "os.h" 22#include "os.h"
23#include "um_malloc.h"
23 24
24#define MAX_PACKET ETH_MAX_PACKET 25#define MAX_PACKET ETH_MAX_PACKET
25 26
diff --git a/arch/um/os-Linux/execvp.c b/arch/um/os-Linux/execvp.c
new file mode 100644
index 00000000000..66e583a4031
--- /dev/null
+++ b/arch/um/os-Linux/execvp.c
@@ -0,0 +1,149 @@
1/* Copyright (C) 2006 by Paolo Giarrusso - modified from glibc' execvp.c.
2 Original copyright notice follows:
3
4 Copyright (C) 1991,92,1995-99,2002,2004 Free Software Foundation, Inc.
5 This file is part of the GNU C Library.
6
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with the GNU C Library; if not, write to the Free
19 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 02111-1307 USA. */
21#include <unistd.h>
22
23#include <stdbool.h>
24#include <stdlib.h>
25#include <string.h>
26#include <errno.h>
27#include <limits.h>
28
29#ifndef TEST
30#include "um_malloc.h"
31#else
32#include <stdio.h>
33#define um_kmalloc malloc
34#endif
35#include "os.h"
36
37/* Execute FILE, searching in the `PATH' environment variable if it contains
38 no slashes, with arguments ARGV and environment from `environ'. */
39int execvp_noalloc(char *buf, const char *file, char *const argv[])
40{
41 if (*file == '\0') {
42 return -ENOENT;
43 }
44
45 if (strchr (file, '/') != NULL) {
46 /* Don't search when it contains a slash. */
47 execv(file, argv);
48 } else {
49 int got_eacces;
50 size_t len, pathlen;
51 char *name, *p;
52 char *path = getenv("PATH");
53 if (path == NULL)
54 path = ":/bin:/usr/bin";
55
56 len = strlen(file) + 1;
57 pathlen = strlen(path);
58 /* Copy the file name at the top. */
59 name = memcpy(buf + pathlen + 1, file, len);
60 /* And add the slash. */
61 *--name = '/';
62
63 got_eacces = 0;
64 p = path;
65 do {
66 char *startp;
67
68 path = p;
69 //Let's avoid this GNU extension.
70 //p = strchrnul (path, ':');
71 p = strchr(path, ':');
72 if (!p)
73 p = strchr(path, '\0');
74
75 if (p == path)
76 /* Two adjacent colons, or a colon at the beginning or the end
77 of `PATH' means to search the current directory. */
78 startp = name + 1;
79 else
80 startp = memcpy(name - (p - path), path, p - path);
81
82 /* Try to execute this name. If it works, execv will not return. */
83 execv(startp, argv);
84
85 /*
86 if (errno == ENOEXEC) {
87 }
88 */
89
90 switch (errno) {
91 case EACCES:
92 /* Record the we got a `Permission denied' error. If we end
93 up finding no executable we can use, we want to diagnose
94 that we did find one but were denied access. */
95 got_eacces = 1;
96 case ENOENT:
97 case ESTALE:
98 case ENOTDIR:
99 /* Those errors indicate the file is missing or not executable
100 by us, in which case we want to just try the next path
101 directory. */
102 case ENODEV:
103 case ETIMEDOUT:
104 /* Some strange filesystems like AFS return even
105 stranger error numbers. They cannot reasonably mean
106 anything else so ignore those, too. */
107 case ENOEXEC:
108 /* We won't go searching for the shell
109 * if it is not executable - the Linux
110 * kernel already handles this enough,
111 * for us. */
112 break;
113
114 default:
115 /* Some other error means we found an executable file, but
116 something went wrong executing it; return the error to our
117 caller. */
118 return -errno;
119 }
120 } while (*p++ != '\0');
121
122 /* We tried every element and none of them worked. */
123 if (got_eacces)
124 /* At least one failure was due to permissions, so report that
125 error. */
126 return -EACCES;
127 }
128
129 /* Return the error from the last attempt (probably ENOENT). */
130 return -errno;
131}
132#ifdef TEST
133int main(int argc, char**argv)
134{
135 char buf[PATH_MAX];
136 int ret;
137 argc--;
138 if (!argc) {
139 fprintf(stderr, "Not enough arguments\n");
140 return 1;
141 }
142 argv++;
143 if (ret = execvp_noalloc(buf, argv[0], argv)) {
144 errno = -ret;
145 perror("execvp_noalloc");
146 }
147 return 0;
148}
149#endif
diff --git a/arch/um/os-Linux/helper.c b/arch/um/os-Linux/helper.c
index cd15b9df5b5..c7ad6306e22 100644
--- a/arch/um/os-Linux/helper.c
+++ b/arch/um/os-Linux/helper.c
@@ -8,18 +8,21 @@
8#include <unistd.h> 8#include <unistd.h>
9#include <errno.h> 9#include <errno.h>
10#include <sched.h> 10#include <sched.h>
11#include <limits.h>
11#include <sys/signal.h> 12#include <sys/signal.h>
12#include <sys/wait.h> 13#include <sys/wait.h>
13#include "user.h" 14#include "user.h"
14#include "kern_util.h" 15#include "kern_util.h"
15#include "user_util.h" 16#include "user_util.h"
16#include "os.h" 17#include "os.h"
18#include "um_malloc.h"
17 19
18struct helper_data { 20struct helper_data {
19 void (*pre_exec)(void*); 21 void (*pre_exec)(void*);
20 void *pre_data; 22 void *pre_data;
21 char **argv; 23 char **argv;
22 int fd; 24 int fd;
25 char *buf;
23}; 26};
24 27
25/* Debugging aid, changed only from gdb */ 28/* Debugging aid, changed only from gdb */
@@ -35,22 +38,22 @@ static int helper_child(void *arg)
35 char **argv = data->argv; 38 char **argv = data->argv;
36 int errval; 39 int errval;
37 40
38 if(helper_pause){ 41 if (helper_pause){
39 signal(SIGHUP, helper_hup); 42 signal(SIGHUP, helper_hup);
40 pause(); 43 pause();
41 } 44 }
42 if(data->pre_exec != NULL) 45 if (data->pre_exec != NULL)
43 (*data->pre_exec)(data->pre_data); 46 (*data->pre_exec)(data->pre_data);
44 execvp(argv[0], argv); 47 errval = execvp_noalloc(data->buf, argv[0], argv);
45 errval = -errno; 48 printk("helper_child - execvp of '%s' failed - errno = %d\n", argv[0], -errval);
46 printk("helper_child - execve of '%s' failed - errno = %d\n", argv[0], errno);
47 os_write_file(data->fd, &errval, sizeof(errval)); 49 os_write_file(data->fd, &errval, sizeof(errval));
48 kill(os_getpid(), SIGKILL); 50 kill(os_getpid(), SIGKILL);
49 return(0); 51 return 0;
50} 52}
51 53
52/* Returns either the pid of the child process we run or -E* on failure. 54/* Returns either the pid of the child process we run or -E* on failure.
53 * XXX The alloc_stack here breaks if this is called in the tracing thread */ 55 * XXX The alloc_stack here breaks if this is called in the tracing thread, so
56 * we need to receive a preallocated stack (a local buffer is ok). */
54int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv, 57int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
55 unsigned long *stack_out) 58 unsigned long *stack_out)
56{ 59{
@@ -58,20 +61,21 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
58 unsigned long stack, sp; 61 unsigned long stack, sp;
59 int pid, fds[2], ret, n; 62 int pid, fds[2], ret, n;
60 63
61 if((stack_out != NULL) && (*stack_out != 0)) 64 if ((stack_out != NULL) && (*stack_out != 0))
62 stack = *stack_out; 65 stack = *stack_out;
63 else stack = alloc_stack(0, __cant_sleep()); 66 else
64 if(stack == 0) 67 stack = alloc_stack(0, __cant_sleep());
68 if (stack == 0)
65 return -ENOMEM; 69 return -ENOMEM;
66 70
67 ret = os_pipe(fds, 1, 0); 71 ret = os_pipe(fds, 1, 0);
68 if(ret < 0){ 72 if (ret < 0) {
69 printk("run_helper : pipe failed, ret = %d\n", -ret); 73 printk("run_helper : pipe failed, ret = %d\n", -ret);
70 goto out_free; 74 goto out_free;
71 } 75 }
72 76
73 ret = os_set_exec_close(fds[1], 1); 77 ret = os_set_exec_close(fds[1], 1);
74 if(ret < 0){ 78 if (ret < 0) {
75 printk("run_helper : setting FD_CLOEXEC failed, ret = %d\n", 79 printk("run_helper : setting FD_CLOEXEC failed, ret = %d\n",
76 -ret); 80 -ret);
77 goto out_close; 81 goto out_close;
@@ -82,11 +86,13 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
82 data.pre_data = pre_data; 86 data.pre_data = pre_data;
83 data.argv = argv; 87 data.argv = argv;
84 data.fd = fds[1]; 88 data.fd = fds[1];
89 data.buf = __cant_sleep() ? um_kmalloc_atomic(PATH_MAX) :
90 um_kmalloc(PATH_MAX);
85 pid = clone(helper_child, (void *) sp, CLONE_VM | SIGCHLD, &data); 91 pid = clone(helper_child, (void *) sp, CLONE_VM | SIGCHLD, &data);
86 if(pid < 0){ 92 if (pid < 0) {
87 ret = -errno; 93 ret = -errno;
88 printk("run_helper : clone failed, errno = %d\n", errno); 94 printk("run_helper : clone failed, errno = %d\n", errno);
89 goto out_close; 95 goto out_free2;
90 } 96 }
91 97
92 close(fds[1]); 98 close(fds[1]);
@@ -95,10 +101,10 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
95 /* Read the errno value from the child, if the exec failed, or get 0 if 101 /* Read the errno value from the child, if the exec failed, or get 0 if
96 * the exec succeeded because the pipe fd was set as close-on-exec. */ 102 * the exec succeeded because the pipe fd was set as close-on-exec. */
97 n = os_read_file(fds[0], &ret, sizeof(ret)); 103 n = os_read_file(fds[0], &ret, sizeof(ret));
98 if(n == 0) 104 if (n == 0) {
99 ret = pid; 105 ret = pid;
100 else { 106 } else {
101 if(n < 0){ 107 if (n < 0) {
102 printk("run_helper : read on pipe failed, ret = %d\n", 108 printk("run_helper : read on pipe failed, ret = %d\n",
103 -n); 109 -n);
104 ret = n; 110 ret = n;
@@ -107,15 +113,16 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
107 CATCH_EINTR(waitpid(pid, NULL, 0)); 113 CATCH_EINTR(waitpid(pid, NULL, 0));
108 } 114 }
109 115
116out_free2:
117 kfree(data.buf);
110out_close: 118out_close:
111 if (fds[1] != -1) 119 if (fds[1] != -1)
112 close(fds[1]); 120 close(fds[1]);
113 close(fds[0]); 121 close(fds[0]);
114out_free: 122out_free:
115 if(stack_out == NULL) 123 if ((stack_out == NULL) || (*stack_out == 0))
116 free_stack(stack, 0); 124 free_stack(stack, 0);
117 else *stack_out = stack; 125 return ret;
118 return(ret);
119} 126}
120 127
121int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags, 128int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
@@ -125,31 +132,32 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
125 int pid, status, err; 132 int pid, status, err;
126 133
127 stack = alloc_stack(stack_order, __cant_sleep()); 134 stack = alloc_stack(stack_order, __cant_sleep());
128 if(stack == 0) return(-ENOMEM); 135 if (stack == 0)
136 return -ENOMEM;
129 137
130 sp = stack + (page_size() << stack_order) - sizeof(void *); 138 sp = stack + (page_size() << stack_order) - sizeof(void *);
131 pid = clone(proc, (void *) sp, flags | SIGCHLD, arg); 139 pid = clone(proc, (void *) sp, flags | SIGCHLD, arg);
132 if(pid < 0){ 140 if (pid < 0) {
133 err = -errno; 141 err = -errno;
134 printk("run_helper_thread : clone failed, errno = %d\n", 142 printk("run_helper_thread : clone failed, errno = %d\n",
135 errno); 143 errno);
136 return err; 144 return err;
137 } 145 }
138 if(stack_out == NULL){ 146 if (stack_out == NULL) {
139 CATCH_EINTR(pid = waitpid(pid, &status, 0)); 147 CATCH_EINTR(pid = waitpid(pid, &status, 0));
140 if(pid < 0){ 148 if (pid < 0) {
141 err = -errno; 149 err = -errno;
142 printk("run_helper_thread - wait failed, errno = %d\n", 150 printk("run_helper_thread - wait failed, errno = %d\n",
143 errno); 151 errno);
144 pid = err; 152 pid = err;
145 } 153 }
146 if(!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) 154 if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0))
147 printk("run_helper_thread - thread returned status " 155 printk("run_helper_thread - thread returned status "
148 "0x%x\n", status); 156 "0x%x\n", status);
149 free_stack(stack, stack_order); 157 free_stack(stack, stack_order);
150 } 158 } else
151 else *stack_out = stack; 159 *stack_out = stack;
152 return(pid); 160 return pid;
153} 161}
154 162
155int helper_wait(int pid) 163int helper_wait(int pid)
@@ -157,9 +165,9 @@ int helper_wait(int pid)
157 int ret; 165 int ret;
158 166
159 CATCH_EINTR(ret = waitpid(pid, NULL, WNOHANG)); 167 CATCH_EINTR(ret = waitpid(pid, NULL, WNOHANG));
160 if(ret < 0){ 168 if (ret < 0) {
161 ret = -errno; 169 ret = -errno;
162 printk("helper_wait : waitpid failed, errno = %d\n", errno); 170 printk("helper_wait : waitpid failed, errno = %d\n", errno);
163 } 171 }
164 return(ret); 172 return ret;
165} 173}
diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c
index a97206df5b5..d46b818c131 100644
--- a/arch/um/os-Linux/irq.c
+++ b/arch/um/os-Linux/irq.c
@@ -18,6 +18,7 @@
18#include "sigio.h" 18#include "sigio.h"
19#include "irq_user.h" 19#include "irq_user.h"
20#include "os.h" 20#include "os.h"
21#include "um_malloc.h"
21 22
22static struct pollfd *pollfds = NULL; 23static struct pollfd *pollfds = NULL;
23static int pollfds_num = 0; 24static int pollfds_num = 0;
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index d1c5670787d..685feaab65d 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -23,6 +23,7 @@
23#include "choose-mode.h" 23#include "choose-mode.h"
24#include "uml-config.h" 24#include "uml-config.h"
25#include "os.h" 25#include "os.h"
26#include "um_malloc.h"
26 27
27/* Set in set_stklim, which is called from main and __wrap_malloc. 28/* Set in set_stklim, which is called from main and __wrap_malloc.
28 * __wrap_malloc only calls it if main hasn't started. 29 * __wrap_malloc only calls it if main hasn't started.
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index 51f0893640a..c692a192957 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -7,7 +7,6 @@
7#include <stdio.h> 7#include <stdio.h>
8#include <errno.h> 8#include <errno.h>
9#include <signal.h> 9#include <signal.h>
10#include <linux/unistd.h>
11#include <sys/mman.h> 10#include <sys/mman.h>
12#include <sys/wait.h> 11#include <sys/wait.h>
13#include <sys/mman.h> 12#include <sys/mman.h>
diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c
index f6457765b17..925a65240cf 100644
--- a/arch/um/os-Linux/sigio.c
+++ b/arch/um/os-Linux/sigio.c
@@ -19,6 +19,7 @@
19#include "user_util.h" 19#include "user_util.h"
20#include "sigio.h" 20#include "sigio.h"
21#include "os.h" 21#include "os.h"
22#include "um_malloc.h"
22 23
23/* Protected by sigio_lock(), also used by sigio_cleanup, which is an 24/* Protected by sigio_lock(), also used by sigio_cleanup, which is an
24 * exitcall. 25 * exitcall.
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index 6b81739279d..b897e8592d7 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -15,6 +15,7 @@
15#include "user.h" 15#include "user.h"
16#include "signal_kern.h" 16#include "signal_kern.h"
17#include "sysdep/sigcontext.h" 17#include "sysdep/sigcontext.h"
18#include "sysdep/barrier.h"
18#include "sigcontext.h" 19#include "sigcontext.h"
19#include "mode.h" 20#include "mode.h"
20#include "os.h" 21#include "os.h"
@@ -34,8 +35,12 @@
34#define SIGALRM_BIT 2 35#define SIGALRM_BIT 2
35#define SIGALRM_MASK (1 << SIGALRM_BIT) 36#define SIGALRM_MASK (1 << SIGALRM_BIT)
36 37
37static int signals_enabled = 1; 38/* These are used by both the signal handlers and
38static int pending = 0; 39 * block/unblock_signals. I don't want modifications cached in a
40 * register - they must go straight to memory.
41 */
42static volatile int signals_enabled = 1;
43static volatile int pending = 0;
39 44
40void sig_handler(int sig, struct sigcontext *sc) 45void sig_handler(int sig, struct sigcontext *sc)
41{ 46{
@@ -152,6 +157,12 @@ int change_sig(int signal, int on)
152void block_signals(void) 157void block_signals(void)
153{ 158{
154 signals_enabled = 0; 159 signals_enabled = 0;
160 /* This must return with signals disabled, so this barrier
161 * ensures that writes are flushed out before the return.
162 * This might matter if gcc figures out how to inline this and
163 * decides to shuffle this code into the caller.
164 */
165 mb();
155} 166}
156 167
157void unblock_signals(void) 168void unblock_signals(void)
@@ -171,9 +182,23 @@ void unblock_signals(void)
171 */ 182 */
172 signals_enabled = 1; 183 signals_enabled = 1;
173 184
185 /* Setting signals_enabled and reading pending must
186 * happen in this order.
187 */
188 mb();
189
174 save_pending = pending; 190 save_pending = pending;
175 if(save_pending == 0) 191 if(save_pending == 0){
192 /* This must return with signals enabled, so
193 * this barrier ensures that writes are
194 * flushed out before the return. This might
195 * matter if gcc figures out how to inline
196 * this (unlikely, given its size) and decides
197 * to shuffle this code into the caller.
198 */
199 mb();
176 return; 200 return;
201 }
177 202
178 pending = 0; 203 pending = 0;
179 204
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index cb9ab54146c..9b34fe65949 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -14,7 +14,7 @@
14#include <sys/mman.h> 14#include <sys/mman.h>
15#include <sys/user.h> 15#include <sys/user.h>
16#include <sys/time.h> 16#include <sys/time.h>
17#include <asm/unistd.h> 17#include <sys/syscall.h>
18#include <asm/types.h> 18#include <asm/types.h>
19#include "user.h" 19#include "user.h"
20#include "sysdep/ptrace.h" 20#include "sysdep/ptrace.h"
diff --git a/arch/um/os-Linux/sys-i386/tls.c b/arch/um/os-Linux/sys-i386/tls.c
index 6e945ab4584..256532034c6 100644
--- a/arch/um/os-Linux/sys-i386/tls.c
+++ b/arch/um/os-Linux/sys-i386/tls.c
@@ -1,6 +1,9 @@
1#include <errno.h> 1#include <errno.h>
2#include <linux/unistd.h> 2#include <linux/unistd.h>
3
3#include <sys/syscall.h> 4#include <sys/syscall.h>
5#include <unistd.h>
6
4#include "sysdep/tls.h" 7#include "sysdep/tls.h"
5#include "user_util.h" 8#include "user_util.h"
6 9
diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c
index 38be096e750..2115b8beb54 100644
--- a/arch/um/os-Linux/time.c
+++ b/arch/um/os-Linux/time.c
@@ -16,6 +16,7 @@
16#include "process.h" 16#include "process.h"
17#include "kern_constants.h" 17#include "kern_constants.h"
18#include "os.h" 18#include "os.h"
19#include "uml-config.h"
19 20
20int set_interval(int is_virtual) 21int set_interval(int is_virtual)
21{ 22{
@@ -30,7 +31,7 @@ int set_interval(int is_virtual)
30 return 0; 31 return 0;
31} 32}
32 33
33#ifdef CONFIG_MODE_TT 34#ifdef UML_CONFIG_MODE_TT
34void enable_timer(void) 35void enable_timer(void)
35{ 36{
36 set_interval(1); 37 set_interval(1);
diff --git a/arch/um/os-Linux/tls.c b/arch/um/os-Linux/tls.c
index a2de2580b8a..16215b99080 100644
--- a/arch/um/os-Linux/tls.c
+++ b/arch/um/os-Linux/tls.c
@@ -1,4 +1,5 @@
1#include <errno.h> 1#include <errno.h>
2#include <unistd.h>
2#include <sys/ptrace.h> 3#include <sys/ptrace.h>
3#include <sys/syscall.h> 4#include <sys/syscall.h>
4#include <asm/ldt.h> 5#include <asm/ldt.h>
diff --git a/arch/um/sys-i386/unmap.c b/arch/um/sys-i386/unmap.c
index 8e55cd5d3d0..1b0ad0e4adc 100644
--- a/arch/um/sys-i386/unmap.c
+++ b/arch/um/sys-i386/unmap.c
@@ -5,17 +5,20 @@
5 5
6#include <linux/mman.h> 6#include <linux/mman.h>
7#include <asm/unistd.h> 7#include <asm/unistd.h>
8#include <sys/syscall.h>
9 8
9static int errno;
10
11static inline _syscall2(int,munmap,void *,start,size_t,len)
12static inline _syscall6(void *,mmap2,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset)
10int switcheroo(int fd, int prot, void *from, void *to, int size) 13int switcheroo(int fd, int prot, void *from, void *to, int size)
11{ 14{
12 if (syscall(__NR_munmap, to, size) < 0){ 15 if(munmap(to, size) < 0){
13 return(-1); 16 return(-1);
14 } 17 }
15 if (syscall(__NR_mmap2, to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1 ){ 18 if(mmap2(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1 ){
16 return(-1); 19 return(-1);
17 } 20 }
18 if (syscall(__NR_munmap, from, size) < 0){ 21 if(munmap(from, size) < 0){
19 return(-1); 22 return(-1);
20 } 23 }
21 return(0); 24 return(0);
diff --git a/arch/um/sys-x86_64/unmap.c b/arch/um/sys-x86_64/unmap.c
index 57c9286a701..f4a4bffd8a1 100644
--- a/arch/um/sys-x86_64/unmap.c
+++ b/arch/um/sys-x86_64/unmap.c
@@ -5,17 +5,20 @@
5 5
6#include <linux/mman.h> 6#include <linux/mman.h>
7#include <asm/unistd.h> 7#include <asm/unistd.h>
8#include <sys/syscall.h>
9 8
9static int errno;
10
11static inline _syscall2(int,munmap,void *,start,size_t,len)
12static inline _syscall6(void *,mmap,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset)
10int switcheroo(int fd, int prot, void *from, void *to, int size) 13int switcheroo(int fd, int prot, void *from, void *to, int size)
11{ 14{
12 if (syscall(__NR_munmap, to, size) < 0){ 15 if(munmap(to, size) < 0){
13 return(-1); 16 return(-1);
14 } 17 }
15 if (syscall(__NR_mmap, to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1){ 18 if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1){
16 return(-1); 19 return(-1);
17 } 20 }
18 if (syscall(__NR_munmap, from, size) < 0){ 21 if(munmap(from, size) < 0){
19 return(-1); 22 return(-1);
20 } 23 }
21 return(0); 24 return(0);
diff --git a/arch/v850/kernel/v850_ksyms.c b/arch/v850/kernel/v850_ksyms.c
index 67bc48e57c6..93575fdc874 100644
--- a/arch/v850/kernel/v850_ksyms.c
+++ b/arch/v850/kernel/v850_ksyms.c
@@ -24,7 +24,7 @@ EXPORT_SYMBOL (kernel_thread);
24EXPORT_SYMBOL (__bug); 24EXPORT_SYMBOL (__bug);
25 25
26/* Networking helper routines. */ 26/* Networking helper routines. */
27EXPORT_SYMBOL (csum_partial_copy); 27EXPORT_SYMBOL (csum_partial_copy_nocheck);
28EXPORT_SYMBOL (csum_partial_copy_from_user); 28EXPORT_SYMBOL (csum_partial_copy_from_user);
29EXPORT_SYMBOL (ip_compute_csum); 29EXPORT_SYMBOL (ip_compute_csum);
30EXPORT_SYMBOL (ip_fast_csum); 30EXPORT_SYMBOL (ip_fast_csum);
diff --git a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S
index 63399219cd9..88d087f527c 100644
--- a/arch/v850/kernel/vmlinux.lds.S
+++ b/arch/v850/kernel/vmlinux.lds.S
@@ -140,13 +140,7 @@
140 ___setup_end = . ; \ 140 ___setup_end = . ; \
141 ___initcall_start = . ; \ 141 ___initcall_start = . ; \
142 *(.initcall.init) \ 142 *(.initcall.init) \
143 *(.initcall1.init) \ 143 INITCALLS \
144 *(.initcall2.init) \
145 *(.initcall3.init) \
146 *(.initcall4.init) \
147 *(.initcall5.init) \
148 *(.initcall6.init) \
149 *(.initcall7.init) \
150 . = ALIGN (4) ; \ 144 . = ALIGN (4) ; \
151 ___initcall_end = . ; \ 145 ___initcall_end = . ; \
152 ___con_initcall_start = .; \ 146 ___con_initcall_start = .; \
diff --git a/arch/v850/lib/checksum.c b/arch/v850/lib/checksum.c
index fa587263307..042158dfe17 100644
--- a/arch/v850/lib/checksum.c
+++ b/arch/v850/lib/checksum.c
@@ -88,32 +88,32 @@ out:
88 * This is a version of ip_compute_csum() optimized for IP headers, 88 * This is a version of ip_compute_csum() optimized for IP headers,
89 * which always checksum on 4 octet boundaries. 89 * which always checksum on 4 octet boundaries.
90 */ 90 */
91unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) 91__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
92{ 92{
93 return ~do_csum(iph,ihl*4); 93 return (__force __sum16)~do_csum(iph,ihl*4);
94} 94}
95 95
96/* 96/*
97 * this routine is used for miscellaneous IP-like checksums, mainly 97 * this routine is used for miscellaneous IP-like checksums, mainly
98 * in icmp.c 98 * in icmp.c
99 */ 99 */
100unsigned short ip_compute_csum(const unsigned char * buff, int len) 100__sum16 ip_compute_csum(const void *buff, int len)
101{ 101{
102 return ~do_csum(buff,len); 102 return (__force __sum16)~do_csum(buff,len);
103} 103}
104 104
105/* 105/*
106 * computes a partial checksum, e.g. for TCP/UDP fragments 106 * computes a partial checksum, e.g. for TCP/UDP fragments
107 */ 107 */
108unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum) 108__wsum csum_partial(const void *buff, int len, __wsum sum)
109{ 109{
110 unsigned int result = do_csum(buff, len); 110 unsigned int result = do_csum(buff, len);
111 111
112 /* add in old sum, and carry.. */ 112 /* add in old sum, and carry.. */
113 result += sum; 113 result += (__force u32)sum;
114 if(sum > result) 114 if ((__force u32)sum > result)
115 result += 1; 115 result += 1;
116 return result; 116 return (__force __wsum)result;
117} 117}
118 118
119EXPORT_SYMBOL(csum_partial); 119EXPORT_SYMBOL(csum_partial);
@@ -121,8 +121,8 @@ EXPORT_SYMBOL(csum_partial);
121/* 121/*
122 * copy while checksumming, otherwise like csum_partial 122 * copy while checksumming, otherwise like csum_partial
123 */ 123 */
124unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst, 124__wsum csum_partial_copy_nocheck(const void *src, void *dst,
125 int len, unsigned int sum) 125 int len, __wsum sum)
126{ 126{
127 /* 127 /*
128 * It's 2:30 am and I don't feel like doing it real ... 128 * It's 2:30 am and I don't feel like doing it real ...
@@ -138,9 +138,9 @@ unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst,
138 * Copy from userspace and compute checksum. If we catch an exception 138 * Copy from userspace and compute checksum. If we catch an exception
139 * then zero the rest of the buffer. 139 * then zero the rest of the buffer.
140 */ 140 */
141unsigned int csum_partial_copy_from_user (const unsigned char *src, 141__wsum csum_partial_copy_from_user (const void *src,
142 unsigned char *dst, 142 void *dst,
143 int len, unsigned int sum, 143 int len, __wsum sum,
144 int *err_ptr) 144 int *err_ptr)
145{ 145{
146 int missing; 146 int missing;
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile
index 1c0f18d4f88..6e38d4daeed 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86_64/Makefile
@@ -54,6 +54,10 @@ endif
54cflags-y += $(call cc-option,-funit-at-a-time) 54cflags-y += $(call cc-option,-funit-at-a-time)
55# prevent gcc from generating any FP code by mistake 55# prevent gcc from generating any FP code by mistake
56cflags-y += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,) 56cflags-y += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
57# this works around some issues with generating unwind tables in older gccs
58# newer gccs do it by default
59cflags-y += -maccumulate-outgoing-args
60
57# do binutils support CFI? 61# do binutils support CFI?
58cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,) 62cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
59AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,) 63AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
@@ -62,8 +66,8 @@ AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
62cflags-y += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,) 66cflags-y += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
63AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,) 67AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
64 68
65cflags-$(CONFIG_CC_STACKPROTECTOR) += $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-x86_64-has-stack-protector.sh $(CC) -fstack-protector ) 69cflags-$(CONFIG_CC_STACKPROTECTOR) += $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-x86_64-has-stack-protector.sh "$(CC)" -fstack-protector )
66cflags-$(CONFIG_CC_STACKPROTECTOR_ALL) += $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-x86_64-has-stack-protector.sh $(CC) -fstack-protector-all ) 70cflags-$(CONFIG_CC_STACKPROTECTOR_ALL) += $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-x86_64-has-stack-protector.sh "$(CC)" -fstack-protector-all )
67 71
68CFLAGS += $(cflags-y) 72CFLAGS += $(cflags-y)
69CFLAGS_KERNEL += $(cflags-kernel-y) 73CFLAGS_KERNEL += $(cflags-kernel-y)
diff --git a/arch/x86_64/boot/setup.S b/arch/x86_64/boot/setup.S
index c3bfd223ab4..770940cc010 100644
--- a/arch/x86_64/boot/setup.S
+++ b/arch/x86_64/boot/setup.S
@@ -836,13 +836,12 @@ gdt:
836 .word 0x9200 # data read/write 836 .word 0x9200 # data read/write
837 .word 0x00CF # granularity = 4096, 386 837 .word 0x00CF # granularity = 4096, 386
838 # (+5th nibble of limit) 838 # (+5th nibble of limit)
839gdt_end:
839idt_48: 840idt_48:
840 .word 0 # idt limit = 0 841 .word 0 # idt limit = 0
841 .word 0, 0 # idt base = 0L 842 .word 0, 0 # idt base = 0L
842gdt_48: 843gdt_48:
843 .word 0x8000 # gdt limit=2048, 844 .word gdt_end-gdt-1 # gdt limit
844 # 256 GDT entries
845
846 .word 0, 0 # gdt base (filled in later) 845 .word 0, 0 # gdt base (filled in later)
847 846
848# Include video setup & detection code 847# Include video setup & detection code
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 47bfba6e9dc..0f5d44e86be 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/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.19-rc1 3# Linux kernel version: 2.6.19-rc2-git4
4# Thu Oct 5 13:04:43 2006 4# Sat Oct 21 03:38:52 2006
5# 5#
6CONFIG_X86_64=y 6CONFIG_X86_64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -335,8 +335,8 @@ CONFIG_IPV6=y
335# CONFIG_INET6_XFRM_MODE_TUNNEL is not set 335# CONFIG_INET6_XFRM_MODE_TUNNEL is not set
336# CONFIG_INET6_XFRM_MODE_BEET is not set 336# CONFIG_INET6_XFRM_MODE_BEET is not set
337# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set 337# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
338CONFIG_IPV6_SIT=y
338# CONFIG_IPV6_TUNNEL is not set 339# CONFIG_IPV6_TUNNEL is not set
339# CONFIG_IPV6_SUBTREES is not set
340# CONFIG_IPV6_MULTIPLE_TABLES is not set 340# CONFIG_IPV6_MULTIPLE_TABLES is not set
341# CONFIG_NETWORK_SECMARK is not set 341# CONFIG_NETWORK_SECMARK is not set
342# CONFIG_NETFILTER is not set 342# CONFIG_NETFILTER is not set
@@ -438,6 +438,13 @@ CONFIG_BLK_DEV_INITRD=y
438# CONFIG_ATA_OVER_ETH is not set 438# CONFIG_ATA_OVER_ETH is not set
439 439
440# 440#
441# Misc devices
442#
443# CONFIG_IBM_ASM is not set
444# CONFIG_SGI_IOC4 is not set
445# CONFIG_TIFM_CORE is not set
446
447#
441# ATA/ATAPI/MFM/RLL support 448# ATA/ATAPI/MFM/RLL support
442# 449#
443CONFIG_IDE=y 450CONFIG_IDE=y
@@ -1008,6 +1015,7 @@ CONFIG_I2C_ISA=m
1008# 1015#
1009# Dallas's 1-wire bus 1016# Dallas's 1-wire bus
1010# 1017#
1018# CONFIG_W1 is not set
1011 1019
1012# 1020#
1013# Hardware Monitoring support 1021# Hardware Monitoring support
@@ -1059,12 +1067,6 @@ CONFIG_SENSORS_SMSC47B397=m
1059# CONFIG_HWMON_DEBUG_CHIP is not set 1067# CONFIG_HWMON_DEBUG_CHIP is not set
1060 1068
1061# 1069#
1062# Misc devices
1063#
1064# CONFIG_IBM_ASM is not set
1065# CONFIG_TIFM_CORE is not set
1066
1067#
1068# Multimedia devices 1070# Multimedia devices
1069# 1071#
1070# CONFIG_VIDEO_DEV is not set 1072# CONFIG_VIDEO_DEV is not set
@@ -1196,7 +1198,6 @@ CONFIG_USB_HIDINPUT=y
1196# CONFIG_USB_ATI_REMOTE2 is not set 1198# CONFIG_USB_ATI_REMOTE2 is not set
1197# CONFIG_USB_KEYSPAN_REMOTE is not set 1199# CONFIG_USB_KEYSPAN_REMOTE is not set
1198# CONFIG_USB_APPLETOUCH is not set 1200# CONFIG_USB_APPLETOUCH is not set
1199# CONFIG_USB_TRANCEVIBRATOR is not set
1200 1201
1201# 1202#
1202# USB Imaging devices 1203# USB Imaging devices
@@ -1242,6 +1243,7 @@ CONFIG_USB_MON=y
1242# CONFIG_USB_APPLEDISPLAY is not set 1243# CONFIG_USB_APPLEDISPLAY is not set
1243# CONFIG_USB_SISUSBVGA is not set 1244# CONFIG_USB_SISUSBVGA is not set
1244# CONFIG_USB_LD is not set 1245# CONFIG_USB_LD is not set
1246# CONFIG_USB_TRANCEVIBRATOR is not set
1245# CONFIG_USB_TEST is not set 1247# CONFIG_USB_TEST is not set
1246 1248
1247# 1249#
@@ -1318,6 +1320,7 @@ CONFIG_EXT3_FS=y
1318CONFIG_EXT3_FS_XATTR=y 1320CONFIG_EXT3_FS_XATTR=y
1319CONFIG_EXT3_FS_POSIX_ACL=y 1321CONFIG_EXT3_FS_POSIX_ACL=y
1320# CONFIG_EXT3_FS_SECURITY is not set 1322# CONFIG_EXT3_FS_SECURITY is not set
1323# CONFIG_EXT4DEV_FS is not set
1321CONFIG_JBD=y 1324CONFIG_JBD=y
1322# CONFIG_JBD_DEBUG is not set 1325# CONFIG_JBD_DEBUG is not set
1323CONFIG_FS_MBCACHE=y 1326CONFIG_FS_MBCACHE=y
@@ -1341,6 +1344,7 @@ CONFIG_DNOTIFY=y
1341# CONFIG_AUTOFS_FS is not set 1344# CONFIG_AUTOFS_FS is not set
1342CONFIG_AUTOFS4_FS=y 1345CONFIG_AUTOFS4_FS=y
1343# CONFIG_FUSE_FS is not set 1346# CONFIG_FUSE_FS is not set
1347CONFIG_GENERIC_ACL=y
1344 1348
1345# 1349#
1346# CD-ROM/DVD Filesystems 1350# CD-ROM/DVD Filesystems
@@ -1418,7 +1422,6 @@ CONFIG_SUNRPC=y
1418# CONFIG_CODA_FS is not set 1422# CONFIG_CODA_FS is not set
1419# CONFIG_AFS_FS is not set 1423# CONFIG_AFS_FS is not set
1420# CONFIG_9P_FS is not set 1424# CONFIG_9P_FS is not set
1421CONFIG_GENERIC_ACL=y
1422 1425
1423# 1426#
1424# Partition Types 1427# Partition Types
@@ -1471,10 +1474,6 @@ CONFIG_NLS_ISO8859_15=y
1471CONFIG_NLS_UTF8=y 1474CONFIG_NLS_UTF8=y
1472 1475
1473# 1476#
1474# Distributed Lock Manager
1475#
1476
1477#
1478# Instrumentation Support 1477# Instrumentation Support
1479# 1478#
1480CONFIG_PROFILING=y 1479CONFIG_PROFILING=y
@@ -1512,6 +1511,7 @@ CONFIG_DEBUG_FS=y
1512CONFIG_UNWIND_INFO=y 1511CONFIG_UNWIND_INFO=y
1513CONFIG_STACK_UNWIND=y 1512CONFIG_STACK_UNWIND=y
1514# CONFIG_FORCED_INLINING is not set 1513# CONFIG_FORCED_INLINING is not set
1514# CONFIG_HEADERS_CHECK is not set
1515# CONFIG_RCU_TORTURE_TEST is not set 1515# CONFIG_RCU_TORTURE_TEST is not set
1516# CONFIG_LKDTM is not set 1516# CONFIG_LKDTM is not set
1517# CONFIG_DEBUG_RODATA is not set 1517# CONFIG_DEBUG_RODATA is not set
diff --git a/arch/x86_64/ia32/ia32_signal.c b/arch/x86_64/ia32/ia32_signal.c
index a6ba9951e86..0e0a266d976 100644
--- a/arch/x86_64/ia32/ia32_signal.c
+++ b/arch/x86_64/ia32/ia32_signal.c
@@ -579,6 +579,11 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
579 regs->rsp = (unsigned long) frame; 579 regs->rsp = (unsigned long) frame;
580 regs->rip = (unsigned long) ka->sa.sa_handler; 580 regs->rip = (unsigned long) ka->sa.sa_handler;
581 581
582 /* Make -mregparm=3 work */
583 regs->rax = sig;
584 regs->rdx = (unsigned long) &frame->info;
585 regs->rcx = (unsigned long) &frame->uc;
586
582 asm volatile("movl %0,%%ds" :: "r" (__USER32_DS)); 587 asm volatile("movl %0,%%ds" :: "r" (__USER32_DS));
583 asm volatile("movl %0,%%es" :: "r" (__USER32_DS)); 588 asm volatile("movl %0,%%es" :: "r" (__USER32_DS));
584 589
diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c
index 3a7561d4703..04566fe5de4 100644
--- a/arch/x86_64/ia32/ptrace32.c
+++ b/arch/x86_64/ia32/ptrace32.c
@@ -244,6 +244,8 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
244 case PTRACE_DETACH: 244 case PTRACE_DETACH:
245 case PTRACE_SYSCALL: 245 case PTRACE_SYSCALL:
246 case PTRACE_SETOPTIONS: 246 case PTRACE_SETOPTIONS:
247 case PTRACE_SET_THREAD_AREA:
248 case PTRACE_GET_THREAD_AREA:
247 return sys_ptrace(request, pid, addr, data); 249 return sys_ptrace(request, pid, addr, data);
248 250
249 default: 251 default:
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index b3f0908668e..6fe191c5808 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -54,13 +54,13 @@ static inline int bad_addr(unsigned long *addrp, unsigned long size)
54 54
55 /* various gunk below that needed for SMP startup */ 55 /* various gunk below that needed for SMP startup */
56 if (addr < 0x8000) { 56 if (addr < 0x8000) {
57 *addrp = 0x8000; 57 *addrp = PAGE_ALIGN(0x8000);
58 return 1; 58 return 1;
59 } 59 }
60 60
61 /* direct mapping tables of the kernel */ 61 /* direct mapping tables of the kernel */
62 if (last >= table_start<<PAGE_SHIFT && addr < table_end<<PAGE_SHIFT) { 62 if (last >= table_start<<PAGE_SHIFT && addr < table_end<<PAGE_SHIFT) {
63 *addrp = table_end << PAGE_SHIFT; 63 *addrp = PAGE_ALIGN(table_end << PAGE_SHIFT);
64 return 1; 64 return 1;
65 } 65 }
66 66
@@ -68,18 +68,18 @@ static inline int bad_addr(unsigned long *addrp, unsigned long size)
68#ifdef CONFIG_BLK_DEV_INITRD 68#ifdef CONFIG_BLK_DEV_INITRD
69 if (LOADER_TYPE && INITRD_START && last >= INITRD_START && 69 if (LOADER_TYPE && INITRD_START && last >= INITRD_START &&
70 addr < INITRD_START+INITRD_SIZE) { 70 addr < INITRD_START+INITRD_SIZE) {
71 *addrp = INITRD_START + INITRD_SIZE; 71 *addrp = PAGE_ALIGN(INITRD_START + INITRD_SIZE);
72 return 1; 72 return 1;
73 } 73 }
74#endif 74#endif
75 /* kernel code */ 75 /* kernel code */
76 if (last >= __pa_symbol(&_text) && last < __pa_symbol(&_end)) { 76 if (last >= __pa_symbol(&_text) && addr < __pa_symbol(&_end)) {
77 *addrp = __pa_symbol(&_end); 77 *addrp = PAGE_ALIGN(__pa_symbol(&_end));
78 return 1; 78 return 1;
79 } 79 }
80 80
81 if (last >= ebda_addr && addr < ebda_addr + ebda_size) { 81 if (last >= ebda_addr && addr < ebda_addr + ebda_size) {
82 *addrp = ebda_addr + ebda_size; 82 *addrp = PAGE_ALIGN(ebda_addr + ebda_size);
83 return 1; 83 return 1;
84 } 84 }
85 85
@@ -152,7 +152,7 @@ unsigned long __init find_e820_area(unsigned long start, unsigned long end, unsi
152 continue; 152 continue;
153 while (bad_addr(&addr, size) && addr+size <= ei->addr+ei->size) 153 while (bad_addr(&addr, size) && addr+size <= ei->addr+ei->size)
154 ; 154 ;
155 last = addr + size; 155 last = PAGE_ALIGN(addr) + size;
156 if (last > ei->addr + ei->size) 156 if (last > ei->addr + ei->size)
157 continue; 157 continue;
158 if (last > end) 158 if (last > end)
@@ -278,7 +278,7 @@ e820_register_active_regions(int nid, unsigned long start_pfn,
278 >> PAGE_SHIFT; 278 >> PAGE_SHIFT;
279 279
280 /* Skip map entries smaller than a page */ 280 /* Skip map entries smaller than a page */
281 if (ei_startpfn > ei_endpfn) 281 if (ei_startpfn >= ei_endpfn)
282 continue; 282 continue;
283 283
284 /* Check if end_pfn_map should be updated */ 284 /* Check if end_pfn_map should be updated */
@@ -594,7 +594,9 @@ static int __init parse_memmap_opt(char *p)
594 * size before original memory map is 594 * size before original memory map is
595 * reset. 595 * reset.
596 */ 596 */
597 e820_register_active_regions(0, 0, -1UL);
597 saved_max_pfn = e820_end_of_ram(); 598 saved_max_pfn = e820_end_of_ram();
599 remove_all_active_ranges();
598#endif 600#endif
599 end_pfn_map = 0; 601 end_pfn_map = 0;
600 e820.nr_map = 0; 602 e820.nr_map = 0;
diff --git a/arch/x86_64/kernel/early-quirks.c b/arch/x86_64/kernel/early-quirks.c
index 208e38a372c..68273bff58c 100644
--- a/arch/x86_64/kernel/early-quirks.c
+++ b/arch/x86_64/kernel/early-quirks.c
@@ -45,7 +45,13 @@ static void nvidia_bugs(void)
45 /* 45 /*
46 * All timer overrides on Nvidia are 46 * All timer overrides on Nvidia are
47 * wrong unless HPET is enabled. 47 * wrong unless HPET is enabled.
48 * Unfortunately that's not true on many Asus boards.
49 * We don't know yet how to detect this automatically, but
50 * at least allow a command line override.
48 */ 51 */
52 if (acpi_use_timer_override)
53 return;
54
49 nvidia_hpet_detected = 0; 55 nvidia_hpet_detected = 0;
50 acpi_table_parse(ACPI_HPET, nvidia_hpet_check); 56 acpi_table_parse(ACPI_HPET, nvidia_hpet_check);
51 if (nvidia_hpet_detected == 0) { 57 if (nvidia_hpet_detected == 0) {
@@ -53,6 +59,8 @@ static void nvidia_bugs(void)
53 printk(KERN_INFO "Nvidia board " 59 printk(KERN_INFO "Nvidia board "
54 "detected. Ignoring ACPI " 60 "detected. Ignoring ACPI "
55 "timer override.\n"); 61 "timer override.\n");
62 printk(KERN_INFO "If you got timer trouble "
63 "try acpi_use_timer_override\n");
56 } 64 }
57#endif 65#endif
58 /* RED-PEN skip them on mptables too? */ 66 /* RED-PEN skip them on mptables too? */
@@ -61,10 +69,11 @@ static void nvidia_bugs(void)
61 69
62static void ati_bugs(void) 70static void ati_bugs(void)
63{ 71{
64#if 1 /* for testing */ 72 if (timer_over_8254 == 1) {
65 printk("ATI board detected\n"); 73 timer_over_8254 = 0;
66#endif 74 printk(KERN_INFO
67 /* No bugs right now */ 75 "ATI board detected. Disabling timer routing over 8254.\n");
76 }
68} 77}
69 78
70struct chipset { 79struct chipset {
diff --git a/arch/x86_64/kernel/early_printk.c b/arch/x86_64/kernel/early_printk.c
index e22ecd54870..47b6d90349d 100644
--- a/arch/x86_64/kernel/early_printk.c
+++ b/arch/x86_64/kernel/early_printk.c
@@ -224,7 +224,7 @@ static int __init setup_early_printk(char *buf)
224 return 0; 224 return 0;
225 early_console_initialized = 1; 225 early_console_initialized = 1;
226 226
227 if (!strcmp(buf,"keep")) 227 if (strstr(buf, "keep"))
228 keep_early = 1; 228 keep_early = 1;
229 229
230 if (!strncmp(buf, "serial", 6)) { 230 if (!strncmp(buf, "serial", 6)) {
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 38a7b2d528e..7d401b00d82 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -315,6 +315,8 @@ tracesys:
315 LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */ 315 LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */
316 RESTORE_REST 316 RESTORE_REST
317 cmpq $__NR_syscall_max,%rax 317 cmpq $__NR_syscall_max,%rax
318 movq $-ENOSYS,%rcx
319 cmova %rcx,%rax
318 ja 1f 320 ja 1f
319 movq %r10,%rcx /* fixup for C */ 321 movq %r10,%rcx /* fixup for C */
320 call *sys_call_table(,%rax,8) 322 call *sys_call_table(,%rax,8)
@@ -535,8 +537,6 @@ END(stub_rt_sigreturn)
5351: incl %gs:pda_irqcount 5371: incl %gs:pda_irqcount
536 cmoveq %gs:pda_irqstackptr,%rsp 538 cmoveq %gs:pda_irqstackptr,%rsp
537 push %rbp # backlink for old unwinder 539 push %rbp # backlink for old unwinder
538 CFI_ADJUST_CFA_OFFSET 8
539 CFI_REL_OFFSET rbp,0
540 /* 540 /*
541 * We entered an interrupt context - irqs are off: 541 * We entered an interrupt context - irqs are off:
542 */ 542 */
@@ -980,11 +980,6 @@ ENTRY(kernel_thread)
980 call do_fork 980 call do_fork
981 movq %rax,RAX(%rsp) 981 movq %rax,RAX(%rsp)
982 xorl %edi,%edi 982 xorl %edi,%edi
983 test %rax,%rax
984 jnz 1f
985 /* terminate stack in child */
986 movq %rdi,RIP(%rsp)
9871:
988 983
989 /* 984 /*
990 * It isn't worth to check for reschedule here, 985 * It isn't worth to check for reschedule here,
@@ -1176,7 +1171,6 @@ ENTRY(call_softirq)
1176 incl %gs:pda_irqcount 1171 incl %gs:pda_irqcount
1177 cmove %gs:pda_irqstackptr,%rsp 1172 cmove %gs:pda_irqstackptr,%rsp
1178 push %rbp # backlink for old unwinder 1173 push %rbp # backlink for old unwinder
1179 CFI_ADJUST_CFA_OFFSET 8
1180 call __do_softirq 1174 call __do_softirq
1181 leaveq 1175 leaveq
1182 CFI_DEF_CFA_REGISTER rsp 1176 CFI_DEF_CFA_REGISTER rsp
diff --git a/arch/x86_64/kernel/genapic_flat.c b/arch/x86_64/kernel/genapic_flat.c
index 0dfc223c183..7c01db8fa9d 100644
--- a/arch/x86_64/kernel/genapic_flat.c
+++ b/arch/x86_64/kernel/genapic_flat.c
@@ -153,7 +153,7 @@ struct genapic apic_flat = {
153 153
154static cpumask_t physflat_target_cpus(void) 154static cpumask_t physflat_target_cpus(void)
155{ 155{
156 return cpumask_of_cpu(0); 156 return cpu_online_map;
157} 157}
158 158
159static cpumask_t physflat_vector_allocation_domain(int cpu) 159static cpumask_t physflat_vector_allocation_domain(int cpu)
diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c
index 0612a33bb89..c4ef801b765 100644
--- a/arch/x86_64/kernel/i8259.c
+++ b/arch/x86_64/kernel/i8259.c
@@ -178,7 +178,8 @@ void make_8259A_irq(unsigned int irq)
178{ 178{
179 disable_irq_nosync(irq); 179 disable_irq_nosync(irq);
180 io_apic_irqs &= ~(1<<irq); 180 io_apic_irqs &= ~(1<<irq);
181 set_irq_chip_and_handler(irq, &i8259A_chip, handle_level_irq); 181 set_irq_chip_and_handler_name(irq, &i8259A_chip, handle_level_irq,
182 "XT");
182 enable_irq(irq); 183 enable_irq(irq);
183} 184}
184 185
@@ -431,8 +432,8 @@ void __init init_ISA_irqs (void)
431 /* 432 /*
432 * 16 old-style INTA-cycle interrupts: 433 * 16 old-style INTA-cycle interrupts:
433 */ 434 */
434 set_irq_chip_and_handler(i, &i8259A_chip, 435 set_irq_chip_and_handler_name(i, &i8259A_chip,
435 handle_level_irq); 436 handle_level_irq, "XT");
436 } else { 437 } else {
437 /* 438 /*
438 * 'high' PCI IRQs filled in on demand 439 * 'high' PCI IRQs filled in on demand
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 44b55f83387..c80081a6ba4 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -57,13 +57,13 @@ static int no_timer_check;
57 57
58static int disable_timer_pin_1 __initdata; 58static int disable_timer_pin_1 __initdata;
59 59
60int timer_over_8254 __initdata = 0; 60int timer_over_8254 __initdata = 1;
61 61
62/* Where if anywhere is the i8259 connect in external int mode */ 62/* Where if anywhere is the i8259 connect in external int mode */
63static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; 63static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
64 64
65static DEFINE_SPINLOCK(ioapic_lock); 65static DEFINE_SPINLOCK(ioapic_lock);
66static DEFINE_SPINLOCK(vector_lock); 66DEFINE_SPINLOCK(vector_lock);
67 67
68/* 68/*
69 * # of IRQ routing registers 69 * # of IRQ routing registers
@@ -88,6 +88,52 @@ static struct irq_pin_list {
88 short apic, pin, next; 88 short apic, pin, next;
89} irq_2_pin[PIN_MAP_SIZE]; 89} irq_2_pin[PIN_MAP_SIZE];
90 90
91struct io_apic {
92 unsigned int index;
93 unsigned int unused[3];
94 unsigned int data;
95};
96
97static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx)
98{
99 return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx)
100 + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK);
101}
102
103static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
104{
105 struct io_apic __iomem *io_apic = io_apic_base(apic);
106 writel(reg, &io_apic->index);
107 return readl(&io_apic->data);
108}
109
110static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
111{
112 struct io_apic __iomem *io_apic = io_apic_base(apic);
113 writel(reg, &io_apic->index);
114 writel(value, &io_apic->data);
115}
116
117/*
118 * Re-write a value: to be used for read-modify-write
119 * cycles where the read already set up the index register.
120 */
121static inline void io_apic_modify(unsigned int apic, unsigned int value)
122{
123 struct io_apic __iomem *io_apic = io_apic_base(apic);
124 writel(value, &io_apic->data);
125}
126
127/*
128 * Synchronize the IO-APIC and the CPU by doing
129 * a dummy read from the IO-APIC
130 */
131static inline void io_apic_sync(unsigned int apic)
132{
133 struct io_apic __iomem *io_apic = io_apic_base(apic);
134 readl(&io_apic->data);
135}
136
91#define __DO_ACTION(R, ACTION, FINAL) \ 137#define __DO_ACTION(R, ACTION, FINAL) \
92 \ 138 \
93{ \ 139{ \
@@ -126,12 +172,34 @@ static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin)
126 return eu.entry; 172 return eu.entry;
127} 173}
128 174
175/*
176 * When we write a new IO APIC routing entry, we need to write the high
177 * word first! If the mask bit in the low word is clear, we will enable
178 * the interrupt, and we need to make sure the entry is fully populated
179 * before that happens.
180 */
129static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) 181static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e)
130{ 182{
131 unsigned long flags; 183 unsigned long flags;
132 union entry_union eu; 184 union entry_union eu;
133 eu.entry = e; 185 eu.entry = e;
134 spin_lock_irqsave(&ioapic_lock, flags); 186 spin_lock_irqsave(&ioapic_lock, flags);
187 io_apic_write(apic, 0x11 + 2*pin, eu.w2);
188 io_apic_write(apic, 0x10 + 2*pin, eu.w1);
189 spin_unlock_irqrestore(&ioapic_lock, flags);
190}
191
192/*
193 * When we mask an IO APIC routing entry, we need to write the low
194 * word first, in order to set the mask bit before we change the
195 * high bits!
196 */
197static void ioapic_mask_entry(int apic, int pin)
198{
199 unsigned long flags;
200 union entry_union eu = { .entry.mask = 1 };
201
202 spin_lock_irqsave(&ioapic_lock, flags);
135 io_apic_write(apic, 0x10 + 2*pin, eu.w1); 203 io_apic_write(apic, 0x10 + 2*pin, eu.w1);
136 io_apic_write(apic, 0x11 + 2*pin, eu.w2); 204 io_apic_write(apic, 0x11 + 2*pin, eu.w2);
137 spin_unlock_irqrestore(&ioapic_lock, flags); 205 spin_unlock_irqrestore(&ioapic_lock, flags);
@@ -256,9 +324,7 @@ static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin)
256 /* 324 /*
257 * Disable it in the IO-APIC irq-routing table: 325 * Disable it in the IO-APIC irq-routing table:
258 */ 326 */
259 memset(&entry, 0, sizeof(entry)); 327 ioapic_mask_entry(apic, pin);
260 entry.mask = 1;
261 ioapic_write_entry(apic, pin, entry);
262} 328}
263 329
264static void clear_IO_APIC (void) 330static void clear_IO_APIC (void)
@@ -612,15 +678,15 @@ static int __assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result)
612 * Also, we've got to be careful not to trash gate 678 * Also, we've got to be careful not to trash gate
613 * 0x80, because int 0x80 is hm, kind of importantish. ;) 679 * 0x80, because int 0x80 is hm, kind of importantish. ;)
614 */ 680 */
615 static struct { 681 static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0;
616 int vector;
617 int offset;
618 } pos[NR_CPUS] = { [ 0 ... NR_CPUS - 1] = {FIRST_DEVICE_VECTOR, 0} };
619 int old_vector = -1; 682 int old_vector = -1;
620 int cpu; 683 int cpu;
621 684
622 BUG_ON((unsigned)irq >= NR_IRQ_VECTORS); 685 BUG_ON((unsigned)irq >= NR_IRQ_VECTORS);
623 686
687 /* Only try and allocate irqs on cpus that are present */
688 cpus_and(mask, mask, cpu_online_map);
689
624 if (irq_vector[irq] > 0) 690 if (irq_vector[irq] > 0)
625 old_vector = irq_vector[irq]; 691 old_vector = irq_vector[irq];
626 if (old_vector > 0) { 692 if (old_vector > 0) {
@@ -630,15 +696,15 @@ static int __assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result)
630 } 696 }
631 697
632 for_each_cpu_mask(cpu, mask) { 698 for_each_cpu_mask(cpu, mask) {
633 cpumask_t domain; 699 cpumask_t domain, new_mask;
634 int first, new_cpu; 700 int new_cpu;
635 int vector, offset; 701 int vector, offset;
636 702
637 domain = vector_allocation_domain(cpu); 703 domain = vector_allocation_domain(cpu);
638 first = first_cpu(domain); 704 cpus_and(new_mask, domain, cpu_online_map);
639 705
640 vector = pos[first].vector; 706 vector = current_vector;
641 offset = pos[first].offset; 707 offset = current_offset;
642next: 708next:
643 vector += 8; 709 vector += 8;
644 if (vector >= FIRST_SYSTEM_VECTOR) { 710 if (vector >= FIRST_SYSTEM_VECTOR) {
@@ -646,24 +712,24 @@ next:
646 offset = (offset + 1) % 8; 712 offset = (offset + 1) % 8;
647 vector = FIRST_DEVICE_VECTOR + offset; 713 vector = FIRST_DEVICE_VECTOR + offset;
648 } 714 }
649 if (unlikely(pos[first].vector == vector)) 715 if (unlikely(current_vector == vector))
650 continue; 716 continue;
651 if (vector == IA32_SYSCALL_VECTOR) 717 if (vector == IA32_SYSCALL_VECTOR)
652 goto next; 718 goto next;
653 for_each_cpu_mask(new_cpu, domain) 719 for_each_cpu_mask(new_cpu, new_mask)
654 if (per_cpu(vector_irq, cpu)[vector] != -1) 720 if (per_cpu(vector_irq, new_cpu)[vector] != -1)
655 goto next; 721 goto next;
656 /* Found one! */ 722 /* Found one! */
657 for_each_cpu_mask(new_cpu, domain) { 723 current_vector = vector;
658 pos[cpu].vector = vector; 724 current_offset = offset;
659 pos[cpu].offset = offset;
660 }
661 if (old_vector >= 0) { 725 if (old_vector >= 0) {
726 cpumask_t old_mask;
662 int old_cpu; 727 int old_cpu;
663 for_each_cpu_mask(old_cpu, irq_domain[irq]) 728 cpus_and(old_mask, irq_domain[irq], cpu_online_map);
729 for_each_cpu_mask(old_cpu, old_mask)
664 per_cpu(vector_irq, old_cpu)[old_vector] = -1; 730 per_cpu(vector_irq, old_cpu)[old_vector] = -1;
665 } 731 }
666 for_each_cpu_mask(new_cpu, domain) 732 for_each_cpu_mask(new_cpu, new_mask)
667 per_cpu(vector_irq, new_cpu)[vector] = irq; 733 per_cpu(vector_irq, new_cpu)[vector] = irq;
668 irq_vector[irq] = vector; 734 irq_vector[irq] = vector;
669 irq_domain[irq] = domain; 735 irq_domain[irq] = domain;
@@ -684,6 +750,30 @@ static int assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result)
684 return vector; 750 return vector;
685} 751}
686 752
753void __setup_vector_irq(int cpu)
754{
755 /* Initialize vector_irq on a new cpu */
756 /* This function must be called with vector_lock held */
757 int irq, vector;
758
759 /* Mark the inuse vectors */
760 for (irq = 0; irq < NR_IRQ_VECTORS; ++irq) {
761 if (!cpu_isset(cpu, irq_domain[irq]))
762 continue;
763 vector = irq_vector[irq];
764 per_cpu(vector_irq, cpu)[vector] = irq;
765 }
766 /* Mark the free vectors */
767 for (vector = 0; vector < NR_VECTORS; ++vector) {
768 irq = per_cpu(vector_irq, cpu)[vector];
769 if (irq < 0)
770 continue;
771 if (!cpu_isset(cpu, irq_domain[irq]))
772 per_cpu(vector_irq, cpu)[vector] = -1;
773 }
774}
775
776
687extern void (*interrupt[NR_IRQS])(void); 777extern void (*interrupt[NR_IRQS])(void);
688 778
689static struct irq_chip ioapic_chip; 779static struct irq_chip ioapic_chip;
@@ -696,11 +786,13 @@ static void ioapic_register_intr(int irq, int vector, unsigned long trigger)
696{ 786{
697 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) || 787 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
698 trigger == IOAPIC_LEVEL) 788 trigger == IOAPIC_LEVEL)
699 set_irq_chip_and_handler(irq, &ioapic_chip, 789 set_irq_chip_and_handler_name(irq, &ioapic_chip,
700 handle_fasteoi_irq); 790 handle_fasteoi_irq, "fasteoi");
701 else 791 else {
702 set_irq_chip_and_handler(irq, &ioapic_chip, 792 irq_desc[irq].status |= IRQ_DELAYED_DISABLE;
703 handle_edge_irq); 793 set_irq_chip_and_handler_name(irq, &ioapic_chip,
794 handle_edge_irq, "edge");
795 }
704} 796}
705 797
706static void __init setup_IO_APIC_irqs(void) 798static void __init setup_IO_APIC_irqs(void)
@@ -806,7 +898,7 @@ static void __init setup_ExtINT_IRQ0_pin(unsigned int apic, unsigned int pin, in
806 * The timer IRQ doesn't have to know that behind the 898 * The timer IRQ doesn't have to know that behind the
807 * scene we have a 8259A-master in AEOI mode ... 899 * scene we have a 8259A-master in AEOI mode ...
808 */ 900 */
809 set_irq_chip_and_handler(0, &ioapic_chip, handle_edge_irq); 901 set_irq_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq, "edge");
810 902
811 /* 903 /*
812 * Add it to the IO-APIC irq-routing table: 904 * Add it to the IO-APIC irq-routing table:
@@ -1255,12 +1347,15 @@ static int ioapic_retrigger_irq(unsigned int irq)
1255{ 1347{
1256 cpumask_t mask; 1348 cpumask_t mask;
1257 unsigned vector; 1349 unsigned vector;
1350 unsigned long flags;
1258 1351
1352 spin_lock_irqsave(&vector_lock, flags);
1259 vector = irq_vector[irq]; 1353 vector = irq_vector[irq];
1260 cpus_clear(mask); 1354 cpus_clear(mask);
1261 cpu_set(vector >> 8, mask); 1355 cpu_set(first_cpu(irq_domain[irq]), mask);
1262 1356
1263 send_IPI_mask(mask, vector & 0xff); 1357 send_IPI_mask(mask, vector);
1358 spin_unlock_irqrestore(&vector_lock, flags);
1264 1359
1265 return 1; 1360 return 1;
1266} 1361}
@@ -1839,7 +1934,7 @@ int arch_setup_msi_irq(unsigned int irq, struct pci_dev *dev)
1839 1934
1840 write_msi_msg(irq, &msg); 1935 write_msi_msg(irq, &msg);
1841 1936
1842 set_irq_chip_and_handler(irq, &msi_chip, handle_edge_irq); 1937 set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq, "edge");
1843 1938
1844 return 0; 1939 return 0;
1845} 1940}
@@ -1860,18 +1955,16 @@ void arch_teardown_msi_irq(unsigned int irq)
1860 1955
1861static void target_ht_irq(unsigned int irq, unsigned int dest, u8 vector) 1956static void target_ht_irq(unsigned int irq, unsigned int dest, u8 vector)
1862{ 1957{
1863 u32 low, high; 1958 struct ht_irq_msg msg;
1864 low = read_ht_irq_low(irq); 1959 fetch_ht_irq_msg(irq, &msg);
1865 high = read_ht_irq_high(irq);
1866 1960
1867 low &= ~(HT_IRQ_LOW_VECTOR_MASK | HT_IRQ_LOW_DEST_ID_MASK); 1961 msg.address_lo &= ~(HT_IRQ_LOW_VECTOR_MASK | HT_IRQ_LOW_DEST_ID_MASK);
1868 high &= ~(HT_IRQ_HIGH_DEST_ID_MASK); 1962 msg.address_hi &= ~(HT_IRQ_HIGH_DEST_ID_MASK);
1869 1963
1870 low |= HT_IRQ_LOW_VECTOR(vector) | HT_IRQ_LOW_DEST_ID(dest); 1964 msg.address_lo |= HT_IRQ_LOW_VECTOR(vector) | HT_IRQ_LOW_DEST_ID(dest);
1871 high |= HT_IRQ_HIGH_DEST_ID(dest); 1965 msg.address_hi |= HT_IRQ_HIGH_DEST_ID(dest);
1872 1966
1873 write_ht_irq_low(irq, low); 1967 write_ht_irq_msg(irq, &msg);
1874 write_ht_irq_high(irq, high);
1875} 1968}
1876 1969
1877static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask) 1970static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask)
@@ -1892,7 +1985,7 @@ static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask)
1892 1985
1893 dest = cpu_mask_to_apicid(tmp); 1986 dest = cpu_mask_to_apicid(tmp);
1894 1987
1895 target_ht_irq(irq, dest, vector & 0xff); 1988 target_ht_irq(irq, dest, vector);
1896 set_native_irq_info(irq, mask); 1989 set_native_irq_info(irq, mask);
1897} 1990}
1898#endif 1991#endif
@@ -1915,14 +2008,15 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
1915 2008
1916 vector = assign_irq_vector(irq, TARGET_CPUS, &tmp); 2009 vector = assign_irq_vector(irq, TARGET_CPUS, &tmp);
1917 if (vector >= 0) { 2010 if (vector >= 0) {
1918 u32 low, high; 2011 struct ht_irq_msg msg;
1919 unsigned dest; 2012 unsigned dest;
1920 2013
1921 dest = cpu_mask_to_apicid(tmp); 2014 dest = cpu_mask_to_apicid(tmp);
1922 2015
1923 high = HT_IRQ_HIGH_DEST_ID(dest); 2016 msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest);
1924 2017
1925 low = HT_IRQ_LOW_BASE | 2018 msg.address_lo =
2019 HT_IRQ_LOW_BASE |
1926 HT_IRQ_LOW_DEST_ID(dest) | 2020 HT_IRQ_LOW_DEST_ID(dest) |
1927 HT_IRQ_LOW_VECTOR(vector) | 2021 HT_IRQ_LOW_VECTOR(vector) |
1928 ((INT_DEST_MODE == 0) ? 2022 ((INT_DEST_MODE == 0) ?
@@ -1931,12 +2025,13 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
1931 HT_IRQ_LOW_RQEOI_EDGE | 2025 HT_IRQ_LOW_RQEOI_EDGE |
1932 ((INT_DELIVERY_MODE != dest_LowestPrio) ? 2026 ((INT_DELIVERY_MODE != dest_LowestPrio) ?
1933 HT_IRQ_LOW_MT_FIXED : 2027 HT_IRQ_LOW_MT_FIXED :
1934 HT_IRQ_LOW_MT_ARBITRATED); 2028 HT_IRQ_LOW_MT_ARBITRATED) |
2029 HT_IRQ_LOW_IRQ_MASKED;
1935 2030
1936 write_ht_irq_low(irq, low); 2031 write_ht_irq_msg(irq, &msg);
1937 write_ht_irq_high(irq, high);
1938 2032
1939 set_irq_chip_and_handler(irq, &ht_irq_chip, handle_edge_irq); 2033 set_irq_chip_and_handler_name(irq, &ht_irq_chip,
2034 handle_edge_irq, "edge");
1940 } 2035 }
1941 return vector; 2036 return vector;
1942} 2037}
diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c
index dff68eb2b78..e46c55856d4 100644
--- a/arch/x86_64/kernel/irq.c
+++ b/arch/x86_64/kernel/irq.c
@@ -75,7 +75,7 @@ int show_interrupts(struct seq_file *p, void *v)
75 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 75 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
76#endif 76#endif
77 seq_printf(p, " %8s", irq_desc[i].chip->name); 77 seq_printf(p, " %8s", irq_desc[i].chip->name);
78 seq_printf(p, "-%s", handle_irq_name(irq_desc[i].handle_irq)); 78 seq_printf(p, "-%-8s", irq_desc[i].name);
79 79
80 seq_printf(p, " %s", action->name); 80 seq_printf(p, " %s", action->name);
81 for (action=action->next; action; action = action->next) 81 for (action=action->next; action; action = action->next)
diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86_64/kernel/pci-calgary.c
index b3296cc2f2f..37a770859e7 100644
--- a/arch/x86_64/kernel/pci-calgary.c
+++ b/arch/x86_64/kernel/pci-calgary.c
@@ -52,7 +52,8 @@
52#define ONE_BASED_CHASSIS_NUM 1 52#define ONE_BASED_CHASSIS_NUM 1
53 53
54/* register offsets inside the host bridge space */ 54/* register offsets inside the host bridge space */
55#define PHB_CSR_OFFSET 0x0110 55#define CALGARY_CONFIG_REG 0x0108
56#define PHB_CSR_OFFSET 0x0110 /* Channel Status */
56#define PHB_PLSSR_OFFSET 0x0120 57#define PHB_PLSSR_OFFSET 0x0120
57#define PHB_CONFIG_RW_OFFSET 0x0160 58#define PHB_CONFIG_RW_OFFSET 0x0160
58#define PHB_IOBASE_BAR_LOW 0x0170 59#define PHB_IOBASE_BAR_LOW 0x0170
@@ -83,6 +84,8 @@
83#define TAR_VALID 0x0000000000000008UL 84#define TAR_VALID 0x0000000000000008UL
84/* CSR (Channel/DMA Status Register) */ 85/* CSR (Channel/DMA Status Register) */
85#define CSR_AGENT_MASK 0xffe0ffff 86#define CSR_AGENT_MASK 0xffe0ffff
87/* CCR (Calgary Configuration Register) */
88#define CCR_2SEC_TIMEOUT 0x000000000000000EUL
86 89
87#define MAX_NUM_OF_PHBS 8 /* how many PHBs in total? */ 90#define MAX_NUM_OF_PHBS 8 /* how many PHBs in total? */
88#define MAX_NUM_CHASSIS 8 /* max number of chassis */ 91#define MAX_NUM_CHASSIS 8 /* max number of chassis */
@@ -732,6 +735,38 @@ static void calgary_watchdog(unsigned long data)
732 } 735 }
733} 736}
734 737
738static void __init calgary_increase_split_completion_timeout(void __iomem *bbar,
739 unsigned char busnum)
740{
741 u64 val64;
742 void __iomem *target;
743 unsigned long phb_shift = -1;
744 u64 mask;
745
746 switch (busno_to_phbid(busnum)) {
747 case 0: phb_shift = (63 - 19);
748 break;
749 case 1: phb_shift = (63 - 23);
750 break;
751 case 2: phb_shift = (63 - 27);
752 break;
753 case 3: phb_shift = (63 - 35);
754 break;
755 default:
756 BUG_ON(busno_to_phbid(busnum));
757 }
758
759 target = calgary_reg(bbar, CALGARY_CONFIG_REG);
760 val64 = be64_to_cpu(readq(target));
761
762 /* zero out this PHB's timer bits */
763 mask = ~(0xFUL << phb_shift);
764 val64 &= mask;
765 val64 |= (CCR_2SEC_TIMEOUT << phb_shift);
766 writeq(cpu_to_be64(val64), target);
767 readq(target); /* flush */
768}
769
735static void __init calgary_enable_translation(struct pci_dev *dev) 770static void __init calgary_enable_translation(struct pci_dev *dev)
736{ 771{
737 u32 val32; 772 u32 val32;
@@ -756,6 +791,13 @@ static void __init calgary_enable_translation(struct pci_dev *dev)
756 writel(cpu_to_be32(val32), target); 791 writel(cpu_to_be32(val32), target);
757 readl(target); /* flush */ 792 readl(target); /* flush */
758 793
794 /*
795 * Give split completion a longer timeout on bus 1 for aic94xx
796 * http://bugzilla.kernel.org/show_bug.cgi?id=7180
797 */
798 if (busnum == 1)
799 calgary_increase_split_completion_timeout(bbar, busnum);
800
759 init_timer(&tbl->watchdog_timer); 801 init_timer(&tbl->watchdog_timer);
760 tbl->watchdog_timer.function = &calgary_watchdog; 802 tbl->watchdog_timer.function = &calgary_watchdog;
761 tbl->watchdog_timer.data = (unsigned long)dev; 803 tbl->watchdog_timer.data = (unsigned long)dev;
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 49f7fac6229..7451a4c43c1 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -88,9 +88,8 @@ void enter_idle(void)
88 88
89static void __exit_idle(void) 89static void __exit_idle(void)
90{ 90{
91 if (read_pda(isidle) == 0) 91 if (test_and_clear_bit_pda(0, isidle) == 0)
92 return; 92 return;
93 write_pda(isidle, 0);
94 atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL); 93 atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL);
95} 94}
96 95
@@ -145,7 +144,7 @@ static void poll_idle (void)
145void cpu_idle_wait(void) 144void cpu_idle_wait(void)
146{ 145{
147 unsigned int cpu, this_cpu = get_cpu(); 146 unsigned int cpu, this_cpu = get_cpu();
148 cpumask_t map; 147 cpumask_t map, tmp = current->cpus_allowed;
149 148
150 set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); 149 set_cpus_allowed(current, cpumask_of_cpu(this_cpu));
151 put_cpu(); 150 put_cpu();
@@ -168,6 +167,8 @@ void cpu_idle_wait(void)
168 } 167 }
169 cpus_and(map, map, cpu_online_map); 168 cpus_and(map, map, cpu_online_map);
170 } while (!cpus_empty(map)); 169 } while (!cpus_empty(map));
170
171 set_cpus_allowed(current, tmp);
171} 172}
172EXPORT_SYMBOL_GPL(cpu_idle_wait); 173EXPORT_SYMBOL_GPL(cpu_idle_wait);
173 174
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
index 4f67697f503..9f74c883568 100644
--- a/arch/x86_64/kernel/smp.c
+++ b/arch/x86_64/kernel/smp.c
@@ -376,9 +376,8 @@ int smp_call_function_single (int cpu, void (*func) (void *info), void *info,
376 /* prevent preemption and reschedule on another processor */ 376 /* prevent preemption and reschedule on another processor */
377 int me = get_cpu(); 377 int me = get_cpu();
378 if (cpu == me) { 378 if (cpu == me) {
379 WARN_ON(1);
380 put_cpu(); 379 put_cpu();
381 return -EBUSY; 380 return 0;
382 } 381 }
383 spin_lock_bh(&call_lock); 382 spin_lock_bh(&call_lock);
384 __smp_call_function_single(cpu, func, info, nonatomic, wait); 383 __smp_call_function_single(cpu, func, info, nonatomic, wait);
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 7b7a6870288..62c2e747af5 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -581,12 +581,16 @@ void __cpuinit start_secondary(void)
581 * smp_call_function(). 581 * smp_call_function().
582 */ 582 */
583 lock_ipi_call_lock(); 583 lock_ipi_call_lock();
584 spin_lock(&vector_lock);
584 585
586 /* Setup the per cpu irq handling data structures */
587 __setup_vector_irq(smp_processor_id());
585 /* 588 /*
586 * Allow the master to continue. 589 * Allow the master to continue.
587 */ 590 */
588 cpu_set(smp_processor_id(), cpu_online_map); 591 cpu_set(smp_processor_id(), cpu_online_map);
589 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; 592 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
593 spin_unlock(&vector_lock);
590 unlock_ipi_call_lock(); 594 unlock_ipi_call_lock();
591 595
592 cpu_idle(); 596 cpu_idle();
@@ -799,7 +803,6 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)
799 cpu, node); 803 cpu, node);
800 } 804 }
801 805
802
803 alternatives_smp_switch(1); 806 alternatives_smp_switch(1);
804 807
805 c_idle.idle = get_idle_for_cpu(cpu); 808 c_idle.idle = get_idle_for_cpu(cpu);
@@ -1246,8 +1249,10 @@ int __cpu_disable(void)
1246 local_irq_disable(); 1249 local_irq_disable();
1247 remove_siblinginfo(cpu); 1250 remove_siblinginfo(cpu);
1248 1251
1252 spin_lock(&vector_lock);
1249 /* It's now safe to remove this processor from the online map */ 1253 /* It's now safe to remove this processor from the online map */
1250 cpu_clear(cpu, cpu_online_map); 1254 cpu_clear(cpu, cpu_online_map);
1255 spin_unlock(&vector_lock);
1251 remove_cpu_from_maps(); 1256 remove_cpu_from_maps();
1252 fixup_irqs(cpu_online_map); 1257 fixup_irqs(cpu_online_map);
1253 return 0; 1258 return 0;
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 1ba5a442ac3..e3ef544d2cf 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -876,15 +876,6 @@ static struct irqaction irq0 = {
876 timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "timer", NULL, NULL 876 timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "timer", NULL, NULL
877}; 877};
878 878
879static int __cpuinit
880time_cpu_notifier(struct notifier_block *nb, unsigned long action, void *hcpu)
881{
882 unsigned cpu = (unsigned long) hcpu;
883 if (action == CPU_ONLINE)
884 vsyscall_set_cpu(cpu);
885 return NOTIFY_DONE;
886}
887
888void __init time_init(void) 879void __init time_init(void)
889{ 880{
890 if (nohpet) 881 if (nohpet)
@@ -925,8 +916,6 @@ void __init time_init(void)
925 vxtime.last_tsc = get_cycles_sync(); 916 vxtime.last_tsc = get_cycles_sync();
926 set_cyc2ns_scale(cpu_khz); 917 set_cyc2ns_scale(cpu_khz);
927 setup_irq(0, &irq0); 918 setup_irq(0, &irq0);
928 hotcpu_notifier(time_cpu_notifier, 0);
929 time_cpu_notifier(NULL, CPU_ONLINE, (void *)(long)smp_processor_id());
930 919
931#ifndef CONFIG_SMP 920#ifndef CONFIG_SMP
932 time_init_gtod(); 921 time_init_gtod();
@@ -948,7 +937,7 @@ __cpuinit int unsynchronized_tsc(void)
948 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) { 937 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
949#ifdef CONFIG_ACPI 938#ifdef CONFIG_ACPI
950 /* But TSC doesn't tick in C3 so don't use it there */ 939 /* But TSC doesn't tick in C3 so don't use it there */
951 if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 100) 940 if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 1000)
952 return 1; 941 return 1;
953#endif 942#endif
954 return 0; 943 return 0;
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 7819022a8db..0d65b22f229 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -242,12 +242,19 @@ static int dump_trace_unwind(struct unwind_frame_info *info, void *context)
242 * severe exception (double fault, nmi, stack fault, debug, mce) hardware stack 242 * severe exception (double fault, nmi, stack fault, debug, mce) hardware stack
243 */ 243 */
244 244
245static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
246{
247 void *t = (void *)tinfo;
248 return p > t && p < t + THREAD_SIZE - 3;
249}
250
245void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * stack, 251void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * stack,
246 struct stacktrace_ops *ops, void *data) 252 struct stacktrace_ops *ops, void *data)
247{ 253{
248 const unsigned cpu = smp_processor_id(); 254 const unsigned cpu = smp_processor_id();
249 unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr; 255 unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr;
250 unsigned used = 0; 256 unsigned used = 0;
257 struct thread_info *tinfo;
251 258
252 if (!tsk) 259 if (!tsk)
253 tsk = current; 260 tsk = current;
@@ -290,6 +297,12 @@ void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
290 if (tsk && tsk != current) 297 if (tsk && tsk != current)
291 stack = (unsigned long *)tsk->thread.rsp; 298 stack = (unsigned long *)tsk->thread.rsp;
292 } 299 }
300 /*
301 * Align the stack pointer on word boundary, later loops
302 * rely on that (and corruption / debug info bugs can cause
303 * unaligned values here):
304 */
305 stack = (unsigned long *)((unsigned long)stack & ~(sizeof(long)-1));
293 306
294 /* 307 /*
295 * Print function call entries within a stack. 'cond' is the 308 * Print function call entries within a stack. 'cond' is the
@@ -364,7 +377,8 @@ void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
364 /* 377 /*
365 * This handles the process stack: 378 * This handles the process stack:
366 */ 379 */
367 HANDLE_STACK (((long) stack & (THREAD_SIZE-1)) != 0); 380 tinfo = current_thread_info();
381 HANDLE_STACK (valid_stack_ptr(tinfo, stack));
368#undef HANDLE_STACK 382#undef HANDLE_STACK
369} 383}
370EXPORT_SYMBOL(dump_trace); 384EXPORT_SYMBOL(dump_trace);
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
index b9df2ab6529..d9534e750d4 100644
--- a/arch/x86_64/kernel/vmlinux.lds.S
+++ b/arch/x86_64/kernel/vmlinux.lds.S
@@ -17,6 +17,7 @@ PHDRS {
17 text PT_LOAD FLAGS(5); /* R_E */ 17 text PT_LOAD FLAGS(5); /* R_E */
18 data PT_LOAD FLAGS(7); /* RWE */ 18 data PT_LOAD FLAGS(7); /* RWE */
19 user PT_LOAD FLAGS(7); /* RWE */ 19 user PT_LOAD FLAGS(7); /* RWE */
20 data.init PT_LOAD FLAGS(7); /* RWE */
20 note PT_NOTE FLAGS(4); /* R__ */ 21 note PT_NOTE FLAGS(4); /* R__ */
21} 22}
22SECTIONS 23SECTIONS
@@ -59,6 +60,7 @@ SECTIONS
59 } 60 }
60#endif 61#endif
61 62
63 . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */
62 /* Data */ 64 /* Data */
63 .data : AT(ADDR(.data) - LOAD_OFFSET) { 65 .data : AT(ADDR(.data) - LOAD_OFFSET) {
64 *(.data) 66 *(.data)
@@ -131,7 +133,7 @@ SECTIONS
131 . = ALIGN(8192); /* init_task */ 133 . = ALIGN(8192); /* init_task */
132 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) { 134 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
133 *(.data.init_task) 135 *(.data.init_task)
134 } :data 136 }:data.init
135 137
136 . = ALIGN(4096); 138 . = ALIGN(4096);
137 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { 139 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
@@ -174,13 +176,7 @@ SECTIONS
174 __setup_end = .; 176 __setup_end = .;
175 __initcall_start = .; 177 __initcall_start = .;
176 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) { 178 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
177 *(.initcall1.init) 179 INITCALLS
178 *(.initcall2.init)
179 *(.initcall3.init)
180 *(.initcall4.init)
181 *(.initcall5.init)
182 *(.initcall6.init)
183 *(.initcall7.init)
184 } 180 }
185 __initcall_end = .; 181 __initcall_end = .;
186 __con_initcall_start = .; 182 __con_initcall_start = .;
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c
index a98b460af6a..92546c1526f 100644
--- a/arch/x86_64/kernel/vsyscall.c
+++ b/arch/x86_64/kernel/vsyscall.c
@@ -27,6 +27,9 @@
27#include <linux/jiffies.h> 27#include <linux/jiffies.h>
28#include <linux/sysctl.h> 28#include <linux/sysctl.h>
29#include <linux/getcpu.h> 29#include <linux/getcpu.h>
30#include <linux/cpu.h>
31#include <linux/smp.h>
32#include <linux/notifier.h>
30 33
31#include <asm/vsyscall.h> 34#include <asm/vsyscall.h>
32#include <asm/pgtable.h> 35#include <asm/pgtable.h>
@@ -243,32 +246,17 @@ static ctl_table kernel_root_table2[] = {
243 246
244#endif 247#endif
245 248
246static void __cpuinit write_rdtscp_cb(void *info) 249/* Assume __initcall executes before all user space. Hopefully kmod
247{ 250 doesn't violate that. We'll find out if it does. */
248 write_rdtscp_aux((unsigned long)info); 251static void __cpuinit vsyscall_set_cpu(int cpu)
249}
250
251void __cpuinit vsyscall_set_cpu(int cpu)
252{ 252{
253 unsigned long *d; 253 unsigned long *d;
254 unsigned long node = 0; 254 unsigned long node = 0;
255#ifdef CONFIG_NUMA 255#ifdef CONFIG_NUMA
256 node = cpu_to_node[cpu]; 256 node = cpu_to_node[cpu];
257#endif 257#endif
258 if (cpu_has(&cpu_data[cpu], X86_FEATURE_RDTSCP)) { 258 if (cpu_has(&cpu_data[cpu], X86_FEATURE_RDTSCP))
259 void *info = (void *)((node << 12) | cpu); 259 write_rdtscp_aux((node << 12) | cpu);
260 /* Can happen on preemptive kernel */
261 if (get_cpu() == cpu)
262 write_rdtscp_cb(info);
263#ifdef CONFIG_SMP
264 else {
265 /* the notifier is unfortunately not executed on the
266 target CPU */
267 smp_call_function_single(cpu,write_rdtscp_cb,info,0,1);
268 }
269#endif
270 put_cpu();
271 }
272 260
273 /* Store cpu number in limit so that it can be loaded quickly 261 /* Store cpu number in limit so that it can be loaded quickly
274 in user space in vgetcpu. 262 in user space in vgetcpu.
@@ -280,6 +268,23 @@ void __cpuinit vsyscall_set_cpu(int cpu)
280 *d |= (node >> 4) << 48; 268 *d |= (node >> 4) << 48;
281} 269}
282 270
271static void __cpuinit cpu_vsyscall_init(void *arg)
272{
273 /* preemption should be already off */
274 vsyscall_set_cpu(raw_smp_processor_id());
275}
276
277#ifdef CONFIG_HOTPLUG_CPU
278static int __cpuinit
279cpu_vsyscall_notifier(struct notifier_block *n, unsigned long action, void *arg)
280{
281 long cpu = (long)arg;
282 if (action == CPU_ONLINE)
283 smp_call_function_single(cpu, cpu_vsyscall_init, NULL, 0, 1);
284 return NOTIFY_DONE;
285}
286#endif
287
283static void __init map_vsyscall(void) 288static void __init map_vsyscall(void)
284{ 289{
285 extern char __vsyscall_0; 290 extern char __vsyscall_0;
@@ -299,6 +304,8 @@ static int __init vsyscall_init(void)
299#ifdef CONFIG_SYSCTL 304#ifdef CONFIG_SYSCTL
300 register_sysctl_table(kernel_root_table2, 0); 305 register_sysctl_table(kernel_root_table2, 0);
301#endif 306#endif
307 on_each_cpu(cpu_vsyscall_init, NULL, 0, 1);
308 hotcpu_notifier(cpu_vsyscall_notifier, 0);
302 return 0; 309 return 0;
303} 310}
304 311
diff --git a/arch/x86_64/lib/csum-partial.c b/arch/x86_64/lib/csum-partial.c
index c493735218d..06ae630de82 100644
--- a/arch/x86_64/lib/csum-partial.c
+++ b/arch/x86_64/lib/csum-partial.c
@@ -132,9 +132,10 @@ static __force_inline unsigned do_csum(const unsigned char *buff, unsigned len)
132 * 132 *
133 * it's best to have buff aligned on a 64-bit boundary 133 * it's best to have buff aligned on a 64-bit boundary
134 */ 134 */
135unsigned csum_partial(const unsigned char *buff, unsigned len, unsigned sum) 135__wsum csum_partial(const void *buff, int len, __wsum sum)
136{ 136{
137 return add32_with_carry(do_csum(buff, len), sum); 137 return (__force __wsum)add32_with_carry(do_csum(buff, len),
138 (__force u32)sum);
138} 139}
139 140
140EXPORT_SYMBOL(csum_partial); 141EXPORT_SYMBOL(csum_partial);
@@ -143,7 +144,7 @@ EXPORT_SYMBOL(csum_partial);
143 * this routine is used for miscellaneous IP-like checksums, mainly 144 * this routine is used for miscellaneous IP-like checksums, mainly
144 * in icmp.c 145 * in icmp.c
145 */ 146 */
146unsigned short ip_compute_csum(unsigned char * buff, int len) 147__sum16 ip_compute_csum(const void *buff, int len)
147{ 148{
148 return csum_fold(csum_partial(buff,len,0)); 149 return csum_fold(csum_partial(buff,len,0));
149} 150}
diff --git a/arch/x86_64/lib/csum-wrappers.c b/arch/x86_64/lib/csum-wrappers.c
index b1320ec5842..fd42a4a095f 100644
--- a/arch/x86_64/lib/csum-wrappers.c
+++ b/arch/x86_64/lib/csum-wrappers.c
@@ -18,9 +18,9 @@
18 * Returns an 32bit unfolded checksum of the buffer. 18 * Returns an 32bit unfolded checksum of the buffer.
19 * src and dst are best aligned to 64bits. 19 * src and dst are best aligned to 64bits.
20 */ 20 */
21unsigned int 21__wsum
22csum_partial_copy_from_user(const unsigned char __user *src, unsigned char *dst, 22csum_partial_copy_from_user(const void __user *src, void *dst,
23 int len, unsigned int isum, int *errp) 23 int len, __wsum isum, int *errp)
24{ 24{
25 might_sleep(); 25 might_sleep();
26 *errp = 0; 26 *errp = 0;
@@ -34,17 +34,19 @@ csum_partial_copy_from_user(const unsigned char __user *src, unsigned char *dst,
34 if (unlikely((unsigned long)src & 6)) { 34 if (unlikely((unsigned long)src & 6)) {
35 while (((unsigned long)src & 6) && len >= 2) { 35 while (((unsigned long)src & 6) && len >= 2) {
36 __u16 val16; 36 __u16 val16;
37 *errp = __get_user(val16, (__u16 __user *)src); 37 *errp = __get_user(val16, (const __u16 __user *)src);
38 if (*errp) 38 if (*errp)
39 return isum; 39 return isum;
40 *(__u16 *)dst = val16; 40 *(__u16 *)dst = val16;
41 isum = add32_with_carry(isum, val16); 41 isum = (__force __wsum)add32_with_carry(
42 (__force unsigned)isum, val16);
42 src += 2; 43 src += 2;
43 dst += 2; 44 dst += 2;
44 len -= 2; 45 len -= 2;
45 } 46 }
46 } 47 }
47 isum = csum_partial_copy_generic((__force void *)src,dst,len,isum,errp,NULL); 48 isum = csum_partial_copy_generic((__force const void *)src,
49 dst, len, isum, errp, NULL);
48 if (likely(*errp == 0)) 50 if (likely(*errp == 0))
49 return isum; 51 return isum;
50 } 52 }
@@ -66,9 +68,9 @@ EXPORT_SYMBOL(csum_partial_copy_from_user);
66 * Returns an 32bit unfolded checksum of the buffer. 68 * Returns an 32bit unfolded checksum of the buffer.
67 * src and dst are best aligned to 64bits. 69 * src and dst are best aligned to 64bits.
68 */ 70 */
69unsigned int 71__wsum
70csum_partial_copy_to_user(unsigned const char *src, unsigned char __user *dst, 72csum_partial_copy_to_user(const void *src, void __user *dst,
71 int len, unsigned int isum, int *errp) 73 int len, __wsum isum, int *errp)
72{ 74{
73 might_sleep(); 75 might_sleep();
74 if (unlikely(!access_ok(VERIFY_WRITE, dst, len))) { 76 if (unlikely(!access_ok(VERIFY_WRITE, dst, len))) {
@@ -79,7 +81,8 @@ csum_partial_copy_to_user(unsigned const char *src, unsigned char __user *dst,
79 if (unlikely((unsigned long)dst & 6)) { 81 if (unlikely((unsigned long)dst & 6)) {
80 while (((unsigned long)dst & 6) && len >= 2) { 82 while (((unsigned long)dst & 6) && len >= 2) {
81 __u16 val16 = *(__u16 *)src; 83 __u16 val16 = *(__u16 *)src;
82 isum = add32_with_carry(isum, val16); 84 isum = (__force __wsum)add32_with_carry(
85 (__force unsigned)isum, val16);
83 *errp = __put_user(val16, (__u16 __user *)dst); 86 *errp = __put_user(val16, (__u16 __user *)dst);
84 if (*errp) 87 if (*errp)
85 return isum; 88 return isum;
@@ -104,19 +107,21 @@ EXPORT_SYMBOL(csum_partial_copy_to_user);
104 * 107 *
105 * Returns an 32bit unfolded checksum of the buffer. 108 * Returns an 32bit unfolded checksum of the buffer.
106 */ 109 */
107unsigned int 110__wsum
108csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, int len, unsigned int sum) 111csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
109{ 112{
110 return csum_partial_copy_generic(src,dst,len,sum,NULL,NULL); 113 return csum_partial_copy_generic(src,dst,len,sum,NULL,NULL);
111} 114}
112EXPORT_SYMBOL(csum_partial_copy_nocheck); 115EXPORT_SYMBOL(csum_partial_copy_nocheck);
113 116
114unsigned short csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, 117__sum16 csum_ipv6_magic(const struct in6_addr *saddr,
115 __u32 len, unsigned short proto, unsigned int sum) 118 const struct in6_addr *daddr,
119 __u32 len, unsigned short proto, __wsum sum)
116{ 120{
117 __u64 rest, sum64; 121 __u64 rest, sum64;
118 122
119 rest = (__u64)htonl(len) + (__u64)htons(proto) + (__u64)sum; 123 rest = (__force __u64)htonl(len) + (__force __u64)htons(proto) +
124 (__force __u64)sum;
120 asm(" addq (%[saddr]),%[sum]\n" 125 asm(" addq (%[saddr]),%[sum]\n"
121 " adcq 8(%[saddr]),%[sum]\n" 126 " adcq 8(%[saddr]),%[sum]\n"
122 " adcq (%[daddr]),%[sum]\n" 127 " adcq (%[daddr]),%[sum]\n"
@@ -124,7 +129,7 @@ unsigned short csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr,
124 " adcq $0,%[sum]\n" 129 " adcq $0,%[sum]\n"
125 : [sum] "=r" (sum64) 130 : [sum] "=r" (sum64)
126 : "[sum]" (rest),[saddr] "r" (saddr), [daddr] "r" (daddr)); 131 : "[sum]" (rest),[saddr] "r" (saddr), [daddr] "r" (daddr));
127 return csum_fold(add32_with_carry(sum64 & 0xffffffff, sum64>>32)); 132 return csum_fold((__force __wsum)add32_with_carry(sum64 & 0xffffffff, sum64>>32));
128} 133}
129 134
130EXPORT_SYMBOL(csum_ipv6_magic); 135EXPORT_SYMBOL(csum_ipv6_magic);
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index 971dc1181e6..4c0c00ef3ca 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -496,7 +496,7 @@ int remove_memory(u64 start, u64 size)
496} 496}
497EXPORT_SYMBOL_GPL(remove_memory); 497EXPORT_SYMBOL_GPL(remove_memory);
498 498
499#ifndef CONFIG_ACPI_NUMA 499#if !defined(CONFIG_ACPI_NUMA) && defined(CONFIG_NUMA)
500int memory_add_physaddr_to_nid(u64 start) 500int memory_add_physaddr_to_nid(u64 start)
501{ 501{
502 return 0; 502 return 0;
@@ -504,13 +504,6 @@ int memory_add_physaddr_to_nid(u64 start)
504EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); 504EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
505#endif 505#endif
506 506
507#ifndef CONFIG_ACPI_NUMA
508int memory_add_physaddr_to_nid(u64 start)
509{
510 return 0;
511}
512#endif
513
514#endif /* CONFIG_MEMORY_HOTPLUG */ 507#endif /* CONFIG_MEMORY_HOTPLUG */
515 508
516#ifdef CONFIG_MEMORY_HOTPLUG_RESERVE 509#ifdef CONFIG_MEMORY_HOTPLUG_RESERVE
@@ -655,9 +648,22 @@ void free_initrd_mem(unsigned long start, unsigned long end)
655 648
656void __init reserve_bootmem_generic(unsigned long phys, unsigned len) 649void __init reserve_bootmem_generic(unsigned long phys, unsigned len)
657{ 650{
658 /* Should check here against the e820 map to avoid double free */
659#ifdef CONFIG_NUMA 651#ifdef CONFIG_NUMA
660 int nid = phys_to_nid(phys); 652 int nid = phys_to_nid(phys);
653#endif
654 unsigned long pfn = phys >> PAGE_SHIFT;
655 if (pfn >= end_pfn) {
656 /* This can happen with kdump kernels when accessing firmware
657 tables. */
658 if (pfn < end_pfn_map)
659 return;
660 printk(KERN_ERR "reserve_bootmem: illegal reserve %lx %u\n",
661 phys, len);
662 return;
663 }
664
665 /* Should check here against the e820 map to avoid double free */
666#ifdef CONFIG_NUMA
661 reserve_bootmem_node(NODE_DATA(nid), phys, len); 667 reserve_bootmem_node(NODE_DATA(nid), phys, len);
662#else 668#else
663 reserve_bootmem(phys, len); 669 reserve_bootmem(phys, len);
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index 3cc0544e25f..1087e150a21 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -207,7 +207,7 @@ static inline int save_add_info(void)
207 return hotadd_percent > 0; 207 return hotadd_percent > 0;
208} 208}
209#else 209#else
210int update_end_of_memory(unsigned long end) {return 0;} 210int update_end_of_memory(unsigned long end) {return -1;}
211static int hotadd_enough_memory(struct bootnode *nd) {return 1;} 211static int hotadd_enough_memory(struct bootnode *nd) {return 1;}
212#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE 212#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
213static inline int save_add_info(void) {return 1;} 213static inline int save_add_info(void) {return 1;}
@@ -337,7 +337,7 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
337 push_node_boundaries(node, nd->start >> PAGE_SHIFT, 337 push_node_boundaries(node, nd->start >> PAGE_SHIFT,
338 nd->end >> PAGE_SHIFT); 338 nd->end >> PAGE_SHIFT);
339 339
340 if (ma->flags.hot_pluggable && !reserve_hotadd(node, start, end) < 0) { 340 if (ma->flags.hot_pluggable && (reserve_hotadd(node, start, end) < 0)) {
341 /* Ignore hotadd region. Undo damage */ 341 /* Ignore hotadd region. Undo damage */
342 printk(KERN_NOTICE "SRAT: Hotplug region ignored\n"); 342 printk(KERN_NOTICE "SRAT: Hotplug region ignored\n");
343 *nd = oldnode; 343 *nd = oldnode;
diff --git a/arch/x86_64/pci/Makefile b/arch/x86_64/pci/Makefile
index 1eb18f421ed..149aba05a5b 100644
--- a/arch/x86_64/pci/Makefile
+++ b/arch/x86_64/pci/Makefile
@@ -3,7 +3,7 @@
3# 3#
4# Reuse the i386 PCI subsystem 4# Reuse the i386 PCI subsystem
5# 5#
6CFLAGS += -Iarch/i386/pci 6EXTRA_CFLAGS += -Iarch/i386/pci
7 7
8obj-y := i386.o 8obj-y := i386.o
9obj-$(CONFIG_PCI_DIRECT)+= direct.o 9obj-$(CONFIG_PCI_DIRECT)+= direct.o
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
index 7732f4254d2..f8b6b2800a6 100644
--- a/arch/x86_64/pci/mmconfig.c
+++ b/arch/x86_64/pci/mmconfig.c
@@ -163,37 +163,6 @@ static __init void unreachable_devices(void)
163 } 163 }
164} 164}
165 165
166static __init void pci_mmcfg_insert_resources(void)
167{
168#define PCI_MMCFG_RESOURCE_NAME_LEN 19
169 int i;
170 struct resource *res;
171 char *names;
172 unsigned num_buses;
173
174 res = kcalloc(PCI_MMCFG_RESOURCE_NAME_LEN + sizeof(*res),
175 pci_mmcfg_config_num, GFP_KERNEL);
176
177 if (!res) {
178 printk(KERN_ERR "PCI: Unable to allocate MMCONFIG resources\n");
179 return;
180 }
181
182 names = (void *)&res[pci_mmcfg_config_num];
183 for (i = 0; i < pci_mmcfg_config_num; i++, res++) {
184 num_buses = pci_mmcfg_config[i].end_bus_number -
185 pci_mmcfg_config[i].start_bus_number + 1;
186 res->name = names;
187 snprintf(names, PCI_MMCFG_RESOURCE_NAME_LEN, "PCI MMCONFIG %u",
188 pci_mmcfg_config[i].pci_segment_group_number);
189 res->start = pci_mmcfg_config[i].base_address;
190 res->end = res->start + (num_buses << 20) - 1;
191 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
192 insert_resource(&iomem_resource, res);
193 names += PCI_MMCFG_RESOURCE_NAME_LEN;
194 }
195}
196
197void __init pci_mmcfg_init(int type) 166void __init pci_mmcfg_init(int type)
198{ 167{
199 int i; 168 int i;
@@ -220,7 +189,7 @@ void __init pci_mmcfg_init(int type)
220 189
221 pci_mmcfg_virt = kmalloc(sizeof(*pci_mmcfg_virt) * pci_mmcfg_config_num, GFP_KERNEL); 190 pci_mmcfg_virt = kmalloc(sizeof(*pci_mmcfg_virt) * pci_mmcfg_config_num, GFP_KERNEL);
222 if (pci_mmcfg_virt == NULL) { 191 if (pci_mmcfg_virt == NULL) {
223 printk("PCI: Can not allocate memory for mmconfig structures\n"); 192 printk(KERN_ERR "PCI: Can not allocate memory for mmconfig structures\n");
224 return; 193 return;
225 } 194 }
226 for (i = 0; i < pci_mmcfg_config_num; ++i) { 195 for (i = 0; i < pci_mmcfg_config_num; ++i) {
@@ -228,7 +197,8 @@ void __init pci_mmcfg_init(int type)
228 pci_mmcfg_virt[i].virt = ioremap_nocache(pci_mmcfg_config[i].base_address, 197 pci_mmcfg_virt[i].virt = ioremap_nocache(pci_mmcfg_config[i].base_address,
229 MMCONFIG_APER_MAX); 198 MMCONFIG_APER_MAX);
230 if (!pci_mmcfg_virt[i].virt) { 199 if (!pci_mmcfg_virt[i].virt) {
231 printk("PCI: Cannot map mmconfig aperture for segment %d\n", 200 printk(KERN_ERR "PCI: Cannot map mmconfig aperture for "
201 "segment %d\n",
232 pci_mmcfg_config[i].pci_segment_group_number); 202 pci_mmcfg_config[i].pci_segment_group_number);
233 return; 203 return;
234 } 204 }
@@ -236,7 +206,6 @@ void __init pci_mmcfg_init(int type)
236 } 206 }
237 207
238 unreachable_devices(); 208 unreachable_devices();
239 pci_mmcfg_insert_resources();
240 209
241 raw_pci_ops = &pci_mmcfg; 210 raw_pci_ops = &pci_mmcfg;
242 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; 211 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index ab6cdbd5eb6..cfe75f52872 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -184,13 +184,7 @@ SECTIONS
184 184
185 __initcall_start = .; 185 __initcall_start = .;
186 .initcall.init : { 186 .initcall.init : {
187 *(.initcall1.init) 187 INITCALLS
188 *(.initcall2.init)
189 *(.initcall3.init)
190 *(.initcall4.init)
191 *(.initcall5.init)
192 *(.initcall6.init)
193 *(.initcall7.init)
194 } 188 }
195 __initcall_end = .; 189 __initcall_end = .;
196 190