aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/atomic.h2
-rw-r--r--include/asm-alpha/barrier.h36
-rw-r--r--include/asm-alpha/dma-mapping.h2
-rw-r--r--include/asm-alpha/rwsem.h5
-rw-r--r--include/asm-alpha/system.h31
-rw-r--r--include/asm-arm/arch-aaec2000/aaec2000.h56
-rw-r--r--include/asm-arm/arch-aaec2000/aaed2000.h40
-rw-r--r--include/asm-arm/arch-aaec2000/hardware.h3
-rw-r--r--include/asm-arm/arch-aaec2000/io.h2
-rw-r--r--include/asm-arm/arch-aaec2000/memory.h2
-rw-r--r--include/asm-arm/arch-cl7500/io.h2
-rw-r--r--include/asm-arm/arch-cl7500/memory.h2
-rw-r--r--include/asm-arm/arch-clps711x/hardware.h117
-rw-r--r--include/asm-arm/arch-clps711x/io.h2
-rw-r--r--include/asm-arm/arch-clps711x/memory.h2
-rw-r--r--include/asm-arm/arch-clps711x/mp1000-seprom.h77
-rw-r--r--include/asm-arm/arch-ebsa110/memory.h2
-rw-r--r--include/asm-arm/arch-ebsa285/io.h2
-rw-r--r--include/asm-arm/arch-ebsa285/memory.h10
-rw-r--r--include/asm-arm/arch-epxa10db/io.h2
-rw-r--r--include/asm-arm/arch-epxa10db/memory.h2
-rw-r--r--include/asm-arm/arch-h720x/io.h2
-rw-r--r--include/asm-arm/arch-h720x/memory.h2
-rw-r--r--include/asm-arm/arch-imx/io.h2
-rw-r--r--include/asm-arm/arch-imx/memory.h2
-rw-r--r--include/asm-arm/arch-integrator/hardware.h9
-rw-r--r--include/asm-arm/arch-integrator/io.h8
-rw-r--r--include/asm-arm/arch-integrator/memory.h4
-rw-r--r--include/asm-arm/arch-iop3xx/io.h2
-rw-r--r--include/asm-arm/arch-iop3xx/memory.h4
-rw-r--r--include/asm-arm/arch-ixp2000/io.h2
-rw-r--r--include/asm-arm/arch-ixp2000/ixp2000-regs.h43
-rw-r--r--include/asm-arm/arch-ixp2000/memory.h2
-rw-r--r--include/asm-arm/arch-ixp2000/platform.h50
-rw-r--r--include/asm-arm/arch-ixp4xx/ixp4xx-regs.h75
-rw-r--r--include/asm-arm/arch-ixp4xx/memory.h2
-rw-r--r--include/asm-arm/arch-l7200/io.h2
-rw-r--r--include/asm-arm/arch-l7200/memory.h2
-rw-r--r--include/asm-arm/arch-lh7a40x/io.h2
-rw-r--r--include/asm-arm/arch-lh7a40x/memory.h2
-rw-r--r--include/asm-arm/arch-omap/io.h2
-rw-r--r--include/asm-arm/arch-omap/memory.h6
-rw-r--r--include/asm-arm/arch-pxa/hardware.h4
-rw-r--r--include/asm-arm/arch-pxa/io.h2
-rw-r--r--include/asm-arm/arch-pxa/irda.h17
-rw-r--r--include/asm-arm/arch-pxa/memory.h2
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h42
-rw-r--r--include/asm-arm/arch-pxa/uncompress.h1
-rw-r--r--include/asm-arm/arch-rpc/io.h2
-rw-r--r--include/asm-arm/arch-rpc/memory.h2
-rw-r--r--include/asm-arm/arch-s3c2410/fb.h3
-rw-r--r--include/asm-arm/arch-s3c2410/io.h2
-rw-r--r--include/asm-arm/arch-s3c2410/memory.h4
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpio.h6
-rw-r--r--include/asm-arm/arch-sa1100/hardware.h7
-rw-r--r--include/asm-arm/arch-sa1100/io.h8
-rw-r--r--include/asm-arm/arch-sa1100/memory.h2
-rw-r--r--include/asm-arm/arch-sa1100/system.h1
-rw-r--r--include/asm-arm/arch-shark/io.h2
-rw-r--r--include/asm-arm/arch-shark/memory.h2
-rw-r--r--include/asm-arm/arch-versatile/memory.h2
-rw-r--r--include/asm-arm/bitops.h1
-rw-r--r--include/asm-arm/dma-mapping.h4
-rw-r--r--include/asm-arm/io.h1
-rw-r--r--include/asm-arm/mach/arch.h7
-rw-r--r--include/asm-arm/mach/flash.h2
-rw-r--r--include/asm-arm/mach/map.h5
-rw-r--r--include/asm-arm/memory.h25
-rw-r--r--include/asm-arm/tlb.h23
-rw-r--r--include/asm-arm26/tlb.h47
-rw-r--r--include/asm-cris/dma-mapping.h4
-rw-r--r--include/asm-frv/dma-mapping.h2
-rw-r--r--include/asm-frv/pci.h2
-rw-r--r--include/asm-generic/4level-fixup.h11
-rw-r--r--include/asm-generic/dma-mapping-broken.h2
-rw-r--r--include/asm-generic/pgtable.h2
-rw-r--r--include/asm-generic/tlb.h23
-rw-r--r--include/asm-i386/mach-summit/mach_mpparse.h3
-rw-r--r--include/asm-i386/mmzone.h6
-rw-r--r--include/asm-i386/pgtable.h3
-rw-r--r--include/asm-i386/rwsem.h5
-rw-r--r--include/asm-ia64/machvec.h4
-rw-r--r--include/asm-ia64/machvec_hpzx1.h21
-rw-r--r--include/asm-ia64/machvec_hpzx1_swiotlb.h3
-rw-r--r--include/asm-ia64/meminit.h6
-rw-r--r--include/asm-ia64/mmzone.h10
-rw-r--r--include/asm-ia64/nodedata.h4
-rw-r--r--include/asm-ia64/page.h6
-rw-r--r--include/asm-ia64/rwsem.h5
-rw-r--r--include/asm-ia64/sn/arch.h36
-rw-r--r--include/asm-ia64/sn/io.h11
-rw-r--r--include/asm-ia64/sn/klconfig.h34
-rw-r--r--include/asm-ia64/sn/l1.h12
-rw-r--r--include/asm-ia64/sn/nodepda.h1
-rw-r--r--include/asm-ia64/sn/sn_cpuid.h3
-rw-r--r--include/asm-ia64/sn/sn_sal.h59
-rw-r--r--include/asm-ia64/sn/tioca_provider.h14
-rw-r--r--include/asm-ia64/sn/tiocx.h3
-rw-r--r--include/asm-ia64/sn/xp.h16
-rw-r--r--include/asm-ia64/sparsemem.h20
-rw-r--r--include/asm-ia64/tlb.h19
-rw-r--r--include/asm-m32r/dma-mapping.h2
-rw-r--r--include/asm-m32r/mmzone.h6
-rw-r--r--include/asm-mips/abi.h25
-rw-r--r--include/asm-mips/addrspace.h90
-rw-r--r--include/asm-mips/asm.h4
-rw-r--r--include/asm-mips/atomic.h40
-rw-r--r--include/asm-mips/bitops.h209
-rw-r--r--include/asm-mips/bootinfo.h5
-rw-r--r--include/asm-mips/break.h1
-rw-r--r--include/asm-mips/bug.h11
-rw-r--r--include/asm-mips/bugs.h6
-rw-r--r--include/asm-mips/cache.h3
-rw-r--r--include/asm-mips/cacheflush.h31
-rw-r--r--include/asm-mips/checksum.h159
-rw-r--r--include/asm-mips/cobalt/cobalt.h52
-rw-r--r--include/asm-mips/cobalt/mach-gt64120.h1
-rw-r--r--include/asm-mips/compat.h12
-rw-r--r--include/asm-mips/cpu-features.h66
-rw-r--r--include/asm-mips/cpu-info.h2
-rw-r--r--include/asm-mips/cpu.h87
-rw-r--r--include/asm-mips/dec/ecc.h3
-rw-r--r--include/asm-mips/dec/ioasic_addrs.h3
-rw-r--r--include/asm-mips/dec/kn01.h34
-rw-r--r--include/asm-mips/dec/kn02.h33
-rw-r--r--include/asm-mips/dec/kn02xa.h46
-rw-r--r--include/asm-mips/dec/kn03.h13
-rw-r--r--include/asm-mips/dec/kn05.h76
-rw-r--r--include/asm-mips/dec/prom.h30
-rw-r--r--include/asm-mips/dec/system.h18
-rw-r--r--include/asm-mips/dec/tc.h10
-rw-r--r--include/asm-mips/delay.h8
-rw-r--r--include/asm-mips/dma-mapping.h4
-rw-r--r--include/asm-mips/dsp.h83
-rw-r--r--include/asm-mips/elf.h96
-rw-r--r--include/asm-mips/errno.h4
-rw-r--r--include/asm-mips/fcntl.h17
-rw-r--r--include/asm-mips/fixmap.h7
-rw-r--r--include/asm-mips/fpu.h9
-rw-r--r--include/asm-mips/fpu_emulator.h19
-rw-r--r--include/asm-mips/futex.h50
-rw-r--r--include/asm-mips/hazards.h58
-rw-r--r--include/asm-mips/highmem.h2
-rw-r--r--include/asm-mips/inst.h10
-rw-r--r--include/asm-mips/interrupt.h137
-rw-r--r--include/asm-mips/inventory.h8
-rw-r--r--include/asm-mips/io.h164
-rw-r--r--include/asm-mips/irq.h4
-rw-r--r--include/asm-mips/jmr3927/jmr3927.h14
-rw-r--r--include/asm-mips/mach-au1x00/au1000.h554
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx.h44
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_dbdma.h128
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_gpio.h20
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_ide.h301
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_psc.h2
-rw-r--r--include/asm-mips/mach-au1x00/ioremap.h32
-rw-r--r--include/asm-mips/mach-db1x00/db1200.h224
-rw-r--r--include/asm-mips/mach-dec/mc146818rtc.h11
-rw-r--r--include/asm-mips/mach-generic/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-generic/ide.h73
-rw-r--r--include/asm-mips/mach-generic/ioremap.h23
-rw-r--r--include/asm-mips/mach-generic/kernel-entry-init.h25
-rw-r--r--include/asm-mips/mach-generic/kmalloc.h13
-rw-r--r--include/asm-mips/mach-generic/spaces.h10
-rw-r--r--include/asm-mips/mach-ip22/cpu-feature-overrides.h8
-rw-r--r--include/asm-mips/mach-ip22/spaces.h2
-rw-r--r--include/asm-mips/mach-ip27/cpu-feature-overrides.h1
-rw-r--r--include/asm-mips/mach-ip27/kernel-entry-init.h52
-rw-r--r--include/asm-mips/mach-ip27/kmalloc.h8
-rw-r--r--include/asm-mips/mach-ip27/mmzone.h2
-rw-r--r--include/asm-mips/mach-ip27/spaces.h1
-rw-r--r--include/asm-mips/mach-ip27/topology.h3
-rw-r--r--include/asm-mips/mach-ip32/cpu-feature-overrides.h1
-rw-r--r--include/asm-mips/mach-ip32/kmalloc.h12
-rw-r--r--include/asm-mips/mach-ip32/spaces.h8
-rw-r--r--include/asm-mips/mach-ja/cpu-feature-overrides.h7
-rw-r--r--include/asm-mips/mach-mips/cpu-feature-overrides.h6
-rw-r--r--include/asm-mips/mach-mips/irq.h14
-rw-r--r--include/asm-mips/mach-ocelot3/cpu-feature-overrides.h7
-rw-r--r--include/asm-mips/mach-pb1x00/pb1200.h252
-rw-r--r--include/asm-mips/mach-pnx8550/cm.h43
-rw-r--r--include/asm-mips/mach-pnx8550/glb.h86
-rw-r--r--include/asm-mips/mach-pnx8550/int.h140
-rw-r--r--include/asm-mips/mach-pnx8550/kernel-entry-init.h262
-rw-r--r--include/asm-mips/mach-pnx8550/nand.h121
-rw-r--r--include/asm-mips/mach-pnx8550/pci.h185
-rw-r--r--include/asm-mips/mach-pnx8550/uart.h16
-rw-r--r--include/asm-mips/mach-pnx8550/usb.h32
-rw-r--r--include/asm-mips/mach-rm200/cpu-feature-overrides.h3
-rw-r--r--include/asm-mips/mach-sibyte/cpu-feature-overrides.h1
-rw-r--r--include/asm-mips/mach-sim/cpu-feature-overrides.h66
-rw-r--r--include/asm-mips/mach-yosemite/cpu-feature-overrides.h7
-rw-r--r--include/asm-mips/mips-boards/generic.h7
-rw-r--r--include/asm-mips/mips-boards/maltaint.h58
-rw-r--r--include/asm-mips/mips-boards/msc01_pci.h241
-rw-r--r--include/asm-mips/mips-boards/sim.h40
-rw-r--r--include/asm-mips/mips-boards/simint.h34
-rw-r--r--include/asm-mips/mipsmtregs.h391
-rw-r--r--include/asm-mips/mipsregs.h394
-rw-r--r--include/asm-mips/mmu_context.h4
-rw-r--r--include/asm-mips/mmzone.h1
-rw-r--r--include/asm-mips/module.h90
-rw-r--r--include/asm-mips/paccess.h8
-rw-r--r--include/asm-mips/page.h42
-rw-r--r--include/asm-mips/pci.h36
-rw-r--r--include/asm-mips/pgalloc.h19
-rw-r--r--include/asm-mips/pgtable-32.h53
-rw-r--r--include/asm-mips/pgtable-64.h70
-rw-r--r--include/asm-mips/pgtable-bits.h6
-rw-r--r--include/asm-mips/pgtable.h23
-rw-r--r--include/asm-mips/processor.h22
-rw-r--r--include/asm-mips/ptrace.h19
-rw-r--r--include/asm-mips/r4kcache.h72
-rw-r--r--include/asm-mips/rtc.h53
-rw-r--r--include/asm-mips/rtlx.h56
-rw-r--r--include/asm-mips/serial.h35
-rw-r--r--include/asm-mips/sgi/hpc3.h40
-rw-r--r--include/asm-mips/sibyte/bcm1480_int.h310
-rw-r--r--include/asm-mips/sibyte/bcm1480_l2c.h176
-rw-r--r--include/asm-mips/sibyte/bcm1480_mc.h962
-rw-r--r--include/asm-mips/sibyte/bcm1480_regs.h869
-rw-r--r--include/asm-mips/sibyte/bcm1480_scd.h436
-rw-r--r--include/asm-mips/sibyte/bigsur.h49
-rw-r--r--include/asm-mips/sibyte/board.h16
-rw-r--r--include/asm-mips/sibyte/sb1250.h13
-rw-r--r--include/asm-mips/sibyte/sb1250_defs.h33
-rw-r--r--include/asm-mips/sibyte/sb1250_dma.h70
-rw-r--r--include/asm-mips/sibyte/sb1250_genbus.h230
-rw-r--r--include/asm-mips/sibyte/sb1250_int.h8
-rw-r--r--include/asm-mips/sibyte/sb1250_l2c.h11
-rw-r--r--include/asm-mips/sibyte/sb1250_ldt.h2
-rw-r--r--include/asm-mips/sibyte/sb1250_mac.h35
-rw-r--r--include/asm-mips/sibyte/sb1250_mc.h6
-rw-r--r--include/asm-mips/sibyte/sb1250_regs.h35
-rw-r--r--include/asm-mips/sibyte/sb1250_scd.h102
-rw-r--r--include/asm-mips/sibyte/sb1250_smbus.h58
-rw-r--r--include/asm-mips/sibyte/sb1250_syncser.h2
-rw-r--r--include/asm-mips/sibyte/sb1250_uart.h13
-rw-r--r--include/asm-mips/sibyte/swarm.h2
-rw-r--r--include/asm-mips/sigcontext.h60
-rw-r--r--include/asm-mips/siginfo.h1
-rw-r--r--include/asm-mips/signal.h29
-rw-r--r--include/asm-mips/sn/sn0/arch.h5
-rw-r--r--include/asm-mips/socket.h5
-rw-r--r--include/asm-mips/spinlock.h26
-rw-r--r--include/asm-mips/stackframe.h29
-rw-r--r--include/asm-mips/system.h71
-rw-r--r--include/asm-mips/thread_info.h11
-rw-r--r--include/asm-mips/traps.h3
-rw-r--r--include/asm-mips/tx4938/rbtx4938.h207
-rw-r--r--include/asm-mips/tx4938/spi.h74
-rw-r--r--include/asm-mips/tx4938/tx4938.h706
-rw-r--r--include/asm-mips/tx4938/tx4938_mips.h54
-rw-r--r--include/asm-mips/uaccess.h158
-rw-r--r--include/asm-mips/unistd.h25
-rw-r--r--include/asm-mips/vga.h25
-rw-r--r--include/asm-mips/war.h14
-rw-r--r--include/asm-parisc/assembly.h71
-rw-r--r--include/asm-parisc/bitops.h290
-rw-r--r--include/asm-parisc/cacheflush.h35
-rw-r--r--include/asm-parisc/dma-mapping.h8
-rw-r--r--include/asm-parisc/errno.h1
-rw-r--r--include/asm-parisc/grfioctl.h2
-rw-r--r--include/asm-parisc/led.h3
-rw-r--r--include/asm-parisc/mmzone.h6
-rw-r--r--include/asm-parisc/parisc-device.h7
-rw-r--r--include/asm-parisc/pci.h2
-rw-r--r--include/asm-parisc/pgtable.h2
-rw-r--r--include/asm-parisc/processor.h19
-rw-r--r--include/asm-parisc/psw.h51
-rw-r--r--include/asm-parisc/ptrace.h2
-rw-r--r--include/asm-parisc/spinlock.h5
-rw-r--r--include/asm-parisc/spinlock_types.h8
-rw-r--r--include/asm-parisc/system.h48
-rw-r--r--include/asm-parisc/tlbflush.h32
-rw-r--r--include/asm-parisc/types.h2
-rw-r--r--include/asm-parisc/unistd.h16
-rw-r--r--include/asm-ppc/dma-mapping.h2
-rw-r--r--include/asm-ppc/rwsem.h5
-rw-r--r--include/asm-ppc64/mmzone.h3
-rw-r--r--include/asm-ppc64/pgtable.h4
-rw-r--r--include/asm-ppc64/rwsem.h5
-rw-r--r--include/asm-s390/rwsem.h5
-rw-r--r--include/asm-sh/dma-mapping.h4
-rw-r--r--include/asm-sh/machvec.h2
-rw-r--r--include/asm-sh/rwsem.h5
-rw-r--r--include/asm-sh64/dma-mapping.h2
-rw-r--r--include/asm-sparc/dma-mapping.h2
-rw-r--r--include/asm-sparc64/dma-mapping.h2
-rw-r--r--include/asm-sparc64/rwsem.h5
-rw-r--r--include/asm-sparc64/tlb.h29
-rw-r--r--include/asm-um/dma-mapping.h2
-rw-r--r--include/asm-um/page.h2
-rw-r--r--include/asm-um/pgtable.h2
-rw-r--r--include/asm-x86_64/dma-mapping.h2
-rw-r--r--include/asm-x86_64/pci.h6
-rw-r--r--include/asm-x86_64/rwsem.h5
-rw-r--r--include/asm-x86_64/swiotlb.h2
-rw-r--r--include/asm-xtensa/dma-mapping.h2
-rw-r--r--include/linux/ata.h41
-rw-r--r--include/linux/audit.h4
-rw-r--r--include/linux/bio.h2
-rw-r--r--include/linux/blkdev.h50
-rw-r--r--include/linux/buffer_head.h8
-rw-r--r--include/linux/cyclomx.h2
-rw-r--r--include/linux/cycx_drv.h1
-rw-r--r--include/linux/device.h115
-rw-r--r--include/linux/elevator.h22
-rw-r--r--include/linux/etherdevice.h16
-rw-r--r--include/linux/ethtool.h8
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/fs_enet_pd.h136
-rw-r--r--include/linux/genhd.h3
-rw-r--r--include/linux/gfp.h39
-rw-r--r--include/linux/hil.h483
-rw-r--r--include/linux/hil_mlc.h168
-rw-r--r--include/linux/hp_sdc.h300
-rw-r--r--include/linux/hugetlb.h2
-rw-r--r--include/linux/i2c-algo-bit.h4
-rw-r--r--include/linux/i2c-algo-pca.h2
-rw-r--r--include/linux/i2c-algo-pcf.h4
-rw-r--r--include/linux/i2c-dev.h2
-rw-r--r--include/linux/i2c-id.h3
-rw-r--r--include/linux/i2c.h38
-rw-r--r--include/linux/i2o.h8
-rw-r--r--include/linux/ibmtr.h4
-rw-r--r--include/linux/ide.h2
-rw-r--r--include/linux/idr.h2
-rw-r--r--include/linux/if_arp.h1
-rw-r--r--include/linux/input.h27
-rw-r--r--include/linux/jbd.h4
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/libata.h113
-rw-r--r--include/linux/loop.h2
-rw-r--r--include/linux/mbcache.h2
-rw-r--r--include/linux/memory.h94
-rw-r--r--include/linux/memory_hotplug.h104
-rw-r--r--include/linux/mempolicy.h7
-rw-r--r--include/linux/mii.h1
-rw-r--r--include/linux/mm.h152
-rw-r--r--include/linux/mmc/mmc.h4
-rw-r--r--include/linux/mmzone.h30
-rw-r--r--include/linux/mod_devicetable.h5
-rw-r--r--include/linux/namei.h8
-rw-r--r--include/linux/netdevice.h7
-rw-r--r--include/linux/nfs_fs.h28
-rw-r--r--include/linux/nfs_xdr.h65
-rw-r--r--include/linux/pagemap.h13
-rw-r--r--include/linux/pci.h7
-rw-r--r--include/linux/pci_ids.h570
-rw-r--r--include/linux/pm.h40
-rw-r--r--include/linux/radix-tree.h2
-rw-r--r--include/linux/reiserfs_fs.h2
-rw-r--r--include/linux/rmap.h4
-rw-r--r--include/linux/rwsem-spinlock.h5
-rw-r--r--include/linux/scatterlist.h17
-rw-r--r--include/linux/sched.h65
-rw-r--r--include/linux/sdladrv.h4
-rw-r--r--include/linux/security.h2
-rw-r--r--include/linux/serial_core.h3
-rw-r--r--include/linux/serial_ip3106.h81
-rw-r--r--include/linux/skbuff.h10
-rw-r--r--include/linux/slab.h2
-rw-r--r--include/linux/sunrpc/auth.h7
-rw-r--r--include/linux/sunrpc/debug.h3
-rw-r--r--include/linux/sunrpc/gss_api.h27
-rw-r--r--include/linux/sunrpc/gss_err.h10
-rw-r--r--include/linux/sunrpc/gss_krb5.h27
-rw-r--r--include/linux/sunrpc/gss_spkm3.h4
-rw-r--r--include/linux/sunrpc/msg_prot.h25
-rw-r--r--include/linux/sunrpc/xdr.h6
-rw-r--r--include/linux/sunrpc/xprt.h227
-rw-r--r--include/linux/suspend.h2
-rw-r--r--include/linux/swap.h4
-rw-r--r--include/linux/textsearch.h4
-rw-r--r--include/linux/types.h9
-rw-r--r--include/linux/usb.h171
-rw-r--r--include/linux/usb_gadget.h12
-rw-r--r--include/linux/usb_otg.h13
-rw-r--r--include/linux/usbdevice_fs.h7
-rw-r--r--include/linux/vmalloc.h8
-rw-r--r--include/linux/wanpipe.h9
-rw-r--r--include/linux/x1205.h31
-rw-r--r--include/media/ovcamchip.h14
-rw-r--r--include/net/ax25.h3
-rw-r--r--include/net/bluetooth/bluetooth.h6
-rw-r--r--include/net/bluetooth/rfcomm.h3
-rw-r--r--include/net/dst.h1
-rw-r--r--include/net/ieee80211.h525
-rw-r--r--include/net/ieee80211_crypt.h38
-rw-r--r--include/net/ieee80211_radiotap.h231
-rw-r--r--include/net/llc_pdu.h4
-rw-r--r--include/net/netrom.h3
-rw-r--r--include/net/sctp/user.h8
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/syncppp.h1
-rw-r--r--include/rdma/ib_cm.h10
-rw-r--r--include/rdma/ib_mad.h66
-rw-r--r--include/rdma/ib_user_cm.h10
-rw-r--r--include/rdma/ib_user_verbs.h222
-rw-r--r--include/rdma/ib_verbs.h6
-rw-r--r--include/scsi/scsi.h3
-rw-r--r--include/scsi/scsi_cmnd.h2
-rw-r--r--include/scsi/scsi_request.h2
-rw-r--r--include/sound/memalloc.h2
405 files changed, 14562 insertions, 3403 deletions
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h
index 0b40bad00289..20ac3d95ecd9 100644
--- a/include/asm-alpha/atomic.h
+++ b/include/asm-alpha/atomic.h
@@ -1,6 +1,8 @@
1#ifndef _ALPHA_ATOMIC_H 1#ifndef _ALPHA_ATOMIC_H
2#define _ALPHA_ATOMIC_H 2#define _ALPHA_ATOMIC_H
3 3
4#include <asm/barrier.h>
5
4/* 6/*
5 * Atomic operations that C can't guarantee us. Useful for 7 * Atomic operations that C can't guarantee us. Useful for
6 * resource counting etc... 8 * resource counting etc...
diff --git a/include/asm-alpha/barrier.h b/include/asm-alpha/barrier.h
new file mode 100644
index 000000000000..681ff581afa5
--- /dev/null
+++ b/include/asm-alpha/barrier.h
@@ -0,0 +1,36 @@
1#ifndef __BARRIER_H
2#define __BARRIER_H
3
4#include <asm/compiler.h>
5
6#define mb() \
7__asm__ __volatile__("mb": : :"memory")
8
9#define rmb() \
10__asm__ __volatile__("mb": : :"memory")
11
12#define wmb() \
13__asm__ __volatile__("wmb": : :"memory")
14
15#define read_barrier_depends() \
16__asm__ __volatile__("mb": : :"memory")
17
18#ifdef CONFIG_SMP
19#define smp_mb() mb()
20#define smp_rmb() rmb()
21#define smp_wmb() wmb()
22#define smp_read_barrier_depends() read_barrier_depends()
23#else
24#define smp_mb() barrier()
25#define smp_rmb() barrier()
26#define smp_wmb() barrier()
27#define smp_read_barrier_depends() barrier()
28#endif
29
30#define set_mb(var, value) \
31do { var = value; mb(); } while (0)
32
33#define set_wmb(var, value) \
34do { var = value; wmb(); } while (0)
35
36#endif /* __BARRIER_H */
diff --git a/include/asm-alpha/dma-mapping.h b/include/asm-alpha/dma-mapping.h
index c675f282d6ad..680f7ecbb28f 100644
--- a/include/asm-alpha/dma-mapping.h
+++ b/include/asm-alpha/dma-mapping.h
@@ -31,7 +31,7 @@
31#else /* no PCI - no IOMMU. */ 31#else /* no PCI - no IOMMU. */
32 32
33void *dma_alloc_coherent(struct device *dev, size_t size, 33void *dma_alloc_coherent(struct device *dev, size_t size,
34 dma_addr_t *dma_handle, int gfp); 34 dma_addr_t *dma_handle, gfp_t gfp);
35int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 35int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
36 enum dma_data_direction direction); 36 enum dma_data_direction direction);
37 37
diff --git a/include/asm-alpha/rwsem.h b/include/asm-alpha/rwsem.h
index 8e058a67c9a4..fafdd4f7010a 100644
--- a/include/asm-alpha/rwsem.h
+++ b/include/asm-alpha/rwsem.h
@@ -262,5 +262,10 @@ static inline long rwsem_atomic_update(long val, struct rw_semaphore *sem)
262#endif 262#endif
263} 263}
264 264
265static inline int rwsem_is_locked(struct rw_semaphore *sem)
266{
267 return (sem->count != 0);
268}
269
265#endif /* __KERNEL__ */ 270#endif /* __KERNEL__ */
266#endif /* _ALPHA_RWSEM_H */ 271#endif /* _ALPHA_RWSEM_H */
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
index bdb4d66418f1..050e86d12891 100644
--- a/include/asm-alpha/system.h
+++ b/include/asm-alpha/system.h
@@ -4,6 +4,7 @@
4#include <linux/config.h> 4#include <linux/config.h>
5#include <asm/pal.h> 5#include <asm/pal.h>
6#include <asm/page.h> 6#include <asm/page.h>
7#include <asm/barrier.h>
7 8
8/* 9/*
9 * System defines.. Note that this is included both from .c and .S 10 * System defines.. Note that this is included both from .c and .S
@@ -139,36 +140,6 @@ extern void halt(void) __attribute__((noreturn));
139struct task_struct; 140struct task_struct;
140extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); 141extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*);
141 142
142#define mb() \
143__asm__ __volatile__("mb": : :"memory")
144
145#define rmb() \
146__asm__ __volatile__("mb": : :"memory")
147
148#define wmb() \
149__asm__ __volatile__("wmb": : :"memory")
150
151#define read_barrier_depends() \
152__asm__ __volatile__("mb": : :"memory")
153
154#ifdef CONFIG_SMP
155#define smp_mb() mb()
156#define smp_rmb() rmb()
157#define smp_wmb() wmb()
158#define smp_read_barrier_depends() read_barrier_depends()
159#else
160#define smp_mb() barrier()
161#define smp_rmb() barrier()
162#define smp_wmb() barrier()
163#define smp_read_barrier_depends() barrier()
164#endif
165
166#define set_mb(var, value) \
167do { var = value; mb(); } while (0)
168
169#define set_wmb(var, value) \
170do { var = value; wmb(); } while (0)
171
172#define imb() \ 143#define imb() \
173__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") 144__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory")
174 145
diff --git a/include/asm-arm/arch-aaec2000/aaec2000.h b/include/asm-arm/arch-aaec2000/aaec2000.h
index 0e9b7e18af05..002227924b9f 100644
--- a/include/asm-arm/arch-aaec2000/aaec2000.h
+++ b/include/asm-arm/arch-aaec2000/aaec2000.h
@@ -17,6 +17,16 @@
17#error You must include hardware.h not this file 17#error You must include hardware.h not this file
18#endif /* __ASM_ARCH_HARDWARE_H */ 18#endif /* __ASM_ARCH_HARDWARE_H */
19 19
20/* Chip selects */
21#define AAEC_CS0 0x00000000
22#define AAEC_CS1 0x10000000
23#define AAEC_CS2 0x20000000
24#define AAEC_CS3 0x30000000
25
26/* Flash */
27#define AAEC_FLASH_BASE AAEC_CS0
28#define AAEC_FLASH_SIZE SZ_64M
29
20/* Interrupt controller */ 30/* Interrupt controller */
21#define IRQ_BASE __REG(0x80000500) 31#define IRQ_BASE __REG(0x80000500)
22#define IRQ_INTSR __REG(0x80000500) /* Int Status Register */ 32#define IRQ_INTSR __REG(0x80000500) /* Int Status Register */
@@ -148,4 +158,50 @@
148#define POWER_STFCLR __REG(0x8000041c) /* NbFlg, RSTFlg, PFFlg, CLDFlg Clear */ 158#define POWER_STFCLR __REG(0x8000041c) /* NbFlg, RSTFlg, PFFlg, CLDFlg Clear */
149#define POWER_CLKSET __REG(0x80000420) /* Clock Speed Control */ 159#define POWER_CLKSET __REG(0x80000420) /* Clock Speed Control */
150 160
161/* GPIO Registers */
162#define AAEC_GPIO_PHYS 0x80000e00
163
164#define AAEC_GPIO_PADR __REG(AAEC_GPIO_PHYS + 0x00)
165#define AAEC_GPIO_PBDR __REG(AAEC_GPIO_PHYS + 0x04)
166#define AAEC_GPIO_PCDR __REG(AAEC_GPIO_PHYS + 0x08)
167#define AAEC_GPIO_PDDR __REG(AAEC_GPIO_PHYS + 0x0c)
168#define AAEC_GPIO_PADDR __REG(AAEC_GPIO_PHYS + 0x10)
169#define AAEC_GPIO_PBDDR __REG(AAEC_GPIO_PHYS + 0x14)
170#define AAEC_GPIO_PCDDR __REG(AAEC_GPIO_PHYS + 0x18)
171#define AAEC_GPIO_PDDDR __REG(AAEC_GPIO_PHYS + 0x1c)
172#define AAEC_GPIO_PEDR __REG(AAEC_GPIO_PHYS + 0x20)
173#define AAEC_GPIO_PEDDR __REG(AAEC_GPIO_PHYS + 0x24)
174#define AAEC_GPIO_KSCAN __REG(AAEC_GPIO_PHYS + 0x28)
175#define AAEC_GPIO_PINMUX __REG(AAEC_GPIO_PHYS + 0x2c)
176#define AAEC_GPIO_PFDR __REG(AAEC_GPIO_PHYS + 0x30)
177#define AAEC_GPIO_PFDDR __REG(AAEC_GPIO_PHYS + 0x34)
178#define AAEC_GPIO_PGDR __REG(AAEC_GPIO_PHYS + 0x38)
179#define AAEC_GPIO_PGDDR __REG(AAEC_GPIO_PHYS + 0x3c)
180#define AAEC_GPIO_PHDR __REG(AAEC_GPIO_PHYS + 0x40)
181#define AAEC_GPIO_PHDDR __REG(AAEC_GPIO_PHYS + 0x44)
182#define AAEC_GPIO_RAZ __REG(AAEC_GPIO_PHYS + 0x48)
183#define AAEC_GPIO_INTTYPE1 __REG(AAEC_GPIO_PHYS + 0x4c)
184#define AAEC_GPIO_INTTYPE2 __REG(AAEC_GPIO_PHYS + 0x50)
185#define AAEC_GPIO_FEOI __REG(AAEC_GPIO_PHYS + 0x54)
186#define AAEC_GPIO_INTEN __REG(AAEC_GPIO_PHYS + 0x58)
187#define AAEC_GPIO_INTSTATUS __REG(AAEC_GPIO_PHYS + 0x5c)
188#define AAEC_GPIO_RAWINTSTATUS __REG(AAEC_GPIO_PHYS + 0x60)
189#define AAEC_GPIO_DB __REG(AAEC_GPIO_PHYS + 0x64)
190#define AAEC_GPIO_PAPINDR __REG(AAEC_GPIO_PHYS + 0x68)
191#define AAEC_GPIO_PBPINDR __REG(AAEC_GPIO_PHYS + 0x6c)
192#define AAEC_GPIO_PCPINDR __REG(AAEC_GPIO_PHYS + 0x70)
193#define AAEC_GPIO_PDPINDR __REG(AAEC_GPIO_PHYS + 0x74)
194#define AAEC_GPIO_PEPINDR __REG(AAEC_GPIO_PHYS + 0x78)
195#define AAEC_GPIO_PFPINDR __REG(AAEC_GPIO_PHYS + 0x7c)
196#define AAEC_GPIO_PGPINDR __REG(AAEC_GPIO_PHYS + 0x80)
197#define AAEC_GPIO_PHPINDR __REG(AAEC_GPIO_PHYS + 0x84)
198
199#define AAEC_GPIO_PINMUX_PE0CON (1 << 0)
200#define AAEC_GPIO_PINMUX_PD0CON (1 << 1)
201#define AAEC_GPIO_PINMUX_CODECON (1 << 2)
202#define AAEC_GPIO_PINMUX_UART3CON (1 << 3)
203
204/* LCD Controller */
205#define AAEC_CLCD_PHYS 0x80003000
206
151#endif /* __ARM_ARCH_AAEC2000_H */ 207#endif /* __ARM_ARCH_AAEC2000_H */
diff --git a/include/asm-arm/arch-aaec2000/aaed2000.h b/include/asm-arm/arch-aaec2000/aaed2000.h
new file mode 100644
index 000000000000..bc76d2badb91
--- /dev/null
+++ b/include/asm-arm/arch-aaec2000/aaed2000.h
@@ -0,0 +1,40 @@
1/*
2 * linux/include/asm-arm/arch-aaec2000/aaed2000.h
3 *
4 * AAED-2000 specific bits definition
5 *
6 * Copyright (c) 2005 Nicolas Bellido Y Ortega
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ASM_ARCH_AAED2000_H
14#define __ASM_ARCH_AAED2000_H
15
16/* External GPIOs. */
17
18#define EXT_GPIO_PBASE AAEC_CS3
19#define EXT_GPIO_VBASE 0xf8100000
20#define EXT_GPIO_LENGTH 0x00001000
21
22#define __ext_gpio_p2v(x) ((x) - EXT_GPIO_PBASE + EXT_GPIO_VBASE)
23#define __ext_gpio_v2p(x) ((x) + EXT_GPIO_PBASE - EXT_GPIO_VBASE)
24
25#define __EXT_GPIO_REG(x) (*((volatile u32 *)__ext_gpio_p2v(x)))
26#define __EXT_GPIO_PREG(x) (__ext_gpio_v2p((u32)&(x)))
27
28#define AAED_EXT_GPIO __EXT_GPIO_REG(EXT_GPIO_PBASE)
29
30#define AAED_EGPIO_KBD_SCAN 0x00003fff /* Keyboard scan data */
31#define AAED_EGPIO_PWR_INT 0x00008fff /* Smart battery charger interrupt */
32#define AAED_EGPIO_SWITCHED 0x000f0000 /* DIP Switches */
33#define AAED_EGPIO_USB_VBUS 0x00400000 /* USB Vbus sense */
34#define AAED_EGPIO_LCD_PWR_EN 0x02000000 /* LCD and backlight PWR enable */
35#define AAED_EGPIO_nLED0 0x20000000 /* LED 0 */
36#define AAED_EGPIO_nLED1 0x20000000 /* LED 1 */
37#define AAED_EGPIO_nLED2 0x20000000 /* LED 2 */
38
39
40#endif /* __ARM_ARCH_AAED2000_H */
diff --git a/include/asm-arm/arch-aaec2000/hardware.h b/include/asm-arm/arch-aaec2000/hardware.h
index 4c37219e030e..153506fd06ed 100644
--- a/include/asm-arm/arch-aaec2000/hardware.h
+++ b/include/asm-arm/arch-aaec2000/hardware.h
@@ -11,7 +11,8 @@
11#ifndef __ASM_ARCH_HARDWARE_H 11#ifndef __ASM_ARCH_HARDWARE_H
12#define __ASM_ARCH_HARDWARE_H 12#define __ASM_ARCH_HARDWARE_H
13 13
14#include <linux/config.h> 14#include <asm/sizes.h>
15#include <asm/arch/aaec2000.h>
15 16
16/* The kernel is loaded at physical address 0xf8000000. 17/* The kernel is loaded at physical address 0xf8000000.
17 * We map the IO space a bit after 18 * We map the IO space a bit after
diff --git a/include/asm-arm/arch-aaec2000/io.h b/include/asm-arm/arch-aaec2000/io.h
index c58a8d10425a..8d67907fd4f0 100644
--- a/include/asm-arm/arch-aaec2000/io.h
+++ b/include/asm-arm/arch-aaec2000/io.h
@@ -6,6 +6,8 @@
6#ifndef __ASM_ARM_ARCH_IO_H 6#ifndef __ASM_ARM_ARCH_IO_H
7#define __ASM_ARM_ARCH_IO_H 7#define __ASM_ARM_ARCH_IO_H
8 8
9#include <asm/hardware.h>
10
9#define IO_SPACE_LIMIT 0xffffffff 11#define IO_SPACE_LIMIT 0xffffffff
10 12
11/* 13/*
diff --git a/include/asm-arm/arch-aaec2000/memory.h b/include/asm-arm/arch-aaec2000/memory.h
index 79c90813bc3e..d8209f8911d6 100644
--- a/include/asm-arm/arch-aaec2000/memory.h
+++ b/include/asm-arm/arch-aaec2000/memory.h
@@ -13,7 +13,7 @@
13 13
14#include <linux/config.h> 14#include <linux/config.h>
15 15
16#define PHYS_OFFSET (0xf0000000UL) 16#define PHYS_OFFSET UL(0xf0000000)
17 17
18#define __virt_to_bus(x) __virt_to_phys(x) 18#define __virt_to_bus(x) __virt_to_phys(x)
19#define __bus_to_virt(x) __phys_to_virt(x) 19#define __bus_to_virt(x) __phys_to_virt(x)
diff --git a/include/asm-arm/arch-cl7500/io.h b/include/asm-arm/arch-cl7500/io.h
index f0113bc75630..89a33287f4fe 100644
--- a/include/asm-arm/arch-cl7500/io.h
+++ b/include/asm-arm/arch-cl7500/io.h
@@ -10,6 +10,8 @@
10#ifndef __ASM_ARM_ARCH_IO_H 10#ifndef __ASM_ARM_ARCH_IO_H
11#define __ASM_ARM_ARCH_IO_H 11#define __ASM_ARM_ARCH_IO_H
12 12
13#include <asm/hardware.h>
14
13#define IO_SPACE_LIMIT 0xffffffff 15#define IO_SPACE_LIMIT 0xffffffff
14 16
15/* 17/*
diff --git a/include/asm-arm/arch-cl7500/memory.h b/include/asm-arm/arch-cl7500/memory.h
index 9776bba8e585..34f40a6cec30 100644
--- a/include/asm-arm/arch-cl7500/memory.h
+++ b/include/asm-arm/arch-cl7500/memory.h
@@ -17,7 +17,7 @@
17/* 17/*
18 * Physical DRAM offset. 18 * Physical DRAM offset.
19 */ 19 */
20#define PHYS_OFFSET (0x10000000UL) 20#define PHYS_OFFSET UL(0x10000000)
21 21
22/* 22/*
23 * These are exactly the same on the RiscPC as the 23 * These are exactly the same on the RiscPC as the
diff --git a/include/asm-arm/arch-clps711x/hardware.h b/include/asm-arm/arch-clps711x/hardware.h
index 1386871e1a5a..f864c367c934 100644
--- a/include/asm-arm/arch-clps711x/hardware.h
+++ b/include/asm-arm/arch-clps711x/hardware.h
@@ -235,4 +235,121 @@
235#define CEIVA_PB0_BLK_BTN (1<<0) 235#define CEIVA_PB0_BLK_BTN (1<<0)
236#endif // #if defined (CONFIG_ARCH_CEIVA) 236#endif // #if defined (CONFIG_ARCH_CEIVA)
237 237
238#if defined (CONFIG_MACH_MP1000)
239/* NOR FLASH */
240#define MP1000_NIO_BASE 0xf9000000 /* virtual */
241#define MP1000_NIO_START CS0_PHYS_BASE /* physical */
242#define MP1000_NIO_SIZE 0x00400000
243
244/* DSP Interface */
245#define MP1000_DSP_BASE 0xfa000000 /* virtual */
246#define MP1000_DSP_START CS1_PHYS_BASE /* physical */
247#define MP1000_DSP_SIZE 0x00100000
248
249/* LCD, DAA/DSP, RTC, DAA RW Reg all in CS2 */
250#define MP1000_LIO_BASE 0xfb000000 /* virtual */
251#define MP1000_LIO_START CS2_PHYS_BASE /* physical */
252#define MP1000_LIO_SIZE 0x00100000
253
254/* NAND FLASH */
255#define MP1000_FIO_BASE 0xfc000000 /* virtual */
256#define MP1000_FIO_START CS3_PHYS_BASE /* physical */
257#define MP1000_FIO_SIZE 0x00800000
258
259/* Ethernet */
260#define MP1000_EIO_BASE 0xfd000000 /* virtual */
261#define MP1000_EIO_START CS4_PHYS_BASE /* physical */
262#define MP1000_EIO_SIZE 0x00100000
263
264#define MP1000_LCD_OFFSET 0x00000000 /* LCD offset in CS2 */
265#define MP1000_DDD_OFFSET 0x00001000 /* DAA/DAI/DSP sft reset offst*/
266#define MP1000_RTC_OFFSET 0x00002000 /* RTC offset in CS2 */
267#define MP1000_DAA_OFFSET 0x00003000 /* DAA RW reg offset in CS2 */
268
269/* IDE */
270#define MP1000_IDE_BASE 0xfe000000 /* virtual */
271#define MP1000_IDE_START CS5_PHYS_BASE /* physical */
272#define MP1000_IDE_SIZE 0x00100000 /* actually it's only 0x1000 */
273
274#define IRQ_HARDDISK IRQ_EINT2
275
276/*
277 * IDE registers definition
278 */
279
280#define IDE_CONTROL_BASE (MP1000_IDE_BASE + 0x1000)
281#define IDE_BASE_OFF (MP1000_IDE_BASE)
282
283#define IDE_WRITE_DEVICE_DATA (IDE_BASE_OFF + 0x0)
284#define IDE_FEATURES_REGISTER (IDE_BASE_OFF + 0x2)
285#define IDE_SECTOR_COUNT_REGISTER (IDE_BASE_OFF + 0x4)
286#define IDE_SECTOR_NUMBER_REGISTER (IDE_BASE_OFF + 0x6)
287#define IDE_CYLINDER_LOW_REGISTER (IDE_BASE_OFF + 0x8)
288#define IDE_CYLINDER_HIGH_REGISTER (IDE_BASE_OFF + 0xa)
289#define IDE_DEVICE_HEAD_REGISTER (IDE_BASE_OFF + 0xc)
290#define IDE_COMMAND_DATA_REGISTER (IDE_BASE_OFF + 0xe)
291#define IDE_DEVICE_CONTROL_REGISTER (IDE_CONTROL_BASE + 0xc)
292
293#define IDE_IRQ IRQ_EINT2
294
295
296#define RTC_PORT(x) (MP1000_LIO_BASE+0x2000 + (x*2))
297#define RTC_ALWAYS_BCD 0
298
299/*
300// Definitions of the bit fields in the HwPortA register for the
301// MP1000 board.
302*/
303#define HwPortAKeyboardRow1 0x00000001
304#define HwPortAKeyboardRow2 0x00000002
305#define HwPortAKeyboardRow3 0x00000004
306#define HwPortAKeyboardRow4 0x00000008
307#define HwPortAKeyboardRow5 0x00000010
308#define HwPortAKeyboardRow6 0x00000020
309#define HwPortALCDEnable 0x00000040
310#define HwPortAOffhook 0x00000080
311
312/*
313// Definitions of the bit fields in the HwPortB register for the
314// MP1000 board.
315*/
316#define HwPortBL3Mode 0x00000001
317#define HwPortBL3Clk 0x00000002
318#define HwPortBSClk 0x00000001
319#define HwPortBSData 0x00000002
320#define HwPortBL3Data 0x00000004
321#define HwPortBMute 0x00000008
322#define HwPortBQD0 0x00000010
323#define HwPortBQD1 0x00000020
324#define HwPortBQD2 0x00000040
325#define HwPortBQD3 0x00000080
326
327/*
328// Definitions of the bit fields in the HwPortD register for the
329// MP1000 board.
330*/
331#define HwPortDLED1 0x00000001
332#define HwPortDLED2 0x00000002
333#define HwPortDLED3 0x00000004
334#define HwPortDLED4 0x00000008
335#define HwPortDLED5 0x00000010
336#define HwPortDEECS 0x00000020
337#define HwPortBRTS 0x00000040
338#define HwPortBRI 0x00000080
339
340
341/*
342// Definitions of the bit fields in the HwPortE register for the
343// MP1000 board.
344*/
345
346#define HwPortECLE 0x00000001
347#define HwPortESepromDOut 0x00000001
348#define HwPortEALE 0x00000002
349#define HwPortESepromDIn 0x00000002
350#define HwPortENANDCS 0x00000004
351#define HwPortESepromCLK 0x00000004
352
353#endif // #if defined (CONFIG_MACH_MP1000)
354
238#endif 355#endif
diff --git a/include/asm-arm/arch-clps711x/io.h b/include/asm-arm/arch-clps711x/io.h
index 14d7e8da5453..62613b0e2d96 100644
--- a/include/asm-arm/arch-clps711x/io.h
+++ b/include/asm-arm/arch-clps711x/io.h
@@ -20,6 +20,8 @@
20#ifndef __ASM_ARM_ARCH_IO_H 20#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H 21#define __ASM_ARM_ARCH_IO_H
22 22
23#include <asm/hardware.h>
24
23#define IO_SPACE_LIMIT 0xffffffff 25#define IO_SPACE_LIMIT 0xffffffff
24 26
25#define __io(a) ((void __iomem *)(a)) 27#define __io(a) ((void __iomem *)(a))
diff --git a/include/asm-arm/arch-clps711x/memory.h b/include/asm-arm/arch-clps711x/memory.h
index bd978947db42..61d8717406ce 100644
--- a/include/asm-arm/arch-clps711x/memory.h
+++ b/include/asm-arm/arch-clps711x/memory.h
@@ -25,7 +25,7 @@
25/* 25/*
26 * Physical DRAM offset. 26 * Physical DRAM offset.
27 */ 27 */
28#define PHYS_OFFSET (0xc0000000UL) 28#define PHYS_OFFSET UL(0xc0000000)
29 29
30/* 30/*
31 * Virtual view <-> DMA view memory address translations 31 * Virtual view <-> DMA view memory address translations
diff --git a/include/asm-arm/arch-clps711x/mp1000-seprom.h b/include/asm-arm/arch-clps711x/mp1000-seprom.h
new file mode 100644
index 000000000000..3e5566cf9666
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/mp1000-seprom.h
@@ -0,0 +1,77 @@
1#ifndef MP1000_SEPROM_H
2#define MP1000_SEPROM_H
3
4/*
5 * mp1000-seprom.h
6 *
7 *
8 * This file contains the Serial EEPROM definitions for the MP1000 board
9 *
10 * Copyright (C) 2005 Comdial Corporation
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28#define COMMAND_ERASE (0x1C0)
29#define COMMAND_ERASE_ALL (0x120)
30#define COMMAND_WRITE_DISABLE (0x100)
31#define COMMAND_WRITE_ENABLE (0x130)
32#define COMMAND_READ (0x180)
33#define COMMAND_WRITE (0x140)
34#define COMMAND_WRITE_ALL (0x110)
35
36//
37// Serial EEPROM data format
38//
39
40#define PACKED __attribute__ ((packed))
41
42typedef struct _EEPROM {
43 union {
44 unsigned char eprom_byte_data[128];
45 unsigned short eprom_short_data[64];
46 struct {
47 unsigned char version PACKED; // EEPROM Version "1" for now
48 unsigned char box_id PACKED; // Box ID (Standalone, SOHO, embedded, etc)
49 unsigned char major_hw_version PACKED; // Major Hardware version (Hex)
50 unsigned char minor_hw_version PACKED; // Minor Hardware Version (Hex)
51 unsigned char mfg_id[3] PACKED; // Manufacturer ID (3 character Alphabetic)
52 unsigned char mfg_serial_number[10] PACKED; // Manufacturer Serial number
53 unsigned char mfg_date[3] PACKED; // Date of Mfg (Formatted YY:MM:DD)
54 unsigned char country PACKED; // Country of deployment
55 unsigned char mac_Address[6] PACKED; // MAC Address
56 unsigned char oem_string[20] PACKED; // OEM ID string
57 unsigned short feature_bits1 PACKED; // Feature Bits 1
58 unsigned short feature_bits2 PACKED; // Feature Bits 2
59 unsigned char filler[75] PACKED; // Unused/Undefined “0” initialized
60 unsigned short checksum PACKED; // byte accumulated short checksum
61 } eprom_struct;
62 } variant;
63} eeprom_struct;
64
65/* These settings must be mutually exclusive */
66#define FEATURE_BITS1_DRAMSIZE_16MEG 0x0001 /* 0 signifies 4 MEG system */
67#define FEATURE_BITS1_DRAMSIZE_8MEG 0x0002 /* 1 in bit 1 = 8MEG system */
68#define FEATURE_BITS1_DRAMSIZE_64MEG 0x0004 /* 1 in bit 2 = 64MEG system */
69
70#define FEATURE_BITS1_CPUIS90MEG 0x0010
71
72extern void seprom_init(void);
73extern eeprom_struct* get_seprom_ptr(void);
74extern unsigned char* get_eeprom_mac_address(void);
75
76#endif /* MP1000_SEPROM_H */
77
diff --git a/include/asm-arm/arch-ebsa110/memory.h b/include/asm-arm/arch-ebsa110/memory.h
index 5a9493e12275..02f144520c10 100644
--- a/include/asm-arm/arch-ebsa110/memory.h
+++ b/include/asm-arm/arch-ebsa110/memory.h
@@ -19,7 +19,7 @@
19/* 19/*
20 * Physical DRAM offset. 20 * Physical DRAM offset.
21 */ 21 */
22#define PHYS_OFFSET (0x00000000UL) 22#define PHYS_OFFSET UL(0x00000000)
23 23
24/* 24/*
25 * We keep this 1:1 so that we don't interfere 25 * We keep this 1:1 so that we don't interfere
diff --git a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h
index 70576b17f922..776f9d377057 100644
--- a/include/asm-arm/arch-ebsa285/io.h
+++ b/include/asm-arm/arch-ebsa285/io.h
@@ -14,6 +14,8 @@
14#ifndef __ASM_ARM_ARCH_IO_H 14#ifndef __ASM_ARM_ARCH_IO_H
15#define __ASM_ARM_ARCH_IO_H 15#define __ASM_ARM_ARCH_IO_H
16 16
17#include <asm/hardware.h>
18
17#define IO_SPACE_LIMIT 0xffff 19#define IO_SPACE_LIMIT 0xffff
18 20
19/* 21/*
diff --git a/include/asm-arm/arch-ebsa285/memory.h b/include/asm-arm/arch-ebsa285/memory.h
index d0466f9987d3..09e335cd687d 100644
--- a/include/asm-arm/arch-ebsa285/memory.h
+++ b/include/asm-arm/arch-ebsa285/memory.h
@@ -46,14 +46,14 @@ extern unsigned long __bus_to_virt(unsigned long);
46#if defined(CONFIG_ARCH_FOOTBRIDGE) 46#if defined(CONFIG_ARCH_FOOTBRIDGE)
47 47
48/* Task size and page offset at 3GB */ 48/* Task size and page offset at 3GB */
49#define TASK_SIZE (0xbf000000UL) 49#define TASK_SIZE UL(0xbf000000)
50#define PAGE_OFFSET (0xc0000000UL) 50#define PAGE_OFFSET UL(0xc0000000)
51 51
52#elif defined(CONFIG_ARCH_CO285) 52#elif defined(CONFIG_ARCH_CO285)
53 53
54/* Task size and page offset at 1.5GB */ 54/* Task size and page offset at 1.5GB */
55#define TASK_SIZE (0x5f000000UL) 55#define TASK_SIZE UL(0x5f000000)
56#define PAGE_OFFSET (0x60000000UL) 56#define PAGE_OFFSET UL(0x60000000)
57 57
58#else 58#else
59 59
@@ -64,7 +64,7 @@ extern unsigned long __bus_to_virt(unsigned long);
64/* 64/*
65 * Physical DRAM offset. 65 * Physical DRAM offset.
66 */ 66 */
67#define PHYS_OFFSET (0x00000000UL) 67#define PHYS_OFFSET UL(0x00000000)
68 68
69/* 69/*
70 * This decides where the kernel will search for a free chunk of vm 70 * This decides where the kernel will search for a free chunk of vm
diff --git a/include/asm-arm/arch-epxa10db/io.h b/include/asm-arm/arch-epxa10db/io.h
index 1f0afa257621..9fe100c9d6be 100644
--- a/include/asm-arm/arch-epxa10db/io.h
+++ b/include/asm-arm/arch-epxa10db/io.h
@@ -20,6 +20,8 @@
20#ifndef __ASM_ARM_ARCH_IO_H 20#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H 21#define __ASM_ARM_ARCH_IO_H
22 22
23#include <asm/hardware.h>
24
23#define IO_SPACE_LIMIT 0xffff 25#define IO_SPACE_LIMIT 0xffff
24 26
25 27
diff --git a/include/asm-arm/arch-epxa10db/memory.h b/include/asm-arm/arch-epxa10db/memory.h
index 3f86bf7f67f0..999541b6a9f5 100644
--- a/include/asm-arm/arch-epxa10db/memory.h
+++ b/include/asm-arm/arch-epxa10db/memory.h
@@ -23,7 +23,7 @@
23/* 23/*
24 * Physical DRAM offset. 24 * Physical DRAM offset.
25 */ 25 */
26#define PHYS_OFFSET (0x00000000UL) 26#define PHYS_OFFSET UL(0x00000000)
27 27
28/* 28/*
29 * Virtual view <-> DMA view memory address translations 29 * Virtual view <-> DMA view memory address translations
diff --git a/include/asm-arm/arch-h720x/io.h b/include/asm-arm/arch-h720x/io.h
index 68814828c9a7..d3ccfd8172b7 100644
--- a/include/asm-arm/arch-h720x/io.h
+++ b/include/asm-arm/arch-h720x/io.h
@@ -14,7 +14,7 @@
14#ifndef __ASM_ARM_ARCH_IO_H 14#ifndef __ASM_ARM_ARCH_IO_H
15#define __ASM_ARM_ARCH_IO_H 15#define __ASM_ARM_ARCH_IO_H
16 16
17#include <asm/arch/hardware.h> 17#include <asm/hardware.h>
18 18
19#define IO_SPACE_LIMIT 0xffffffff 19#define IO_SPACE_LIMIT 0xffffffff
20 20
diff --git a/include/asm-arm/arch-h720x/memory.h b/include/asm-arm/arch-h720x/memory.h
index 5633447af268..4a1bfd78a0fe 100644
--- a/include/asm-arm/arch-h720x/memory.h
+++ b/include/asm-arm/arch-h720x/memory.h
@@ -11,7 +11,7 @@
11 * Page offset: 11 * Page offset:
12 * ( 0xc0000000UL ) 12 * ( 0xc0000000UL )
13 */ 13 */
14#define PHYS_OFFSET (0x40000000UL) 14#define PHYS_OFFSET UL(0x40000000)
15 15
16/* 16/*
17 * Virtual view <-> DMA view memory address translations 17 * Virtual view <-> DMA view memory address translations
diff --git a/include/asm-arm/arch-imx/io.h b/include/asm-arm/arch-imx/io.h
index 28a4cca6a4cb..b191cdd05576 100644
--- a/include/asm-arm/arch-imx/io.h
+++ b/include/asm-arm/arch-imx/io.h
@@ -20,6 +20,8 @@
20#ifndef __ASM_ARM_ARCH_IO_H 20#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H 21#define __ASM_ARM_ARCH_IO_H
22 22
23#include <asm/hardware.h>
24
23#define IO_SPACE_LIMIT 0xffffffff 25#define IO_SPACE_LIMIT 0xffffffff
24 26
25#define __io(a) ((void __iomem *)(a)) 27#define __io(a) ((void __iomem *)(a))
diff --git a/include/asm-arm/arch-imx/memory.h b/include/asm-arm/arch-imx/memory.h
index 116a91fa14f1..d09ae32cd2f4 100644
--- a/include/asm-arm/arch-imx/memory.h
+++ b/include/asm-arm/arch-imx/memory.h
@@ -21,7 +21,7 @@
21#ifndef __ASM_ARCH_MMU_H 21#ifndef __ASM_ARCH_MMU_H
22#define __ASM_ARCH_MMU_H 22#define __ASM_ARCH_MMU_H
23 23
24#define PHYS_OFFSET (0x08000000UL) 24#define PHYS_OFFSET UL(0x08000000)
25 25
26/* 26/*
27 * Virtual view <-> DMA view memory address translations 27 * Virtual view <-> DMA view memory address translations
diff --git a/include/asm-arm/arch-integrator/hardware.h b/include/asm-arm/arch-integrator/hardware.h
index be2716eeaa02..6f0947bc500d 100644
--- a/include/asm-arm/arch-integrator/hardware.h
+++ b/include/asm-arm/arch-integrator/hardware.h
@@ -33,15 +33,6 @@
33#define IO_SIZE 0x0B000000 // How much? 33#define IO_SIZE 0x0B000000 // How much?
34#define IO_START INTEGRATOR_HDR_BASE // PA of IO 34#define IO_START INTEGRATOR_HDR_BASE // PA of IO
35 35
36/*
37 * Similar to above, but for PCI addresses (memory, IO, Config and the
38 * V3 chip itself). WARNING: this has to mirror definitions in platform.h
39 */
40#define PCI_MEMORY_VADDR 0xe8000000
41#define PCI_CONFIG_VADDR 0xec000000
42#define PCI_V3_VADDR 0xed000000
43#define PCI_IO_VADDR 0xee000000
44
45#define PCIO_BASE PCI_IO_VADDR 36#define PCIO_BASE PCI_IO_VADDR
46#define PCIMEM_BASE PCI_MEMORY_VADDR 37#define PCIMEM_BASE PCI_MEMORY_VADDR
47 38
diff --git a/include/asm-arm/arch-integrator/io.h b/include/asm-arm/arch-integrator/io.h
index fbea8be67d26..31f2deab51b0 100644
--- a/include/asm-arm/arch-integrator/io.h
+++ b/include/asm-arm/arch-integrator/io.h
@@ -22,6 +22,14 @@
22 22
23#define IO_SPACE_LIMIT 0xffff 23#define IO_SPACE_LIMIT 0xffff
24 24
25/*
26 * WARNING: this has to mirror definitions in platform.h
27 */
28#define PCI_MEMORY_VADDR 0xe8000000
29#define PCI_CONFIG_VADDR 0xec000000
30#define PCI_V3_VADDR 0xed000000
31#define PCI_IO_VADDR 0xee000000
32
25#define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a))) 33#define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a)))
26#define __mem_pci(a) (a) 34#define __mem_pci(a) (a)
27#define __mem_isa(a) ((a) + PCI_MEMORY_VADDR) 35#define __mem_isa(a) ((a) + PCI_MEMORY_VADDR)
diff --git a/include/asm-arm/arch-integrator/memory.h b/include/asm-arm/arch-integrator/memory.h
index 2087ea7d28a9..1ab56d783e7c 100644
--- a/include/asm-arm/arch-integrator/memory.h
+++ b/include/asm-arm/arch-integrator/memory.h
@@ -23,8 +23,8 @@
23/* 23/*
24 * Physical DRAM offset. 24 * Physical DRAM offset.
25 */ 25 */
26#define PHYS_OFFSET (0x00000000UL) 26#define PHYS_OFFSET UL(0x00000000)
27#define BUS_OFFSET (0x80000000UL) 27#define BUS_OFFSET UL(0x80000000)
28 28
29/* 29/*
30 * Virtual view <-> DMA view memory address translations 30 * Virtual view <-> DMA view memory address translations
diff --git a/include/asm-arm/arch-iop3xx/io.h b/include/asm-arm/arch-iop3xx/io.h
index 2761dfd8694d..f39046a6ab14 100644
--- a/include/asm-arm/arch-iop3xx/io.h
+++ b/include/asm-arm/arch-iop3xx/io.h
@@ -11,6 +11,8 @@
11#ifndef __ASM_ARM_ARCH_IO_H 11#ifndef __ASM_ARM_ARCH_IO_H
12#define __ASM_ARM_ARCH_IO_H 12#define __ASM_ARM_ARCH_IO_H
13 13
14#include <asm/hardware.h>
15
14#define IO_SPACE_LIMIT 0xffffffff 16#define IO_SPACE_LIMIT 0xffffffff
15 17
16#define __io(p) ((void __iomem *)(p)) 18#define __io(p) ((void __iomem *)(p))
diff --git a/include/asm-arm/arch-iop3xx/memory.h b/include/asm-arm/arch-iop3xx/memory.h
index 45351f5cd904..bc62f4b13235 100644
--- a/include/asm-arm/arch-iop3xx/memory.h
+++ b/include/asm-arm/arch-iop3xx/memory.h
@@ -12,9 +12,9 @@
12 * Physical DRAM offset. 12 * Physical DRAM offset.
13 */ 13 */
14#ifndef CONFIG_ARCH_IOP331 14#ifndef CONFIG_ARCH_IOP331
15#define PHYS_OFFSET (0xa0000000UL) 15#define PHYS_OFFSET UL(0xa0000000)
16#else 16#else
17#define PHYS_OFFSET (0x00000000UL) 17#define PHYS_OFFSET UL(0x00000000)
18#endif 18#endif
19 19
20/* 20/*
diff --git a/include/asm-arm/arch-ixp2000/io.h b/include/asm-arm/arch-ixp2000/io.h
index 3241cd6f0778..7fbcdf9931ee 100644
--- a/include/asm-arm/arch-ixp2000/io.h
+++ b/include/asm-arm/arch-ixp2000/io.h
@@ -15,6 +15,8 @@
15#ifndef __ASM_ARM_ARCH_IO_H 15#ifndef __ASM_ARM_ARCH_IO_H
16#define __ASM_ARM_ARCH_IO_H 16#define __ASM_ARM_ARCH_IO_H
17 17
18#include <asm/hardware.h>
19
18#define IO_SPACE_LIMIT 0xffffffff 20#define IO_SPACE_LIMIT 0xffffffff
19#define __mem_pci(a) (a) 21#define __mem_pci(a) (a)
20 22
diff --git a/include/asm-arm/arch-ixp2000/ixp2000-regs.h b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
index 32aece069869..def089d693d2 100644
--- a/include/asm-arm/arch-ixp2000/ixp2000-regs.h
+++ b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
@@ -392,4 +392,47 @@
392#define WDT_RESET_ENABLE 0x01000000 392#define WDT_RESET_ENABLE 0x01000000
393 393
394 394
395/*
396 * MSF registers. The IXP2400 and IXP2800 have somewhat different MSF
397 * units, but the registers that differ between the two don't overlap,
398 * so we can have one register list for both.
399 */
400#define IXP2000_MSF_REG(x) ((volatile unsigned long*)(IXP2000_MSF_VIRT_BASE + (x)))
401#define IXP2000_MSF_RX_CONTROL IXP2000_MSF_REG(0x0000)
402#define IXP2000_MSF_TX_CONTROL IXP2000_MSF_REG(0x0004)
403#define IXP2000_MSF_INTERRUPT_STATUS IXP2000_MSF_REG(0x0008)
404#define IXP2000_MSF_INTERRUPT_ENABLE IXP2000_MSF_REG(0x000c)
405#define IXP2000_MSF_CSIX_TYPE_MAP IXP2000_MSF_REG(0x0010)
406#define IXP2000_MSF_FC_EGRESS_STATUS IXP2000_MSF_REG(0x0014)
407#define IXP2000_MSF_FC_INGRESS_STATUS IXP2000_MSF_REG(0x0018)
408#define IXP2000_MSF_HWM_CONTROL IXP2000_MSF_REG(0x0024)
409#define IXP2000_MSF_FC_STATUS_OVERRIDE IXP2000_MSF_REG(0x0028)
410#define IXP2000_MSF_CLOCK_CONTROL IXP2000_MSF_REG(0x002c)
411#define IXP2000_MSF_RX_PORT_MAP IXP2000_MSF_REG(0x0040)
412#define IXP2000_MSF_RBUF_ELEMENT_DONE IXP2000_MSF_REG(0x0044)
413#define IXP2000_MSF_RX_MPHY_POLL_LIMIT IXP2000_MSF_REG(0x0048)
414#define IXP2000_MSF_RX_CALENDAR_LENGTH IXP2000_MSF_REG(0x0048)
415#define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_0 IXP2000_MSF_REG(0x0050)
416#define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_1 IXP2000_MSF_REG(0x0054)
417#define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_2 IXP2000_MSF_REG(0x0058)
418#define IXP2000_MSF_TX_SEQUENCE_0 IXP2000_MSF_REG(0x0060)
419#define IXP2000_MSF_TX_SEQUENCE_1 IXP2000_MSF_REG(0x0064)
420#define IXP2000_MSF_TX_SEQUENCE_2 IXP2000_MSF_REG(0x0068)
421#define IXP2000_MSF_TX_MPHY_POLL_LIMIT IXP2000_MSF_REG(0x0070)
422#define IXP2000_MSF_TX_CALENDAR_LENGTH IXP2000_MSF_REG(0x0070)
423#define IXP2000_MSF_RX_UP_CONTROL_0 IXP2000_MSF_REG(0x0080)
424#define IXP2000_MSF_RX_UP_CONTROL_1 IXP2000_MSF_REG(0x0084)
425#define IXP2000_MSF_RX_UP_CONTROL_2 IXP2000_MSF_REG(0x0088)
426#define IXP2000_MSF_RX_UP_CONTROL_3 IXP2000_MSF_REG(0x008c)
427#define IXP2000_MSF_TX_UP_CONTROL_0 IXP2000_MSF_REG(0x0090)
428#define IXP2000_MSF_TX_UP_CONTROL_1 IXP2000_MSF_REG(0x0094)
429#define IXP2000_MSF_TX_UP_CONTROL_2 IXP2000_MSF_REG(0x0098)
430#define IXP2000_MSF_TX_UP_CONTROL_3 IXP2000_MSF_REG(0x009c)
431#define IXP2000_MSF_TRAIN_DATA IXP2000_MSF_REG(0x00a0)
432#define IXP2000_MSF_TRAIN_CALENDAR IXP2000_MSF_REG(0x00a4)
433#define IXP2000_MSF_TRAIN_FLOW_CONTROL IXP2000_MSF_REG(0x00a8)
434#define IXP2000_MSF_TX_CALENDAR_0 IXP2000_MSF_REG(0x1000)
435#define IXP2000_MSF_RX_PORT_CALENDAR_STATUS IXP2000_MSF_REG(0x1400)
436
437
395#endif /* _IXP2000_H_ */ 438#endif /* _IXP2000_H_ */
diff --git a/include/asm-arm/arch-ixp2000/memory.h b/include/asm-arm/arch-ixp2000/memory.h
index d0f415c6dae9..21e1de51e3f6 100644
--- a/include/asm-arm/arch-ixp2000/memory.h
+++ b/include/asm-arm/arch-ixp2000/memory.h
@@ -13,7 +13,7 @@
13#ifndef __ASM_ARCH_MEMORY_H 13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H 14#define __ASM_ARCH_MEMORY_H
15 15
16#define PHYS_OFFSET (0x00000000UL) 16#define PHYS_OFFSET UL(0x00000000)
17 17
18/* 18/*
19 * Virtual view <-> DMA view memory address translations 19 * Virtual view <-> DMA view memory address translations
diff --git a/include/asm-arm/arch-ixp2000/platform.h b/include/asm-arm/arch-ixp2000/platform.h
index abdcf51bd283..a66317ab2071 100644
--- a/include/asm-arm/arch-ixp2000/platform.h
+++ b/include/asm-arm/arch-ixp2000/platform.h
@@ -15,40 +15,40 @@
15 15
16#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
17 17
18static inline unsigned long ixp2000_reg_read(volatile void *reg)
19{
20 return *((volatile unsigned long *)reg);
21}
22
23static inline void ixp2000_reg_write(volatile void *reg, unsigned long val)
24{
25 *((volatile unsigned long *)reg) = val;
26}
27
18/* 28/*
19 * The IXP2400 B0 silicon contains an erratum (#66) that causes writes 29 * On the IXP2400, we can't use XCB=000 due to chip bugs. We use
20 * to on-chip I/O register to not complete fully. What this means is 30 * XCB=101 instead, but that makes all I/O accesses bufferable. This
21 * that if you have a write to on-chip I/O followed by a back-to-back 31 * is not a problem in general, but we do have to be slightly more
22 * read or write, the first write will happen twice. OR...if it's 32 * careful because I/O writes are no longer automatically flushed out
23 * not a back-to-back transaction, the read or write will generate 33 * of the write buffer.
24 * incorrect data.
25 *
26 * The official work around for this is to set the on-chip I/O regions
27 * as XCB=101 and then force a read-back from the register.
28 * 34 *
35 * In cases where we want to make sure that a write has been flushed
36 * out of the write buffer before we proceed, for example when masking
37 * a device interrupt before re-enabling IRQs in CPSR, we can use this
38 * function, ixp2000_reg_wrb, which performs a write, a readback, and
39 * issues a dummy instruction dependent on the value of the readback
40 * (mov rX, rX) to make sure that the readback has completed before we
41 * continue.
29 */ 42 */
30#if defined(CONFIG_ARCH_ENP2611) || defined(CONFIG_ARCH_IXDP2400) || defined(CONFIG_ARCH_IXDP2401) 43static inline void ixp2000_reg_wrb(volatile void *reg, unsigned long val)
31
32#include <asm/system.h> /* Pickup local_irq_ functions */
33
34static inline void ixp2000_reg_write(volatile void *reg, unsigned long val)
35{ 44{
36 unsigned long dummy; 45 unsigned long dummy;
37 unsigned long flags;
38 46
39 local_irq_save(flags);
40 *((volatile unsigned long *)reg) = val; 47 *((volatile unsigned long *)reg) = val;
41 barrier(); 48
42 dummy = *((volatile unsigned long *)reg); 49 dummy = *((volatile unsigned long *)reg);
43 local_irq_restore(flags); 50 __asm__ __volatile__("mov %0, %0" : "+r" (dummy));
44}
45#else
46static inline void ixp2000_reg_write(volatile void *reg, unsigned long val)
47{
48 *((volatile unsigned long *)reg) = val;
49} 51}
50#endif /* IXDP2400 || IXDP2401 */
51#define ixp2000_reg_read(reg) (*((volatile unsigned long *)reg))
52 52
53/* 53/*
54 * Boards may multiplex different devices on the 2nd channel of 54 * Boards may multiplex different devices on the 2nd channel of
diff --git a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
index 004696a95bdb..2b149ed59149 100644
--- a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
+++ b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
@@ -36,11 +36,11 @@
36 * 36 *
37 * 0x6000000 0x00004000 ioremap'd QMgr 37 * 0x6000000 0x00004000 ioremap'd QMgr
38 * 38 *
39 * 0xC0000000 0x00001000 0xffbfe000 PCI CFG 39 * 0xC0000000 0x00001000 0xffbff000 PCI CFG
40 * 40 *
41 * 0xC4000000 0x00001000 0xffbfd000 EXP CFG 41 * 0xC4000000 0x00001000 0xffbfe000 EXP CFG
42 * 42 *
43 * 0xC8000000 0x0000C000 0xffbf2000 On-Chip Peripherals 43 * 0xC8000000 0x00013000 0xffbeb000 On-Chip Peripherals
44 */ 44 */
45 45
46/* 46/*
@@ -52,22 +52,22 @@
52 * Expansion BUS Configuration registers 52 * Expansion BUS Configuration registers
53 */ 53 */
54#define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000) 54#define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000)
55#define IXP4XX_EXP_CFG_BASE_VIRT (0xFFBFD000) 55#define IXP4XX_EXP_CFG_BASE_VIRT (0xFFBFE000)
56#define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000) 56#define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000)
57 57
58/* 58/*
59 * PCI Config registers 59 * PCI Config registers
60 */ 60 */
61#define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000) 61#define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000)
62#define IXP4XX_PCI_CFG_BASE_VIRT (0xFFBFE000) 62#define IXP4XX_PCI_CFG_BASE_VIRT (0xFFBFF000)
63#define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000) 63#define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000)
64 64
65/* 65/*
66 * Peripheral space 66 * Peripheral space
67 */ 67 */
68#define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000) 68#define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000)
69#define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBF2000) 69#define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBEB000)
70#define IXP4XX_PERIPHERAL_REGION_SIZE (0x0000C000) 70#define IXP4XX_PERIPHERAL_REGION_SIZE (0x00013000)
71 71
72/* 72/*
73 * Debug UART 73 * Debug UART
@@ -115,25 +115,48 @@
115/* 115/*
116 * Peripheral Space Register Region Base Addresses 116 * Peripheral Space Register Region Base Addresses
117 */ 117 */
118#define IXP4XX_UART1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x0000) 118#define IXP4XX_UART1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x0000)
119#define IXP4XX_UART2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x1000) 119#define IXP4XX_UART2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x1000)
120#define IXP4XX_PMU_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x2000) 120#define IXP4XX_PMU_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x2000)
121#define IXP4XX_INTC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x3000) 121#define IXP4XX_INTC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x3000)
122#define IXP4XX_GPIO_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x4000) 122#define IXP4XX_GPIO_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x4000)
123#define IXP4XX_TIMER_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x5000) 123#define IXP4XX_TIMER_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x5000)
124#define IXP4XX_EthA_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x9000) 124#define IXP4XX_NPEA_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x6000)
125#define IXP4XX_EthB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xA000) 125#define IXP4XX_NPEB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x7000)
126#define IXP4XX_USB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xB000) 126#define IXP4XX_NPEC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x8000)
127 127#define IXP4XX_EthB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x9000)
128#define IXP4XX_UART1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x0000) 128#define IXP4XX_EthC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xA000)
129#define IXP4XX_UART2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x1000) 129#define IXP4XX_USB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xB000)
130#define IXP4XX_PMU_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x2000) 130/* ixp46X only */
131#define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000) 131#define IXP4XX_EthA_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xC000)
132#define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000) 132#define IXP4XX_EthB1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xD000)
133#define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000) 133#define IXP4XX_EthB2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xE000)
134#define IXP4XX_EthA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000) 134#define IXP4XX_EthB3_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xF000)
135#define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000) 135#define IXP4XX_TIMESYNC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x10000)
136#define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000) 136#define IXP4XX_I2C_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x11000)
137#define IXP4XX_SSP_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x12000)
138
139
140#define IXP4XX_UART1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x0000)
141#define IXP4XX_UART2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x1000)
142#define IXP4XX_PMU_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x2000)
143#define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000)
144#define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000)
145#define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000)
146#define IXP4XX_NPEA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x6000)
147#define IXP4XX_NPEB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x7000)
148#define IXP4XX_NPEC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x8000)
149#define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000)
150#define IXP4XX_EthC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000)
151#define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000)
152/* ixp46X only */
153#define IXP4XX_EthA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xC000)
154#define IXP4XX_EthB1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xD000)
155#define IXP4XX_EthB2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xE000)
156#define IXP4XX_EthB3_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xF000)
157#define IXP4XX_TIMESYNC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x10000)
158#define IXP4XX_I2C_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x11000)
159#define IXP4XX_SSP_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x12000)
137 160
138/* 161/*
139 * Constants to make it easy to access Interrupt Controller registers 162 * Constants to make it easy to access Interrupt Controller registers
diff --git a/include/asm-arm/arch-ixp4xx/memory.h b/include/asm-arm/arch-ixp4xx/memory.h
index d348548b592b..e024d0a1a669 100644
--- a/include/asm-arm/arch-ixp4xx/memory.h
+++ b/include/asm-arm/arch-ixp4xx/memory.h
@@ -12,7 +12,7 @@
12/* 12/*
13 * Physical DRAM offset. 13 * Physical DRAM offset.
14 */ 14 */
15#define PHYS_OFFSET (0x00000000UL) 15#define PHYS_OFFSET UL(0x00000000)
16 16
17#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
18 18
diff --git a/include/asm-arm/arch-l7200/io.h b/include/asm-arm/arch-l7200/io.h
index fc012a39e2cb..cab8ad0adf09 100644
--- a/include/asm-arm/arch-l7200/io.h
+++ b/include/asm-arm/arch-l7200/io.h
@@ -10,7 +10,7 @@
10#ifndef __ASM_ARM_ARCH_IO_H 10#ifndef __ASM_ARM_ARCH_IO_H
11#define __ASM_ARM_ARCH_IO_H 11#define __ASM_ARM_ARCH_IO_H
12 12
13#include <asm/arch/hardware.h> 13#include <asm/hardware.h>
14 14
15#define IO_SPACE_LIMIT 0xffffffff 15#define IO_SPACE_LIMIT 0xffffffff
16 16
diff --git a/include/asm-arm/arch-l7200/memory.h b/include/asm-arm/arch-l7200/memory.h
index c5b9608cb137..9e50a171f78a 100644
--- a/include/asm-arm/arch-l7200/memory.h
+++ b/include/asm-arm/arch-l7200/memory.h
@@ -15,7 +15,7 @@
15/* 15/*
16 * Physical DRAM offset on the L7200 SDB. 16 * Physical DRAM offset on the L7200 SDB.
17 */ 17 */
18#define PHYS_OFFSET (0xf0000000UL) 18#define PHYS_OFFSET UL(0xf0000000)
19 19
20#define __virt_to_bus(x) __virt_to_phys(x) 20#define __virt_to_bus(x) __virt_to_phys(x)
21#define __bus_to_virt(x) __phys_to_virt(x) 21#define __bus_to_virt(x) __phys_to_virt(x)
diff --git a/include/asm-arm/arch-lh7a40x/io.h b/include/asm-arm/arch-lh7a40x/io.h
index c13bdd9add92..bbcd4335f441 100644
--- a/include/asm-arm/arch-lh7a40x/io.h
+++ b/include/asm-arm/arch-lh7a40x/io.h
@@ -11,6 +11,8 @@
11#ifndef __ASM_ARCH_IO_H 11#ifndef __ASM_ARCH_IO_H
12#define __ASM_ARCH_IO_H 12#define __ASM_ARCH_IO_H
13 13
14#include <asm/hardware.h>
15
14#define IO_SPACE_LIMIT 0xffffffff 16#define IO_SPACE_LIMIT 0xffffffff
15 17
16/* No ISA or PCI bus on this machine. */ 18/* No ISA or PCI bus on this machine. */
diff --git a/include/asm-arm/arch-lh7a40x/memory.h b/include/asm-arm/arch-lh7a40x/memory.h
index c650e6feb9d5..c92bcb837629 100644
--- a/include/asm-arm/arch-lh7a40x/memory.h
+++ b/include/asm-arm/arch-lh7a40x/memory.h
@@ -17,7 +17,7 @@
17/* 17/*
18 * Physical DRAM offset. 18 * Physical DRAM offset.
19 */ 19 */
20#define PHYS_OFFSET (0xc0000000UL) 20#define PHYS_OFFSET UL(0xc0000000)
21 21
22/* 22/*
23 * Virtual view <-> DMA view memory address translations 23 * Virtual view <-> DMA view memory address translations
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h
index 11fbf629bf75..3d5bcd545082 100644
--- a/include/asm-arm/arch-omap/io.h
+++ b/include/asm-arm/arch-omap/io.h
@@ -34,6 +34,8 @@
34#ifndef __ASM_ARM_ARCH_IO_H 34#ifndef __ASM_ARM_ARCH_IO_H
35#define __ASM_ARM_ARCH_IO_H 35#define __ASM_ARM_ARCH_IO_H
36 36
37#include <asm/hardware.h>
38
37#define IO_SPACE_LIMIT 0xffffffff 39#define IO_SPACE_LIMIT 0xffffffff
38 40
39/* 41/*
diff --git a/include/asm-arm/arch-omap/memory.h b/include/asm-arm/arch-omap/memory.h
index ef32d61eec7a..bf545b6e0a26 100644
--- a/include/asm-arm/arch-omap/memory.h
+++ b/include/asm-arm/arch-omap/memory.h
@@ -37,9 +37,9 @@
37 * Physical DRAM offset. 37 * Physical DRAM offset.
38 */ 38 */
39#if defined(CONFIG_ARCH_OMAP1) 39#if defined(CONFIG_ARCH_OMAP1)
40#define PHYS_OFFSET (0x10000000UL) 40#define PHYS_OFFSET UL(0x10000000)
41#elif defined(CONFIG_ARCH_OMAP2) 41#elif defined(CONFIG_ARCH_OMAP2)
42#define PHYS_OFFSET (0x80000000UL) 42#define PHYS_OFFSET UL(0x80000000)
43#endif 43#endif
44 44
45/* 45/*
@@ -66,7 +66,7 @@
66/* 66/*
67 * OMAP-1510 Local Bus address offset 67 * OMAP-1510 Local Bus address offset
68 */ 68 */
69#define OMAP1510_LB_OFFSET (0x30000000UL) 69#define OMAP1510_LB_OFFSET UL(0x30000000)
70 70
71#define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET) 71#define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET)
72#define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) 72#define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h
index cf35721cfa45..3e70bd95472c 100644
--- a/include/asm-arm/arch-pxa/hardware.h
+++ b/include/asm-arm/arch-pxa/hardware.h
@@ -44,12 +44,12 @@
44 44
45#ifndef __ASSEMBLY__ 45#ifndef __ASSEMBLY__
46 46
47# define __REG(x) (*((volatile unsigned long *)io_p2v(x))) 47# define __REG(x) (*((volatile u32 *)io_p2v(x)))
48 48
49/* With indexed regs we don't want to feed the index through io_p2v() 49/* With indexed regs we don't want to feed the index through io_p2v()
50 especially if it is a variable, otherwise horrible code will result. */ 50 especially if it is a variable, otherwise horrible code will result. */
51# define __REG2(x,y) \ 51# define __REG2(x,y) \
52 (*(volatile unsigned long *)((unsigned long)&__REG(x) + (y))) 52 (*(volatile u32 *)((u32)&__REG(x) + (y)))
53 53
54# define __PREG(x) (io_v2p((u32)&(x))) 54# define __PREG(x) (io_v2p((u32)&(x)))
55 55
diff --git a/include/asm-arm/arch-pxa/io.h b/include/asm-arm/arch-pxa/io.h
index c3bdbe44e21f..eb2dd58d397f 100644
--- a/include/asm-arm/arch-pxa/io.h
+++ b/include/asm-arm/arch-pxa/io.h
@@ -6,6 +6,8 @@
6#ifndef __ASM_ARM_ARCH_IO_H 6#ifndef __ASM_ARM_ARCH_IO_H
7#define __ASM_ARM_ARCH_IO_H 7#define __ASM_ARM_ARCH_IO_H
8 8
9#include <asm/hardware.h>
10
9#define IO_SPACE_LIMIT 0xffffffff 11#define IO_SPACE_LIMIT 0xffffffff
10 12
11/* 13/*
diff --git a/include/asm-arm/arch-pxa/irda.h b/include/asm-arm/arch-pxa/irda.h
new file mode 100644
index 000000000000..748406f384c2
--- /dev/null
+++ b/include/asm-arm/arch-pxa/irda.h
@@ -0,0 +1,17 @@
1#ifndef ASMARM_ARCH_IRDA_H
2#define ASMARM_ARCH_IRDA_H
3
4/* board specific transceiver capabilities */
5
6#define IR_OFF 1
7#define IR_SIRMODE 2
8#define IR_FIRMODE 4
9
10struct pxaficp_platform_data {
11 int transceiver_cap;
12 void (*transceiver_mode)(struct device *dev, int mode);
13};
14
15extern void pxa_set_ficp_info(struct pxaficp_platform_data *info);
16
17#endif
diff --git a/include/asm-arm/arch-pxa/memory.h b/include/asm-arm/arch-pxa/memory.h
index 58bad9748b5c..eaf6d43939e9 100644
--- a/include/asm-arm/arch-pxa/memory.h
+++ b/include/asm-arm/arch-pxa/memory.h
@@ -15,7 +15,7 @@
15/* 15/*
16 * Physical DRAM offset. 16 * Physical DRAM offset.
17 */ 17 */
18#define PHYS_OFFSET (0xa0000000UL) 18#define PHYS_OFFSET UL(0xa0000000)
19 19
20/* 20/*
21 * Virtual view <-> DMA view memory address translations 21 * Virtual view <-> DMA view memory address translations
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index 3af7165ab0d7..a75a2470f4f5 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -326,6 +326,25 @@
326#define STDLL __REG(0x40700000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */ 326#define STDLL __REG(0x40700000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */
327#define STDLH __REG(0x40700004) /* Divisor Latch High Register (DLAB = 1) (read/write) */ 327#define STDLH __REG(0x40700004) /* Divisor Latch High Register (DLAB = 1) (read/write) */
328 328
329/* Hardware UART (HWUART) */
330#define HWUART HWRBR
331#define HWRBR __REG(0x41600000) /* Receive Buffer Register (read only) */
332#define HWTHR __REG(0x41600000) /* Transmit Holding Register (write only) */
333#define HWIER __REG(0x41600004) /* Interrupt Enable Register (read/write) */
334#define HWIIR __REG(0x41600008) /* Interrupt ID Register (read only) */
335#define HWFCR __REG(0x41600008) /* FIFO Control Register (write only) */
336#define HWLCR __REG(0x4160000C) /* Line Control Register (read/write) */
337#define HWMCR __REG(0x41600010) /* Modem Control Register (read/write) */
338#define HWLSR __REG(0x41600014) /* Line Status Register (read only) */
339#define HWMSR __REG(0x41600018) /* Modem Status Register (read only) */
340#define HWSPR __REG(0x4160001C) /* Scratch Pad Register (read/write) */
341#define HWISR __REG(0x41600020) /* Infrared Selection Register (read/write) */
342#define HWFOR __REG(0x41600024) /* Receive FIFO Occupancy Register (read only) */
343#define HWABR __REG(0x41600028) /* Auto-Baud Control Register (read/write) */
344#define HWACR __REG(0x4160002C) /* Auto-Baud Count Register (read only) */
345#define HWDLL __REG(0x41600000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */
346#define HWDLH __REG(0x41600004) /* Divisor Latch High Register (DLAB = 1) (read/write) */
347
329#define IER_DMAE (1 << 7) /* DMA Requests Enable */ 348#define IER_DMAE (1 << 7) /* DMA Requests Enable */
330#define IER_UUE (1 << 6) /* UART Unit Enable */ 349#define IER_UUE (1 << 6) /* UART Unit Enable */
331#define IER_NRZE (1 << 5) /* NRZ coding Enable */ 350#define IER_NRZE (1 << 5) /* NRZ coding Enable */
@@ -1013,14 +1032,12 @@
1013#define ICCR0_LBM (1 << 1) /* Loopback mode */ 1032#define ICCR0_LBM (1 << 1) /* Loopback mode */
1014#define ICCR0_ITR (1 << 0) /* IrDA transmission */ 1033#define ICCR0_ITR (1 << 0) /* IrDA transmission */
1015 1034
1016#ifdef CONFIG_PXA27x
1017#define ICCR2_RXP (1 << 3) /* Receive Pin Polarity select */ 1035#define ICCR2_RXP (1 << 3) /* Receive Pin Polarity select */
1018#define ICCR2_TXP (1 << 2) /* Transmit Pin Polarity select */ 1036#define ICCR2_TXP (1 << 2) /* Transmit Pin Polarity select */
1019#define ICCR2_TRIG (3 << 0) /* Receive FIFO Trigger threshold */ 1037#define ICCR2_TRIG (3 << 0) /* Receive FIFO Trigger threshold */
1020#define ICCR2_TRIG_8 (0 << 0) /* >= 8 bytes */ 1038#define ICCR2_TRIG_8 (0 << 0) /* >= 8 bytes */
1021#define ICCR2_TRIG_16 (1 << 0) /* >= 16 bytes */ 1039#define ICCR2_TRIG_16 (1 << 0) /* >= 16 bytes */
1022#define ICCR2_TRIG_32 (2 << 0) /* >= 32 bytes */ 1040#define ICCR2_TRIG_32 (2 << 0) /* >= 32 bytes */
1023#endif
1024 1041
1025#ifdef CONFIG_PXA27x 1042#ifdef CONFIG_PXA27x
1026#define ICSR0_EOC (1 << 6) /* DMA End of Descriptor Chain */ 1043#define ICSR0_EOC (1 << 6) /* DMA End of Descriptor Chain */
@@ -1250,9 +1267,13 @@
1250#define GPIO40_FFDTR 40 /* FFUART data terminal Ready */ 1267#define GPIO40_FFDTR 40 /* FFUART data terminal Ready */
1251#define GPIO41_FFRTS 41 /* FFUART request to send */ 1268#define GPIO41_FFRTS 41 /* FFUART request to send */
1252#define GPIO42_BTRXD 42 /* BTUART receive data */ 1269#define GPIO42_BTRXD 42 /* BTUART receive data */
1270#define GPIO42_HWRXD 42 /* HWUART receive data */
1253#define GPIO43_BTTXD 43 /* BTUART transmit data */ 1271#define GPIO43_BTTXD 43 /* BTUART transmit data */
1272#define GPIO43_HWTXD 43 /* HWUART transmit data */
1254#define GPIO44_BTCTS 44 /* BTUART clear to send */ 1273#define GPIO44_BTCTS 44 /* BTUART clear to send */
1274#define GPIO44_HWCTS 44 /* HWUART clear to send */
1255#define GPIO45_BTRTS 45 /* BTUART request to send */ 1275#define GPIO45_BTRTS 45 /* BTUART request to send */
1276#define GPIO45_HWRTS 45 /* HWUART request to send */
1256#define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */ 1277#define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */
1257#define GPIO46_ICPRXD 46 /* ICP receive data */ 1278#define GPIO46_ICPRXD 46 /* ICP receive data */
1258#define GPIO46_STRXD 46 /* STD_UART receive data */ 1279#define GPIO46_STRXD 46 /* STD_UART receive data */
@@ -1378,17 +1399,26 @@
1378#define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT) 1399#define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT)
1379#define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT) 1400#define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT)
1380#define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN) 1401#define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN)
1402#define GPIO42_HWRXD_MD (42 | GPIO_ALT_FN_3_IN)
1381#define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT) 1403#define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT)
1404#define GPIO43_HWTXD_MD (43 | GPIO_ALT_FN_3_OUT)
1382#define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN) 1405#define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN)
1406#define GPIO44_HWCTS_MD (44 | GPIO_ALT_FN_3_IN)
1383#define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT) 1407#define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT)
1408#define GPIO45_HWRTS_MD (45 | GPIO_ALT_FN_3_OUT)
1384#define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT) 1409#define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT)
1385#define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN) 1410#define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN)
1386#define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN) 1411#define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN)
1387#define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT) 1412#define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT)
1388#define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT) 1413#define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT)
1389#define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT) 1414#define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT)
1415#define GPIO48_HWTXD_MD (48 | GPIO_ALT_FN_1_OUT)
1416#define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT)
1417#define GPIO49_HWRXD_MD (49 | GPIO_ALT_FN_1_IN)
1390#define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT) 1418#define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT)
1391#define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT) 1419#define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT)
1420#define GPIO50_HWCTS_MD (50 | GPIO_ALT_FN_1_IN)
1421#define GPIO51_HWRTS_MD (51 | GPIO_ALT_FN_1_OUT)
1392#define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT) 1422#define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT)
1393#define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT) 1423#define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT)
1394#define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT) 1424#define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT)
@@ -1763,6 +1793,7 @@
1763#define CKEN7_BTUART (1 << 7) /* BTUART Unit Clock Enable */ 1793#define CKEN7_BTUART (1 << 7) /* BTUART Unit Clock Enable */
1764#define CKEN6_FFUART (1 << 6) /* FFUART Unit Clock Enable */ 1794#define CKEN6_FFUART (1 << 6) /* FFUART Unit Clock Enable */
1765#define CKEN5_STUART (1 << 5) /* STUART Unit Clock Enable */ 1795#define CKEN5_STUART (1 << 5) /* STUART Unit Clock Enable */
1796#define CKEN4_HWUART (1 << 4) /* HWUART Unit Clock Enable */
1766#define CKEN4_SSP3 (1 << 4) /* SSP3 Unit Clock Enable */ 1797#define CKEN4_SSP3 (1 << 4) /* SSP3 Unit Clock Enable */
1767#define CKEN3_SSP (1 << 3) /* SSP Unit Clock Enable */ 1798#define CKEN3_SSP (1 << 3) /* SSP Unit Clock Enable */
1768#define CKEN3_SSP2 (1 << 3) /* SSP2 Unit Clock Enable */ 1799#define CKEN3_SSP2 (1 << 3) /* SSP2 Unit Clock Enable */
@@ -2282,4 +2313,11 @@
2282 2313
2283#endif 2314#endif
2284 2315
2316/* PWRMODE register M field values */
2317
2318#define PWRMODE_IDLE 0x1
2319#define PWRMODE_STANDBY 0x2
2320#define PWRMODE_SLEEP 0x3
2321#define PWRMODE_DEEPSLEEP 0x7
2322
2285#endif 2323#endif
diff --git a/include/asm-arm/arch-pxa/uncompress.h b/include/asm-arm/arch-pxa/uncompress.h
index 4428d3eb7432..fe38090444e0 100644
--- a/include/asm-arm/arch-pxa/uncompress.h
+++ b/include/asm-arm/arch-pxa/uncompress.h
@@ -12,6 +12,7 @@
12#define FFUART ((volatile unsigned long *)0x40100000) 12#define FFUART ((volatile unsigned long *)0x40100000)
13#define BTUART ((volatile unsigned long *)0x40200000) 13#define BTUART ((volatile unsigned long *)0x40200000)
14#define STUART ((volatile unsigned long *)0x40700000) 14#define STUART ((volatile unsigned long *)0x40700000)
15#define HWUART ((volatile unsigned long *)0x41600000)
15 16
16#define UART FFUART 17#define UART FFUART
17 18
diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h
index 24453c405a87..b4da08d7a336 100644
--- a/include/asm-arm/arch-rpc/io.h
+++ b/include/asm-arm/arch-rpc/io.h
@@ -13,6 +13,8 @@
13#ifndef __ASM_ARM_ARCH_IO_H 13#ifndef __ASM_ARM_ARCH_IO_H
14#define __ASM_ARM_ARCH_IO_H 14#define __ASM_ARM_ARCH_IO_H
15 15
16#include <asm/hardware.h>
17
16#define IO_SPACE_LIMIT 0xffffffff 18#define IO_SPACE_LIMIT 0xffffffff
17 19
18/* 20/*
diff --git a/include/asm-arm/arch-rpc/memory.h b/include/asm-arm/arch-rpc/memory.h
index 33fc75cdead0..0592cb3f0c74 100644
--- a/include/asm-arm/arch-rpc/memory.h
+++ b/include/asm-arm/arch-rpc/memory.h
@@ -21,7 +21,7 @@
21/* 21/*
22 * Physical DRAM offset. 22 * Physical DRAM offset.
23 */ 23 */
24#define PHYS_OFFSET (0x10000000UL) 24#define PHYS_OFFSET UL(0x10000000)
25 25
26/* 26/*
27 * These are exactly the same on the RiscPC as the 27 * These are exactly the same on the RiscPC as the
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h
index ac57bc887d82..4790491ba9d0 100644
--- a/include/asm-arm/arch-s3c2410/fb.h
+++ b/include/asm-arm/arch-s3c2410/fb.h
@@ -13,6 +13,7 @@
13 * 07-Sep-2004 RTP Created file 13 * 07-Sep-2004 RTP Created file
14 * 03-Nov-2004 BJD Updated and minor cleanups 14 * 03-Nov-2004 BJD Updated and minor cleanups
15 * 03-Aug-2005 RTP Renamed to fb.h 15 * 03-Aug-2005 RTP Renamed to fb.h
16 * 26-Oct-2005 BJD Changed name of platdata init
16*/ 17*/
17 18
18#ifndef __ASM_ARM_FB_H 19#ifndef __ASM_ARM_FB_H
@@ -64,6 +65,6 @@ struct s3c2410fb_mach_info {
64 unsigned long lpcsel; 65 unsigned long lpcsel;
65}; 66};
66 67
67void __init set_s3c2410fb_info(struct s3c2410fb_mach_info *hard_s3c2410fb_info); 68extern void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *);
68 69
69#endif /* __ASM_ARM_FB_H */ 70#endif /* __ASM_ARM_FB_H */
diff --git a/include/asm-arm/arch-s3c2410/io.h b/include/asm-arm/arch-s3c2410/io.h
index 4bf272ed9add..16fbc8afffd9 100644
--- a/include/asm-arm/arch-s3c2410/io.h
+++ b/include/asm-arm/arch-s3c2410/io.h
@@ -15,6 +15,8 @@
15#ifndef __ASM_ARM_ARCH_IO_H 15#ifndef __ASM_ARM_ARCH_IO_H
16#define __ASM_ARM_ARCH_IO_H 16#define __ASM_ARM_ARCH_IO_H
17 17
18#include <asm/hardware.h>
19
18#define IO_SPACE_LIMIT 0xffffffff 20#define IO_SPACE_LIMIT 0xffffffff
19 21
20/* 22/*
diff --git a/include/asm-arm/arch-s3c2410/memory.h b/include/asm-arm/arch-s3c2410/memory.h
index 3380ab1d0749..6ab834a14c8e 100644
--- a/include/asm-arm/arch-s3c2410/memory.h
+++ b/include/asm-arm/arch-s3c2410/memory.h
@@ -28,9 +28,9 @@
28 * and at 0x0C000000 for S3C2400 28 * and at 0x0C000000 for S3C2400
29 */ 29 */
30#ifdef CONFIG_CPU_S3C2400 30#ifdef CONFIG_CPU_S3C2400
31#define PHYS_OFFSET (0x0C000000UL) 31#define PHYS_OFFSET UL(0x0C000000)
32#else 32#else
33#define PHYS_OFFSET (0x30000000UL) 33#define PHYS_OFFSET UL(0x30000000)
34#endif 34#endif
35 35
36/* 36/*
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h
index 2053cbacffc3..cb33d57c146c 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpio.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpio.h
@@ -20,6 +20,7 @@
20 * 18-11-2004 BJD Added S3C2440 AC97 controls 20 * 18-11-2004 BJD Added S3C2440 AC97 controls
21 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 21 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
22 * 28-Mar-2005 LCVR Fixed definition of GPB10 22 * 28-Mar-2005 LCVR Fixed definition of GPB10
23 * 26-Oct-2005 BJD Added generic configuration types
23*/ 24*/
24 25
25 26
@@ -43,6 +44,11 @@
43/* general configuration options */ 44/* general configuration options */
44 45
45#define S3C2410_GPIO_LEAVE (0xFFFFFFFF) 46#define S3C2410_GPIO_LEAVE (0xFFFFFFFF)
47#define S3C2410_GPIO_INPUT (0xFFFFFFF0)
48#define S3C2410_GPIO_OUTPUT (0xFFFFFFF1)
49#define S3C2410_GPIO_IRQ (0xFFFFFFF2) /* not available for all */
50#define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* not available on A */
51#define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */
46 52
47/* configure GPIO ports A..G */ 53/* configure GPIO ports A..G */
48 54
diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h
index 19c3b1e186bb..28711aaa4968 100644
--- a/include/asm-arm/arch-sa1100/hardware.h
+++ b/include/asm-arm/arch-sa1100/hardware.h
@@ -22,13 +22,6 @@
22 22
23 23
24/* 24/*
25 * We requires absolute addresses i.e. (PCMCIA_IO_0_BASE + 0x3f8) for
26 * in*()/out*() macros to be usable for all cases.
27 */
28#define PCIO_BASE 0
29
30
31/*
32 * SA1100 internal I/O mappings 25 * SA1100 internal I/O mappings
33 * 26 *
34 * We have the following mapping: 27 * We have the following mapping:
diff --git a/include/asm-arm/arch-sa1100/io.h b/include/asm-arm/arch-sa1100/io.h
index 7d969ffbd3bb..9d4fe6cf205b 100644
--- a/include/asm-arm/arch-sa1100/io.h
+++ b/include/asm-arm/arch-sa1100/io.h
@@ -10,13 +10,19 @@
10#ifndef __ASM_ARM_ARCH_IO_H 10#ifndef __ASM_ARM_ARCH_IO_H
11#define __ASM_ARM_ARCH_IO_H 11#define __ASM_ARM_ARCH_IO_H
12 12
13#include <asm/hardware.h>
14
13#define IO_SPACE_LIMIT 0xffffffff 15#define IO_SPACE_LIMIT 0xffffffff
14 16
15/* 17/*
16 * We don't actually have real ISA nor PCI buses, but there is so many 18 * We don't actually have real ISA nor PCI buses, but there is so many
17 * drivers out there that might just work if we fake them... 19 * drivers out there that might just work if we fake them...
18 */ 20 */
19#define __io(a) ((void __iomem *)(PCIO_BASE + (a))) 21static inline void __iomem *__io(unsigned long addr)
22{
23 return (void __iomem *)addr;
24}
25#define __io(a) __io(a)
20#define __mem_pci(a) (a) 26#define __mem_pci(a) (a)
21#define __mem_isa(a) (a) 27#define __mem_isa(a) (a)
22 28
diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h
index 8743ff5c1b23..0fc555b4c912 100644
--- a/include/asm-arm/arch-sa1100/memory.h
+++ b/include/asm-arm/arch-sa1100/memory.h
@@ -13,7 +13,7 @@
13/* 13/*
14 * Physical DRAM offset is 0xc0000000 on the SA1100 14 * Physical DRAM offset is 0xc0000000 on the SA1100
15 */ 15 */
16#define PHYS_OFFSET (0xc0000000UL) 16#define PHYS_OFFSET UL(0xc0000000)
17 17
18#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
19 19
diff --git a/include/asm-arm/arch-sa1100/system.h b/include/asm-arm/arch-sa1100/system.h
index 6f52118ba1a4..0f0612f79b2b 100644
--- a/include/asm-arm/arch-sa1100/system.h
+++ b/include/asm-arm/arch-sa1100/system.h
@@ -4,6 +4,7 @@
4 * Copyright (c) 1999 Nicolas Pitre <nico@cam.org> 4 * Copyright (c) 1999 Nicolas Pitre <nico@cam.org>
5 */ 5 */
6#include <linux/config.h> 6#include <linux/config.h>
7#include <asm/hardware.h>
7 8
8static inline void arch_idle(void) 9static inline void arch_idle(void)
9{ 10{
diff --git a/include/asm-arm/arch-shark/io.h b/include/asm-arm/arch-shark/io.h
index 5e6ed0038b2b..87ffa27f2962 100644
--- a/include/asm-arm/arch-shark/io.h
+++ b/include/asm-arm/arch-shark/io.h
@@ -11,6 +11,8 @@
11#ifndef __ASM_ARM_ARCH_IO_H 11#ifndef __ASM_ARM_ARCH_IO_H
12#define __ASM_ARM_ARCH_IO_H 12#define __ASM_ARM_ARCH_IO_H
13 13
14#include <asm/hardware.h>
15
14#define IO_SPACE_LIMIT 0xffffffff 16#define IO_SPACE_LIMIT 0xffffffff
15 17
16/* 18/*
diff --git a/include/asm-arm/arch-shark/memory.h b/include/asm-arm/arch-shark/memory.h
index 8ff956d25463..95a29b4bc5d0 100644
--- a/include/asm-arm/arch-shark/memory.h
+++ b/include/asm-arm/arch-shark/memory.h
@@ -15,7 +15,7 @@
15/* 15/*
16 * Physical DRAM offset. 16 * Physical DRAM offset.
17 */ 17 */
18#define PHYS_OFFSET (0x08000000UL) 18#define PHYS_OFFSET UL(0x08000000)
19 19
20#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
21 21
diff --git a/include/asm-arm/arch-versatile/memory.h b/include/asm-arm/arch-versatile/memory.h
index 7b8b7cc422fa..a9370976cc5e 100644
--- a/include/asm-arm/arch-versatile/memory.h
+++ b/include/asm-arm/arch-versatile/memory.h
@@ -23,7 +23,7 @@
23/* 23/*
24 * Physical DRAM offset. 24 * Physical DRAM offset.
25 */ 25 */
26#define PHYS_OFFSET (0x00000000UL) 26#define PHYS_OFFSET UL(0x00000000)
27 27
28/* 28/*
29 * Virtual view <-> DMA view memory address translations 29 * Virtual view <-> DMA view memory address translations
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
index aad7aad026b3..e007dd990da5 100644
--- a/include/asm-arm/bitops.h
+++ b/include/asm-arm/bitops.h
@@ -347,7 +347,6 @@ static inline unsigned long __ffs(unsigned long word)
347 * the clz instruction for much better code efficiency. 347 * the clz instruction for much better code efficiency.
348 */ 348 */
349 349
350static __inline__ int generic_fls(int x);
351#define fls(x) \ 350#define fls(x) \
352 ( __builtin_constant_p(x) ? generic_fls(x) : \ 351 ( __builtin_constant_p(x) ? generic_fls(x) : \
353 ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) ) 352 ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) )
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h
index d62ade4e4cbb..e3e8541ee63b 100644
--- a/include/asm-arm/dma-mapping.h
+++ b/include/asm-arm/dma-mapping.h
@@ -70,7 +70,7 @@ static inline int dma_mapping_error(dma_addr_t dma_addr)
70 * device-viewed address. 70 * device-viewed address.
71 */ 71 */
72extern void * 72extern void *
73dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, int gfp); 73dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp);
74 74
75/** 75/**
76 * dma_free_coherent - free memory allocated by dma_alloc_coherent 76 * dma_free_coherent - free memory allocated by dma_alloc_coherent
@@ -117,7 +117,7 @@ int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma,
117 * device-viewed address. 117 * device-viewed address.
118 */ 118 */
119extern void * 119extern void *
120dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, int gfp); 120dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp);
121 121
122#define dma_free_writecombine(dev,size,cpu_addr,handle) \ 122#define dma_free_writecombine(dev,size,cpu_addr,handle) \
123 dma_free_coherent(dev,size,cpu_addr,handle) 123 dma_free_coherent(dev,size,cpu_addr,handle)
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index 5c4ae8f5dbb0..2e6799632f12 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -26,7 +26,6 @@
26#include <linux/types.h> 26#include <linux/types.h>
27#include <asm/byteorder.h> 27#include <asm/byteorder.h>
28#include <asm/memory.h> 28#include <asm/memory.h>
29#include <asm/arch/hardware.h>
30 29
31/* 30/*
32 * ISA I/O bus memory addresses are 1:1 with the physical address. 31 * ISA I/O bus memory addresses are 1:1 with the physical address.
diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h
index 4fa95084a8c0..eb262e078c46 100644
--- a/include/asm-arm/mach/arch.h
+++ b/include/asm-arm/mach/arch.h
@@ -48,10 +48,11 @@ struct machine_desc {
48 * Set of macros to define architecture features. This is built into 48 * Set of macros to define architecture features. This is built into
49 * a table by the linker. 49 * a table by the linker.
50 */ 50 */
51#define MACHINE_START(_type,_name) \ 51#define MACHINE_START(_type,_name) \
52const struct machine_desc __mach_desc_##_type \ 52static const struct machine_desc __mach_desc_##_type \
53 __attribute_used__ \
53 __attribute__((__section__(".arch.info.init"))) = { \ 54 __attribute__((__section__(".arch.info.init"))) = { \
54 .nr = MACH_TYPE_##_type, \ 55 .nr = MACH_TYPE_##_type, \
55 .name = _name, 56 .name = _name,
56 57
57#define MACHINE_END \ 58#define MACHINE_END \
diff --git a/include/asm-arm/mach/flash.h b/include/asm-arm/mach/flash.h
index a92887d4b2cb..cd57436d9874 100644
--- a/include/asm-arm/mach/flash.h
+++ b/include/asm-arm/mach/flash.h
@@ -14,6 +14,7 @@ struct mtd_partition;
14 14
15/* 15/*
16 * map_name: the map probe function name 16 * map_name: the map probe function name
17 * name: flash device name (eg, as used with mtdparts=)
17 * width: width of mapped device 18 * width: width of mapped device
18 * init: method called at driver/device initialisation 19 * init: method called at driver/device initialisation
19 * exit: method called at driver/device removal 20 * exit: method called at driver/device removal
@@ -23,6 +24,7 @@ struct mtd_partition;
23 */ 24 */
24struct flash_platform_data { 25struct flash_platform_data {
25 const char *map_name; 26 const char *map_name;
27 const char *name;
26 unsigned int width; 28 unsigned int width;
27 int (*init)(void); 29 int (*init)(void);
28 void (*exit)(void); 30 void (*exit)(void);
diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h
index 9ac47cf8d2e4..b338936bde4f 100644
--- a/include/asm-arm/mach/map.h
+++ b/include/asm-arm/mach/map.h
@@ -11,7 +11,7 @@
11 */ 11 */
12struct map_desc { 12struct map_desc {
13 unsigned long virtual; 13 unsigned long virtual;
14 unsigned long physical; 14 unsigned long pfn;
15 unsigned long length; 15 unsigned long length;
16 unsigned int type; 16 unsigned int type;
17}; 17};
@@ -27,6 +27,9 @@ struct meminfo;
27#define MT_ROM 6 27#define MT_ROM 6
28#define MT_IXP2000_DEVICE 7 28#define MT_IXP2000_DEVICE 7
29 29
30#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT)
31#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)
32
30extern void create_memmap_holes(struct meminfo *); 33extern void create_memmap_holes(struct meminfo *);
31extern void memtable_init(struct meminfo *); 34extern void memtable_init(struct meminfo *);
32extern void iotable_init(struct map_desc *, int); 35extern void iotable_init(struct map_desc *, int);
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index a8a933a775db..a547ee598c6c 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -12,6 +12,16 @@
12#ifndef __ASM_ARM_MEMORY_H 12#ifndef __ASM_ARM_MEMORY_H
13#define __ASM_ARM_MEMORY_H 13#define __ASM_ARM_MEMORY_H
14 14
15/*
16 * Allow for constants defined here to be used from assembly code
17 * by prepending the UL suffix only with actual C code compilation.
18 */
19#ifndef __ASSEMBLY__
20#define UL(x) (x##UL)
21#else
22#define UL(x) (x)
23#endif
24
15#include <linux/config.h> 25#include <linux/config.h>
16#include <linux/compiler.h> 26#include <linux/compiler.h>
17#include <asm/arch/memory.h> 27#include <asm/arch/memory.h>
@@ -21,20 +31,20 @@
21 * TASK_SIZE - the maximum size of a user space task. 31 * TASK_SIZE - the maximum size of a user space task.
22 * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area 32 * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area
23 */ 33 */
24#define TASK_SIZE (0xbf000000UL) 34#define TASK_SIZE UL(0xbf000000)
25#define TASK_UNMAPPED_BASE (0x40000000UL) 35#define TASK_UNMAPPED_BASE UL(0x40000000)
26#endif 36#endif
27 37
28/* 38/*
29 * The maximum size of a 26-bit user space task. 39 * The maximum size of a 26-bit user space task.
30 */ 40 */
31#define TASK_SIZE_26 (0x04000000UL) 41#define TASK_SIZE_26 UL(0x04000000)
32 42
33/* 43/*
34 * Page offset: 3GB 44 * Page offset: 3GB
35 */ 45 */
36#ifndef PAGE_OFFSET 46#ifndef PAGE_OFFSET
37#define PAGE_OFFSET (0xc0000000UL) 47#define PAGE_OFFSET UL(0xc0000000)
38#endif 48#endif
39 49
40/* 50/*
@@ -58,6 +68,13 @@
58#error Top of user space clashes with start of module space 68#error Top of user space clashes with start of module space
59#endif 69#endif
60 70
71/*
72 * The XIP kernel gets mapped at the bottom of the module vm area.
73 * Since we use sections to map it, this macro replaces the physical address
74 * with its virtual address while keeping offset from the base section.
75 */
76#define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff))
77
61#ifndef __ASSEMBLY__ 78#ifndef __ASSEMBLY__
62 79
63/* 80/*
diff --git a/include/asm-arm/tlb.h b/include/asm-arm/tlb.h
index 9bb325c54645..f49bfb78c221 100644
--- a/include/asm-arm/tlb.h
+++ b/include/asm-arm/tlb.h
@@ -27,11 +27,7 @@
27 */ 27 */
28struct mmu_gather { 28struct mmu_gather {
29 struct mm_struct *mm; 29 struct mm_struct *mm;
30 unsigned int freed;
31 unsigned int fullmm; 30 unsigned int fullmm;
32
33 unsigned int flushes;
34 unsigned int avoided_flushes;
35}; 31};
36 32
37DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); 33DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
@@ -39,11 +35,9 @@ DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
39static inline struct mmu_gather * 35static inline struct mmu_gather *
40tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) 36tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
41{ 37{
42 int cpu = smp_processor_id(); 38 struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
43 struct mmu_gather *tlb = &per_cpu(mmu_gathers, cpu);
44 39
45 tlb->mm = mm; 40 tlb->mm = mm;
46 tlb->freed = 0;
47 tlb->fullmm = full_mm_flush; 41 tlb->fullmm = full_mm_flush;
48 42
49 return tlb; 43 return tlb;
@@ -52,24 +46,13 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
52static inline void 46static inline void
53tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) 47tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
54{ 48{
55 struct mm_struct *mm = tlb->mm;
56 unsigned long freed = tlb->freed;
57 int rss = get_mm_counter(mm, rss);
58
59 if (rss < freed)
60 freed = rss;
61 add_mm_counter(mm, rss, -freed);
62
63 if (tlb->fullmm) 49 if (tlb->fullmm)
64 flush_tlb_mm(mm); 50 flush_tlb_mm(tlb->mm);
65 51
66 /* keep the page table cache within bounds */ 52 /* keep the page table cache within bounds */
67 check_pgt_cache(); 53 check_pgt_cache();
68}
69 54
70static inline unsigned int tlb_is_full_mm(struct mmu_gather *tlb) 55 put_cpu_var(mmu_gathers);
71{
72 return tlb->fullmm;
73} 56}
74 57
75#define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0) 58#define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0)
diff --git a/include/asm-arm26/tlb.h b/include/asm-arm26/tlb.h
index 1316352a58f3..08ddd85b8d35 100644
--- a/include/asm-arm26/tlb.h
+++ b/include/asm-arm26/tlb.h
@@ -10,24 +10,20 @@
10 */ 10 */
11struct mmu_gather { 11struct mmu_gather {
12 struct mm_struct *mm; 12 struct mm_struct *mm;
13 unsigned int freed; 13 unsigned int need_flush;
14 unsigned int fullmm; 14 unsigned int fullmm;
15
16 unsigned int flushes;
17 unsigned int avoided_flushes;
18}; 15};
19 16
20extern struct mmu_gather mmu_gathers[NR_CPUS]; 17DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
21 18
22static inline struct mmu_gather * 19static inline struct mmu_gather *
23tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) 20tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
24{ 21{
25 int cpu = smp_processor_id(); 22 struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
26 struct mmu_gather *tlb = &mmu_gathers[cpu];
27 23
28 tlb->mm = mm; 24 tlb->mm = mm;
29 tlb->freed = 0; 25 tlb->need_flush = 0;
30 tlb->fullmm = full_mm_flush; 26 tlb->fullmm = full_mm_flush;
31 27
32 return tlb; 28 return tlb;
33} 29}
@@ -35,30 +31,13 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
35static inline void 31static inline void
36tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) 32tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
37{ 33{
38 struct mm_struct *mm = tlb->mm; 34 if (tlb->need_flush)
39 unsigned long freed = tlb->freed; 35 flush_tlb_mm(tlb->mm);
40 int rss = get_mm_counter(mm, rss);
41
42 if (rss < freed)
43 freed = rss;
44 add_mm_counter(mm, rss, -freed);
45
46 if (freed) {
47 flush_tlb_mm(mm);
48 tlb->flushes++;
49 } else {
50 tlb->avoided_flushes++;
51 }
52 36
53 /* keep the page table cache within bounds */ 37 /* keep the page table cache within bounds */
54 check_pgt_cache(); 38 check_pgt_cache();
55}
56
57 39
58static inline unsigned int 40 put_cpu_var(mmu_gathers);
59tlb_is_full_mm(struct mmu_gather *tlb)
60{
61 return tlb->fullmm;
62} 41}
63 42
64#define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0) 43#define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0)
@@ -71,7 +50,13 @@ tlb_is_full_mm(struct mmu_gather *tlb)
71 } while (0) 50 } while (0)
72#define tlb_end_vma(tlb,vma) do { } while (0) 51#define tlb_end_vma(tlb,vma) do { } while (0)
73 52
74#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) 53static inline void
54tlb_remove_page(struct mmu_gather *tlb, struct page *page)
55{
56 tlb->need_flush = 1;
57 free_page_and_swap_cache(page);
58}
59
75#define pte_free_tlb(tlb,ptep) pte_free(ptep) 60#define pte_free_tlb(tlb,ptep) pte_free(ptep)
76#define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp) 61#define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp)
77 62
diff --git a/include/asm-cris/dma-mapping.h b/include/asm-cris/dma-mapping.h
index 0b5c3fdaefe1..8eff51349ae7 100644
--- a/include/asm-cris/dma-mapping.h
+++ b/include/asm-cris/dma-mapping.h
@@ -15,14 +15,14 @@
15 15
16#ifdef CONFIG_PCI 16#ifdef CONFIG_PCI
17void *dma_alloc_coherent(struct device *dev, size_t size, 17void *dma_alloc_coherent(struct device *dev, size_t size,
18 dma_addr_t *dma_handle, int flag); 18 dma_addr_t *dma_handle, gfp_t flag);
19 19
20void dma_free_coherent(struct device *dev, size_t size, 20void dma_free_coherent(struct device *dev, size_t size,
21 void *vaddr, dma_addr_t dma_handle); 21 void *vaddr, dma_addr_t dma_handle);
22#else 22#else
23static inline void * 23static inline void *
24dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 24dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
25 int flag) 25 gfp_t flag)
26{ 26{
27 BUG(); 27 BUG();
28 return NULL; 28 return NULL;
diff --git a/include/asm-frv/dma-mapping.h b/include/asm-frv/dma-mapping.h
index 0206ab35eae0..5003e017fd1e 100644
--- a/include/asm-frv/dma-mapping.h
+++ b/include/asm-frv/dma-mapping.h
@@ -13,7 +13,7 @@
13extern unsigned long __nongprelbss dma_coherent_mem_start; 13extern unsigned long __nongprelbss dma_coherent_mem_start;
14extern unsigned long __nongprelbss dma_coherent_mem_end; 14extern unsigned long __nongprelbss dma_coherent_mem_end;
15 15
16void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, int gfp); 16void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp);
17void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle); 17void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle);
18 18
19/* 19/*
diff --git a/include/asm-frv/pci.h b/include/asm-frv/pci.h
index b4efe5e3591a..1168451c275f 100644
--- a/include/asm-frv/pci.h
+++ b/include/asm-frv/pci.h
@@ -32,7 +32,7 @@ extern void pcibios_set_master(struct pci_dev *dev);
32extern void pcibios_penalize_isa_irq(int irq); 32extern void pcibios_penalize_isa_irq(int irq);
33 33
34#ifdef CONFIG_MMU 34#ifdef CONFIG_MMU
35extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle); 35extern void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle);
36extern void consistent_free(void *vaddr); 36extern void consistent_free(void *vaddr);
37extern void consistent_sync(void *vaddr, size_t size, int direction); 37extern void consistent_sync(void *vaddr, size_t size, int direction);
38extern void consistent_sync_page(struct page *page, unsigned long offset, 38extern void consistent_sync_page(struct page *page, unsigned long offset,
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h
index c20ec257ecc0..68c6fea994d9 100644
--- a/include/asm-generic/4level-fixup.h
+++ b/include/asm-generic/4level-fixup.h
@@ -10,14 +10,9 @@
10 10
11#define pud_t pgd_t 11#define pud_t pgd_t
12 12
13#define pmd_alloc(mm, pud, address) \ 13#define pmd_alloc(mm, pud, address) \
14({ pmd_t *ret; \ 14 ((unlikely(pgd_none(*(pud))) && __pmd_alloc(mm, pud, address))? \
15 if (pgd_none(*pud)) \ 15 NULL: pmd_offset(pud, address))
16 ret = __pmd_alloc(mm, pud, address); \
17 else \
18 ret = pmd_offset(pud, address); \
19 ret; \
20})
21 16
22#define pud_alloc(mm, pgd, address) (pgd) 17#define pud_alloc(mm, pgd, address) (pgd)
23#define pud_offset(pgd, start) (pgd) 18#define pud_offset(pgd, start) (pgd)
diff --git a/include/asm-generic/dma-mapping-broken.h b/include/asm-generic/dma-mapping-broken.h
index fd9de9502dff..a7f1a55ce6b0 100644
--- a/include/asm-generic/dma-mapping-broken.h
+++ b/include/asm-generic/dma-mapping-broken.h
@@ -6,7 +6,7 @@
6 6
7static inline void * 7static inline void *
8dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 8dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
9 int flag) 9 gfp_t flag)
10{ 10{
11 BUG(); 11 BUG();
12 return NULL; 12 return NULL;
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index ff28c8b31f58..7dca30a26c53 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -8,7 +8,7 @@
8 * - update the page tables 8 * - update the page tables
9 * - inform the TLB about the new one 9 * - inform the TLB about the new one
10 * 10 *
11 * We hold the mm semaphore for reading and vma->vm_mm->page_table_lock. 11 * We hold the mm semaphore for reading, and the pte lock.
12 * 12 *
13 * Note: the old pte is known to not be writable, so we don't need to 13 * Note: the old pte is known to not be writable, so we don't need to
14 * worry about dirty bits etc getting lost. 14 * worry about dirty bits etc getting lost.
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index 7d0298347ee7..cdd4145243cd 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -35,16 +35,13 @@
35#endif 35#endif
36 36
37/* struct mmu_gather is an opaque type used by the mm code for passing around 37/* struct mmu_gather is an opaque type used by the mm code for passing around
38 * any data needed by arch specific code for tlb_remove_page. This structure 38 * any data needed by arch specific code for tlb_remove_page.
39 * can be per-CPU or per-MM as the page table lock is held for the duration of
40 * TLB shootdown.
41 */ 39 */
42struct mmu_gather { 40struct mmu_gather {
43 struct mm_struct *mm; 41 struct mm_struct *mm;
44 unsigned int nr; /* set to ~0U means fast mode */ 42 unsigned int nr; /* set to ~0U means fast mode */
45 unsigned int need_flush;/* Really unmapped some ptes? */ 43 unsigned int need_flush;/* Really unmapped some ptes? */
46 unsigned int fullmm; /* non-zero means full mm flush */ 44 unsigned int fullmm; /* non-zero means full mm flush */
47 unsigned long freed;
48 struct page * pages[FREE_PTE_NR]; 45 struct page * pages[FREE_PTE_NR];
49}; 46};
50 47
@@ -57,7 +54,7 @@ DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
57static inline struct mmu_gather * 54static inline struct mmu_gather *
58tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) 55tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
59{ 56{
60 struct mmu_gather *tlb = &per_cpu(mmu_gathers, smp_processor_id()); 57 struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
61 58
62 tlb->mm = mm; 59 tlb->mm = mm;
63 60
@@ -65,7 +62,6 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
65 tlb->nr = num_online_cpus() > 1 ? 0U : ~0U; 62 tlb->nr = num_online_cpus() > 1 ? 0U : ~0U;
66 63
67 tlb->fullmm = full_mm_flush; 64 tlb->fullmm = full_mm_flush;
68 tlb->freed = 0;
69 65
70 return tlb; 66 return tlb;
71} 67}
@@ -85,28 +81,17 @@ tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
85 81
86/* tlb_finish_mmu 82/* tlb_finish_mmu
87 * Called at the end of the shootdown operation to free up any resources 83 * Called at the end of the shootdown operation to free up any resources
88 * that were required. The page table lock is still held at this point. 84 * that were required.
89 */ 85 */
90static inline void 86static inline void
91tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) 87tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
92{ 88{
93 int freed = tlb->freed;
94 struct mm_struct *mm = tlb->mm;
95 int rss = get_mm_counter(mm, rss);
96
97 if (rss < freed)
98 freed = rss;
99 add_mm_counter(mm, rss, -freed);
100 tlb_flush_mmu(tlb, start, end); 89 tlb_flush_mmu(tlb, start, end);
101 90
102 /* keep the page table cache within bounds */ 91 /* keep the page table cache within bounds */
103 check_pgt_cache(); 92 check_pgt_cache();
104}
105 93
106static inline unsigned int 94 put_cpu_var(mmu_gathers);
107tlb_is_full_mm(struct mmu_gather *tlb)
108{
109 return tlb->fullmm;
110} 95}
111 96
112/* tlb_remove_page 97/* tlb_remove_page
diff --git a/include/asm-i386/mach-summit/mach_mpparse.h b/include/asm-i386/mach-summit/mach_mpparse.h
index 2b9e6d55bef1..1cce2b924a80 100644
--- a/include/asm-i386/mach-summit/mach_mpparse.h
+++ b/include/asm-i386/mach-summit/mach_mpparse.h
@@ -22,7 +22,6 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,
22{ 22{
23} 23}
24 24
25extern int usb_early_handoff;
26static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, 25static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
27 char *productid) 26 char *productid)
28{ 27{
@@ -32,7 +31,6 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
32 || !strncmp(productid, "RUTHLESS SMP", 12))){ 31 || !strncmp(productid, "RUTHLESS SMP", 12))){
33 use_cyclone = 1; /*enable cyclone-timer*/ 32 use_cyclone = 1; /*enable cyclone-timer*/
34 setup_summit(); 33 setup_summit();
35 usb_early_handoff = 1;
36 return 1; 34 return 1;
37 } 35 }
38 return 0; 36 return 0;
@@ -46,7 +44,6 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
46 || !strncmp(oem_table_id, "EXA", 3))){ 44 || !strncmp(oem_table_id, "EXA", 3))){
47 use_cyclone = 1; /*enable cyclone-timer*/ 45 use_cyclone = 1; /*enable cyclone-timer*/
48 setup_summit(); 46 setup_summit();
49 usb_early_handoff = 1;
50 return 1; 47 return 1;
51 } 48 }
52 return 0; 49 return 0;
diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h
index 348fe3a4879d..620a90641ea8 100644
--- a/include/asm-i386/mmzone.h
+++ b/include/asm-i386/mmzone.h
@@ -88,12 +88,6 @@ static inline int pfn_to_nid(unsigned long pfn)
88 __pgdat->node_start_pfn + __pgdat->node_spanned_pages; \ 88 __pgdat->node_start_pfn + __pgdat->node_spanned_pages; \
89}) 89})
90 90
91#define local_mapnr(kvaddr) \
92({ \
93 unsigned long __pfn = __pa(kvaddr) >> PAGE_SHIFT; \
94 (__pfn - node_start_pfn(pfn_to_nid(__pfn))); \
95})
96
97/* XXX: FIXME -- wli */ 91/* XXX: FIXME -- wli */
98#define kern_addr_valid(kaddr) (0) 92#define kern_addr_valid(kaddr) (0)
99 93
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index d101ac414f07..0e3ec809352d 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -203,7 +203,8 @@ extern unsigned long pg0[];
203#define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE)) 203#define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))
204#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) 204#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
205 205
206#define pmd_none(x) (!pmd_val(x)) 206/* To avoid harmful races, pmd_none(x) should check only the lower when PAE */
207#define pmd_none(x) (!(unsigned long)pmd_val(x))
207#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) 208#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT)
208#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) 209#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0)
209#define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) 210#define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
diff --git a/include/asm-i386/rwsem.h b/include/asm-i386/rwsem.h
index 7625a675852f..be4ab859238e 100644
--- a/include/asm-i386/rwsem.h
+++ b/include/asm-i386/rwsem.h
@@ -284,5 +284,10 @@ LOCK_PREFIX "xadd %0,(%2)"
284 return tmp+delta; 284 return tmp+delta;
285} 285}
286 286
287static inline int rwsem_is_locked(struct rw_semaphore *sem)
288{
289 return (sem->count != 0);
290}
291
287#endif /* __KERNEL__ */ 292#endif /* __KERNEL__ */
288#endif /* _I386_RWSEM_H */ 293#endif /* _I386_RWSEM_H */
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
index 79e89a7db566..ca5ea994d688 100644
--- a/include/asm-ia64/machvec.h
+++ b/include/asm-ia64/machvec.h
@@ -26,7 +26,7 @@ typedef void ia64_mv_cpu_init_t (void);
26typedef void ia64_mv_irq_init_t (void); 26typedef void ia64_mv_irq_init_t (void);
27typedef void ia64_mv_send_ipi_t (int, int, int, int); 27typedef void ia64_mv_send_ipi_t (int, int, int, int);
28typedef void ia64_mv_timer_interrupt_t (int, void *, struct pt_regs *); 28typedef void ia64_mv_timer_interrupt_t (int, void *, struct pt_regs *);
29typedef void ia64_mv_global_tlb_purge_t (unsigned long, unsigned long, unsigned long); 29typedef void ia64_mv_global_tlb_purge_t (struct mm_struct *, unsigned long, unsigned long, unsigned long);
30typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *); 30typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *);
31typedef unsigned int ia64_mv_local_vector_to_irq (u8); 31typedef unsigned int ia64_mv_local_vector_to_irq (u8);
32typedef char *ia64_mv_pci_get_legacy_mem_t (struct pci_bus *); 32typedef char *ia64_mv_pci_get_legacy_mem_t (struct pci_bus *);
@@ -37,7 +37,7 @@ typedef int ia64_mv_pci_legacy_write_t (struct pci_bus *, u16 port, u32 val,
37 37
38/* DMA-mapping interface: */ 38/* DMA-mapping interface: */
39typedef void ia64_mv_dma_init (void); 39typedef void ia64_mv_dma_init (void);
40typedef void *ia64_mv_dma_alloc_coherent (struct device *, size_t, dma_addr_t *, int); 40typedef void *ia64_mv_dma_alloc_coherent (struct device *, size_t, dma_addr_t *, gfp_t);
41typedef void ia64_mv_dma_free_coherent (struct device *, size_t, void *, dma_addr_t); 41typedef void ia64_mv_dma_free_coherent (struct device *, size_t, void *, dma_addr_t);
42typedef dma_addr_t ia64_mv_dma_map_single (struct device *, void *, size_t, int); 42typedef dma_addr_t ia64_mv_dma_map_single (struct device *, void *, size_t, int);
43typedef void ia64_mv_dma_unmap_single (struct device *, dma_addr_t, size_t, int); 43typedef void ia64_mv_dma_unmap_single (struct device *, dma_addr_t, size_t, int);
diff --git a/include/asm-ia64/machvec_hpzx1.h b/include/asm-ia64/machvec_hpzx1.h
index daafe504c5f4..e90daf9ce340 100644
--- a/include/asm-ia64/machvec_hpzx1.h
+++ b/include/asm-ia64/machvec_hpzx1.h
@@ -1,8 +1,7 @@
1#ifndef _ASM_IA64_MACHVEC_HPZX1_h 1#ifndef _ASM_IA64_MACHVEC_HPZX1_h
2#define _ASM_IA64_MACHVEC_HPZX1_h 2#define _ASM_IA64_MACHVEC_HPZX1_h
3 3
4extern ia64_mv_setup_t dig_setup; 4extern ia64_mv_setup_t dig_setup;
5extern ia64_mv_setup_t sba_setup;
6extern ia64_mv_dma_alloc_coherent sba_alloc_coherent; 5extern ia64_mv_dma_alloc_coherent sba_alloc_coherent;
7extern ia64_mv_dma_free_coherent sba_free_coherent; 6extern ia64_mv_dma_free_coherent sba_free_coherent;
8extern ia64_mv_dma_map_single sba_map_single; 7extern ia64_mv_dma_map_single sba_map_single;
@@ -19,15 +18,15 @@ extern ia64_mv_dma_mapping_error sba_dma_mapping_error;
19 * platform's machvec structure. When compiling a non-generic kernel, 18 * platform's machvec structure. When compiling a non-generic kernel,
20 * the macros are used directly. 19 * the macros are used directly.
21 */ 20 */
22#define platform_name "hpzx1" 21#define platform_name "hpzx1"
23#define platform_setup sba_setup 22#define platform_setup dig_setup
24#define platform_dma_init machvec_noop 23#define platform_dma_init machvec_noop
25#define platform_dma_alloc_coherent sba_alloc_coherent 24#define platform_dma_alloc_coherent sba_alloc_coherent
26#define platform_dma_free_coherent sba_free_coherent 25#define platform_dma_free_coherent sba_free_coherent
27#define platform_dma_map_single sba_map_single 26#define platform_dma_map_single sba_map_single
28#define platform_dma_unmap_single sba_unmap_single 27#define platform_dma_unmap_single sba_unmap_single
29#define platform_dma_map_sg sba_map_sg 28#define platform_dma_map_sg sba_map_sg
30#define platform_dma_unmap_sg sba_unmap_sg 29#define platform_dma_unmap_sg sba_unmap_sg
31#define platform_dma_sync_single_for_cpu machvec_dma_sync_single 30#define platform_dma_sync_single_for_cpu machvec_dma_sync_single
32#define platform_dma_sync_sg_for_cpu machvec_dma_sync_sg 31#define platform_dma_sync_sg_for_cpu machvec_dma_sync_sg
33#define platform_dma_sync_single_for_device machvec_dma_sync_single 32#define platform_dma_sync_single_for_device machvec_dma_sync_single
diff --git a/include/asm-ia64/machvec_hpzx1_swiotlb.h b/include/asm-ia64/machvec_hpzx1_swiotlb.h
index 9924b1b00a6c..f00a34a148ff 100644
--- a/include/asm-ia64/machvec_hpzx1_swiotlb.h
+++ b/include/asm-ia64/machvec_hpzx1_swiotlb.h
@@ -2,7 +2,6 @@
2#define _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h 2#define _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h
3 3
4extern ia64_mv_setup_t dig_setup; 4extern ia64_mv_setup_t dig_setup;
5extern ia64_mv_dma_init hwsw_init;
6extern ia64_mv_dma_alloc_coherent hwsw_alloc_coherent; 5extern ia64_mv_dma_alloc_coherent hwsw_alloc_coherent;
7extern ia64_mv_dma_free_coherent hwsw_free_coherent; 6extern ia64_mv_dma_free_coherent hwsw_free_coherent;
8extern ia64_mv_dma_map_single hwsw_map_single; 7extern ia64_mv_dma_map_single hwsw_map_single;
@@ -26,7 +25,7 @@ extern ia64_mv_dma_sync_sg_for_device hwsw_sync_sg_for_device;
26#define platform_name "hpzx1_swiotlb" 25#define platform_name "hpzx1_swiotlb"
27 26
28#define platform_setup dig_setup 27#define platform_setup dig_setup
29#define platform_dma_init hwsw_init 28#define platform_dma_init machvec_noop
30#define platform_dma_alloc_coherent hwsw_alloc_coherent 29#define platform_dma_alloc_coherent hwsw_alloc_coherent
31#define platform_dma_free_coherent hwsw_free_coherent 30#define platform_dma_free_coherent hwsw_free_coherent
32#define platform_dma_map_single hwsw_map_single 31#define platform_dma_map_single hwsw_map_single
diff --git a/include/asm-ia64/meminit.h b/include/asm-ia64/meminit.h
index 1590dc65b30b..46501b01a5c5 100644
--- a/include/asm-ia64/meminit.h
+++ b/include/asm-ia64/meminit.h
@@ -16,10 +16,11 @@
16 * - initrd (optional) 16 * - initrd (optional)
17 * - command line string 17 * - command line string
18 * - kernel code & data 18 * - kernel code & data
19 * - Kernel memory map built from EFI memory map
19 * 20 *
20 * More could be added if necessary 21 * More could be added if necessary
21 */ 22 */
22#define IA64_MAX_RSVD_REGIONS 5 23#define IA64_MAX_RSVD_REGIONS 6
23 24
24struct rsvd_region { 25struct rsvd_region {
25 unsigned long start; /* virtual address of beginning of element */ 26 unsigned long start; /* virtual address of beginning of element */
@@ -33,6 +34,7 @@ extern void find_memory (void);
33extern void reserve_memory (void); 34extern void reserve_memory (void);
34extern void find_initrd (void); 35extern void find_initrd (void);
35extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg); 36extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg);
37extern void efi_memmap_init(unsigned long *, unsigned long *);
36 38
37/* 39/*
38 * For rounding an address to the next IA64_GRANULE_SIZE or order 40 * For rounding an address to the next IA64_GRANULE_SIZE or order
@@ -41,7 +43,7 @@ extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg
41#define GRANULEROUNDUP(n) (((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1)) 43#define GRANULEROUNDUP(n) (((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1))
42#define ORDERROUNDDOWN(n) ((n) & ~((PAGE_SIZE<<MAX_ORDER)-1)) 44#define ORDERROUNDDOWN(n) ((n) & ~((PAGE_SIZE<<MAX_ORDER)-1))
43 45
44#ifdef CONFIG_DISCONTIGMEM 46#ifdef CONFIG_NUMA
45 extern void call_pernode_memory (unsigned long start, unsigned long len, void *func); 47 extern void call_pernode_memory (unsigned long start, unsigned long len, void *func);
46#else 48#else
47# define call_pernode_memory(start, len, func) (*func)(start, len, 0) 49# define call_pernode_memory(start, len, func) (*func)(start, len, 0)
diff --git a/include/asm-ia64/mmzone.h b/include/asm-ia64/mmzone.h
index d32f51e3d6c2..34efe88eb849 100644
--- a/include/asm-ia64/mmzone.h
+++ b/include/asm-ia64/mmzone.h
@@ -15,7 +15,7 @@
15#include <asm/page.h> 15#include <asm/page.h>
16#include <asm/meminit.h> 16#include <asm/meminit.h>
17 17
18#ifdef CONFIG_DISCONTIGMEM 18#ifdef CONFIG_NUMA
19 19
20static inline int pfn_to_nid(unsigned long pfn) 20static inline int pfn_to_nid(unsigned long pfn)
21{ 21{
@@ -31,6 +31,10 @@ static inline int pfn_to_nid(unsigned long pfn)
31#endif 31#endif
32} 32}
33 33
34#ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
35extern int early_pfn_to_nid(unsigned long pfn);
36#endif
37
34#ifdef CONFIG_IA64_DIG /* DIG systems are small */ 38#ifdef CONFIG_IA64_DIG /* DIG systems are small */
35# define MAX_PHYSNODE_ID 8 39# define MAX_PHYSNODE_ID 8
36# define NR_NODE_MEMBLKS (MAX_NUMNODES * 8) 40# define NR_NODE_MEMBLKS (MAX_NUMNODES * 8)
@@ -39,8 +43,8 @@ static inline int pfn_to_nid(unsigned long pfn)
39# define NR_NODE_MEMBLKS (MAX_NUMNODES * 4) 43# define NR_NODE_MEMBLKS (MAX_NUMNODES * 4)
40#endif 44#endif
41 45
42#else /* CONFIG_DISCONTIGMEM */ 46#else /* CONFIG_NUMA */
43# define NR_NODE_MEMBLKS (MAX_NUMNODES * 4) 47# define NR_NODE_MEMBLKS (MAX_NUMNODES * 4)
44#endif /* CONFIG_DISCONTIGMEM */ 48#endif /* CONFIG_NUMA */
45 49
46#endif /* _ASM_IA64_MMZONE_H */ 50#endif /* _ASM_IA64_MMZONE_H */
diff --git a/include/asm-ia64/nodedata.h b/include/asm-ia64/nodedata.h
index 6b0f3ed89b7e..9978c7ce7549 100644
--- a/include/asm-ia64/nodedata.h
+++ b/include/asm-ia64/nodedata.h
@@ -17,7 +17,7 @@
17#include <asm/percpu.h> 17#include <asm/percpu.h>
18#include <asm/mmzone.h> 18#include <asm/mmzone.h>
19 19
20#ifdef CONFIG_DISCONTIGMEM 20#ifdef CONFIG_NUMA
21 21
22/* 22/*
23 * Node Data. One of these structures is located on each node of a NUMA system. 23 * Node Data. One of these structures is located on each node of a NUMA system.
@@ -47,6 +47,6 @@ struct ia64_node_data {
47 */ 47 */
48#define NODE_DATA(nid) (local_node_data->pg_data_ptrs[nid]) 48#define NODE_DATA(nid) (local_node_data->pg_data_ptrs[nid])
49 49
50#endif /* CONFIG_DISCONTIGMEM */ 50#endif /* CONFIG_NUMA */
51 51
52#endif /* _ASM_IA64_NODEDATA_H */ 52#endif /* _ASM_IA64_NODEDATA_H */
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
index 9edffad8c28b..ef436b9d06ad 100644
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -102,15 +102,15 @@ do { \
102 102
103#ifdef CONFIG_VIRTUAL_MEM_MAP 103#ifdef CONFIG_VIRTUAL_MEM_MAP
104extern int ia64_pfn_valid (unsigned long pfn); 104extern int ia64_pfn_valid (unsigned long pfn);
105#else 105#elif defined(CONFIG_FLATMEM)
106# define ia64_pfn_valid(pfn) 1 106# define ia64_pfn_valid(pfn) 1
107#endif 107#endif
108 108
109#ifndef CONFIG_DISCONTIGMEM 109#ifdef CONFIG_FLATMEM
110# define pfn_valid(pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn)) 110# define pfn_valid(pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
111# define page_to_pfn(page) ((unsigned long) (page - mem_map)) 111# define page_to_pfn(page) ((unsigned long) (page - mem_map))
112# define pfn_to_page(pfn) (mem_map + (pfn)) 112# define pfn_to_page(pfn) (mem_map + (pfn))
113#else 113#elif defined(CONFIG_DISCONTIGMEM)
114extern struct page *vmem_map; 114extern struct page *vmem_map;
115extern unsigned long max_low_pfn; 115extern unsigned long max_low_pfn;
116# define pfn_valid(pfn) (((pfn) < max_low_pfn) && ia64_pfn_valid(pfn)) 116# define pfn_valid(pfn) (((pfn) < max_low_pfn) && ia64_pfn_valid(pfn))
diff --git a/include/asm-ia64/rwsem.h b/include/asm-ia64/rwsem.h
index e18b5ab0cb75..1327c91ea39c 100644
--- a/include/asm-ia64/rwsem.h
+++ b/include/asm-ia64/rwsem.h
@@ -186,4 +186,9 @@ __downgrade_write (struct rw_semaphore *sem)
186#define rwsem_atomic_add(delta, sem) atomic64_add(delta, (atomic64_t *)(&(sem)->count)) 186#define rwsem_atomic_add(delta, sem) atomic64_add(delta, (atomic64_t *)(&(sem)->count))
187#define rwsem_atomic_update(delta, sem) atomic64_add_return(delta, (atomic64_t *)(&(sem)->count)) 187#define rwsem_atomic_update(delta, sem) atomic64_add_return(delta, (atomic64_t *)(&(sem)->count))
188 188
189static inline int rwsem_is_locked(struct rw_semaphore *sem)
190{
191 return (sem->count != 0);
192}
193
189#endif /* _ASM_IA64_RWSEM_H */ 194#endif /* _ASM_IA64_RWSEM_H */
diff --git a/include/asm-ia64/sn/arch.h b/include/asm-ia64/sn/arch.h
index ab827d298569..1a3831c04af6 100644
--- a/include/asm-ia64/sn/arch.h
+++ b/include/asm-ia64/sn/arch.h
@@ -18,6 +18,32 @@
18#include <asm/sn/sn_cpuid.h> 18#include <asm/sn/sn_cpuid.h>
19 19
20/* 20/*
21 * This is the maximum number of NUMALINK nodes that can be part of a single
22 * SSI kernel. This number includes C-brick, M-bricks, and TIOs. Nodes in
23 * remote partitions are NOT included in this number.
24 * The number of compact nodes cannot exceed size of a coherency domain.
25 * The purpose of this define is to specify a node count that includes
26 * all C/M/TIO nodes in an SSI system.
27 *
28 * SGI system can currently support up to 256 C/M nodes plus additional TIO nodes.
29 *
30 * Note: ACPI20 has an architectural limit of 256 nodes. When we upgrade
31 * to ACPI3.0, this limit will be removed. The notion of "compact nodes"
32 * should be deleted and TIOs should be included in MAX_NUMNODES.
33 */
34#define MAX_COMPACT_NODES 512
35
36/*
37 * Maximum number of nodes in all partitions and in all coherency domains.
38 * This is the total number of nodes accessible in the numalink fabric. It
39 * includes all C & M bricks, plus all TIOs.
40 *
41 * This value is also the value of the maximum number of NASIDs in the numalink
42 * fabric.
43 */
44#define MAX_NUMALINK_NODES 16384
45
46/*
21 * The following defines attributes of the HUB chip. These attributes are 47 * The following defines attributes of the HUB chip. These attributes are
22 * frequently referenced. They are kept in the per-cpu data areas of each cpu. 48 * frequently referenced. They are kept in the per-cpu data areas of each cpu.
23 * They are kept together in a struct to minimize cache misses. 49 * They are kept together in a struct to minimize cache misses.
@@ -41,15 +67,6 @@ DECLARE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
41 67
42 68
43/* 69/*
44 * This is the maximum number of nodes that can be part of a kernel.
45 * Effectively, it's the maximum number of compact node ids (cnodeid_t).
46 * This is not necessarily the same as MAX_NASIDS.
47 */
48#define MAX_COMPACT_NODES 2048
49#define CPUS_PER_NODE 4
50
51
52/*
53 * Compact node ID to nasid mappings kept in the per-cpu data areas of each 70 * Compact node ID to nasid mappings kept in the per-cpu data areas of each
54 * cpu. 71 * cpu.
55 */ 72 */
@@ -57,7 +74,6 @@ DECLARE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]);
57#define sn_cnodeid_to_nasid (&__get_cpu_var(__sn_cnodeid_to_nasid[0])) 74#define sn_cnodeid_to_nasid (&__get_cpu_var(__sn_cnodeid_to_nasid[0]))
58 75
59 76
60
61extern u8 sn_partition_id; 77extern u8 sn_partition_id;
62extern u8 sn_system_size; 78extern u8 sn_system_size;
63extern u8 sn_sharing_domain_size; 79extern u8 sn_sharing_domain_size;
diff --git a/include/asm-ia64/sn/io.h b/include/asm-ia64/sn/io.h
index 42209733f6b1..41c73a735628 100644
--- a/include/asm-ia64/sn/io.h
+++ b/include/asm-ia64/sn/io.h
@@ -14,7 +14,7 @@
14extern void * sn_io_addr(unsigned long port) __attribute_const__; /* Forward definition */ 14extern void * sn_io_addr(unsigned long port) __attribute_const__; /* Forward definition */
15extern void __sn_mmiowb(void); /* Forward definition */ 15extern void __sn_mmiowb(void); /* Forward definition */
16 16
17extern int numionodes; 17extern int num_cnodes;
18 18
19#define __sn_mf_a() ia64_mfa() 19#define __sn_mf_a() ia64_mfa()
20 20
@@ -36,6 +36,15 @@ extern void sn_dma_flush(unsigned long);
36#define __sn_readq_relaxed ___sn_readq_relaxed 36#define __sn_readq_relaxed ___sn_readq_relaxed
37 37
38/* 38/*
39 * Convenience macros for setting/clearing bits using the above accessors
40 */
41
42#define __sn_setq_relaxed(addr, val) \
43 writeq((__sn_readq_relaxed(addr) | (val)), (addr))
44#define __sn_clrq_relaxed(addr, val) \
45 writeq((__sn_readq_relaxed(addr) & ~(val)), (addr))
46
47/*
39 * The following routines are SN Platform specific, called when 48 * The following routines are SN Platform specific, called when
40 * a reference is made to inX/outX set macros. SN Platform 49 * a reference is made to inX/outX set macros. SN Platform
41 * inX set of macros ensures that Posted DMA writes on the 50 * inX set of macros ensures that Posted DMA writes on the
diff --git a/include/asm-ia64/sn/klconfig.h b/include/asm-ia64/sn/klconfig.h
index 9f920c70a62a..bcbf209d63be 100644
--- a/include/asm-ia64/sn/klconfig.h
+++ b/include/asm-ia64/sn/klconfig.h
@@ -208,19 +208,6 @@ typedef struct lboard_s {
208 klconf_off_t brd_next_same; /* Next BOARD with same nasid */ 208 klconf_off_t brd_next_same; /* Next BOARD with same nasid */
209} lboard_t; 209} lboard_t;
210 210
211#define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts)
212#define NODE_OFFSET_TO_KLINFO(n,off) ((klinfo_t*) TO_NODE_CAC(n,off))
213#define KLCF_NEXT(_brd) \
214 ((_brd)->brd_next_same ? \
215 (NODE_OFFSET_TO_LBOARD((_brd)->brd_next_same_host, (_brd)->brd_next_same)): NULL)
216#define KLCF_NEXT_ANY(_brd) \
217 ((_brd)->brd_next_any ? \
218 (NODE_OFFSET_TO_LBOARD(NASID_GET(_brd), (_brd)->brd_next_any)): NULL)
219#define KLCF_COMP(_brd, _ndx) \
220 ((((_brd)->brd_compts[(_ndx)]) == 0) ? 0 : \
221 (NODE_OFFSET_TO_KLINFO(NASID_GET(_brd), (_brd)->brd_compts[(_ndx)])))
222
223
224/* 211/*
225 * Generic info structure. This stores common info about a 212 * Generic info structure. This stores common info about a
226 * component. 213 * component.
@@ -249,24 +236,11 @@ typedef struct klinfo_s { /* Generic info */
249} klinfo_t ; 236} klinfo_t ;
250 237
251 238
252static inline lboard_t *find_lboard_any(lboard_t * start, unsigned char brd_type) 239static inline lboard_t *find_lboard_next(lboard_t * brd)
253{ 240{
254 /* Search all boards stored on this node. */ 241 if (brd && brd->brd_next_any)
255 242 return NODE_OFFSET_TO_LBOARD(NASID_GET(brd), brd->brd_next_any);
256 while (start) { 243 return NULL;
257 if (start->brd_type == brd_type)
258 return start;
259 start = KLCF_NEXT_ANY(start);
260 }
261 /* Didn't find it. */
262 return (lboard_t *) NULL;
263} 244}
264 245
265
266/* external declarations of Linux kernel functions. */
267
268extern lboard_t *root_lboard[];
269extern klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char type);
270extern klinfo_t *find_first_component(lboard_t *brd, unsigned char type);
271
272#endif /* _ASM_IA64_SN_KLCONFIG_H */ 246#endif /* _ASM_IA64_SN_KLCONFIG_H */
diff --git a/include/asm-ia64/sn/l1.h b/include/asm-ia64/sn/l1.h
index 2e5f0aa38889..e3b819110d47 100644
--- a/include/asm-ia64/sn/l1.h
+++ b/include/asm-ia64/sn/l1.h
@@ -35,4 +35,16 @@
35#define L1_BRICKTYPE_ATHENA 0x2b /* + */ 35#define L1_BRICKTYPE_ATHENA 0x2b /* + */
36#define L1_BRICKTYPE_DAYTONA 0x7a /* z */ 36#define L1_BRICKTYPE_DAYTONA 0x7a /* z */
37 37
38/* board type response codes */
39#define L1_BOARDTYPE_IP69 0x0100 /* CA */
40#define L1_BOARDTYPE_IP63 0x0200 /* CB */
41#define L1_BOARDTYPE_BASEIO 0x0300 /* IB */
42#define L1_BOARDTYPE_PCIE2SLOT 0x0400 /* IC */
43#define L1_BOARDTYPE_PCIX3SLOT 0x0500 /* ID */
44#define L1_BOARDTYPE_PCIXPCIE4SLOT 0x0600 /* IE */
45#define L1_BOARDTYPE_ABACUS 0x0700 /* AB */
46#define L1_BOARDTYPE_DAYTONA 0x0800 /* AD */
47#define L1_BOARDTYPE_INVAL (-1) /* invalid brick type */
48
49
38#endif /* _ASM_IA64_SN_L1_H */ 50#endif /* _ASM_IA64_SN_L1_H */
diff --git a/include/asm-ia64/sn/nodepda.h b/include/asm-ia64/sn/nodepda.h
index 47bb8100fd00..6f6d69e39ff5 100644
--- a/include/asm-ia64/sn/nodepda.h
+++ b/include/asm-ia64/sn/nodepda.h
@@ -55,7 +55,6 @@ struct nodepda_s {
55 */ 55 */
56 struct phys_cpuid phys_cpuid[NR_CPUS]; 56 struct phys_cpuid phys_cpuid[NR_CPUS];
57 spinlock_t ptc_lock ____cacheline_aligned_in_smp; 57 spinlock_t ptc_lock ____cacheline_aligned_in_smp;
58 spinlock_t bist_lock;
59}; 58};
60 59
61typedef struct nodepda_s nodepda_t; 60typedef struct nodepda_s nodepda_t;
diff --git a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h
index d2c1d34dcce4..749deb2ca6c1 100644
--- a/include/asm-ia64/sn/sn_cpuid.h
+++ b/include/asm-ia64/sn/sn_cpuid.h
@@ -105,7 +105,6 @@ extern short physical_node_map[]; /* indexed by nasid to get cnode */
105#define cpuid_to_nasid(cpuid) (sn_nodepda->phys_cpuid[cpuid].nasid) 105#define cpuid_to_nasid(cpuid) (sn_nodepda->phys_cpuid[cpuid].nasid)
106#define cpuid_to_subnode(cpuid) (sn_nodepda->phys_cpuid[cpuid].subnode) 106#define cpuid_to_subnode(cpuid) (sn_nodepda->phys_cpuid[cpuid].subnode)
107#define cpuid_to_slice(cpuid) (sn_nodepda->phys_cpuid[cpuid].slice) 107#define cpuid_to_slice(cpuid) (sn_nodepda->phys_cpuid[cpuid].slice)
108#define cpuid_to_cnodeid(cpuid) (physical_node_map[cpuid_to_nasid(cpuid)])
109 108
110 109
111/* 110/*
@@ -113,8 +112,6 @@ extern short physical_node_map[]; /* indexed by nasid to get cnode */
113 * of potentially large tables. 112 * of potentially large tables.
114 */ 113 */
115extern int nasid_slice_to_cpuid(int, int); 114extern int nasid_slice_to_cpuid(int, int);
116#define nasid_slice_to_cpu_physical_id(nasid, slice) \
117 cpu_physical_id(nasid_slice_to_cpuid(nasid, slice))
118 115
119/* 116/*
120 * cnodeid_to_nasid - convert a cnodeid to a NASID 117 * cnodeid_to_nasid - convert a cnodeid to a NASID
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index fea35b33d4e4..3f7564dc0aa9 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -47,6 +47,7 @@
47#define SN_SAL_CONSOLE_PUTB 0x02000028 47#define SN_SAL_CONSOLE_PUTB 0x02000028
48#define SN_SAL_CONSOLE_XMIT_CHARS 0x0200002a 48#define SN_SAL_CONSOLE_XMIT_CHARS 0x0200002a
49#define SN_SAL_CONSOLE_READC 0x0200002b 49#define SN_SAL_CONSOLE_READC 0x0200002b
50#define SN_SAL_SYSCTL_OP 0x02000030
50#define SN_SAL_SYSCTL_MODID_GET 0x02000031 51#define SN_SAL_SYSCTL_MODID_GET 0x02000031
51#define SN_SAL_SYSCTL_GET 0x02000032 52#define SN_SAL_SYSCTL_GET 0x02000032
52#define SN_SAL_SYSCTL_IOBRICK_MODULE_GET 0x02000033 53#define SN_SAL_SYSCTL_IOBRICK_MODULE_GET 0x02000033
@@ -67,7 +68,7 @@
67#define SN_SAL_IOIF_INTERRUPT 0x0200004a 68#define SN_SAL_IOIF_INTERRUPT 0x0200004a
68#define SN_SAL_HWPERF_OP 0x02000050 // lock 69#define SN_SAL_HWPERF_OP 0x02000050 // lock
69#define SN_SAL_IOIF_ERROR_INTERRUPT 0x02000051 70#define SN_SAL_IOIF_ERROR_INTERRUPT 0x02000051
70 71#define SN_SAL_IOIF_PCI_SAFE 0x02000052
71#define SN_SAL_IOIF_SLOT_ENABLE 0x02000053 72#define SN_SAL_IOIF_SLOT_ENABLE 0x02000053
72#define SN_SAL_IOIF_SLOT_DISABLE 0x02000054 73#define SN_SAL_IOIF_SLOT_DISABLE 0x02000054
73#define SN_SAL_IOIF_GET_HUBDEV_INFO 0x02000055 74#define SN_SAL_IOIF_GET_HUBDEV_INFO 0x02000055
@@ -101,6 +102,13 @@
101#define SAL_INTR_FREE 2 102#define SAL_INTR_FREE 2
102 103
103/* 104/*
105 * operations available on the generic SN_SAL_SYSCTL_OP
106 * runtime service
107 */
108#define SAL_SYSCTL_OP_IOBOARD 0x0001 /* retrieve board type */
109#define SAL_SYSCTL_OP_TIO_JLCK_RST 0x0002 /* issue TIO clock reset */
110
111/*
104 * IRouter (i.e. generalized system controller) operations 112 * IRouter (i.e. generalized system controller) operations
105 */ 113 */
106#define SAL_IROUTER_OPEN 0 /* open a subchannel */ 114#define SAL_IROUTER_OPEN 0 /* open a subchannel */
@@ -198,26 +206,16 @@ ia64_sn_get_master_baseio_nasid(void)
198 return ret_stuff.v0; 206 return ret_stuff.v0;
199} 207}
200 208
201static inline char * 209static inline void *
202ia64_sn_get_klconfig_addr(nasid_t nasid) 210ia64_sn_get_klconfig_addr(nasid_t nasid)
203{ 211{
204 struct ia64_sal_retval ret_stuff; 212 struct ia64_sal_retval ret_stuff;
205 int cnodeid;
206 213
207 cnodeid = nasid_to_cnodeid(nasid);
208 ret_stuff.status = 0; 214 ret_stuff.status = 0;
209 ret_stuff.v0 = 0; 215 ret_stuff.v0 = 0;
210 ret_stuff.v1 = 0; 216 ret_stuff.v1 = 0;
211 ret_stuff.v2 = 0; 217 ret_stuff.v2 = 0;
212 SAL_CALL(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR, (u64)nasid, 0, 0, 0, 0, 0, 0); 218 SAL_CALL(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR, (u64)nasid, 0, 0, 0, 0, 0, 0);
213
214 /*
215 * We should panic if a valid cnode nasid does not produce
216 * a klconfig address.
217 */
218 if (ret_stuff.status != 0) {
219 panic("ia64_sn_get_klconfig_addr: Returned error %lx\n", ret_stuff.status);
220 }
221 return ret_stuff.v0 ? __va(ret_stuff.v0) : NULL; 219 return ret_stuff.v0 ? __va(ret_stuff.v0) : NULL;
222} 220}
223 221
@@ -694,12 +692,10 @@ sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array)
694 unsigned long irq_flags; 692 unsigned long irq_flags;
695 693
696 cnodeid = nasid_to_cnodeid(get_node_number(paddr)); 694 cnodeid = nasid_to_cnodeid(get_node_number(paddr));
697 // spin_lock(&NODEPDA(cnodeid)->bist_lock);
698 local_irq_save(irq_flags); 695 local_irq_save(irq_flags);
699 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len, 696 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len,
700 (u64)nasid_array, perms, 0, 0, 0); 697 (u64)nasid_array, perms, 0, 0, 0);
701 local_irq_restore(irq_flags); 698 local_irq_restore(irq_flags);
702 // spin_unlock(&NODEPDA(cnodeid)->bist_lock);
703 return ret_stuff.status; 699 return ret_stuff.status;
704} 700}
705#define SN_MEMPROT_ACCESS_CLASS_0 0x14a080 701#define SN_MEMPROT_ACCESS_CLASS_0 0x14a080
@@ -873,6 +869,41 @@ ia64_sn_sysctl_event_init(nasid_t nasid)
873 return (int) rv.v0; 869 return (int) rv.v0;
874} 870}
875 871
872/*
873 * Ask the system controller on the specified nasid to reset
874 * the CX corelet clock. Only valid on TIO nodes.
875 */
876static inline int
877ia64_sn_sysctl_tio_clock_reset(nasid_t nasid)
878{
879 struct ia64_sal_retval rv;
880 SAL_CALL_REENTRANT(rv, SN_SAL_SYSCTL_OP, SAL_SYSCTL_OP_TIO_JLCK_RST,
881 nasid, 0, 0, 0, 0, 0);
882 if (rv.status != 0)
883 return (int)rv.status;
884 if (rv.v0 != 0)
885 return (int)rv.v0;
886
887 return 0;
888}
889
890/*
891 * Get the associated ioboard type for a given nasid.
892 */
893static inline int
894ia64_sn_sysctl_ioboard_get(nasid_t nasid)
895{
896 struct ia64_sal_retval rv;
897 SAL_CALL_REENTRANT(rv, SN_SAL_SYSCTL_OP, SAL_SYSCTL_OP_IOBOARD,
898 nasid, 0, 0, 0, 0, 0);
899 if (rv.v0 != 0)
900 return (int)rv.v0;
901 if (rv.v1 != 0)
902 return (int)rv.v1;
903
904 return 0;
905}
906
876/** 907/**
877 * ia64_sn_get_fit_compt - read a FIT entry from the PROM header 908 * ia64_sn_get_fit_compt - read a FIT entry from the PROM header
878 * @nasid: NASID of node to read 909 * @nasid: NASID of node to read
diff --git a/include/asm-ia64/sn/tioca_provider.h b/include/asm-ia64/sn/tioca_provider.h
index 5ccec608d325..b532ef6148ed 100644
--- a/include/asm-ia64/sn/tioca_provider.h
+++ b/include/asm-ia64/sn/tioca_provider.h
@@ -182,11 +182,11 @@ tioca_tlbflush(struct tioca_kernel *tioca_kernel)
182 * touch every CL aligned GART entry. 182 * touch every CL aligned GART entry.
183 */ 183 */
184 184
185 ca_base->ca_control2 &= ~(CA_GART_MEM_PARAM); 185 __sn_clrq_relaxed(&ca_base->ca_control2, CA_GART_MEM_PARAM);
186 ca_base->ca_control2 |= CA_GART_FLUSH_TLB; 186 __sn_setq_relaxed(&ca_base->ca_control2, CA_GART_FLUSH_TLB);
187 ca_base->ca_control2 |= 187 __sn_setq_relaxed(&ca_base->ca_control2,
188 (0x2ull << CA_GART_MEM_PARAM_SHFT); 188 (0x2ull << CA_GART_MEM_PARAM_SHFT));
189 tmp = ca_base->ca_control2; 189 tmp = __sn_readq_relaxed(&ca_base->ca_control2);
190 } 190 }
191 191
192 return; 192 return;
@@ -196,8 +196,8 @@ tioca_tlbflush(struct tioca_kernel *tioca_kernel)
196 * Gart in uncached mode ... need an explicit flush. 196 * Gart in uncached mode ... need an explicit flush.
197 */ 197 */
198 198
199 ca_base->ca_control2 |= CA_GART_FLUSH_TLB; 199 __sn_setq_relaxed(&ca_base->ca_control2, CA_GART_FLUSH_TLB);
200 tmp = ca_base->ca_control2; 200 tmp = __sn_readq_relaxed(&ca_base->ca_control2);
201} 201}
202 202
203extern uint32_t tioca_gart_found; 203extern uint32_t tioca_gart_found;
diff --git a/include/asm-ia64/sn/tiocx.h b/include/asm-ia64/sn/tiocx.h
index c5447a504509..5699e75e5024 100644
--- a/include/asm-ia64/sn/tiocx.h
+++ b/include/asm-ia64/sn/tiocx.h
@@ -19,6 +19,7 @@ struct cx_id_s {
19 19
20struct cx_dev { 20struct cx_dev {
21 struct cx_id_s cx_id; 21 struct cx_id_s cx_id;
22 int bt; /* board/blade type */
22 void *soft; /* driver specific */ 23 void *soft; /* driver specific */
23 struct hubdev_info *hubdev; 24 struct hubdev_info *hubdev;
24 struct device dev; 25 struct device dev;
@@ -59,7 +60,7 @@ struct cx_drv {
59extern struct sn_irq_info *tiocx_irq_alloc(nasid_t, int, int, nasid_t, int); 60extern struct sn_irq_info *tiocx_irq_alloc(nasid_t, int, int, nasid_t, int);
60extern void tiocx_irq_free(struct sn_irq_info *); 61extern void tiocx_irq_free(struct sn_irq_info *);
61extern int cx_device_unregister(struct cx_dev *); 62extern int cx_device_unregister(struct cx_dev *);
62extern int cx_device_register(nasid_t, int, int, struct hubdev_info *); 63extern int cx_device_register(nasid_t, int, int, struct hubdev_info *, int);
63extern int cx_driver_unregister(struct cx_drv *); 64extern int cx_driver_unregister(struct cx_drv *);
64extern int cx_driver_register(struct cx_drv *); 65extern int cx_driver_register(struct cx_drv *);
65extern uint64_t tiocx_dma_addr(uint64_t addr); 66extern uint64_t tiocx_dma_addr(uint64_t addr);
diff --git a/include/asm-ia64/sn/xp.h b/include/asm-ia64/sn/xp.h
index 1df1c9f61a65..49faf8f26430 100644
--- a/include/asm-ia64/sn/xp.h
+++ b/include/asm-ia64/sn/xp.h
@@ -49,7 +49,7 @@
49 * C-brick nasids, thus the need for bitmaps which don't account for 49 * C-brick nasids, thus the need for bitmaps which don't account for
50 * odd-numbered (non C-brick) nasids. 50 * odd-numbered (non C-brick) nasids.
51 */ 51 */
52#define XP_MAX_PHYSNODE_ID (MAX_PHYSNODE_ID / 2) 52#define XP_MAX_PHYSNODE_ID (MAX_NUMALINK_NODES / 2)
53#define XP_NASID_MASK_BYTES ((XP_MAX_PHYSNODE_ID + 7) / 8) 53#define XP_NASID_MASK_BYTES ((XP_MAX_PHYSNODE_ID + 7) / 8)
54#define XP_NASID_MASK_WORDS ((XP_MAX_PHYSNODE_ID + 63) / 64) 54#define XP_NASID_MASK_WORDS ((XP_MAX_PHYSNODE_ID + 63) / 64)
55 55
@@ -217,7 +217,17 @@ enum xpc_retval {
217 xpcInvalidPartid, /* 42: invalid partition ID */ 217 xpcInvalidPartid, /* 42: invalid partition ID */
218 xpcLocalPartid, /* 43: local partition ID */ 218 xpcLocalPartid, /* 43: local partition ID */
219 219
220 xpcUnknownReason /* 44: unknown reason -- must be last in list */ 220 xpcOtherGoingDown, /* 44: other side going down, reason unknown */
221 xpcSystemGoingDown, /* 45: system is going down, reason unknown */
222 xpcSystemHalt, /* 46: system is being halted */
223 xpcSystemReboot, /* 47: system is being rebooted */
224 xpcSystemPoweroff, /* 48: system is being powered off */
225
226 xpcDisconnecting, /* 49: channel disconnecting (closing) */
227
228 xpcOpenCloseError, /* 50: channel open/close protocol error */
229
230 xpcUnknownReason /* 51: unknown reason -- must be last in list */
221}; 231};
222 232
223 233
@@ -342,7 +352,7 @@ typedef void (*xpc_notify_func)(enum xpc_retval reason, partid_t partid,
342 * 352 *
343 * The 'func' field points to the function to call when aynchronous 353 * The 'func' field points to the function to call when aynchronous
344 * notification is required for such events as: a connection established/lost, 354 * notification is required for such events as: a connection established/lost,
345 * or an incomming message received, or an error condition encountered. A 355 * or an incoming message received, or an error condition encountered. A
346 * non-NULL 'func' field indicates that there is an active registration for 356 * non-NULL 'func' field indicates that there is an active registration for
347 * the channel. 357 * the channel.
348 */ 358 */
diff --git a/include/asm-ia64/sparsemem.h b/include/asm-ia64/sparsemem.h
new file mode 100644
index 000000000000..67a7c40ec27f
--- /dev/null
+++ b/include/asm-ia64/sparsemem.h
@@ -0,0 +1,20 @@
1#ifndef _ASM_IA64_SPARSEMEM_H
2#define _ASM_IA64_SPARSEMEM_H
3
4#ifdef CONFIG_SPARSEMEM
5/*
6 * SECTION_SIZE_BITS 2^N: how big each section will be
7 * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
8 */
9
10#define SECTION_SIZE_BITS (30)
11#define MAX_PHYSMEM_BITS (50)
12#ifdef CONFIG_FORCE_MAX_ZONEORDER
13#if ((CONFIG_FORCE_MAX_ZONEORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS)
14#undef SECTION_SIZE_BITS
15#define SECTION_SIZE_BITS (CONFIG_FORCE_MAX_ZONEORDER - 1 + PAGE_SHIFT)
16#endif
17#endif
18
19#endif /* CONFIG_SPARSEMEM */
20#endif /* _ASM_IA64_SPARSEMEM_H */
diff --git a/include/asm-ia64/tlb.h b/include/asm-ia64/tlb.h
index 3a9a6d1be75c..834370b9dea1 100644
--- a/include/asm-ia64/tlb.h
+++ b/include/asm-ia64/tlb.h
@@ -60,7 +60,6 @@ struct mmu_gather {
60 unsigned int nr; /* == ~0U => fast mode */ 60 unsigned int nr; /* == ~0U => fast mode */
61 unsigned char fullmm; /* non-zero means full mm flush */ 61 unsigned char fullmm; /* non-zero means full mm flush */
62 unsigned char need_flush; /* really unmapped some PTEs? */ 62 unsigned char need_flush; /* really unmapped some PTEs? */
63 unsigned long freed; /* number of pages freed */
64 unsigned long start_addr; 63 unsigned long start_addr;
65 unsigned long end_addr; 64 unsigned long end_addr;
66 struct page *pages[FREE_PTE_NR]; 65 struct page *pages[FREE_PTE_NR];
@@ -129,7 +128,7 @@ ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long e
129static inline struct mmu_gather * 128static inline struct mmu_gather *
130tlb_gather_mmu (struct mm_struct *mm, unsigned int full_mm_flush) 129tlb_gather_mmu (struct mm_struct *mm, unsigned int full_mm_flush)
131{ 130{
132 struct mmu_gather *tlb = &__get_cpu_var(mmu_gathers); 131 struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
133 132
134 tlb->mm = mm; 133 tlb->mm = mm;
135 /* 134 /*
@@ -147,25 +146,17 @@ tlb_gather_mmu (struct mm_struct *mm, unsigned int full_mm_flush)
147 */ 146 */
148 tlb->nr = (num_online_cpus() == 1) ? ~0U : 0; 147 tlb->nr = (num_online_cpus() == 1) ? ~0U : 0;
149 tlb->fullmm = full_mm_flush; 148 tlb->fullmm = full_mm_flush;
150 tlb->freed = 0;
151 tlb->start_addr = ~0UL; 149 tlb->start_addr = ~0UL;
152 return tlb; 150 return tlb;
153} 151}
154 152
155/* 153/*
156 * Called at the end of the shootdown operation to free up any resources that were 154 * Called at the end of the shootdown operation to free up any resources that were
157 * collected. The page table lock is still held at this point. 155 * collected.
158 */ 156 */
159static inline void 157static inline void
160tlb_finish_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end) 158tlb_finish_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end)
161{ 159{
162 unsigned long freed = tlb->freed;
163 struct mm_struct *mm = tlb->mm;
164 unsigned long rss = get_mm_counter(mm, rss);
165
166 if (rss < freed)
167 freed = rss;
168 add_mm_counter(mm, rss, -freed);
169 /* 160 /*
170 * Note: tlb->nr may be 0 at this point, so we can't rely on tlb->start_addr and 161 * Note: tlb->nr may be 0 at this point, so we can't rely on tlb->start_addr and
171 * tlb->end_addr. 162 * tlb->end_addr.
@@ -174,12 +165,8 @@ tlb_finish_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end)
174 165
175 /* keep the page table cache within bounds */ 166 /* keep the page table cache within bounds */
176 check_pgt_cache(); 167 check_pgt_cache();
177}
178 168
179static inline unsigned int 169 put_cpu_var(mmu_gathers);
180tlb_is_full_mm(struct mmu_gather *tlb)
181{
182 return tlb->fullmm;
183} 170}
184 171
185/* 172/*
diff --git a/include/asm-m32r/dma-mapping.h b/include/asm-m32r/dma-mapping.h
index 3a2db28834b6..a7fa0302bda7 100644
--- a/include/asm-m32r/dma-mapping.h
+++ b/include/asm-m32r/dma-mapping.h
@@ -8,7 +8,7 @@
8 8
9static inline void * 9static inline void *
10dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 10dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
11 int flag) 11 gfp_t flag)
12{ 12{
13 return (void *)NULL; 13 return (void *)NULL;
14} 14}
diff --git a/include/asm-m32r/mmzone.h b/include/asm-m32r/mmzone.h
index d58878ec899e..adc7970a77ec 100644
--- a/include/asm-m32r/mmzone.h
+++ b/include/asm-m32r/mmzone.h
@@ -21,12 +21,6 @@ extern struct pglist_data *node_data[];
21 __pgdat->node_start_pfn + __pgdat->node_spanned_pages - 1; \ 21 __pgdat->node_start_pfn + __pgdat->node_spanned_pages - 1; \
22}) 22})
23 23
24#define local_mapnr(kvaddr) \
25({ \
26 unsigned long __pfn = __pa(kvaddr) >> PAGE_SHIFT; \
27 (__pfn - node_start_pfn(pfn_to_nid(__pfn))); \
28})
29
30#define pfn_to_page(pfn) \ 24#define pfn_to_page(pfn) \
31({ \ 25({ \
32 unsigned long __pfn = pfn; \ 26 unsigned long __pfn = pfn; \
diff --git a/include/asm-mips/abi.h b/include/asm-mips/abi.h
new file mode 100644
index 000000000000..2e7e651c3e3f
--- /dev/null
+++ b/include/asm-mips/abi.h
@@ -0,0 +1,25 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005 by Ralf Baechle
7 * Copyright (C) 2005 MIPS Technologies, Inc.
8 */
9#ifndef _ASM_ABI_H
10#define _ASM_ABI_H
11
12#include <asm/signal.h>
13#include <asm/siginfo.h>
14
15struct mips_abi {
16 int (* const do_signal)(sigset_t *oldset, struct pt_regs *regs);
17 int (* const setup_frame)(struct k_sigaction * ka,
18 struct pt_regs *regs, int signr,
19 sigset_t *set);
20 int (* const setup_rt_frame)(struct k_sigaction * ka,
21 struct pt_regs *regs, int signr,
22 sigset_t *set, siginfo_t *info);
23};
24
25#endif /* _ASM_ABI_H */
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
index 7dc2619f5006..42520cc84b0f 100644
--- a/include/asm-mips/addrspace.h
+++ b/include/asm-mips/addrspace.h
@@ -20,10 +20,12 @@
20#define _ATYPE_ 20#define _ATYPE_
21#define _ATYPE32_ 21#define _ATYPE32_
22#define _ATYPE64_ 22#define _ATYPE64_
23#define _LLCONST_(x) x
23#else 24#else
24#define _ATYPE_ __PTRDIFF_TYPE__ 25#define _ATYPE_ __PTRDIFF_TYPE__
25#define _ATYPE32_ int 26#define _ATYPE32_ int
26#define _ATYPE64_ long long 27#define _ATYPE64_ long long
28#define _LLCONST_(x) x ## LL
27#endif 29#endif
28 30
29/* 31/*
@@ -45,8 +47,9 @@
45/* 47/*
46 * Returns the physical address of a CKSEGx / XKPHYS address 48 * Returns the physical address of a CKSEGx / XKPHYS address
47 */ 49 */
48#define CPHYSADDR(a) ((_ACAST32_ (a)) & 0x1fffffff) 50#define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff)
49#define XPHYSADDR(a) ((_ACAST64_ (a)) & 0x000000ffffffffff) 51#define XPHYSADDR(a) ((_ACAST64_(a)) & \
52 _LLCONST_(0x000000ffffffffff))
50 53
51#ifdef CONFIG_64BIT 54#ifdef CONFIG_64BIT
52 55
@@ -55,14 +58,14 @@
55 * The compatibility segments use the full 64-bit sign extended value. Note 58 * The compatibility segments use the full 64-bit sign extended value. Note
56 * the R8000 doesn't have them so don't reference these in generic MIPS code. 59 * the R8000 doesn't have them so don't reference these in generic MIPS code.
57 */ 60 */
58#define XKUSEG 0x0000000000000000 61#define XKUSEG _LLCONST_(0x0000000000000000)
59#define XKSSEG 0x4000000000000000 62#define XKSSEG _LLCONST_(0x4000000000000000)
60#define XKPHYS 0x8000000000000000 63#define XKPHYS _LLCONST_(0x8000000000000000)
61#define XKSEG 0xc000000000000000 64#define XKSEG _LLCONST_(0xc000000000000000)
62#define CKSEG0 0xffffffff80000000 65#define CKSEG0 _LLCONST_(0xffffffff80000000)
63#define CKSEG1 0xffffffffa0000000 66#define CKSEG1 _LLCONST_(0xffffffffa0000000)
64#define CKSSEG 0xffffffffc0000000 67#define CKSSEG _LLCONST_(0xffffffffc0000000)
65#define CKSEG3 0xffffffffe0000000 68#define CKSEG3 _LLCONST_(0xffffffffe0000000)
66 69
67#define CKSEG0ADDR(a) (CPHYSADDR(a) | CKSEG0) 70#define CKSEG0ADDR(a) (CPHYSADDR(a) | CKSEG0)
68#define CKSEG1ADDR(a) (CPHYSADDR(a) | CKSEG1) 71#define CKSEG1ADDR(a) (CPHYSADDR(a) | CKSEG1)
@@ -120,7 +123,8 @@
120#define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED,(p)) 123#define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED,(p))
121#define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE,(p)) 124#define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE,(p))
122#define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK) 125#define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK)
123#define PHYS_TO_XKPHYS(cm,a) (0x8000000000000000 | ((cm)<<59) | (a)) 126#define PHYS_TO_XKPHYS(cm,a) (_LLCONST_(0x8000000000000000) | \
127 ((cm)<<59) | (a))
124 128
125#if defined (CONFIG_CPU_R4300) \ 129#if defined (CONFIG_CPU_R4300) \
126 || defined (CONFIG_CPU_R4X00) \ 130 || defined (CONFIG_CPU_R4X00) \
@@ -128,46 +132,56 @@
128 || defined (CONFIG_CPU_NEVADA) \ 132 || defined (CONFIG_CPU_NEVADA) \
129 || defined (CONFIG_CPU_TX49XX) \ 133 || defined (CONFIG_CPU_TX49XX) \
130 || defined (CONFIG_CPU_MIPS64) 134 || defined (CONFIG_CPU_MIPS64)
131#define KUSIZE 0x0000010000000000 /* 2^^40 */ 135#define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
132#define KUSIZE_64 0x0000010000000000 /* 2^^40 */ 136#define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */
133#define K0SIZE 0x0000001000000000 /* 2^^36 */ 137#define K0SIZE _LLCONST_(0x0000001000000000) /* 2^^36 */
134#define K1SIZE 0x0000001000000000 /* 2^^36 */ 138#define K1SIZE _LLCONST_(0x0000001000000000) /* 2^^36 */
135#define K2SIZE 0x000000ff80000000 139#define K2SIZE _LLCONST_(0x000000ff80000000)
136#define KSEGSIZE 0x000000ff80000000 /* max syssegsz */ 140#define KSEGSIZE _LLCONST_(0x000000ff80000000) /* max syssegsz */
137#define TO_PHYS_MASK 0x0000000fffffffff /* 2^^36 - 1 */ 141#define TO_PHYS_MASK _LLCONST_(0x0000000fffffffff) /* 2^^36 - 1 */
138#endif 142#endif
139 143
140#if defined (CONFIG_CPU_R8000) 144#if defined (CONFIG_CPU_R8000)
141/* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */ 145/* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */
142#define KUSIZE 0x0000010000000000 /* 2^^40 */ 146#define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
143#define KUSIZE_64 0x0000010000000000 /* 2^^40 */ 147#define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */
144#define K0SIZE 0x0000010000000000 /* 2^^40 */ 148#define K0SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
145#define K1SIZE 0x0000010000000000 /* 2^^40 */ 149#define K1SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
146#define K2SIZE 0x0001000000000000 150#define K2SIZE _LLCONST_(0x0001000000000000)
147#define KSEGSIZE 0x0000010000000000 /* max syssegsz */ 151#define KSEGSIZE _LLCONST_(0x0000010000000000) /* max syssegsz */
148#define TO_PHYS_MASK 0x000000ffffffffff /* 2^^40 - 1 */ 152#define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */
149#endif 153#endif
150 154
151#if defined (CONFIG_CPU_R10000) 155#if defined (CONFIG_CPU_R10000)
152#define KUSIZE 0x0000010000000000 /* 2^^40 */ 156#define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
153#define KUSIZE_64 0x0000010000000000 /* 2^^40 */ 157#define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */
154#define K0SIZE 0x0000010000000000 /* 2^^40 */ 158#define K0SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
155#define K1SIZE 0x0000010000000000 /* 2^^40 */ 159#define K1SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
156#define K2SIZE 0x00000fff80000000 160#define K2SIZE _LLCONST_(0x00000fff80000000)
157#define KSEGSIZE 0x00000fff80000000 /* max syssegsz */ 161#define KSEGSIZE _LLCONST_(0x00000fff80000000) /* max syssegsz */
158#define TO_PHYS_MASK 0x000000ffffffffff /* 2^^40 - 1 */ 162#define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */
163#endif
164
165#if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A)
166#define KUSIZE _LLCONST_(0x0000100000000000) /* 2^^44 */
167#define KUSIZE_64 _LLCONST_(0x0000100000000000) /* 2^^44 */
168#define K0SIZE _LLCONST_(0x0000100000000000) /* 2^^44 */
169#define K1SIZE _LLCONST_(0x0000100000000000) /* 2^^44 */
170#define K2SIZE _LLCONST_(0x0000ffff80000000)
171#define KSEGSIZE _LLCONST_(0x0000ffff80000000) /* max syssegsz */
172#define TO_PHYS_MASK _LLCONST_(0x00000fffffffffff) /* 2^^44 - 1 */
159#endif 173#endif
160 174
161/* 175/*
162 * Further names for SGI source compatibility. These are stolen from 176 * Further names for SGI source compatibility. These are stolen from
163 * IRIX's <sys/mips_addrspace.h>. 177 * IRIX's <sys/mips_addrspace.h>.
164 */ 178 */
165#define KUBASE 0 179#define KUBASE _LLCONST_(0)
166#define KUSIZE_32 0x0000000080000000 /* KUSIZE 180#define KUSIZE_32 _LLCONST_(0x0000000080000000) /* KUSIZE
167 for a 32 bit proc */ 181 for a 32 bit proc */
168#define K0BASE_EXL_WR 0xa800000000000000 /* exclusive on write */ 182#define K0BASE_EXL_WR _LLCONST_(0xa800000000000000) /* exclusive on write */
169#define K0BASE_NONCOH 0x9800000000000000 /* noncoherent */ 183#define K0BASE_NONCOH _LLCONST_(0x9800000000000000) /* noncoherent */
170#define K0BASE_EXL 0xa000000000000000 /* exclusive */ 184#define K0BASE_EXL _LLCONST_(0xa000000000000000) /* exclusive */
171 185
172#ifndef CONFIG_CPU_R8000 186#ifndef CONFIG_CPU_R8000
173 187
@@ -176,7 +190,7 @@
176 * in order to catch bugs in the source code. 190 * in order to catch bugs in the source code.
177 */ 191 */
178 192
179#define COMPAT_K1BASE32 0xffffffffa0000000 193#define COMPAT_K1BASE32 _LLCONST_(0xffffffffa0000000)
180#define PHYS_TO_COMPATK1(x) ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */ 194#define PHYS_TO_COMPATK1(x) ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */
181 195
182#endif 196#endif
diff --git a/include/asm-mips/asm.h b/include/asm-mips/asm.h
index f53237772985..4b090f3142e0 100644
--- a/include/asm-mips/asm.h
+++ b/include/asm-mips/asm.h
@@ -107,6 +107,7 @@ symbol = value
107/* 107/*
108 * Print formatted string 108 * Print formatted string
109 */ 109 */
110#ifdef CONFIG_PRINTK
110#define PRINT(string) \ 111#define PRINT(string) \
111 .set push; \ 112 .set push; \
112 .set reorder; \ 113 .set reorder; \
@@ -114,6 +115,9 @@ symbol = value
114 jal printk; \ 115 jal printk; \
115 .set pop; \ 116 .set pop; \
116 TEXT(string) 117 TEXT(string)
118#else
119#define PRINT(string)
120#endif
117 121
118#define TEXT(msg) \ 122#define TEXT(msg) \
119 .pushsection .data; \ 123 .pushsection .data; \
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index c0bd8d014e14..6202eb8a14b7 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -62,20 +62,24 @@ static __inline__ void atomic_add(int i, atomic_t * v)
62 unsigned long temp; 62 unsigned long temp;
63 63
64 __asm__ __volatile__( 64 __asm__ __volatile__(
65 " .set mips3 \n"
65 "1: ll %0, %1 # atomic_add \n" 66 "1: ll %0, %1 # atomic_add \n"
66 " addu %0, %2 \n" 67 " addu %0, %2 \n"
67 " sc %0, %1 \n" 68 " sc %0, %1 \n"
68 " beqzl %0, 1b \n" 69 " beqzl %0, 1b \n"
70 " .set mips0 \n"
69 : "=&r" (temp), "=m" (v->counter) 71 : "=&r" (temp), "=m" (v->counter)
70 : "Ir" (i), "m" (v->counter)); 72 : "Ir" (i), "m" (v->counter));
71 } else if (cpu_has_llsc) { 73 } else if (cpu_has_llsc) {
72 unsigned long temp; 74 unsigned long temp;
73 75
74 __asm__ __volatile__( 76 __asm__ __volatile__(
77 " .set mips3 \n"
75 "1: ll %0, %1 # atomic_add \n" 78 "1: ll %0, %1 # atomic_add \n"
76 " addu %0, %2 \n" 79 " addu %0, %2 \n"
77 " sc %0, %1 \n" 80 " sc %0, %1 \n"
78 " beqz %0, 1b \n" 81 " beqz %0, 1b \n"
82 " .set mips0 \n"
79 : "=&r" (temp), "=m" (v->counter) 83 : "=&r" (temp), "=m" (v->counter)
80 : "Ir" (i), "m" (v->counter)); 84 : "Ir" (i), "m" (v->counter));
81 } else { 85 } else {
@@ -100,20 +104,24 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
100 unsigned long temp; 104 unsigned long temp;
101 105
102 __asm__ __volatile__( 106 __asm__ __volatile__(
107 " .set mips3 \n"
103 "1: ll %0, %1 # atomic_sub \n" 108 "1: ll %0, %1 # atomic_sub \n"
104 " subu %0, %2 \n" 109 " subu %0, %2 \n"
105 " sc %0, %1 \n" 110 " sc %0, %1 \n"
106 " beqzl %0, 1b \n" 111 " beqzl %0, 1b \n"
112 " .set mips0 \n"
107 : "=&r" (temp), "=m" (v->counter) 113 : "=&r" (temp), "=m" (v->counter)
108 : "Ir" (i), "m" (v->counter)); 114 : "Ir" (i), "m" (v->counter));
109 } else if (cpu_has_llsc) { 115 } else if (cpu_has_llsc) {
110 unsigned long temp; 116 unsigned long temp;
111 117
112 __asm__ __volatile__( 118 __asm__ __volatile__(
119 " .set mips3 \n"
113 "1: ll %0, %1 # atomic_sub \n" 120 "1: ll %0, %1 # atomic_sub \n"
114 " subu %0, %2 \n" 121 " subu %0, %2 \n"
115 " sc %0, %1 \n" 122 " sc %0, %1 \n"
116 " beqz %0, 1b \n" 123 " beqz %0, 1b \n"
124 " .set mips0 \n"
117 : "=&r" (temp), "=m" (v->counter) 125 : "=&r" (temp), "=m" (v->counter)
118 : "Ir" (i), "m" (v->counter)); 126 : "Ir" (i), "m" (v->counter));
119 } else { 127 } else {
@@ -136,12 +144,14 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
136 unsigned long temp; 144 unsigned long temp;
137 145
138 __asm__ __volatile__( 146 __asm__ __volatile__(
147 " .set mips3 \n"
139 "1: ll %1, %2 # atomic_add_return \n" 148 "1: ll %1, %2 # atomic_add_return \n"
140 " addu %0, %1, %3 \n" 149 " addu %0, %1, %3 \n"
141 " sc %0, %2 \n" 150 " sc %0, %2 \n"
142 " beqzl %0, 1b \n" 151 " beqzl %0, 1b \n"
143 " addu %0, %1, %3 \n" 152 " addu %0, %1, %3 \n"
144 " sync \n" 153 " sync \n"
154 " .set mips0 \n"
145 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 155 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
146 : "Ir" (i), "m" (v->counter) 156 : "Ir" (i), "m" (v->counter)
147 : "memory"); 157 : "memory");
@@ -149,12 +159,14 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
149 unsigned long temp; 159 unsigned long temp;
150 160
151 __asm__ __volatile__( 161 __asm__ __volatile__(
162 " .set mips3 \n"
152 "1: ll %1, %2 # atomic_add_return \n" 163 "1: ll %1, %2 # atomic_add_return \n"
153 " addu %0, %1, %3 \n" 164 " addu %0, %1, %3 \n"
154 " sc %0, %2 \n" 165 " sc %0, %2 \n"
155 " beqz %0, 1b \n" 166 " beqz %0, 1b \n"
156 " addu %0, %1, %3 \n" 167 " addu %0, %1, %3 \n"
157 " sync \n" 168 " sync \n"
169 " .set mips0 \n"
158 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 170 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
159 : "Ir" (i), "m" (v->counter) 171 : "Ir" (i), "m" (v->counter)
160 : "memory"); 172 : "memory");
@@ -179,12 +191,14 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
179 unsigned long temp; 191 unsigned long temp;
180 192
181 __asm__ __volatile__( 193 __asm__ __volatile__(
194 " .set mips3 \n"
182 "1: ll %1, %2 # atomic_sub_return \n" 195 "1: ll %1, %2 # atomic_sub_return \n"
183 " subu %0, %1, %3 \n" 196 " subu %0, %1, %3 \n"
184 " sc %0, %2 \n" 197 " sc %0, %2 \n"
185 " beqzl %0, 1b \n" 198 " beqzl %0, 1b \n"
186 " subu %0, %1, %3 \n" 199 " subu %0, %1, %3 \n"
187 " sync \n" 200 " sync \n"
201 " .set mips0 \n"
188 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 202 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
189 : "Ir" (i), "m" (v->counter) 203 : "Ir" (i), "m" (v->counter)
190 : "memory"); 204 : "memory");
@@ -192,12 +206,14 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
192 unsigned long temp; 206 unsigned long temp;
193 207
194 __asm__ __volatile__( 208 __asm__ __volatile__(
209 " .set mips3 \n"
195 "1: ll %1, %2 # atomic_sub_return \n" 210 "1: ll %1, %2 # atomic_sub_return \n"
196 " subu %0, %1, %3 \n" 211 " subu %0, %1, %3 \n"
197 " sc %0, %2 \n" 212 " sc %0, %2 \n"
198 " beqz %0, 1b \n" 213 " beqz %0, 1b \n"
199 " subu %0, %1, %3 \n" 214 " subu %0, %1, %3 \n"
200 " sync \n" 215 " sync \n"
216 " .set mips0 \n"
201 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 217 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
202 : "Ir" (i), "m" (v->counter) 218 : "Ir" (i), "m" (v->counter)
203 : "memory"); 219 : "memory");
@@ -229,6 +245,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
229 unsigned long temp; 245 unsigned long temp;
230 246
231 __asm__ __volatile__( 247 __asm__ __volatile__(
248 " .set mips3 \n"
232 "1: ll %1, %2 # atomic_sub_if_positive\n" 249 "1: ll %1, %2 # atomic_sub_if_positive\n"
233 " subu %0, %1, %3 \n" 250 " subu %0, %1, %3 \n"
234 " bltz %0, 1f \n" 251 " bltz %0, 1f \n"
@@ -236,6 +253,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
236 " beqzl %0, 1b \n" 253 " beqzl %0, 1b \n"
237 " sync \n" 254 " sync \n"
238 "1: \n" 255 "1: \n"
256 " .set mips0 \n"
239 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 257 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
240 : "Ir" (i), "m" (v->counter) 258 : "Ir" (i), "m" (v->counter)
241 : "memory"); 259 : "memory");
@@ -243,6 +261,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
243 unsigned long temp; 261 unsigned long temp;
244 262
245 __asm__ __volatile__( 263 __asm__ __volatile__(
264 " .set mips3 \n"
246 "1: ll %1, %2 # atomic_sub_if_positive\n" 265 "1: ll %1, %2 # atomic_sub_if_positive\n"
247 " subu %0, %1, %3 \n" 266 " subu %0, %1, %3 \n"
248 " bltz %0, 1f \n" 267 " bltz %0, 1f \n"
@@ -250,6 +269,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
250 " beqz %0, 1b \n" 269 " beqz %0, 1b \n"
251 " sync \n" 270 " sync \n"
252 "1: \n" 271 "1: \n"
272 " .set mips0 \n"
253 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 273 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
254 : "Ir" (i), "m" (v->counter) 274 : "Ir" (i), "m" (v->counter)
255 : "memory"); 275 : "memory");
@@ -367,20 +387,24 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
367 unsigned long temp; 387 unsigned long temp;
368 388
369 __asm__ __volatile__( 389 __asm__ __volatile__(
390 " .set mips3 \n"
370 "1: lld %0, %1 # atomic64_add \n" 391 "1: lld %0, %1 # atomic64_add \n"
371 " addu %0, %2 \n" 392 " addu %0, %2 \n"
372 " scd %0, %1 \n" 393 " scd %0, %1 \n"
373 " beqzl %0, 1b \n" 394 " beqzl %0, 1b \n"
395 " .set mips0 \n"
374 : "=&r" (temp), "=m" (v->counter) 396 : "=&r" (temp), "=m" (v->counter)
375 : "Ir" (i), "m" (v->counter)); 397 : "Ir" (i), "m" (v->counter));
376 } else if (cpu_has_llsc) { 398 } else if (cpu_has_llsc) {
377 unsigned long temp; 399 unsigned long temp;
378 400
379 __asm__ __volatile__( 401 __asm__ __volatile__(
402 " .set mips3 \n"
380 "1: lld %0, %1 # atomic64_add \n" 403 "1: lld %0, %1 # atomic64_add \n"
381 " addu %0, %2 \n" 404 " addu %0, %2 \n"
382 " scd %0, %1 \n" 405 " scd %0, %1 \n"
383 " beqz %0, 1b \n" 406 " beqz %0, 1b \n"
407 " .set mips0 \n"
384 : "=&r" (temp), "=m" (v->counter) 408 : "=&r" (temp), "=m" (v->counter)
385 : "Ir" (i), "m" (v->counter)); 409 : "Ir" (i), "m" (v->counter));
386 } else { 410 } else {
@@ -405,20 +429,24 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
405 unsigned long temp; 429 unsigned long temp;
406 430
407 __asm__ __volatile__( 431 __asm__ __volatile__(
432 " .set mips3 \n"
408 "1: lld %0, %1 # atomic64_sub \n" 433 "1: lld %0, %1 # atomic64_sub \n"
409 " subu %0, %2 \n" 434 " subu %0, %2 \n"
410 " scd %0, %1 \n" 435 " scd %0, %1 \n"
411 " beqzl %0, 1b \n" 436 " beqzl %0, 1b \n"
437 " .set mips0 \n"
412 : "=&r" (temp), "=m" (v->counter) 438 : "=&r" (temp), "=m" (v->counter)
413 : "Ir" (i), "m" (v->counter)); 439 : "Ir" (i), "m" (v->counter));
414 } else if (cpu_has_llsc) { 440 } else if (cpu_has_llsc) {
415 unsigned long temp; 441 unsigned long temp;
416 442
417 __asm__ __volatile__( 443 __asm__ __volatile__(
444 " .set mips3 \n"
418 "1: lld %0, %1 # atomic64_sub \n" 445 "1: lld %0, %1 # atomic64_sub \n"
419 " subu %0, %2 \n" 446 " subu %0, %2 \n"
420 " scd %0, %1 \n" 447 " scd %0, %1 \n"
421 " beqz %0, 1b \n" 448 " beqz %0, 1b \n"
449 " .set mips0 \n"
422 : "=&r" (temp), "=m" (v->counter) 450 : "=&r" (temp), "=m" (v->counter)
423 : "Ir" (i), "m" (v->counter)); 451 : "Ir" (i), "m" (v->counter));
424 } else { 452 } else {
@@ -441,12 +469,14 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
441 unsigned long temp; 469 unsigned long temp;
442 470
443 __asm__ __volatile__( 471 __asm__ __volatile__(
472 " .set mips3 \n"
444 "1: lld %1, %2 # atomic64_add_return \n" 473 "1: lld %1, %2 # atomic64_add_return \n"
445 " addu %0, %1, %3 \n" 474 " addu %0, %1, %3 \n"
446 " scd %0, %2 \n" 475 " scd %0, %2 \n"
447 " beqzl %0, 1b \n" 476 " beqzl %0, 1b \n"
448 " addu %0, %1, %3 \n" 477 " addu %0, %1, %3 \n"
449 " sync \n" 478 " sync \n"
479 " .set mips0 \n"
450 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 480 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
451 : "Ir" (i), "m" (v->counter) 481 : "Ir" (i), "m" (v->counter)
452 : "memory"); 482 : "memory");
@@ -454,12 +484,14 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
454 unsigned long temp; 484 unsigned long temp;
455 485
456 __asm__ __volatile__( 486 __asm__ __volatile__(
487 " .set mips3 \n"
457 "1: lld %1, %2 # atomic64_add_return \n" 488 "1: lld %1, %2 # atomic64_add_return \n"
458 " addu %0, %1, %3 \n" 489 " addu %0, %1, %3 \n"
459 " scd %0, %2 \n" 490 " scd %0, %2 \n"
460 " beqz %0, 1b \n" 491 " beqz %0, 1b \n"
461 " addu %0, %1, %3 \n" 492 " addu %0, %1, %3 \n"
462 " sync \n" 493 " sync \n"
494 " .set mips0 \n"
463 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 495 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
464 : "Ir" (i), "m" (v->counter) 496 : "Ir" (i), "m" (v->counter)
465 : "memory"); 497 : "memory");
@@ -484,12 +516,14 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
484 unsigned long temp; 516 unsigned long temp;
485 517
486 __asm__ __volatile__( 518 __asm__ __volatile__(
519 " .set mips3 \n"
487 "1: lld %1, %2 # atomic64_sub_return \n" 520 "1: lld %1, %2 # atomic64_sub_return \n"
488 " subu %0, %1, %3 \n" 521 " subu %0, %1, %3 \n"
489 " scd %0, %2 \n" 522 " scd %0, %2 \n"
490 " beqzl %0, 1b \n" 523 " beqzl %0, 1b \n"
491 " subu %0, %1, %3 \n" 524 " subu %0, %1, %3 \n"
492 " sync \n" 525 " sync \n"
526 " .set mips0 \n"
493 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 527 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
494 : "Ir" (i), "m" (v->counter) 528 : "Ir" (i), "m" (v->counter)
495 : "memory"); 529 : "memory");
@@ -497,12 +531,14 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
497 unsigned long temp; 531 unsigned long temp;
498 532
499 __asm__ __volatile__( 533 __asm__ __volatile__(
534 " .set mips3 \n"
500 "1: lld %1, %2 # atomic64_sub_return \n" 535 "1: lld %1, %2 # atomic64_sub_return \n"
501 " subu %0, %1, %3 \n" 536 " subu %0, %1, %3 \n"
502 " scd %0, %2 \n" 537 " scd %0, %2 \n"
503 " beqz %0, 1b \n" 538 " beqz %0, 1b \n"
504 " subu %0, %1, %3 \n" 539 " subu %0, %1, %3 \n"
505 " sync \n" 540 " sync \n"
541 " .set mips0 \n"
506 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 542 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
507 : "Ir" (i), "m" (v->counter) 543 : "Ir" (i), "m" (v->counter)
508 : "memory"); 544 : "memory");
@@ -534,6 +570,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
534 unsigned long temp; 570 unsigned long temp;
535 571
536 __asm__ __volatile__( 572 __asm__ __volatile__(
573 " .set mips3 \n"
537 "1: lld %1, %2 # atomic64_sub_if_positive\n" 574 "1: lld %1, %2 # atomic64_sub_if_positive\n"
538 " dsubu %0, %1, %3 \n" 575 " dsubu %0, %1, %3 \n"
539 " bltz %0, 1f \n" 576 " bltz %0, 1f \n"
@@ -541,6 +578,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
541 " beqzl %0, 1b \n" 578 " beqzl %0, 1b \n"
542 " sync \n" 579 " sync \n"
543 "1: \n" 580 "1: \n"
581 " .set mips0 \n"
544 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 582 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
545 : "Ir" (i), "m" (v->counter) 583 : "Ir" (i), "m" (v->counter)
546 : "memory"); 584 : "memory");
@@ -548,6 +586,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
548 unsigned long temp; 586 unsigned long temp;
549 587
550 __asm__ __volatile__( 588 __asm__ __volatile__(
589 " .set mips3 \n"
551 "1: lld %1, %2 # atomic64_sub_if_positive\n" 590 "1: lld %1, %2 # atomic64_sub_if_positive\n"
552 " dsubu %0, %1, %3 \n" 591 " dsubu %0, %1, %3 \n"
553 " bltz %0, 1f \n" 592 " bltz %0, 1f \n"
@@ -555,6 +594,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
555 " beqz %0, 1b \n" 594 " beqz %0, 1b \n"
556 " sync \n" 595 " sync \n"
557 "1: \n" 596 "1: \n"
597 " .set mips0 \n"
558 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 598 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
559 : "Ir" (i), "m" (v->counter) 599 : "Ir" (i), "m" (v->counter)
560 : "memory"); 600 : "memory");
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index eb8d79dba11c..5496f9064a6a 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -12,20 +12,21 @@
12#include <linux/config.h> 12#include <linux/config.h>
13#include <linux/compiler.h> 13#include <linux/compiler.h>
14#include <linux/types.h> 14#include <linux/types.h>
15#include <asm/bug.h>
15#include <asm/byteorder.h> /* sigh ... */ 16#include <asm/byteorder.h> /* sigh ... */
16#include <asm/cpu-features.h> 17#include <asm/cpu-features.h>
17 18
18#if (_MIPS_SZLONG == 32) 19#if (_MIPS_SZLONG == 32)
19#define SZLONG_LOG 5 20#define SZLONG_LOG 5
20#define SZLONG_MASK 31UL 21#define SZLONG_MASK 31UL
21#define __LL "ll " 22#define __LL "ll "
22#define __SC "sc " 23#define __SC "sc "
23#define cpu_to_lelongp(x) cpu_to_le32p((__u32 *) (x)) 24#define cpu_to_lelongp(x) cpu_to_le32p((__u32 *) (x))
24#elif (_MIPS_SZLONG == 64) 25#elif (_MIPS_SZLONG == 64)
25#define SZLONG_LOG 6 26#define SZLONG_LOG 6
26#define SZLONG_MASK 63UL 27#define SZLONG_MASK 63UL
27#define __LL "lld " 28#define __LL "lld "
28#define __SC "scd " 29#define __SC "scd "
29#define cpu_to_lelongp(x) cpu_to_le64p((__u64 *) (x)) 30#define cpu_to_lelongp(x) cpu_to_le64p((__u64 *) (x))
30#endif 31#endif
31 32
@@ -72,18 +73,22 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
72 73
73 if (cpu_has_llsc && R10000_LLSC_WAR) { 74 if (cpu_has_llsc && R10000_LLSC_WAR) {
74 __asm__ __volatile__( 75 __asm__ __volatile__(
76 " .set mips3 \n"
75 "1: " __LL "%0, %1 # set_bit \n" 77 "1: " __LL "%0, %1 # set_bit \n"
76 " or %0, %2 \n" 78 " or %0, %2 \n"
77 " "__SC "%0, %1 \n" 79 " " __SC "%0, %1 \n"
78 " beqzl %0, 1b \n" 80 " beqzl %0, 1b \n"
81 " .set mips0 \n"
79 : "=&r" (temp), "=m" (*m) 82 : "=&r" (temp), "=m" (*m)
80 : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); 83 : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m));
81 } else if (cpu_has_llsc) { 84 } else if (cpu_has_llsc) {
82 __asm__ __volatile__( 85 __asm__ __volatile__(
86 " .set mips3 \n"
83 "1: " __LL "%0, %1 # set_bit \n" 87 "1: " __LL "%0, %1 # set_bit \n"
84 " or %0, %2 \n" 88 " or %0, %2 \n"
85 " "__SC "%0, %1 \n" 89 " " __SC "%0, %1 \n"
86 " beqz %0, 1b \n" 90 " beqz %0, 1b \n"
91 " .set mips0 \n"
87 : "=&r" (temp), "=m" (*m) 92 : "=&r" (temp), "=m" (*m)
88 : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); 93 : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m));
89 } else { 94 } else {
@@ -132,18 +137,22 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
132 137
133 if (cpu_has_llsc && R10000_LLSC_WAR) { 138 if (cpu_has_llsc && R10000_LLSC_WAR) {
134 __asm__ __volatile__( 139 __asm__ __volatile__(
140 " .set mips3 \n"
135 "1: " __LL "%0, %1 # clear_bit \n" 141 "1: " __LL "%0, %1 # clear_bit \n"
136 " and %0, %2 \n" 142 " and %0, %2 \n"
137 " " __SC "%0, %1 \n" 143 " " __SC "%0, %1 \n"
138 " beqzl %0, 1b \n" 144 " beqzl %0, 1b \n"
145 " .set mips0 \n"
139 : "=&r" (temp), "=m" (*m) 146 : "=&r" (temp), "=m" (*m)
140 : "ir" (~(1UL << (nr & SZLONG_MASK))), "m" (*m)); 147 : "ir" (~(1UL << (nr & SZLONG_MASK))), "m" (*m));
141 } else if (cpu_has_llsc) { 148 } else if (cpu_has_llsc) {
142 __asm__ __volatile__( 149 __asm__ __volatile__(
150 " .set mips3 \n"
143 "1: " __LL "%0, %1 # clear_bit \n" 151 "1: " __LL "%0, %1 # clear_bit \n"
144 " and %0, %2 \n" 152 " and %0, %2 \n"
145 " " __SC "%0, %1 \n" 153 " " __SC "%0, %1 \n"
146 " beqz %0, 1b \n" 154 " beqz %0, 1b \n"
155 " .set mips0 \n"
147 : "=&r" (temp), "=m" (*m) 156 : "=&r" (temp), "=m" (*m)
148 : "ir" (~(1UL << (nr & SZLONG_MASK))), "m" (*m)); 157 : "ir" (~(1UL << (nr & SZLONG_MASK))), "m" (*m));
149 } else { 158 } else {
@@ -191,10 +200,12 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
191 unsigned long temp; 200 unsigned long temp;
192 201
193 __asm__ __volatile__( 202 __asm__ __volatile__(
203 " .set mips3 \n"
194 "1: " __LL "%0, %1 # change_bit \n" 204 "1: " __LL "%0, %1 # change_bit \n"
195 " xor %0, %2 \n" 205 " xor %0, %2 \n"
196 " "__SC "%0, %1 \n" 206 " " __SC "%0, %1 \n"
197 " beqzl %0, 1b \n" 207 " beqzl %0, 1b \n"
208 " .set mips0 \n"
198 : "=&r" (temp), "=m" (*m) 209 : "=&r" (temp), "=m" (*m)
199 : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); 210 : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m));
200 } else if (cpu_has_llsc) { 211 } else if (cpu_has_llsc) {
@@ -202,10 +213,12 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
202 unsigned long temp; 213 unsigned long temp;
203 214
204 __asm__ __volatile__( 215 __asm__ __volatile__(
216 " .set mips3 \n"
205 "1: " __LL "%0, %1 # change_bit \n" 217 "1: " __LL "%0, %1 # change_bit \n"
206 " xor %0, %2 \n" 218 " xor %0, %2 \n"
207 " "__SC "%0, %1 \n" 219 " " __SC "%0, %1 \n"
208 " beqz %0, 1b \n" 220 " beqz %0, 1b \n"
221 " .set mips0 \n"
209 : "=&r" (temp), "=m" (*m) 222 : "=&r" (temp), "=m" (*m)
210 : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); 223 : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m));
211 } else { 224 } else {
@@ -253,14 +266,16 @@ static inline int test_and_set_bit(unsigned long nr,
253 unsigned long temp, res; 266 unsigned long temp, res;
254 267
255 __asm__ __volatile__( 268 __asm__ __volatile__(
269 " .set mips3 \n"
256 "1: " __LL "%0, %1 # test_and_set_bit \n" 270 "1: " __LL "%0, %1 # test_and_set_bit \n"
257 " or %2, %0, %3 \n" 271 " or %2, %0, %3 \n"
258 " " __SC "%2, %1 \n" 272 " " __SC "%2, %1 \n"
259 " beqzl %2, 1b \n" 273 " beqzl %2, 1b \n"
260 " and %2, %0, %3 \n" 274 " and %2, %0, %3 \n"
261#ifdef CONFIG_SMP 275#ifdef CONFIG_SMP
262 "sync \n" 276 " sync \n"
263#endif 277#endif
278 " .set mips0 \n"
264 : "=&r" (temp), "=m" (*m), "=&r" (res) 279 : "=&r" (temp), "=m" (*m), "=&r" (res)
265 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) 280 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m)
266 : "memory"); 281 : "memory");
@@ -271,16 +286,18 @@ static inline int test_and_set_bit(unsigned long nr,
271 unsigned long temp, res; 286 unsigned long temp, res;
272 287
273 __asm__ __volatile__( 288 __asm__ __volatile__(
274 " .set noreorder # test_and_set_bit \n" 289 " .set push \n"
275 "1: " __LL "%0, %1 \n" 290 " .set noreorder \n"
291 " .set mips3 \n"
292 "1: " __LL "%0, %1 # test_and_set_bit \n"
276 " or %2, %0, %3 \n" 293 " or %2, %0, %3 \n"
277 " " __SC "%2, %1 \n" 294 " " __SC "%2, %1 \n"
278 " beqz %2, 1b \n" 295 " beqz %2, 1b \n"
279 " and %2, %0, %3 \n" 296 " and %2, %0, %3 \n"
280#ifdef CONFIG_SMP 297#ifdef CONFIG_SMP
281 "sync \n" 298 " sync \n"
282#endif 299#endif
283 ".set\treorder" 300 " .set pop \n"
284 : "=&r" (temp), "=m" (*m), "=&r" (res) 301 : "=&r" (temp), "=m" (*m), "=&r" (res)
285 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) 302 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m)
286 : "memory"); 303 : "memory");
@@ -343,15 +360,17 @@ static inline int test_and_clear_bit(unsigned long nr,
343 unsigned long temp, res; 360 unsigned long temp, res;
344 361
345 __asm__ __volatile__( 362 __asm__ __volatile__(
363 " .set mips3 \n"
346 "1: " __LL "%0, %1 # test_and_clear_bit \n" 364 "1: " __LL "%0, %1 # test_and_clear_bit \n"
347 " or %2, %0, %3 \n" 365 " or %2, %0, %3 \n"
348 " xor %2, %3 \n" 366 " xor %2, %3 \n"
349 __SC "%2, %1 \n" 367 " " __SC "%2, %1 \n"
350 " beqzl %2, 1b \n" 368 " beqzl %2, 1b \n"
351 " and %2, %0, %3 \n" 369 " and %2, %0, %3 \n"
352#ifdef CONFIG_SMP 370#ifdef CONFIG_SMP
353 " sync \n" 371 " sync \n"
354#endif 372#endif
373 " .set mips0 \n"
355 : "=&r" (temp), "=m" (*m), "=&r" (res) 374 : "=&r" (temp), "=m" (*m), "=&r" (res)
356 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) 375 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m)
357 : "memory"); 376 : "memory");
@@ -362,17 +381,19 @@ static inline int test_and_clear_bit(unsigned long nr,
362 unsigned long temp, res; 381 unsigned long temp, res;
363 382
364 __asm__ __volatile__( 383 __asm__ __volatile__(
365 " .set noreorder # test_and_clear_bit \n" 384 " .set push \n"
366 "1: " __LL "%0, %1 \n" 385 " .set noreorder \n"
386 " .set mips3 \n"
387 "1: " __LL "%0, %1 # test_and_clear_bit \n"
367 " or %2, %0, %3 \n" 388 " or %2, %0, %3 \n"
368 " xor %2, %3 \n" 389 " xor %2, %3 \n"
369 __SC "%2, %1 \n" 390 " " __SC "%2, %1 \n"
370 " beqz %2, 1b \n" 391 " beqz %2, 1b \n"
371 " and %2, %0, %3 \n" 392 " and %2, %0, %3 \n"
372#ifdef CONFIG_SMP 393#ifdef CONFIG_SMP
373 " sync \n" 394 " sync \n"
374#endif 395#endif
375 " .set reorder \n" 396 " .set pop \n"
376 : "=&r" (temp), "=m" (*m), "=&r" (res) 397 : "=&r" (temp), "=m" (*m), "=&r" (res)
377 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) 398 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m)
378 : "memory"); 399 : "memory");
@@ -435,14 +456,16 @@ static inline int test_and_change_bit(unsigned long nr,
435 unsigned long temp, res; 456 unsigned long temp, res;
436 457
437 __asm__ __volatile__( 458 __asm__ __volatile__(
438 "1: " __LL " %0, %1 # test_and_change_bit \n" 459 " .set mips3 \n"
460 "1: " __LL "%0, %1 # test_and_change_bit \n"
439 " xor %2, %0, %3 \n" 461 " xor %2, %0, %3 \n"
440 " "__SC "%2, %1 \n" 462 " " __SC "%2, %1 \n"
441 " beqzl %2, 1b \n" 463 " beqzl %2, 1b \n"
442 " and %2, %0, %3 \n" 464 " and %2, %0, %3 \n"
443#ifdef CONFIG_SMP 465#ifdef CONFIG_SMP
444 " sync \n" 466 " sync \n"
445#endif 467#endif
468 " .set mips0 \n"
446 : "=&r" (temp), "=m" (*m), "=&r" (res) 469 : "=&r" (temp), "=m" (*m), "=&r" (res)
447 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) 470 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m)
448 : "memory"); 471 : "memory");
@@ -453,16 +476,18 @@ static inline int test_and_change_bit(unsigned long nr,
453 unsigned long temp, res; 476 unsigned long temp, res;
454 477
455 __asm__ __volatile__( 478 __asm__ __volatile__(
456 " .set noreorder # test_and_change_bit \n" 479 " .set push \n"
457 "1: " __LL " %0, %1 \n" 480 " .set noreorder \n"
481 " .set mips3 \n"
482 "1: " __LL "%0, %1 # test_and_change_bit \n"
458 " xor %2, %0, %3 \n" 483 " xor %2, %0, %3 \n"
459 " "__SC "\t%2, %1 \n" 484 " " __SC "\t%2, %1 \n"
460 " beqz %2, 1b \n" 485 " beqz %2, 1b \n"
461 " and %2, %0, %3 \n" 486 " and %2, %0, %3 \n"
462#ifdef CONFIG_SMP 487#ifdef CONFIG_SMP
463 " sync \n" 488 " sync \n"
464#endif 489#endif
465 " .set reorder \n" 490 " .set pop \n"
466 : "=&r" (temp), "=m" (*m), "=&r" (res) 491 : "=&r" (temp), "=m" (*m), "=&r" (res)
467 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) 492 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m)
468 : "memory"); 493 : "memory");
@@ -523,22 +548,60 @@ static inline int test_bit(unsigned long nr, const volatile unsigned long *addr)
523} 548}
524 549
525/* 550/*
526 * ffz - find first zero in word. 551 * Return the bit position (0..63) of the most significant 1 bit in a word
552 * Returns -1 if no 1 bit exists
553 */
554static inline int __ilog2(unsigned long x)
555{
556 int lz;
557
558 if (sizeof(x) == 4) {
559 __asm__ (
560 " .set push \n"
561 " .set mips32 \n"
562 " clz %0, %1 \n"
563 " .set pop \n"
564 : "=r" (lz)
565 : "r" (x));
566
567 return 31 - lz;
568 }
569
570 BUG_ON(sizeof(x) != 8);
571
572 __asm__ (
573 " .set push \n"
574 " .set mips64 \n"
575 " dclz %0, %1 \n"
576 " .set pop \n"
577 : "=r" (lz)
578 : "r" (x));
579
580 return 63 - lz;
581}
582
583/*
584 * __ffs - find first bit in word.
527 * @word: The word to search 585 * @word: The word to search
528 * 586 *
529 * Undefined if no zero exists, so code should check against ~0UL first. 587 * Returns 0..SZLONG-1
588 * Undefined if no bit exists, so code should check against 0 first.
530 */ 589 */
531static inline unsigned long ffz(unsigned long word) 590static inline unsigned long __ffs(unsigned long word)
532{ 591{
592#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
593 return __ilog2(word & -word);
594#else
533 int b = 0, s; 595 int b = 0, s;
534 596
535 word = ~word;
536#ifdef CONFIG_32BIT 597#ifdef CONFIG_32BIT
537 s = 16; if (word << 16 != 0) s = 0; b += s; word >>= s; 598 s = 16; if (word << 16 != 0) s = 0; b += s; word >>= s;
538 s = 8; if (word << 24 != 0) s = 0; b += s; word >>= s; 599 s = 8; if (word << 24 != 0) s = 0; b += s; word >>= s;
539 s = 4; if (word << 28 != 0) s = 0; b += s; word >>= s; 600 s = 4; if (word << 28 != 0) s = 0; b += s; word >>= s;
540 s = 2; if (word << 30 != 0) s = 0; b += s; word >>= s; 601 s = 2; if (word << 30 != 0) s = 0; b += s; word >>= s;
541 s = 1; if (word << 31 != 0) s = 0; b += s; 602 s = 1; if (word << 31 != 0) s = 0; b += s;
603
604 return b;
542#endif 605#endif
543#ifdef CONFIG_64BIT 606#ifdef CONFIG_64BIT
544 s = 32; if (word << 32 != 0) s = 0; b += s; word >>= s; 607 s = 32; if (word << 32 != 0) s = 0; b += s; word >>= s;
@@ -547,27 +610,92 @@ static inline unsigned long ffz(unsigned long word)
547 s = 4; if (word << 60 != 0) s = 0; b += s; word >>= s; 610 s = 4; if (word << 60 != 0) s = 0; b += s; word >>= s;
548 s = 2; if (word << 62 != 0) s = 0; b += s; word >>= s; 611 s = 2; if (word << 62 != 0) s = 0; b += s; word >>= s;
549 s = 1; if (word << 63 != 0) s = 0; b += s; 612 s = 1; if (word << 63 != 0) s = 0; b += s;
550#endif
551 613
552 return b; 614 return b;
615#endif
616#endif
553} 617}
554 618
555/* 619/*
556 * __ffs - find first bit in word. 620 * ffs - find first bit set.
557 * @word: The word to search 621 * @word: The word to search
558 * 622 *
559 * Undefined if no bit exists, so code should check against 0 first. 623 * Returns 1..SZLONG
624 * Returns 0 if no bit exists
560 */ 625 */
561static inline unsigned long __ffs(unsigned long word) 626
627static inline unsigned long ffs(unsigned long word)
562{ 628{
563 return ffz(~word); 629 if (!word)
630 return 0;
631
632 return __ffs(word) + 1;
564} 633}
565 634
566/* 635/*
567 * fls: find last bit set. 636 * ffz - find first zero in word.
637 * @word: The word to search
638 *
639 * Undefined if no zero exists, so code should check against ~0UL first.
640 */
641static inline unsigned long ffz(unsigned long word)
642{
643 return __ffs (~word);
644}
645
646/*
647 * flz - find last zero in word.
648 * @word: The word to search
649 *
650 * Returns 0..SZLONG-1
651 * Undefined if no zero exists, so code should check against ~0UL first.
652 */
653static inline unsigned long flz(unsigned long word)
654{
655#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
656 return __ilog2(~word);
657#else
658#ifdef CONFIG_32BIT
659 int r = 31, s;
660 word = ~word;
661 s = 16; if ((word & 0xffff0000)) s = 0; r -= s; word <<= s;
662 s = 8; if ((word & 0xff000000)) s = 0; r -= s; word <<= s;
663 s = 4; if ((word & 0xf0000000)) s = 0; r -= s; word <<= s;
664 s = 2; if ((word & 0xc0000000)) s = 0; r -= s; word <<= s;
665 s = 1; if ((word & 0x80000000)) s = 0; r -= s;
666
667 return r;
668#endif
669#ifdef CONFIG_64BIT
670 int r = 63, s;
671 word = ~word;
672 s = 32; if ((word & 0xffffffff00000000UL)) s = 0; r -= s; word <<= s;
673 s = 16; if ((word & 0xffff000000000000UL)) s = 0; r -= s; word <<= s;
674 s = 8; if ((word & 0xff00000000000000UL)) s = 0; r -= s; word <<= s;
675 s = 4; if ((word & 0xf000000000000000UL)) s = 0; r -= s; word <<= s;
676 s = 2; if ((word & 0xc000000000000000UL)) s = 0; r -= s; word <<= s;
677 s = 1; if ((word & 0x8000000000000000UL)) s = 0; r -= s;
678
679 return r;
680#endif
681#endif
682}
683
684/*
685 * fls - find last bit set.
686 * @word: The word to search
687 *
688 * Returns 1..SZLONG
689 * Returns 0 if no bit exists
568 */ 690 */
691static inline unsigned long fls(unsigned long word)
692{
693 if (word == 0)
694 return 0;
695
696 return flz(~word) + 1;
697}
569 698
570#define fls(x) generic_fls(x)
571 699
572/* 700/*
573 * find_next_zero_bit - find the first zero bit in a memory region 701 * find_next_zero_bit - find the first zero bit in a memory region
@@ -704,17 +832,6 @@ static inline int sched_find_first_bit(const unsigned long *b)
704} 832}
705 833
706/* 834/*
707 * ffs - find first bit set
708 * @x: the word to search
709 *
710 * This is defined the same way as
711 * the libc and compiler builtin ffs routines, therefore
712 * differs in spirit from the above ffz (man ffs).
713 */
714
715#define ffs(x) generic_ffs(x)
716
717/*
718 * hweightN - returns the hamming weight of a N-bit word 835 * hweightN - returns the hamming weight of a N-bit word
719 * @x: the word to weigh 836 * @x: the word to weigh
720 * 837 *
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h
index b1e57d783604..14fc88f27226 100644
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -77,6 +77,7 @@
77#define MACH_SGI_IP27 1 /* Origin 200, Origin 2000, Onyx 2 */ 77#define MACH_SGI_IP27 1 /* Origin 200, Origin 2000, Onyx 2 */
78#define MACH_SGI_IP28 2 /* Indigo2 Impact */ 78#define MACH_SGI_IP28 2 /* Indigo2 Impact */
79#define MACH_SGI_IP32 3 /* O2 */ 79#define MACH_SGI_IP32 3 /* O2 */
80#define MACH_SGI_IP30 4 /* Octane, Octane2 */
80 81
81/* 82/*
82 * Valid machtype for group COBALT 83 * Valid machtype for group COBALT
@@ -136,6 +137,7 @@
136#define MACH_GROUP_PHILIPS 14 137#define MACH_GROUP_PHILIPS 14
137#define MACH_PHILIPS_NINO 0 /* Nino */ 138#define MACH_PHILIPS_NINO 0 /* Nino */
138#define MACH_PHILIPS_VELO 1 /* Velo */ 139#define MACH_PHILIPS_VELO 1 /* Velo */
140#define MACH_PHILIPS_JBS 2 /* JBS */
139 141
140/* 142/*
141 * Valid machtype for group Globespan 143 * Valid machtype for group Globespan
@@ -159,6 +161,7 @@
159#define MACH_TOSHIBA_JMR3927 3 /* JMR-TX3927 CPU/IO board */ 161#define MACH_TOSHIBA_JMR3927 3 /* JMR-TX3927 CPU/IO board */
160#define MACH_TOSHIBA_RBTX4927 4 162#define MACH_TOSHIBA_RBTX4927 4
161#define MACH_TOSHIBA_RBTX4937 5 163#define MACH_TOSHIBA_RBTX4937 5
164#define MACH_TOSHIBA_RBTX4938 6
162 165
163#define GROUP_TOSHIBA_NAMES { "Pallas", "TopasCE", "JMR", "JMR TX3927", \ 166#define GROUP_TOSHIBA_NAMES { "Pallas", "TopasCE", "JMR", "JMR TX3927", \
164 "RBTX4927", "RBTX4937" } 167 "RBTX4927", "RBTX4937" }
@@ -177,6 +180,8 @@
177#define MACH_MTX1 7 /* 4G MTX-1 Au1500-based board */ 180#define MACH_MTX1 7 /* 4G MTX-1 Au1500-based board */
178#define MACH_PB1550 8 /* Au1550-based eval board */ 181#define MACH_PB1550 8 /* Au1550-based eval board */
179#define MACH_DB1550 9 /* Au1550-based eval board */ 182#define MACH_DB1550 9 /* Au1550-based eval board */
183#define MACH_PB1200 10 /* Au1200-based eval board */
184#define MACH_DB1200 11 /* Au1200-based eval board */
180 185
181/* 186/*
182 * Valid machtype for group NEC_VR41XX 187 * Valid machtype for group NEC_VR41XX
diff --git a/include/asm-mips/break.h b/include/asm-mips/break.h
index 2e6de788f207..25b980c91e7e 100644
--- a/include/asm-mips/break.h
+++ b/include/asm-mips/break.h
@@ -28,6 +28,7 @@
28#define BRK_NORLD 10 /* No rld found - not used by Linux/MIPS */ 28#define BRK_NORLD 10 /* No rld found - not used by Linux/MIPS */
29#define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */ 29#define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */
30#define BRK_BUG 512 /* Used by BUG() */ 30#define BRK_BUG 512 /* Used by BUG() */
31#define BRK_KDB 513 /* Used in KDB_ENTER() */
31#define BRK_MULOVF 1023 /* Multiply overflow */ 32#define BRK_MULOVF 1023 /* Multiply overflow */
32 33
33#endif /* __ASM_BREAK_H */ 34#endif /* __ASM_BREAK_H */
diff --git a/include/asm-mips/bug.h b/include/asm-mips/bug.h
index 3f594b440abc..87d49a5bdc63 100644
--- a/include/asm-mips/bug.h
+++ b/include/asm-mips/bug.h
@@ -1,16 +1,21 @@
1#ifndef __ASM_BUG_H 1#ifndef __ASM_BUG_H
2#define __ASM_BUG_H 2#define __ASM_BUG_H
3 3
4#include <asm/break.h> 4#include <linux/config.h>
5 5
6#ifdef CONFIG_BUG 6#ifdef CONFIG_BUG
7#define HAVE_ARCH_BUG 7
8#include <asm/break.h>
9
8#define BUG() \ 10#define BUG() \
9do { \ 11do { \
10 __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); \ 12 __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); \
11} while (0) 13} while (0)
14
15#define HAVE_ARCH_BUG
16
12#endif 17#endif
13 18
14#include <asm-generic/bug.h> 19#include <asm-generic/bug.h>
15 20
16#endif 21#endif /* __ASM_BUG_H */
diff --git a/include/asm-mips/bugs.h b/include/asm-mips/bugs.h
index b14b961c2100..cb2ea7c15c7a 100644
--- a/include/asm-mips/bugs.h
+++ b/include/asm-mips/bugs.h
@@ -8,12 +8,18 @@
8#define _ASM_BUGS_H 8#define _ASM_BUGS_H
9 9
10#include <linux/config.h> 10#include <linux/config.h>
11#include <linux/delay.h>
12#include <asm/cpu.h>
13#include <asm/cpu-info.h>
11 14
12extern void check_bugs32(void); 15extern void check_bugs32(void);
13extern void check_bugs64(void); 16extern void check_bugs64(void);
14 17
15static inline void check_bugs(void) 18static inline void check_bugs(void)
16{ 19{
20 unsigned int cpu = smp_processor_id();
21
22 cpu_data[cpu].udelay_val = loops_per_jiffy;
17 check_bugs32(); 23 check_bugs32();
18#ifdef CONFIG_64BIT 24#ifdef CONFIG_64BIT
19 check_bugs64(); 25 check_bugs64();
diff --git a/include/asm-mips/cache.h b/include/asm-mips/cache.h
index 4517bdf20953..1a5d1a669db3 100644
--- a/include/asm-mips/cache.h
+++ b/include/asm-mips/cache.h
@@ -10,6 +10,7 @@
10#define _ASM_CACHE_H 10#define _ASM_CACHE_H
11 11
12#include <linux/config.h> 12#include <linux/config.h>
13#include <kmalloc.h>
13 14
14#define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT 15#define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT
15#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 16#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
@@ -18,6 +19,4 @@
18#define SMP_CACHE_SHIFT L1_CACHE_SHIFT 19#define SMP_CACHE_SHIFT L1_CACHE_SHIFT
19#define SMP_CACHE_BYTES L1_CACHE_BYTES 20#define SMP_CACHE_BYTES L1_CACHE_BYTES
20 21
21#define ARCH_KMALLOC_MINALIGN 8
22
23#endif /* _ASM_CACHE_H */ 22#endif /* _ASM_CACHE_H */
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h
index 635f1bfb403e..a18ba2edc0b6 100644
--- a/include/asm-mips/cacheflush.h
+++ b/include/asm-mips/cacheflush.h
@@ -49,17 +49,29 @@ static inline void flush_dcache_page(struct page *page)
49 49
50extern void (*flush_icache_page)(struct vm_area_struct *vma, 50extern void (*flush_icache_page)(struct vm_area_struct *vma,
51 struct page *page); 51 struct page *page);
52extern void (*flush_icache_range)(unsigned long start, unsigned long end); 52extern void (*flush_icache_range)(unsigned long __user start,
53 unsigned long __user end);
53#define flush_cache_vmap(start, end) flush_cache_all() 54#define flush_cache_vmap(start, end) flush_cache_all()
54#define flush_cache_vunmap(start, end) flush_cache_all() 55#define flush_cache_vunmap(start, end) flush_cache_all()
55 56
56#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 57static inline void copy_to_user_page(struct vm_area_struct *vma,
57do { \ 58 struct page *page, unsigned long vaddr, void *dst, const void *src,
58 memcpy(dst, (void *) src, len); \ 59 unsigned long len)
59 flush_icache_page(vma, page); \ 60{
60} while (0) 61 if (cpu_has_dc_aliases)
61#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 62 flush_cache_page(vma, vaddr, page_to_pfn(page));
62 memcpy(dst, src, len) 63 memcpy(dst, src, len);
64 flush_icache_page(vma, page);
65}
66
67static inline void copy_from_user_page(struct vm_area_struct *vma,
68 struct page *page, unsigned long vaddr, void *dst, const void *src,
69 unsigned long len)
70{
71 if (cpu_has_dc_aliases)
72 flush_cache_page(vma, vaddr, page_to_pfn(page));
73 memcpy(dst, src, len);
74}
63 75
64extern void (*flush_cache_sigtramp)(unsigned long addr); 76extern void (*flush_cache_sigtramp)(unsigned long addr);
65extern void (*flush_icache_all)(void); 77extern void (*flush_icache_all)(void);
@@ -78,4 +90,7 @@ extern void (*flush_data_cache_page)(unsigned long addr);
78#define ClearPageDcacheDirty(page) \ 90#define ClearPageDcacheDirty(page) \
79 clear_bit(PG_dcache_dirty, &(page)->flags) 91 clear_bit(PG_dcache_dirty, &(page)->flags)
80 92
93/* Run kernel code uncached, useful for cache probing functions. */
94unsigned long __init run_uncached(void *func);
95
81#endif /* _ASM_CACHEFLUSH_H */ 96#endif /* _ASM_CACHEFLUSH_H */
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h
index c1ea5a8714f3..b09f8971e95d 100644
--- a/include/asm-mips/checksum.h
+++ b/include/asm-mips/checksum.h
@@ -34,8 +34,9 @@ unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum);
34 * this is a new version of the above that records errors it finds in *errp, 34 * this is a new version of the above that records errors it finds in *errp,
35 * but continues and zeros the rest of the buffer. 35 * but continues and zeros the rest of the buffer.
36 */ 36 */
37unsigned int csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, int len, 37unsigned int csum_partial_copy_from_user(const unsigned char __user *src,
38 unsigned int sum, int *errp); 38 unsigned char *dst, int len,
39 unsigned int sum, int *errp);
39 40
40/* 41/*
41 * Copy and checksum to user 42 * Copy and checksum to user
@@ -70,14 +71,15 @@ unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *
70static inline unsigned short int csum_fold(unsigned int sum) 71static inline unsigned short int csum_fold(unsigned int sum)
71{ 72{
72 __asm__( 73 __asm__(
73 ".set\tnoat\t\t\t# csum_fold\n\t" 74 " .set push # csum_fold\n"
74 "sll\t$1,%0,16\n\t" 75 " .set noat \n"
75 "addu\t%0,$1\n\t" 76 " sll $1, %0, 16 \n"
76 "sltu\t$1,%0,$1\n\t" 77 " addu %0, $1 \n"
77 "srl\t%0,%0,16\n\t" 78 " sltu $1, %0, $1 \n"
78 "addu\t%0,$1\n\t" 79 " srl %0, %0, 16 \n"
79 "xori\t%0,0xffff\n\t" 80 " addu %0, $1 \n"
80 ".set\tat" 81 " xori %0, 0xffff \n"
82 " .set pop"
81 : "=r" (sum) 83 : "=r" (sum)
82 : "0" (sum)); 84 : "0" (sum));
83 85
@@ -127,29 +129,30 @@ static inline unsigned int csum_tcpudp_nofold(unsigned long saddr,
127 unsigned int sum) 129 unsigned int sum)
128{ 130{
129 __asm__( 131 __asm__(
130 ".set\tnoat\t\t\t# csum_tcpudp_nofold\n\t" 132 " .set push # csum_tcpudp_nofold\n"
133 " .set noat \n"
131#ifdef CONFIG_32BIT 134#ifdef CONFIG_32BIT
132 "addu\t%0, %2\n\t" 135 " addu %0, %2 \n"
133 "sltu\t$1, %0, %2\n\t" 136 " sltu $1, %0, %2 \n"
134 "addu\t%0, $1\n\t" 137 " addu %0, $1 \n"
135 138
136 "addu\t%0, %3\n\t" 139 " addu %0, %3 \n"
137 "sltu\t$1, %0, %3\n\t" 140 " sltu $1, %0, %3 \n"
138 "addu\t%0, $1\n\t" 141 " addu %0, $1 \n"
139 142
140 "addu\t%0, %4\n\t" 143 " addu %0, %4 \n"
141 "sltu\t$1, %0, %4\n\t" 144 " sltu $1, %0, %4 \n"
142 "addu\t%0, $1\n\t" 145 " addu %0, $1 \n"
143#endif 146#endif
144#ifdef CONFIG_64BIT 147#ifdef CONFIG_64BIT
145 "daddu\t%0, %2\n\t" 148 " daddu %0, %2 \n"
146 "daddu\t%0, %3\n\t" 149 " daddu %0, %3 \n"
147 "daddu\t%0, %4\n\t" 150 " daddu %0, %4 \n"
148 "dsll32\t$1, %0, 0\n\t" 151 " dsll32 $1, %0, 0 \n"
149 "daddu\t%0, $1\n\t" 152 " daddu %0, $1 \n"
150 "dsrl32\t%0, %0, 0\n\t" 153 " dsra32 %0, %0, 0 \n"
151#endif 154#endif
152 ".set\tat" 155 " .set pop"
153 : "=r" (sum) 156 : "=r" (sum)
154 : "0" (daddr), "r"(saddr), 157 : "0" (daddr), "r"(saddr),
155#ifdef __MIPSEL__ 158#ifdef __MIPSEL__
@@ -192,57 +195,57 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
192 unsigned int sum) 195 unsigned int sum)
193{ 196{
194 __asm__( 197 __asm__(
195 ".set\tpush\t\t\t# csum_ipv6_magic\n\t" 198 " .set push # csum_ipv6_magic\n"
196 ".set\tnoreorder\n\t" 199 " .set noreorder \n"
197 ".set\tnoat\n\t" 200 " .set noat \n"
198 "addu\t%0, %5\t\t\t# proto (long in network byte order)\n\t" 201 " addu %0, %5 # proto (long in network byte order)\n"
199 "sltu\t$1, %0, %5\n\t" 202 " sltu $1, %0, %5 \n"
200 "addu\t%0, $1\n\t" 203 " addu %0, $1 \n"
201 204
202 "addu\t%0, %6\t\t\t# csum\n\t" 205 " addu %0, %6 # csum\n"
203 "sltu\t$1, %0, %6\n\t" 206 " sltu $1, %0, %6 \n"
204 "lw\t%1, 0(%2)\t\t\t# four words source address\n\t" 207 " lw %1, 0(%2) # four words source address\n"
205 "addu\t%0, $1\n\t" 208 " addu %0, $1 \n"
206 "addu\t%0, %1\n\t" 209 " addu %0, %1 \n"
207 "sltu\t$1, %0, %1\n\t" 210 " sltu $1, %0, %1 \n"
208 211
209 "lw\t%1, 4(%2)\n\t" 212 " lw %1, 4(%2) \n"
210 "addu\t%0, $1\n\t" 213 " addu %0, $1 \n"
211 "addu\t%0, %1\n\t" 214 " addu %0, %1 \n"
212 "sltu\t$1, %0, %1\n\t" 215 " sltu $1, %0, %1 \n"
213 216
214 "lw\t%1, 8(%2)\n\t" 217 " lw %1, 8(%2) \n"
215 "addu\t%0, $1\n\t" 218 " addu %0, $1 \n"
216 "addu\t%0, %1\n\t" 219 " addu %0, %1 \n"
217 "sltu\t$1, %0, %1\n\t" 220 " sltu $1, %0, %1 \n"
218 221
219 "lw\t%1, 12(%2)\n\t" 222 " lw %1, 12(%2) \n"
220 "addu\t%0, $1\n\t" 223 " addu %0, $1 \n"
221 "addu\t%0, %1\n\t" 224 " addu %0, %1 \n"
222 "sltu\t$1, %0, %1\n\t" 225 " sltu $1, %0, %1 \n"
223 226
224 "lw\t%1, 0(%3)\n\t" 227 " lw %1, 0(%3) \n"
225 "addu\t%0, $1\n\t" 228 " addu %0, $1 \n"
226 "addu\t%0, %1\n\t" 229 " addu %0, %1 \n"
227 "sltu\t$1, %0, %1\n\t" 230 " sltu $1, %0, %1 \n"
228 231
229 "lw\t%1, 4(%3)\n\t" 232 " lw %1, 4(%3) \n"
230 "addu\t%0, $1\n\t" 233 " addu %0, $1 \n"
231 "addu\t%0, %1\n\t" 234 " addu %0, %1 \n"
232 "sltu\t$1, %0, %1\n\t" 235 " sltu $1, %0, %1 \n"
233 236
234 "lw\t%1, 8(%3)\n\t" 237 " lw %1, 8(%3) \n"
235 "addu\t%0, $1\n\t" 238 " addu %0, $1 \n"
236 "addu\t%0, %1\n\t" 239 " addu %0, %1 \n"
237 "sltu\t$1, %0, %1\n\t" 240 " sltu $1, %0, %1 \n"
238 241
239 "lw\t%1, 12(%3)\n\t" 242 " lw %1, 12(%3) \n"
240 "addu\t%0, $1\n\t" 243 " addu %0, $1 \n"
241 "addu\t%0, %1\n\t" 244 " addu %0, %1 \n"
242 "sltu\t$1, %0, %1\n\t" 245 " sltu $1, %0, %1 \n"
243 246
244 "addu\t%0, $1\t\t\t# Add final carry\n\t" 247 " addu %0, $1 # Add final carry\n"
245 ".set\tpop" 248 " .set pop"
246 : "=r" (sum), "=r" (proto) 249 : "=r" (sum), "=r" (proto)
247 : "r" (saddr), "r" (daddr), 250 : "r" (saddr), "r" (daddr),
248 "0" (htonl(len)), "1" (htonl(proto)), "r" (sum)); 251 "0" (htonl(len)), "1" (htonl(proto)), "r" (sum));
diff --git a/include/asm-mips/cobalt/cobalt.h b/include/asm-mips/cobalt/cobalt.h
index ca1fbc0579fe..78e1df2095fb 100644
--- a/include/asm-mips/cobalt/cobalt.h
+++ b/include/asm-mips/cobalt/cobalt.h
@@ -19,18 +19,23 @@
19 * 9 - PCI 19 * 9 - PCI
20 * 14 - IDE0 20 * 14 - IDE0
21 * 15 - IDE1 21 * 15 - IDE1
22 * 22 */
23#define COBALT_QUBE_SLOT_IRQ 9
24
25/*
23 * CPU IRQs are 16 ... 23 26 * CPU IRQs are 16 ... 23
24 */ 27 */
25#define COBALT_TIMER_IRQ 18 28#define COBALT_CPU_IRQ 16
26#define COBALT_SCC_IRQ 19 /* pre-production has 85C30 */ 29
27#define COBALT_RAQ_SCSI_IRQ 19 30#define COBALT_GALILEO_IRQ (COBALT_CPU_IRQ + 2)
28#define COBALT_ETH0_IRQ 19 31#define COBALT_SCC_IRQ (COBALT_CPU_IRQ + 3) /* pre-production has 85C30 */
29#define COBALT_ETH1_IRQ 20 32#define COBALT_RAQ_SCSI_IRQ (COBALT_CPU_IRQ + 3)
30#define COBALT_SERIAL_IRQ 21 33#define COBALT_ETH0_IRQ (COBALT_CPU_IRQ + 3)
31#define COBALT_SCSI_IRQ 21 34#define COBALT_QUBE1_ETH0_IRQ (COBALT_CPU_IRQ + 4)
32#define COBALT_VIA_IRQ 22 /* Chained to VIA ISA bridge */ 35#define COBALT_ETH1_IRQ (COBALT_CPU_IRQ + 4)
33#define COBALT_QUBE_SLOT_IRQ 23 36#define COBALT_SERIAL_IRQ (COBALT_CPU_IRQ + 5)
37#define COBALT_SCSI_IRQ (COBALT_CPU_IRQ + 5)
38#define COBALT_VIA_IRQ (COBALT_CPU_IRQ + 6) /* Chained to VIA ISA bridge */
34 39
35/* 40/*
36 * PCI configuration space manifest constants. These are wired into 41 * PCI configuration space manifest constants. These are wired into
@@ -69,16 +74,21 @@
69 * Most of this really should go into a separate GT64111 header file. 74 * Most of this really should go into a separate GT64111 header file.
70 */ 75 */
71#define GT64111_IO_BASE 0x10000000UL 76#define GT64111_IO_BASE 0x10000000UL
77#define GT64111_IO_END 0x11ffffffUL
78#define GT64111_MEM_BASE 0x12000000UL
79#define GT64111_MEM_END 0x13ffffffUL
72#define GT64111_BASE 0x14000000UL 80#define GT64111_BASE 0x14000000UL
73#define GALILEO_REG(ofs) (KSEG0 + GT64111_BASE + (unsigned long)(ofs)) 81#define GALILEO_REG(ofs) CKSEG1ADDR(GT64111_BASE + (unsigned long)(ofs))
74 82
75#define GALILEO_INL(port) (*(volatile unsigned int *) GALILEO_REG(port)) 83#define GALILEO_INL(port) (*(volatile unsigned int *) GALILEO_REG(port))
76#define GALILEO_OUTL(val, port) \ 84#define GALILEO_OUTL(val, port) \
77do { \ 85do { \
78 *(volatile unsigned int *) GALILEO_REG(port) = (port); \ 86 *(volatile unsigned int *) GALILEO_REG(port) = (val); \
79} while (0) 87} while (0)
80 88
81#define GALILEO_T0EXP 0x0100 89#define GALILEO_INTR_T0EXP (1 << 8)
90#define GALILEO_INTR_RETRY_CTR (1 << 20)
91
82#define GALILEO_ENTC0 0x01 92#define GALILEO_ENTC0 0x01
83#define GALILEO_SELTC0 0x02 93#define GALILEO_SELTC0 0x02
84 94
@@ -86,5 +96,21 @@ do { \
86 GALILEO_OUTL((0x80000000 | (PCI_SLOT (devfn) << 11) | \ 96 GALILEO_OUTL((0x80000000 | (PCI_SLOT (devfn) << 11) | \
87 (PCI_FUNC (devfn) << 8) | (where)), GT_PCI0_CFGADDR_OFS) 97 (PCI_FUNC (devfn) << 8) | (where)), GT_PCI0_CFGADDR_OFS)
88 98
99#define COBALT_LED_PORT (*(volatile unsigned char *) CKSEG1ADDR(0x1c000000))
100# define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */
101# define COBALT_LED_BAR_RIGHT (1 << 1) /* Qube */
102# define COBALT_LED_WEB (1 << 2) /* RaQ */
103# define COBALT_LED_POWER_OFF (1 << 3) /* RaQ */
104# define COBALT_LED_RESET 0x0f
105
106#define COBALT_KEY_PORT ((~*(volatile unsigned int *) CKSEG1ADDR(0x1d000000) >> 24) & COBALT_KEY_MASK)
107# define COBALT_KEY_CLEAR (1 << 1)
108# define COBALT_KEY_LEFT (1 << 2)
109# define COBALT_KEY_UP (1 << 3)
110# define COBALT_KEY_DOWN (1 << 4)
111# define COBALT_KEY_RIGHT (1 << 5)
112# define COBALT_KEY_ENTER (1 << 6)
113# define COBALT_KEY_SELECT (1 << 7)
114# define COBALT_KEY_MASK 0xfe
89 115
90#endif /* __ASM_COBALT_H */ 116#endif /* __ASM_COBALT_H */
diff --git a/include/asm-mips/cobalt/mach-gt64120.h b/include/asm-mips/cobalt/mach-gt64120.h
new file mode 100644
index 000000000000..587fc4378f44
--- /dev/null
+++ b/include/asm-mips/cobalt/mach-gt64120.h
@@ -0,0 +1 @@
/* there's something here ... in the dark */
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h
index 2c084cd4bc0a..35d2604fe69c 100644
--- a/include/asm-mips/compat.h
+++ b/include/asm-mips/compat.h
@@ -15,10 +15,10 @@ typedef s32 compat_clock_t;
15typedef s32 compat_suseconds_t; 15typedef s32 compat_suseconds_t;
16 16
17typedef s32 compat_pid_t; 17typedef s32 compat_pid_t;
18typedef u32 __compat_uid_t; 18typedef s32 __compat_uid_t;
19typedef u32 __compat_gid_t; 19typedef s32 __compat_gid_t;
20typedef u32 __compat_uid32_t; 20typedef __compat_uid_t __compat_uid32_t;
21typedef u32 __compat_gid32_t; 21typedef __compat_gid_t __compat_gid32_t;
22typedef u32 compat_mode_t; 22typedef u32 compat_mode_t;
23typedef u32 compat_ino_t; 23typedef u32 compat_ino_t;
24typedef u32 compat_dev_t; 24typedef u32 compat_dev_t;
@@ -54,8 +54,8 @@ struct compat_stat {
54 compat_ino_t st_ino; 54 compat_ino_t st_ino;
55 compat_mode_t st_mode; 55 compat_mode_t st_mode;
56 compat_nlink_t st_nlink; 56 compat_nlink_t st_nlink;
57 __compat_uid32_t st_uid; 57 __compat_uid_t st_uid;
58 __compat_gid32_t st_gid; 58 __compat_gid_t st_gid;
59 compat_dev_t st_rdev; 59 compat_dev_t st_rdev;
60 s32 st_pad2[2]; 60 s32 st_pad2[2];
61 compat_off_t st_size; 61 compat_off_t st_size;
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h
index 9a2de642eee6..03627cfb3e45 100644
--- a/include/asm-mips/cpu-features.h
+++ b/include/asm-mips/cpu-features.h
@@ -4,6 +4,7 @@
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003, 2004 Ralf Baechle 6 * Copyright (C) 2003, 2004 Ralf Baechle
7 * Copyright (C) 2004 Maciej W. Rozycki
7 */ 8 */
8#ifndef __ASM_CPU_FEATURES_H 9#ifndef __ASM_CPU_FEATURES_H
9#define __ASM_CPU_FEATURES_H 10#define __ASM_CPU_FEATURES_H
@@ -24,8 +25,19 @@
24#ifndef cpu_has_4kex 25#ifndef cpu_has_4kex
25#define cpu_has_4kex (cpu_data[0].options & MIPS_CPU_4KEX) 26#define cpu_has_4kex (cpu_data[0].options & MIPS_CPU_4KEX)
26#endif 27#endif
27#ifndef cpu_has_4ktlb 28#ifndef cpu_has_3k_cache
28#define cpu_has_4ktlb (cpu_data[0].options & MIPS_CPU_4KTLB) 29#define cpu_has_3k_cache (cpu_data[0].options & MIPS_CPU_3K_CACHE)
30#endif
31#define cpu_has_6k_cache 0
32#define cpu_has_8k_cache 0
33#ifndef cpu_has_4k_cache
34#define cpu_has_4k_cache (cpu_data[0].options & MIPS_CPU_4K_CACHE)
35#endif
36#ifndef cpu_has_tx39_cache
37#define cpu_has_tx39_cache (cpu_data[0].options & MIPS_CPU_TX39_CACHE)
38#endif
39#ifndef cpu_has_sb1_cache
40#define cpu_has_sb1_cache (cpu_data[0].options & MIPS_CPU_SB1_CACHE)
29#endif 41#endif
30#ifndef cpu_has_fpu 42#ifndef cpu_has_fpu
31#define cpu_has_fpu (cpu_data[0].options & MIPS_CPU_FPU) 43#define cpu_has_fpu (cpu_data[0].options & MIPS_CPU_FPU)
@@ -39,9 +51,6 @@
39#ifndef cpu_has_watch 51#ifndef cpu_has_watch
40#define cpu_has_watch (cpu_data[0].options & MIPS_CPU_WATCH) 52#define cpu_has_watch (cpu_data[0].options & MIPS_CPU_WATCH)
41#endif 53#endif
42#ifndef cpu_has_mips16
43#define cpu_has_mips16 (cpu_data[0].options & MIPS_CPU_MIPS16)
44#endif
45#ifndef cpu_has_divec 54#ifndef cpu_has_divec
46#define cpu_has_divec (cpu_data[0].options & MIPS_CPU_DIVEC) 55#define cpu_has_divec (cpu_data[0].options & MIPS_CPU_DIVEC)
47#endif 56#endif
@@ -66,6 +75,18 @@
66#ifndef cpu_has_llsc 75#ifndef cpu_has_llsc
67#define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC) 76#define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC)
68#endif 77#endif
78#ifndef cpu_has_mips16
79#define cpu_has_mips16 (cpu_data[0].ases & MIPS_ASE_MIPS16)
80#endif
81#ifndef cpu_has_mdmx
82#define cpu_has_mdmx (cpu_data[0].ases & MIPS_ASE_MDMX)
83#endif
84#ifndef cpu_has_mips3d
85#define cpu_has_mips3d (cpu_data[0].ases & MIPS_ASE_MIPS3D)
86#endif
87#ifndef cpu_has_smartmips
88#define cpu_has_smartmips (cpu_data[0].ases & MIPS_ASE_SMARTMIPS)
89#endif
69#ifndef cpu_has_vtag_icache 90#ifndef cpu_has_vtag_icache
70#define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) 91#define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG)
71#endif 92#endif
@@ -95,15 +116,16 @@
95#endif 116#endif
96#endif 117#endif
97 118
98/* 119#ifndef cpu_has_dsp
99 * Certain CPUs may throw bizarre exceptions if not the whole cacheline 120#define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP)
100 * contains valid instructions. For these we ensure proper alignment of 121#endif
101 * signal trampolines and pad them to the size of a full cache lines with 122
102 * nops. This is also used in structure definitions so can't be a test macro 123#ifdef CONFIG_MIPS_MT
103 * like the others. 124#ifndef cpu_has_mipsmt
104 */ 125# define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT)
105#ifndef PLAT_TRAMPOLINE_STUFF_LINE 126#endif
106#define PLAT_TRAMPOLINE_STUFF_LINE 0UL 127#else
128# define cpu_has_mipsmt 0
107#endif 129#endif
108 130
109#ifdef CONFIG_32BIT 131#ifdef CONFIG_32BIT
@@ -142,6 +164,22 @@
142# endif 164# endif
143#endif 165#endif
144 166
167#ifdef CONFIG_CPU_MIPSR2
168# if defined(CONFIG_CPU_MIPSR2_IRQ_VI) && !defined(cpu_has_vint)
169# define cpu_has_vint (cpu_data[0].options & MIPS_CPU_VINT)
170# else
171# define cpu_has_vint 0
172# endif
173# if defined(CONFIG_CPU_MIPSR2_IRQ_EI) && !defined(cpu_has_veic)
174# define cpu_has_veic (cpu_data[0].options & MIPS_CPU_VEIC)
175# else
176# define cpu_has_veic 0
177# endif
178#else
179# define cpu_has_vint 0
180# define cpu_has_veic 0
181#endif
182
145#ifndef cpu_has_subset_pcaches 183#ifndef cpu_has_subset_pcaches
146#define cpu_has_subset_pcaches (cpu_data[0].options & MIPS_CPU_SUBSET_CACHES) 184#define cpu_has_subset_pcaches (cpu_data[0].options & MIPS_CPU_SUBSET_CACHES)
147#endif 185#endif
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h
index 20a35b15a31d..d5cf519f8fcc 100644
--- a/include/asm-mips/cpu-info.h
+++ b/include/asm-mips/cpu-info.h
@@ -7,6 +7,7 @@
7 * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle 7 * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle
8 * Copyright (C) 1996 Paul M. Antoine 8 * Copyright (C) 1996 Paul M. Antoine
9 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 9 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
10 * Copyright (C) 2004 Maciej W. Rozycki
10 */ 11 */
11#ifndef __ASM_CPU_INFO_H 12#ifndef __ASM_CPU_INFO_H
12#define __ASM_CPU_INFO_H 13#define __ASM_CPU_INFO_H
@@ -61,6 +62,7 @@ struct cpuinfo_mips {
61 * Capability and feature descriptor structure for MIPS CPU 62 * Capability and feature descriptor structure for MIPS CPU
62 */ 63 */
63 unsigned long options; 64 unsigned long options;
65 unsigned long ases;
64 unsigned int processor_id; 66 unsigned int processor_id;
65 unsigned int fpu_id; 67 unsigned int fpu_id;
66 unsigned int cputype; 68 unsigned int cputype;
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h
index dec060b49556..48eac296060f 100644
--- a/include/asm-mips/cpu.h
+++ b/include/asm-mips/cpu.h
@@ -3,6 +3,7 @@
3 * various MIPS cpu types. 3 * various MIPS cpu types.
4 * 4 *
5 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) 5 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
6 * Copyright (C) 2004 Maciej W. Rozycki
6 */ 7 */
7#ifndef _ASM_CPU_H 8#ifndef _ASM_CPU_H
8#define _ASM_CPU_H 9#define _ASM_CPU_H
@@ -22,12 +23,17 @@
22 spec. 23 spec.
23*/ 24*/
24 25
25#define PRID_COMP_LEGACY 0x000000 26#define PRID_COMP_LEGACY 0x000000
26#define PRID_COMP_MIPS 0x010000 27#define PRID_COMP_MIPS 0x010000
27#define PRID_COMP_BROADCOM 0x020000 28#define PRID_COMP_BROADCOM 0x020000
28#define PRID_COMP_ALCHEMY 0x030000 29#define PRID_COMP_ALCHEMY 0x030000
29#define PRID_COMP_SIBYTE 0x040000 30#define PRID_COMP_SIBYTE 0x040000
30#define PRID_COMP_SANDCRAFT 0x050000 31#define PRID_COMP_SANDCRAFT 0x050000
32#define PRID_COMP_PHILIPS 0x060000
33#define PRID_COMP_TOSHIBA 0x070000
34#define PRID_COMP_LSI 0x080000
35#define PRID_COMP_LEXRA 0x0b0000
36
31 37
32/* 38/*
33 * Assigned values for the product ID register. In order to detect a 39 * Assigned values for the product ID register. In order to detect a
@@ -46,6 +52,7 @@
46#define PRID_IMP_VR41XX 0x0c00 52#define PRID_IMP_VR41XX 0x0c00
47#define PRID_IMP_R12000 0x0e00 53#define PRID_IMP_R12000 0x0e00
48#define PRID_IMP_R8000 0x1000 54#define PRID_IMP_R8000 0x1000
55#define PRID_IMP_PR4450 0x1200
49#define PRID_IMP_R4600 0x2000 56#define PRID_IMP_R4600 0x2000
50#define PRID_IMP_R4700 0x2100 57#define PRID_IMP_R4700 0x2100
51#define PRID_IMP_TX39 0x2200 58#define PRID_IMP_TX39 0x2200
@@ -60,6 +67,13 @@
60#define PRID_IMP_RM9000 0x3400 67#define PRID_IMP_RM9000 0x3400
61#define PRID_IMP_R5432 0x5400 68#define PRID_IMP_R5432 0x5400
62#define PRID_IMP_R5500 0x5500 69#define PRID_IMP_R5500 0x5500
70
71#define PRID_IMP_UNKNOWN 0xff00
72
73/*
74 * These are the PRID's for when 23:16 == PRID_COMP_MIPS
75 */
76
63#define PRID_IMP_4KC 0x8000 77#define PRID_IMP_4KC 0x8000
64#define PRID_IMP_5KC 0x8100 78#define PRID_IMP_5KC 0x8100
65#define PRID_IMP_20KC 0x8200 79#define PRID_IMP_20KC 0x8200
@@ -71,14 +85,15 @@
71#define PRID_IMP_4KEMPR2 0x9100 85#define PRID_IMP_4KEMPR2 0x9100
72#define PRID_IMP_4KSD 0x9200 86#define PRID_IMP_4KSD 0x9200
73#define PRID_IMP_24K 0x9300 87#define PRID_IMP_24K 0x9300
74 88#define PRID_IMP_34K 0x9500
75#define PRID_IMP_UNKNOWN 0xff00 89#define PRID_IMP_24KE 0x9600
76 90
77/* 91/*
78 * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE 92 * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE
79 */ 93 */
80 94
81#define PRID_IMP_SB1 0x0100 95#define PRID_IMP_SB1 0x0100
96#define PRID_IMP_SB1A 0x1100
82 97
83/* 98/*
84 * These are the PRID's for when 23:16 == PRID_COMP_SANDCRAFT 99 * These are the PRID's for when 23:16 == PRID_COMP_SANDCRAFT
@@ -177,7 +192,11 @@
177#define CPU_VR4133 56 192#define CPU_VR4133 56
178#define CPU_AU1550 57 193#define CPU_AU1550 57
179#define CPU_24K 58 194#define CPU_24K 58
180#define CPU_LAST 58 195#define CPU_AU1200 59
196#define CPU_34K 60
197#define CPU_PR4450 61
198#define CPU_SB1A 62
199#define CPU_LAST 62
181 200
182/* 201/*
183 * ISA Level encodings 202 * ISA Level encodings
@@ -200,23 +219,37 @@
200 * CPU Option encodings 219 * CPU Option encodings
201 */ 220 */
202#define MIPS_CPU_TLB 0x00000001 /* CPU has TLB */ 221#define MIPS_CPU_TLB 0x00000001 /* CPU has TLB */
203/* Leave a spare bit for variant MMU types... */ 222#define MIPS_CPU_4KEX 0x00000002 /* "R4K" exception model */
204#define MIPS_CPU_4KEX 0x00000004 /* "R4K" exception model */ 223#define MIPS_CPU_3K_CACHE 0x00000004 /* R3000-style caches */
205#define MIPS_CPU_4KTLB 0x00000008 /* "R4K" TLB handler */ 224#define MIPS_CPU_4K_CACHE 0x00000008 /* R4000-style caches */
206#define MIPS_CPU_FPU 0x00000010 /* CPU has FPU */ 225#define MIPS_CPU_TX39_CACHE 0x00000010 /* TX3900-style caches */
207#define MIPS_CPU_32FPR 0x00000020 /* 32 dbl. prec. FP registers */ 226#define MIPS_CPU_SB1_CACHE 0x00000020 /* SB1-style caches */
208#define MIPS_CPU_COUNTER 0x00000040 /* Cycle count/compare */ 227#define MIPS_CPU_FPU 0x00000040 /* CPU has FPU */
209#define MIPS_CPU_WATCH 0x00000080 /* watchpoint registers */ 228#define MIPS_CPU_32FPR 0x00000080 /* 32 dbl. prec. FP registers */
210#define MIPS_CPU_MIPS16 0x00000100 /* code compression */ 229#define MIPS_CPU_COUNTER 0x00000100 /* Cycle count/compare */
211#define MIPS_CPU_DIVEC 0x00000200 /* dedicated interrupt vector */ 230#define MIPS_CPU_WATCH 0x00000200 /* watchpoint registers */
212#define MIPS_CPU_VCE 0x00000400 /* virt. coherence conflict possible */ 231#define MIPS_CPU_DIVEC 0x00000400 /* dedicated interrupt vector */
213#define MIPS_CPU_CACHE_CDEX_P 0x00000800 /* Create_Dirty_Exclusive CACHE op */ 232#define MIPS_CPU_VCE 0x00000800 /* virt. coherence conflict possible */
214#define MIPS_CPU_CACHE_CDEX_S 0x00001000 /* ... same for seconary cache ... */ 233#define MIPS_CPU_CACHE_CDEX_P 0x00001000 /* Create_Dirty_Exclusive CACHE op */
215#define MIPS_CPU_MCHECK 0x00002000 /* Machine check exception */ 234#define MIPS_CPU_CACHE_CDEX_S 0x00002000 /* ... same for seconary cache ... */
216#define MIPS_CPU_EJTAG 0x00004000 /* EJTAG exception */ 235#define MIPS_CPU_MCHECK 0x00004000 /* Machine check exception */
217#define MIPS_CPU_NOFPUEX 0x00008000 /* no FPU exception */ 236#define MIPS_CPU_EJTAG 0x00008000 /* EJTAG exception */
218#define MIPS_CPU_LLSC 0x00010000 /* CPU has ll/sc instructions */ 237#define MIPS_CPU_NOFPUEX 0x00010000 /* no FPU exception */
219#define MIPS_CPU_SUBSET_CACHES 0x00020000 /* P-cache subset enforced */ 238#define MIPS_CPU_LLSC 0x00020000 /* CPU has ll/sc instructions */
220#define MIPS_CPU_PREFETCH 0x00040000 /* CPU has usable prefetch */ 239#define MIPS_CPU_SUBSET_CACHES 0x00040000 /* P-cache subset enforced */
240#define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */
241#define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */
242#define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */
243
244/*
245 * CPU ASE encodings
246 */
247#define MIPS_ASE_MIPS16 0x00000001 /* code compression */
248#define MIPS_ASE_MDMX 0x00000002 /* MIPS digital media extension */
249#define MIPS_ASE_MIPS3D 0x00000004 /* MIPS-3D */
250#define MIPS_ASE_SMARTMIPS 0x00000008 /* SmartMIPS */
251#define MIPS_ASE_DSP 0x00000010 /* Signal Processing ASE */
252#define MIPS_ASE_MIPSMT 0x00000020 /* CPU supports MIPS MT */
253
221 254
222#endif /* _ASM_CPU_H */ 255#endif /* _ASM_CPU_H */
diff --git a/include/asm-mips/dec/ecc.h b/include/asm-mips/dec/ecc.h
index 724908b0bf13..19495a490e72 100644
--- a/include/asm-mips/dec/ecc.h
+++ b/include/asm-mips/dec/ecc.h
@@ -49,7 +49,8 @@ struct pt_regs;
49 49
50extern void dec_ecc_be_init(void); 50extern void dec_ecc_be_init(void);
51extern int dec_ecc_be_handler(struct pt_regs *regs, int is_fixup); 51extern int dec_ecc_be_handler(struct pt_regs *regs, int is_fixup);
52extern irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id, struct pt_regs *regs); 52extern irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id,
53 struct pt_regs *regs);
53#endif 54#endif
54 55
55#endif /* __ASM_MIPS_DEC_ECC_H */ 56#endif /* __ASM_MIPS_DEC_ECC_H */
diff --git a/include/asm-mips/dec/ioasic_addrs.h b/include/asm-mips/dec/ioasic_addrs.h
index 5e18a7510592..4cbc1f8a1129 100644
--- a/include/asm-mips/dec/ioasic_addrs.h
+++ b/include/asm-mips/dec/ioasic_addrs.h
@@ -45,7 +45,8 @@
45 45
46 46
47/* 47/*
48 * Offsets for I/O ASIC registers (relative to (system_base + IOASIC_IOCTL)). 48 * Offsets for I/O ASIC registers
49 * (relative to (dec_kn_slot_base + IOASIC_IOCTL)).
49 */ 50 */
50 /* all systems */ 51 /* all systems */
51#define IO_REG_SCSI_DMA_P 0x00 /* SCSI DMA Pointer */ 52#define IO_REG_SCSI_DMA_P 0x00 /* SCSI DMA Pointer */
diff --git a/include/asm-mips/dec/kn01.h b/include/asm-mips/dec/kn01.h
index 946943502f83..eb522aa1e226 100644
--- a/include/asm-mips/dec/kn01.h
+++ b/include/asm-mips/dec/kn01.h
@@ -8,14 +8,12 @@
8 * 8 *
9 * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions 9 * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions
10 * are by courtesy of Chris Fraser. 10 * are by courtesy of Chris Fraser.
11 * Copyright (C) 2002, 2003 Maciej W. Rozycki 11 * Copyright (C) 2002, 2003, 2005 Maciej W. Rozycki
12 */ 12 */
13#ifndef __ASM_MIPS_DEC_KN01_H 13#ifndef __ASM_MIPS_DEC_KN01_H
14#define __ASM_MIPS_DEC_KN01_H 14#define __ASM_MIPS_DEC_KN01_H
15 15
16#include <asm/addrspace.h> 16#define KN01_SLOT_BASE 0x10000000
17
18#define KN01_SLOT_BASE KSEG1ADDR(0x10000000)
19#define KN01_SLOT_SIZE 0x01000000 17#define KN01_SLOT_SIZE 0x01000000
20 18
21/* 19/*
@@ -41,17 +39,9 @@
41 39
42 40
43/* 41/*
44 * Some port addresses...
45 */
46#define KN01_LANCE_BASE (KN01_SLOT_BASE + KN01_LANCE) /* 0xB8000000 */
47#define KN01_DZ11_BASE (KN01_SLOT_BASE + KN01_DZ11) /* 0xBC000000 */
48#define KN01_RTC_BASE (KN01_SLOT_BASE + KN01_RTC) /* 0xBD000000 */
49
50
51/*
52 * Frame buffer memory address. 42 * Frame buffer memory address.
53 */ 43 */
54#define KN01_VFB_MEM KSEG1ADDR(0x0fc00000) 44#define KN01_VFB_MEM 0x0fc00000
55 45
56/* 46/*
57 * CPU interrupt bits. 47 * CPU interrupt bits.
@@ -80,4 +70,22 @@
80#define KN01_CSR_VRGTRB (1<<0) /* red DAC voltage over blue (r/o) */ 70#define KN01_CSR_VRGTRB (1<<0) /* red DAC voltage over blue (r/o) */
81#define KN01_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */ 71#define KN01_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */
82 72
73
74#ifndef __ASSEMBLY__
75
76#include <linux/interrupt.h>
77#include <linux/spinlock.h>
78#include <linux/types.h>
79
80struct pt_regs;
81
82extern u16 cached_kn01_csr;
83extern spinlock_t kn01_lock;
84
85extern void dec_kn01_be_init(void);
86extern int dec_kn01_be_handler(struct pt_regs *regs, int is_fixup);
87extern irqreturn_t dec_kn01_be_interrupt(int irq, void *dev_id,
88 struct pt_regs *regs);
89#endif
90
83#endif /* __ASM_MIPS_DEC_KN01_H */ 91#endif /* __ASM_MIPS_DEC_KN01_H */
diff --git a/include/asm-mips/dec/kn02.h b/include/asm-mips/dec/kn02.h
index f797f7045920..8319ad77b250 100644
--- a/include/asm-mips/dec/kn02.h
+++ b/include/asm-mips/dec/kn02.h
@@ -8,21 +8,12 @@
8 * 8 *
9 * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions 9 * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions
10 * are by courtesy of Chris Fraser. 10 * are by courtesy of Chris Fraser.
11 * Copyright (C) 2002, 2003 Maciej W. Rozycki 11 * Copyright (C) 2002, 2003, 2005 Maciej W. Rozycki
12 */ 12 */
13#ifndef __ASM_MIPS_DEC_KN02_H 13#ifndef __ASM_MIPS_DEC_KN02_H
14#define __ASM_MIPS_DEC_KN02_H 14#define __ASM_MIPS_DEC_KN02_H
15 15
16#ifndef __ASSEMBLY__ 16#define KN02_SLOT_BASE 0x1fc00000
17#include <linux/spinlock.h>
18#include <linux/types.h>
19#endif
20
21#include <asm/addrspace.h>
22#include <asm/dec/ecc.h>
23
24
25#define KN02_SLOT_BASE KSEG1ADDR(0x1fc00000)
26#define KN02_SLOT_SIZE 0x00080000 17#define KN02_SLOT_SIZE 0x00080000
27 18
28/* 19/*
@@ -39,22 +30,14 @@
39 30
40 31
41/* 32/*
42 * Some port addresses...
43 */
44#define KN02_DZ11_BASE (KN02_SLOT_BASE + KN02_DZ11) /* DZ11 */
45#define KN02_RTC_BASE (KN02_SLOT_BASE + KN02_RTC) /* RTC */
46#define KN02_CSR_BASE (KN02_SLOT_BASE + KN02_CSR) /* CSR */
47
48
49/*
50 * System Control & Status Register bits. 33 * System Control & Status Register bits.
51 */ 34 */
52#define KN02_CSR_RES_28 (0xf<<28) /* unused */ 35#define KN02_CSR_RES_28 (0xf<<28) /* unused */
53#define KN02_CSR_PSU (1<<27) /* power supply unit warning */ 36#define KN02_CSR_PSU (1<<27) /* power supply unit warning */
54#define KN02_CSR_NVRAM (1<<26) /* ~NVRAM clear jumper */ 37#define KN02_CSR_NVRAM (1<<26) /* ~NVRAM clear jumper */
55#define KN02_CSR_REFEVEN (1<<25) /* mem refresh bank toggle */ 38#define KN02_CSR_REFEVEN (1<<25) /* mem refresh bank toggle */
56#define KN03_CSR_NRMOD (1<<24) /* ~NRMOD manufact. jumper */ 39#define KN02_CSR_NRMOD (1<<24) /* ~NRMOD manufact. jumper */
57#define KN03_CSR_IOINTEN (0xff<<16) /* IRQ mask bits */ 40#define KN02_CSR_IOINTEN (0xff<<16) /* IRQ mask bits */
58#define KN02_CSR_DIAGCHK (1<<15) /* diagn/norml ECC reads */ 41#define KN02_CSR_DIAGCHK (1<<15) /* diagn/norml ECC reads */
59#define KN02_CSR_DIAGGEN (1<<14) /* diagn/norml ECC writes */ 42#define KN02_CSR_DIAGGEN (1<<14) /* diagn/norml ECC writes */
60#define KN02_CSR_CORRECT (1<<13) /* ECC correct/check */ 43#define KN02_CSR_CORRECT (1<<13) /* ECC correct/check */
@@ -63,8 +46,8 @@
63#define KN02_CSR_BNK32M (1<<10) /* 32M/8M stride */ 46#define KN02_CSR_BNK32M (1<<10) /* 32M/8M stride */
64#define KN02_CSR_DIAGDN (1<<9) /* DIAGDN manufact. jumper */ 47#define KN02_CSR_DIAGDN (1<<9) /* DIAGDN manufact. jumper */
65#define KN02_CSR_BAUD38 (1<<8) /* DZ11 38/19kbps ext. rate */ 48#define KN02_CSR_BAUD38 (1<<8) /* DZ11 38/19kbps ext. rate */
66#define KN03_CSR_IOINT (0xff<<0) /* IRQ status bits (r/o) */ 49#define KN02_CSR_IOINT (0xff<<0) /* IRQ status bits (r/o) */
67#define KN03_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */ 50#define KN02_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */
68 51
69 52
70/* 53/*
@@ -98,6 +81,10 @@
98 81
99 82
100#ifndef __ASSEMBLY__ 83#ifndef __ASSEMBLY__
84
85#include <linux/spinlock.h>
86#include <linux/types.h>
87
101extern u32 cached_kn02_csr; 88extern u32 cached_kn02_csr;
102extern spinlock_t kn02_lock; 89extern spinlock_t kn02_lock;
103extern void init_kn02_irqs(int base); 90extern void init_kn02_irqs(int base);
diff --git a/include/asm-mips/dec/kn02xa.h b/include/asm-mips/dec/kn02xa.h
index 648c4dcbba1d..a25f3d7da7f7 100644
--- a/include/asm-mips/dec/kn02xa.h
+++ b/include/asm-mips/dec/kn02xa.h
@@ -9,7 +9,7 @@
9 * 9 *
10 * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions 10 * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions
11 * are by courtesy of Chris Fraser. 11 * are by courtesy of Chris Fraser.
12 * Copyright (C) 2000, 2002, 2003 Maciej W. Rozycki 12 * Copyright (C) 2000, 2002, 2003, 2005 Maciej W. Rozycki
13 * 13 *
14 * These are addresses which have to be known early in the boot process. 14 * These are addresses which have to be known early in the boot process.
15 * For other addresses refer to tc.h, ioasic_addrs.h and friends. 15 * For other addresses refer to tc.h, ioasic_addrs.h and friends.
@@ -17,31 +17,23 @@
17#ifndef __ASM_MIPS_DEC_KN02XA_H 17#ifndef __ASM_MIPS_DEC_KN02XA_H
18#define __ASM_MIPS_DEC_KN02XA_H 18#define __ASM_MIPS_DEC_KN02XA_H
19 19
20#include <asm/addrspace.h>
21#include <asm/dec/ioasic_addrs.h> 20#include <asm/dec/ioasic_addrs.h>
22 21
23#define KN02XA_SLOT_BASE KSEG1ADDR(0x1c000000) 22#define KN02XA_SLOT_BASE 0x1c000000
24
25/*
26 * Some port addresses...
27 */
28#define KN02XA_IOASIC_BASE (KN02XA_SLOT_BASE + IOASIC_IOCTL) /* I/O ASIC */
29#define KN02XA_RTC_BASE (KN02XA_SLOT_BASE + IOASIC_TOY) /* RTC */
30
31 23
32/* 24/*
33 * Memory control ASIC registers. 25 * Memory control ASIC registers.
34 */ 26 */
35#define KN02XA_MER KSEG1ADDR(0x0c400000) /* memory error register */ 27#define KN02XA_MER 0x0c400000 /* memory error register */
36#define KN02XA_MSR KSEG1ADDR(0x0c800000) /* memory size register */ 28#define KN02XA_MSR 0x0c800000 /* memory size register */
37 29
38/* 30/*
39 * CPU control ASIC registers. 31 * CPU control ASIC registers.
40 */ 32 */
41#define KN02XA_MEM_CONF KSEG1ADDR(0x0e000000) /* write timeout config */ 33#define KN02XA_MEM_CONF 0x0e000000 /* write timeout config */
42#define KN02XA_EAR KSEG1ADDR(0x0e000004) /* error address register */ 34#define KN02XA_EAR 0x0e000004 /* error address register */
43#define KN02XA_BOOT0 KSEG1ADDR(0x0e000008) /* boot 0 register */ 35#define KN02XA_BOOT0 0x0e000008 /* boot 0 register */
44#define KN02XA_MEM_INTR KSEG1ADDR(0x0e00000c) /* write err IRQ stat & ack */ 36#define KN02XA_MEM_INTR 0x0e00000c /* write err IRQ stat & ack */
45 37
46/* 38/*
47 * Memory Error Register bits, common definitions. 39 * Memory Error Register bits, common definitions.
@@ -52,8 +44,13 @@
52#define KN02XA_MER_PAGERR (1<<16) /* 2k page boundary error */ 44#define KN02XA_MER_PAGERR (1<<16) /* 2k page boundary error */
53#define KN02XA_MER_TRANSERR (1<<15) /* transfer length error */ 45#define KN02XA_MER_TRANSERR (1<<15) /* transfer length error */
54#define KN02XA_MER_PARDIS (1<<14) /* parity error disable */ 46#define KN02XA_MER_PARDIS (1<<14) /* parity error disable */
55#define KN02XA_MER_RES_12 (0x3<<12) /* unused */ 47#define KN02XA_MER_SIZE (1<<13) /* r/o mirror of MSR_SIZE */
56#define KN02XA_MER_BYTERR (0xf<<8) /* byte lane error bitmask */ 48#define KN02XA_MER_RES_12 (1<<12) /* unused */
49#define KN02XA_MER_BYTERR (0xf<<8) /* byte lane error bitmask: */
50#define KN02XA_MER_BYTERR_3 (0x8<<8) /* byte lane #3 */
51#define KN02XA_MER_BYTERR_2 (0x4<<8) /* byte lane #2 */
52#define KN02XA_MER_BYTERR_1 (0x2<<8) /* byte lane #1 */
53#define KN02XA_MER_BYTERR_0 (0x1<<8) /* byte lane #0 */
57#define KN02XA_MER_RES_0 (0xff<<0) /* unused */ 54#define KN02XA_MER_RES_0 (0xff<<0) /* unused */
58 55
59/* 56/*
@@ -72,4 +69,17 @@
72#define KN02XA_EAR_ADDRESS (0x7ffffff<<2) /* address involved */ 69#define KN02XA_EAR_ADDRESS (0x7ffffff<<2) /* address involved */
73#define KN02XA_EAR_RES_0 (0x3<<0) /* unused */ 70#define KN02XA_EAR_RES_0 (0x3<<0) /* unused */
74 71
72
73#ifndef __ASSEMBLY__
74
75#include <linux/interrupt.h>
76
77struct pt_regs;
78
79extern void dec_kn02xa_be_init(void);
80extern int dec_kn02xa_be_handler(struct pt_regs *regs, int is_fixup);
81extern irqreturn_t dec_kn02xa_be_interrupt(int irq, void *dev_id,
82 struct pt_regs *regs);
83#endif
84
75#endif /* __ASM_MIPS_DEC_KN02XA_H */ 85#endif /* __ASM_MIPS_DEC_KN02XA_H */
diff --git a/include/asm-mips/dec/kn03.h b/include/asm-mips/dec/kn03.h
index 676abd17c6a4..edede923ffb8 100644
--- a/include/asm-mips/dec/kn03.h
+++ b/include/asm-mips/dec/kn03.h
@@ -10,24 +10,15 @@
10 * 10 *
11 * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions 11 * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions
12 * are by courtesy of Chris Fraser. 12 * are by courtesy of Chris Fraser.
13 * Copyright (C) 2000, 2002, 2003 Maciej W. Rozycki 13 * Copyright (C) 2000, 2002, 2003, 2005 Maciej W. Rozycki
14 */ 14 */
15#ifndef __ASM_MIPS_DEC_KN03_H 15#ifndef __ASM_MIPS_DEC_KN03_H
16#define __ASM_MIPS_DEC_KN03_H 16#define __ASM_MIPS_DEC_KN03_H
17 17
18#include <asm/addrspace.h>
19#include <asm/dec/ecc.h> 18#include <asm/dec/ecc.h>
20#include <asm/dec/ioasic_addrs.h> 19#include <asm/dec/ioasic_addrs.h>
21 20
22#define KN03_SLOT_BASE KSEG1ADDR(0x1f800000) 21#define KN03_SLOT_BASE 0x1f800000
23
24/*
25 * Some port addresses...
26 */
27#define KN03_IOASIC_BASE (KN03_SLOT_BASE + IOASIC_IOCTL) /* I/O ASIC */
28#define KN03_RTC_BASE (KN03_SLOT_BASE + IOASIC_TOY) /* RTC */
29#define KN03_MCR_BASE (KN03_SLOT_BASE + IOASIC_MCR) /* MCR */
30
31 22
32/* 23/*
33 * CPU interrupt bits. 24 * CPU interrupt bits.
diff --git a/include/asm-mips/dec/kn05.h b/include/asm-mips/dec/kn05.h
index b120362b8f13..15fe8f881e60 100644
--- a/include/asm-mips/dec/kn05.h
+++ b/include/asm-mips/dec/kn05.h
@@ -1,10 +1,12 @@
1/* 1/*
2 * include/asm-mips/dec/kn05.h 2 * include/asm-mips/dec/kn05.h
3 * 3 *
4 * DECstation 5000/260 (4max+ or KN05) and DECsystem 5900/260 4 * DECstation/DECsystem 5000/260 (4max+ or KN05), 5000/150 (4min
5 * or KN04-BA), Personal DECstation/DECsystem 5000/50 (4maxine or
6 * KN04-CA) and DECsystem 5900/260 (KN05) R4k CPU card MB ASIC
5 * definitions. 7 * definitions.
6 * 8 *
7 * Copyright (C) 2002, 2003 Maciej W. Rozycki 9 * Copyright (C) 2002, 2003, 2005 Maciej W. Rozycki
8 * 10 *
9 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
@@ -13,8 +15,8 @@
13 * 15 *
14 * WARNING! All this information is pure guesswork based on the 16 * WARNING! All this information is pure guesswork based on the
15 * ROM. It is provided here in hope it will give someone some 17 * ROM. It is provided here in hope it will give someone some
16 * food for thought. No documentation for the KN05 module has 18 * food for thought. No documentation for the KN05 nor the KN04
17 * been located so far. 19 * module has been located so far.
18 */ 20 */
19#ifndef __ASM_MIPS_DEC_KN05_H 21#ifndef __ASM_MIPS_DEC_KN05_H
20#define __ASM_MIPS_DEC_KN05_H 22#define __ASM_MIPS_DEC_KN05_H
@@ -24,48 +26,50 @@
24/* 26/*
25 * The oncard MB (Memory Buffer) ASIC provides an additional address 27 * The oncard MB (Memory Buffer) ASIC provides an additional address
26 * decoder. Certain address ranges within the "high" 16 slots are 28 * decoder. Certain address ranges within the "high" 16 slots are
27 * passed to the I/O ASIC's decoder like with the KN03. Others are 29 * passed to the I/O ASIC's decoder like with the KN03 or KN02-BA/CA.
28 * handled locally. "Low" slots are always passed. 30 * Others are handled locally. "Low" slots are always passed.
29 */ 31 */
30#define KN05_MB_ROM (16*IOASIC_SLOT_SIZE) /* KN05 card ROM */ 32#define KN4K_SLOT_BASE 0x1fc00000
31#define KN05_IOCTL (17*IOASIC_SLOT_SIZE) /* I/O ASIC */ 33
32#define KN05_ESAR (18*IOASIC_SLOT_SIZE) /* LANCE MAC address chip */ 34#define KN4K_MB_ROM (0*IOASIC_SLOT_SIZE) /* KN05/KN04 card ROM */
33#define KN05_LANCE (19*IOASIC_SLOT_SIZE) /* LANCE Ethernet */ 35#define KN4K_IOCTL (1*IOASIC_SLOT_SIZE) /* I/O ASIC */
34#define KN05_MB_INT (20*IOASIC_SLOT_SIZE) /* MB interrupt register */ 36#define KN4K_ESAR (2*IOASIC_SLOT_SIZE) /* LANCE MAC address chip */
35#define KN05_MB_EA (21*IOASIC_SLOT_SIZE) /* MB error address? */ 37#define KN4K_LANCE (3*IOASIC_SLOT_SIZE) /* LANCE Ethernet */
36#define KN05_MB_EC (22*IOASIC_SLOT_SIZE) /* MB error ??? */ 38#define KN4K_MB_INT (4*IOASIC_SLOT_SIZE) /* MB interrupt register */
37#define KN05_MB_CSR (23*IOASIC_SLOT_SIZE) /* MB control & status */ 39#define KN4K_MB_EA (5*IOASIC_SLOT_SIZE) /* MB error address? */
38#define KN05_RES_24 (24*IOASIC_SLOT_SIZE) /* unused? */ 40#define KN4K_MB_EC (6*IOASIC_SLOT_SIZE) /* MB error ??? */
39#define KN05_RES_25 (25*IOASIC_SLOT_SIZE) /* unused? */ 41#define KN4K_MB_CSR (7*IOASIC_SLOT_SIZE) /* MB control & status */
40#define KN05_RES_26 (26*IOASIC_SLOT_SIZE) /* unused? */ 42#define KN4K_RES_08 (8*IOASIC_SLOT_SIZE) /* unused? */
41#define KN05_RES_27 (27*IOASIC_SLOT_SIZE) /* unused? */ 43#define KN4K_RES_09 (9*IOASIC_SLOT_SIZE) /* unused? */
42#define KN05_SCSI (28*IOASIC_SLOT_SIZE) /* ASC SCSI */ 44#define KN4K_RES_10 (10*IOASIC_SLOT_SIZE) /* unused? */
43#define KN05_RES_29 (29*IOASIC_SLOT_SIZE) /* unused? */ 45#define KN4K_RES_11 (11*IOASIC_SLOT_SIZE) /* unused? */
44#define KN05_RES_30 (30*IOASIC_SLOT_SIZE) /* unused? */ 46#define KN4K_SCSI (12*IOASIC_SLOT_SIZE) /* ASC SCSI */
45#define KN05_RES_31 (31*IOASIC_SLOT_SIZE) /* unused? */ 47#define KN4K_RES_13 (13*IOASIC_SLOT_SIZE) /* unused? */
48#define KN4K_RES_14 (14*IOASIC_SLOT_SIZE) /* unused? */
49#define KN4K_RES_15 (15*IOASIC_SLOT_SIZE) /* unused? */
46 50
47/* 51/*
48 * Bits for the MB interrupt register. 52 * Bits for the MB interrupt register.
49 * The register appears read-only. 53 * The register appears read-only.
50 */ 54 */
51#define KN05_MB_INT_TC (1<<0) /* TURBOchannel? */ 55#define KN4K_MB_INT_TC (1<<0) /* TURBOchannel? */
52#define KN05_MB_INT_RTC (1<<1) /* RTC? */ 56#define KN4K_MB_INT_RTC (1<<1) /* RTC? */
53#define KN05_MB_INT_MT (1<<3) /* ??? */ 57#define KN4K_MB_INT_MT (1<<3) /* ??? */
54 58
55/* 59/*
56 * Bits for the MB control & status register. 60 * Bits for the MB control & status register.
57 * Set to 0x00bf8001 on my system by the ROM. 61 * Set to 0x00bf8001 on my system by the ROM.
58 */ 62 */
59#define KN05_MB_CSR_PF (1<<0) /* PreFetching enable? */ 63#define KN4K_MB_CSR_PF (1<<0) /* PreFetching enable? */
60#define KN05_MB_CSR_F (1<<1) /* ??? */ 64#define KN4K_MB_CSR_F (1<<1) /* ??? */
61#define KN05_MB_CSR_ECC (0xff<<2) /* ??? */ 65#define KN4K_MB_CSR_ECC (0xff<<2) /* ??? */
62#define KN05_MB_CSR_OD (1<<10) /* ??? */ 66#define KN4K_MB_CSR_OD (1<<10) /* ??? */
63#define KN05_MB_CSR_CP (1<<11) /* ??? */ 67#define KN4K_MB_CSR_CP (1<<11) /* ??? */
64#define KN05_MB_CSR_UNC (1<<12) /* ??? */ 68#define KN4K_MB_CSR_UNC (1<<12) /* ??? */
65#define KN05_MB_CSR_IM (1<<13) /* ??? */ 69#define KN4K_MB_CSR_IM (1<<13) /* ??? */
66#define KN05_MB_CSR_NC (1<<14) /* ??? */ 70#define KN4K_MB_CSR_NC (1<<14) /* ??? */
67#define KN05_MB_CSR_EE (1<<15) /* (bus) Exception Enable? */ 71#define KN4K_MB_CSR_EE (1<<15) /* (bus) Exception Enable? */
68#define KN05_MB_CSR_MSK (0x1f<<16) /* ??? */ 72#define KN4K_MB_CSR_MSK (0x1f<<16) /* ??? */
69#define KN05_MB_CSR_FW (1<<21) /* ??? */ 73#define KN4K_MB_CSR_FW (1<<21) /* ??? */
70 74
71#endif /* __ASM_MIPS_DEC_KN05_H */ 75#endif /* __ASM_MIPS_DEC_KN05_H */
diff --git a/include/asm-mips/dec/prom.h b/include/asm-mips/dec/prom.h
index a05d6d3395fe..1384dd0964b9 100644
--- a/include/asm-mips/dec/prom.h
+++ b/include/asm-mips/dec/prom.h
@@ -24,7 +24,7 @@
24 * PMAX/3MAX PROM entry points for DS2100/3100's and DS5000/2xx's. 24 * PMAX/3MAX PROM entry points for DS2100/3100's and DS5000/2xx's.
25 * Many of these will work for MIPSen as well! 25 * Many of these will work for MIPSen as well!
26 */ 26 */
27#define VEC_RESET (u64 *)KSEG1ADDR(0x1fc00000) 27#define VEC_RESET (u64 *)CKSEG1ADDR(0x1fc00000)
28 /* Prom base address */ 28 /* Prom base address */
29 29
30#define PMAX_PROM_ENTRY(x) (VEC_RESET + (x)) /* Prom jump table */ 30#define PMAX_PROM_ENTRY(x) (VEC_RESET + (x)) /* Prom jump table */
@@ -111,19 +111,21 @@ extern int (*__pmax_close)(int);
111 * On MIPS64 we have to call PROM functions via a helper 111 * On MIPS64 we have to call PROM functions via a helper
112 * dispatcher to accomodate ABI incompatibilities. 112 * dispatcher to accomodate ABI incompatibilities.
113 */ 113 */
114#define __DEC_PROM_O32 __attribute__((alias("call_o32"))) 114#define __DEC_PROM_O32(fun, arg) fun arg __asm__(#fun); \
115 115 __asm__(#fun " = call_o32")
116int _rex_bootinit(int (*)(void)) __DEC_PROM_O32; 116
117int _rex_bootread(int (*)(void)) __DEC_PROM_O32; 117int __DEC_PROM_O32(_rex_bootinit, (int (*)(void)));
118int _rex_getbitmap(int (*)(memmap *), memmap *) __DEC_PROM_O32; 118int __DEC_PROM_O32(_rex_bootread, (int (*)(void)));
119unsigned long *_rex_slot_address(unsigned long *(*)(int), int) __DEC_PROM_O32; 119int __DEC_PROM_O32(_rex_getbitmap, (int (*)(memmap *), memmap *));
120void *_rex_gettcinfo(void *(*)(void)) __DEC_PROM_O32; 120unsigned long *__DEC_PROM_O32(_rex_slot_address,
121int _rex_getsysid(int (*)(void)) __DEC_PROM_O32; 121 (unsigned long *(*)(int), int));
122void _rex_clear_cache(void (*)(void)) __DEC_PROM_O32; 122void *__DEC_PROM_O32(_rex_gettcinfo, (void *(*)(void)));
123 123int __DEC_PROM_O32(_rex_getsysid, (int (*)(void)));
124int _prom_getchar(int (*)(void)) __DEC_PROM_O32; 124void __DEC_PROM_O32(_rex_clear_cache, (void (*)(void)));
125char *_prom_getenv(char *(*)(char *), char *) __DEC_PROM_O32; 125
126int _prom_printf(int (*)(char *, ...), char *, ...) __DEC_PROM_O32; 126int __DEC_PROM_O32(_prom_getchar, (int (*)(void)));
127char *__DEC_PROM_O32(_prom_getenv, (char *(*)(char *), char *));
128int __DEC_PROM_O32(_prom_printf, (int (*)(char *, ...), char *, ...));
127 129
128 130
129#define rex_bootinit() _rex_bootinit(__rex_bootinit) 131#define rex_bootinit() _rex_bootinit(__rex_bootinit)
diff --git a/include/asm-mips/dec/system.h b/include/asm-mips/dec/system.h
new file mode 100644
index 000000000000..78af51fbc797
--- /dev/null
+++ b/include/asm-mips/dec/system.h
@@ -0,0 +1,18 @@
1/*
2 * include/asm-mips/dec/system.h
3 *
4 * Generic DECstation/DECsystem bits.
5 *
6 * Copyright (C) 2005 Maciej W. Rozycki
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#ifndef __ASM_DEC_SYSTEM_H
14#define __ASM_DEC_SYSTEM_H
15
16extern unsigned long dec_kn_slot_base, dec_kn_slot_size;
17
18#endif /* __ASM_DEC_SYSTEM_H */
diff --git a/include/asm-mips/dec/tc.h b/include/asm-mips/dec/tc.h
index d7bba43f863a..9cb51f24d42c 100644
--- a/include/asm-mips/dec/tc.h
+++ b/include/asm-mips/dec/tc.h
@@ -7,10 +7,8 @@
7 * 7 *
8 * Copyright (c) 1998 Harald Koerfgen 8 * Copyright (c) 1998 Harald Koerfgen
9 */ 9 */
10#ifndef ASM_TC_H 10#ifndef __ASM_DEC_TC_H
11#define ASM_TC_H 11#define __ASM_DEC_TC_H
12
13extern unsigned long system_base;
14 12
15/* 13/*
16 * Search for a TURBOchannel Option Module 14 * Search for a TURBOchannel Option Module
@@ -36,8 +34,8 @@ extern unsigned long get_tc_base_addr(int);
36 */ 34 */
37extern unsigned long get_tc_irq_nr(int); 35extern unsigned long get_tc_irq_nr(int);
38/* 36/*
39 * Return TURBOchannel clock frequency in hz 37 * Return TURBOchannel clock frequency in Hz
40 */ 38 */
41extern unsigned long get_tc_speed(void); 39extern unsigned long get_tc_speed(void);
42 40
43#endif 41#endif /* __ASM_DEC_TC_H */
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h
index a606dbee0412..85435a8d4e52 100644
--- a/include/asm-mips/delay.h
+++ b/include/asm-mips/delay.h
@@ -12,11 +12,9 @@
12 12
13#include <linux/config.h> 13#include <linux/config.h>
14#include <linux/param.h> 14#include <linux/param.h>
15 15#include <linux/smp.h>
16#include <asm/compiler.h> 16#include <asm/compiler.h>
17 17
18extern unsigned long loops_per_jiffy;
19
20static inline void __delay(unsigned long loops) 18static inline void __delay(unsigned long loops)
21{ 19{
22 if (sizeof(long) == 4) 20 if (sizeof(long) == 4)
@@ -82,11 +80,7 @@ static inline void __udelay(unsigned long usecs, unsigned long lpj)
82 __delay(usecs); 80 __delay(usecs);
83} 81}
84 82
85#ifdef CONFIG_SMP
86#define __udelay_val cpu_data[smp_processor_id()].udelay_val 83#define __udelay_val cpu_data[smp_processor_id()].udelay_val
87#else
88#define __udelay_val loops_per_jiffy
89#endif
90 84
91#define udelay(usecs) __udelay((usecs),__udelay_val) 85#define udelay(usecs) __udelay((usecs),__udelay_val)
92 86
diff --git a/include/asm-mips/dma-mapping.h b/include/asm-mips/dma-mapping.h
index af28dc88930b..43288634c38a 100644
--- a/include/asm-mips/dma-mapping.h
+++ b/include/asm-mips/dma-mapping.h
@@ -5,13 +5,13 @@
5#include <asm/cache.h> 5#include <asm/cache.h>
6 6
7void *dma_alloc_noncoherent(struct device *dev, size_t size, 7void *dma_alloc_noncoherent(struct device *dev, size_t size,
8 dma_addr_t *dma_handle, int flag); 8 dma_addr_t *dma_handle, gfp_t flag);
9 9
10void dma_free_noncoherent(struct device *dev, size_t size, 10void dma_free_noncoherent(struct device *dev, size_t size,
11 void *vaddr, dma_addr_t dma_handle); 11 void *vaddr, dma_addr_t dma_handle);
12 12
13void *dma_alloc_coherent(struct device *dev, size_t size, 13void *dma_alloc_coherent(struct device *dev, size_t size,
14 dma_addr_t *dma_handle, int flag); 14 dma_addr_t *dma_handle, gfp_t flag);
15 15
16void dma_free_coherent(struct device *dev, size_t size, 16void dma_free_coherent(struct device *dev, size_t size,
17 void *vaddr, dma_addr_t dma_handle); 17 void *vaddr, dma_addr_t dma_handle);
diff --git a/include/asm-mips/dsp.h b/include/asm-mips/dsp.h
new file mode 100644
index 000000000000..50f556bb4978
--- /dev/null
+++ b/include/asm-mips/dsp.h
@@ -0,0 +1,83 @@
1/*
2 * Copyright (C) 2005 Mips Technologies
3 * Author: Chris Dearman, chris@mips.com derived from fpu.h
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10#ifndef _ASM_DSP_H
11#define _ASM_DSP_H
12
13#include <asm/cpu.h>
14#include <asm/cpu-features.h>
15#include <asm/hazards.h>
16#include <asm/mipsregs.h>
17
18#define DSP_DEFAULT 0x00000000
19#define DSP_MASK 0x1f
20
21#define __enable_dsp_hazard() \
22do { \
23 asm("_ehb"); \
24} while (0)
25
26static inline void __init_dsp(void)
27{
28 mthi1(0);
29 mtlo1(0);
30 mthi2(0);
31 mtlo2(0);
32 mthi3(0);
33 mtlo3(0);
34 wrdsp(DSP_DEFAULT, DSP_MASK);
35}
36
37static inline void init_dsp(void)
38{
39 if (cpu_has_dsp)
40 __init_dsp();
41}
42
43#define __save_dsp(tsk) \
44do { \
45 tsk->thread.dsp.dspr[0] = mfhi1(); \
46 tsk->thread.dsp.dspr[1] = mflo1(); \
47 tsk->thread.dsp.dspr[2] = mfhi2(); \
48 tsk->thread.dsp.dspr[3] = mflo2(); \
49 tsk->thread.dsp.dspr[4] = mfhi3(); \
50 tsk->thread.dsp.dspr[5] = mflo3(); \
51} while (0)
52
53#define save_dsp(tsk) \
54do { \
55 if (cpu_has_dsp) \
56 __save_dsp(tsk); \
57} while (0)
58
59#define __restore_dsp(tsk) \
60do { \
61 mthi1(tsk->thread.dsp.dspr[0]); \
62 mtlo1(tsk->thread.dsp.dspr[1]); \
63 mthi2(tsk->thread.dsp.dspr[2]); \
64 mtlo2(tsk->thread.dsp.dspr[3]); \
65 mthi3(tsk->thread.dsp.dspr[4]); \
66 mtlo3(tsk->thread.dsp.dspr[5]); \
67} while (0)
68
69#define restore_dsp(tsk) \
70do { \
71 if (cpu_has_dsp) \
72 __restore_dsp(tsk); \
73} while (0)
74
75#define __get_dsp_regs(tsk) \
76({ \
77 if (tsk == current) \
78 __save_dsp(current); \
79 \
80 tsk->thread.dsp.dspr; \
81})
82
83#endif /* _ASM_DSP_H */
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h
index e48811440015..7420f12742bb 100644
--- a/include/asm-mips/elf.h
+++ b/include/asm-mips/elf.h
@@ -2,6 +2,8 @@
2 * This file is subject to the terms and conditions of the GNU General Public 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 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 *
6 * Much of this is taken from binutils and GNU libc ...
5 */ 7 */
6#ifndef _ASM_ELF_H 8#ifndef _ASM_ELF_H
7#define _ASM_ELF_H 9#define _ASM_ELF_H
@@ -17,6 +19,8 @@
17#define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ 19#define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */
18#define EF_MIPS_ARCH_32 0x50000000 /* MIPS32 code. */ 20#define EF_MIPS_ARCH_32 0x50000000 /* MIPS32 code. */
19#define EF_MIPS_ARCH_64 0x60000000 /* MIPS64 code. */ 21#define EF_MIPS_ARCH_64 0x60000000 /* MIPS64 code. */
22#define EF_MIPS_ARCH_32R2 0x70000000 /* MIPS32 R2 code. */
23#define EF_MIPS_ARCH_64R2 0x80000000 /* MIPS64 R2 code. */
20 24
21/* The ABI of a file. */ 25/* The ABI of a file. */
22#define EF_MIPS_ABI_O32 0x00001000 /* O32 ABI. */ 26#define EF_MIPS_ABI_O32 0x00001000 /* O32 ABI. */
@@ -105,7 +109,11 @@
105#define R_MIPS_LOVENDOR 100 109#define R_MIPS_LOVENDOR 100
106#define R_MIPS_HIVENDOR 127 110#define R_MIPS_HIVENDOR 127
107 111
108#define SHN_MIPS_ACCOMON 0xff00 112#define SHN_MIPS_ACCOMON 0xff00 /* Allocated common symbols */
113#define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */
114#define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */
115#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */
116#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */
109 117
110#define SHT_MIPS_LIST 0x70000000 118#define SHT_MIPS_LIST 0x70000000
111#define SHT_MIPS_CONFLICT 0x70000002 119#define SHT_MIPS_CONFLICT 0x70000002
@@ -193,50 +201,92 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
193 201
194#ifdef __KERNEL__ 202#ifdef __KERNEL__
195 203
204struct mips_abi;
205
206extern struct mips_abi mips_abi;
207extern struct mips_abi mips_abi_32;
208extern struct mips_abi mips_abi_n32;
209
196#ifdef CONFIG_32BIT 210#ifdef CONFIG_32BIT
197 211
198#define SET_PERSONALITY(ex, ibcs2) \ 212#define SET_PERSONALITY(ex, ibcs2) \
199do { \ 213do { \
200 if (ibcs2) \ 214 if (ibcs2) \
201 set_personality(PER_SVR4); \ 215 set_personality(PER_SVR4); \
202 set_personality(PER_LINUX); \ 216 set_personality(PER_LINUX); \
217 \
218 current->thread.abi = &mips_abi; \
203} while (0) 219} while (0)
204 220
205#endif /* CONFIG_32BIT */ 221#endif /* CONFIG_32BIT */
206 222
207#ifdef CONFIG_64BIT 223#ifdef CONFIG_64BIT
208 224
209#define SET_PERSONALITY(ex, ibcs2) \ 225#ifdef CONFIG_MIPS32_N32
210do { current->thread.mflags &= ~MF_ABI_MASK; \ 226#define __SET_PERSONALITY32_N32() \
211 if ((ex).e_ident[EI_CLASS] == ELFCLASS32) { \ 227 do { \
212 if ((((ex).e_flags & EF_MIPS_ABI2) != 0) && \ 228 current->thread.mflags |= MF_N32; \
213 ((ex).e_flags & EF_MIPS_ABI) == 0) \ 229 current->thread.abi = &mips_abi_n32; \
214 current->thread.mflags |= MF_N32; \ 230 } while (0)
215 else \ 231#else
216 current->thread.mflags |= MF_O32; \ 232#define __SET_PERSONALITY32_N32() \
217 } else \ 233 do { } while (0)
218 current->thread.mflags |= MF_N64; \ 234#endif
219 if (ibcs2) \ 235
220 set_personality(PER_SVR4); \ 236#ifdef CONFIG_MIPS32_O32
221 else if (current->personality != PER_LINUX32) \ 237#define __SET_PERSONALITY32_O32() \
222 set_personality(PER_LINUX); \ 238 do { \
239 current->thread.mflags |= MF_O32; \
240 current->thread.abi = &mips_abi_32; \
241 } while (0)
242#else
243#define __SET_PERSONALITY32_O32() \
244 do { } while (0)
245#endif
246
247#ifdef CONFIG_MIPS32_COMPAT
248#define __SET_PERSONALITY32(ex) \
249do { \
250 if ((((ex).e_flags & EF_MIPS_ABI2) != 0) && \
251 ((ex).e_flags & EF_MIPS_ABI) == 0) \
252 __SET_PERSONALITY32_N32(); \
253 else \
254 __SET_PERSONALITY32_O32(); \
255} while (0)
256#else
257#define __SET_PERSONALITY32(ex) do { } while (0)
258#endif
259
260#define SET_PERSONALITY(ex, ibcs2) \
261do { \
262 current->thread.mflags &= ~MF_ABI_MASK; \
263 if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \
264 __SET_PERSONALITY32(ex); \
265 else { \
266 current->thread.mflags |= MF_N64; \
267 current->thread.abi = &mips_abi; \
268 } \
269 \
270 if (ibcs2) \
271 set_personality(PER_SVR4); \
272 else if (current->personality != PER_LINUX32) \
273 set_personality(PER_LINUX); \
223} while (0) 274} while (0)
224 275
225#endif /* CONFIG_64BIT */ 276#endif /* CONFIG_64BIT */
226 277
227extern void dump_regs(elf_greg_t *, struct pt_regs *regs); 278extern void dump_regs(elf_greg_t *, struct pt_regs *regs);
279extern int dump_task_regs (struct task_struct *, elf_gregset_t *);
228extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); 280extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
229 281
230#define ELF_CORE_COPY_REGS(elf_regs, regs) \ 282#define ELF_CORE_COPY_REGS(elf_regs, regs) \
231 dump_regs((elf_greg_t *)&(elf_regs), regs); 283 dump_regs((elf_greg_t *)&(elf_regs), regs);
284#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
232#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \ 285#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \
233 dump_task_fpu(tsk, elf_fpregs) 286 dump_task_fpu(tsk, elf_fpregs)
234 287
235#endif /* __KERNEL__ */ 288#endif /* __KERNEL__ */
236 289
237/* This one accepts IRIX binaries. */
238#define irix_elf_check_arch(hdr) ((hdr)->e_flags & RHF_SGI_ONLY)
239
240#define USE_ELF_CORE_DUMP 290#define USE_ELF_CORE_DUMP
241#define ELF_EXEC_PAGESIZE PAGE_SIZE 291#define ELF_EXEC_PAGESIZE PAGE_SIZE
242 292
diff --git a/include/asm-mips/errno.h b/include/asm-mips/errno.h
index 3c0d840e4577..9d3e6e7cdb92 100644
--- a/include/asm-mips/errno.h
+++ b/include/asm-mips/errno.h
@@ -119,6 +119,10 @@
119#define EOWNERDEAD 165 /* Owner died */ 119#define EOWNERDEAD 165 /* Owner died */
120#define ENOTRECOVERABLE 166 /* State not recoverable */ 120#define ENOTRECOVERABLE 166 /* State not recoverable */
121 121
122/* for robust mutexes */
123#define EOWNERDEAD 165 /* Owner died */
124#define ENOTRECOVERABLE 166 /* State not recoverable */
125
122#define EDQUOT 1133 /* Quota exceeded */ 126#define EDQUOT 1133 /* Quota exceeded */
123 127
124#ifdef __KERNEL__ 128#ifdef __KERNEL__
diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h
index 06c5d13faf66..43d047a9a6af 100644
--- a/include/asm-mips/fcntl.h
+++ b/include/asm-mips/fcntl.h
@@ -3,11 +3,13 @@
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) 1995, 96, 97, 98, 99, 2003 Ralf Baechle 6 * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle
7 */ 7 */
8#ifndef _ASM_FCNTL_H 8#ifndef _ASM_FCNTL_H
9#define _ASM_FCNTL_H 9#define _ASM_FCNTL_H
10 10
11#include <linux/config.h>
12
11#define O_APPEND 0x0008 13#define O_APPEND 0x0008
12#define O_SYNC 0x0010 14#define O_SYNC 0x0010
13#define O_NONBLOCK 0x0080 15#define O_NONBLOCK 0x0080
@@ -40,13 +42,13 @@
40 * contain all the same fields as struct flock. 42 * contain all the same fields as struct flock.
41 */ 43 */
42 44
43#ifndef __mips64 45#ifdef CONFIG_32BIT
44 46
45struct flock { 47struct flock {
46 short l_type; 48 short l_type;
47 short l_whence; 49 short l_whence;
48 __kernel_off_t l_start; 50 off_t l_start;
49 __kernel_off_t l_len; 51 off_t l_len;
50 long l_sysid; 52 long l_sysid;
51 __kernel_pid_t l_pid; 53 __kernel_pid_t l_pid;
52 long pad[4]; 54 long pad[4];
@@ -54,13 +56,8 @@ struct flock {
54 56
55#define HAVE_ARCH_STRUCT_FLOCK 57#define HAVE_ARCH_STRUCT_FLOCK
56 58
57#endif 59#endif /* CONFIG_32BIT */
58 60
59#include <asm-generic/fcntl.h> 61#include <asm-generic/fcntl.h>
60 62
61typedef struct flock flock_t;
62#ifndef __mips64
63typedef struct flock64 flock64_t;
64#endif
65
66#endif /* _ASM_FCNTL_H */ 63#endif /* _ASM_FCNTL_H */
diff --git a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h
index 26b6a90a690b..73a3028dd9f9 100644
--- a/include/asm-mips/fixmap.h
+++ b/include/asm-mips/fixmap.h
@@ -107,4 +107,11 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr)
107 return __virt_to_fix(vaddr); 107 return __virt_to_fix(vaddr);
108} 108}
109 109
110/*
111 * Called from pgtable_init()
112 */
113extern void fixrange_init(unsigned long start, unsigned long end,
114 pgd_t *pgd_base);
115
116
110#endif 117#endif
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h
index ea24e733b1bc..9c828b1f8218 100644
--- a/include/asm-mips/fpu.h
+++ b/include/asm-mips/fpu.h
@@ -80,9 +80,14 @@ do { \
80 80
81#define clear_fpu_owner() clear_thread_flag(TIF_USEDFPU) 81#define clear_fpu_owner() clear_thread_flag(TIF_USEDFPU)
82 82
83static inline int __is_fpu_owner(void)
84{
85 return test_thread_flag(TIF_USEDFPU);
86}
87
83static inline int is_fpu_owner(void) 88static inline int is_fpu_owner(void)
84{ 89{
85 return cpu_has_fpu && test_thread_flag(TIF_USEDFPU); 90 return cpu_has_fpu && __is_fpu_owner();
86} 91}
87 92
88static inline void own_fpu(void) 93static inline void own_fpu(void)
@@ -127,7 +132,7 @@ static inline void restore_fp(struct task_struct *tsk)
127static inline fpureg_t *get_fpu_regs(struct task_struct *tsk) 132static inline fpureg_t *get_fpu_regs(struct task_struct *tsk)
128{ 133{
129 if (cpu_has_fpu) { 134 if (cpu_has_fpu) {
130 if ((tsk == current) && is_fpu_owner()) 135 if ((tsk == current) && __is_fpu_owner())
131 _save_fp(current); 136 _save_fp(current);
132 return tsk->thread.fpu.hard.fpr; 137 return tsk->thread.fpu.hard.fpr;
133 } 138 }
diff --git a/include/asm-mips/fpu_emulator.h b/include/asm-mips/fpu_emulator.h
index 46972ae2b95d..16cb4d11dd0b 100644
--- a/include/asm-mips/fpu_emulator.h
+++ b/include/asm-mips/fpu_emulator.h
@@ -23,16 +23,15 @@
23#ifndef _ASM_FPU_EMULATOR_H 23#ifndef _ASM_FPU_EMULATOR_H
24#define _ASM_FPU_EMULATOR_H 24#define _ASM_FPU_EMULATOR_H
25 25
26struct mips_fpu_emulator_private { 26struct mips_fpu_emulator_stats {
27 unsigned int eir; 27 unsigned int emulated;
28 struct { 28 unsigned int loads;
29 unsigned int emulated; 29 unsigned int stores;
30 unsigned int loads; 30 unsigned int cp1ops;
31 unsigned int stores; 31 unsigned int cp1xops;
32 unsigned int cp1ops; 32 unsigned int errors;
33 unsigned int cp1xops;
34 unsigned int errors;
35 } stats;
36}; 33};
37 34
35extern struct mips_fpu_emulator_stats fpuemustats;
36
38#endif /* _ASM_FPU_EMULATOR_H */ 37#endif /* _ASM_FPU_EMULATOR_H */
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h
index 9feff4ce1424..2454c44a8f54 100644
--- a/include/asm-mips/futex.h
+++ b/include/asm-mips/futex.h
@@ -3,10 +3,45 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
6#include <linux/futex.h> 7#include <linux/futex.h>
7#include <asm/errno.h> 8#include <asm/errno.h>
8#include <asm/uaccess.h> 9#include <asm/uaccess.h>
9 10
11#ifdef CONFIG_SMP
12#define __FUTEX_SMP_SYNC " sync \n"
13#else
14#define __FUTEX_SMP_SYNC
15#endif
16
17#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
18{ \
19 __asm__ __volatile__( \
20 " .set push \n" \
21 " .set noat \n" \
22 " .set mips3 \n" \
23 "1: ll %1, (%3) # __futex_atomic_op1 \n" \
24 " .set mips0 \n" \
25 " " insn " \n" \
26 " .set mips3 \n" \
27 "2: sc $1, (%3) \n" \
28 " beqzl $1, 1b \n" \
29 __FUTEX_SMP_SYNC \
30 "3: \n" \
31 " .set pop \n" \
32 " .set mips0 \n" \
33 " .section .fixup,\"ax\" \n" \
34 "4: li %0, %5 \n" \
35 " j 2b \n" \
36 " .previous \n" \
37 " .section __ex_table,\"a\" \n" \
38 " "__UA_ADDR "\t1b, 4b \n" \
39 " "__UA_ADDR "\t2b, 4b \n" \
40 " .previous \n" \
41 : "=r" (ret), "=r" (oldval) \
42 : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \
43}
44
10static inline int 45static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr) 46futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{ 47{
@@ -25,10 +60,25 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
25 60
26 switch (op) { 61 switch (op) {
27 case FUTEX_OP_SET: 62 case FUTEX_OP_SET:
63 __futex_atomic_op("move $1, %z4", ret, oldval, uaddr, oparg);
64 break;
65
28 case FUTEX_OP_ADD: 66 case FUTEX_OP_ADD:
67 __futex_atomic_op("addu $1, %1, %z4",
68 ret, oldval, uaddr, oparg);
69 break;
29 case FUTEX_OP_OR: 70 case FUTEX_OP_OR:
71 __futex_atomic_op("or $1, %1, %z4",
72 ret, oldval, uaddr, oparg);
73 break;
30 case FUTEX_OP_ANDN: 74 case FUTEX_OP_ANDN:
75 __futex_atomic_op("and $1, %1, %z4",
76 ret, oldval, uaddr, ~oparg);
77 break;
31 case FUTEX_OP_XOR: 78 case FUTEX_OP_XOR:
79 __futex_atomic_op("xor $1, %1, %z4",
80 ret, oldval, uaddr, oparg);
81 break;
32 default: 82 default:
33 ret = -ENOSYS; 83 ret = -ENOSYS;
34 } 84 }
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h
index f524eaccd5f1..7517189e469f 100644
--- a/include/asm-mips/hazards.h
+++ b/include/asm-mips/hazards.h
@@ -74,7 +74,8 @@
74#define irq_disable_hazard 74#define irq_disable_hazard
75 _ehb 75 _ehb
76 76
77#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) 77#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) || \
78 defined(CONFIG_CPU_SB1)
78 79
79/* 80/*
80 * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer. 81 * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
@@ -107,6 +108,7 @@ __asm__(
107 " .endm \n\t"); 108 " .endm \n\t");
108 109
109#ifdef CONFIG_CPU_RM9000 110#ifdef CONFIG_CPU_RM9000
111
110/* 112/*
111 * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent 113 * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
112 * use of the JTLB for instructions should not occur for 4 cpu cycles and use 114 * use of the JTLB for instructions should not occur for 4 cpu cycles and use
@@ -124,6 +126,9 @@ __asm__(
124 ".set\tmips32\n\t" \ 126 ".set\tmips32\n\t" \
125 "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \ 127 "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
126 ".set\tmips0") 128 ".set\tmips0")
129
130#define back_to_back_c0_hazard() do { } while (0)
131
127#else 132#else
128 133
129/* 134/*
@@ -144,15 +149,13 @@ __asm__(
144#endif 149#endif
145 150
146/* 151/*
147 * mtc0->mfc0 hazard 152 * Interrupt enable/disable hazards
148 * The 24K has a 2 cycle mtc0/mfc0 execution hazard. 153 * Some processors have hazards when modifying
149 * It is a MIPS32R2 processor so ehb will clear the hazard. 154 * the status register to change the interrupt state
150 */ 155 */
151 156
152#ifdef CONFIG_CPU_MIPSR2 157#ifdef CONFIG_CPU_MIPSR2
153/* 158
154 * Use a macro for ehb unless explicit support for MIPSR2 is enabled
155 */
156__asm__( 159__asm__(
157 " .macro\tirq_enable_hazard \n\t" 160 " .macro\tirq_enable_hazard \n\t"
158 " _ehb \n\t" 161 " _ehb \n\t"
@@ -160,17 +163,26 @@ __asm__(
160 " \n\t" 163 " \n\t"
161 " .macro\tirq_disable_hazard \n\t" 164 " .macro\tirq_disable_hazard \n\t"
162 " _ehb \n\t" 165 " _ehb \n\t"
166 " .endm \n\t"
167 " \n\t"
168 " .macro\tback_to_back_c0_hazard \n\t"
169 " _ehb \n\t"
163 " .endm"); 170 " .endm");
164 171
165#define irq_enable_hazard() \ 172#define irq_enable_hazard() \
166 __asm__ __volatile__( \ 173 __asm__ __volatile__( \
167 "_ehb\t\t\t\t# irq_enable_hazard") 174 "irq_enable_hazard")
168 175
169#define irq_disable_hazard() \ 176#define irq_disable_hazard() \
170 __asm__ __volatile__( \ 177 __asm__ __volatile__( \
171 "_ehb\t\t\t\t# irq_disable_hazard") 178 "irq_disable_hazard")
179
180#define back_to_back_c0_hazard() \
181 __asm__ __volatile__( \
182 "back_to_back_c0_hazard")
172 183
173#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) 184#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) || \
185 defined(CONFIG_CPU_SB1)
174 186
175/* 187/*
176 * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer. 188 * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
@@ -186,6 +198,8 @@ __asm__(
186#define irq_enable_hazard() do { } while (0) 198#define irq_enable_hazard() do { } while (0)
187#define irq_disable_hazard() do { } while (0) 199#define irq_disable_hazard() do { } while (0)
188 200
201#define back_to_back_c0_hazard() do { } while (0)
202
189#else 203#else
190 204
191/* 205/*
@@ -208,10 +222,32 @@ __asm__(
208#define irq_enable_hazard() do { } while (0) 222#define irq_enable_hazard() do { } while (0)
209#define irq_disable_hazard() \ 223#define irq_disable_hazard() \
210 __asm__ __volatile__( \ 224 __asm__ __volatile__( \
211 "_ssnop; _ssnop; _ssnop;\t\t# irq_disable_hazard") 225 "irq_disable_hazard")
226
227#define back_to_back_c0_hazard() \
228 __asm__ __volatile__( \
229 " .set noreorder \n" \
230 " nop; nop; nop \n" \
231 " .set reorder \n")
212 232
213#endif 233#endif
214 234
235#ifdef CONFIG_CPU_MIPSR2
236#define instruction_hazard() \
237do { \
238__label__ __next; \
239 __asm__ __volatile__( \
240 " jr.hb %0 \n" \
241 : \
242 : "r" (&&__next)); \
243__next: \
244 ; \
245} while (0)
246
247#else
248#define instruction_hazard() do { } while (0)
249#endif
250
215#endif /* __ASSEMBLY__ */ 251#endif /* __ASSEMBLY__ */
216 252
217#endif /* _ASM_HAZARDS_H */ 253#endif /* _ASM_HAZARDS_H */
diff --git a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h
index f49930d947d4..8cf598402492 100644
--- a/include/asm-mips/highmem.h
+++ b/include/asm-mips/highmem.h
@@ -75,6 +75,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
75} 75}
76 76
77static inline void kunmap_atomic(void *kvaddr, enum km_type type) { } 77static inline void kunmap_atomic(void *kvaddr, enum km_type type) { }
78#define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn))
78 79
79#define kmap_atomic_to_page(ptr) virt_to_page(ptr) 80#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
80 81
@@ -86,6 +87,7 @@ extern void *__kmap(struct page *page);
86extern void __kunmap(struct page *page); 87extern void __kunmap(struct page *page);
87extern void *__kmap_atomic(struct page *page, enum km_type type); 88extern void *__kmap_atomic(struct page *page, enum km_type type);
88extern void __kunmap_atomic(void *kvaddr, enum km_type type); 89extern void __kunmap_atomic(void *kvaddr, enum km_type type);
90extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
89extern struct page *__kmap_atomic_to_page(void *ptr); 91extern struct page *__kmap_atomic_to_page(void *ptr);
90 92
91#define kmap __kmap 93#define kmap __kmap
diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h
index 6ad517241768..e0745f4ff624 100644
--- a/include/asm-mips/inst.h
+++ b/include/asm-mips/inst.h
@@ -28,7 +28,7 @@ enum major_op {
28 sdl_op, sdr_op, swr_op, cache_op, 28 sdl_op, sdr_op, swr_op, cache_op,
29 ll_op, lwc1_op, lwc2_op, pref_op, 29 ll_op, lwc1_op, lwc2_op, pref_op,
30 lld_op, ldc1_op, ldc2_op, ld_op, 30 lld_op, ldc1_op, ldc2_op, ld_op,
31 sc_op, swc1_op, swc2_op, major_3b_op, /* Opcode 0x3b is unused */ 31 sc_op, swc1_op, swc2_op, rdhwr_op,
32 scd_op, sdc1_op, sdc2_op, sd_op 32 scd_op, sdc1_op, sdc2_op, sd_op
33}; 33};
34 34
@@ -62,10 +62,10 @@ enum rt_op {
62 spimi_op, unused_rt_op_0x05, unused_rt_op_0x06, unused_rt_op_0x07, 62 spimi_op, unused_rt_op_0x05, unused_rt_op_0x06, unused_rt_op_0x07,
63 tgei_op, tgeiu_op, tlti_op, tltiu_op, 63 tgei_op, tgeiu_op, tlti_op, tltiu_op,
64 teqi_op, unused_0x0d_rt_op, tnei_op, unused_0x0f_rt_op, 64 teqi_op, unused_0x0d_rt_op, tnei_op, unused_0x0f_rt_op,
65 bltzal_op, bgezal_op, bltzall_op, bgezall_op 65 bltzal_op, bgezal_op, bltzall_op, bgezall_op,
66 /* 66 rt_op_0x14, rt_op_0x15, rt_op_0x16, rt_op_0x17,
67 * The others (0x14 - 0x1f) are unused. 67 rt_op_0x18, rt_op_0x19, rt_op_0x1a, rt_op_0x1b,
68 */ 68 bposge32_op, rt_op_0x1d, rt_op_0x1e, rt_op_0x1f
69}; 69};
70 70
71/* 71/*
diff --git a/include/asm-mips/interrupt.h b/include/asm-mips/interrupt.h
index e8357f5379fa..a5735761f5e5 100644
--- a/include/asm-mips/interrupt.h
+++ b/include/asm-mips/interrupt.h
@@ -11,20 +11,25 @@
11#ifndef _ASM_INTERRUPT_H 11#ifndef _ASM_INTERRUPT_H
12#define _ASM_INTERRUPT_H 12#define _ASM_INTERRUPT_H
13 13
14#include <linux/config.h>
14#include <asm/hazards.h> 15#include <asm/hazards.h>
15 16
16__asm__ ( 17__asm__ (
17 ".macro\tlocal_irq_enable\n\t" 18 " .macro local_irq_enable \n"
18 ".set\tpush\n\t" 19 " .set push \n"
19 ".set\treorder\n\t" 20 " .set reorder \n"
20 ".set\tnoat\n\t" 21 " .set noat \n"
21 "mfc0\t$1,$12\n\t" 22#ifdef CONFIG_CPU_MIPSR2
22 "ori\t$1,0x1f\n\t" 23 " ei \n"
23 "xori\t$1,0x1e\n\t" 24#else
24 "mtc0\t$1,$12\n\t" 25 " mfc0 $1,$12 \n"
25 "irq_enable_hazard\n\t" 26 " ori $1,0x1f \n"
26 ".set\tpop\n\t" 27 " xori $1,0x1e \n"
27 ".endm"); 28 " mtc0 $1,$12 \n"
29#endif
30 " irq_enable_hazard \n"
31 " .set pop \n"
32 " .endm");
28 33
29static inline void local_irq_enable(void) 34static inline void local_irq_enable(void)
30{ 35{
@@ -43,17 +48,21 @@ static inline void local_irq_enable(void)
43 * no nops at all. 48 * no nops at all.
44 */ 49 */
45__asm__ ( 50__asm__ (
46 ".macro\tlocal_irq_disable\n\t" 51 " .macro local_irq_disable\n"
47 ".set\tpush\n\t" 52 " .set push \n"
48 ".set\tnoat\n\t" 53 " .set noat \n"
49 "mfc0\t$1,$12\n\t" 54#ifdef CONFIG_CPU_MIPSR2
50 "ori\t$1,1\n\t" 55 " di \n"
51 "xori\t$1,1\n\t" 56#else
52 ".set\tnoreorder\n\t" 57 " mfc0 $1,$12 \n"
53 "mtc0\t$1,$12\n\t" 58 " ori $1,1 \n"
54 "irq_disable_hazard\n\t" 59 " xori $1,1 \n"
55 ".set\tpop\n\t" 60 " .set noreorder \n"
56 ".endm"); 61 " mtc0 $1,$12 \n"
62#endif
63 " irq_disable_hazard \n"
64 " .set pop \n"
65 " .endm \n");
57 66
58static inline void local_irq_disable(void) 67static inline void local_irq_disable(void)
59{ 68{
@@ -65,12 +74,12 @@ static inline void local_irq_disable(void)
65} 74}
66 75
67__asm__ ( 76__asm__ (
68 ".macro\tlocal_save_flags flags\n\t" 77 " .macro local_save_flags flags \n"
69 ".set\tpush\n\t" 78 " .set push \n"
70 ".set\treorder\n\t" 79 " .set reorder \n"
71 "mfc0\t\\flags, $12\n\t" 80 " mfc0 \\flags, $12 \n"
72 ".set\tpop\n\t" 81 " .set pop \n"
73 ".endm"); 82 " .endm \n");
74 83
75#define local_save_flags(x) \ 84#define local_save_flags(x) \
76__asm__ __volatile__( \ 85__asm__ __volatile__( \
@@ -78,18 +87,22 @@ __asm__ __volatile__( \
78 : "=r" (x)) 87 : "=r" (x))
79 88
80__asm__ ( 89__asm__ (
81 ".macro\tlocal_irq_save result\n\t" 90 " .macro local_irq_save result \n"
82 ".set\tpush\n\t" 91 " .set push \n"
83 ".set\treorder\n\t" 92 " .set reorder \n"
84 ".set\tnoat\n\t" 93 " .set noat \n"
85 "mfc0\t\\result, $12\n\t" 94#ifdef CONFIG_CPU_MIPSR2
86 "ori\t$1, \\result, 1\n\t" 95 " di \\result \n"
87 "xori\t$1, 1\n\t" 96#else
88 ".set\tnoreorder\n\t" 97 " mfc0 \\result, $12 \n"
89 "mtc0\t$1, $12\n\t" 98 " ori $1, \\result, 1 \n"
90 "irq_disable_hazard\n\t" 99 " xori $1, 1 \n"
91 ".set\tpop\n\t" 100 " .set noreorder \n"
92 ".endm"); 101 " mtc0 $1, $12 \n"
102#endif
103 " irq_disable_hazard \n"
104 " .set pop \n"
105 " .endm \n");
93 106
94#define local_irq_save(x) \ 107#define local_irq_save(x) \
95__asm__ __volatile__( \ 108__asm__ __volatile__( \
@@ -99,19 +112,37 @@ __asm__ __volatile__( \
99 : "memory") 112 : "memory")
100 113
101__asm__ ( 114__asm__ (
102 ".macro\tlocal_irq_restore flags\n\t" 115 " .macro local_irq_restore flags \n"
103 ".set\tnoreorder\n\t" 116 " .set noreorder \n"
104 ".set\tnoat\n\t" 117 " .set noat \n"
105 "mfc0\t$1, $12\n\t" 118#if defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU)
106 "andi\t\\flags, 1\n\t" 119 /*
107 "ori\t$1, 1\n\t" 120 * Slow, but doesn't suffer from a relativly unlikely race
108 "xori\t$1, 1\n\t" 121 * condition we're having since days 1.
109 "or\t\\flags, $1\n\t" 122 */
110 "mtc0\t\\flags, $12\n\t" 123 " beqz \\flags, 1f \n"
111 "irq_disable_hazard\n\t" 124 " di \n"
112 ".set\tat\n\t" 125 " ei \n"
113 ".set\treorder\n\t" 126 "1: \n"
114 ".endm"); 127#elif defined(CONFIG_CPU_MIPSR2)
128 /*
129 * Fast, dangerous. Life is fun, life is good.
130 */
131 " mfc0 $1, $12 \n"
132 " ins $1, \\flags, 0, 1 \n"
133 " mtc0 $1, $12 \n"
134#else
135 " mfc0 $1, $12 \n"
136 " andi \\flags, 1 \n"
137 " ori $1, 1 \n"
138 " xori $1, 1 \n"
139 " or \\flags, $1 \n"
140 " mtc0 \\flags, $12 \n"
141#endif
142 " irq_disable_hazard \n"
143 " .set at \n"
144 " .set reorder \n"
145 " .endm \n");
115 146
116#define local_irq_restore(flags) \ 147#define local_irq_restore(flags) \
117do { \ 148do { \
diff --git a/include/asm-mips/inventory.h b/include/asm-mips/inventory.h
index 4cd36fe98173..92d90f75a636 100644
--- a/include/asm-mips/inventory.h
+++ b/include/asm-mips/inventory.h
@@ -4,6 +4,8 @@
4#ifndef __ASM_INVENTORY_H 4#ifndef __ASM_INVENTORY_H
5#define __ASM_INVENTORY_H 5#define __ASM_INVENTORY_H
6 6
7#include <linux/compiler.h>
8
7typedef struct inventory_s { 9typedef struct inventory_s {
8 struct inventory_s *inv_next; 10 struct inventory_s *inv_next;
9 int inv_class; 11 int inv_class;
@@ -14,7 +16,9 @@ typedef struct inventory_s {
14} inventory_t; 16} inventory_t;
15 17
16extern int inventory_items; 18extern int inventory_items;
17void add_to_inventory (int class, int type, int controller, int unit, int state); 19
18int dump_inventory_to_user (void *userbuf, int size); 20extern void add_to_inventory (int class, int type, int controller, int unit, int state);
21extern int dump_inventory_to_user (void __user *userbuf, int size);
22extern int __init init_inventory(void);
19 23
20#endif /* __ASM_INVENTORY_H */ 24#endif /* __ASM_INVENTORY_H */
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
index 039845f2e6b0..3061870b7f6c 100644
--- a/include/asm-mips/io.h
+++ b/include/asm-mips/io.h
@@ -25,7 +25,9 @@
25#include <asm/page.h> 25#include <asm/page.h>
26#include <asm/pgtable-bits.h> 26#include <asm/pgtable-bits.h>
27#include <asm/processor.h> 27#include <asm/processor.h>
28#include <asm/string.h>
28 29
30#include <ioremap.h>
29#include <mangle-port.h> 31#include <mangle-port.h>
30 32
31/* 33/*
@@ -34,7 +36,7 @@
34#undef CONF_SLOWDOWN_IO 36#undef CONF_SLOWDOWN_IO
35 37
36/* 38/*
37 * Raw operations are never swapped in software. Otoh values that raw 39 * Raw operations are never swapped in software. OTOH values that raw
38 * operations are working on may or may not have been swapped by the bus 40 * operations are working on may or may not have been swapped by the bus
39 * hardware. An example use would be for flash memory that's used for 41 * hardware. An example use would be for flash memory that's used for
40 * execute in place. 42 * execute in place.
@@ -43,45 +45,53 @@
43# define __raw_ioswabw(x) (x) 45# define __raw_ioswabw(x) (x)
44# define __raw_ioswabl(x) (x) 46# define __raw_ioswabl(x) (x)
45# define __raw_ioswabq(x) (x) 47# define __raw_ioswabq(x) (x)
48# define ____raw_ioswabq(x) (x)
46 49
47/* 50/*
48 * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware; 51 * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware;
49 * less sane hardware forces software to fiddle with this... 52 * less sane hardware forces software to fiddle with this...
53 *
54 * Regardless, if the host bus endianness mismatches that of PCI/ISA, then
55 * you can't have the numerical value of data and byte addresses within
56 * multibyte quantities both preserved at the same time. Hence two
57 * variations of functions: non-prefixed ones that preserve the value
58 * and prefixed ones that preserve byte addresses. The latters are
59 * typically used for moving raw data between a peripheral and memory (cf.
60 * string I/O functions), hence the "mem_" prefix.
50 */ 61 */
51#if defined(CONFIG_SWAP_IO_SPACE) 62#if defined(CONFIG_SWAP_IO_SPACE)
52 63
53# define ioswabb(x) (x) 64# define ioswabb(x) (x)
65# define mem_ioswabb(x) (x)
54# ifdef CONFIG_SGI_IP22 66# ifdef CONFIG_SGI_IP22
55/* 67/*
56 * IP22 seems braindead enough to swap 16bits values in hardware, but 68 * IP22 seems braindead enough to swap 16bits values in hardware, but
57 * not 32bits. Go figure... Can't tell without documentation. 69 * not 32bits. Go figure... Can't tell without documentation.
58 */ 70 */
59# define ioswabw(x) (x) 71# define ioswabw(x) (x)
72# define mem_ioswabw(x) le16_to_cpu(x)
60# else 73# else
61# define ioswabw(x) le16_to_cpu(x) 74# define ioswabw(x) le16_to_cpu(x)
75# define mem_ioswabw(x) (x)
62# endif 76# endif
63# define ioswabl(x) le32_to_cpu(x) 77# define ioswabl(x) le32_to_cpu(x)
78# define mem_ioswabl(x) (x)
64# define ioswabq(x) le64_to_cpu(x) 79# define ioswabq(x) le64_to_cpu(x)
80# define mem_ioswabq(x) (x)
65 81
66#else 82#else
67 83
68# define ioswabb(x) (x) 84# define ioswabb(x) (x)
85# define mem_ioswabb(x) (x)
69# define ioswabw(x) (x) 86# define ioswabw(x) (x)
87# define mem_ioswabw(x) cpu_to_le16(x)
70# define ioswabl(x) (x) 88# define ioswabl(x) (x)
89# define mem_ioswabl(x) cpu_to_le32(x)
71# define ioswabq(x) (x) 90# define ioswabq(x) (x)
91# define mem_ioswabq(x) cpu_to_le32(x)
72 92
73#endif 93#endif
74 94
75/*
76 * Native bus accesses never swapped.
77 */
78#define bus_ioswabb(x) (x)
79#define bus_ioswabw(x) (x)
80#define bus_ioswabl(x) (x)
81#define bus_ioswabq(x) (x)
82
83#define __bus_ioswabq bus_ioswabq
84
85#define IO_SPACE_LIMIT 0xffff 95#define IO_SPACE_LIMIT 0xffff
86 96
87/* 97/*
@@ -194,12 +204,14 @@ extern unsigned long isa_slot_offset;
194 */ 204 */
195#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) 205#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
196 206
197extern void * __ioremap(phys_t offset, phys_t size, unsigned long flags); 207extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags);
198extern void __iounmap(volatile void __iomem *addr); 208extern void __iounmap(volatile void __iomem *addr);
199 209
200static inline void * __ioremap_mode(phys_t offset, unsigned long size, 210static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
201 unsigned long flags) 211 unsigned long flags)
202{ 212{
213#define __IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL))
214
203 if (cpu_has_64bit_addresses) { 215 if (cpu_has_64bit_addresses) {
204 u64 base = UNCAC_BASE; 216 u64 base = UNCAC_BASE;
205 217
@@ -209,10 +221,30 @@ static inline void * __ioremap_mode(phys_t offset, unsigned long size,
209 */ 221 */
210 if (flags == _CACHE_UNCACHED) 222 if (flags == _CACHE_UNCACHED)
211 base = (u64) IO_BASE; 223 base = (u64) IO_BASE;
212 return (void *) (unsigned long) (base + offset); 224 return (void __iomem *) (unsigned long) (base + offset);
225 } else if (__builtin_constant_p(offset) &&
226 __builtin_constant_p(size) && __builtin_constant_p(flags)) {
227 phys_t phys_addr, last_addr;
228
229 phys_addr = fixup_bigphys_addr(offset, size);
230
231 /* Don't allow wraparound or zero size. */
232 last_addr = phys_addr + size - 1;
233 if (!size || last_addr < phys_addr)
234 return NULL;
235
236 /*
237 * Map uncached objects in the low 512MB of address
238 * space using KSEG1.
239 */
240 if (__IS_LOW512(phys_addr) && __IS_LOW512(last_addr) &&
241 flags == _CACHE_UNCACHED)
242 return (void __iomem *)CKSEG1ADDR(phys_addr);
213 } 243 }
214 244
215 return __ioremap(offset, size, flags); 245 return __ioremap(offset, size, flags);
246
247#undef __IS_LOW512
216} 248}
217 249
218/* 250/*
@@ -264,12 +296,16 @@ static inline void * __ioremap_mode(phys_t offset, unsigned long size,
264 296
265static inline void iounmap(volatile void __iomem *addr) 297static inline void iounmap(volatile void __iomem *addr)
266{ 298{
267 if (cpu_has_64bit_addresses) 299#define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1)
300
301 if (cpu_has_64bit_addresses ||
302 (__builtin_constant_p(addr) && __IS_KSEG1(addr)))
268 return; 303 return;
269 304
270 __iounmap(addr); 305 __iounmap(addr);
271}
272 306
307#undef __IS_KSEG1
308}
273 309
274#define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \ 310#define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \
275 \ 311 \
@@ -319,7 +355,8 @@ static inline type pfx##read##bwlq(volatile void __iomem *mem) \
319 else if (cpu_has_64bits) { \ 355 else if (cpu_has_64bits) { \
320 unsigned long __flags; \ 356 unsigned long __flags; \
321 \ 357 \
322 local_irq_save(__flags); \ 358 if (irq) \
359 local_irq_save(__flags); \
323 __asm__ __volatile__( \ 360 __asm__ __volatile__( \
324 ".set mips3" "\t\t# __readq" "\n\t" \ 361 ".set mips3" "\t\t# __readq" "\n\t" \
325 "ld %L0, %1" "\n\t" \ 362 "ld %L0, %1" "\n\t" \
@@ -328,7 +365,8 @@ static inline type pfx##read##bwlq(volatile void __iomem *mem) \
328 ".set mips0" "\n" \ 365 ".set mips0" "\n" \
329 : "=r" (__val) \ 366 : "=r" (__val) \
330 : "m" (*__mem)); \ 367 : "m" (*__mem)); \
331 local_irq_restore(__flags); \ 368 if (irq) \
369 local_irq_restore(__flags); \
332 } else { \ 370 } else { \
333 __val = 0; \ 371 __val = 0; \
334 BUG(); \ 372 BUG(); \
@@ -349,11 +387,11 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \
349 \ 387 \
350 __val = pfx##ioswab##bwlq(val); \ 388 __val = pfx##ioswab##bwlq(val); \
351 \ 389 \
352 if (sizeof(type) != sizeof(u64)) { \ 390 /* Really, we want this to be atomic */ \
353 *__addr = __val; \ 391 BUILD_BUG_ON(sizeof(type) > sizeof(unsigned long)); \
354 slow; \ 392 \
355 } else \ 393 *__addr = __val; \
356 BUILD_BUG(); \ 394 slow; \
357} \ 395} \
358 \ 396 \
359static inline type pfx##in##bwlq##p(unsigned long port) \ 397static inline type pfx##in##bwlq##p(unsigned long port) \
@@ -364,13 +402,10 @@ static inline type pfx##in##bwlq##p(unsigned long port) \
364 port = __swizzle_addr_##bwlq(port); \ 402 port = __swizzle_addr_##bwlq(port); \
365 __addr = (void *)(mips_io_port_base + port); \ 403 __addr = (void *)(mips_io_port_base + port); \
366 \ 404 \
367 if (sizeof(type) != sizeof(u64)) { \ 405 BUILD_BUG_ON(sizeof(type) > sizeof(unsigned long)); \
368 __val = *__addr; \ 406 \
369 slow; \ 407 __val = *__addr; \
370 } else { \ 408 slow; \
371 __val = 0; \
372 BUILD_BUG(); \
373 } \
374 \ 409 \
375 return pfx##ioswab##bwlq(__val); \ 410 return pfx##ioswab##bwlq(__val); \
376} 411}
@@ -379,27 +414,35 @@ static inline type pfx##in##bwlq##p(unsigned long port) \
379 \ 414 \
380__BUILD_MEMORY_SINGLE(bus, bwlq, type, 1) 415__BUILD_MEMORY_SINGLE(bus, bwlq, type, 1)
381 416
382#define __BUILD_IOPORT_PFX(bus, bwlq, type) \ 417#define BUILDIO_MEM(bwlq, type) \
383 \
384__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
385__BUILD_IOPORT_SINGLE(bus, bwlq, type, _p, SLOW_DOWN_IO)
386
387#define BUILDIO(bwlq, type) \
388 \ 418 \
389__BUILD_MEMORY_PFX(, bwlq, type) \
390__BUILD_MEMORY_PFX(__raw_, bwlq, type) \ 419__BUILD_MEMORY_PFX(__raw_, bwlq, type) \
391__BUILD_MEMORY_PFX(bus_, bwlq, type) \ 420__BUILD_MEMORY_PFX(, bwlq, type) \
392__BUILD_IOPORT_PFX(, bwlq, type) \ 421__BUILD_MEMORY_PFX(mem_, bwlq, type) \
393__BUILD_IOPORT_PFX(__raw_, bwlq, type) 422
423BUILDIO_MEM(b, u8)
424BUILDIO_MEM(w, u16)
425BUILDIO_MEM(l, u32)
426BUILDIO_MEM(q, u64)
427
428#define __BUILD_IOPORT_PFX(bus, bwlq, type) \
429 __BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
430 __BUILD_IOPORT_SINGLE(bus, bwlq, type, _p, SLOW_DOWN_IO)
431
432#define BUILDIO_IOPORT(bwlq, type) \
433 __BUILD_IOPORT_PFX(, bwlq, type) \
434 __BUILD_IOPORT_PFX(mem_, bwlq, type)
435
436BUILDIO_IOPORT(b, u8)
437BUILDIO_IOPORT(w, u16)
438BUILDIO_IOPORT(l, u32)
439#ifdef CONFIG_64BIT
440BUILDIO_IOPORT(q, u64)
441#endif
394 442
395#define __BUILDIO(bwlq, type) \ 443#define __BUILDIO(bwlq, type) \
396 \ 444 \
397__BUILD_MEMORY_SINGLE(__bus_, bwlq, type, 0) 445__BUILD_MEMORY_SINGLE(____raw_, bwlq, type, 0)
398
399BUILDIO(b, u8)
400BUILDIO(w, u16)
401BUILDIO(l, u32)
402BUILDIO(q, u64)
403 446
404__BUILDIO(q, u64) 447__BUILDIO(q, u64)
405 448
@@ -422,7 +465,7 @@ static inline void writes##bwlq(volatile void __iomem *mem, void *addr, \
422 volatile type *__addr = addr; \ 465 volatile type *__addr = addr; \
423 \ 466 \
424 while (count--) { \ 467 while (count--) { \
425 __raw_write##bwlq(*__addr, mem); \ 468 mem_write##bwlq(*__addr, mem); \
426 __addr++; \ 469 __addr++; \
427 } \ 470 } \
428} \ 471} \
@@ -433,20 +476,20 @@ static inline void reads##bwlq(volatile void __iomem *mem, void *addr, \
433 volatile type *__addr = addr; \ 476 volatile type *__addr = addr; \
434 \ 477 \
435 while (count--) { \ 478 while (count--) { \
436 *__addr = __raw_read##bwlq(mem); \ 479 *__addr = mem_read##bwlq(mem); \
437 __addr++; \ 480 __addr++; \
438 } \ 481 } \
439} 482}
440 483
441#define __BUILD_IOPORT_STRING(bwlq, type) \ 484#define __BUILD_IOPORT_STRING(bwlq, type) \
442 \ 485 \
443static inline void outs##bwlq(unsigned long port, void *addr, \ 486static inline void outs##bwlq(unsigned long port, const void *addr, \
444 unsigned int count) \ 487 unsigned int count) \
445{ \ 488{ \
446 volatile type *__addr = addr; \ 489 const volatile type *__addr = addr; \
447 \ 490 \
448 while (count--) { \ 491 while (count--) { \
449 __raw_out##bwlq(*__addr, port); \ 492 mem_out##bwlq(*__addr, port); \
450 __addr++; \ 493 __addr++; \
451 } \ 494 } \
452} \ 495} \
@@ -457,7 +500,7 @@ static inline void ins##bwlq(unsigned long port, void *addr, \
457 volatile type *__addr = addr; \ 500 volatile type *__addr = addr; \
458 \ 501 \
459 while (count--) { \ 502 while (count--) { \
460 *__addr = __raw_in##bwlq(port); \ 503 *__addr = mem_in##bwlq(port); \
461 __addr++; \ 504 __addr++; \
462 } \ 505 } \
463} 506}
@@ -470,15 +513,26 @@ __BUILD_IOPORT_STRING(bwlq, type)
470BUILDSTRING(b, u8) 513BUILDSTRING(b, u8)
471BUILDSTRING(w, u16) 514BUILDSTRING(w, u16)
472BUILDSTRING(l, u32) 515BUILDSTRING(l, u32)
516#ifdef CONFIG_64BIT
473BUILDSTRING(q, u64) 517BUILDSTRING(q, u64)
518#endif
474 519
475 520
476/* Depends on MIPS II instruction set */ 521/* Depends on MIPS II instruction set */
477#define mmiowb() asm volatile ("sync" ::: "memory") 522#define mmiowb() asm volatile ("sync" ::: "memory")
478 523
479#define memset_io(a,b,c) memset((void *)(a),(b),(c)) 524static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count)
480#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) 525{
481#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) 526 memset((void __force *) addr, val, count);
527}
528static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
529{
530 memcpy(dst, (void __force *) src, count);
531}
532static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count)
533{
534 memcpy((void __force *) dst, src, count);
535}
482 536
483/* 537/*
484 * Memory Mapped I/O 538 * Memory Mapped I/O
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index 3f2470e9e678..8a342ccb34a8 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -24,11 +24,9 @@ static inline int irq_canonicalize(int irq)
24 24
25struct pt_regs; 25struct pt_regs;
26 26
27#ifdef CONFIG_PREEMPT
28
29extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs); 27extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs);
30 28
31#else 29#ifdef CONFIG_PREEMPT
32 30
33/* 31/*
34 * do_IRQ handles all normal device IRQ's (the special 32 * do_IRQ handles all normal device IRQ's (the special
diff --git a/include/asm-mips/jmr3927/jmr3927.h b/include/asm-mips/jmr3927/jmr3927.h
index 86df317b4078..baf412967afa 100644
--- a/include/asm-mips/jmr3927/jmr3927.h
+++ b/include/asm-mips/jmr3927/jmr3927.h
@@ -202,20 +202,6 @@ static inline int jmr3927_have_isac(void)
202#endif /* !__ASSEMBLY__ */ 202#endif /* !__ASSEMBLY__ */
203 203
204/* 204/*
205 * UART defines for serial.h
206 */
207
208/* use Pre-scaler T0 (1/2) */
209#define JMR3927_BASE_BAUD (JMR3927_IMCLK / 2 / 16)
210
211#define UART0_ADDR 0xfffef300
212#define UART1_ADDR 0xfffef400
213#define UART0_INT JMR3927_IRQ_IRC_SIO0
214#define UART1_INT JMR3927_IRQ_IRC_SIO1
215#define UART0_FLAGS ASYNC_BOOT_AUTOCONF
216#define UART1_FLAGS 0
217
218/*
219 * IRQ mappings 205 * IRQ mappings
220 */ 206 */
221 207
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h
index 148bae2fa7d3..8327ec341c18 100644
--- a/include/asm-mips/mach-au1x00/au1000.h
+++ b/include/asm-mips/mach-au1x00/au1000.h
@@ -60,59 +60,36 @@ void static inline au_sync_delay(int ms)
60 mdelay(ms); 60 mdelay(ms);
61} 61}
62 62
63void static inline au_writeb(u8 val, int reg) 63void static inline au_writeb(u8 val, unsigned long reg)
64{ 64{
65 *(volatile u8 *)(reg) = val; 65 *(volatile u8 *)(reg) = val;
66} 66}
67 67
68void static inline au_writew(u16 val, int reg) 68void static inline au_writew(u16 val, unsigned long reg)
69{ 69{
70 *(volatile u16 *)(reg) = val; 70 *(volatile u16 *)(reg) = val;
71} 71}
72 72
73void static inline au_writel(u32 val, int reg) 73void static inline au_writel(u32 val, unsigned long reg)
74{ 74{
75 *(volatile u32 *)(reg) = val; 75 *(volatile u32 *)(reg) = val;
76} 76}
77 77
78static inline u8 au_readb(unsigned long port) 78static inline u8 au_readb(unsigned long reg)
79{ 79{
80 return (*(volatile u8 *)port); 80 return (*(volatile u8 *)reg);
81} 81}
82 82
83static inline u16 au_readw(unsigned long port) 83static inline u16 au_readw(unsigned long reg)
84{ 84{
85 return (*(volatile u16 *)port); 85 return (*(volatile u16 *)reg);
86} 86}
87 87
88static inline u32 au_readl(unsigned long port) 88static inline u32 au_readl(unsigned long reg)
89{ 89{
90 return (*(volatile u32 *)port); 90 return (*(volatile u32 *)reg);
91} 91}
92 92
93/* These next three functions should be a generic part of the MIPS
94 * kernel (with the 'au_' removed from the name) and selected for
95 * processors that support the instructions.
96 * Taken from PPC tree. -- Dan
97 */
98/* Return the bit position of the most significant 1 bit in a word */
99static __inline__ int __ilog2(unsigned int x)
100{
101 int lz;
102
103 asm volatile (
104 ".set\tnoreorder\n\t"
105 ".set\tnoat\n\t"
106 ".set\tmips32\n\t"
107 "clz\t%0,%1\n\t"
108 ".set\tmips0\n\t"
109 ".set\tat\n\t"
110 ".set\treorder"
111 : "=r" (lz)
112 : "r" (x));
113
114 return 31 - lz;
115}
116 93
117static __inline__ int au_ffz(unsigned int x) 94static __inline__ int au_ffz(unsigned int x)
118{ 95{
@@ -162,28 +139,293 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
162#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5) 139#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
163#endif 140#endif
164 141
165/* SDRAM Controller */ 142/*
143 * SDRAM Register Offsets
144 */
166#if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1100) 145#if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1100)
167#define MEM_SDMODE0 0xB4000000 146#define MEM_SDMODE0 (0x0000)
168#define MEM_SDMODE1 0xB4000004 147#define MEM_SDMODE1 (0x0004)
169#define MEM_SDMODE2 0xB4000008 148#define MEM_SDMODE2 (0x0008)
149#define MEM_SDADDR0 (0x000C)
150#define MEM_SDADDR1 (0x0010)
151#define MEM_SDADDR2 (0x0014)
152#define MEM_SDREFCFG (0x0018)
153#define MEM_SDPRECMD (0x001C)
154#define MEM_SDAUTOREF (0x0020)
155#define MEM_SDWRMD0 (0x0024)
156#define MEM_SDWRMD1 (0x0028)
157#define MEM_SDWRMD2 (0x002C)
158#define MEM_SDSLEEP (0x0030)
159#define MEM_SDSMCKE (0x0034)
170 160
171#define MEM_SDADDR0 0xB400000C 161/*
172#define MEM_SDADDR1 0xB4000010 162 * MEM_SDMODE register content definitions
173#define MEM_SDADDR2 0xB4000014 163 */
164#define MEM_SDMODE_F (1<<22)
165#define MEM_SDMODE_SR (1<<21)
166#define MEM_SDMODE_BS (1<<20)
167#define MEM_SDMODE_RS (3<<18)
168#define MEM_SDMODE_CS (7<<15)
169#define MEM_SDMODE_TRAS (15<<11)
170#define MEM_SDMODE_TMRD (3<<9)
171#define MEM_SDMODE_TWR (3<<7)
172#define MEM_SDMODE_TRP (3<<5)
173#define MEM_SDMODE_TRCD (3<<3)
174#define MEM_SDMODE_TCL (7<<0)
175
176#define MEM_SDMODE_BS_2Bank (0<<20)
177#define MEM_SDMODE_BS_4Bank (1<<20)
178#define MEM_SDMODE_RS_11Row (0<<18)
179#define MEM_SDMODE_RS_12Row (1<<18)
180#define MEM_SDMODE_RS_13Row (2<<18)
181#define MEM_SDMODE_RS_N(N) ((N)<<18)
182#define MEM_SDMODE_CS_7Col (0<<15)
183#define MEM_SDMODE_CS_8Col (1<<15)
184#define MEM_SDMODE_CS_9Col (2<<15)
185#define MEM_SDMODE_CS_10Col (3<<15)
186#define MEM_SDMODE_CS_11Col (4<<15)
187#define MEM_SDMODE_CS_N(N) ((N)<<15)
188#define MEM_SDMODE_TRAS_N(N) ((N)<<11)
189#define MEM_SDMODE_TMRD_N(N) ((N)<<9)
190#define MEM_SDMODE_TWR_N(N) ((N)<<7)
191#define MEM_SDMODE_TRP_N(N) ((N)<<5)
192#define MEM_SDMODE_TRCD_N(N) ((N)<<3)
193#define MEM_SDMODE_TCL_N(N) ((N)<<0)
174 194
175#define MEM_SDREFCFG 0xB4000018 195/*
176#define MEM_SDPRECMD 0xB400001C 196 * MEM_SDADDR register contents definitions
177#define MEM_SDAUTOREF 0xB4000020 197 */
198#define MEM_SDADDR_E (1<<20)
199#define MEM_SDADDR_CSBA (0x03FF<<10)
200#define MEM_SDADDR_CSMASK (0x03FF<<0)
201#define MEM_SDADDR_CSBA_N(N) ((N)&(0x03FF<<22)>>12)
202#define MEM_SDADDR_CSMASK_N(N) ((N)&(0x03FF<<22)>>22)
203
204/*
205 * MEM_SDREFCFG register content definitions
206 */
207#define MEM_SDREFCFG_TRC (15<<28)
208#define MEM_SDREFCFG_TRPM (3<<26)
209#define MEM_SDREFCFG_E (1<<25)
210#define MEM_SDREFCFG_RE (0x1ffffff<<0)
211#define MEM_SDREFCFG_TRC_N(N) ((N)<<MEM_SDREFCFG_TRC)
212#define MEM_SDREFCFG_TRPM_N(N) ((N)<<MEM_SDREFCFG_TRPM)
213#define MEM_SDREFCFG_REF_N(N) (N)
214#endif
178 215
179#define MEM_SDWRMD0 0xB4000024 216/***********************************************************************/
180#define MEM_SDWRMD1 0xB4000028
181#define MEM_SDWRMD2 0xB400002C
182 217
183#define MEM_SDSLEEP 0xB4000030 218/*
184#define MEM_SDSMCKE 0xB4000034 219 * Au1550 SDRAM Register Offsets
220 */
221
222/***********************************************************************/
223
224#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
225#define MEM_SDMODE0 (0x0800)
226#define MEM_SDMODE1 (0x0808)
227#define MEM_SDMODE2 (0x0810)
228#define MEM_SDADDR0 (0x0820)
229#define MEM_SDADDR1 (0x0828)
230#define MEM_SDADDR2 (0x0830)
231#define MEM_SDCONFIGA (0x0840)
232#define MEM_SDCONFIGB (0x0848)
233#define MEM_SDSTAT (0x0850)
234#define MEM_SDERRADDR (0x0858)
235#define MEM_SDSTRIDE0 (0x0860)
236#define MEM_SDSTRIDE1 (0x0868)
237#define MEM_SDSTRIDE2 (0x0870)
238#define MEM_SDWRMD0 (0x0880)
239#define MEM_SDWRMD1 (0x0888)
240#define MEM_SDWRMD2 (0x0890)
241#define MEM_SDPRECMD (0x08C0)
242#define MEM_SDAUTOREF (0x08C8)
243#define MEM_SDSREF (0x08D0)
244#define MEM_SDSLEEP MEM_SDSREF
245
246#endif
247
248/*
249 * Physical base addresses for integrated peripherals
250 */
251
252#ifdef CONFIG_SOC_AU1000
253#define MEM_PHYS_ADDR 0x14000000
254#define STATIC_MEM_PHYS_ADDR 0x14001000
255#define DMA0_PHYS_ADDR 0x14002000
256#define DMA1_PHYS_ADDR 0x14002100
257#define DMA2_PHYS_ADDR 0x14002200
258#define DMA3_PHYS_ADDR 0x14002300
259#define DMA4_PHYS_ADDR 0x14002400
260#define DMA5_PHYS_ADDR 0x14002500
261#define DMA6_PHYS_ADDR 0x14002600
262#define DMA7_PHYS_ADDR 0x14002700
263#define IC0_PHYS_ADDR 0x10400000
264#define IC1_PHYS_ADDR 0x11800000
265#define AC97_PHYS_ADDR 0x10000000
266#define USBH_PHYS_ADDR 0x10100000
267#define USBD_PHYS_ADDR 0x10200000
268#define IRDA_PHYS_ADDR 0x10300000
269#define MAC0_PHYS_ADDR 0x10500000
270#define MAC1_PHYS_ADDR 0x10510000
271#define MACEN_PHYS_ADDR 0x10520000
272#define MACDMA0_PHYS_ADDR 0x14004000
273#define MACDMA1_PHYS_ADDR 0x14004200
274#define I2S_PHYS_ADDR 0x11000000
275#define UART0_PHYS_ADDR 0x11100000
276#define UART1_PHYS_ADDR 0x11200000
277#define UART2_PHYS_ADDR 0x11300000
278#define UART3_PHYS_ADDR 0x11400000
279#define SSI0_PHYS_ADDR 0x11600000
280#define SSI1_PHYS_ADDR 0x11680000
281#define SYS_PHYS_ADDR 0x11900000
282#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
283#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
284#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
185#endif 285#endif
186 286
287/********************************************************************/
288
289#ifdef CONFIG_SOC_AU1500
290#define MEM_PHYS_ADDR 0x14000000
291#define STATIC_MEM_PHYS_ADDR 0x14001000
292#define DMA0_PHYS_ADDR 0x14002000
293#define DMA1_PHYS_ADDR 0x14002100
294#define DMA2_PHYS_ADDR 0x14002200
295#define DMA3_PHYS_ADDR 0x14002300
296#define DMA4_PHYS_ADDR 0x14002400
297#define DMA5_PHYS_ADDR 0x14002500
298#define DMA6_PHYS_ADDR 0x14002600
299#define DMA7_PHYS_ADDR 0x14002700
300#define IC0_PHYS_ADDR 0x10400000
301#define IC1_PHYS_ADDR 0x11800000
302#define AC97_PHYS_ADDR 0x10000000
303#define USBH_PHYS_ADDR 0x10100000
304#define USBD_PHYS_ADDR 0x10200000
305#define PCI_PHYS_ADDR 0x14005000
306#define MAC0_PHYS_ADDR 0x11500000
307#define MAC1_PHYS_ADDR 0x11510000
308#define MACEN_PHYS_ADDR 0x11520000
309#define MACDMA0_PHYS_ADDR 0x14004000
310#define MACDMA1_PHYS_ADDR 0x14004200
311#define I2S_PHYS_ADDR 0x11000000
312#define UART0_PHYS_ADDR 0x11100000
313#define UART3_PHYS_ADDR 0x11400000
314#define GPIO2_PHYS_ADDR 0x11700000
315#define SYS_PHYS_ADDR 0x11900000
316#define PCI_MEM_PHYS_ADDR 0x400000000ULL
317#define PCI_IO_PHYS_ADDR 0x500000000ULL
318#define PCI_CONFIG0_PHYS_ADDR 0x600000000ULL
319#define PCI_CONFIG1_PHYS_ADDR 0x680000000ULL
320#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
321#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
322#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
323#endif
324
325/********************************************************************/
326
327#ifdef CONFIG_SOC_AU1100
328#define MEM_PHYS_ADDR 0x14000000
329#define STATIC_MEM_PHYS_ADDR 0x14001000
330#define DMA0_PHYS_ADDR 0x14002000
331#define DMA1_PHYS_ADDR 0x14002100
332#define DMA2_PHYS_ADDR 0x14002200
333#define DMA3_PHYS_ADDR 0x14002300
334#define DMA4_PHYS_ADDR 0x14002400
335#define DMA5_PHYS_ADDR 0x14002500
336#define DMA6_PHYS_ADDR 0x14002600
337#define DMA7_PHYS_ADDR 0x14002700
338#define IC0_PHYS_ADDR 0x10400000
339#define SD0_PHYS_ADDR 0x10600000
340#define SD1_PHYS_ADDR 0x10680000
341#define IC1_PHYS_ADDR 0x11800000
342#define AC97_PHYS_ADDR 0x10000000
343#define USBH_PHYS_ADDR 0x10100000
344#define USBD_PHYS_ADDR 0x10200000
345#define IRDA_PHYS_ADDR 0x10300000
346#define MAC0_PHYS_ADDR 0x10500000
347#define MACEN_PHYS_ADDR 0x10520000
348#define MACDMA0_PHYS_ADDR 0x14004000
349#define MACDMA1_PHYS_ADDR 0x14004200
350#define I2S_PHYS_ADDR 0x11000000
351#define UART0_PHYS_ADDR 0x11100000
352#define UART1_PHYS_ADDR 0x11200000
353#define UART3_PHYS_ADDR 0x11400000
354#define SSI0_PHYS_ADDR 0x11600000
355#define SSI1_PHYS_ADDR 0x11680000
356#define GPIO2_PHYS_ADDR 0x11700000
357#define SYS_PHYS_ADDR 0x11900000
358#define LCD_PHYS_ADDR 0x15000000
359#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
360#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
361#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
362#endif
363
364/***********************************************************************/
365
366#ifdef CONFIG_SOC_AU1550
367#define MEM_PHYS_ADDR 0x14000000
368#define STATIC_MEM_PHYS_ADDR 0x14001000
369#define IC0_PHYS_ADDR 0x10400000
370#define IC1_PHYS_ADDR 0x11800000
371#define USBH_PHYS_ADDR 0x14020000
372#define USBD_PHYS_ADDR 0x10200000
373#define PCI_PHYS_ADDR 0x14005000
374#define MAC0_PHYS_ADDR 0x10500000
375#define MAC1_PHYS_ADDR 0x10510000
376#define MACEN_PHYS_ADDR 0x10520000
377#define MACDMA0_PHYS_ADDR 0x14004000
378#define MACDMA1_PHYS_ADDR 0x14004200
379#define UART0_PHYS_ADDR 0x11100000
380#define UART1_PHYS_ADDR 0x11200000
381#define UART3_PHYS_ADDR 0x11400000
382#define GPIO2_PHYS_ADDR 0x11700000
383#define SYS_PHYS_ADDR 0x11900000
384#define DDMA_PHYS_ADDR 0x14002000
385#define PE_PHYS_ADDR 0x14008000
386#define PSC0_PHYS_ADDR 0x11A00000
387#define PSC1_PHYS_ADDR 0x11B00000
388#define PSC2_PHYS_ADDR 0x10A00000
389#define PSC3_PHYS_ADDR 0x10B00000
390#define PCI_MEM_PHYS_ADDR 0x400000000ULL
391#define PCI_IO_PHYS_ADDR 0x500000000ULL
392#define PCI_CONFIG0_PHYS_ADDR 0x600000000ULL
393#define PCI_CONFIG1_PHYS_ADDR 0x680000000ULL
394#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
395#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
396#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
397#endif
398
399/***********************************************************************/
400
401#ifdef CONFIG_SOC_AU1200
402#define MEM_PHYS_ADDR 0x14000000
403#define STATIC_MEM_PHYS_ADDR 0x14001000
404#define AES_PHYS_ADDR 0x10300000
405#define CIM_PHYS_ADDR 0x14004000
406#define IC0_PHYS_ADDR 0x10400000
407#define IC1_PHYS_ADDR 0x11800000
408#define USBM_PHYS_ADDR 0x14020000
409#define USBH_PHYS_ADDR 0x14020100
410#define UART0_PHYS_ADDR 0x11100000
411#define UART1_PHYS_ADDR 0x11200000
412#define GPIO2_PHYS_ADDR 0x11700000
413#define SYS_PHYS_ADDR 0x11900000
414#define DDMA_PHYS_ADDR 0x14002000
415#define PSC0_PHYS_ADDR 0x11A00000
416#define PSC1_PHYS_ADDR 0x11B00000
417#define SD0_PHYS_ADDR 0x10600000
418#define SD1_PHYS_ADDR 0x10680000
419#define LCD_PHYS_ADDR 0x15000000
420#define SWCNT_PHYS_ADDR 0x1110010C
421#define MAEFE_PHYS_ADDR 0x14012000
422#define MAEBE_PHYS_ADDR 0x14010000
423#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
424#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
425#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
426#endif
427
428
187/* Static Bus Controller */ 429/* Static Bus Controller */
188#define MEM_STCFG0 0xB4001000 430#define MEM_STCFG0 0xB4001000
189#define MEM_STTIME0 0xB4001004 431#define MEM_STTIME0 0xB4001004
@@ -369,7 +611,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
369#define AU1000_MAC0_ENABLE 0xB0520000 611#define AU1000_MAC0_ENABLE 0xB0520000
370#define AU1000_MAC1_ENABLE 0xB0520004 612#define AU1000_MAC1_ENABLE 0xB0520004
371#define NUM_ETH_INTERFACES 2 613#define NUM_ETH_INTERFACES 2
372#endif // CONFIG_SOC_AU1000 614#endif /* CONFIG_SOC_AU1000 */
373 615
374/* Au1500 */ 616/* Au1500 */
375#ifdef CONFIG_SOC_AU1500 617#ifdef CONFIG_SOC_AU1500
@@ -429,6 +671,12 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
429#define AU1500_GPIO_207 62 671#define AU1500_GPIO_207 62
430#define AU1500_GPIO_208_215 63 672#define AU1500_GPIO_208_215 63
431 673
674/* shortcuts */
675#define INTA AU1000_PCI_INTA
676#define INTB AU1000_PCI_INTB
677#define INTC AU1000_PCI_INTC
678#define INTD AU1000_PCI_INTD
679
432#define UART0_ADDR 0xB1100000 680#define UART0_ADDR 0xB1100000
433#define UART3_ADDR 0xB1400000 681#define UART3_ADDR 0xB1400000
434 682
@@ -440,7 +688,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
440#define AU1500_MAC0_ENABLE 0xB1520000 688#define AU1500_MAC0_ENABLE 0xB1520000
441#define AU1500_MAC1_ENABLE 0xB1520004 689#define AU1500_MAC1_ENABLE 0xB1520004
442#define NUM_ETH_INTERFACES 2 690#define NUM_ETH_INTERFACES 2
443#endif // CONFIG_SOC_AU1500 691#endif /* CONFIG_SOC_AU1500 */
444 692
445/* Au1100 */ 693/* Au1100 */
446#ifdef CONFIG_SOC_AU1100 694#ifdef CONFIG_SOC_AU1100
@@ -485,6 +733,22 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
485#define AU1000_GPIO_13 45 733#define AU1000_GPIO_13 45
486#define AU1000_GPIO_14 46 734#define AU1000_GPIO_14 46
487#define AU1000_GPIO_15 47 735#define AU1000_GPIO_15 47
736#define AU1000_GPIO_16 48
737#define AU1000_GPIO_17 49
738#define AU1000_GPIO_18 50
739#define AU1000_GPIO_19 51
740#define AU1000_GPIO_20 52
741#define AU1000_GPIO_21 53
742#define AU1000_GPIO_22 54
743#define AU1000_GPIO_23 55
744#define AU1000_GPIO_24 56
745#define AU1000_GPIO_25 57
746#define AU1000_GPIO_26 58
747#define AU1000_GPIO_27 59
748#define AU1000_GPIO_28 60
749#define AU1000_GPIO_29 61
750#define AU1000_GPIO_30 62
751#define AU1000_GPIO_31 63
488 752
489#define UART0_ADDR 0xB1100000 753#define UART0_ADDR 0xB1100000
490#define UART1_ADDR 0xB1200000 754#define UART1_ADDR 0xB1200000
@@ -496,7 +760,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
496#define AU1100_ETH0_BASE 0xB0500000 760#define AU1100_ETH0_BASE 0xB0500000
497#define AU1100_MAC0_ENABLE 0xB0520000 761#define AU1100_MAC0_ENABLE 0xB0520000
498#define NUM_ETH_INTERFACES 1 762#define NUM_ETH_INTERFACES 1
499#endif // CONFIG_SOC_AU1100 763#endif /* CONFIG_SOC_AU1100 */
500 764
501#ifdef CONFIG_SOC_AU1550 765#ifdef CONFIG_SOC_AU1550
502#define AU1550_UART0_INT 0 766#define AU1550_UART0_INT 0
@@ -513,14 +777,14 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
513#define AU1550_PSC1_INT 11 777#define AU1550_PSC1_INT 11
514#define AU1550_PSC2_INT 12 778#define AU1550_PSC2_INT 12
515#define AU1550_PSC3_INT 13 779#define AU1550_PSC3_INT 13
516#define AU1550_TOY_INT 14 780#define AU1000_TOY_INT 14
517#define AU1550_TOY_MATCH0_INT 15 781#define AU1000_TOY_MATCH0_INT 15
518#define AU1550_TOY_MATCH1_INT 16 782#define AU1000_TOY_MATCH1_INT 16
519#define AU1550_TOY_MATCH2_INT 17 783#define AU1000_TOY_MATCH2_INT 17
520#define AU1550_RTC_INT 18 784#define AU1000_RTC_INT 18
521#define AU1550_RTC_MATCH0_INT 19 785#define AU1000_RTC_MATCH0_INT 19
522#define AU1550_RTC_MATCH1_INT 20 786#define AU1000_RTC_MATCH1_INT 20
523#define AU1550_RTC_MATCH2_INT 21 787#define AU1000_RTC_MATCH2_INT 21
524#define AU1550_NAND_INT 23 788#define AU1550_NAND_INT 23
525#define AU1550_USB_DEV_REQ_INT 24 789#define AU1550_USB_DEV_REQ_INT 24
526#define AU1550_USB_DEV_SUS_INT 25 790#define AU1550_USB_DEV_SUS_INT 25
@@ -563,6 +827,12 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
563#define AU1500_GPIO_207 62 827#define AU1500_GPIO_207 62
564#define AU1500_GPIO_208_218 63 // Logical or of GPIO208:218 828#define AU1500_GPIO_208_218 63 // Logical or of GPIO208:218
565 829
830/* shortcuts */
831#define INTA AU1550_PCI_INTA
832#define INTB AU1550_PCI_INTB
833#define INTC AU1550_PCI_INTC
834#define INTD AU1550_PCI_INTD
835
566#define UART0_ADDR 0xB1100000 836#define UART0_ADDR 0xB1100000
567#define UART1_ADDR 0xB1200000 837#define UART1_ADDR 0xB1200000
568#define UART3_ADDR 0xB1400000 838#define UART3_ADDR 0xB1400000
@@ -575,7 +845,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
575#define AU1550_MAC0_ENABLE 0xB0520000 845#define AU1550_MAC0_ENABLE 0xB0520000
576#define AU1550_MAC1_ENABLE 0xB0520004 846#define AU1550_MAC1_ENABLE 0xB0520004
577#define NUM_ETH_INTERFACES 2 847#define NUM_ETH_INTERFACES 2
578#endif // CONFIG_SOC_AU1550 848#endif /* CONFIG_SOC_AU1550 */
579 849
580#ifdef CONFIG_SOC_AU1200 850#ifdef CONFIG_SOC_AU1200
581#define AU1200_UART0_INT 0 851#define AU1200_UART0_INT 0
@@ -592,14 +862,14 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
592#define AU1200_PSC1_INT 11 862#define AU1200_PSC1_INT 11
593#define AU1200_AES_INT 12 863#define AU1200_AES_INT 12
594#define AU1200_CAMERA_INT 13 864#define AU1200_CAMERA_INT 13
595#define AU1200_TOY_INT 14 865#define AU1000_TOY_INT 14
596#define AU1200_TOY_MATCH0_INT 15 866#define AU1000_TOY_MATCH0_INT 15
597#define AU1200_TOY_MATCH1_INT 16 867#define AU1000_TOY_MATCH1_INT 16
598#define AU1200_TOY_MATCH2_INT 17 868#define AU1000_TOY_MATCH2_INT 17
599#define AU1200_RTC_INT 18 869#define AU1000_RTC_INT 18
600#define AU1200_RTC_MATCH0_INT 19 870#define AU1000_RTC_MATCH0_INT 19
601#define AU1200_RTC_MATCH1_INT 20 871#define AU1000_RTC_MATCH1_INT 20
602#define AU1200_RTC_MATCH2_INT 21 872#define AU1000_RTC_MATCH2_INT 21
603#define AU1200_NAND_INT 23 873#define AU1200_NAND_INT 23
604#define AU1200_GPIO_204 24 874#define AU1200_GPIO_204 24
605#define AU1200_GPIO_205 25 875#define AU1200_GPIO_205 25
@@ -607,6 +877,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
607#define AU1200_GPIO_207 27 877#define AU1200_GPIO_207 27
608#define AU1200_GPIO_208_215 28 // Logical OR of 208:215 878#define AU1200_GPIO_208_215 28 // Logical OR of 208:215
609#define AU1200_USB_INT 29 879#define AU1200_USB_INT 29
880#define AU1000_USB_HOST_INT AU1200_USB_INT
610#define AU1200_LCD_INT 30 881#define AU1200_LCD_INT 30
611#define AU1200_MAE_BOTH_INT 31 882#define AU1200_MAE_BOTH_INT 31
612#define AU1000_GPIO_0 32 883#define AU1000_GPIO_0 32
@@ -645,20 +916,36 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
645#define UART0_ADDR 0xB1100000 916#define UART0_ADDR 0xB1100000
646#define UART1_ADDR 0xB1200000 917#define UART1_ADDR 0xB1200000
647 918
648#define USB_OHCI_BASE 0x14020000 // phys addr for ioremap 919#define USB_UOC_BASE 0x14020020
649#define USB_HOST_CONFIG 0xB4027ffc 920#define USB_UOC_LEN 0x20
650 921#define USB_OHCI_BASE 0x14020100
651// these are here for prototyping on au1550 (do not exist on au1200) 922#define USB_OHCI_LEN 0x100
652#define AU1200_ETH0_BASE 0xB0500000 923#define USB_EHCI_BASE 0x14020200
653#define AU1200_ETH1_BASE 0xB0510000 924#define USB_EHCI_LEN 0x100
654#define AU1200_MAC0_ENABLE 0xB0520000 925#define USB_UDC_BASE 0x14022000
655#define AU1200_MAC1_ENABLE 0xB0520004 926#define USB_UDC_LEN 0x2000
656#define NUM_ETH_INTERFACES 2 927#define USB_MSR_BASE 0xB4020000
657#endif // CONFIG_SOC_AU1200 928#define USB_MSR_MCFG 4
929#define USBMSRMCFG_OMEMEN 0
930#define USBMSRMCFG_OBMEN 1
931#define USBMSRMCFG_EMEMEN 2
932#define USBMSRMCFG_EBMEN 3
933#define USBMSRMCFG_DMEMEN 4
934#define USBMSRMCFG_DBMEN 5
935#define USBMSRMCFG_GMEMEN 6
936#define USBMSRMCFG_OHCCLKEN 16
937#define USBMSRMCFG_EHCCLKEN 17
938#define USBMSRMCFG_UDCCLKEN 18
939#define USBMSRMCFG_PHYPLLEN 19
940#define USBMSRMCFG_RDCOMB 30
941#define USBMSRMCFG_PFEN 31
942
943#endif /* CONFIG_SOC_AU1200 */
658 944
659#define AU1000_LAST_INTC0_INT 31 945#define AU1000_LAST_INTC0_INT 31
946#define AU1000_LAST_INTC1_INT 63
660#define AU1000_MAX_INTR 63 947#define AU1000_MAX_INTR 63
661 948#define INTX 0xFF /* not valid */
662 949
663/* Programmable Counters 0 and 1 */ 950/* Programmable Counters 0 and 1 */
664#define SYS_BASE 0xB1900000 951#define SYS_BASE 0xB1900000
@@ -730,6 +1017,8 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
730 #define I2S_CONTROL_D (1<<1) 1017 #define I2S_CONTROL_D (1<<1)
731 #define I2S_CONTROL_CE (1<<0) 1018 #define I2S_CONTROL_CE (1<<0)
732 1019
1020#ifndef CONFIG_SOC_AU1200
1021
733/* USB Host Controller */ 1022/* USB Host Controller */
734#define USB_OHCI_LEN 0x00100000 1023#define USB_OHCI_LEN 0x00100000
735 1024
@@ -775,6 +1064,8 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
775 #define USBDEV_ENABLE (1<<1) 1064 #define USBDEV_ENABLE (1<<1)
776 #define USBDEV_CE (1<<0) 1065 #define USBDEV_CE (1<<0)
777 1066
1067#endif /* !CONFIG_SOC_AU1200 */
1068
778/* Ethernet Controllers */ 1069/* Ethernet Controllers */
779 1070
780/* 4 byte offsets from AU1000_ETH_BASE */ 1071/* 4 byte offsets from AU1000_ETH_BASE */
@@ -1173,6 +1464,37 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
1173 #define SYS_PF_PSC1_S1 (1 << 1) 1464 #define SYS_PF_PSC1_S1 (1 << 1)
1174 #define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2)) 1465 #define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2))
1175 1466
1467/* Au1200 Only */
1468#ifdef CONFIG_SOC_AU1200
1469#define SYS_PINFUNC_DMA (1<<31)
1470#define SYS_PINFUNC_S0A (1<<30)
1471#define SYS_PINFUNC_S1A (1<<29)
1472#define SYS_PINFUNC_LP0 (1<<28)
1473#define SYS_PINFUNC_LP1 (1<<27)
1474#define SYS_PINFUNC_LD16 (1<<26)
1475#define SYS_PINFUNC_LD8 (1<<25)
1476#define SYS_PINFUNC_LD1 (1<<24)
1477#define SYS_PINFUNC_LD0 (1<<23)
1478#define SYS_PINFUNC_P1A (3<<21)
1479#define SYS_PINFUNC_P1B (1<<20)
1480#define SYS_PINFUNC_FS3 (1<<19)
1481#define SYS_PINFUNC_P0A (3<<17)
1482#define SYS_PINFUNC_CS (1<<16)
1483#define SYS_PINFUNC_CIM (1<<15)
1484#define SYS_PINFUNC_P1C (1<<14)
1485#define SYS_PINFUNC_U1T (1<<12)
1486#define SYS_PINFUNC_U1R (1<<11)
1487#define SYS_PINFUNC_EX1 (1<<10)
1488#define SYS_PINFUNC_EX0 (1<<9)
1489#define SYS_PINFUNC_U0R (1<<8)
1490#define SYS_PINFUNC_MC (1<<7)
1491#define SYS_PINFUNC_S0B (1<<6)
1492#define SYS_PINFUNC_S0C (1<<5)
1493#define SYS_PINFUNC_P0B (1<<4)
1494#define SYS_PINFUNC_U0T (1<<3)
1495#define SYS_PINFUNC_S1B (1<<2)
1496#endif
1497
1176#define SYS_TRIOUTRD 0xB1900100 1498#define SYS_TRIOUTRD 0xB1900100
1177#define SYS_TRIOUTCLR 0xB1900100 1499#define SYS_TRIOUTCLR 0xB1900100
1178#define SYS_OUTPUTRD 0xB1900108 1500#define SYS_OUTPUTRD 0xB1900108
@@ -1239,6 +1561,12 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
1239 #define SYS_CS_MI2_MASK (0x7<<SYS_CS_MI2_BIT) 1561 #define SYS_CS_MI2_MASK (0x7<<SYS_CS_MI2_BIT)
1240 #define SYS_CS_DI2 (1<<16) 1562 #define SYS_CS_DI2 (1<<16)
1241 #define SYS_CS_CI2 (1<<15) 1563 #define SYS_CS_CI2 (1<<15)
1564#ifdef CONFIG_SOC_AU1100
1565 #define SYS_CS_ML_BIT 7
1566 #define SYS_CS_ML_MASK (0x7<<SYS_CS_ML_BIT)
1567 #define SYS_CS_DL (1<<6)
1568 #define SYS_CS_CL (1<<5)
1569#else
1242 #define SYS_CS_MUH_BIT 12 1570 #define SYS_CS_MUH_BIT 12
1243 #define SYS_CS_MUH_MASK (0x7<<SYS_CS_MUH_BIT) 1571 #define SYS_CS_MUH_MASK (0x7<<SYS_CS_MUH_BIT)
1244 #define SYS_CS_DUH (1<<11) 1572 #define SYS_CS_DUH (1<<11)
@@ -1247,6 +1575,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
1247 #define SYS_CS_MUD_MASK (0x7<<SYS_CS_MUD_BIT) 1575 #define SYS_CS_MUD_MASK (0x7<<SYS_CS_MUD_BIT)
1248 #define SYS_CS_DUD (1<<6) 1576 #define SYS_CS_DUD (1<<6)
1249 #define SYS_CS_CUD (1<<5) 1577 #define SYS_CS_CUD (1<<5)
1578#endif
1250 #define SYS_CS_MIR_BIT 2 1579 #define SYS_CS_MIR_BIT 2
1251 #define SYS_CS_MIR_MASK (0x7<<SYS_CS_MIR_BIT) 1580 #define SYS_CS_MIR_MASK (0x7<<SYS_CS_MIR_BIT)
1252 #define SYS_CS_DIR (1<<1) 1581 #define SYS_CS_DIR (1<<1)
@@ -1300,7 +1629,6 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
1300#define SD1_XMIT_FIFO 0xB0680000 1629#define SD1_XMIT_FIFO 0xB0680000
1301#define SD1_RECV_FIFO 0xB0680004 1630#define SD1_RECV_FIFO 0xB0680004
1302 1631
1303
1304#if defined (CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550) 1632#if defined (CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
1305/* Au1500 PCI Controller */ 1633/* Au1500 PCI Controller */
1306#define Au1500_CFG_BASE 0xB4005000 // virtual, kseg0 addr 1634#define Au1500_CFG_BASE 0xB4005000 // virtual, kseg0 addr
@@ -1363,36 +1691,77 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
1363 _ctl_; }) 1691 _ctl_; })
1364 1692
1365 1693
1366#else /* Au1000 and Au1100 */ 1694#else /* Au1000 and Au1100 and Au1200 */
1367 1695
1368/* don't allow any legacy ports probing */ 1696/* don't allow any legacy ports probing */
1369#define IOPORT_RESOURCE_START 0x10000000; 1697#define IOPORT_RESOURCE_START 0x10000000
1370#define IOPORT_RESOURCE_END 0xffffffff 1698#define IOPORT_RESOURCE_END 0xffffffff
1371#define IOMEM_RESOURCE_START 0x10000000 1699#define IOMEM_RESOURCE_START 0x10000000
1372#define IOMEM_RESOURCE_END 0xffffffff 1700#define IOMEM_RESOURCE_END 0xffffffff
1373 1701
1374#ifdef CONFIG_MIPS_PB1000
1375#define PCI_IO_START 0x10000000
1376#define PCI_IO_END 0x1000ffff
1377#define PCI_MEM_START 0x18000000
1378#define PCI_MEM_END 0x18ffffff
1379#define PCI_FIRST_DEVFN 0
1380#define PCI_LAST_DEVFN 1
1381#else
1382/* no PCI bus controller */
1383#define PCI_IO_START 0 1702#define PCI_IO_START 0
1384#define PCI_IO_END 0 1703#define PCI_IO_END 0
1385#define PCI_MEM_START 0 1704#define PCI_MEM_START 0
1386#define PCI_MEM_END 0 1705#define PCI_MEM_END 0
1387#define PCI_FIRST_DEVFN 0 1706#define PCI_FIRST_DEVFN 0
1388#define PCI_LAST_DEVFN 0 1707#define PCI_LAST_DEVFN 0
1389#endif
1390 1708
1391#endif 1709#endif
1392 1710
1711#ifndef _LANGUAGE_ASSEMBLY
1712typedef volatile struct
1713{
1714 /* 0x0000 */ u32 toytrim;
1715 /* 0x0004 */ u32 toywrite;
1716 /* 0x0008 */ u32 toymatch0;
1717 /* 0x000C */ u32 toymatch1;
1718 /* 0x0010 */ u32 toymatch2;
1719 /* 0x0014 */ u32 cntrctrl;
1720 /* 0x0018 */ u32 scratch0;
1721 /* 0x001C */ u32 scratch1;
1722 /* 0x0020 */ u32 freqctrl0;
1723 /* 0x0024 */ u32 freqctrl1;
1724 /* 0x0028 */ u32 clksrc;
1725 /* 0x002C */ u32 pinfunc;
1726 /* 0x0030 */ u32 reserved0;
1727 /* 0x0034 */ u32 wakemsk;
1728 /* 0x0038 */ u32 endian;
1729 /* 0x003C */ u32 powerctrl;
1730 /* 0x0040 */ u32 toyread;
1731 /* 0x0044 */ u32 rtctrim;
1732 /* 0x0048 */ u32 rtcwrite;
1733 /* 0x004C */ u32 rtcmatch0;
1734 /* 0x0050 */ u32 rtcmatch1;
1735 /* 0x0054 */ u32 rtcmatch2;
1736 /* 0x0058 */ u32 rtcread;
1737 /* 0x005C */ u32 wakesrc;
1738 /* 0x0060 */ u32 cpupll;
1739 /* 0x0064 */ u32 auxpll;
1740 /* 0x0068 */ u32 reserved1;
1741 /* 0x006C */ u32 reserved2;
1742 /* 0x0070 */ u32 reserved3;
1743 /* 0x0074 */ u32 reserved4;
1744 /* 0x0078 */ u32 slppwr;
1745 /* 0x007C */ u32 sleep;
1746 /* 0x0080 */ u32 reserved5[32];
1747 /* 0x0100 */ u32 trioutrd;
1748#define trioutclr trioutrd
1749 /* 0x0104 */ u32 reserved6;
1750 /* 0x0108 */ u32 outputrd;
1751#define outputset outputrd
1752 /* 0x010C */ u32 outputclr;
1753 /* 0x0110 */ u32 pinstaterd;
1754#define pininputen pinstaterd
1755
1756} AU1X00_SYS;
1757
1758static AU1X00_SYS* const sys = (AU1X00_SYS *)SYS_BASE;
1759
1760#endif
1393/* Processor information base on prid. 1761/* Processor information base on prid.
1394 * Copied from PowerPC. 1762 * Copied from PowerPC.
1395 */ 1763 */
1764#ifndef _LANGUAGE_ASSEMBLY
1396struct cpu_spec { 1765struct cpu_spec {
1397 /* CPU is matched via (PRID & prid_mask) == prid_value */ 1766 /* CPU is matched via (PRID & prid_mask) == prid_value */
1398 unsigned int prid_mask; 1767 unsigned int prid_mask;
@@ -1406,3 +1775,6 @@ struct cpu_spec {
1406extern struct cpu_spec cpu_specs[]; 1775extern struct cpu_spec cpu_specs[];
1407extern struct cpu_spec *cur_cpu_spec[]; 1776extern struct cpu_spec *cur_cpu_spec[];
1408#endif 1777#endif
1778
1779#endif
1780
diff --git a/include/asm-mips/mach-au1x00/au1xxx.h b/include/asm-mips/mach-au1x00/au1xxx.h
new file mode 100644
index 000000000000..b7b46dd9b929
--- /dev/null
+++ b/include/asm-mips/mach-au1x00/au1xxx.h
@@ -0,0 +1,44 @@
1/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the License, or (at your
5 * option) any later version.
6 *
7 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
11 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
12 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
13 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
14 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
16 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#ifndef _AU1XXX_H_
24#define _AU1XXX_H_
25
26#include <linux/config.h>
27
28#include <asm/mach-au1x00/au1000.h>
29
30#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550)
31#include <asm/mach-db1x00/db1x00.h>
32
33#elif defined(CONFIG_MIPS_PB1550)
34#include <asm/mach-pb1x00/pb1550.h>
35
36#elif defined(CONFIG_MIPS_PB1200)
37#include <asm/mach-pb1x00/pb1200.h>
38
39#elif defined(CONFIG_MIPS_DB1200)
40#include <asm/mach-db1x00/db1200.h>
41
42#endif
43
44#endif /* _AU1XXX_H_ */
diff --git a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h b/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
index d5eb88cd7d51..b327bcd3fee1 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
@@ -45,7 +45,7 @@
45#define DDMA_GLOBAL_BASE 0xb4003000 45#define DDMA_GLOBAL_BASE 0xb4003000
46#define DDMA_CHANNEL_BASE 0xb4002000 46#define DDMA_CHANNEL_BASE 0xb4002000
47 47
48typedef struct dbdma_global { 48typedef volatile struct dbdma_global {
49 u32 ddma_config; 49 u32 ddma_config;
50 u32 ddma_intstat; 50 u32 ddma_intstat;
51 u32 ddma_throttle; 51 u32 ddma_throttle;
@@ -62,7 +62,7 @@ typedef struct dbdma_global {
62 62
63/* The structure of a DMA Channel. 63/* The structure of a DMA Channel.
64*/ 64*/
65typedef struct au1xxx_dma_channel { 65typedef volatile struct au1xxx_dma_channel {
66 u32 ddma_cfg; /* See below */ 66 u32 ddma_cfg; /* See below */
67 u32 ddma_desptr; /* 32-byte aligned pointer to descriptor */ 67 u32 ddma_desptr; /* 32-byte aligned pointer to descriptor */
68 u32 ddma_statptr; /* word aligned pointer to status word */ 68 u32 ddma_statptr; /* word aligned pointer to status word */
@@ -98,7 +98,7 @@ typedef struct au1xxx_dma_channel {
98/* "Standard" DDMA Descriptor. 98/* "Standard" DDMA Descriptor.
99 * Must be 32-byte aligned. 99 * Must be 32-byte aligned.
100 */ 100 */
101typedef struct au1xxx_ddma_desc { 101typedef volatile struct au1xxx_ddma_desc {
102 u32 dscr_cmd0; /* See below */ 102 u32 dscr_cmd0; /* See below */
103 u32 dscr_cmd1; /* See below */ 103 u32 dscr_cmd1; /* See below */
104 u32 dscr_source0; /* source phys address */ 104 u32 dscr_source0; /* source phys address */
@@ -107,6 +107,12 @@ typedef struct au1xxx_ddma_desc {
107 u32 dscr_dest1; /* See below */ 107 u32 dscr_dest1; /* See below */
108 u32 dscr_stat; /* completion status */ 108 u32 dscr_stat; /* completion status */
109 u32 dscr_nxtptr; /* Next descriptor pointer (mostly) */ 109 u32 dscr_nxtptr; /* Next descriptor pointer (mostly) */
110 /* First 32bytes are HW specific!!!
111 Lets have some SW data following.. make sure its 32bytes
112 */
113 u32 sw_status;
114 u32 sw_context;
115 u32 sw_reserved[6];
110} au1x_ddma_desc_t; 116} au1x_ddma_desc_t;
111 117
112#define DSCR_CMD0_V (1 << 31) /* Descriptor valid */ 118#define DSCR_CMD0_V (1 << 31) /* Descriptor valid */
@@ -125,8 +131,11 @@ typedef struct au1xxx_ddma_desc {
125#define DSCR_CMD0_CV (0x1 << 2) /* Clear Valid when done */ 131#define DSCR_CMD0_CV (0x1 << 2) /* Clear Valid when done */
126#define DSCR_CMD0_ST_MASK (0x3 << 0) /* Status instruction */ 132#define DSCR_CMD0_ST_MASK (0x3 << 0) /* Status instruction */
127 133
134#define SW_STATUS_INUSE (1<<0)
135
128/* Command 0 device IDs. 136/* Command 0 device IDs.
129*/ 137*/
138#ifdef CONFIG_SOC_AU1550
130#define DSCR_CMD0_UART0_TX 0 139#define DSCR_CMD0_UART0_TX 0
131#define DSCR_CMD0_UART0_RX 1 140#define DSCR_CMD0_UART0_RX 1
132#define DSCR_CMD0_UART3_TX 2 141#define DSCR_CMD0_UART3_TX 2
@@ -155,9 +164,45 @@ typedef struct au1xxx_ddma_desc {
155#define DSCR_CMD0_MAC0_TX 25 164#define DSCR_CMD0_MAC0_TX 25
156#define DSCR_CMD0_MAC1_RX 26 165#define DSCR_CMD0_MAC1_RX 26
157#define DSCR_CMD0_MAC1_TX 27 166#define DSCR_CMD0_MAC1_TX 27
167#endif /* CONFIG_SOC_AU1550 */
168
169#ifdef CONFIG_SOC_AU1200
170#define DSCR_CMD0_UART0_TX 0
171#define DSCR_CMD0_UART0_RX 1
172#define DSCR_CMD0_UART1_TX 2
173#define DSCR_CMD0_UART1_RX 3
174#define DSCR_CMD0_DMA_REQ0 4
175#define DSCR_CMD0_DMA_REQ1 5
176#define DSCR_CMD0_MAE_BE 6
177#define DSCR_CMD0_MAE_FE 7
178#define DSCR_CMD0_SDMS_TX0 8
179#define DSCR_CMD0_SDMS_RX0 9
180#define DSCR_CMD0_SDMS_TX1 10
181#define DSCR_CMD0_SDMS_RX1 11
182#define DSCR_CMD0_AES_TX 13
183#define DSCR_CMD0_AES_RX 12
184#define DSCR_CMD0_PSC0_TX 14
185#define DSCR_CMD0_PSC0_RX 15
186#define DSCR_CMD0_PSC1_TX 16
187#define DSCR_CMD0_PSC1_RX 17
188#define DSCR_CMD0_CIM_RXA 18
189#define DSCR_CMD0_CIM_RXB 19
190#define DSCR_CMD0_CIM_RXC 20
191#define DSCR_CMD0_MAE_BOTH 21
192#define DSCR_CMD0_LCD 22
193#define DSCR_CMD0_NAND_FLASH 23
194#define DSCR_CMD0_PSC0_SYNC 24
195#define DSCR_CMD0_PSC1_SYNC 25
196#define DSCR_CMD0_CIM_SYNC 26
197#endif /* CONFIG_SOC_AU1200 */
198
158#define DSCR_CMD0_THROTTLE 30 199#define DSCR_CMD0_THROTTLE 30
159#define DSCR_CMD0_ALWAYS 31 200#define DSCR_CMD0_ALWAYS 31
160#define DSCR_NDEV_IDS 32 201#define DSCR_NDEV_IDS 32
202/* THis macro is used to find/create custom device types */
203#define DSCR_DEV2CUSTOM_ID(x,d) (((((x)&0xFFFF)<<8)|0x32000000)|((d)&0xFF))
204#define DSCR_CUSTOM2DEV_ID(x) ((x)&0xFF)
205
161 206
162#define DSCR_CMD0_SID(x) (((x) & 0x1f) << 25) 207#define DSCR_CMD0_SID(x) (((x) & 0x1f) << 25)
163#define DSCR_CMD0_DID(x) (((x) & 0x1f) << 20) 208#define DSCR_CMD0_DID(x) (((x) & 0x1f) << 20)
@@ -246,6 +291,43 @@ typedef struct au1xxx_ddma_desc {
246*/ 291*/
247#define NUM_DBDMA_CHANS 16 292#define NUM_DBDMA_CHANS 16
248 293
294/*
295 * Ddma API definitions
296 * FIXME: may not fit to this header file
297 */
298typedef struct dbdma_device_table {
299 u32 dev_id;
300 u32 dev_flags;
301 u32 dev_tsize;
302 u32 dev_devwidth;
303 u32 dev_physaddr; /* If FIFO */
304 u32 dev_intlevel;
305 u32 dev_intpolarity;
306} dbdev_tab_t;
307
308
309typedef struct dbdma_chan_config {
310 spinlock_t lock;
311
312 u32 chan_flags;
313 u32 chan_index;
314 dbdev_tab_t *chan_src;
315 dbdev_tab_t *chan_dest;
316 au1x_dma_chan_t *chan_ptr;
317 au1x_ddma_desc_t *chan_desc_base;
318 au1x_ddma_desc_t *get_ptr, *put_ptr, *cur_ptr;
319 void *chan_callparam;
320 void (*chan_callback)(int, void *, struct pt_regs *);
321} chan_tab_t;
322
323#define DEV_FLAGS_INUSE (1 << 0)
324#define DEV_FLAGS_ANYUSE (1 << 1)
325#define DEV_FLAGS_OUT (1 << 2)
326#define DEV_FLAGS_IN (1 << 3)
327#define DEV_FLAGS_BURSTABLE (1 << 4)
328#define DEV_FLAGS_SYNC (1 << 5)
329/* end Ddma API definitions */
330
249/* External functions for drivers to use. 331/* External functions for drivers to use.
250*/ 332*/
251/* Use this to allocate a dbdma channel. The device ids are one of the 333/* Use this to allocate a dbdma channel. The device ids are one of the
@@ -258,18 +340,6 @@ u32 au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
258 340
259#define DBDMA_MEM_CHAN DSCR_CMD0_ALWAYS 341#define DBDMA_MEM_CHAN DSCR_CMD0_ALWAYS
260 342
261/* ACK! These should be in a board specific description file.
262*/
263#ifdef CONFIG_MIPS_PB1550
264#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
265#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
266#endif
267#ifdef CONFIG_MIPS_DB1550
268#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
269#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
270#endif
271
272
273/* Set the device width of a in/out fifo. 343/* Set the device width of a in/out fifo.
274*/ 344*/
275u32 au1xxx_dbdma_set_devwidth(u32 chanid, int bits); 345u32 au1xxx_dbdma_set_devwidth(u32 chanid, int bits);
@@ -280,8 +350,8 @@ u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries);
280 350
281/* Put buffers on source/destination descriptors. 351/* Put buffers on source/destination descriptors.
282*/ 352*/
283u32 au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes); 353u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags);
284u32 au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes); 354u32 _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags);
285 355
286/* Get a buffer from the destination descriptor. 356/* Get a buffer from the destination descriptor.
287*/ 357*/
@@ -295,5 +365,29 @@ u32 au1xxx_get_dma_residue(u32 chanid);
295void au1xxx_dbdma_chan_free(u32 chanid); 365void au1xxx_dbdma_chan_free(u32 chanid);
296void au1xxx_dbdma_dump(u32 chanid); 366void au1xxx_dbdma_dump(u32 chanid);
297 367
368u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr );
369
370u32 au1xxx_ddma_add_device( dbdev_tab_t *dev );
371void * au1xxx_ddma_get_nextptr_virt(au1x_ddma_desc_t *dp);
372
373/*
374 Some compatibilty macros --
375 Needed to make changes to API without breaking existing drivers
376*/
377#define au1xxx_dbdma_put_source(chanid,buf,nbytes)_au1xxx_dbdma_put_source(chanid, buf, nbytes, DDMA_FLAGS_IE)
378#define au1xxx_dbdma_put_source_flags(chanid,buf,nbytes,flags) _au1xxx_dbdma_put_source(chanid, buf, nbytes, flags)
379#define put_source_flags(chanid,buf,nbytes,flags) au1xxx_dbdma_put_source_flags(chanid,buf,nbytes,flags)
380
381
382#define au1xxx_dbdma_put_dest(chanid,buf,nbytes) _au1xxx_dbdma_put_dest(chanid, buf, nbytes, DDMA_FLAGS_IE)
383#define au1xxx_dbdma_put_dest_flags(chanid,buf,nbytes,flags) _au1xxx_dbdma_put_dest(chanid, buf, nbytes, flags)
384#define put_dest_flags(chanid,buf,nbytes,flags) au1xxx_dbdma_put_dest_flags(chanid,buf,nbytes,flags)
385
386/*
387 * Flags for the put_source/put_dest functions.
388 */
389#define DDMA_FLAGS_IE (1<<0)
390#define DDMA_FLAGS_NOIE (1<<1)
391
298#endif /* _LANGUAGE_ASSEMBLY */ 392#endif /* _LANGUAGE_ASSEMBLY */
299#endif /* _AU1000_DBDMA_H_ */ 393#endif /* _AU1000_DBDMA_H_ */
diff --git a/include/asm-mips/mach-au1x00/au1xxx_gpio.h b/include/asm-mips/mach-au1x00/au1xxx_gpio.h
new file mode 100644
index 000000000000..27911e054ffc
--- /dev/null
+++ b/include/asm-mips/mach-au1x00/au1xxx_gpio.h
@@ -0,0 +1,20 @@
1#ifndef __AU1XXX_GPIO_H
2#define __AU1XXX_GPIO_H
3
4void au1xxx_gpio1_set_inputs(void);
5void au1xxx_gpio_tristate(int signal);
6void au1xxx_gpio_write(int signal, int value);
7int au1xxx_gpio_read(int signal);
8
9typedef volatile struct
10{
11 u32 dir;
12 u32 reserved;
13 u32 output;
14 u32 pinstate;
15 u32 inten;
16 u32 enable;
17
18} AU1X00_GPIO2;
19
20#endif //__AU1XXX_GPIO_H
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h
new file mode 100644
index 000000000000..33d275c3b84c
--- /dev/null
+++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h
@@ -0,0 +1,301 @@
1/*
2 * include/asm-mips/mach-au1x00/au1xxx_ide.h version 01.30.00 Aug. 02 2005
3 *
4 * BRIEF MODULE DESCRIPTION
5 * AMD Alchemy Au1xxx IDE interface routines over the Static Bus
6 *
7 * Copyright (c) 2003-2005 AMD, Personal Connectivity Solutions
8 *
9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the License, or (at your option) any later
12 * version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
15 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 * POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along with
26 * this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 *
29 * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE
30 * Interface and Linux Device Driver" Application Note.
31 */
32#include <linux/config.h>
33
34#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
35 #define DMA_WAIT_TIMEOUT 100
36 #define NUM_DESCRIPTORS PRD_ENTRIES
37#else /* CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA */
38 #define NUM_DESCRIPTORS 2
39#endif
40
41#ifndef AU1XXX_ATA_RQSIZE
42 #define AU1XXX_ATA_RQSIZE 128
43#endif
44
45/* Disable Burstable-Support for DBDMA */
46#ifndef CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON
47 #define CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON 0
48#endif
49
50#ifdef CONFIG_PM
51/*
52* This will enable the device to be powered up when write() or read()
53* is called. If this is not defined, the driver will return -EBUSY.
54*/
55#define WAKE_ON_ACCESS 1
56
57typedef struct
58{
59 spinlock_t lock; /* Used to block on state transitions */
60 au1xxx_power_dev_t *dev; /* Power Managers device structure */
61 unsigned stopped; /* USed to signaling device is stopped */
62} pm_state;
63#endif
64
65
66typedef struct
67{
68 u32 tx_dev_id, rx_dev_id, target_dev_id;
69 u32 tx_chan, rx_chan;
70 void *tx_desc_head, *rx_desc_head;
71 ide_hwif_t *hwif;
72#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
73 ide_drive_t *drive;
74 u8 white_list, black_list;
75 struct dbdma_cmd *dma_table_cpu;
76 dma_addr_t dma_table_dma;
77 struct scatterlist *sg_table;
78 int sg_nents;
79 int sg_dma_direction;
80#endif
81 struct device *dev;
82 int irq;
83 u32 regbase;
84#ifdef CONFIG_PM
85 pm_state pm;
86#endif
87} _auide_hwif;
88
89#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
90struct drive_list_entry {
91 const char * id_model;
92 const char * id_firmware;
93};
94
95/* HD white list */
96static const struct drive_list_entry dma_white_list [] = {
97/*
98 * Hitachi
99 */
100 { "HITACHI_DK14FA-20" , "ALL" },
101 { "HTS726060M9AT00" , "ALL" },
102/*
103 * Maxtor
104 */
105 { "Maxtor 6E040L0" , "ALL" },
106 { "Maxtor 6Y080P0" , "ALL" },
107 { "Maxtor 6Y160P0" , "ALL" },
108/*
109 * Seagate
110 */
111 { "ST3120026A" , "ALL" },
112 { "ST320014A" , "ALL" },
113 { "ST94011A" , "ALL" },
114 { "ST340016A" , "ALL" },
115/*
116 * Western Digital
117 */
118 { "WDC WD400UE-00HCT0" , "ALL" },
119 { "WDC WD400JB-00JJC0" , "ALL" },
120 { NULL , NULL }
121};
122
123/* HD black list */
124static const struct drive_list_entry dma_black_list [] = {
125/*
126 * Western Digital
127 */
128 { "WDC WD100EB-00CGH0" , "ALL" },
129 { "WDC WD200BB-00AUA1" , "ALL" },
130 { "WDC AC24300L" , "ALL" },
131 { NULL , NULL }
132};
133#endif
134
135/* function prototyping */
136u8 auide_inb(unsigned long port);
137u16 auide_inw(unsigned long port);
138u32 auide_inl(unsigned long port);
139void auide_insw(unsigned long port, void *addr, u32 count);
140void auide_insl(unsigned long port, void *addr, u32 count);
141void auide_outb(u8 addr, unsigned long port);
142void auide_outbsync(ide_drive_t *drive, u8 addr, unsigned long port);
143void auide_outw(u16 addr, unsigned long port);
144void auide_outl(u32 addr, unsigned long port);
145void auide_outsw(unsigned long port, void *addr, u32 count);
146void auide_outsl(unsigned long port, void *addr, u32 count);
147static void auide_tune_drive(ide_drive_t *drive, byte pio);
148static int auide_tune_chipset (ide_drive_t *drive, u8 speed);
149static int auide_ddma_init( _auide_hwif *auide );
150static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif);
151int __init auide_probe(void);
152
153#ifdef CONFIG_PM
154 int au1200ide_pm_callback( au1xxx_power_dev_t *dev,
155 au1xxx_request_t request, void *data);
156 static int au1xxxide_pm_standby( au1xxx_power_dev_t *dev );
157 static int au1xxxide_pm_sleep( au1xxx_power_dev_t *dev );
158 static int au1xxxide_pm_resume( au1xxx_power_dev_t *dev );
159 static int au1xxxide_pm_getstatus( au1xxx_power_dev_t *dev );
160 static int au1xxxide_pm_access( au1xxx_power_dev_t *dev );
161 static int au1xxxide_pm_idle( au1xxx_power_dev_t *dev );
162 static int au1xxxide_pm_cleanup( au1xxx_power_dev_t *dev );
163#endif
164
165
166/*
167 * Multi-Word DMA + DbDMA functions
168 */
169#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
170
171 static int in_drive_list(struct hd_driveid *id,
172 const struct drive_list_entry *drive_table);
173 static int auide_build_sglist(ide_drive_t *drive, struct request *rq);
174 static int auide_build_dmatable(ide_drive_t *drive);
175 static int auide_dma_end(ide_drive_t *drive);
176 static void auide_dma_start(ide_drive_t *drive );
177 ide_startstop_t auide_dma_intr (ide_drive_t *drive);
178 static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command);
179 static int auide_dma_setup(ide_drive_t *drive);
180 static int auide_dma_check(ide_drive_t *drive);
181 static int auide_dma_test_irq(ide_drive_t *drive);
182 static int auide_dma_host_off(ide_drive_t *drive);
183 static int auide_dma_host_on(ide_drive_t *drive);
184 static int auide_dma_lostirq(ide_drive_t *drive);
185 static int auide_dma_on(ide_drive_t *drive);
186 static void auide_ddma_tx_callback(int irq, void *param,
187 struct pt_regs *regs);
188 static void auide_ddma_rx_callback(int irq, void *param,
189 struct pt_regs *regs);
190 static int auide_dma_off_quietly(ide_drive_t *drive);
191 static int auide_dma_timeout(ide_drive_t *drive);
192
193#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
194
195/*******************************************************************************
196* PIO Mode timing calculation : *
197* *
198* Static Bus Spec ATA Spec *
199* Tcsoe = t1 *
200* Toecs = t9 *
201* Twcs = t9 *
202* Tcsh = t2i | t2 *
203* Tcsoff = t2i | t2 *
204* Twp = t2 *
205* Tcsw = t1 *
206* Tpm = 0 *
207* Ta = t1+t2 *
208*******************************************************************************/
209
210#define TCSOE_MASK (0x07<<29)
211#define TOECS_MASK (0x07<<26)
212#define TWCS_MASK (0x07<<28)
213#define TCSH_MASK (0x0F<<24)
214#define TCSOFF_MASK (0x07<<20)
215#define TWP_MASK (0x3F<<14)
216#define TCSW_MASK (0x0F<<10)
217#define TPM_MASK (0x0F<<6)
218#define TA_MASK (0x3F<<0)
219#define TS_MASK (1<<8)
220
221/* Timing parameters PIO mode 0 */
222#define SBC_IDE_PIO0_TCSOE (0x04<<29)
223#define SBC_IDE_PIO0_TOECS (0x01<<26)
224#define SBC_IDE_PIO0_TWCS (0x02<<28)
225#define SBC_IDE_PIO0_TCSH (0x08<<24)
226#define SBC_IDE_PIO0_TCSOFF (0x07<<20)
227#define SBC_IDE_PIO0_TWP (0x10<<14)
228#define SBC_IDE_PIO0_TCSW (0x04<<10)
229#define SBC_IDE_PIO0_TPM (0x0<<6)
230#define SBC_IDE_PIO0_TA (0x15<<0)
231/* Timing parameters PIO mode 1 */
232#define SBC_IDE_PIO1_TCSOE (0x03<<29)
233#define SBC_IDE_PIO1_TOECS (0x01<<26)
234#define SBC_IDE_PIO1_TWCS (0x01<<28)
235#define SBC_IDE_PIO1_TCSH (0x06<<24)
236#define SBC_IDE_PIO1_TCSOFF (0x06<<20)
237#define SBC_IDE_PIO1_TWP (0x08<<14)
238#define SBC_IDE_PIO1_TCSW (0x03<<10)
239#define SBC_IDE_PIO1_TPM (0x00<<6)
240#define SBC_IDE_PIO1_TA (0x0B<<0)
241/* Timing parameters PIO mode 2 */
242#define SBC_IDE_PIO2_TCSOE (0x05<<29)
243#define SBC_IDE_PIO2_TOECS (0x01<<26)
244#define SBC_IDE_PIO2_TWCS (0x01<<28)
245#define SBC_IDE_PIO2_TCSH (0x07<<24)
246#define SBC_IDE_PIO2_TCSOFF (0x07<<20)
247#define SBC_IDE_PIO2_TWP (0x1F<<14)
248#define SBC_IDE_PIO2_TCSW (0x05<<10)
249#define SBC_IDE_PIO2_TPM (0x00<<6)
250#define SBC_IDE_PIO2_TA (0x22<<0)
251/* Timing parameters PIO mode 3 */
252#define SBC_IDE_PIO3_TCSOE (0x05<<29)
253#define SBC_IDE_PIO3_TOECS (0x01<<26)
254#define SBC_IDE_PIO3_TWCS (0x01<<28)
255#define SBC_IDE_PIO3_TCSH (0x0D<<24)
256#define SBC_IDE_PIO3_TCSOFF (0x0D<<20)
257#define SBC_IDE_PIO3_TWP (0x15<<14)
258#define SBC_IDE_PIO3_TCSW (0x05<<10)
259#define SBC_IDE_PIO3_TPM (0x00<<6)
260#define SBC_IDE_PIO3_TA (0x1A<<0)
261/* Timing parameters PIO mode 4 */
262#define SBC_IDE_PIO4_TCSOE (0x04<<29)
263#define SBC_IDE_PIO4_TOECS (0x01<<26)
264#define SBC_IDE_PIO4_TWCS (0x01<<28)
265#define SBC_IDE_PIO4_TCSH (0x04<<24)
266#define SBC_IDE_PIO4_TCSOFF (0x04<<20)
267#define SBC_IDE_PIO4_TWP (0x0D<<14)
268#define SBC_IDE_PIO4_TCSW (0x03<<10)
269#define SBC_IDE_PIO4_TPM (0x00<<6)
270#define SBC_IDE_PIO4_TA (0x12<<0)
271/* Timing parameters MDMA mode 0 */
272#define SBC_IDE_MDMA0_TCSOE (0x03<<29)
273#define SBC_IDE_MDMA0_TOECS (0x01<<26)
274#define SBC_IDE_MDMA0_TWCS (0x01<<28)
275#define SBC_IDE_MDMA0_TCSH (0x07<<24)
276#define SBC_IDE_MDMA0_TCSOFF (0x07<<20)
277#define SBC_IDE_MDMA0_TWP (0x0C<<14)
278#define SBC_IDE_MDMA0_TCSW (0x03<<10)
279#define SBC_IDE_MDMA0_TPM (0x00<<6)
280#define SBC_IDE_MDMA0_TA (0x0F<<0)
281/* Timing parameters MDMA mode 1 */
282#define SBC_IDE_MDMA1_TCSOE (0x05<<29)
283#define SBC_IDE_MDMA1_TOECS (0x01<<26)
284#define SBC_IDE_MDMA1_TWCS (0x01<<28)
285#define SBC_IDE_MDMA1_TCSH (0x05<<24)
286#define SBC_IDE_MDMA1_TCSOFF (0x05<<20)
287#define SBC_IDE_MDMA1_TWP (0x0F<<14)
288#define SBC_IDE_MDMA1_TCSW (0x05<<10)
289#define SBC_IDE_MDMA1_TPM (0x00<<6)
290#define SBC_IDE_MDMA1_TA (0x15<<0)
291/* Timing parameters MDMA mode 2 */
292#define SBC_IDE_MDMA2_TCSOE (0x04<<29)
293#define SBC_IDE_MDMA2_TOECS (0x01<<26)
294#define SBC_IDE_MDMA2_TWCS (0x01<<28)
295#define SBC_IDE_MDMA2_TCSH (0x04<<24)
296#define SBC_IDE_MDMA2_TCSOFF (0x04<<20)
297#define SBC_IDE_MDMA2_TWP (0x0D<<14)
298#define SBC_IDE_MDMA2_TCSW (0x04<<10)
299#define SBC_IDE_MDMA2_TPM (0x00<<6)
300#define SBC_IDE_MDMA2_TA (0x12<<0)
301
diff --git a/include/asm-mips/mach-au1x00/au1xxx_psc.h b/include/asm-mips/mach-au1x00/au1xxx_psc.h
index 283519dfdec4..8e5fb3c7da4d 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_psc.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_psc.h
@@ -33,6 +33,8 @@
33#ifndef _AU1000_PSC_H_ 33#ifndef _AU1000_PSC_H_
34#define _AU1000_PSC_H_ 34#define _AU1000_PSC_H_
35 35
36#include <linux/config.h>
37
36/* The PSC base addresses. */ 38/* The PSC base addresses. */
37#ifdef CONFIG_SOC_AU1550 39#ifdef CONFIG_SOC_AU1550
38#define PSC0_BASE_ADDR 0xb1a00000 40#define PSC0_BASE_ADDR 0xb1a00000
diff --git a/include/asm-mips/mach-au1x00/ioremap.h b/include/asm-mips/mach-au1x00/ioremap.h
new file mode 100644
index 000000000000..d3ec6274575a
--- /dev/null
+++ b/include/asm-mips/mach-au1x00/ioremap.h
@@ -0,0 +1,32 @@
1/*
2 * include/asm-mips/mach-au1x00/ioremap.h
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#ifndef __ASM_MACH_AU1X00_IOREMAP_H
10#define __ASM_MACH_AU1X00_IOREMAP_H
11
12#include <linux/config.h>
13#include <linux/types.h>
14
15#ifdef CONFIG_64BIT_PHYS_ADDR
16extern phys_t __fixup_bigphys_addr(phys_t, phys_t);
17#else
18static inline phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
19{
20 return phys_addr;
21}
22#endif
23
24/*
25 * Allow physical addresses to be fixed up to help 36-bit peripherals.
26 */
27static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size)
28{
29 return __fixup_bigphys_addr(phys_addr, size);
30}
31
32#endif /* __ASM_MACH_AU1X00_IOREMAP_H */
diff --git a/include/asm-mips/mach-db1x00/db1200.h b/include/asm-mips/mach-db1x00/db1200.h
new file mode 100644
index 000000000000..5d894376fc1a
--- /dev/null
+++ b/include/asm-mips/mach-db1x00/db1200.h
@@ -0,0 +1,224 @@
1/*
2 * AMD Alchemy DB1200 Referrence Board
3 * Board Registers defines.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 *
20 * ########################################################################
21 *
22 *
23 */
24#ifndef __ASM_DB1200_H
25#define __ASM_DB1200_H
26
27#include <linux/types.h>
28
29// This is defined in au1000.h with bogus value
30#undef AU1X00_EXTERNAL_INT
31
32#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
33#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
34#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
35#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
36
37/* SPI and SMB are muxed on the Pb1200 board.
38 Refer to board documentation.
39 */
40#define SPI_PSC_BASE PSC0_BASE_ADDR
41#define SMBUS_PSC_BASE PSC0_BASE_ADDR
42/* AC97 and I2S are muxed on the Pb1200 board.
43 Refer to board documentation.
44 */
45#define AC97_PSC_BASE PSC1_BASE_ADDR
46#define I2S_PSC_BASE PSC1_BASE_ADDR
47
48#define BCSR_KSEG1_ADDR 0xB9800000
49
50typedef volatile struct
51{
52 /*00*/ u16 whoami;
53 u16 reserved0;
54 /*04*/ u16 status;
55 u16 reserved1;
56 /*08*/ u16 switches;
57 u16 reserved2;
58 /*0C*/ u16 resets;
59 u16 reserved3;
60
61 /*10*/ u16 pcmcia;
62 u16 reserved4;
63 /*14*/ u16 board;
64 u16 reserved5;
65 /*18*/ u16 disk_leds;
66 u16 reserved6;
67 /*1C*/ u16 system;
68 u16 reserved7;
69
70 /*20*/ u16 intclr;
71 u16 reserved8;
72 /*24*/ u16 intset;
73 u16 reserved9;
74 /*28*/ u16 intclr_mask;
75 u16 reserved10;
76 /*2C*/ u16 intset_mask;
77 u16 reserved11;
78
79 /*30*/ u16 sig_status;
80 u16 reserved12;
81 /*34*/ u16 int_status;
82 u16 reserved13;
83 /*38*/ u16 reserved14;
84 u16 reserved15;
85 /*3C*/ u16 reserved16;
86 u16 reserved17;
87
88} BCSR;
89
90static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
91
92/*
93 * Register bit definitions for the BCSRs
94 */
95#define BCSR_WHOAMI_DCID 0x000F
96#define BCSR_WHOAMI_CPLD 0x00F0
97#define BCSR_WHOAMI_BOARD 0x0F00
98
99#define BCSR_STATUS_PCMCIA0VS 0x0003
100#define BCSR_STATUS_PCMCIA1VS 0x000C
101#define BCSR_STATUS_SWAPBOOT 0x0040
102#define BCSR_STATUS_FLASHBUSY 0x0100
103#define BCSR_STATUS_IDECBLID 0x0200
104#define BCSR_STATUS_SD0WP 0x0400
105#define BCSR_STATUS_U0RXD 0x1000
106#define BCSR_STATUS_U1RXD 0x2000
107
108#define BCSR_SWITCHES_OCTAL 0x00FF
109#define BCSR_SWITCHES_DIP_1 0x0080
110#define BCSR_SWITCHES_DIP_2 0x0040
111#define BCSR_SWITCHES_DIP_3 0x0020
112#define BCSR_SWITCHES_DIP_4 0x0010
113#define BCSR_SWITCHES_DIP_5 0x0008
114#define BCSR_SWITCHES_DIP_6 0x0004
115#define BCSR_SWITCHES_DIP_7 0x0002
116#define BCSR_SWITCHES_DIP_8 0x0001
117#define BCSR_SWITCHES_ROTARY 0x0F00
118
119#define BCSR_RESETS_ETH 0x0001
120#define BCSR_RESETS_CAMERA 0x0002
121#define BCSR_RESETS_DC 0x0004
122#define BCSR_RESETS_IDE 0x0008
123#define BCSR_RESETS_TV 0x0010
124/* not resets but in the same register */
125#define BCSR_RESETS_PWMR1mUX 0x0800
126#define BCSR_RESETS_PCS0MUX 0x1000
127#define BCSR_RESETS_PCS1MUX 0x2000
128#define BCSR_RESETS_SPISEL 0x4000
129
130#define BCSR_PCMCIA_PC0VPP 0x0003
131#define BCSR_PCMCIA_PC0VCC 0x000C
132#define BCSR_PCMCIA_PC0DRVEN 0x0010
133#define BCSR_PCMCIA_PC0RST 0x0080
134#define BCSR_PCMCIA_PC1VPP 0x0300
135#define BCSR_PCMCIA_PC1VCC 0x0C00
136#define BCSR_PCMCIA_PC1DRVEN 0x1000
137#define BCSR_PCMCIA_PC1RST 0x8000
138
139#define BCSR_BOARD_LCDVEE 0x0001
140#define BCSR_BOARD_LCDVDD 0x0002
141#define BCSR_BOARD_LCDBL 0x0004
142#define BCSR_BOARD_CAMSNAP 0x0010
143#define BCSR_BOARD_CAMPWR 0x0020
144#define BCSR_BOARD_SD0PWR 0x0040
145
146#define BCSR_LEDS_DECIMALS 0x0003
147#define BCSR_LEDS_LED0 0x0100
148#define BCSR_LEDS_LED1 0x0200
149#define BCSR_LEDS_LED2 0x0400
150#define BCSR_LEDS_LED3 0x0800
151
152#define BCSR_SYSTEM_POWEROFF 0x4000
153#define BCSR_SYSTEM_RESET 0x8000
154
155/* Bit positions for the different interrupt sources */
156#define BCSR_INT_IDE 0x0001
157#define BCSR_INT_ETH 0x0002
158#define BCSR_INT_PC0 0x0004
159#define BCSR_INT_PC0STSCHG 0x0008
160#define BCSR_INT_PC1 0x0010
161#define BCSR_INT_PC1STSCHG 0x0020
162#define BCSR_INT_DC 0x0040
163#define BCSR_INT_FLASHBUSY 0x0080
164#define BCSR_INT_PC0INSERT 0x0100
165#define BCSR_INT_PC0EJECT 0x0200
166#define BCSR_INT_PC1INSERT 0x0400
167#define BCSR_INT_PC1EJECT 0x0800
168#define BCSR_INT_SD0INSERT 0x1000
169#define BCSR_INT_SD0EJECT 0x2000
170
171#define AU1XXX_SMC91111_PHYS_ADDR (0x19000300)
172#define AU1XXX_SMC91111_IRQ DB1200_ETH_INT
173
174#define AU1XXX_ATA_PHYS_ADDR (0x18800000)
175#define AU1XXX_ATA_PHYS_LEN (0x100)
176#define AU1XXX_ATA_REG_OFFSET (5)
177#define AU1XXX_ATA_INT DB1200_IDE_INT
178#define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1;
179#define AU1XXX_ATA_RQSIZE 128
180
181#define NAND_PHYS_ADDR 0x20000000
182
183/*
184 * External Interrupts for Pb1200 as of 8/6/2004.
185 * Bit positions in the CPLD registers can be calculated by taking
186 * the interrupt define and subtracting the DB1200_INT_BEGIN value.
187 * *example: IDE bis pos is = 64 - 64
188 ETH bit pos is = 65 - 64
189 */
190#define DB1200_INT_BEGIN (AU1000_LAST_INTC1_INT + 1)
191#define DB1200_IDE_INT (DB1200_INT_BEGIN + 0)
192#define DB1200_ETH_INT (DB1200_INT_BEGIN + 1)
193#define DB1200_PC0_INT (DB1200_INT_BEGIN + 2)
194#define DB1200_PC0_STSCHG_INT (DB1200_INT_BEGIN + 3)
195#define DB1200_PC1_INT (DB1200_INT_BEGIN + 4)
196#define DB1200_PC1_STSCHG_INT (DB1200_INT_BEGIN + 5)
197#define DB1200_DC_INT (DB1200_INT_BEGIN + 6)
198#define DB1200_FLASHBUSY_INT (DB1200_INT_BEGIN + 7)
199#define DB1200_PC0_INSERT_INT (DB1200_INT_BEGIN + 8)
200#define DB1200_PC0_EJECT_INT (DB1200_INT_BEGIN + 9)
201#define DB1200_PC1_INSERT_INT (DB1200_INT_BEGIN + 10)
202#define DB1200_PC1_EJECT_INT (DB1200_INT_BEGIN + 11)
203#define DB1200_SD0_INSERT_INT (DB1200_INT_BEGIN + 12)
204#define DB1200_SD0_EJECT_INT (DB1200_INT_BEGIN + 13)
205
206#define DB1200_INT_END (DB1200_INT_BEGIN + 15)
207
208/* For drivers/pcmcia/au1000_db1x00.c */
209
210/* PCMCIA Db1x00 specific defines */
211
212#define PCMCIA_MAX_SOCK 1
213#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
214
215/* VPP/VCC */
216#define SET_VCC_VPP(VCC, VPP, SLOT)\
217 ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
218
219#define BOARD_PC0_INT DB1200_PC0_INT
220#define BOARD_PC1_INT DB1200_PC1_INT
221#define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1<<(8+(2*SOCKET)))
222
223#endif /* __ASM_DB1200_H */
224
diff --git a/include/asm-mips/mach-dec/mc146818rtc.h b/include/asm-mips/mach-dec/mc146818rtc.h
index a326f451253b..6d37a5675803 100644
--- a/include/asm-mips/mach-dec/mc146818rtc.h
+++ b/include/asm-mips/mach-dec/mc146818rtc.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 1998, 2001 by Ralf Baechle 4 * Copyright (C) 1998, 2001 by Ralf Baechle
5 * Copyright (C) 1998 by Harald Koerfgen 5 * Copyright (C) 1998 by Harald Koerfgen
6 * Copyright (C) 2002 Maciej W. Rozycki 6 * Copyright (C) 2002, 2005 Maciej W. Rozycki
7 * 7 *
8 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 9 * modify it under the terms of the GNU General Public License
@@ -14,23 +14,18 @@
14#define __ASM_MIPS_DEC_RTC_DEC_H 14#define __ASM_MIPS_DEC_RTC_DEC_H
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17
18#include <asm/addrspace.h> 17#include <asm/addrspace.h>
18#include <asm/dec/system.h>
19 19
20extern volatile u8 *dec_rtc_base; 20extern volatile u8 *dec_rtc_base;
21extern unsigned long dec_kn_slot_size;
22 21
23#define RTC_PORT(x) CPHYSADDR(dec_rtc_base) 22#define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base)
24#define RTC_IO_EXTENT dec_kn_slot_size 23#define RTC_IO_EXTENT dec_kn_slot_size
25#define RTC_IOMAPPED 0 24#define RTC_IOMAPPED 0
26#undef RTC_IRQ 25#undef RTC_IRQ
27 26
28#define RTC_DEC_YEAR 0x3f /* Where we store the real year on DECs. */ 27#define RTC_DEC_YEAR 0x3f /* Where we store the real year on DECs. */
29 28
30#include <linux/mc146818rtc.h>
31#include <linux/module.h>
32#include <linux/types.h>
33
34static inline unsigned char CMOS_READ(unsigned long addr) 29static inline unsigned char CMOS_READ(unsigned long addr)
35{ 30{
36 return dec_rtc_base[addr * 4]; 31 return dec_rtc_base[addr * 4];
diff --git a/include/asm-mips/mach-generic/cpu-feature-overrides.h b/include/asm-mips/mach-generic/cpu-feature-overrides.h
index 0aecfd08e39a..7c185bb06f13 100644
--- a/include/asm-mips/mach-generic/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-generic/cpu-feature-overrides.h
@@ -8,6 +8,6 @@
8#ifndef __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H
10 10
11/* Intensionally empty file ... */ 11/* Intentionally empty file ... */
12 12
13#endif /* __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H */ 13#endif /* __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h
index cb2edd018ad6..961006948c7c 100644
--- a/include/asm-mips/mach-generic/ide.h
+++ b/include/asm-mips/mach-generic/ide.h
@@ -18,6 +18,7 @@
18#include <linux/config.h> 18#include <linux/config.h>
19#include <linux/pci.h> 19#include <linux/pci.h>
20#include <linux/stddef.h> 20#include <linux/stddef.h>
21#include <asm/processor.h>
21 22
22#ifndef MAX_HWIFS 23#ifndef MAX_HWIFS
23# ifdef CONFIG_BLK_DEV_IDEPCI 24# ifdef CONFIG_BLK_DEV_IDEPCI
@@ -104,15 +105,71 @@ static __inline__ unsigned long ide_default_io_base(int index)
104 105
105/* MIPS port and memory-mapped I/O string operations. */ 106/* MIPS port and memory-mapped I/O string operations. */
106 107
107#define __ide_insw insw 108static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size)
108#define __ide_insl insl 109{
109#define __ide_outsw outsw 110 if (cpu_has_dc_aliases) {
110#define __ide_outsl outsl 111 unsigned long end = addr + size;
112 for (; addr < end; addr += PAGE_SIZE)
113 flush_dcache_page(virt_to_page(addr));
114 }
115}
116
117static inline void __ide_insw(unsigned long port, void *addr,
118 unsigned int count)
119{
120 insw(port, addr, count);
121 __ide_flush_dcache_range((unsigned long)addr, count * 2);
122}
123
124static inline void __ide_insl(unsigned long port, void *addr, unsigned int count)
125{
126 insl(port, addr, count);
127 __ide_flush_dcache_range((unsigned long)addr, count * 4);
128}
129
130static inline void __ide_outsw(unsigned long port, const void *addr,
131 unsigned long count)
132{
133 outsw(port, addr, count);
134 __ide_flush_dcache_range((unsigned long)addr, count * 2);
135}
136
137static inline void __ide_outsl(unsigned long port, const void *addr,
138 unsigned long count)
139{
140 outsl(port, addr, count);
141 __ide_flush_dcache_range((unsigned long)addr, count * 4);
142}
143
144static inline void __ide_mm_insw(void __iomem *port, void *addr, u32 count)
145{
146 readsw(port, addr, count);
147 __ide_flush_dcache_range((unsigned long)addr, count * 2);
148}
149
150static inline void __ide_mm_insl(void __iomem *port, void *addr, u32 count)
151{
152 readsl(port, addr, count);
153 __ide_flush_dcache_range((unsigned long)addr, count * 4);
154}
155
156static inline void __ide_mm_outsw(void __iomem *port, void *addr, u32 count)
157{
158 writesw(port, addr, count);
159 __ide_flush_dcache_range((unsigned long)addr, count * 2);
160}
161
162static inline void __ide_mm_outsl(void __iomem * port, void *addr, u32 count)
163{
164 writesl(port, addr, count);
165 __ide_flush_dcache_range((unsigned long)addr, count * 4);
166}
111 167
112#define __ide_mm_insw readsw 168/* ide_insw calls insw, not __ide_insw. Why? */
113#define __ide_mm_insl readsl 169#undef insw
114#define __ide_mm_outsw writesw 170#undef insl
115#define __ide_mm_outsl writesl 171#define insw(port, addr, count) __ide_insw(port, addr, count)
172#define insl(port, addr, count) __ide_insl(port, addr, count)
116 173
117#endif /* __KERNEL__ */ 174#endif /* __KERNEL__ */
118 175
diff --git a/include/asm-mips/mach-generic/ioremap.h b/include/asm-mips/mach-generic/ioremap.h
new file mode 100644
index 000000000000..9b64ff6e485d
--- /dev/null
+++ b/include/asm-mips/mach-generic/ioremap.h
@@ -0,0 +1,23 @@
1/*
2 * include/asm-mips/mach-generic/ioremap.h
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#ifndef __ASM_MACH_GENERIC_IOREMAP_H
10#define __ASM_MACH_GENERIC_IOREMAP_H
11
12#include <linux/types.h>
13
14/*
15 * Allow physical addresses to be fixed up to help peripherals located
16 * outside the low 32-bit range -- generic pass-through version.
17 */
18static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size)
19{
20 return phys_addr;
21}
22
23#endif /* __ASM_MACH_GENERIC_IOREMAP_H */
diff --git a/include/asm-mips/mach-generic/kernel-entry-init.h b/include/asm-mips/mach-generic/kernel-entry-init.h
new file mode 100644
index 000000000000..7e66505fa574
--- /dev/null
+++ b/include/asm-mips/mach-generic/kernel-entry-init.h
@@ -0,0 +1,25 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005 Embedded Alley Solutions, Inc
7 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
8 */
9#ifndef __ASM_MACH_GENERIC_KERNEL_ENTRY_H
10#define __ASM_MACH_GENERIC_KERNEL_ENTRY_H
11
12/* Intentionally empty macro, used in head.S. Override in
13 * arch/mips/mach-xxx/kernel-entry-init.h when necessary.
14 */
15.macro kernel_entry_setup
16.endm
17
18/*
19 * Do SMP slave processor setup necessary before we can savely execute C code.
20 */
21 .macro smp_slave_setup
22 .endm
23
24
25#endif /* __ASM_MACH_GENERIC_KERNEL_ENTRY_H */
diff --git a/include/asm-mips/mach-generic/kmalloc.h b/include/asm-mips/mach-generic/kmalloc.h
new file mode 100644
index 000000000000..373d66dee9d7
--- /dev/null
+++ b/include/asm-mips/mach-generic/kmalloc.h
@@ -0,0 +1,13 @@
1#ifndef __ASM_MACH_GENERIC_KMALLOC_H
2#define __ASM_MACH_GENERIC_KMALLOC_H
3
4#include <linux/config.h>
5
6#ifndef CONFIG_DMA_COHERENT
7/*
8 * Total overkill for most systems but need as a safe default.
9 */
10#define ARCH_KMALLOC_MINALIGN 128
11#endif
12
13#endif /* __ASM_MACH_GENERIC_KMALLOC_H */
diff --git a/include/asm-mips/mach-generic/spaces.h b/include/asm-mips/mach-generic/spaces.h
index 5a2c1efb4eb7..b849d8dd7e78 100644
--- a/include/asm-mips/mach-generic/spaces.h
+++ b/include/asm-mips/mach-generic/spaces.h
@@ -55,13 +55,13 @@
55#endif 55#endif
56 56
57#ifdef CONFIG_DMA_NONCOHERENT 57#ifdef CONFIG_DMA_NONCOHERENT
58#define CAC_BASE 0x9800000000000000 58#define CAC_BASE 0x9800000000000000UL
59#else 59#else
60#define CAC_BASE 0xa800000000000000 60#define CAC_BASE 0xa800000000000000UL
61#endif 61#endif
62#define IO_BASE 0x9000000000000000 62#define IO_BASE 0x9000000000000000UL
63#define UNCAC_BASE 0x9000000000000000 63#define UNCAC_BASE 0x9000000000000000UL
64#define MAP_BASE 0xc000000000000000 64#define MAP_BASE 0xc000000000000000UL
65 65
66#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) 66#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
67#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) 67#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
diff --git a/include/asm-mips/mach-ip22/cpu-feature-overrides.h b/include/asm-mips/mach-ip22/cpu-feature-overrides.h
index 3c8896d9b133..ab9714668177 100644
--- a/include/asm-mips/mach-ip22/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip22/cpu-feature-overrides.h
@@ -11,6 +11,12 @@
11/* 11/*
12 * IP22 with a variety of processors so we can't use defaults for everything. 12 * IP22 with a variety of processors so we can't use defaults for everything.
13 */ 13 */
14#define cpu_has_tlb 1
15#define cpu_has_4kex 1
16#define cpu_has_4kcache 1
17#define cpu_has_fpu 1
18#define cpu_has_32fpr 1
19#define cpu_has_counter 1
14#define cpu_has_mips16 0 20#define cpu_has_mips16 0
15#define cpu_has_divec 0 21#define cpu_has_divec 0
16#define cpu_has_cache_cdex_p 1 22#define cpu_has_cache_cdex_p 1
@@ -23,6 +29,8 @@
23#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) 29#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000)
24#define cpu_has_ic_fills_f_dc 0 30#define cpu_has_ic_fills_f_dc 0
25 31
32#define cpu_has_dsp 0
33
26#define cpu_has_nofpuex 0 34#define cpu_has_nofpuex 0
27#define cpu_has_64bits 1 35#define cpu_has_64bits 1
28 36
diff --git a/include/asm-mips/mach-ip22/spaces.h b/include/asm-mips/mach-ip22/spaces.h
index e96166f27c49..8385f716798d 100644
--- a/include/asm-mips/mach-ip22/spaces.h
+++ b/include/asm-mips/mach-ip22/spaces.h
@@ -44,7 +44,7 @@
44#define CAC_BASE 0xffffffff80000000 44#define CAC_BASE 0xffffffff80000000
45#define IO_BASE 0xffffffffa0000000 45#define IO_BASE 0xffffffffa0000000
46#define UNCAC_BASE 0xffffffffa0000000 46#define UNCAC_BASE 0xffffffffa0000000
47#define MAP_BASE 0xffffffffc0000000 47#define MAP_BASE 0xc000000000000000
48 48
49#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) 49#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
50#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) 50#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
index fe96d7358517..4c8a90051fd0 100644
--- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
@@ -25,6 +25,7 @@
25#define cpu_has_vtag_icache 0 25#define cpu_has_vtag_icache 0
26#define cpu_has_dc_aliases 0 26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0
28#define cpu_icache_snoops_remote_store 1 29#define cpu_icache_snoops_remote_store 1
29 30
30#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
diff --git a/include/asm-mips/mach-ip27/kernel-entry-init.h b/include/asm-mips/mach-ip27/kernel-entry-init.h
new file mode 100644
index 000000000000..c1a10314b317
--- /dev/null
+++ b/include/asm-mips/mach-ip27/kernel-entry-init.h
@@ -0,0 +1,52 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2000 Silicon Graphics, Inc.
7 * Copyright (C) 2005 Ralf Baechle <ralf@linux-mips.org>
8 */
9#ifndef __ASM_MACH_IP27_KERNEL_ENTRY_H
10#define __ASM_MACH_IP27_KERNEL_ENTRY_H
11
12#include <asm/sn/addrs.h>
13#include <asm/sn/sn0/hubni.h>
14#include <asm/sn/klkernvars.h>
15
16/*
17 * Returns the local nasid into res.
18 */
19 .macro GET_NASID_ASM res
20 dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID)
21 ld \res, (\res)
22 and \res, NSRI_NODEID_MASK
23 dsrl \res, NSRI_NODEID_SHFT
24 .endm
25
26/*
27 * Intentionally empty macro, used in head.S. Override in
28 * arch/mips/mach-xxx/kernel-entry-init.h when necessary.
29 */
30 .macro kernel_entry_setup
31 GET_NASID_ASM t1
32 move t2, t1 # text and data are here
33 MAPPED_KERNEL_SETUP_TLB
34 .endm
35
36/*
37 * Do SMP slave processor setup necessary before we can savely execute C code.
38 */
39 .macro smp_slave_setup
40 GET_NASID_ASM t1
41 dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \
42 KLDIR_OFF_POINTER + CAC_BASE
43 dsll t1, NASID_SHFT
44 or t0, t0, t1
45 ld t0, 0(t0) # t0 points to kern_vars struct
46 lh t1, KV_RO_NASID_OFFSET(t0)
47 lh t2, KV_RW_NASID_OFFSET(t0)
48 MAPPED_KERNEL_SETUP_TLB
49 ARC64_TWIDDLE_PC
50 .endm
51
52#endif /* __ASM_MACH_IP27_KERNEL_ENTRY_H */
diff --git a/include/asm-mips/mach-ip27/kmalloc.h b/include/asm-mips/mach-ip27/kmalloc.h
new file mode 100644
index 000000000000..426bd049b2d7
--- /dev/null
+++ b/include/asm-mips/mach-ip27/kmalloc.h
@@ -0,0 +1,8 @@
1#ifndef __ASM_MACH_IP27_KMALLOC_H
2#define __ASM_MACH_IP27_KMALLOC_H
3
4/*
5 * All happy, no need to define ARCH_KMALLOC_MINALIGN
6 */
7
8#endif /* __ASM_MACH_IP27_KMALLOC_H */
diff --git a/include/asm-mips/mach-ip27/mmzone.h b/include/asm-mips/mach-ip27/mmzone.h
index d3f566362e9d..986a3b9b59a7 100644
--- a/include/asm-mips/mach-ip27/mmzone.h
+++ b/include/asm-mips/mach-ip27/mmzone.h
@@ -10,7 +10,6 @@
10#define LEVELS_PER_SLICE 128 10#define LEVELS_PER_SLICE 128
11 11
12struct slice_data { 12struct slice_data {
13 unsigned long irq_alloc_mask[2];
14 unsigned long irq_enable_mask[2]; 13 unsigned long irq_enable_mask[2];
15 int level_to_irq[LEVELS_PER_SLICE]; 14 int level_to_irq[LEVELS_PER_SLICE];
16}; 15};
@@ -20,6 +19,7 @@ struct hub_data {
20 DECLARE_BITMAP(h_bigwin_used, HUB_NUM_BIG_WINDOW); 19 DECLARE_BITMAP(h_bigwin_used, HUB_NUM_BIG_WINDOW);
21 cpumask_t h_cpus; 20 cpumask_t h_cpus;
22 unsigned long slice_map; 21 unsigned long slice_map;
22 unsigned long irq_alloc_mask[2];
23 struct slice_data slice[2]; 23 struct slice_data slice[2];
24}; 24};
25 25
diff --git a/include/asm-mips/mach-ip27/spaces.h b/include/asm-mips/mach-ip27/spaces.h
index e3b3fe32eeb1..45e61785ef42 100644
--- a/include/asm-mips/mach-ip27/spaces.h
+++ b/include/asm-mips/mach-ip27/spaces.h
@@ -20,6 +20,7 @@
20#define IO_BASE 0x9200000000000000 20#define IO_BASE 0x9200000000000000
21#define MSPEC_BASE 0x9400000000000000 21#define MSPEC_BASE 0x9400000000000000
22#define UNCAC_BASE 0x9600000000000000 22#define UNCAC_BASE 0x9600000000000000
23#define MAP_BASE 0xc000000000000000
23 24
24#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) 25#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
25#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) 26#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
diff --git a/include/asm-mips/mach-ip27/topology.h b/include/asm-mips/mach-ip27/topology.h
index a70a81257c3d..82141c711c33 100644
--- a/include/asm-mips/mach-ip27/topology.h
+++ b/include/asm-mips/mach-ip27/topology.h
@@ -9,6 +9,9 @@
9#define parent_node(node) (node) 9#define parent_node(node) (node)
10#define node_to_cpumask(node) (hub_data(node)->h_cpus) 10#define node_to_cpumask(node) (hub_data(node)->h_cpus)
11#define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node))) 11#define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node)))
12struct pci_bus;
13extern int pcibus_to_node(struct pci_bus *);
14
12#define pcibus_to_cpumask(bus) (cpu_online_map) 15#define pcibus_to_cpumask(bus) (cpu_online_map)
13 16
14extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES]; 17extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
index 04713973c6c3..ab37fc1842ba 100644
--- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
@@ -37,5 +37,6 @@
37#define cpu_has_ejtag 0 37#define cpu_has_ejtag 0
38#define cpu_has_vtag_icache 0 38#define cpu_has_vtag_icache 0
39#define cpu_has_ic_fills_f_dc 0 39#define cpu_has_ic_fills_f_dc 0
40#define cpu_has_dsp 0
40 41
41#endif /* __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H */ 42#endif /* __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-ip32/kmalloc.h b/include/asm-mips/mach-ip32/kmalloc.h
new file mode 100644
index 000000000000..9d2d4d9ac036
--- /dev/null
+++ b/include/asm-mips/mach-ip32/kmalloc.h
@@ -0,0 +1,12 @@
1#ifndef __ASM_MACH_IP32_KMALLOC_H
2#define __ASM_MACH_IP32_KMALLOC_H
3
4#include <linux/config.h>
5
6#if defined(CONFIG_CPU_R5000) || defined (CONFIG_CPU_RM7000)
7#define ARCH_KMALLOC_MINALIGN 32
8#else
9#define ARCH_KMALLOC_MINALIGN 128
10#endif
11
12#endif /* __ASM_MACH_IP32_KMALLOC_H */
diff --git a/include/asm-mips/mach-ip32/spaces.h b/include/asm-mips/mach-ip32/spaces.h
index c7839f85c68d..44abe5c02389 100644
--- a/include/asm-mips/mach-ip32/spaces.h
+++ b/include/asm-mips/mach-ip32/spaces.h
@@ -19,10 +19,10 @@
19#define HIGHMEM_START (1UL << 59UL) 19#define HIGHMEM_START (1UL << 59UL)
20#endif 20#endif
21 21
22#define CAC_BASE 0x9800000000000000 22#define CAC_BASE 0x9800000000000000UL
23#define IO_BASE 0x9000000000000000 23#define IO_BASE 0x9000000000000000UL
24#define UNCAC_BASE 0x9000000000000000 24#define UNCAC_BASE 0x9000000000000000UL
25#define MAP_BASE 0xc000000000000000 25#define MAP_BASE 0xc000000000000000UL
26 26
27#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) 27#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
28#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) 28#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
diff --git a/include/asm-mips/mach-ja/cpu-feature-overrides.h b/include/asm-mips/mach-ja/cpu-feature-overrides.h
index ca57e7db98bb..a0fde405d4c4 100644
--- a/include/asm-mips/mach-ja/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ja/cpu-feature-overrides.h
@@ -25,6 +25,7 @@
25#define cpu_has_vtag_icache 0 25#define cpu_has_vtag_icache 0
26#define cpu_has_dc_aliases 0 26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0
28#define cpu_icache_snoops_remote_store 0 29#define cpu_icache_snoops_remote_store 0
29 30
30#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
@@ -36,10 +37,4 @@
36#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
37#define cpu_scache_line_size() 32 38#define cpu_scache_line_size() 32
38 39
39/*
40 * On the RM9000 we need to ensure that I-cache lines being fetches only
41 * contain valid instructions are funny things will happen.
42 */
43#define PLAT_TRAMPOLINE_STUFF_LINE 32UL
44
45#endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */ 40#endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-mips/cpu-feature-overrides.h b/include/asm-mips/mach-mips/cpu-feature-overrides.h
index 6f51be571bf0..9f92aed17754 100644
--- a/include/asm-mips/mach-mips/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-mips/cpu-feature-overrides.h
@@ -17,7 +17,7 @@
17#ifdef CONFIG_CPU_MIPS32 17#ifdef CONFIG_CPU_MIPS32
18#define cpu_has_tlb 1 18#define cpu_has_tlb 1
19#define cpu_has_4kex 1 19#define cpu_has_4kex 1
20#define cpu_has_4ktlb 1 20#define cpu_has_4kcache 1
21/* #define cpu_has_fpu ? */ 21/* #define cpu_has_fpu ? */
22/* #define cpu_has_32fpr ? */ 22/* #define cpu_has_32fpr ? */
23#define cpu_has_counter 1 23#define cpu_has_counter 1
@@ -37,12 +37,13 @@
37/* #define cpu_has_64bits ? */ 37/* #define cpu_has_64bits ? */
38/* #define cpu_has_64bit_zero_reg ? */ 38/* #define cpu_has_64bit_zero_reg ? */
39/* #define cpu_has_subset_pcaches ? */ 39/* #define cpu_has_subset_pcaches ? */
40#define cpu_icache_snoops_remote_store 1
40#endif 41#endif
41 42
42#ifdef CONFIG_CPU_MIPS64 43#ifdef CONFIG_CPU_MIPS64
43#define cpu_has_tlb 1 44#define cpu_has_tlb 1
44#define cpu_has_4kex 1 45#define cpu_has_4kex 1
45#define cpu_has_4ktlb 1 46#define cpu_has_4kcache 1
46/* #define cpu_has_fpu ? */ 47/* #define cpu_has_fpu ? */
47/* #define cpu_has_32fpr ? */ 48/* #define cpu_has_32fpr ? */
48#define cpu_has_counter 1 49#define cpu_has_counter 1
@@ -62,6 +63,7 @@
62/* #define cpu_has_64bits ? */ 63/* #define cpu_has_64bits ? */
63/* #define cpu_has_64bit_zero_reg ? */ 64/* #define cpu_has_64bit_zero_reg ? */
64/* #define cpu_has_subset_pcaches ? */ 65/* #define cpu_has_subset_pcaches ? */
66#define cpu_icache_snoops_remote_store 1
65#endif 67#endif
66 68
67#endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */ 69#endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-mips/irq.h b/include/asm-mips/mach-mips/irq.h
new file mode 100644
index 000000000000..f8579696ca54
--- /dev/null
+++ b/include/asm-mips/mach-mips/irq.h
@@ -0,0 +1,14 @@
1#ifndef __ASM_MACH_MIPS_IRQ_H
2#define __ASM_MACH_MIPS_IRQ_H
3
4#include <linux/config.h>
5
6#define NR_IRQS 256
7
8#ifdef CONFIG_SMP
9
10#define ARCH_HAS_IRQ_PER_CPU
11
12#endif
13
14#endif /* __ASM_MACH_MIPS_IRQ_H */
diff --git a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
index 7473512384bc..825c5f674dfc 100644
--- a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
@@ -28,6 +28,7 @@
28#define cpu_has_vtag_icache 0 28#define cpu_has_vtag_icache 0
29#define cpu_has_dc_aliases 0 29#define cpu_has_dc_aliases 0
30#define cpu_has_ic_fills_f_dc 0 30#define cpu_has_ic_fills_f_dc 0
31#define cpu_has_dsp 0
31#define cpu_icache_snoops_remote_store 0 32#define cpu_icache_snoops_remote_store 0
32 33
33#define cpu_has_nofpuex 0 34#define cpu_has_nofpuex 0
@@ -39,10 +40,4 @@
39#define cpu_icache_line_size() 32 40#define cpu_icache_line_size() 32
40#define cpu_scache_line_size() 32 41#define cpu_scache_line_size() 32
41 42
42/*
43 * On the RM9000 we need to ensure that I-cache lines being fetches only
44 * contain valid instructions are funny things will happen.
45 */
46#define PLAT_TRAMPOLINE_STUFF_LINE 32UL
47
48#endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */ 43#endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-pb1x00/pb1200.h b/include/asm-mips/mach-pb1x00/pb1200.h
new file mode 100644
index 000000000000..9a3088b19bf3
--- /dev/null
+++ b/include/asm-mips/mach-pb1x00/pb1200.h
@@ -0,0 +1,252 @@
1/*
2 * AMD Alchemy PB1200 Referrence Board
3 * Board Registers defines.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 *
20 * ########################################################################
21 *
22 *
23 */
24#ifndef __ASM_PB1200_H
25#define __ASM_PB1200_H
26
27#include <linux/types.h>
28
29// This is defined in au1000.h with bogus value
30#undef AU1X00_EXTERNAL_INT
31
32#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
33#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
34#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
35#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
36
37/* SPI and SMB are muxed on the Pb1200 board.
38 Refer to board documentation.
39 */
40#define SPI_PSC_BASE PSC0_BASE_ADDR
41#define SMBUS_PSC_BASE PSC0_BASE_ADDR
42/* AC97 and I2S are muxed on the Pb1200 board.
43 Refer to board documentation.
44 */
45#define AC97_PSC_BASE PSC1_BASE_ADDR
46#define I2S_PSC_BASE PSC1_BASE_ADDR
47
48#define BCSR_KSEG1_ADDR 0xAD800000
49
50typedef volatile struct
51{
52 /*00*/ u16 whoami;
53 u16 reserved0;
54 /*04*/ u16 status;
55 u16 reserved1;
56 /*08*/ u16 switches;
57 u16 reserved2;
58 /*0C*/ u16 resets;
59 u16 reserved3;
60
61 /*10*/ u16 pcmcia;
62 u16 reserved4;
63 /*14*/ u16 board;
64 u16 reserved5;
65 /*18*/ u16 disk_leds;
66 u16 reserved6;
67 /*1C*/ u16 system;
68 u16 reserved7;
69
70 /*20*/ u16 intclr;
71 u16 reserved8;
72 /*24*/ u16 intset;
73 u16 reserved9;
74 /*28*/ u16 intclr_mask;
75 u16 reserved10;
76 /*2C*/ u16 intset_mask;
77 u16 reserved11;
78
79 /*30*/ u16 sig_status;
80 u16 reserved12;
81 /*34*/ u16 int_status;
82 u16 reserved13;
83 /*38*/ u16 reserved14;
84 u16 reserved15;
85 /*3C*/ u16 reserved16;
86 u16 reserved17;
87
88} BCSR;
89
90static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
91
92/*
93 * Register bit definitions for the BCSRs
94 */
95#define BCSR_WHOAMI_DCID 0x000F
96#define BCSR_WHOAMI_CPLD 0x00F0
97#define BCSR_WHOAMI_BOARD 0x0F00
98
99#define BCSR_STATUS_PCMCIA0VS 0x0003
100#define BCSR_STATUS_PCMCIA1VS 0x000C
101#define BCSR_STATUS_SWAPBOOT 0x0040
102#define BCSR_STATUS_FLASHBUSY 0x0100
103#define BCSR_STATUS_IDECBLID 0x0200
104#define BCSR_STATUS_SD0WP 0x0400
105#define BCSR_STATUS_SD1WP 0x0800
106#define BCSR_STATUS_U0RXD 0x1000
107#define BCSR_STATUS_U1RXD 0x2000
108
109#define BCSR_SWITCHES_OCTAL 0x00FF
110#define BCSR_SWITCHES_DIP_1 0x0080
111#define BCSR_SWITCHES_DIP_2 0x0040
112#define BCSR_SWITCHES_DIP_3 0x0020
113#define BCSR_SWITCHES_DIP_4 0x0010
114#define BCSR_SWITCHES_DIP_5 0x0008
115#define BCSR_SWITCHES_DIP_6 0x0004
116#define BCSR_SWITCHES_DIP_7 0x0002
117#define BCSR_SWITCHES_DIP_8 0x0001
118#define BCSR_SWITCHES_ROTARY 0x0F00
119
120#define BCSR_RESETS_ETH 0x0001
121#define BCSR_RESETS_CAMERA 0x0002
122#define BCSR_RESETS_DC 0x0004
123#define BCSR_RESETS_IDE 0x0008
124/* not resets but in the same register */
125#define BCSR_RESETS_WSCFSM 0x0800
126#define BCSR_RESETS_PCS0MUX 0x1000
127#define BCSR_RESETS_PCS1MUX 0x2000
128#define BCSR_RESETS_SPISEL 0x4000
129#define BCSR_RESETS_SD1MUX 0x8000
130
131#define BCSR_PCMCIA_PC0VPP 0x0003
132#define BCSR_PCMCIA_PC0VCC 0x000C
133#define BCSR_PCMCIA_PC0DRVEN 0x0010
134#define BCSR_PCMCIA_PC0RST 0x0080
135#define BCSR_PCMCIA_PC1VPP 0x0300
136#define BCSR_PCMCIA_PC1VCC 0x0C00
137#define BCSR_PCMCIA_PC1DRVEN 0x1000
138#define BCSR_PCMCIA_PC1RST 0x8000
139
140#define BCSR_BOARD_LCDVEE 0x0001
141#define BCSR_BOARD_LCDVDD 0x0002
142#define BCSR_BOARD_LCDBL 0x0004
143#define BCSR_BOARD_CAMSNAP 0x0010
144#define BCSR_BOARD_CAMPWR 0x0020
145#define BCSR_BOARD_SD0PWR 0x0040
146#define BCSR_BOARD_SD1PWR 0x0080
147
148#define BCSR_LEDS_DECIMALS 0x00FF
149#define BCSR_LEDS_LED0 0x0100
150#define BCSR_LEDS_LED1 0x0200
151#define BCSR_LEDS_LED2 0x0400
152#define BCSR_LEDS_LED3 0x0800
153
154#define BCSR_SYSTEM_VDDI 0x001F
155#define BCSR_SYSTEM_POWEROFF 0x4000
156#define BCSR_SYSTEM_RESET 0x8000
157
158/* Bit positions for the different interrupt sources */
159#define BCSR_INT_IDE 0x0001
160#define BCSR_INT_ETH 0x0002
161#define BCSR_INT_PC0 0x0004
162#define BCSR_INT_PC0STSCHG 0x0008
163#define BCSR_INT_PC1 0x0010
164#define BCSR_INT_PC1STSCHG 0x0020
165#define BCSR_INT_DC 0x0040
166#define BCSR_INT_FLASHBUSY 0x0080
167#define BCSR_INT_PC0INSERT 0x0100
168#define BCSR_INT_PC0EJECT 0x0200
169#define BCSR_INT_PC1INSERT 0x0400
170#define BCSR_INT_PC1EJECT 0x0800
171#define BCSR_INT_SD0INSERT 0x1000
172#define BCSR_INT_SD0EJECT 0x2000
173#define BCSR_INT_SD1INSERT 0x4000
174#define BCSR_INT_SD1EJECT 0x8000
175
176/* PCMCIA Db1x00 specific defines */
177#define PCMCIA_MAX_SOCK 1
178#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
179
180/* VPP/VCC */
181#define SET_VCC_VPP(VCC, VPP, SLOT)\
182 ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
183
184#define AU1XXX_SMC91111_PHYS_ADDR (0x0D000300)
185#define AU1XXX_SMC91111_IRQ PB1200_ETH_INT
186
187#define AU1XXX_ATA_PHYS_ADDR (0x0C800000)
188#define AU1XXX_ATA_PHYS_LEN (0x100)
189#define AU1XXX_ATA_REG_OFFSET (5)
190#define AU1XXX_ATA_INT PB1200_IDE_INT
191#define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1;
192#define AU1XXX_ATA_RQSIZE 128
193
194#define NAND_PHYS_ADDR 0x1C000000
195
196/* Timing values as described in databook, * ns value stripped of
197 * lower 2 bits.
198 * These defines are here rather than an SOC1200 generic file because
199 * the parts chosen on another board may be different and may require
200 * different timings.
201 */
202#define NAND_T_H (18 >> 2)
203#define NAND_T_PUL (30 >> 2)
204#define NAND_T_SU (30 >> 2)
205#define NAND_T_WH (30 >> 2)
206
207/* Bitfield shift amounts */
208#define NAND_T_H_SHIFT 0
209#define NAND_T_PUL_SHIFT 4
210#define NAND_T_SU_SHIFT 8
211#define NAND_T_WH_SHIFT 12
212
213#define NAND_TIMING ((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
214 ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
215 ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
216 ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)
217
218
219/*
220 * External Interrupts for Pb1200 as of 8/6/2004.
221 * Bit positions in the CPLD registers can be calculated by taking
222 * the interrupt define and subtracting the PB1200_INT_BEGIN value.
223 * *example: IDE bis pos is = 64 - 64
224 ETH bit pos is = 65 - 64
225 */
226#define PB1200_INT_BEGIN (AU1000_LAST_INTC1_INT + 1)
227#define PB1200_IDE_INT (PB1200_INT_BEGIN + 0)
228#define PB1200_ETH_INT (PB1200_INT_BEGIN + 1)
229#define PB1200_PC0_INT (PB1200_INT_BEGIN + 2)
230#define PB1200_PC0_STSCHG_INT (PB1200_INT_BEGIN + 3)
231#define PB1200_PC1_INT (PB1200_INT_BEGIN + 4)
232#define PB1200_PC1_STSCHG_INT (PB1200_INT_BEGIN + 5)
233#define PB1200_DC_INT (PB1200_INT_BEGIN + 6)
234#define PB1200_FLASHBUSY_INT (PB1200_INT_BEGIN + 7)
235#define PB1200_PC0_INSERT_INT (PB1200_INT_BEGIN + 8)
236#define PB1200_PC0_EJECT_INT (PB1200_INT_BEGIN + 9)
237#define PB1200_PC1_INSERT_INT (PB1200_INT_BEGIN + 10)
238#define PB1200_PC1_EJECT_INT (PB1200_INT_BEGIN + 11)
239#define PB1200_SD0_INSERT_INT (PB1200_INT_BEGIN + 12)
240#define PB1200_SD0_EJECT_INT (PB1200_INT_BEGIN + 13)
241#define PB1200_SD1_INSERT_INT (PB1200_INT_BEGIN + 14)
242#define PB1200_SD1_EJECT_INT (PB1200_INT_BEGIN + 15)
243
244#define PB1200_INT_END (PB1200_INT_BEGIN + 15)
245
246/* For drivers/pcmcia/au1000_db1x00.c */
247#define BOARD_PC0_INT PB1200_PC0_INT
248#define BOARD_PC1_INT PB1200_PC1_INT
249#define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1<<(8+(2*SOCKET)))
250
251#endif /* __ASM_PB1200_H */
252
diff --git a/include/asm-mips/mach-pnx8550/cm.h b/include/asm-mips/mach-pnx8550/cm.h
new file mode 100644
index 000000000000..bb0a56c7d011
--- /dev/null
+++ b/include/asm-mips/mach-pnx8550/cm.h
@@ -0,0 +1,43 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Clock module specific definitions
5 *
6 * Author: source@mvista.com
7 *
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 */
21
22#ifndef __PNX8550_CM_H
23#define __PNX8550_CM_H
24
25#define PNX8550_CM_BASE 0xBBE47000
26
27#define PNX8550_CM_PLL0_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x000)
28#define PNX8550_CM_PLL1_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x004)
29#define PNX8550_CM_PLL2_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x008)
30#define PNX8550_CM_PLL3_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x00C)
31
32// Table not complete.....
33
34#define PNX8550_CM_PLL_BLOCKED_MASK 0x80000000
35#define PNX8550_CM_PLL_LOCK_MASK 0x40000000
36#define PNX8550_CM_PLL_CURRENT_ADJ_MASK 0x3c000000
37#define PNX8550_CM_PLL_N_MASK 0x01ff0000
38#define PNX8550_CM_PLL_M_MASK 0x00003f00
39#define PNX8550_CM_PLL_P_MASK 0x0000000c
40#define PNX8550_CM_PLL_PD_MASK 0x00000002
41
42
43#endif
diff --git a/include/asm-mips/mach-pnx8550/glb.h b/include/asm-mips/mach-pnx8550/glb.h
new file mode 100644
index 000000000000..07aa85e609bc
--- /dev/null
+++ b/include/asm-mips/mach-pnx8550/glb.h
@@ -0,0 +1,86 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * PNX8550 global definitions
5 *
6 * Author: source@mvista.com
7 *
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 */
21
22#ifndef __PNX8550_GLB_H
23#define __PNX8550_GLB_H
24
25#define PNX8550_GLB1_BASE 0xBBE63000
26#define PNX8550_GLB2_BASE 0xBBE4d000
27#define PNX8550_RESET_BASE 0xBBE60000
28
29/* PCI Inta Output Enable Registers */
30#define PNX8550_GLB2_ENAB_INTA_O *(volatile unsigned long *)(PNX8550_GLB2_BASE + 0x050)
31
32/* Bit 1:Enable DAC Powerdown
33 0:DACs are enabled and are working normally
34 1:DACs are powerdown
35*/
36#define PNX8550_GLB_DAC_PD 0x2
37/* Bit 0:Enable of PCI inta output
38 0 = Disable PCI inta output
39 1 = Enable PCI inta output
40*/
41#define PNX8550_GLB_ENABLE_INTA_O 0x1
42
43/* PCI Direct Mappings */
44#define PNX8550_PCIMEM 0x12000000
45#define PNX8550_PCIMEM_SIZE 0x08000000
46#define PNX8550_PCIIO 0x1c000000
47#define PNX8550_PCIIO_SIZE 0x02000000 /* 32M */
48
49#define PNX8550_PORT_BASE KSEG1
50
51// GPIO def
52#define PNX8550_GPIO_BASE 0x1Be00000
53
54#define PNX8550_GPIO_DIRQ0 (PNX8550_GPIO_BASE + 0x104500)
55#define PNX8550_GPIO_MC1 (PNX8550_GPIO_BASE + 0x104004)
56#define PNX8550_GPIO_MC_31_BIT 30
57#define PNX8550_GPIO_MC_30_BIT 28
58#define PNX8550_GPIO_MC_29_BIT 26
59#define PNX8550_GPIO_MC_28_BIT 24
60#define PNX8550_GPIO_MC_27_BIT 22
61#define PNX8550_GPIO_MC_26_BIT 20
62#define PNX8550_GPIO_MC_25_BIT 18
63#define PNX8550_GPIO_MC_24_BIT 16
64#define PNX8550_GPIO_MC_23_BIT 14
65#define PNX8550_GPIO_MC_22_BIT 12
66#define PNX8550_GPIO_MC_21_BIT 10
67#define PNX8550_GPIO_MC_20_BIT 8
68#define PNX8550_GPIO_MC_19_BIT 6
69#define PNX8550_GPIO_MC_18_BIT 4
70#define PNX8550_GPIO_MC_17_BIT 2
71#define PNX8550_GPIO_MC_16_BIT 0
72
73#define PNX8550_GPIO_MODE_PRIMOP 0x1
74#define PNX8550_GPIO_MODE_NO_OPENDR 0x2
75#define PNX8550_GPIO_MODE_OPENDR 0x3
76
77// RESET module
78#define PNX8550_RST_CTL *(volatile unsigned long *)(PNX8550_RESET_BASE + 0x0)
79#define PNX8550_RST_CAUSE *(volatile unsigned long *)(PNX8550_RESET_BASE + 0x4)
80#define PNX8550_RST_EN_WATCHDOG *(volatile unsigned long *)(PNX8550_RESET_BASE + 0x8)
81
82#define PNX8550_RST_REL_MIPS_RST_N 0x8
83#define PNX8550_RST_DO_SW_RST 0x4
84#define PNX8550_RST_REL_SYS_RST_OUT 0x2
85#define PNX8550_RST_ASSERT_SYS_RST_OUT 0x1
86#endif
diff --git a/include/asm-mips/mach-pnx8550/int.h b/include/asm-mips/mach-pnx8550/int.h
new file mode 100644
index 000000000000..0e0668b524f4
--- /dev/null
+++ b/include/asm-mips/mach-pnx8550/int.h
@@ -0,0 +1,140 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Interrupt specific definitions
5 *
6 * Author: source@mvista.com
7 *
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 */
21
22#ifndef __PNX8550_INT_H
23#define __PNX8550_INT_H
24
25#define PNX8550_GIC_BASE 0xBBE3E000
26
27#define PNX8550_GIC_PRIMASK_0 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x000)
28#define PNX8550_GIC_PRIMASK_1 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x004)
29#define PNX8550_GIC_VECTOR_0 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x100)
30#define PNX8550_GIC_VECTOR_1 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x104)
31#define PNX8550_GIC_PEND_1_31 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x200)
32#define PNX8550_GIC_PEND_32_63 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x204)
33#define PNX8550_GIC_PEND_64_70 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x208)
34#define PNX8550_GIC_FEATURES *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x300)
35#define PNX8550_GIC_REQ(x) *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x400 + (x)*4)
36#define PNX8550_GIC_MOD_ID *(volatile unsigned long *)(PNX8550_GIC_BASE + 0xFFC)
37
38// cp0 is two software + six hw exceptions
39#define PNX8550_INT_CP0_TOTINT 8
40#define PNX8550_INT_CP0_MIN 0
41#define PNX8550_INT_CP0_MAX (PNX8550_INT_CP0_MIN + PNX8550_INT_CP0_TOTINT - 1)
42
43#define MIPS_CPU_GIC_IRQ 2
44#define MIPS_CPU_TIMER_IRQ 7
45
46// GIC are 71 exceptions connected to cp0's first hardware exception
47#define PNX8550_INT_GIC_TOTINT 71
48#define PNX8550_INT_GIC_MIN (PNX8550_INT_CP0_MAX+1)
49#define PNX8550_INT_GIC_MAX (PNX8550_INT_GIC_MIN + PNX8550_INT_GIC_TOTINT - 1)
50
51#define PNX8550_INT_UNDEF (PNX8550_INT_GIC_MIN+0)
52#define PNX8550_INT_IPC_TARGET0_MIPS (PNX8550_INT_GIC_MIN+1)
53#define PNX8550_INT_IPC_TARGET1_TM32_1 (PNX8550_INT_GIC_MIN+2)
54#define PNX8550_INT_IPC_TARGET1_TM32_2 (PNX8550_INT_GIC_MIN+3)
55#define PNX8550_INT_RESERVED_4 (PNX8550_INT_GIC_MIN+4)
56#define PNX8550_INT_USB (PNX8550_INT_GIC_MIN+5)
57#define PNX8550_INT_GPIO_EQ1 (PNX8550_INT_GIC_MIN+6)
58#define PNX8550_INT_GPIO_EQ2 (PNX8550_INT_GIC_MIN+7)
59#define PNX8550_INT_GPIO_EQ3 (PNX8550_INT_GIC_MIN+8)
60#define PNX8550_INT_GPIO_EQ4 (PNX8550_INT_GIC_MIN+9)
61
62#define PNX8550_INT_GPIO_EQ5 (PNX8550_INT_GIC_MIN+10)
63#define PNX8550_INT_GPIO_EQ6 (PNX8550_INT_GIC_MIN+11)
64#define PNX8550_INT_RESERVED_12 (PNX8550_INT_GIC_MIN+12)
65#define PNX8550_INT_QVCP1 (PNX8550_INT_GIC_MIN+13)
66#define PNX8550_INT_QVCP2 (PNX8550_INT_GIC_MIN+14)
67#define PNX8550_INT_I2C1 (PNX8550_INT_GIC_MIN+15)
68#define PNX8550_INT_I2C2 (PNX8550_INT_GIC_MIN+16)
69#define PNX8550_INT_ISO_UART1 (PNX8550_INT_GIC_MIN+17)
70#define PNX8550_INT_ISO_UART2 (PNX8550_INT_GIC_MIN+18)
71#define PNX8550_INT_UART1 (PNX8550_INT_GIC_MIN+19)
72
73#define PNX8550_INT_UART2 (PNX8550_INT_GIC_MIN+20)
74#define PNX8550_INT_QNTR (PNX8550_INT_GIC_MIN+21)
75#define PNX8550_INT_RESERVED22 (PNX8550_INT_GIC_MIN+22)
76#define PNX8550_INT_T_DSC (PNX8550_INT_GIC_MIN+23)
77#define PNX8550_INT_M_DSC (PNX8550_INT_GIC_MIN+24)
78#define PNX8550_INT_RESERVED25 (PNX8550_INT_GIC_MIN+25)
79#define PNX8550_INT_2D_DRAW_ENG (PNX8550_INT_GIC_MIN+26)
80#define PNX8550_INT_MEM_BASED_SCALAR1 (PNX8550_INT_GIC_MIN+27)
81#define PNX8550_INT_VIDEO_MPEG (PNX8550_INT_GIC_MIN+28)
82#define PNX8550_INT_VIDEO_INPUT_P1 (PNX8550_INT_GIC_MIN+29)
83
84#define PNX8550_INT_VIDEO_INPUT_P2 (PNX8550_INT_GIC_MIN+30)
85#define PNX8550_INT_SPDI1 (PNX8550_INT_GIC_MIN+31)
86#define PNX8550_INT_SPDO (PNX8550_INT_GIC_MIN+32)
87#define PNX8550_INT_AUDIO_INPUT1 (PNX8550_INT_GIC_MIN+33)
88#define PNX8550_INT_AUDIO_OUTPUT1 (PNX8550_INT_GIC_MIN+34)
89#define PNX8550_INT_AUDIO_INPUT2 (PNX8550_INT_GIC_MIN+35)
90#define PNX8550_INT_AUDIO_OUTPUT2 (PNX8550_INT_GIC_MIN+36)
91#define PNX8550_INT_MEMBASED_SCALAR2 (PNX8550_INT_GIC_MIN+37)
92#define PNX8550_INT_VPK (PNX8550_INT_GIC_MIN+38)
93#define PNX8550_INT_MPEG1_MIPS (PNX8550_INT_GIC_MIN+39)
94
95#define PNX8550_INT_MPEG1_TM (PNX8550_INT_GIC_MIN+40)
96#define PNX8550_INT_MPEG2_MIPS (PNX8550_INT_GIC_MIN+41)
97#define PNX8550_INT_MPEG2_TM (PNX8550_INT_GIC_MIN+42)
98#define PNX8550_INT_TS_DMA (PNX8550_INT_GIC_MIN+43)
99#define PNX8550_INT_EDMA (PNX8550_INT_GIC_MIN+44)
100#define PNX8550_INT_TM_DEBUG1 (PNX8550_INT_GIC_MIN+45)
101#define PNX8550_INT_TM_DEBUG2 (PNX8550_INT_GIC_MIN+46)
102#define PNX8550_INT_PCI_INTA (PNX8550_INT_GIC_MIN+47)
103#define PNX8550_INT_CLOCK_MODULE (PNX8550_INT_GIC_MIN+48)
104#define PNX8550_INT_PCI_XIO_INTA_PCI (PNX8550_INT_GIC_MIN+49)
105
106#define PNX8550_INT_PCI_XIO_INTB_DMA (PNX8550_INT_GIC_MIN+50)
107#define PNX8550_INT_PCI_XIO_INTC_GPPM (PNX8550_INT_GIC_MIN+51)
108#define PNX8550_INT_PCI_XIO_INTD_GPXIO (PNX8550_INT_GIC_MIN+52)
109#define PNX8550_INT_DVD_CSS (PNX8550_INT_GIC_MIN+53)
110#define PNX8550_INT_VLD (PNX8550_INT_GIC_MIN+54)
111#define PNX8550_INT_GPIO_TSU_7_0 (PNX8550_INT_GIC_MIN+55)
112#define PNX8550_INT_GPIO_TSU_15_8 (PNX8550_INT_GIC_MIN+56)
113#define PNX8550_INT_GPIO_CTU_IR (PNX8550_INT_GIC_MIN+57)
114#define PNX8550_INT_GPIO0 (PNX8550_INT_GIC_MIN+58)
115#define PNX8550_INT_GPIO1 (PNX8550_INT_GIC_MIN+59)
116
117#define PNX8550_INT_GPIO2 (PNX8550_INT_GIC_MIN+60)
118#define PNX8550_INT_GPIO3 (PNX8550_INT_GIC_MIN+61)
119#define PNX8550_INT_GPIO4 (PNX8550_INT_GIC_MIN+62)
120#define PNX8550_INT_GPIO5 (PNX8550_INT_GIC_MIN+63)
121#define PNX8550_INT_GPIO6 (PNX8550_INT_GIC_MIN+64)
122#define PNX8550_INT_GPIO7 (PNX8550_INT_GIC_MIN+65)
123#define PNX8550_INT_PMAN_SECURITY (PNX8550_INT_GIC_MIN+66)
124#define PNX8550_INT_I2C3 (PNX8550_INT_GIC_MIN+67)
125#define PNX8550_INT_RESERVED_68 (PNX8550_INT_GIC_MIN+68)
126#define PNX8550_INT_SPDI2 (PNX8550_INT_GIC_MIN+69)
127
128#define PNX8550_INT_I2C4 (PNX8550_INT_GIC_MIN+70)
129
130// Timer are 3 exceptions connected to cp0's 7th hardware exception
131#define PNX8550_INT_TIMER_TOTINT 3
132#define PNX8550_INT_TIMER_MIN (PNX8550_INT_GIC_MAX+1)
133#define PNX8550_INT_TIMER_MAX (PNX8550_INT_TIMER_MIN + PNX8550_INT_TIMER_TOTINT - 1)
134
135#define PNX8550_INT_TIMER1 (PNX8550_INT_TIMER_MIN+0)
136#define PNX8550_INT_TIMER2 (PNX8550_INT_TIMER_MIN+1)
137#define PNX8550_INT_TIMER3 (PNX8550_INT_TIMER_MIN+2)
138#define PNX8550_INT_WATCHDOG PNX8550_INT_TIMER3
139
140#endif
diff --git a/include/asm-mips/mach-pnx8550/kernel-entry-init.h b/include/asm-mips/mach-pnx8550/kernel-entry-init.h
new file mode 100644
index 000000000000..57102fa9da51
--- /dev/null
+++ b/include/asm-mips/mach-pnx8550/kernel-entry-init.h
@@ -0,0 +1,262 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005 Embedded Alley Solutions, Inc
7 */
8#ifndef __ASM_MACH_KERNEL_ENTRY_INIT_H
9#define __ASM_MACH_KERNEL_ENTRY_INIT_H
10
11#include <asm/cacheops.h>
12#include <asm/addrspace.h>
13
14#define CO_CONFIGPR_VALID 0x3F1F41FF /* valid bits to write to ConfigPR */
15#define HAZARD_CP0 nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
16#define CACHE_OPC 0xBC000000 /* MIPS cache instruction opcode */
17#define ICACHE_LINE_SIZE 32 /* Instruction cache line size bytes */
18#define DCACHE_LINE_SIZE 32 /* Data cache line size in bytes */
19
20#define ICACHE_SET_COUNT 256 /* Instruction cache set count */
21#define DCACHE_SET_COUNT 128 /* Data cache set count */
22
23#define ICACHE_SET_SIZE (ICACHE_SET_COUNT * ICACHE_LINE_SIZE)
24#define DCACHE_SET_SIZE (DCACHE_SET_COUNT * DCACHE_LINE_SIZE)
25
26 .macro kernel_entry_setup
27 .set push
28 .set noreorder
29 /*
30 * PNX8550 entry point, when running a non compressed
31 * kernel. When loading a zImage, the head.S code in
32 * arch/mips/zboot/pnx8550 will init the caches and,
33 * decompress the kernel, and branch to kernel_entry.
34 */
35cache_begin: li t0, (1<<28)
36 mtc0 t0, CP0_STATUS /* cp0 usable */
37 HAZARD_CP0
38
39 mtc0 zero, CP0_CAUSE
40 HAZARD_CP0
41
42
43 /* Set static virtual to phys address translation and TLB disabled */
44 mfc0 t0, CP0_CONFIG, 7
45 HAZARD_CP0
46
47 and t0,~((1<<19) | (1<<20)) /* TLB/MAP cleared */
48 mtc0 t0, CP0_CONFIG, 7
49 HAZARD_CP0
50
51 /* CPU boots with kseg0 cache algo set to 0x2 -- uncached */
52
53 init_icache
54 nop
55 init_dcache
56 nop
57
58 cachePr4450ICReset
59 nop
60
61 cachePr4450DCReset
62 nop
63
64 /* read ConfigPR into t0 */
65 mfc0 t0, CP0_CONFIG, 7
66 HAZARD_CP0
67
68 /* enable the TLB */
69 or t0, (1<<19)
70
71 /* disable the ICACHE: at least 10x slower */
72 /* or t0, (1<<26) */
73
74 /* disable the DCACHE; CONFIG_CPU_HAS_LLSC should not be set */
75 /* or t0, (1<<27) */
76
77 and t0, CO_CONFIGPR_VALID
78
79 /* enable TLB. */
80 mtc0 t0, CP0_CONFIG, 7
81 HAZARD_CP0
82cache_end:
83 /* Setup CMEM_0 to MMIO address space, 2MB */
84 lui t0, 0x1BE0
85 addi t0, t0, 0x3
86 mtc0 $8, $22, 4
87 nop
88
89 /* Setup CMEM_1, 128MB */
90 lui t0, 0x1000
91 addi t0, t0, 0xf
92 mtc0 $8, $22, 5
93 nop
94
95
96 /* Setup CMEM_2, 32MB */
97 lui t0, 0x1C00
98 addi t0, t0, 0xb
99 mtc0 $8, $22, 6
100 nop
101
102 /* Setup CMEM_3, 0MB */
103 lui t0, 0x0
104 addi t0, t0, 0x0
105 mtc0 $8, $22, 7
106 nop
107
108 /* Enable cache */
109 mfc0 t0, CP0_CONFIG
110 HAZARD_CP0
111 and t0, t0, 0xFFFFFFF8
112 or t0, t0, 3
113 mtc0 t0, CP0_CONFIG
114 HAZARD_CP0
115 .set pop
116 .endm
117
118 .macro init_icache
119 .set push
120 .set noreorder
121
122 /* Get Cache Configuration */
123 mfc0 t3, CP0_CONFIG, 1
124 HAZARD_CP0
125
126 /* get cache Line size */
127
128 srl t1, t3, 19 /* C0_CONFIGPR_IL_SHIFT */
129 andi t1, t1, 0x7 /* C0_CONFIGPR_IL_MASK */
130 beq t1, zero, pr4450_instr_cache_invalidated /* if zero instruction cache is absent */
131 nop
132 addiu t0, t1, 1
133 ori t1, zero, 1
134 sllv t1, t1, t0
135
136 /* get max cache Index */
137 srl t2, t3, 22 /* C0_CONFIGPR_IS_SHIFT */
138 andi t2, t2, 0x7 /* C0_CONFIGPR_IS_MASK */
139 addiu t0, t2, 6
140 ori t2, zero, 1
141 sllv t2, t2, t0
142
143 /* get max cache way */
144 srl t3, t3, 16 /* C0_CONFIGPR_IA_SHIFT */
145 andi t3, t3, 0x7 /* C0_CONFIGPR_IA_MASK */
146 addiu t3, t3, 1
147
148 /* total no of cache lines */
149 multu t2, t3 /* max index * max way */
150 mflo t2
151 addiu t2, t2, -1
152
153 move t0, zero
154pr4450_next_instruction_cache_set:
155 cache Index_Invalidate_I, 0(t0)
156 addu t0, t0, t1 /* add bytes in a line */
157 bne t2, zero, pr4450_next_instruction_cache_set
158 addiu t2, t2, -1 /* reduce no of lines to invalidate by one */
159pr4450_instr_cache_invalidated:
160 .set pop
161 .endm
162
163 .macro init_dcache
164 .set push
165 .set noreorder
166 move t1, zero
167
168 /* Store Tag Information */
169 mtc0 zero, CP0_TAGLO, 0
170 HAZARD_CP0
171
172 mtc0 zero, CP0_TAGHI, 0
173 HAZARD_CP0
174
175 /* Cache size is 16384 = 512 lines x 32 bytes per line */
176 or t2, zero, (128*4)-1 /* 512 lines */
177 /* Invalidate all lines */
1782:
179 cache Index_Store_Tag_D, 0(t1)
180 addiu t2, t2, -1
181 bne t2, zero, 2b
182 addiu t1, t1, 32 /* 32 bytes in a line */
183 .set pop
184 .endm
185
186 .macro cachePr4450ICReset
187 .set push
188 .set noreorder
189
190 /* Save CP0 status reg on entry; */
191 /* disable interrupts during cache reset */
192 mfc0 t0, CP0_STATUS /* T0 = interrupt status on entry */
193 HAZARD_CP0
194
195 mtc0 zero, CP0_STATUS /* disable CPU interrupts */
196 HAZARD_CP0
197
198 or t1, zero, zero /* T1 = starting cache index (0) */
199 ori t2, zero, (256 - 1) /* T2 = inst cache set cnt - 1 */
200
201 icache_invd_loop:
202 /* 9 == register t1 */
203 .word (CACHE_OPC | (9 << 21) | (Index_Invalidate_I << 16) | \
204 (0 * ICACHE_SET_SIZE)) /* invalidate inst cache WAY0 */
205 .word (CACHE_OPC | (9 << 21) | (Index_Invalidate_I << 16) | \
206 (1 * ICACHE_SET_SIZE)) /* invalidate inst cache WAY1 */
207
208 addiu t1, t1, ICACHE_LINE_SIZE /* T1 = next cache line index */
209 bne t2, zero, icache_invd_loop /* T2 = 0 if all sets invalidated */
210 addiu t2, t2, -1 /* decrement T2 set cnt (delay slot) */
211
212 /* Initialize the latches in the instruction cache tag */
213 /* that drive the way selection tri-state bus drivers, by doing a */
214 /* dummy load while the instruction cache is still disabled. */
215 /* TODO: Is this needed ? */
216 la t1, KSEG0 /* T1 = cached memory base address */
217 lw zero, 0x0000(t1) /* (dummy read of first memory word) */
218
219 mtc0 t0, CP0_STATUS /* restore interrupt status on entry */
220 HAZARD_CP0
221 .set pop
222 .endm
223
224 .macro cachePr4450DCReset
225 .set push
226 .set noreorder
227 mfc0 t0, CP0_STATUS /* T0 = interrupt status on entry */
228 HAZARD_CP0
229 mtc0 zero, CP0_STATUS /* disable CPU interrupts */
230 HAZARD_CP0
231
232 /* Writeback/invalidate entire data cache sets/ways/lines */
233 or t1, zero, zero /* T1 = starting cache index (0) */
234 ori t2, zero, (DCACHE_SET_COUNT - 1) /* T2 = data cache set cnt - 1 */
235
236 dcache_wbinvd_loop:
237 /* 9 == register t1 */
238 .word (CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \
239 (0 * DCACHE_SET_SIZE)) /* writeback/invalidate WAY0 */
240 .word (CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \
241 (1 * DCACHE_SET_SIZE)) /* writeback/invalidate WAY1 */
242 .word (CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \
243 (2 * DCACHE_SET_SIZE)) /* writeback/invalidate WAY2 */
244 .word (CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \
245 (3 * DCACHE_SET_SIZE)) /* writeback/invalidate WAY3 */
246
247 addiu t1, t1, DCACHE_LINE_SIZE /* T1 = next data cache line index */
248 bne t2, zero, dcache_wbinvd_loop /* T2 = 0 when wbinvd entire cache */
249 addiu t2, t2, -1 /* decrement T2 set cnt (delay slot) */
250
251 /* Initialize the latches in the data cache tag that drive the way
252 selection tri-state bus drivers, by doing a dummy load while the
253 data cache is still in the disabled mode. TODO: Is this needed ? */
254 la t1, KSEG0 /* T1 = cached memory base address */
255 lw zero, 0x0000(t1) /* (dummy read of first memory word) */
256
257 mtc0 t0, CP0_STATUS /* restore interrupt status on entry */
258 HAZARD_CP0
259 .set pop
260 .endm
261
262#endif /* __ASM_MACH_KERNEL_ENTRY_INIT_H */
diff --git a/include/asm-mips/mach-pnx8550/nand.h b/include/asm-mips/mach-pnx8550/nand.h
new file mode 100644
index 000000000000..aefbc514ab09
--- /dev/null
+++ b/include/asm-mips/mach-pnx8550/nand.h
@@ -0,0 +1,121 @@
1#ifndef __PNX8550_NAND_H
2#define __PNX8550_NAND_H
3
4#define PNX8550_NAND_BASE_ADDR 0x10000000
5#define PNX8550_PCIXIO_BASE 0xBBE40000
6
7#define PNX8550_DMA_EXT_ADDR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x800)
8#define PNX8550_DMA_INT_ADDR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x804)
9#define PNX8550_DMA_TRANS_SIZE *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x808)
10#define PNX8550_DMA_CTRL *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x80c)
11#define PNX8550_XIO_SEL0 *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x814)
12#define PNX8550_GPXIO_ADDR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x820)
13#define PNX8550_GPXIO_WR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x824)
14#define PNX8550_GPXIO_RD *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x828)
15#define PNX8550_GPXIO_CTRL *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x82C)
16#define PNX8550_XIO_FLASH_CTRL *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x830)
17#define PNX8550_GPXIO_INT_STATUS *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfb0)
18#define PNX8550_GPXIO_INT_ENABLE *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfb4)
19#define PNX8550_GPXIO_INT_CLEAR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfb8)
20#define PNX8550_DMA_INT_STATUS *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfd0)
21#define PNX8550_DMA_INT_ENABLE *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfd4)
22#define PNX8550_DMA_INT_CLEAR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfd8)
23
24#define PNX8550_XIO_SEL0_EN_16BIT 0x00800000
25#define PNX8550_XIO_SEL0_USE_ACK 0x00400000
26#define PNX8550_XIO_SEL0_REN_HIGH 0x00100000
27#define PNX8550_XIO_SEL0_REN_LOW 0x00040000
28#define PNX8550_XIO_SEL0_WEN_HIGH 0x00010000
29#define PNX8550_XIO_SEL0_WEN_LOW 0x00004000
30#define PNX8550_XIO_SEL0_WAIT 0x00000200
31#define PNX8550_XIO_SEL0_OFFSET 0x00000020
32#define PNX8550_XIO_SEL0_TYPE_68360 0x00000000
33#define PNX8550_XIO_SEL0_TYPE_NOR 0x00000008
34#define PNX8550_XIO_SEL0_TYPE_NAND 0x00000010
35#define PNX8550_XIO_SEL0_TYPE_IDE 0x00000018
36#define PNX8550_XIO_SEL0_SIZE_8MB 0x00000000
37#define PNX8550_XIO_SEL0_SIZE_16MB 0x00000002
38#define PNX8550_XIO_SEL0_SIZE_32MB 0x00000004
39#define PNX8550_XIO_SEL0_SIZE_64MB 0x00000006
40#define PNX8550_XIO_SEL0_ENAB 0x00000001
41
42#define PNX8550_SEL0_DEFAULT ((PNX8550_XIO_SEL0_EN_16BIT) | \
43 (PNX8550_XIO_SEL0_REN_HIGH*0)| \
44 (PNX8550_XIO_SEL0_REN_LOW*2) | \
45 (PNX8550_XIO_SEL0_WEN_HIGH*0)| \
46 (PNX8550_XIO_SEL0_WEN_LOW*2) | \
47 (PNX8550_XIO_SEL0_WAIT*4) | \
48 (PNX8550_XIO_SEL0_OFFSET*0) | \
49 (PNX8550_XIO_SEL0_TYPE_NAND) | \
50 (PNX8550_XIO_SEL0_SIZE_32MB) | \
51 (PNX8550_XIO_SEL0_ENAB))
52
53#define PNX8550_GPXIO_PENDING 0x00000200
54#define PNX8550_GPXIO_DONE 0x00000100
55#define PNX8550_GPXIO_CLR_DONE 0x00000080
56#define PNX8550_GPXIO_INIT 0x00000040
57#define PNX8550_GPXIO_READ_CMD 0x00000010
58#define PNX8550_GPXIO_BEN 0x0000000F
59
60#define PNX8550_XIO_FLASH_64MB 0x00200000
61#define PNX8550_XIO_FLASH_INC_DATA 0x00100000
62#define PNX8550_XIO_FLASH_CMD_PH 0x000C0000
63#define PNX8550_XIO_FLASH_CMD_PH2 0x00080000
64#define PNX8550_XIO_FLASH_CMD_PH1 0x00040000
65#define PNX8550_XIO_FLASH_CMD_PH0 0x00000000
66#define PNX8550_XIO_FLASH_ADR_PH 0x00030000
67#define PNX8550_XIO_FLASH_ADR_PH3 0x00030000
68#define PNX8550_XIO_FLASH_ADR_PH2 0x00020000
69#define PNX8550_XIO_FLASH_ADR_PH1 0x00010000
70#define PNX8550_XIO_FLASH_ADR_PH0 0x00000000
71#define PNX8550_XIO_FLASH_CMD_B(x) ((x<<8) & 0x0000FF00)
72#define PNX8550_XIO_FLASH_CMD_A(x) (x & 0x000000FF)
73
74#define PNX8550_XIO_INT_ACK 0x00004000
75#define PNX8550_XIO_INT_COMPL 0x00002000
76#define PNX8550_XIO_INT_NONSUP 0x00000200
77#define PNX8550_XIO_INT_ABORT 0x00000004
78
79#define PNX8550_DMA_CTRL_SINGLE_DATA 0x00000400
80#define PNX8550_DMA_CTRL_SND2XIO 0x00000200
81#define PNX8550_DMA_CTRL_FIX_ADDR 0x00000100
82#define PNX8550_DMA_CTRL_BURST_8 0x00000000
83#define PNX8550_DMA_CTRL_BURST_16 0x00000020
84#define PNX8550_DMA_CTRL_BURST_32 0x00000040
85#define PNX8550_DMA_CTRL_BURST_64 0x00000060
86#define PNX8550_DMA_CTRL_BURST_128 0x00000080
87#define PNX8550_DMA_CTRL_BURST_256 0x000000A0
88#define PNX8550_DMA_CTRL_BURST_512 0x000000C0
89#define PNX8550_DMA_CTRL_BURST_NORES 0x000000E0
90#define PNX8550_DMA_CTRL_INIT_DMA 0x00000010
91#define PNX8550_DMA_CTRL_CMD_TYPE 0x0000000F
92
93/* see PCI system arch, page 100 for the full list: */
94#define PNX8550_DMA_CTRL_PCI_CMD_READ 0x00000006
95#define PNX8550_DMA_CTRL_PCI_CMD_WRITE 0x00000007
96
97#define PNX8550_DMA_INT_STAT_ACK_DONE (1<<14)
98#define PNX8550_DMA_INT_STAT_DMA_DONE (1<<12)
99#define PNX8550_DMA_INT_STAT_DMA_ERR (1<<9)
100#define PNX8550_DMA_INT_STAT_PERR5 (1<<5)
101#define PNX8550_DMA_INT_STAT_PERR4 (1<<4)
102#define PNX8550_DMA_INT_STAT_M_ABORT (1<<2)
103#define PNX8550_DMA_INT_STAT_T_ABORT (1<<1)
104
105#define PNX8550_DMA_INT_EN_ACK_DONE (1<<14)
106#define PNX8550_DMA_INT_EN_DMA_DONE (1<<12)
107#define PNX8550_DMA_INT_EN_DMA_ERR (1<<9)
108#define PNX8550_DMA_INT_EN_PERR5 (1<<5)
109#define PNX8550_DMA_INT_EN_PERR4 (1<<4)
110#define PNX8550_DMA_INT_EN_M_ABORT (1<<2)
111#define PNX8550_DMA_INT_EN_T_ABORT (1<<1)
112
113#define PNX8550_DMA_INT_CLR_ACK_DONE (1<<14)
114#define PNX8550_DMA_INT_CLR_DMA_DONE (1<<12)
115#define PNX8550_DMA_INT_CLR_DMA_ERR (1<<9)
116#define PNX8550_DMA_INT_CLR_PERR5 (1<<5)
117#define PNX8550_DMA_INT_CLR_PERR4 (1<<4)
118#define PNX8550_DMA_INT_CLR_M_ABORT (1<<2)
119#define PNX8550_DMA_INT_CLR_T_ABORT (1<<1)
120
121#endif
diff --git a/include/asm-mips/mach-pnx8550/pci.h b/include/asm-mips/mach-pnx8550/pci.h
new file mode 100644
index 000000000000..b921508d701b
--- /dev/null
+++ b/include/asm-mips/mach-pnx8550/pci.h
@@ -0,0 +1,185 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * PCI specific definitions
5 *
6 * Author: source@mvista.com
7 *
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 */
21
22#ifndef __PNX8550_PCI_H
23#define __PNX8550_PCI_H
24
25#include <linux/types.h>
26#include <linux/pci.h>
27#include <linux/kernel.h>
28#include <linux/init.h>
29
30#define PCI_ACCESS_READ 0
31#define PCI_ACCESS_WRITE 1
32
33#define PCI_CMD_IOR 0x20
34#define PCI_CMD_IOW 0x30
35#define PCI_CMD_CONFIG_READ 0xa0
36#define PCI_CMD_CONFIG_WRITE 0xb0
37
38#define PCI_IO_TIMEOUT 1000
39#define PCI_IO_RETRY 5
40/* Timeout for IO and CFG accesses.
41 This is in 1/1024 th of a jiffie(=10ms)
42 i.e. approx 10us */
43#define PCI_IO_JIFFIES_TIMEOUT 40
44#define PCI_IO_JIFFIES_SHIFT 10
45
46#define PCI_BYTE_ENABLE_MASK 0x0000000f
47#define PCI_CFG_BUS_SHIFT 16
48#define PCI_CFG_FUNC_SHIFT 8
49#define PCI_CFG_REG_SHIFT 2
50
51#define PCI_BASE 0x1be00000
52#define PCI_SETUP 0x00040010
53#define PCI_DIS_REQGNT (1<<30)
54#define PCI_DIS_REQGNTA (1<<29)
55#define PCI_DIS_REQGNTB (1<<28)
56#define PCI_D2_SUPPORT (1<<27)
57#define PCI_D1_SUPPORT (1<<26)
58#define PCI_EN_TA (1<<24)
59#define PCI_EN_PCI2MMI (1<<23)
60#define PCI_EN_XIO (1<<22)
61#define PCI_BASE18_PREF (1<<21)
62#define SIZE_16M 0x3
63#define SIZE_32M 0x4
64#define SIZE_64M 0x5
65#define SIZE_128M 0x6
66#define PCI_SETUP_BASE18_SIZE(X) (X<<18)
67#define PCI_SETUP_BASE18_EN (1<<17)
68#define PCI_SETUP_BASE14_PREF (1<<16)
69#define PCI_SETUP_BASE14_SIZE(X) (X<<12)
70#define PCI_SETUP_BASE14_EN (1<<11)
71#define PCI_SETUP_BASE10_PREF (1<<10)
72#define PCI_SETUP_BASE10_SIZE(X) (X<<7)
73#define PCI_SETUP_CFGMANAGE_EN (1<<1)
74#define PCI_SETUP_PCIARB_EN (1<<0)
75
76#define PCI_CTRL 0x040014
77#define PCI_SWPB_DCS_PCI (1<<16)
78#define PCI_SWPB_PCI_PCI (1<<15)
79#define PCI_SWPB_PCI_DCS (1<<14)
80#define PCI_REG_WR_POST (1<<13)
81#define PCI_XIO_WR_POST (1<<12)
82#define PCI_PCI2_WR_POST (1<<13)
83#define PCI_PCI1_WR_POST (1<<12)
84#define PCI_SERR_SEEN (1<<11)
85#define PCI_B10_SPEC_RD (1<<6)
86#define PCI_B14_SPEC_RD (1<<5)
87#define PCI_B18_SPEC_RD (1<<4)
88#define PCI_B10_NOSUBWORD (1<<3)
89#define PCI_B14_NOSUBWORD (1<<2)
90#define PCI_B18_NOSUBWORD (1<<1)
91#define PCI_RETRY_TMREN (1<<0)
92
93#define PCI_BASE1_LO 0x040018
94#define PCI_BASE1_HI 0x04001C
95#define PCI_BASE2_LO 0x040020
96#define PCI_BASE2_HI 0x040024
97#define PCI_RDLIFETIM 0x040028
98#define PCI_GPPM_ADDR 0x04002C
99#define PCI_GPPM_WDAT 0x040030
100#define PCI_GPPM_RDAT 0x040034
101#define PCI_GPPM_CTRL 0x040038
102#define GPPM_DONE (1<<10)
103#define INIT_PCI_CYCLE (1<<9)
104#define GPPM_CMD(X) (((X)&0xf)<<4)
105#define GPPM_BYTEEN(X) ((X)&0xf)
106#define PCI_UNLOCKREG 0x04003C
107#define UNLOCK_SSID(X) (((X)&0xff)<<8)
108#define UNLOCK_SETUP(X) (((X)&0xff)<<0)
109#define UNLOCK_MAGIC 0xCA
110#define PCI_DEV_VEND_ID 0x040040
111#define DEVICE_ID(X) (((X)>>16)&0xffff)
112#define VENDOR_ID(X) (((X)&0xffff))
113#define PCI_CFG_CMDSTAT 0x040044
114#define PCI_CFG_STATUS(X) (((X)>>16)&0xffff)
115#define PCI_CFG_COMMAND(X) ((X)&0xffff)
116#define PCI_CLASS_REV 0x040048
117#define PCI_CLASSCODE(X) (((X)>>8)&0xffffff)
118#define PCI_REVID(X) ((X)&0xff)
119#define PCI_LAT_TMR 0x04004c
120#define PCI_BASE10 0x040050
121#define PCI_BASE14 0x040054
122#define PCI_BASE18 0x040058
123#define PCI_SUBSYS_ID 0x04006c
124#define PCI_CAP_PTR 0x040074
125#define PCI_CFG_MISC 0x04007c
126#define PCI_PMC 0x040080
127#define PCI_PWR_STATE 0x040084
128#define PCI_IO 0x040088
129#define PCI_SLVTUNING 0x04008C
130#define PCI_DMATUNING 0x040090
131#define PCI_DMAEADDR 0x040800
132#define PCI_DMAIADDR 0x040804
133#define PCI_DMALEN 0x040808
134#define PCI_DMACTRL 0x04080C
135#define PCI_XIOCTRL 0x040810
136#define PCI_SEL0PROF 0x040814
137#define PCI_SEL1PROF 0x040818
138#define PCI_SEL2PROF 0x04081C
139#define PCI_GPXIOADDR 0x040820
140#define PCI_NANDCTRLS 0x400830
141#define PCI_SEL3PROF 0x040834
142#define PCI_SEL4PROF 0x040838
143#define PCI_GPXIO_STAT 0x040FB0
144#define PCI_GPXIO_IMASK 0x040FB4
145#define PCI_GPXIO_ICLR 0x040FB8
146#define PCI_GPXIO_ISET 0x040FBC
147#define PCI_GPPM_STATUS 0x040FC0
148#define GPPM_DONE (1<<10)
149#define GPPM_ERR (1<<9)
150#define GPPM_MPAR_ERR (1<<8)
151#define GPPM_PAR_ERR (1<<7)
152#define GPPM_R_MABORT (1<<2)
153#define GPPM_R_TABORT (1<<1)
154#define PCI_GPPM_IMASK 0x040FC4
155#define PCI_GPPM_ICLR 0x040FC8
156#define PCI_GPPM_ISET 0x040FCC
157#define PCI_DMA_STATUS 0x040FD0
158#define PCI_DMA_IMASK 0x040FD4
159#define PCI_DMA_ICLR 0x040FD8
160#define PCI_DMA_ISET 0x040FDC
161#define PCI_ISTATUS 0x040FE0
162#define PCI_IMASK 0x040FE4
163#define PCI_ICLR 0x040FE8
164#define PCI_ISET 0x040FEC
165#define PCI_MOD_ID 0x040FFC
166
167/*
168 * PCI configuration cycle AD bus definition
169 */
170/* Type 0 */
171#define PCI_CFG_TYPE0_REG_SHF 0
172#define PCI_CFG_TYPE0_FUNC_SHF 8
173
174/* Type 1 */
175#define PCI_CFG_TYPE1_REG_SHF 0
176#define PCI_CFG_TYPE1_FUNC_SHF 8
177#define PCI_CFG_TYPE1_DEV_SHF 11
178#define PCI_CFG_TYPE1_BUS_SHF 16
179
180/*
181 * Ethernet device DP83816 definition
182 */
183#define DP83816_IRQ_ETHER 66
184
185#endif
diff --git a/include/asm-mips/mach-pnx8550/uart.h b/include/asm-mips/mach-pnx8550/uart.h
new file mode 100644
index 000000000000..e32b9a23d70e
--- /dev/null
+++ b/include/asm-mips/mach-pnx8550/uart.h
@@ -0,0 +1,16 @@
1#ifndef __IP3106_UART_H
2#define __IP3106_UART_H
3
4#include <int.h>
5
6/* early macros for kgdb use. fixme: clean this up */
7
8#define UART_BASE 0xbbe4a000 /* PNX8550 */
9
10#define PNX8550_UART_PORT0 (UART_BASE)
11#define PNX8550_UART_PORT1 (UART_BASE + 0x1000)
12
13#define PNX8550_UART_INT(x) (PNX8550_INT_GIC_MIN+19+x)
14#define IRQ_TO_UART(x) (x-PNX8550_INT_GIC_MIN-19)
15
16#endif
diff --git a/include/asm-mips/mach-pnx8550/usb.h b/include/asm-mips/mach-pnx8550/usb.h
new file mode 100644
index 000000000000..483b7fc65d41
--- /dev/null
+++ b/include/asm-mips/mach-pnx8550/usb.h
@@ -0,0 +1,32 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * USB specific definitions
5 *
6 * Author: source@mvista.com
7 *
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 */
21
22#ifndef __PNX8550_USB_H
23#define __PNX8550_USB_H
24
25/*
26 * USB Host controller
27 */
28
29#define PNX8550_USB_OHCI_OP_BASE 0x1be48000
30#define PNX8550_USB_OHCI_OP_LEN 0x1000
31
32#endif
diff --git a/include/asm-mips/mach-rm200/cpu-feature-overrides.h b/include/asm-mips/mach-rm200/cpu-feature-overrides.h
index f48736032b2a..79f9b064c864 100644
--- a/include/asm-mips/mach-rm200/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-rm200/cpu-feature-overrides.h
@@ -14,7 +14,7 @@
14 14
15#define cpu_has_tlb 1 15#define cpu_has_tlb 1
16#define cpu_has_4kex 1 16#define cpu_has_4kex 1
17#define cpu_has_4ktlb 1 17#define cpu_has_4kcache 1
18#define cpu_has_fpu 1 18#define cpu_has_fpu 1
19#define cpu_has_32fpr 1 19#define cpu_has_32fpr 1
20#define cpu_has_counter 1 20#define cpu_has_counter 1
@@ -31,6 +31,7 @@
31#define cpu_has_vtag_icache 0 31#define cpu_has_vtag_icache 0
32#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) 32#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000)
33#define cpu_has_ic_fills_f_dc 0 33#define cpu_has_ic_fills_f_dc 0
34#define cpu_has_dsp 0
34#define cpu_has_nofpuex 0 35#define cpu_has_nofpuex 0
35#define cpu_has_64bits 1 36#define cpu_has_64bits 1
36 37
diff --git a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
index a3a2cc6014b2..193a666cd131 100644
--- a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
@@ -25,6 +25,7 @@
25#define cpu_has_vtag_icache 1 25#define cpu_has_vtag_icache 1
26#define cpu_has_dc_aliases 0 26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0
28#define cpu_icache_snoops_remote_store 0 29#define cpu_icache_snoops_remote_store 0
29 30
30#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
diff --git a/include/asm-mips/mach-sim/cpu-feature-overrides.h b/include/asm-mips/mach-sim/cpu-feature-overrides.h
new file mode 100644
index 000000000000..cadbe8eda79c
--- /dev/null
+++ b/include/asm-mips/mach-sim/cpu-feature-overrides.h
@@ -0,0 +1,66 @@
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) 2003, 2004 Chris Dearman
7 */
8#ifndef __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H
10
11#include <linux/config.h>
12
13/*
14 * CPU feature overrides for MIPS boards
15 */
16#ifdef CONFIG_CPU_MIPS32
17#define cpu_has_tlb 1
18#define cpu_has_4kex 1
19#define cpu_has_4kcache 1
20#define cpu_has_fpu 0
21/* #define cpu_has_32fpr ? */
22#define cpu_has_counter 1
23/* #define cpu_has_watch ? */
24#define cpu_has_divec 1
25#define cpu_has_vce 0
26/* #define cpu_has_cache_cdex_p ? */
27/* #define cpu_has_cache_cdex_s ? */
28/* #define cpu_has_prefetch ? */
29#define cpu_has_mcheck 1
30/* #define cpu_has_ejtag ? */
31#define cpu_has_llsc 1
32/* #define cpu_has_vtag_icache ? */
33/* #define cpu_has_dc_aliases ? */
34/* #define cpu_has_ic_fills_f_dc ? */
35#define cpu_has_nofpuex 0
36/* #define cpu_has_64bits ? */
37/* #define cpu_has_64bit_zero_reg ? */
38/* #define cpu_has_subset_pcaches ? */
39#endif
40
41#ifdef CONFIG_CPU_MIPS64
42#define cpu_has_tlb 1
43#define cpu_has_4kex 1
44#define cpu_has_4kcache 1
45/* #define cpu_has_fpu ? */
46/* #define cpu_has_32fpr ? */
47#define cpu_has_counter 1
48/* #define cpu_has_watch ? */
49#define cpu_has_divec 1
50#define cpu_has_vce 0
51/* #define cpu_has_cache_cdex_p ? */
52/* #define cpu_has_cache_cdex_s ? */
53/* #define cpu_has_prefetch ? */
54#define cpu_has_mcheck 1
55/* #define cpu_has_ejtag ? */
56#define cpu_has_llsc 1
57/* #define cpu_has_vtag_icache ? */
58/* #define cpu_has_dc_aliases ? */
59/* #define cpu_has_ic_fills_f_dc ? */
60#define cpu_has_nofpuex 0
61/* #define cpu_has_64bits ? */
62/* #define cpu_has_64bit_zero_reg ? */
63/* #define cpu_has_subset_pcaches ? */
64#endif
65
66#endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
index 58603e3daca6..463d051f4683 100644
--- a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
@@ -25,6 +25,7 @@
25#define cpu_has_vtag_icache 0 25#define cpu_has_vtag_icache 0
26#define cpu_has_dc_aliases 0 26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0
28#define cpu_icache_snoops_remote_store 0 29#define cpu_icache_snoops_remote_store 0
29 30
30#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
@@ -36,10 +37,4 @@
36#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
37#define cpu_scache_line_size() 32 38#define cpu_scache_line_size() 32
38 39
39/*
40 * On the RM9000 we need to ensure that I-cache lines being fetches only
41 * contain valid instructions are funny things will happen.
42 */
43#define PLAT_TRAMPOLINE_STUFF_LINE 32UL
44
45#endif /* __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H */ 40#endif /* __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mips-boards/generic.h b/include/asm-mips/mips-boards/generic.h
index 65d1d16eab16..25b6ffc26623 100644
--- a/include/asm-mips/mips-boards/generic.h
+++ b/include/asm-mips/mips-boards/generic.h
@@ -66,6 +66,7 @@
66#define MIPS_REVISION_CORID_CORE_EMUL 6 66#define MIPS_REVISION_CORID_CORE_EMUL 6
67#define MIPS_REVISION_CORID_CORE_FPGA2 7 67#define MIPS_REVISION_CORID_CORE_FPGA2 7
68#define MIPS_REVISION_CORID_CORE_FPGAR2 8 68#define MIPS_REVISION_CORID_CORE_FPGAR2 8
69#define MIPS_REVISION_CORID_CORE_FPGA3 9
69 70
70/**** Artificial corid defines ****/ 71/**** Artificial corid defines ****/
71/* 72/*
@@ -79,4 +80,10 @@
79 80
80extern unsigned int mips_revision_corid; 81extern unsigned int mips_revision_corid;
81 82
83#ifdef CONFIG_PCI
84extern void mips_pcibios_init(void);
85#else
86#define mips_pcibios_init() do { } while (0)
87#endif
88
82#endif /* __ASM_MIPS_BOARDS_GENERIC_H */ 89#endif /* __ASM_MIPS_BOARDS_GENERIC_H */
diff --git a/include/asm-mips/mips-boards/maltaint.h b/include/asm-mips/mips-boards/maltaint.h
index 376181882e81..da6cc2fbbc78 100644
--- a/include/asm-mips/mips-boards/maltaint.h
+++ b/include/asm-mips/mips-boards/maltaint.h
@@ -25,9 +25,63 @@
25#ifndef _MIPS_MALTAINT_H 25#ifndef _MIPS_MALTAINT_H
26#define _MIPS_MALTAINT_H 26#define _MIPS_MALTAINT_H
27 27
28/* Number of IRQ supported on hw interrupt 0. */ 28/*
29#define MALTAINT_END 16 29 * Interrupts 0..15 are used for Malta ISA compatible interrupts
30 */
31#define MALTA_INT_BASE 0
32
33/*
34 * Interrupts 16..23 are used for Malta CPU interrupts (nonEIC mode)
35 */
36#define MIPSCPU_INT_BASE 16
37
38/* CPU interrupt offsets */
39#define MIPSCPU_INT_SW0 0
40#define MIPSCPU_INT_SW1 1
41#define MIPSCPU_INT_MB0 2
42#define MIPSCPU_INT_I8259A MIPSCPU_INT_MB0
43#define MIPSCPU_INT_MB1 3
44#define MIPSCPU_INT_SMI MIPSCPU_INT_MB1
45#define MIPSCPU_INT_MB2 4
46#define MIPSCPU_INT_MB3 5
47#define MIPSCPU_INT_COREHI MIPSCPU_INT_MB3
48#define MIPSCPU_INT_MB4 6
49#define MIPSCPU_INT_CORELO MIPSCPU_INT_MB4
50#define MIPSCPU_INT_CPUCTR 7
51
52/*
53 * Interrupts 64..127 are used for Soc-it Classic interrupts
54 */
55#define MSC01C_INT_BASE 64
56
57/* SOC-it Classic interrupt offsets */
58#define MSC01C_INT_TMR 0
59#define MSC01C_INT_PCI 1
60
61/*
62 * Interrupts 64..127 are used for Soc-it EIC interrupts
63 */
64#define MSC01E_INT_BASE 64
65
66/* SOC-it EIC interrupt offsets */
67#define MSC01E_INT_SW0 1
68#define MSC01E_INT_SW1 2
69#define MSC01E_INT_MB0 3
70#define MSC01E_INT_I8259A MSC01E_INT_MB0
71#define MSC01E_INT_MB1 4
72#define MSC01E_INT_SMI MSC01E_INT_MB1
73#define MSC01E_INT_MB2 5
74#define MSC01E_INT_MB3 6
75#define MSC01E_INT_COREHI MSC01E_INT_MB3
76#define MSC01E_INT_MB4 7
77#define MSC01E_INT_CORELO MSC01E_INT_MB4
78#define MSC01E_INT_TMR 8
79#define MSC01E_INT_PCI 9
80#define MSC01E_INT_PERFCTR 10
81#define MSC01E_INT_CPUCTR 11
30 82
83#ifndef __ASSEMBLY__
31extern void maltaint_init(void); 84extern void maltaint_init(void);
85#endif
32 86
33#endif /* !(_MIPS_MALTAINT_H) */ 87#endif /* !(_MIPS_MALTAINT_H) */
diff --git a/include/asm-mips/mips-boards/msc01_pci.h b/include/asm-mips/mips-boards/msc01_pci.h
index 6b2a87a38f4b..8eaefb837b9d 100644
--- a/include/asm-mips/mips-boards/msc01_pci.h
+++ b/include/asm-mips/mips-boards/msc01_pci.h
@@ -1,8 +1,9 @@
1/* 1/*
2 * PCI Register definitions for the MIPS System Controller. 2 * PCI Register definitions for the MIPS System Controller.
3 * 3 *
4 * Carsten Langgaard, carstenl@mips.com 4 * Copyright (C) 2002, 2005 MIPS Technologies, Inc. All rights reserved.
5 * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved. 5 * Authors: Carsten Langgaard <carstenl@mips.com>
6 * Maciej W. Rozycki <macro@mips.com>
6 * 7 *
7 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
@@ -29,22 +30,22 @@
29#define MSC01_PCI_CFGADDR_OFS 0x0610 30#define MSC01_PCI_CFGADDR_OFS 0x0610
30#define MSC01_PCI_CFGDATA_OFS 0x0618 31#define MSC01_PCI_CFGDATA_OFS 0x0618
31#define MSC01_PCI_IACK_OFS 0x0620 32#define MSC01_PCI_IACK_OFS 0x0620
32#define MSC01_PCI_HEAD0_OFS 0x2000 /* DevID, VendorID */ 33#define MSC01_PCI_HEAD0_OFS 0x2000 /* DevID, VendorID */
33#define MSC01_PCI_HEAD1_OFS 0x2008 /* Status, Command */ 34#define MSC01_PCI_HEAD1_OFS 0x2008 /* Status, Command */
34#define MSC01_PCI_HEAD2_OFS 0x2010 /* Class code, RevID */ 35#define MSC01_PCI_HEAD2_OFS 0x2010 /* Class code, RevID */
35#define MSC01_PCI_HEAD3_OFS 0x2018 /* bist, header, latency */ 36#define MSC01_PCI_HEAD3_OFS 0x2018 /* bist, header, latency */
36#define MSC01_PCI_HEAD4_OFS 0x2020 /* BAR 0 */ 37#define MSC01_PCI_HEAD4_OFS 0x2020 /* BAR 0 */
37#define MSC01_PCI_HEAD5_OFS 0x2028 /* BAR 1 */ 38#define MSC01_PCI_HEAD5_OFS 0x2028 /* BAR 1 */
38#define MSC01_PCI_HEAD6_OFS 0x2030 /* BAR 2 */ 39#define MSC01_PCI_HEAD6_OFS 0x2030 /* BAR 2 */
39#define MSC01_PCI_HEAD7_OFS 0x2038 /* BAR 3 */ 40#define MSC01_PCI_HEAD7_OFS 0x2038 /* BAR 3 */
40#define MSC01_PCI_HEAD8_OFS 0x2040 /* BAR 4 */ 41#define MSC01_PCI_HEAD8_OFS 0x2040 /* BAR 4 */
41#define MSC01_PCI_HEAD9_OFS 0x2048 /* BAR 5 */ 42#define MSC01_PCI_HEAD9_OFS 0x2048 /* BAR 5 */
42#define MSC01_PCI_HEAD10_OFS 0x2050 /* CardBus CIS Ptr */ 43#define MSC01_PCI_HEAD10_OFS 0x2050 /* CardBus CIS Ptr */
43#define MSC01_PCI_HEAD11_OFS 0x2058 /* SubSystem ID, -VendorID */ 44#define MSC01_PCI_HEAD11_OFS 0x2058 /* SubSystem ID, -VendorID */
44#define MSC01_PCI_HEAD12_OFS 0x2060 /* ROM BAR */ 45#define MSC01_PCI_HEAD12_OFS 0x2060 /* ROM BAR */
45#define MSC01_PCI_HEAD13_OFS 0x2068 /* Capabilities ptr */ 46#define MSC01_PCI_HEAD13_OFS 0x2068 /* Capabilities ptr */
46#define MSC01_PCI_HEAD14_OFS 0x2070 /* reserved */ 47#define MSC01_PCI_HEAD14_OFS 0x2070 /* reserved */
47#define MSC01_PCI_HEAD15_OFS 0x2078 /* Maxl, ming, intpin, int */ 48#define MSC01_PCI_HEAD15_OFS 0x2078 /* Maxl, ming, intpin, int */
48#define MSC01_PCI_BAR0_OFS 0x2220 49#define MSC01_PCI_BAR0_OFS 0x2220
49#define MSC01_PCI_CFG_OFS 0x2380 50#define MSC01_PCI_CFG_OFS 0x2380
50#define MSC01_PCI_SWAP_OFS 0x2388 51#define MSC01_PCI_SWAP_OFS 0x2388
@@ -86,73 +87,73 @@
86#define MSC01_PCI_P2SCMAPL_MAP_SHF 24 87#define MSC01_PCI_P2SCMAPL_MAP_SHF 24
87#define MSC01_PCI_P2SCMAPL_MAP_MSK 0xff000000 88#define MSC01_PCI_P2SCMAPL_MAP_MSK 0xff000000
88 89
89#define MSC01_PCI_INTCFG_RST_SHF 10 90#define MSC01_PCI_INTCFG_RST_SHF 10
90#define MSC01_PCI_INTCFG_RST_MSK 0x00000400 91#define MSC01_PCI_INTCFG_RST_MSK 0x00000400
91#define MSC01_PCI_INTCFG_RST_BIT 0x00000400 92#define MSC01_PCI_INTCFG_RST_BIT 0x00000400
92#define MSC01_PCI_INTCFG_MWE_SHF 9 93#define MSC01_PCI_INTCFG_MWE_SHF 9
93#define MSC01_PCI_INTCFG_MWE_MSK 0x00000200 94#define MSC01_PCI_INTCFG_MWE_MSK 0x00000200
94#define MSC01_PCI_INTCFG_MWE_BIT 0x00000200 95#define MSC01_PCI_INTCFG_MWE_BIT 0x00000200
95#define MSC01_PCI_INTCFG_DTO_SHF 8 96#define MSC01_PCI_INTCFG_DTO_SHF 8
96#define MSC01_PCI_INTCFG_DTO_MSK 0x00000100 97#define MSC01_PCI_INTCFG_DTO_MSK 0x00000100
97#define MSC01_PCI_INTCFG_DTO_BIT 0x00000100 98#define MSC01_PCI_INTCFG_DTO_BIT 0x00000100
98#define MSC01_PCI_INTCFG_MA_SHF 7 99#define MSC01_PCI_INTCFG_MA_SHF 7
99#define MSC01_PCI_INTCFG_MA_MSK 0x00000080 100#define MSC01_PCI_INTCFG_MA_MSK 0x00000080
100#define MSC01_PCI_INTCFG_MA_BIT 0x00000080 101#define MSC01_PCI_INTCFG_MA_BIT 0x00000080
101#define MSC01_PCI_INTCFG_TA_SHF 6 102#define MSC01_PCI_INTCFG_TA_SHF 6
102#define MSC01_PCI_INTCFG_TA_MSK 0x00000040 103#define MSC01_PCI_INTCFG_TA_MSK 0x00000040
103#define MSC01_PCI_INTCFG_TA_BIT 0x00000040 104#define MSC01_PCI_INTCFG_TA_BIT 0x00000040
104#define MSC01_PCI_INTCFG_RTY_SHF 5 105#define MSC01_PCI_INTCFG_RTY_SHF 5
105#define MSC01_PCI_INTCFG_RTY_MSK 0x00000020 106#define MSC01_PCI_INTCFG_RTY_MSK 0x00000020
106#define MSC01_PCI_INTCFG_RTY_BIT 0x00000020 107#define MSC01_PCI_INTCFG_RTY_BIT 0x00000020
107#define MSC01_PCI_INTCFG_MWP_SHF 4 108#define MSC01_PCI_INTCFG_MWP_SHF 4
108#define MSC01_PCI_INTCFG_MWP_MSK 0x00000010 109#define MSC01_PCI_INTCFG_MWP_MSK 0x00000010
109#define MSC01_PCI_INTCFG_MWP_BIT 0x00000010 110#define MSC01_PCI_INTCFG_MWP_BIT 0x00000010
110#define MSC01_PCI_INTCFG_MRP_SHF 3 111#define MSC01_PCI_INTCFG_MRP_SHF 3
111#define MSC01_PCI_INTCFG_MRP_MSK 0x00000008 112#define MSC01_PCI_INTCFG_MRP_MSK 0x00000008
112#define MSC01_PCI_INTCFG_MRP_BIT 0x00000008 113#define MSC01_PCI_INTCFG_MRP_BIT 0x00000008
113#define MSC01_PCI_INTCFG_SWP_SHF 2 114#define MSC01_PCI_INTCFG_SWP_SHF 2
114#define MSC01_PCI_INTCFG_SWP_MSK 0x00000004 115#define MSC01_PCI_INTCFG_SWP_MSK 0x00000004
115#define MSC01_PCI_INTCFG_SWP_BIT 0x00000004 116#define MSC01_PCI_INTCFG_SWP_BIT 0x00000004
116#define MSC01_PCI_INTCFG_SRP_SHF 1 117#define MSC01_PCI_INTCFG_SRP_SHF 1
117#define MSC01_PCI_INTCFG_SRP_MSK 0x00000002 118#define MSC01_PCI_INTCFG_SRP_MSK 0x00000002
118#define MSC01_PCI_INTCFG_SRP_BIT 0x00000002 119#define MSC01_PCI_INTCFG_SRP_BIT 0x00000002
119#define MSC01_PCI_INTCFG_SE_SHF 0 120#define MSC01_PCI_INTCFG_SE_SHF 0
120#define MSC01_PCI_INTCFG_SE_MSK 0x00000001 121#define MSC01_PCI_INTCFG_SE_MSK 0x00000001
121#define MSC01_PCI_INTCFG_SE_BIT 0x00000001 122#define MSC01_PCI_INTCFG_SE_BIT 0x00000001
122 123
123#define MSC01_PCI_INTSTAT_RST_SHF 10 124#define MSC01_PCI_INTSTAT_RST_SHF 10
124#define MSC01_PCI_INTSTAT_RST_MSK 0x00000400 125#define MSC01_PCI_INTSTAT_RST_MSK 0x00000400
125#define MSC01_PCI_INTSTAT_RST_BIT 0x00000400 126#define MSC01_PCI_INTSTAT_RST_BIT 0x00000400
126#define MSC01_PCI_INTSTAT_MWE_SHF 9 127#define MSC01_PCI_INTSTAT_MWE_SHF 9
127#define MSC01_PCI_INTSTAT_MWE_MSK 0x00000200 128#define MSC01_PCI_INTSTAT_MWE_MSK 0x00000200
128#define MSC01_PCI_INTSTAT_MWE_BIT 0x00000200 129#define MSC01_PCI_INTSTAT_MWE_BIT 0x00000200
129#define MSC01_PCI_INTSTAT_DTO_SHF 8 130#define MSC01_PCI_INTSTAT_DTO_SHF 8
130#define MSC01_PCI_INTSTAT_DTO_MSK 0x00000100 131#define MSC01_PCI_INTSTAT_DTO_MSK 0x00000100
131#define MSC01_PCI_INTSTAT_DTO_BIT 0x00000100 132#define MSC01_PCI_INTSTAT_DTO_BIT 0x00000100
132#define MSC01_PCI_INTSTAT_MA_SHF 7 133#define MSC01_PCI_INTSTAT_MA_SHF 7
133#define MSC01_PCI_INTSTAT_MA_MSK 0x00000080 134#define MSC01_PCI_INTSTAT_MA_MSK 0x00000080
134#define MSC01_PCI_INTSTAT_MA_BIT 0x00000080 135#define MSC01_PCI_INTSTAT_MA_BIT 0x00000080
135#define MSC01_PCI_INTSTAT_TA_SHF 6 136#define MSC01_PCI_INTSTAT_TA_SHF 6
136#define MSC01_PCI_INTSTAT_TA_MSK 0x00000040 137#define MSC01_PCI_INTSTAT_TA_MSK 0x00000040
137#define MSC01_PCI_INTSTAT_TA_BIT 0x00000040 138#define MSC01_PCI_INTSTAT_TA_BIT 0x00000040
138#define MSC01_PCI_INTSTAT_RTY_SHF 5 139#define MSC01_PCI_INTSTAT_RTY_SHF 5
139#define MSC01_PCI_INTSTAT_RTY_MSK 0x00000020 140#define MSC01_PCI_INTSTAT_RTY_MSK 0x00000020
140#define MSC01_PCI_INTSTAT_RTY_BIT 0x00000020 141#define MSC01_PCI_INTSTAT_RTY_BIT 0x00000020
141#define MSC01_PCI_INTSTAT_MWP_SHF 4 142#define MSC01_PCI_INTSTAT_MWP_SHF 4
142#define MSC01_PCI_INTSTAT_MWP_MSK 0x00000010 143#define MSC01_PCI_INTSTAT_MWP_MSK 0x00000010
143#define MSC01_PCI_INTSTAT_MWP_BIT 0x00000010 144#define MSC01_PCI_INTSTAT_MWP_BIT 0x00000010
144#define MSC01_PCI_INTSTAT_MRP_SHF 3 145#define MSC01_PCI_INTSTAT_MRP_SHF 3
145#define MSC01_PCI_INTSTAT_MRP_MSK 0x00000008 146#define MSC01_PCI_INTSTAT_MRP_MSK 0x00000008
146#define MSC01_PCI_INTSTAT_MRP_BIT 0x00000008 147#define MSC01_PCI_INTSTAT_MRP_BIT 0x00000008
147#define MSC01_PCI_INTSTAT_SWP_SHF 2 148#define MSC01_PCI_INTSTAT_SWP_SHF 2
148#define MSC01_PCI_INTSTAT_SWP_MSK 0x00000004 149#define MSC01_PCI_INTSTAT_SWP_MSK 0x00000004
149#define MSC01_PCI_INTSTAT_SWP_BIT 0x00000004 150#define MSC01_PCI_INTSTAT_SWP_BIT 0x00000004
150#define MSC01_PCI_INTSTAT_SRP_SHF 1 151#define MSC01_PCI_INTSTAT_SRP_SHF 1
151#define MSC01_PCI_INTSTAT_SRP_MSK 0x00000002 152#define MSC01_PCI_INTSTAT_SRP_MSK 0x00000002
152#define MSC01_PCI_INTSTAT_SRP_BIT 0x00000002 153#define MSC01_PCI_INTSTAT_SRP_BIT 0x00000002
153#define MSC01_PCI_INTSTAT_SE_SHF 0 154#define MSC01_PCI_INTSTAT_SE_SHF 0
154#define MSC01_PCI_INTSTAT_SE_MSK 0x00000001 155#define MSC01_PCI_INTSTAT_SE_MSK 0x00000001
155#define MSC01_PCI_INTSTAT_SE_BIT 0x00000001 156#define MSC01_PCI_INTSTAT_SE_BIT 0x00000001
156 157
157#define MSC01_PCI_CFGADDR_BNUM_SHF 16 158#define MSC01_PCI_CFGADDR_BNUM_SHF 16
158#define MSC01_PCI_CFGADDR_BNUM_MSK 0x00ff0000 159#define MSC01_PCI_CFGADDR_BNUM_MSK 0x00ff0000
@@ -167,29 +168,29 @@
167#define MSC01_PCI_CFGDATA_DATA_MSK 0xffffffff 168#define MSC01_PCI_CFGDATA_DATA_MSK 0xffffffff
168 169
169/* The defines below are ONLY valid for a MEM bar! */ 170/* The defines below are ONLY valid for a MEM bar! */
170#define MSC01_PCI_BAR0_SIZE_SHF 4 171#define MSC01_PCI_BAR0_SIZE_SHF 4
171#define MSC01_PCI_BAR0_SIZE_MSK 0xfffffff0 172#define MSC01_PCI_BAR0_SIZE_MSK 0xfffffff0
172#define MSC01_PCI_BAR0_P_SHF 3 173#define MSC01_PCI_BAR0_P_SHF 3
173#define MSC01_PCI_BAR0_P_MSK 0x00000008 174#define MSC01_PCI_BAR0_P_MSK 0x00000008
174#define MSC01_PCI_BAR0_P_BIT MSC01_PCI_BAR0_P_MSK 175#define MSC01_PCI_BAR0_P_BIT MSC01_PCI_BAR0_P_MSK
175#define MSC01_PCI_BAR0_D_SHF 1 176#define MSC01_PCI_BAR0_D_SHF 1
176#define MSC01_PCI_BAR0_D_MSK 0x00000006 177#define MSC01_PCI_BAR0_D_MSK 0x00000006
177#define MSC01_PCI_BAR0_T_SHF 0 178#define MSC01_PCI_BAR0_T_SHF 0
178#define MSC01_PCI_BAR0_T_MSK 0x00000001 179#define MSC01_PCI_BAR0_T_MSK 0x00000001
179#define MSC01_PCI_BAR0_T_BIT MSC01_PCI_BAR0_T_MSK 180#define MSC01_PCI_BAR0_T_BIT MSC01_PCI_BAR0_T_MSK
180 181
181 182
182#define MSC01_PCI_CFG_RA_SHF 17 183#define MSC01_PCI_CFG_RA_SHF 17
183#define MSC01_PCI_CFG_RA_MSK 0x00020000 184#define MSC01_PCI_CFG_RA_MSK 0x00020000
184#define MSC01_PCI_CFG_RA_BIT MSC01_PCI_CFG_RA_MSK 185#define MSC01_PCI_CFG_RA_BIT MSC01_PCI_CFG_RA_MSK
185#define MSC01_PCI_CFG_G_SHF 16 186#define MSC01_PCI_CFG_G_SHF 16
186#define MSC01_PCI_CFG_G_MSK 0x00010000 187#define MSC01_PCI_CFG_G_MSK 0x00010000
187#define MSC01_PCI_CFG_G_BIT MSC01_PCI_CFG_G_MSK 188#define MSC01_PCI_CFG_G_BIT MSC01_PCI_CFG_G_MSK
188#define MSC01_PCI_CFG_EN_SHF 15 189#define MSC01_PCI_CFG_EN_SHF 15
189#define MSC01_PCI_CFG_EN_MSK 0x00008000 190#define MSC01_PCI_CFG_EN_MSK 0x00008000
190#define MSC01_PCI_CFG_EN_BIT MSC01_PCI_CFG_EN_MSK 191#define MSC01_PCI_CFG_EN_BIT MSC01_PCI_CFG_EN_MSK
191#define MSC01_PCI_CFG_MAXRTRY_SHF 0 192#define MSC01_PCI_CFG_MAXRTRY_SHF 0
192#define MSC01_PCI_CFG_MAXRTRY_MSK 0x000000ff 193#define MSC01_PCI_CFG_MAXRTRY_MSK 0x00000fff
193 194
194#define MSC01_PCI_SWAP_IO_SHF 18 195#define MSC01_PCI_SWAP_IO_SHF 18
195#define MSC01_PCI_SWAP_IO_MSK 0x000c0000 196#define MSC01_PCI_SWAP_IO_MSK 0x000c0000
@@ -206,7 +207,7 @@
206 * FIXME - are these macros specific to Malta and co or to the MSC? If the 207 * FIXME - are these macros specific to Malta and co or to the MSC? If the
207 * latter, they should be moved elsewhere. 208 * latter, they should be moved elsewhere.
208 */ 209 */
209#define MIPS_MSC01_PCI_REG_BASE 0x1bd00000 210#define MIPS_MSC01_PCI_REG_BASE 0x1bd00000
210 211
211extern unsigned long _pcictrl_msc; 212extern unsigned long _pcictrl_msc;
212 213
@@ -219,19 +220,19 @@ extern unsigned long _pcictrl_msc;
219 * Registers absolute addresses 220 * Registers absolute addresses
220 */ 221 */
221 222
222#define MSC01_PCI_ID (MSC01_PCI_REG_BASE + MSC01_PCI_ID_OFS) 223#define MSC01_PCI_ID (MSC01_PCI_REG_BASE + MSC01_PCI_ID_OFS)
223#define MSC01_PCI_SC2PMBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMBASL_OFS) 224#define MSC01_PCI_SC2PMBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMBASL_OFS)
224#define MSC01_PCI_SC2PMMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMSKL_OFS) 225#define MSC01_PCI_SC2PMMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMSKL_OFS)
225#define MSC01_PCI_SC2PMMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMAPL_OFS) 226#define MSC01_PCI_SC2PMMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMAPL_OFS)
226#define MSC01_PCI_SC2PIOBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOBASL_OFS) 227#define MSC01_PCI_SC2PIOBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOBASL_OFS)
227#define MSC01_PCI_SC2PIOMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMSKL_OFS) 228#define MSC01_PCI_SC2PIOMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMSKL_OFS)
228#define MSC01_PCI_SC2PIOMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMAPL_OFS) 229#define MSC01_PCI_SC2PIOMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMAPL_OFS)
229#define MSC01_PCI_P2SCMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMSKL_OFS) 230#define MSC01_PCI_P2SCMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMSKL_OFS)
230#define MSC01_PCI_P2SCMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMAPL_OFS) 231#define MSC01_PCI_P2SCMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMAPL_OFS)
231#define MSC01_PCI_INTCFG (MSC01_PCI_REG_BASE + MSC01_PCI_INTCFG_OFS) 232#define MSC01_PCI_INTCFG (MSC01_PCI_REG_BASE + MSC01_PCI_INTCFG_OFS)
232#define MSC01_PCI_INTSTAT (MSC01_PCI_REG_BASE + MSC01_PCI_INTSTAT_OFS) 233#define MSC01_PCI_INTSTAT (MSC01_PCI_REG_BASE + MSC01_PCI_INTSTAT_OFS)
233#define MSC01_PCI_CFGADDR (MSC01_PCI_REG_BASE + MSC01_PCI_CFGADDR_OFS) 234#define MSC01_PCI_CFGADDR (MSC01_PCI_REG_BASE + MSC01_PCI_CFGADDR_OFS)
234#define MSC01_PCI_CFGDATA (MSC01_PCI_REG_BASE + MSC01_PCI_CFGDATA_OFS) 235#define MSC01_PCI_CFGDATA (MSC01_PCI_REG_BASE + MSC01_PCI_CFGDATA_OFS)
235#define MSC01_PCI_IACK (MSC01_PCI_REG_BASE + MSC01_PCI_IACK_OFS) 236#define MSC01_PCI_IACK (MSC01_PCI_REG_BASE + MSC01_PCI_IACK_OFS)
236#define MSC01_PCI_HEAD0 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD0_OFS) 237#define MSC01_PCI_HEAD0 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD0_OFS)
237#define MSC01_PCI_HEAD1 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD1_OFS) 238#define MSC01_PCI_HEAD1 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD1_OFS)
@@ -248,7 +249,7 @@ extern unsigned long _pcictrl_msc;
248#define MSC01_PCI_HEAD12 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) 249#define MSC01_PCI_HEAD12 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
249#define MSC01_PCI_HEAD13 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) 250#define MSC01_PCI_HEAD13 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
250#define MSC01_PCI_HEAD14 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) 251#define MSC01_PCI_HEAD14 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
251#define MSC01_PCI_HEAD15 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) 252#define MSC01_PCI_HEAD15 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
252#define MSC01_PCI_BAR0 (MSC01_PCI_REG_BASE + MSC01_PCI_BAR0_OFS) 253#define MSC01_PCI_BAR0 (MSC01_PCI_REG_BASE + MSC01_PCI_BAR0_OFS)
253#define MSC01_PCI_CFG (MSC01_PCI_REG_BASE + MSC01_PCI_CFG_OFS) 254#define MSC01_PCI_CFG (MSC01_PCI_REG_BASE + MSC01_PCI_CFG_OFS)
254#define MSC01_PCI_SWAP (MSC01_PCI_REG_BASE + MSC01_PCI_SWAP_OFS) 255#define MSC01_PCI_SWAP (MSC01_PCI_REG_BASE + MSC01_PCI_SWAP_OFS)
diff --git a/include/asm-mips/mips-boards/sim.h b/include/asm-mips/mips-boards/sim.h
new file mode 100644
index 000000000000..acb7c2331d98
--- /dev/null
+++ b/include/asm-mips/mips-boards/sim.h
@@ -0,0 +1,40 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18
19#ifndef _ASM_MIPS_BOARDS_SIM_H
20#define _ASM_MIPS_BOARDS_SIM_H
21
22#define STATS_ON 1
23#define STATS_OFF 2
24#define STATS_CLEAR 3
25#define STATS_DUMP 4
26#define TRACE_ON 5
27#define TRACE_OFF 6
28
29
30#define simcfg(code) \
31({ \
32 __asm__ __volatile__( \
33 "sltiu $0,$0, %0" \
34 ::"i"(code) \
35 ); \
36})
37
38
39
40#endif
diff --git a/include/asm-mips/mips-boards/simint.h b/include/asm-mips/mips-boards/simint.h
new file mode 100644
index 000000000000..4952e0b3bf11
--- /dev/null
+++ b/include/asm-mips/mips-boards/simint.h
@@ -0,0 +1,34 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 */
17#ifndef _MIPS_SIMINT_H
18#define _MIPS_SIMINT_H
19
20
21#define SIM_INT_BASE 0
22#define MIPSCPU_INT_MB0 2
23#define MIPSCPU_INT_BASE 16
24#define MIPS_CPU_TIMER_IRQ 7
25
26
27#define MIPSCPU_INT_CPUCTR 7
28
29#define MSC01E_INT_BASE 64
30
31#define MIPSCPU_INT_CPUCTR 7
32#define MSC01E_INT_CPUCTR 11
33
34#endif
diff --git a/include/asm-mips/mipsmtregs.h b/include/asm-mips/mipsmtregs.h
new file mode 100644
index 000000000000..a669c0702c66
--- /dev/null
+++ b/include/asm-mips/mipsmtregs.h
@@ -0,0 +1,391 @@
1/*
2 * MT regs definitions, follows on from mipsregs.h
3 * Copyright (C) 2004 - 2005 MIPS Technologies, Inc. All rights reserved.
4 * Elizabeth Clarke et. al.
5 *
6 */
7#ifndef _ASM_MIPSMTREGS_H
8#define _ASM_MIPSMTREGS_H
9
10#include <asm/mipsregs.h>
11#include <asm/war.h>
12
13#ifndef __ASSEMBLY__
14
15/*
16 * C macros
17 */
18
19#define read_c0_mvpcontrol() __read_32bit_c0_register($0, 1)
20#define write_c0_mvpcontrol(val) __write_32bit_c0_register($0, 1, val)
21
22#define read_c0_mvpconf0() __read_32bit_c0_register($0, 2)
23#define read_c0_mvpconf1() __read_32bit_c0_register($0, 3)
24
25#define read_c0_vpecontrol() __read_32bit_c0_register($1, 1)
26#define write_c0_vpecontrol(val) __write_32bit_c0_register($1, 1, val)
27
28#define read_c0_vpeconf0() __read_32bit_c0_register($1, 2)
29#define write_c0_vpeconf0(val) __write_32bit_c0_register($1, 2, val)
30
31#define read_c0_tcstatus() __read_32bit_c0_register($2, 1)
32#define write_c0_tcstatus(val) __write_32bit_c0_register($2, 1, val)
33
34#define read_c0_tcbind() __read_32bit_c0_register($2, 2)
35
36#define read_c0_tccontext() __read_32bit_c0_register($2, 5)
37#define write_c0_tccontext(val) __write_32bit_c0_register($2, 5, val)
38
39#else /* Assembly */
40/*
41 * Macros for use in assembly language code
42 */
43
44#define CP0_MVPCONTROL $0,1
45#define CP0_MVPCONF0 $0,2
46#define CP0_MVPCONF1 $0,3
47#define CP0_VPECONTROL $1,1
48#define CP0_VPECONF0 $1,2
49#define CP0_VPECONF1 $1,3
50#define CP0_YQMASK $1,4
51#define CP0_VPESCHEDULE $1,5
52#define CP0_VPESCHEFBK $1,6
53#define CP0_TCSTATUS $2,1
54#define CP0_TCBIND $2,2
55#define CP0_TCRESTART $2,3
56#define CP0_TCHALT $2,4
57#define CP0_TCCONTEXT $2,5
58#define CP0_TCSCHEDULE $2,6
59#define CP0_TCSCHEFBK $2,7
60#define CP0_SRSCONF0 $6,1
61#define CP0_SRSCONF1 $6,2
62#define CP0_SRSCONF2 $6,3
63#define CP0_SRSCONF3 $6,4
64#define CP0_SRSCONF4 $6,5
65
66#endif
67
68/* MVPControl fields */
69#define MVPCONTROL_EVP (_ULCAST_(1))
70
71#define MVPCONTROL_VPC_SHIFT 1
72#define MVPCONTROL_VPC (_ULCAST_(1) << MVPCONTROL_VPC_SHIFT)
73
74#define MVPCONTROL_STLB_SHIFT 2
75#define MVPCONTROL_STLB (_ULCAST_(1) << MVPCONTROL_STLB_SHIFT)
76
77
78/* MVPConf0 fields */
79#define MVPCONF0_PTC_SHIFT 0
80#define MVPCONF0_PTC ( _ULCAST_(0xff))
81#define MVPCONF0_PVPE_SHIFT 10
82#define MVPCONF0_PVPE ( _ULCAST_(0xf) << MVPCONF0_PVPE_SHIFT)
83#define MVPCONF0_TCA_SHIFT 15
84#define MVPCONF0_TCA ( _ULCAST_(1) << MVPCONF0_TCA_SHIFT)
85#define MVPCONF0_PTLBE_SHIFT 16
86#define MVPCONF0_PTLBE (_ULCAST_(0x3ff) << MVPCONF0_PTLBE_SHIFT)
87#define MVPCONF0_TLBS_SHIFT 29
88#define MVPCONF0_TLBS (_ULCAST_(1) << MVPCONF0_TLBS_SHIFT)
89#define MVPCONF0_M_SHIFT 31
90#define MVPCONF0_M (_ULCAST_(0x1) << MVPCONF0_M_SHIFT)
91
92
93/* config3 fields */
94#define CONFIG3_MT_SHIFT 2
95#define CONFIG3_MT (_ULCAST_(1) << CONFIG3_MT_SHIFT)
96
97
98/* VPEControl fields (per VPE) */
99#define VPECONTROL_TARGTC (_ULCAST_(0xff))
100
101#define VPECONTROL_TE_SHIFT 15
102#define VPECONTROL_TE (_ULCAST_(1) << VPECONTROL_TE_SHIFT)
103#define VPECONTROL_EXCPT_SHIFT 16
104#define VPECONTROL_EXCPT (_ULCAST_(0x7) << VPECONTROL_EXCPT_SHIFT)
105
106/* Thread Exception Codes for EXCPT field */
107#define THREX_TU 0
108#define THREX_TO 1
109#define THREX_IYQ 2
110#define THREX_GSX 3
111#define THREX_YSCH 4
112#define THREX_GSSCH 5
113
114#define VPECONTROL_GSI_SHIFT 20
115#define VPECONTROL_GSI (_ULCAST_(1) << VPECONTROL_GSI_SHIFT)
116#define VPECONTROL_YSI_SHIFT 21
117#define VPECONTROL_YSI (_ULCAST_(1) << VPECONTROL_YSI_SHIFT)
118
119/* VPEConf0 fields (per VPE) */
120#define VPECONF0_VPA_SHIFT 0
121#define VPECONF0_VPA (_ULCAST_(1) << VPECONF0_VPA_SHIFT)
122#define VPECONF0_MVP_SHIFT 1
123#define VPECONF0_MVP (_ULCAST_(1) << VPECONF0_MVP_SHIFT)
124#define VPECONF0_XTC_SHIFT 21
125#define VPECONF0_XTC (_ULCAST_(0xff) << VPECONF0_XTC_SHIFT)
126
127/* TCStatus fields (per TC) */
128#define TCSTATUS_TASID (_ULCAST_(0xff))
129#define TCSTATUS_IXMT_SHIFT 10
130#define TCSTATUS_IXMT (_ULCAST_(1) << TCSTATUS_IXMT_SHIFT)
131#define TCSTATUS_TKSU_SHIFT 11
132#define TCSTATUS_TKSU (_ULCAST_(3) << TCSTATUS_TKSU_SHIFT)
133#define TCSTATUS_A_SHIFT 13
134#define TCSTATUS_A (_ULCAST_(1) << TCSTATUS_A_SHIFT)
135#define TCSTATUS_DA_SHIFT 15
136#define TCSTATUS_DA (_ULCAST_(1) << TCSTATUS_DA_SHIFT)
137#define TCSTATUS_DT_SHIFT 20
138#define TCSTATUS_DT (_ULCAST_(1) << TCSTATUS_DT_SHIFT)
139#define TCSTATUS_TDS_SHIFT 21
140#define TCSTATUS_TDS (_ULCAST_(1) << TCSTATUS_TDS_SHIFT)
141#define TCSTATUS_TSST_SHIFT 22
142#define TCSTATUS_TSST (_ULCAST_(1) << TCSTATUS_TSST_SHIFT)
143#define TCSTATUS_RNST_SHIFT 23
144#define TCSTATUS_RNST (_ULCAST_(3) << TCSTATUS_RNST_SHIFT)
145/* Codes for RNST */
146#define TC_RUNNING 0
147#define TC_WAITING 1
148#define TC_YIELDING 2
149#define TC_GATED 3
150
151#define TCSTATUS_TMX_SHIFT 27
152#define TCSTATUS_TMX (_ULCAST_(1) << TCSTATUS_TMX_SHIFT)
153/* TCStatus TCU bits can use same definitions/offsets as CU bits in Status */
154
155/* TCBind */
156#define TCBIND_CURVPE_SHIFT 0
157#define TCBIND_CURVPE (_ULCAST_(0xf))
158
159#define TCBIND_CURTC_SHIFT 21
160
161#define TCBIND_CURTC (_ULCAST_(0xff) << TCBIND_CURTC_SHIFT)
162
163/* TCHalt */
164#define TCHALT_H (_ULCAST_(1))
165
166#ifndef __ASSEMBLY__
167
168extern void mips_mt_regdump(void);
169
170static inline unsigned int dvpe(void)
171{
172 int res = 0;
173
174 __asm__ __volatile__(
175 " .set push \n"
176 " .set noreorder \n"
177 " .set noat \n"
178 " .set mips32r2 \n"
179 " .word 0x41610001 # dvpe $1 \n"
180 " move %0, $1 \n"
181 " ehb \n"
182 " .set pop \n"
183 : "=r" (res));
184
185 instruction_hazard();
186
187 return res;
188}
189
190static inline void __raw_evpe(void)
191{
192 __asm__ __volatile__(
193 " .set push \n"
194 " .set noreorder \n"
195 " .set noat \n"
196 " .set mips32r2 \n"
197 " .word 0x41600021 # evpe \n"
198 " ehb \n"
199 " .set pop \n");
200}
201
202/* Enable multiMT if previous suggested it should be.
203 EMT_ENABLE to force */
204
205#define EVPE_ENABLE MVPCONTROL_EVP
206
207static inline void evpe(int previous)
208{
209 if ((previous & MVPCONTROL_EVP))
210 __raw_evpe();
211}
212
213static inline unsigned int dmt(void)
214{
215 int res;
216
217 __asm__ __volatile__(
218 " .set push \n"
219 " .set mips32r2 \n"
220 " .set noat \n"
221 " .word 0x41610BC1 # dmt $1 \n"
222 " ehb \n"
223 " move %0, $1 \n"
224 " .set pop \n"
225 : "=r" (res));
226
227 instruction_hazard();
228
229 return res;
230}
231
232static inline void __raw_emt(void)
233{
234 __asm__ __volatile__(
235 " .set noreorder \n"
236 " .set mips32r2 \n"
237 " emt \n"
238 " ehb \n"
239 " .set mips0 \n"
240 " .set reorder");
241}
242
243/* enable multiVPE if previous suggested it should be.
244 EVPE_ENABLE to force */
245
246#define EMT_ENABLE VPECONTROL_TE
247
248static inline void emt(int previous)
249{
250 if ((previous & EMT_ENABLE))
251 __raw_emt();
252}
253
254static inline void ehb(void)
255{
256 __asm__ __volatile__(
257 " .set mips32r2 \n"
258 " ehb \n"
259 " .set mips0 \n");
260}
261
262#define mftc0(rt,sel) \
263({ \
264 unsigned long __res; \
265 \
266 __asm__ __volatile__( \
267 " .set push \n" \
268 " .set mips32r2 \n" \
269 " .set noat \n" \
270 " # mftc0 $1, $" #rt ", " #sel " \n" \
271 " .word 0x41000800 | (" #rt " << 16) | " #sel " \n" \
272 " move %0, $1 \n" \
273 " .set pop \n" \
274 : "=r" (__res)); \
275 \
276 __res; \
277})
278
279#define mftgpr(rt) \
280({ \
281 unsigned long __res; \
282 \
283 __asm__ __volatile__( \
284 " .set push \n" \
285 " .set mips32r2 \n" \
286 " mftgpr %0," #rt " \n" \
287 " .set pop \n" \
288 : "=r" (__res)); \
289 \
290 __res; \
291})
292
293#define mftr(rt,u,sel) \
294({ \
295 unsigned long __res; \
296 \
297 __asm__ __volatile__( \
298 ".set noat\n\t" \
299 "mftr\t%0, " #rt ", " #u ", " #sel "\n\t" \
300 ".set at\n\t" \
301 : "=r" (__res)); \
302 \
303 __res; \
304})
305
306#define mttgpr(rd,v) \
307do { \
308 __asm__ __volatile__( \
309 " .set push \n" \
310 " .set mips32r2 \n" \
311 " .set noat \n" \
312 " move $1, %0 \n" \
313 " # mttgpr $1, " #rd " \n" \
314 " .word 0x41810020 | (" #rd " << 11) \n" \
315 " .set pop \n" \
316 : : "r" (v)); \
317} while (0)
318
319#define mttc0(rd,sel,v) \
320({ \
321 __asm__ __volatile__( \
322 " .set push \n" \
323 " .set mips32r2 \n" \
324 " .set noat \n" \
325 " move $1, %0 \n" \
326 " # mttc0 %0," #rd ", " #sel " \n" \
327 " .word 0x41810000 | (" #rd " << 11) | " #sel " \n" \
328 " .set pop \n" \
329 : \
330 : "r" (v)); \
331})
332
333
334#define mttr(rd,u,sel,v) \
335({ \
336 __asm__ __volatile__( \
337 "mttr %0," #rd ", " #u ", " #sel \
338 : : "r" (v)); \
339})
340
341
342#define settc(tc) \
343do { \
344 write_c0_vpecontrol((read_c0_vpecontrol()&~VPECONTROL_TARGTC) | (tc)); \
345 ehb(); \
346} while (0)
347
348
349/* you *must* set the target tc (settc) before trying to use these */
350#define read_vpe_c0_vpecontrol() mftc0(1, 1)
351#define write_vpe_c0_vpecontrol(val) mttc0(1, 1, val)
352#define read_vpe_c0_vpeconf0() mftc0(1, 2)
353#define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val)
354#define read_vpe_c0_status() mftc0(12, 0)
355#define write_vpe_c0_status(val) mttc0(12, 0, val)
356#define read_vpe_c0_cause() mftc0(13, 0)
357#define write_vpe_c0_cause(val) mttc0(13, 0, val)
358#define read_vpe_c0_config() mftc0(16, 0)
359#define write_vpe_c0_config(val) mttc0(16, 0, val)
360#define read_vpe_c0_config1() mftc0(16, 1)
361#define write_vpe_c0_config1(val) mttc0(16, 1, val)
362#define read_vpe_c0_config7() mftc0(16, 7)
363#define write_vpe_c0_config7(val) mttc0(16, 7, val)
364#define read_vpe_c0_ebase() mftc0(15,1)
365#define write_vpe_c0_ebase(val) mttc0(15, 1, val)
366#define write_vpe_c0_compare(val) mttc0(11, 0, val)
367
368
369/* TC */
370#define read_tc_c0_tcstatus() mftc0(2, 1)
371#define write_tc_c0_tcstatus(val) mttc0(2,1,val)
372#define read_tc_c0_tcbind() mftc0(2, 2)
373#define write_tc_c0_tcbind(val) mttc0(2,2,val)
374#define read_tc_c0_tcrestart() mftc0(2, 3)
375#define write_tc_c0_tcrestart(val) mttc0(2,3,val)
376#define read_tc_c0_tchalt() mftc0(2, 4)
377#define write_tc_c0_tchalt(val) mttc0(2,4,val)
378#define read_tc_c0_tccontext() mftc0(2, 5)
379#define write_tc_c0_tccontext(val) mttc0(2,5,val)
380
381/* GPR */
382#define read_tc_gpr_sp() mftgpr(29)
383#define write_tc_gpr_sp(val) mttgpr(29, val)
384#define read_tc_gpr_gp() mftgpr(28)
385#define write_tc_gpr_gp(val) mttgpr(28, val)
386
387__BUILD_SET_C0(mvpcontrol)
388
389#endif /* Not __ASSEMBLY__ */
390
391#endif
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h
index 2197aa4ce456..80370e0a5589 100644
--- a/include/asm-mips/mipsregs.h
+++ b/include/asm-mips/mipsregs.h
@@ -8,7 +8,7 @@
8 * Modified for further R[236]000 support by Paul M. Antoine, 1996. 8 * Modified for further R[236]000 support by Paul M. Antoine, 1996.
9 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com 9 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
10 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. 10 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
11 * Copyright (C) 2003 Maciej W. Rozycki 11 * Copyright (C) 2003, 2004 Maciej W. Rozycki
12 */ 12 */
13#ifndef _ASM_MIPSREGS_H 13#ifndef _ASM_MIPSREGS_H
14#define _ASM_MIPSREGS_H 14#define _ASM_MIPSREGS_H
@@ -96,6 +96,16 @@
96#define CP0_S1_INTCONTROL $20 96#define CP0_S1_INTCONTROL $20
97 97
98/* 98/*
99 * Coprocessor 0 Set 2 register names
100 */
101#define CP0_S2_SRSCTL $12 /* MIPSR2 */
102
103/*
104 * Coprocessor 0 Set 3 register names
105 */
106#define CP0_S3_SRSMAP $12 /* MIPSR2 */
107
108/*
99 * TX39 Series 109 * TX39 Series
100 */ 110 */
101#define CP0_TX39_CACHE $7 111#define CP0_TX39_CACHE $7
@@ -281,6 +291,11 @@
281#define ST0_DL (_ULCAST_(1) << 24) 291#define ST0_DL (_ULCAST_(1) << 24)
282 292
283/* 293/*
294 * Enable the MIPS DSP ASE
295 */
296#define ST0_MX 0x01000000
297
298/*
284 * Bitfields in the TX39 family CP0 Configuration Register 3 299 * Bitfields in the TX39 family CP0 Configuration Register 3
285 */ 300 */
286#define TX39_CONF_ICS_SHIFT 19 301#define TX39_CONF_ICS_SHIFT 19
@@ -433,6 +448,14 @@
433#define R5K_CONF_SE (_ULCAST_(1) << 12) 448#define R5K_CONF_SE (_ULCAST_(1) << 12)
434#define R5K_CONF_SS (_ULCAST_(3) << 20) 449#define R5K_CONF_SS (_ULCAST_(3) << 20)
435 450
451/* Bits specific to the RM7000. */
452#define RM7K_CONF_SE (_ULCAST_(1) << 3)
453#define RM7K_CONF_TE (_ULCAST_(1) << 12)
454#define RM7K_CONF_CLK (_ULCAST_(1) << 16)
455#define RM7K_CONF_TC (_ULCAST_(1) << 17)
456#define RM7K_CONF_SI (_ULCAST_(3) << 20)
457#define RM7K_CONF_SC (_ULCAST_(1) << 31)
458
436/* Bits specific to the R10000. */ 459/* Bits specific to the R10000. */
437#define R10K_CONF_DN (_ULCAST_(3) << 3) 460#define R10K_CONF_DN (_ULCAST_(3) << 3)
438#define R10K_CONF_CT (_ULCAST_(1) << 5) 461#define R10K_CONF_CT (_ULCAST_(1) << 5)
@@ -475,6 +498,53 @@
475#define MIPS_CONF_M (_ULCAST_(1) << 31) 498#define MIPS_CONF_M (_ULCAST_(1) << 31)
476 499
477/* 500/*
501 * Bits in the MIPS32/64 PRA coprocessor 0 config registers 1 and above.
502 */
503#define MIPS_CONF1_FP (_ULCAST_(1) << 0)
504#define MIPS_CONF1_EP (_ULCAST_(1) << 1)
505#define MIPS_CONF1_CA (_ULCAST_(1) << 2)
506#define MIPS_CONF1_WR (_ULCAST_(1) << 3)
507#define MIPS_CONF1_PC (_ULCAST_(1) << 4)
508#define MIPS_CONF1_MD (_ULCAST_(1) << 5)
509#define MIPS_CONF1_C2 (_ULCAST_(1) << 6)
510#define MIPS_CONF1_DA (_ULCAST_(7) << 7)
511#define MIPS_CONF1_DL (_ULCAST_(7) << 10)
512#define MIPS_CONF1_DS (_ULCAST_(7) << 13)
513#define MIPS_CONF1_IA (_ULCAST_(7) << 16)
514#define MIPS_CONF1_IL (_ULCAST_(7) << 19)
515#define MIPS_CONF1_IS (_ULCAST_(7) << 22)
516#define MIPS_CONF1_TLBS (_ULCAST_(63)<< 25)
517
518#define MIPS_CONF2_SA (_ULCAST_(15)<< 0)
519#define MIPS_CONF2_SL (_ULCAST_(15)<< 4)
520#define MIPS_CONF2_SS (_ULCAST_(15)<< 8)
521#define MIPS_CONF2_SU (_ULCAST_(15)<< 12)
522#define MIPS_CONF2_TA (_ULCAST_(15)<< 16)
523#define MIPS_CONF2_TL (_ULCAST_(15)<< 20)
524#define MIPS_CONF2_TS (_ULCAST_(15)<< 24)
525#define MIPS_CONF2_TU (_ULCAST_(7) << 28)
526
527#define MIPS_CONF3_TL (_ULCAST_(1) << 0)
528#define MIPS_CONF3_SM (_ULCAST_(1) << 1)
529#define MIPS_CONF3_MT (_ULCAST_(1) << 2)
530#define MIPS_CONF3_SP (_ULCAST_(1) << 4)
531#define MIPS_CONF3_VINT (_ULCAST_(1) << 5)
532#define MIPS_CONF3_VEIC (_ULCAST_(1) << 6)
533#define MIPS_CONF3_LPA (_ULCAST_(1) << 7)
534#define MIPS_CONF3_DSP (_ULCAST_(1) << 10)
535
536/*
537 * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register.
538 */
539#define MIPS_FPIR_S (_ULCAST_(1) << 16)
540#define MIPS_FPIR_D (_ULCAST_(1) << 17)
541#define MIPS_FPIR_PS (_ULCAST_(1) << 18)
542#define MIPS_FPIR_3D (_ULCAST_(1) << 19)
543#define MIPS_FPIR_W (_ULCAST_(1) << 20)
544#define MIPS_FPIR_L (_ULCAST_(1) << 21)
545#define MIPS_FPIR_F64 (_ULCAST_(1) << 22)
546
547/*
478 * R10000 performance counter definitions. 548 * R10000 performance counter definitions.
479 * 549 *
480 * FIXME: The R10000 performance counter opens a nice way to implement CPU 550 * FIXME: The R10000 performance counter opens a nice way to implement CPU
@@ -621,13 +691,13 @@ do { \
621 if (sel == 0) \ 691 if (sel == 0) \
622 __asm__ __volatile__( \ 692 __asm__ __volatile__( \
623 "mtc0\t%z0, " #register "\n\t" \ 693 "mtc0\t%z0, " #register "\n\t" \
624 : : "Jr" ((unsigned int)value)); \ 694 : : "Jr" ((unsigned int)(value))); \
625 else \ 695 else \
626 __asm__ __volatile__( \ 696 __asm__ __volatile__( \
627 ".set\tmips32\n\t" \ 697 ".set\tmips32\n\t" \
628 "mtc0\t%z0, " #register ", " #sel "\n\t" \ 698 "mtc0\t%z0, " #register ", " #sel "\n\t" \
629 ".set\tmips0" \ 699 ".set\tmips0" \
630 : : "Jr" ((unsigned int)value)); \ 700 : : "Jr" ((unsigned int)(value))); \
631} while (0) 701} while (0)
632 702
633#define __write_64bit_c0_register(register, sel, value) \ 703#define __write_64bit_c0_register(register, sel, value) \
@@ -676,7 +746,7 @@ do { \
676do { \ 746do { \
677 __asm__ __volatile__( \ 747 __asm__ __volatile__( \
678 "ctc0\t%z0, " #register "\n\t" \ 748 "ctc0\t%z0, " #register "\n\t" \
679 : : "Jr" ((unsigned int)value)); \ 749 : : "Jr" ((unsigned int)(value))); \
680} while (0) 750} while (0)
681 751
682/* 752/*
@@ -769,12 +839,24 @@ do { \
769#define read_c0_count() __read_32bit_c0_register($9, 0) 839#define read_c0_count() __read_32bit_c0_register($9, 0)
770#define write_c0_count(val) __write_32bit_c0_register($9, 0, val) 840#define write_c0_count(val) __write_32bit_c0_register($9, 0, val)
771 841
842#define read_c0_count2() __read_32bit_c0_register($9, 6) /* pnx8550 */
843#define write_c0_count2(val) __write_32bit_c0_register($9, 6, val)
844
845#define read_c0_count3() __read_32bit_c0_register($9, 7) /* pnx8550 */
846#define write_c0_count3(val) __write_32bit_c0_register($9, 7, val)
847
772#define read_c0_entryhi() __read_ulong_c0_register($10, 0) 848#define read_c0_entryhi() __read_ulong_c0_register($10, 0)
773#define write_c0_entryhi(val) __write_ulong_c0_register($10, 0, val) 849#define write_c0_entryhi(val) __write_ulong_c0_register($10, 0, val)
774 850
775#define read_c0_compare() __read_32bit_c0_register($11, 0) 851#define read_c0_compare() __read_32bit_c0_register($11, 0)
776#define write_c0_compare(val) __write_32bit_c0_register($11, 0, val) 852#define write_c0_compare(val) __write_32bit_c0_register($11, 0, val)
777 853
854#define read_c0_compare2() __read_32bit_c0_register($11, 6) /* pnx8550 */
855#define write_c0_compare2(val) __write_32bit_c0_register($11, 6, val)
856
857#define read_c0_compare3() __read_32bit_c0_register($11, 7) /* pnx8550 */
858#define write_c0_compare3(val) __write_32bit_c0_register($11, 7, val)
859
778#define read_c0_status() __read_32bit_c0_register($12, 0) 860#define read_c0_status() __read_32bit_c0_register($12, 0)
779#define write_c0_status(val) __write_32bit_c0_register($12, 0, val) 861#define write_c0_status(val) __write_32bit_c0_register($12, 0, val)
780 862
@@ -790,10 +872,18 @@ do { \
790#define read_c0_config1() __read_32bit_c0_register($16, 1) 872#define read_c0_config1() __read_32bit_c0_register($16, 1)
791#define read_c0_config2() __read_32bit_c0_register($16, 2) 873#define read_c0_config2() __read_32bit_c0_register($16, 2)
792#define read_c0_config3() __read_32bit_c0_register($16, 3) 874#define read_c0_config3() __read_32bit_c0_register($16, 3)
875#define read_c0_config4() __read_32bit_c0_register($16, 4)
876#define read_c0_config5() __read_32bit_c0_register($16, 5)
877#define read_c0_config6() __read_32bit_c0_register($16, 6)
878#define read_c0_config7() __read_32bit_c0_register($16, 7)
793#define write_c0_config(val) __write_32bit_c0_register($16, 0, val) 879#define write_c0_config(val) __write_32bit_c0_register($16, 0, val)
794#define write_c0_config1(val) __write_32bit_c0_register($16, 1, val) 880#define write_c0_config1(val) __write_32bit_c0_register($16, 1, val)
795#define write_c0_config2(val) __write_32bit_c0_register($16, 2, val) 881#define write_c0_config2(val) __write_32bit_c0_register($16, 2, val)
796#define write_c0_config3(val) __write_32bit_c0_register($16, 3, val) 882#define write_c0_config3(val) __write_32bit_c0_register($16, 3, val)
883#define write_c0_config4(val) __write_32bit_c0_register($16, 4, val)
884#define write_c0_config5(val) __write_32bit_c0_register($16, 5, val)
885#define write_c0_config6(val) __write_32bit_c0_register($16, 6, val)
886#define write_c0_config7(val) __write_32bit_c0_register($16, 7, val)
797 887
798/* 888/*
799 * The WatchLo register. There may be upto 8 of them. 889 * The WatchLo register. There may be upto 8 of them.
@@ -917,6 +1007,22 @@ do { \
917#define read_c0_errorepc() __read_ulong_c0_register($30, 0) 1007#define read_c0_errorepc() __read_ulong_c0_register($30, 0)
918#define write_c0_errorepc(val) __write_ulong_c0_register($30, 0, val) 1008#define write_c0_errorepc(val) __write_ulong_c0_register($30, 0, val)
919 1009
1010/* MIPSR2 */
1011#define read_c0_hwrena() __read_32bit_c0_register($7,0)
1012#define write_c0_hwrena(val) __write_32bit_c0_register($7, 0, val)
1013
1014#define read_c0_intctl() __read_32bit_c0_register($12, 1)
1015#define write_c0_intctl(val) __write_32bit_c0_register($12, 1, val)
1016
1017#define read_c0_srsctl() __read_32bit_c0_register($12, 2)
1018#define write_c0_srsctl(val) __write_32bit_c0_register($12, 2, val)
1019
1020#define read_c0_srsmap() __read_32bit_c0_register($12, 3)
1021#define write_c0_srsmap(val) __write_32bit_c0_register($12, 3, val)
1022
1023#define read_c0_ebase() __read_32bit_c0_register($15,1)
1024#define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val)
1025
920/* 1026/*
921 * Macros to access the floating point coprocessor control registers 1027 * Macros to access the floating point coprocessor control registers
922 */ 1028 */
@@ -930,6 +1036,284 @@ do { \
930 : "=r" (__res)); \ 1036 : "=r" (__res)); \
931 __res;}) 1037 __res;})
932 1038
1039#define rddsp(mask) \
1040({ \
1041 unsigned int __res; \
1042 \
1043 __asm__ __volatile__( \
1044 " .set push \n" \
1045 " .set noat \n" \
1046 " # rddsp $1, %x1 \n" \
1047 " .word 0x7c000cb8 | (%x1 << 16) \n" \
1048 " move %0, $1 \n" \
1049 " .set pop \n" \
1050 : "=r" (__res) \
1051 : "i" (mask)); \
1052 __res; \
1053})
1054
1055#define wrdsp(val, mask) \
1056do { \
1057 __asm__ __volatile__( \
1058 " .set push \n" \
1059 " .set noat \n" \
1060 " move $1, %0 \n" \
1061 " # wrdsp $1, %x1 \n" \
1062 " .word 0x7c2004f8 | (%x1 << 15) \n" \
1063 " .set pop \n" \
1064 : \
1065 : "r" (val), "i" (mask)); \
1066} while (0)
1067
1068#if 0 /* Need DSP ASE capable assembler ... */
1069#define mflo0() ({ long mflo0; __asm__("mflo %0, $ac0" : "=r" (mflo0)); mflo0;})
1070#define mflo1() ({ long mflo1; __asm__("mflo %0, $ac1" : "=r" (mflo1)); mflo1;})
1071#define mflo2() ({ long mflo2; __asm__("mflo %0, $ac2" : "=r" (mflo2)); mflo2;})
1072#define mflo3() ({ long mflo3; __asm__("mflo %0, $ac3" : "=r" (mflo3)); mflo3;})
1073
1074#define mfhi0() ({ long mfhi0; __asm__("mfhi %0, $ac0" : "=r" (mfhi0)); mfhi0;})
1075#define mfhi1() ({ long mfhi1; __asm__("mfhi %0, $ac1" : "=r" (mfhi1)); mfhi1;})
1076#define mfhi2() ({ long mfhi2; __asm__("mfhi %0, $ac2" : "=r" (mfhi2)); mfhi2;})
1077#define mfhi3() ({ long mfhi3; __asm__("mfhi %0, $ac3" : "=r" (mfhi3)); mfhi3;})
1078
1079#define mtlo0(x) __asm__("mtlo %0, $ac0" ::"r" (x))
1080#define mtlo1(x) __asm__("mtlo %0, $ac1" ::"r" (x))
1081#define mtlo2(x) __asm__("mtlo %0, $ac2" ::"r" (x))
1082#define mtlo3(x) __asm__("mtlo %0, $ac3" ::"r" (x))
1083
1084#define mthi0(x) __asm__("mthi %0, $ac0" ::"r" (x))
1085#define mthi1(x) __asm__("mthi %0, $ac1" ::"r" (x))
1086#define mthi2(x) __asm__("mthi %0, $ac2" ::"r" (x))
1087#define mthi3(x) __asm__("mthi %0, $ac3" ::"r" (x))
1088
1089#else
1090
1091#define mfhi0() \
1092({ \
1093 unsigned long __treg; \
1094 \
1095 __asm__ __volatile__( \
1096 " .set push \n" \
1097 " .set noat \n" \
1098 " # mfhi %0, $ac0 \n" \
1099 " .word 0x00000810 \n" \
1100 " move %0, $1 \n" \
1101 " .set pop \n" \
1102 : "=r" (__treg)); \
1103 __treg; \
1104})
1105
1106#define mfhi1() \
1107({ \
1108 unsigned long __treg; \
1109 \
1110 __asm__ __volatile__( \
1111 " .set push \n" \
1112 " .set noat \n" \
1113 " # mfhi %0, $ac1 \n" \
1114 " .word 0x00200810 \n" \
1115 " move %0, $1 \n" \
1116 " .set pop \n" \
1117 : "=r" (__treg)); \
1118 __treg; \
1119})
1120
1121#define mfhi2() \
1122({ \
1123 unsigned long __treg; \
1124 \
1125 __asm__ __volatile__( \
1126 " .set push \n" \
1127 " .set noat \n" \
1128 " # mfhi %0, $ac2 \n" \
1129 " .word 0x00400810 \n" \
1130 " move %0, $1 \n" \
1131 " .set pop \n" \
1132 : "=r" (__treg)); \
1133 __treg; \
1134})
1135
1136#define mfhi3() \
1137({ \
1138 unsigned long __treg; \
1139 \
1140 __asm__ __volatile__( \
1141 " .set push \n" \
1142 " .set noat \n" \
1143 " # mfhi %0, $ac3 \n" \
1144 " .word 0x00600810 \n" \
1145 " move %0, $1 \n" \
1146 " .set pop \n" \
1147 : "=r" (__treg)); \
1148 __treg; \
1149})
1150
1151#define mflo0() \
1152({ \
1153 unsigned long __treg; \
1154 \
1155 __asm__ __volatile__( \
1156 " .set push \n" \
1157 " .set noat \n" \
1158 " # mflo %0, $ac0 \n" \
1159 " .word 0x00000812 \n" \
1160 " move %0, $1 \n" \
1161 " .set pop \n" \
1162 : "=r" (__treg)); \
1163 __treg; \
1164})
1165
1166#define mflo1() \
1167({ \
1168 unsigned long __treg; \
1169 \
1170 __asm__ __volatile__( \
1171 " .set push \n" \
1172 " .set noat \n" \
1173 " # mflo %0, $ac1 \n" \
1174 " .word 0x00200812 \n" \
1175 " move %0, $1 \n" \
1176 " .set pop \n" \
1177 : "=r" (__treg)); \
1178 __treg; \
1179})
1180
1181#define mflo2() \
1182({ \
1183 unsigned long __treg; \
1184 \
1185 __asm__ __volatile__( \
1186 " .set push \n" \
1187 " .set noat \n" \
1188 " # mflo %0, $ac2 \n" \
1189 " .word 0x00400812 \n" \
1190 " move %0, $1 \n" \
1191 " .set pop \n" \
1192 : "=r" (__treg)); \
1193 __treg; \
1194})
1195
1196#define mflo3() \
1197({ \
1198 unsigned long __treg; \
1199 \
1200 __asm__ __volatile__( \
1201 " .set push \n" \
1202 " .set noat \n" \
1203 " # mflo %0, $ac3 \n" \
1204 " .word 0x00600812 \n" \
1205 " move %0, $1 \n" \
1206 " .set pop \n" \
1207 : "=r" (__treg)); \
1208 __treg; \
1209})
1210
1211#define mthi0(x) \
1212do { \
1213 __asm__ __volatile__( \
1214 " .set push \n" \
1215 " .set noat \n" \
1216 " move $1, %0 \n" \
1217 " # mthi $1, $ac0 \n" \
1218 " .word 0x00200011 \n" \
1219 " .set pop \n" \
1220 : \
1221 : "r" (x)); \
1222} while (0)
1223
1224#define mthi1(x) \
1225do { \
1226 __asm__ __volatile__( \
1227 " .set push \n" \
1228 " .set noat \n" \
1229 " move $1, %0 \n" \
1230 " # mthi $1, $ac1 \n" \
1231 " .word 0x00200811 \n" \
1232 " .set pop \n" \
1233 : \
1234 : "r" (x)); \
1235} while (0)
1236
1237#define mthi2(x) \
1238do { \
1239 __asm__ __volatile__( \
1240 " .set push \n" \
1241 " .set noat \n" \
1242 " move $1, %0 \n" \
1243 " # mthi $1, $ac2 \n" \
1244 " .word 0x00201011 \n" \
1245 " .set pop \n" \
1246 : \
1247 : "r" (x)); \
1248} while (0)
1249
1250#define mthi3(x) \
1251do { \
1252 __asm__ __volatile__( \
1253 " .set push \n" \
1254 " .set noat \n" \
1255 " move $1, %0 \n" \
1256 " # mthi $1, $ac3 \n" \
1257 " .word 0x00201811 \n" \
1258 " .set pop \n" \
1259 : \
1260 : "r" (x)); \
1261} while (0)
1262
1263#define mtlo0(x) \
1264do { \
1265 __asm__ __volatile__( \
1266 " .set push \n" \
1267 " .set noat \n" \
1268 " move $1, %0 \n" \
1269 " # mtlo $1, $ac0 \n" \
1270 " .word 0x00200013 \n" \
1271 " .set pop \n" \
1272 : \
1273 : "r" (x)); \
1274} while (0)
1275
1276#define mtlo1(x) \
1277do { \
1278 __asm__ __volatile__( \
1279 " .set push \n" \
1280 " .set noat \n" \
1281 " move $1, %0 \n" \
1282 " # mtlo $1, $ac1 \n" \
1283 " .word 0x00200813 \n" \
1284 " .set pop \n" \
1285 : \
1286 : "r" (x)); \
1287} while (0)
1288
1289#define mtlo2(x) \
1290do { \
1291 __asm__ __volatile__( \
1292 " .set push \n" \
1293 " .set noat \n" \
1294 " move $1, %0 \n" \
1295 " # mtlo $1, $ac2 \n" \
1296 " .word 0x00201013 \n" \
1297 " .set pop \n" \
1298 : \
1299 : "r" (x)); \
1300} while (0)
1301
1302#define mtlo3(x) \
1303do { \
1304 __asm__ __volatile__( \
1305 " .set push \n" \
1306 " .set noat \n" \
1307 " move $1, %0 \n" \
1308 " # mtlo $1, $ac3 \n" \
1309 " .word 0x00201813 \n" \
1310 " .set pop \n" \
1311 : \
1312 : "r" (x)); \
1313} while (0)
1314
1315#endif
1316
933/* 1317/*
934 * TLB operations. 1318 * TLB operations.
935 * 1319 *
@@ -1012,6 +1396,8 @@ __BUILD_SET_C0(status)
1012__BUILD_SET_C0(cause) 1396__BUILD_SET_C0(cause)
1013__BUILD_SET_C0(config) 1397__BUILD_SET_C0(config)
1014__BUILD_SET_C0(intcontrol) 1398__BUILD_SET_C0(intcontrol)
1399__BUILD_SET_C0(intctl)
1400__BUILD_SET_C0(srsmap)
1015 1401
1016#endif /* !__ASSEMBLY__ */ 1402#endif /* !__ASSEMBLY__ */
1017 1403
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h
index 45cd72d172e8..19cdf7642e66 100644
--- a/include/asm-mips/mmu_context.h
+++ b/include/asm-mips/mmu_context.h
@@ -30,7 +30,7 @@ extern unsigned long pgd_current[];
30 30
31#ifdef CONFIG_32BIT 31#ifdef CONFIG_32BIT
32#define TLBMISS_HANDLER_SETUP() \ 32#define TLBMISS_HANDLER_SETUP() \
33 write_c0_context((unsigned long) smp_processor_id() << 23); \ 33 write_c0_context((unsigned long) smp_processor_id() << 25); \
34 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) 34 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
35#endif 35#endif
36#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) 36#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
@@ -40,7 +40,7 @@ extern unsigned long pgd_current[];
40#endif 40#endif
41#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) 41#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64)
42#define TLBMISS_HANDLER_SETUP() \ 42#define TLBMISS_HANDLER_SETUP() \
43 write_c0_context((unsigned long) smp_processor_id() << 23); \ 43 write_c0_context((unsigned long) smp_processor_id() << 26); \
44 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) 44 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
45#endif 45#endif
46 46
diff --git a/include/asm-mips/mmzone.h b/include/asm-mips/mmzone.h
index d721143dbd47..011caebac369 100644
--- a/include/asm-mips/mmzone.h
+++ b/include/asm-mips/mmzone.h
@@ -5,6 +5,7 @@
5#ifndef _ASM_MMZONE_H_ 5#ifndef _ASM_MMZONE_H_
6#define _ASM_MMZONE_H_ 6#define _ASM_MMZONE_H_
7 7
8#include <linux/config.h>
8#include <asm/page.h> 9#include <asm/page.h>
9#include <mmzone.h> 10#include <mmzone.h>
10 11
diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h
index 0be58b2aeb9f..2be399311eec 100644
--- a/include/asm-mips/module.h
+++ b/include/asm-mips/module.h
@@ -14,15 +14,23 @@ struct mod_arch_specific {
14 14
15typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */ 15typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */
16 16
17typedef struct 17typedef struct {
18{ 18 Elf64_Addr r_offset; /* Address of relocation. */
19 Elf64_Addr r_offset; /* Address of relocation. */ 19 Elf64_Word r_sym; /* Symbol index. */
20 Elf64_Word r_sym; /* Symbol index. */ 20 Elf64_Byte r_ssym; /* Special symbol. */
21 Elf64_Byte r_ssym; /* Special symbol. */ 21 Elf64_Byte r_type3; /* Third relocation. */
22 Elf64_Byte r_type3; /* Third relocation. */ 22 Elf64_Byte r_type2; /* Second relocation. */
23 Elf64_Byte r_type2; /* Second relocation. */ 23 Elf64_Byte r_type; /* First relocation. */
24 Elf64_Byte r_type; /* First relocation. */ 24} Elf64_Mips_Rel;
25 Elf64_Sxword r_addend; /* Addend. */ 25
26typedef struct {
27 Elf64_Addr r_offset; /* Address of relocation. */
28 Elf64_Word r_sym; /* Symbol index. */
29 Elf64_Byte r_ssym; /* Special symbol. */
30 Elf64_Byte r_type3; /* Third relocation. */
31 Elf64_Byte r_type2; /* Second relocation. */
32 Elf64_Byte r_type; /* First relocation. */
33 Elf64_Sxword r_addend; /* Addend. */
26} Elf64_Mips_Rela; 34} Elf64_Mips_Rela;
27 35
28#ifdef CONFIG_32BIT 36#ifdef CONFIG_32BIT
@@ -30,6 +38,13 @@ typedef struct
30#define Elf_Shdr Elf32_Shdr 38#define Elf_Shdr Elf32_Shdr
31#define Elf_Sym Elf32_Sym 39#define Elf_Sym Elf32_Sym
32#define Elf_Ehdr Elf32_Ehdr 40#define Elf_Ehdr Elf32_Ehdr
41#define Elf_Addr Elf32_Addr
42
43#define Elf_Mips_Rel Elf32_Rel
44#define Elf_Mips_Rela Elf32_Rela
45
46#define ELF_MIPS_R_SYM(rel) ELF32_R_SYM(rel.r_info)
47#define ELF_MIPS_R_TYPE(rel) ELF32_R_TYPE(rel.r_info)
33 48
34#endif 49#endif
35 50
@@ -38,6 +53,13 @@ typedef struct
38#define Elf_Shdr Elf64_Shdr 53#define Elf_Shdr Elf64_Shdr
39#define Elf_Sym Elf64_Sym 54#define Elf_Sym Elf64_Sym
40#define Elf_Ehdr Elf64_Ehdr 55#define Elf_Ehdr Elf64_Ehdr
56#define Elf_Addr Elf64_Addr
57
58#define Elf_Mips_Rel Elf64_Mips_Rel
59#define Elf_Mips_Rela Elf64_Mips_Rela
60
61#define ELF_MIPS_R_SYM(rel) (rel.r_sym)
62#define ELF_MIPS_R_TYPE(rel) (rel.r_type)
41 63
42#endif 64#endif
43 65
@@ -53,4 +75,54 @@ search_module_dbetables(unsigned long addr)
53} 75}
54#endif 76#endif
55 77
78#ifdef CONFIG_CPU_MIPS32_R1
79#define MODULE_PROC_FAMILY "MIPS32_R1"
80#elif defined CONFIG_CPU_MIPS32_R2
81#define MODULE_PROC_FAMILY "MIPS32_R2"
82#elif defined CONFIG_CPU_MIPS64_R1
83#define MODULE_PROC_FAMILY "MIPS64_R1"
84#elif defined CONFIG_CPU_MIPS64_R2
85#define MODULE_PROC_FAMILY "MIPS64_R2"
86#elif defined CONFIG_CPU_R3000
87#define MODULE_PROC_FAMILY "R3000"
88#elif defined CONFIG_CPU_TX39XX
89#define MODULE_PROC_FAMILY "TX39XX"
90#elif defined CONFIG_CPU_VR41XX
91#define MODULE_PROC_FAMILY "VR41XX"
92#elif defined CONFIG_CPU_R4300
93#define MODULE_PROC_FAMILY "R4300"
94#elif defined CONFIG_CPU_R4X00
95#define MODULE_PROC_FAMILY "R4X00"
96#elif defined CONFIG_CPU_TX49XX
97#define MODULE_PROC_FAMILY "TX49XX"
98#elif defined CONFIG_CPU_R5000
99#define MODULE_PROC_FAMILY "R5000"
100#elif defined CONFIG_CPU_R5432
101#define MODULE_PROC_FAMILY "R5432"
102#elif defined CONFIG_CPU_R6000
103#define MODULE_PROC_FAMILY "R6000"
104#elif defined CONFIG_CPU_NEVADA
105#define MODULE_PROC_FAMILY "NEVADA"
106#elif defined CONFIG_CPU_R8000
107#define MODULE_PROC_FAMILY "R8000"
108#elif defined CONFIG_CPU_R10000
109#define MODULE_PROC_FAMILY "R10000"
110#elif defined CONFIG_CPU_RM7000
111#define MODULE_PROC_FAMILY "RM7000"
112#elif defined CONFIG_CPU_RM9000
113#define MODULE_PROC_FAMILY "RM9000"
114#elif defined CONFIG_CPU_SB1
115#define MODULE_PROC_FAMILY "SB1"
116#else
117#error MODULE_PROC_FAMILY undefined for your processor configuration
118#endif
119
120#ifdef CONFIG_32BIT
121#define MODULE_KERNEL_TYPE "32BIT "
122#elif defined CONFIG_64BIT
123#define MODULE_KERNEL_TYPE "64BIT "
124#endif
125
126#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_KERNEL_TYPE
127
56#endif /* _ASM_MODULE_H */ 128#endif /* _ASM_MODULE_H */
diff --git a/include/asm-mips/paccess.h b/include/asm-mips/paccess.h
index 309bc3099f68..46f2d23d2697 100644
--- a/include/asm-mips/paccess.h
+++ b/include/asm-mips/paccess.h
@@ -52,7 +52,7 @@ struct __large_pstruct { unsigned long buf[100]; };
52}) 52})
53 53
54#define __get_dbe_asm(insn) \ 54#define __get_dbe_asm(insn) \
55({ \ 55{ \
56 __asm__ __volatile__( \ 56 __asm__ __volatile__( \
57 "1:\t" insn "\t%1,%2\n\t" \ 57 "1:\t" insn "\t%1,%2\n\t" \
58 "move\t%0,$0\n" \ 58 "move\t%0,$0\n" \
@@ -67,7 +67,7 @@ struct __large_pstruct { unsigned long buf[100]; };
67 ".previous" \ 67 ".previous" \
68 :"=r" (__gu_err), "=r" (__gu_val) \ 68 :"=r" (__gu_err), "=r" (__gu_val) \
69 :"o" (__mp(__gu_addr)), "i" (-EFAULT)); \ 69 :"o" (__mp(__gu_addr)), "i" (-EFAULT)); \
70}) 70}
71 71
72extern void __get_dbe_unknown(void); 72extern void __get_dbe_unknown(void);
73 73
@@ -90,7 +90,7 @@ extern void __get_dbe_unknown(void);
90}) 90})
91 91
92#define __put_dbe_asm(insn) \ 92#define __put_dbe_asm(insn) \
93({ \ 93{ \
94 __asm__ __volatile__( \ 94 __asm__ __volatile__( \
95 "1:\t" insn "\t%1,%2\n\t" \ 95 "1:\t" insn "\t%1,%2\n\t" \
96 "move\t%0,$0\n" \ 96 "move\t%0,$0\n" \
@@ -104,7 +104,7 @@ extern void __get_dbe_unknown(void);
104 ".previous" \ 104 ".previous" \
105 : "=r" (__pu_err) \ 105 : "=r" (__pu_err) \
106 : "r" (__pu_val), "o" (__mp(__pu_addr)), "i" (-EFAULT)); \ 106 : "r" (__pu_val), "o" (__mp(__pu_addr)), "i" (-EFAULT)); \
107}) 107}
108 108
109extern void __put_dbe_unknown(void); 109extern void __put_dbe_unknown(void);
110 110
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 652b6d67a571..ee25a779bf49 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -87,22 +87,48 @@ static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
87typedef struct { unsigned long pte; } pte_t; 87typedef struct { unsigned long pte; } pte_t;
88#define pte_val(x) ((x).pte) 88#define pte_val(x) ((x).pte)
89#endif 89#endif
90#define __pte(x) ((pte_t) { (x) } )
90 91
91typedef struct { unsigned long pmd; } pmd_t; 92/*
92typedef struct { unsigned long pgd; } pgd_t; 93 * For 3-level pagetables we defines these ourselves, for 2-level the
93typedef struct { unsigned long pgprot; } pgprot_t; 94 * definitions are supplied by <asm-generic/pgtable-nopmd.h>.
95 */
96#ifdef CONFIG_64BIT
94 97
98typedef struct { unsigned long pmd; } pmd_t;
95#define pmd_val(x) ((x).pmd) 99#define pmd_val(x) ((x).pmd)
96#define pgd_val(x) ((x).pgd) 100#define __pmd(x) ((pmd_t) { (x) } )
97#define pgprot_val(x) ((x).pgprot)
98 101
99#define ptep_buddy(x) ((pte_t *)((unsigned long)(x) ^ sizeof(pte_t))) 102#endif
100 103
101#define __pte(x) ((pte_t) { (x) } ) 104/*
102#define __pmd(x) ((pmd_t) { (x) } ) 105 * Right now we don't support 4-level pagetables, so all pud-related
106 * definitions come from <asm-generic/pgtable-nopud.h>.
107 */
108
109/*
110 * Finall the top of the hierarchy, the pgd
111 */
112typedef struct { unsigned long pgd; } pgd_t;
113#define pgd_val(x) ((x).pgd)
103#define __pgd(x) ((pgd_t) { (x) } ) 114#define __pgd(x) ((pgd_t) { (x) } )
115
116/*
117 * Manipulate page protection bits
118 */
119typedef struct { unsigned long pgprot; } pgprot_t;
120#define pgprot_val(x) ((x).pgprot)
104#define __pgprot(x) ((pgprot_t) { (x) } ) 121#define __pgprot(x) ((pgprot_t) { (x) } )
105 122
123/*
124 * On R4000-style MMUs where a TLB entry is mapping a adjacent even / odd
125 * pair of pages we only have a single global bit per pair of pages. When
126 * writing to the TLB make sure we always have the bit set for both pages
127 * or none. This macro is used to access the `buddy' of the pte we're just
128 * working on.
129 */
130#define ptep_buddy(x) ((pte_t *)((unsigned long)(x) ^ sizeof(pte_t)))
131
106#endif /* !__ASSEMBLY__ */ 132#endif /* !__ASSEMBLY__ */
107 133
108/* to align the pointer to the (next) page boundary */ 134/* to align the pointer to the (next) page boundary */
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index c9a00ca1c012..6c9ad8171a77 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -40,6 +40,11 @@ struct pci_controller {
40 unsigned int need_domain_info; 40 unsigned int need_domain_info;
41 41
42 int iommu; 42 int iommu;
43
44 /* Optional access methods for reading/writing the bus number
45 of the PCI controller */
46 int (*get_busno)(void);
47 void (*set_busno)(int busno);
43}; 48};
44 49
45/* 50/*
@@ -142,8 +147,22 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
142 147
143extern void pcibios_resource_to_bus(struct pci_dev *dev, 148extern void pcibios_resource_to_bus(struct pci_dev *dev,
144 struct pci_bus_region *region, struct resource *res); 149 struct pci_bus_region *region, struct resource *res);
145extern void pcibios_bus_to_resource(struct pci_dev *dev, 150
146 struct resource *res, struct pci_bus_region *region); 151extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
152 struct pci_bus_region *region);
153
154static inline struct resource *
155pcibios_select_root(struct pci_dev *pdev, struct resource *res)
156{
157 struct resource *root = NULL;
158
159 if (res->flags & IORESOURCE_IO)
160 root = &ioport_resource;
161 if (res->flags & IORESOURCE_MEM)
162 root = &iomem_resource;
163
164 return root;
165}
147 166
148#ifdef CONFIG_PCI_DOMAINS 167#ifdef CONFIG_PCI_DOMAINS
149 168
@@ -169,17 +188,4 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev)
169/* Do platform specific device initialization at pci_enable_device() time */ 188/* Do platform specific device initialization at pci_enable_device() time */
170extern int pcibios_plat_dev_init(struct pci_dev *dev); 189extern int pcibios_plat_dev_init(struct pci_dev *dev);
171 190
172static inline struct resource *
173pcibios_select_root(struct pci_dev *pdev, struct resource *res)
174{
175 struct resource *root = NULL;
176
177 if (res->flags & IORESOURCE_IO)
178 root = &ioport_resource;
179 if (res->flags & IORESOURCE_MEM)
180 root = &iomem_resource;
181
182 return root;
183}
184
185#endif /* _ASM_PCI_H */ 191#endif /* _ASM_PCI_H */
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h
index ce57288d43bd..fe1df572318b 100644
--- a/include/asm-mips/pgalloc.h
+++ b/include/asm-mips/pgalloc.h
@@ -26,10 +26,22 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
26} 26}
27 27
28/* 28/*
29 * Initialize a new pmd table with invalid pointers.
30 */
31extern void pmd_init(unsigned long page, unsigned long pagetable);
32
33#ifdef CONFIG_64BIT
34
35static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
36{
37 set_pud(pud, __pud((unsigned long)pmd));
38}
39#endif
40
41/*
29 * Initialize a new pgd / pmd table with invalid pointers. 42 * Initialize a new pgd / pmd table with invalid pointers.
30 */ 43 */
31extern void pgd_init(unsigned long page); 44extern void pgd_init(unsigned long page);
32extern void pmd_init(unsigned long page, unsigned long pagetable);
33 45
34static inline pgd_t *pgd_alloc(struct mm_struct *mm) 46static inline pgd_t *pgd_alloc(struct mm_struct *mm)
35{ 47{
@@ -86,21 +98,18 @@ static inline void pte_free(struct page *pte)
86#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) 98#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
87 99
88#ifdef CONFIG_32BIT 100#ifdef CONFIG_32BIT
89#define pgd_populate(mm, pmd, pte) BUG()
90 101
91/* 102/*
92 * allocating and freeing a pmd is trivial: the 1-entry pmd is 103 * allocating and freeing a pmd is trivial: the 1-entry pmd is
93 * inside the pgd, so has no extra memory associated with it. 104 * inside the pgd, so has no extra memory associated with it.
94 */ 105 */
95#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
96#define pmd_free(x) do { } while (0) 106#define pmd_free(x) do { } while (0)
97#define __pmd_free_tlb(tlb,x) do { } while (0) 107#define __pmd_free_tlb(tlb,x) do { } while (0)
108
98#endif 109#endif
99 110
100#ifdef CONFIG_64BIT 111#ifdef CONFIG_64BIT
101 112
102#define pgd_populate(mm, pgd, pmd) set_pgd(pgd, __pgd(pmd))
103
104static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) 113static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
105{ 114{
106 pmd_t *pmd; 115 pmd_t *pmd;
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
index 7fec93b76da9..0cff64ce0fb8 100644
--- a/include/asm-mips/pgtable-32.h
+++ b/include/asm-mips/pgtable-32.h
@@ -17,6 +17,8 @@
17#include <asm/cachectl.h> 17#include <asm/cachectl.h>
18#include <asm/fixmap.h> 18#include <asm/fixmap.h>
19 19
20#include <asm-generic/pgtable-nopmd.h>
21
20/* 22/*
21 * - add_wired_entry() add a fixed TLB entry, and move wired register 23 * - add_wired_entry() add a fixed TLB entry, and move wired register
22 */ 24 */
@@ -41,42 +43,38 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
41 * works even with the cache aliasing problem the R4k and above have. 43 * works even with the cache aliasing problem the R4k and above have.
42 */ 44 */
43 45
44/* PMD_SHIFT determines the size of the area a second-level page table can map */ 46/* PGDIR_SHIFT determines what a third-level page table entry can map */
45#ifdef CONFIG_64BIT_PHYS_ADDR 47#ifdef CONFIG_64BIT_PHYS_ADDR
46#define PMD_SHIFT 21 48#define PGDIR_SHIFT 21
47#else 49#else
48#define PMD_SHIFT 22 50#define PGDIR_SHIFT 22
49#endif 51#endif
50#define PMD_SIZE (1UL << PMD_SHIFT)
51#define PMD_MASK (~(PMD_SIZE-1))
52
53/* PGDIR_SHIFT determines what a third-level page table entry can map */
54#define PGDIR_SHIFT PMD_SHIFT
55#define PGDIR_SIZE (1UL << PGDIR_SHIFT) 52#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
56#define PGDIR_MASK (~(PGDIR_SIZE-1)) 53#define PGDIR_MASK (~(PGDIR_SIZE-1))
57 54
58/* 55/*
59 * Entries per page directory level: we use two-level, so 56 * Entries per page directory level: we use two-level, so
60 * we don't really have any PMD directory physically. 57 * we don't really have any PUD/PMD directory physically.
61 */ 58 */
62#ifdef CONFIG_64BIT_PHYS_ADDR 59#ifdef CONFIG_64BIT_PHYS_ADDR
63#define PGD_ORDER 1 60#define PGD_ORDER 1
64#define PMD_ORDER 0 61#define PUD_ORDER aieeee_attempt_to_allocate_pud
62#define PMD_ORDER 1
65#define PTE_ORDER 0 63#define PTE_ORDER 0
66#else 64#else
67#define PGD_ORDER 0 65#define PGD_ORDER 0
68#define PMD_ORDER 0 66#define PUD_ORDER aieeee_attempt_to_allocate_pud
67#define PMD_ORDER 1
69#define PTE_ORDER 0 68#define PTE_ORDER 0
70#endif 69#endif
71 70
72#define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t)) 71#define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t))
73#define PTRS_PER_PMD 1
74#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) 72#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
75 73
76#define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE) 74#define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE)
77#define FIRST_USER_ADDRESS 0 75#define FIRST_USER_ADDRESS 0
78 76
79#define VMALLOC_START KSEG2 77#define VMALLOC_START MAP_BASE
80 78
81#ifdef CONFIG_HIGHMEM 79#ifdef CONFIG_HIGHMEM
82# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) 80# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE)
@@ -91,8 +89,6 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
91#define pte_ERROR(e) \ 89#define pte_ERROR(e) \
92 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) 90 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
93#endif 91#endif
94#define pmd_ERROR(e) \
95 printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
96#define pgd_ERROR(e) \ 92#define pgd_ERROR(e) \
97 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) 93 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
98 94
@@ -120,17 +116,7 @@ static inline void pmd_clear(pmd_t *pmdp)
120 pmd_val(*pmdp) = ((unsigned long) invalid_pte_table); 116 pmd_val(*pmdp) = ((unsigned long) invalid_pte_table);
121} 117}
122 118
123/* 119#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
124 * The "pgd_xxx()" functions here are trivial for a folded two-level
125 * setup: the pgd is never bad, and a pmd always exists (as it's folded
126 * into the pgd entry)
127 */
128static inline int pgd_none(pgd_t pgd) { return 0; }
129static inline int pgd_bad(pgd_t pgd) { return 0; }
130static inline int pgd_present(pgd_t pgd) { return 1; }
131static inline void pgd_clear(pgd_t *pgdp) { }
132
133#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
134#define pte_page(x) pfn_to_page(pte_pfn(x)) 120#define pte_page(x) pfn_to_page(pte_pfn(x))
135#define pte_pfn(x) ((unsigned long)((x).pte_high >> 6)) 121#define pte_pfn(x) ((unsigned long)((x).pte_high >> 6))
136static inline pte_t 122static inline pte_t
@@ -151,27 +137,22 @@ pfn_pte(unsigned long pfn, pgprot_t prot)
151#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) 137#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
152#else 138#else
153#define pte_pfn(x) ((unsigned long)((x).pte >> PAGE_SHIFT)) 139#define pte_pfn(x) ((unsigned long)((x).pte >> PAGE_SHIFT))
154#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) 140#define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
155#endif 141#endif
156#endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */ 142#endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) */
157 143
158#define __pgd_offset(address) pgd_index(address) 144#define __pgd_offset(address) pgd_index(address)
145#define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
159#define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) 146#define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
160 147
161/* to find an entry in a kernel page-table-directory */ 148/* to find an entry in a kernel page-table-directory */
162#define pgd_offset_k(address) pgd_offset(&init_mm, address) 149#define pgd_offset_k(address) pgd_offset(&init_mm, address)
163 150
164#define pgd_index(address) ((address) >> PGDIR_SHIFT) 151#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
165 152
166/* to find an entry in a page-table-directory */ 153/* to find an entry in a page-table-directory */
167#define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) 154#define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr))
168 155
169/* Find an entry in the second-level page table.. */
170static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address)
171{
172 return (pmd_t *) dir;
173}
174
175/* Find an entry in the third-level page table.. */ 156/* Find an entry in the third-level page table.. */
176#define __pte_offset(address) \ 157#define __pte_offset(address) \
177 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) 158 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
@@ -221,7 +202,7 @@ static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address)
221 */ 202 */
222#define PTE_FILE_MAX_BITS 27 203#define PTE_FILE_MAX_BITS 27
223 204
224#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) 205#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
225 /* fixme */ 206 /* fixme */
226#define pte_to_pgoff(_pte) (((_pte).pte_high >> 6) + ((_pte).pte_high & 0x3f)) 207#define pte_to_pgoff(_pte) (((_pte).pte_high >> 6) + ((_pte).pte_high & 0x3f))
227#define pgoff_to_pte(off) \ 208#define pgoff_to_pte(off) \
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h
index 1011e0635f56..3e0a522c0f0e 100644
--- a/include/asm-mips/pgtable-64.h
+++ b/include/asm-mips/pgtable-64.h
@@ -16,13 +16,15 @@
16#include <asm/page.h> 16#include <asm/page.h>
17#include <asm/cachectl.h> 17#include <asm/cachectl.h>
18 18
19#include <asm-generic/pgtable-nopud.h>
20
19/* 21/*
20 * Each address space has 2 4K pages as its page directory, giving 1024 22 * Each address space has 2 4K pages as its page directory, giving 1024
21 * (== PTRS_PER_PGD) 8 byte pointers to pmd tables. Each pmd table is a 23 * (== PTRS_PER_PGD) 8 byte pointers to pmd tables. Each pmd table is a
22 * pair of 4K pages, giving 1024 (== PTRS_PER_PMD) 8 byte pointers to 24 * single 4K page, giving 512 (== PTRS_PER_PMD) 8 byte pointers to page
23 * page tables. Each page table is a single 4K page, giving 512 (== 25 * tables. Each page table is also a single 4K page, giving 512 (==
24 * PTRS_PER_PTE) 8 byte ptes. Each pgde is initialized to point to 26 * PTRS_PER_PTE) 8 byte ptes. Each pud entry is initialized to point to
25 * invalid_pmd_table, each pmde is initialized to point to 27 * invalid_pmd_table, each pmd entry is initialized to point to
26 * invalid_pte_table, each pte is initialized to 0. When memory is low, 28 * invalid_pte_table, each pte is initialized to 0. When memory is low,
27 * and a pmd table or a page table allocation fails, empty_bad_pmd_table 29 * and a pmd table or a page table allocation fails, empty_bad_pmd_table
28 * and empty_bad_page_table is returned back to higher layer code, so 30 * and empty_bad_page_table is returned back to higher layer code, so
@@ -36,17 +38,17 @@
36 */ 38 */
37 39
38/* PMD_SHIFT determines the size of the area a second-level page table can map */ 40/* PMD_SHIFT determines the size of the area a second-level page table can map */
39#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT - 3)) 41#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT + PTE_ORDER - 3))
40#define PMD_SIZE (1UL << PMD_SHIFT) 42#define PMD_SIZE (1UL << PMD_SHIFT)
41#define PMD_MASK (~(PMD_SIZE-1)) 43#define PMD_MASK (~(PMD_SIZE-1))
42 44
43/* PGDIR_SHIFT determines what a third-level page table entry can map */ 45/* PGDIR_SHIFT determines what a third-level page table entry can map */
44#define PGDIR_SHIFT (PMD_SHIFT + (PAGE_SHIFT + 1 - 3)) 46#define PGDIR_SHIFT (PMD_SHIFT + (PAGE_SHIFT + PMD_ORDER - 3))
45#define PGDIR_SIZE (1UL << PGDIR_SHIFT) 47#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
46#define PGDIR_MASK (~(PGDIR_SIZE-1)) 48#define PGDIR_MASK (~(PGDIR_SIZE-1))
47 49
48/* 50/*
49 * For 4kB page size we use a 3 level page tree and a 8kB pmd and pgds which 51 * For 4kB page size we use a 3 level page tree and an 8kB pud, which
50 * permits us mapping 40 bits of virtual address space. 52 * permits us mapping 40 bits of virtual address space.
51 * 53 *
52 * We used to implement 41 bits by having an order 1 pmd level but that seemed 54 * We used to implement 41 bits by having an order 1 pmd level but that seemed
@@ -57,7 +59,7 @@
57 * two levels would be easy to implement. 59 * two levels would be easy to implement.
58 * 60 *
59 * For 16kB page size we use a 2 level page tree which permits a total of 61 * For 16kB page size we use a 2 level page tree which permits a total of
60 * 36 bits of virtual address space. We could add a third leve. but it seems 62 * 36 bits of virtual address space. We could add a third level but it seems
61 * like at the moment there's no need for this. 63 * like at the moment there's no need for this.
62 * 64 *
63 * For 64kB page size we use a 2 level page table tree for a total of 42 bits 65 * For 64kB page size we use a 2 level page table tree for a total of 42 bits
@@ -65,21 +67,25 @@
65 */ 67 */
66#ifdef CONFIG_PAGE_SIZE_4KB 68#ifdef CONFIG_PAGE_SIZE_4KB
67#define PGD_ORDER 1 69#define PGD_ORDER 1
70#define PUD_ORDER aieeee_attempt_to_allocate_pud
68#define PMD_ORDER 0 71#define PMD_ORDER 0
69#define PTE_ORDER 0 72#define PTE_ORDER 0
70#endif 73#endif
71#ifdef CONFIG_PAGE_SIZE_8KB 74#ifdef CONFIG_PAGE_SIZE_8KB
72#define PGD_ORDER 0 75#define PGD_ORDER 0
76#define PUD_ORDER aieeee_attempt_to_allocate_pud
73#define PMD_ORDER 0 77#define PMD_ORDER 0
74#define PTE_ORDER 0 78#define PTE_ORDER 0
75#endif 79#endif
76#ifdef CONFIG_PAGE_SIZE_16KB 80#ifdef CONFIG_PAGE_SIZE_16KB
77#define PGD_ORDER 0 81#define PGD_ORDER 0
82#define PUD_ORDER aieeee_attempt_to_allocate_pud
78#define PMD_ORDER 0 83#define PMD_ORDER 0
79#define PTE_ORDER 0 84#define PTE_ORDER 0
80#endif 85#endif
81#ifdef CONFIG_PAGE_SIZE_64KB 86#ifdef CONFIG_PAGE_SIZE_64KB
82#define PGD_ORDER 0 87#define PGD_ORDER 0
88#define PUD_ORDER aieeee_attempt_to_allocate_pud
83#define PMD_ORDER 0 89#define PMD_ORDER 0
84#define PTE_ORDER 0 90#define PTE_ORDER 0
85#endif 91#endif
@@ -91,7 +97,7 @@
91#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 97#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
92#define FIRST_USER_ADDRESS 0 98#define FIRST_USER_ADDRESS 0
93 99
94#define VMALLOC_START XKSEG 100#define VMALLOC_START MAP_BASE
95#define VMALLOC_END \ 101#define VMALLOC_END \
96 (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) 102 (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE)
97 103
@@ -102,13 +108,13 @@
102#define pgd_ERROR(e) \ 108#define pgd_ERROR(e) \
103 printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e)) 109 printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e))
104 110
105extern pte_t invalid_pte_table[PAGE_SIZE/sizeof(pte_t)]; 111extern pte_t invalid_pte_table[PTRS_PER_PTE];
106extern pte_t empty_bad_page_table[PAGE_SIZE/sizeof(pte_t)]; 112extern pte_t empty_bad_page_table[PTRS_PER_PTE];
107extern pmd_t invalid_pmd_table[2*PAGE_SIZE/sizeof(pmd_t)]; 113extern pmd_t invalid_pmd_table[PTRS_PER_PMD];
108extern pmd_t empty_bad_pmd_table[2*PAGE_SIZE/sizeof(pmd_t)]; 114extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD];
109 115
110/* 116/*
111 * Empty pmd entries point to the invalid_pte_table. 117 * Empty pgd/pmd entries point to the invalid_pte_table.
112 */ 118 */
113static inline int pmd_none(pmd_t pmd) 119static inline int pmd_none(pmd_t pmd)
114{ 120{
@@ -128,26 +134,30 @@ static inline void pmd_clear(pmd_t *pmdp)
128} 134}
129 135
130/* 136/*
131 * Empty pgd entries point to the invalid_pmd_table. 137 * Empty pud entries point to the invalid_pmd_table.
132 */ 138 */
133static inline int pgd_none(pgd_t pgd) 139static inline int pud_none(pud_t pud)
134{ 140{
135 return pgd_val(pgd) == (unsigned long) invalid_pmd_table; 141 return pud_val(pud) == (unsigned long) invalid_pmd_table;
136} 142}
137 143
138#define pgd_bad(pgd) (pgd_val(pgd) &~ PAGE_MASK) 144static inline int pud_bad(pud_t pud)
145{
146 return pud_val(pud) & ~PAGE_MASK;
147}
139 148
140static inline int pgd_present(pgd_t pgd) 149static inline int pud_present(pud_t pud)
141{ 150{
142 return pgd_val(pgd) != (unsigned long) invalid_pmd_table; 151 return pud_val(pud) != (unsigned long) invalid_pmd_table;
143} 152}
144 153
145static inline void pgd_clear(pgd_t *pgdp) 154static inline void pud_clear(pud_t *pudp)
146{ 155{
147 pgd_val(*pgdp) = ((unsigned long) invalid_pmd_table); 156 pud_val(*pudp) = ((unsigned long) invalid_pmd_table);
148} 157}
149 158
150#define pte_page(x) pfn_to_page((unsigned long)((pte_val(x) >> PAGE_SHIFT))) 159#define pte_page(x) pfn_to_page(pte_pfn(x))
160
151#ifdef CONFIG_CPU_VR41XX 161#ifdef CONFIG_CPU_VR41XX
152#define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2))) 162#define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2)))
153#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) 163#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
@@ -157,26 +167,28 @@ static inline void pgd_clear(pgd_t *pgdp)
157#endif 167#endif
158 168
159#define __pgd_offset(address) pgd_index(address) 169#define __pgd_offset(address) pgd_index(address)
170#define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
171#define __pmd_offset(address) pmd_index(address)
160#define page_pte(page) page_pte_prot(page, __pgprot(0)) 172#define page_pte(page) page_pte_prot(page, __pgprot(0))
161 173
162/* to find an entry in a kernel page-table-directory */ 174/* to find an entry in a kernel page-table-directory */
163#define pgd_offset_k(address) pgd_offset(&init_mm, 0) 175#define pgd_offset_k(address) pgd_offset(&init_mm, 0)
164 176
165#define pgd_index(address) ((address) >> PGDIR_SHIFT) 177#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
178#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
166 179
167/* to find an entry in a page-table-directory */ 180/* to find an entry in a page-table-directory */
168#define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) 181#define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr))
169 182
170static inline unsigned long pgd_page(pgd_t pgd) 183static inline unsigned long pud_page(pud_t pud)
171{ 184{
172 return pgd_val(pgd); 185 return pud_val(pud);
173} 186}
174 187
175/* Find an entry in the second-level page table.. */ 188/* Find an entry in the second-level page table.. */
176static inline pmd_t *pmd_offset(pgd_t * dir, unsigned long address) 189static inline pmd_t *pmd_offset(pud_t * pud, unsigned long address)
177{ 190{
178 return (pmd_t *) pgd_page(*dir) + 191 return (pmd_t *) pud_page(*pud) + pmd_index(address);
179 ((address >> PMD_SHIFT) & (PTRS_PER_PMD - 1));
180} 192}
181 193
182/* Find an entry in the third-level page table.. */ 194/* Find an entry in the third-level page table.. */
diff --git a/include/asm-mips/pgtable-bits.h b/include/asm-mips/pgtable-bits.h
index 3aad751ccd5f..01e76e932e3f 100644
--- a/include/asm-mips/pgtable-bits.h
+++ b/include/asm-mips/pgtable-bits.h
@@ -33,7 +33,7 @@
33 * unpredictable things. The code (when it is written) to deal with 33 * unpredictable things. The code (when it is written) to deal with
34 * this problem will be in the update_mmu_cache() code for the r4k. 34 * this problem will be in the update_mmu_cache() code for the r4k.
35 */ 35 */
36#if defined(CONFIG_CPU_MIPS32) && defined(CONFIG_64BIT_PHYS_ADDR) 36#if defined(CONFIG_CPU_MIPS32_R1) && defined(CONFIG_64BIT_PHYS_ADDR)
37 37
38#define _PAGE_PRESENT (1<<6) /* implemented in software */ 38#define _PAGE_PRESENT (1<<6) /* implemented in software */
39#define _PAGE_READ (1<<7) /* implemented in software */ 39#define _PAGE_READ (1<<7) /* implemented in software */
@@ -123,7 +123,7 @@
123 123
124#endif 124#endif
125#endif 125#endif
126#endif /* defined(CONFIG_CPU_MIPS32) && defined(CONFIG_64BIT_PHYS_ADDR) */ 126#endif /* defined(CONFIG_CPU_MIPS32_R1) && defined(CONFIG_64BIT_PHYS_ADDR) */
127 127
128#define __READABLE (_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED) 128#define __READABLE (_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED)
129#define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED) 129#define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED)
@@ -140,7 +140,7 @@
140#define PAGE_CACHABLE_DEFAULT _CACHE_CACHABLE_COW 140#define PAGE_CACHABLE_DEFAULT _CACHE_CACHABLE_COW
141#endif 141#endif
142 142
143#if defined(CONFIG_CPU_MIPS32) && defined(CONFIG_64BIT_PHYS_ADDR) 143#if defined(CONFIG_CPU_MIPS32_R1) && defined(CONFIG_64BIT_PHYS_ADDR)
144#define CONF_CM_DEFAULT (PAGE_CACHABLE_DEFAULT >> 3) 144#define CONF_CM_DEFAULT (PAGE_CACHABLE_DEFAULT >> 3)
145#else 145#else
146#define CONF_CM_DEFAULT (PAGE_CACHABLE_DEFAULT >> 9) 146#define CONF_CM_DEFAULT (PAGE_CACHABLE_DEFAULT >> 9)
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index eaf5d9b3a0e1..1e8ae2723be4 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -8,8 +8,6 @@
8#ifndef _ASM_PGTABLE_H 8#ifndef _ASM_PGTABLE_H
9#define _ASM_PGTABLE_H 9#define _ASM_PGTABLE_H
10 10
11#include <asm-generic/4level-fixup.h>
12
13#include <linux/config.h> 11#include <linux/config.h>
14#ifdef CONFIG_32BIT 12#ifdef CONFIG_32BIT
15#include <asm/pgtable-32.h> 13#include <asm/pgtable-32.h>
@@ -18,6 +16,7 @@
18#include <asm/pgtable-64.h> 16#include <asm/pgtable-64.h>
19#endif 17#endif
20 18
19#include <asm/io.h>
21#include <asm/pgtable-bits.h> 20#include <asm/pgtable-bits.h>
22 21
23#define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) 22#define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT)
@@ -84,7 +83,7 @@ extern void paging_init(void);
84#define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL)) 83#define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL))
85#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) 84#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
86 85
87#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) 86#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
88static inline void set_pte(pte_t *ptep, pte_t pte) 87static inline void set_pte(pte_t *ptep, pte_t pte)
89{ 88{
90 ptep->pte_high = pte.pte_high; 89 ptep->pte_high = pte.pte_high;
@@ -148,11 +147,18 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt
148#endif 147#endif
149 148
150/* 149/*
151 * (pmds are folded into pgds so this doesn't get actually called, 150 * (pmds are folded into puds so this doesn't get actually called,
152 * but the define is needed for a generic inline function.) 151 * but the define is needed for a generic inline function.)
153 */ 152 */
154#define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0) 153#define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0)
155#define set_pgd(pgdptr, pgdval) do { *(pgdptr) = (pgdval); } while(0) 154
155#ifdef CONFIG_64BIT
156/*
157 * (puds are folded into pgds so this doesn't get actually called,
158 * but the define is needed for a generic inline function.)
159 */
160#define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0)
161#endif
156 162
157#define PGD_T_LOG2 ffz(~sizeof(pgd_t)) 163#define PGD_T_LOG2 ffz(~sizeof(pgd_t))
158#define PMD_T_LOG2 ffz(~sizeof(pmd_t)) 164#define PMD_T_LOG2 ffz(~sizeof(pmd_t))
@@ -165,7 +171,7 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
165 * Undefined behaviour if not.. 171 * Undefined behaviour if not..
166 */ 172 */
167static inline int pte_user(pte_t pte) { BUG(); return 0; } 173static inline int pte_user(pte_t pte) { BUG(); return 0; }
168#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) 174#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
169static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_READ; } 175static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_READ; }
170static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_WRITE; } 176static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_WRITE; }
171static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_MODIFIED; } 177static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_MODIFIED; }
@@ -324,7 +330,7 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot)
324 */ 330 */
325#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) 331#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
326 332
327#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) 333#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
328static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 334static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
329{ 335{
330 pte.pte_low &= _PAGE_CHG_MASK; 336 pte.pte_low &= _PAGE_CHG_MASK;
@@ -357,7 +363,6 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
357#endif 363#endif
358 364
359#ifdef CONFIG_64BIT_PHYS_ADDR 365#ifdef CONFIG_64BIT_PHYS_ADDR
360extern phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size);
361extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot); 366extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot);
362 367
363static inline int io_remap_pfn_range(struct vm_area_struct *vma, 368static inline int io_remap_pfn_range(struct vm_area_struct *vma,
@@ -367,7 +372,7 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma,
367 pgprot_t prot) 372 pgprot_t prot)
368{ 373{
369 phys_t phys_addr_high = fixup_bigphys_addr(pfn << PAGE_SHIFT, size); 374 phys_t phys_addr_high = fixup_bigphys_addr(pfn << PAGE_SHIFT, size);
370 return remap_pfn_range(vma, vaddr, pfn, size, prot); 375 return remap_pfn_range(vma, vaddr, phys_addr_high >> PAGE_SHIFT, size, prot);
371} 376}
372#else 377#else
373#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 378#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index d6466aa09fb7..f1980c6c3bcc 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -96,12 +96,26 @@ union mips_fpu_union {
96 {{0,},} \ 96 {{0,},} \
97} 97}
98 98
99#define NUM_DSP_REGS 6
100
101typedef __u32 dspreg_t;
102
103struct mips_dsp_state {
104 dspreg_t dspr[NUM_DSP_REGS];
105 unsigned int dspcontrol;
106 unsigned short used_dsp;
107};
108
109#define INIT_DSP {{0,},}
110
99typedef struct { 111typedef struct {
100 unsigned long seg; 112 unsigned long seg;
101} mm_segment_t; 113} mm_segment_t;
102 114
103#define ARCH_MIN_TASKALIGN 8 115#define ARCH_MIN_TASKALIGN 8
104 116
117struct mips_abi;
118
105/* 119/*
106 * If you change thread_struct remember to change the #defines below too! 120 * If you change thread_struct remember to change the #defines below too!
107 */ 121 */
@@ -117,6 +131,9 @@ struct thread_struct {
117 /* Saved fpu/fpu emulator stuff. */ 131 /* Saved fpu/fpu emulator stuff. */
118 union mips_fpu_union fpu; 132 union mips_fpu_union fpu;
119 133
134 /* Saved state of the DSP ASE, if available. */
135 struct mips_dsp_state dsp;
136
120 /* Other stuff associated with the thread. */ 137 /* Other stuff associated with the thread. */
121 unsigned long cp0_badvaddr; /* Last user fault */ 138 unsigned long cp0_badvaddr; /* Last user fault */
122 unsigned long cp0_baduaddr; /* Last kernel fault accessing USEG */ 139 unsigned long cp0_baduaddr; /* Last kernel fault accessing USEG */
@@ -129,6 +146,7 @@ struct thread_struct {
129 unsigned long mflags; 146 unsigned long mflags;
130 unsigned long irix_trampoline; /* Wheee... */ 147 unsigned long irix_trampoline; /* Wheee... */
131 unsigned long irix_oldctx; 148 unsigned long irix_oldctx;
149 struct mips_abi *abi;
132}; 150};
133 151
134#define MF_ABI_MASK (MF_32BIT_REGS | MF_32BIT_ADDR) 152#define MF_ABI_MASK (MF_32BIT_REGS | MF_32BIT_ADDR)
@@ -151,6 +169,10 @@ struct thread_struct {
151 */ \ 169 */ \
152 INIT_FPU, \ 170 INIT_FPU, \
153 /* \ 171 /* \
172 * saved dsp/dsp emulator stuff \
173 */ \
174 INIT_DSP, \
175 /* \
154 * Other stuff associated with the process \ 176 * Other stuff associated with the process \
155 */ \ 177 */ \
156 0, 0, 0, 0, \ 178 0, 0, 0, 0, \
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index 2b5c624c3d4f..95c5839ac465 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -22,6 +22,8 @@
22#define MMLO 68 22#define MMLO 68
23#define FPC_CSR 69 23#define FPC_CSR 69
24#define FPC_EIR 70 24#define FPC_EIR 70
25#define DSP_BASE 71 /* 3 more hi / lo register pairs */
26#define DSP_CONTROL 77
25 27
26/* 28/*
27 * This struct defines the way the registers are stored on the stack during a 29 * This struct defines the way the registers are stored on the stack during a
@@ -38,18 +40,18 @@ struct pt_regs {
38 40
39 /* Saved special registers. */ 41 /* Saved special registers. */
40 unsigned long cp0_status; 42 unsigned long cp0_status;
41 unsigned long lo;
42 unsigned long hi; 43 unsigned long hi;
44 unsigned long lo;
43 unsigned long cp0_badvaddr; 45 unsigned long cp0_badvaddr;
44 unsigned long cp0_cause; 46 unsigned long cp0_cause;
45 unsigned long cp0_epc; 47 unsigned long cp0_epc;
46}; 48};
47 49
48/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ 50/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
49/* #define PTRACE_GETREGS 12 */ 51#define PTRACE_GETREGS 12
50/* #define PTRACE_SETREGS 13 */ 52#define PTRACE_SETREGS 13
51/* #define PTRACE_GETFPREGS 14 */ 53#define PTRACE_GETFPREGS 14
52/* #define PTRACE_SETFPREGS 15 */ 54#define PTRACE_SETFPREGS 15
53/* #define PTRACE_GETFPXREGS 18 */ 55/* #define PTRACE_GETFPXREGS 18 */
54/* #define PTRACE_SETFPXREGS 19 */ 56/* #define PTRACE_SETFPXREGS 19 */
55 57
@@ -58,6 +60,13 @@ struct pt_regs {
58#define PTRACE_GET_THREAD_AREA 25 60#define PTRACE_GET_THREAD_AREA 25
59#define PTRACE_SET_THREAD_AREA 26 61#define PTRACE_SET_THREAD_AREA 26
60 62
63/* Calls to trace a 64bit program from a 32bit program. */
64#define PTRACE_PEEKTEXT_3264 0xc0
65#define PTRACE_PEEKDATA_3264 0xc1
66#define PTRACE_POKETEXT_3264 0xc2
67#define PTRACE_POKEDATA_3264 0xc3
68#define PTRACE_GET_THREAD_AREA_3264 0xc4
69
61#ifdef __KERNEL__ 70#ifdef __KERNEL__
62 71
63#include <linux/linkage.h> 72#include <linux/linkage.h>
diff --git a/include/asm-mips/r4kcache.h b/include/asm-mips/r4kcache.h
index 5bea49feec66..a5ea9d828aee 100644
--- a/include/asm-mips/r4kcache.h
+++ b/include/asm-mips/r4kcache.h
@@ -21,7 +21,7 @@
21 * 21 *
22 * - The MIPS32 and MIPS64 specs permit an implementation to directly derive 22 * - The MIPS32 and MIPS64 specs permit an implementation to directly derive
23 * the index bits from the virtual address. This breaks with tradition 23 * the index bits from the virtual address. This breaks with tradition
24 * set by the R4000. To keep unpleassant surprises from happening we pick 24 * set by the R4000. To keep unpleasant surprises from happening we pick
25 * an address in KSEG0 / CKSEG0. 25 * an address in KSEG0 / CKSEG0.
26 * - We need a properly sign extended address for 64-bit code. To get away 26 * - We need a properly sign extended address for 64-bit code. To get away
27 * without ifdefs we let the compiler do it by a type cast. 27 * without ifdefs we let the compiler do it by a type cast.
@@ -30,11 +30,11 @@
30 30
31#define cache_op(op,addr) \ 31#define cache_op(op,addr) \
32 __asm__ __volatile__( \ 32 __asm__ __volatile__( \
33 " .set push \n" \
33 " .set noreorder \n" \ 34 " .set noreorder \n" \
34 " .set mips3\n\t \n" \ 35 " .set mips3\n\t \n" \
35 " cache %0, %1 \n" \ 36 " cache %0, %1 \n" \
36 " .set mips0 \n" \ 37 " .set pop \n" \
37 " .set reorder" \
38 : \ 38 : \
39 : "i" (op), "m" (*(unsigned char *)(addr))) 39 : "i" (op), "m" (*(unsigned char *)(addr)))
40 40
@@ -84,14 +84,14 @@ static inline void flush_scache_line(unsigned long addr)
84static inline void protected_flush_icache_line(unsigned long addr) 84static inline void protected_flush_icache_line(unsigned long addr)
85{ 85{
86 __asm__ __volatile__( 86 __asm__ __volatile__(
87 ".set noreorder\n\t" 87 " .set push \n"
88 ".set mips3\n" 88 " .set noreorder \n"
89 "1:\tcache %0,(%1)\n" 89 " .set mips3 \n"
90 "2:\t.set mips0\n\t" 90 "1: cache %0, (%1) \n"
91 ".set reorder\n\t" 91 "2: .set pop \n"
92 ".section\t__ex_table,\"a\"\n\t" 92 " .section __ex_table,\"a\" \n"
93 STR(PTR)"\t1b,2b\n\t" 93 " "STR(PTR)" 1b, 2b \n"
94 ".previous" 94 " .previous"
95 : 95 :
96 : "i" (Hit_Invalidate_I), "r" (addr)); 96 : "i" (Hit_Invalidate_I), "r" (addr));
97} 97}
@@ -100,19 +100,19 @@ static inline void protected_flush_icache_line(unsigned long addr)
100 * R10000 / R12000 hazard - these processors don't support the Hit_Writeback_D 100 * R10000 / R12000 hazard - these processors don't support the Hit_Writeback_D
101 * cacheop so we use Hit_Writeback_Inv_D which is supported by all R4000-style 101 * cacheop so we use Hit_Writeback_Inv_D which is supported by all R4000-style
102 * caches. We're talking about one cacheline unnecessarily getting invalidated 102 * caches. We're talking about one cacheline unnecessarily getting invalidated
103 * here so the penaltiy isn't overly hard. 103 * here so the penalty isn't overly hard.
104 */ 104 */
105static inline void protected_writeback_dcache_line(unsigned long addr) 105static inline void protected_writeback_dcache_line(unsigned long addr)
106{ 106{
107 __asm__ __volatile__( 107 __asm__ __volatile__(
108 ".set noreorder\n\t" 108 " .set push \n"
109 ".set mips3\n" 109 " .set noreorder \n"
110 "1:\tcache %0,(%1)\n" 110 " .set mips3 \n"
111 "2:\t.set mips0\n\t" 111 "1: cache %0, (%1) \n"
112 ".set reorder\n\t" 112 "2: .set pop \n"
113 ".section\t__ex_table,\"a\"\n\t" 113 " .section __ex_table,\"a\" \n"
114 STR(PTR)"\t1b,2b\n\t" 114 " "STR(PTR)" 1b, 2b \n"
115 ".previous" 115 " .previous"
116 : 116 :
117 : "i" (Hit_Writeback_Inv_D), "r" (addr)); 117 : "i" (Hit_Writeback_Inv_D), "r" (addr));
118} 118}
@@ -120,14 +120,14 @@ static inline void protected_writeback_dcache_line(unsigned long addr)
120static inline void protected_writeback_scache_line(unsigned long addr) 120static inline void protected_writeback_scache_line(unsigned long addr)
121{ 121{
122 __asm__ __volatile__( 122 __asm__ __volatile__(
123 ".set noreorder\n\t" 123 " .set push \n"
124 ".set mips3\n" 124 " .set noreorder \n"
125 "1:\tcache %0,(%1)\n" 125 " .set mips3 \n"
126 "2:\t.set mips0\n\t" 126 "1: cache %0, (%1) \n"
127 ".set reorder\n\t" 127 "2: .set pop \n"
128 ".section\t__ex_table,\"a\"\n\t" 128 " .section __ex_table,\"a\" \n"
129 STR(PTR)"\t1b,2b\n\t" 129 " "STR(PTR)" 1b, 2b \n"
130 ".previous" 130 " .previous"
131 : 131 :
132 : "i" (Hit_Writeback_Inv_SD), "r" (addr)); 132 : "i" (Hit_Writeback_Inv_SD), "r" (addr));
133} 133}
@@ -142,6 +142,7 @@ static inline void invalidate_tcache_page(unsigned long addr)
142 142
143#define cache16_unroll32(base,op) \ 143#define cache16_unroll32(base,op) \
144 __asm__ __volatile__( \ 144 __asm__ __volatile__( \
145 " .set push \n" \
145 " .set noreorder \n" \ 146 " .set noreorder \n" \
146 " .set mips3 \n" \ 147 " .set mips3 \n" \
147 " cache %1, 0x000(%0); cache %1, 0x010(%0) \n" \ 148 " cache %1, 0x000(%0); cache %1, 0x010(%0) \n" \
@@ -160,8 +161,7 @@ static inline void invalidate_tcache_page(unsigned long addr)
160 " cache %1, 0x1a0(%0); cache %1, 0x1b0(%0) \n" \ 161 " cache %1, 0x1a0(%0); cache %1, 0x1b0(%0) \n" \
161 " cache %1, 0x1c0(%0); cache %1, 0x1d0(%0) \n" \ 162 " cache %1, 0x1c0(%0); cache %1, 0x1d0(%0) \n" \
162 " cache %1, 0x1e0(%0); cache %1, 0x1f0(%0) \n" \ 163 " cache %1, 0x1e0(%0); cache %1, 0x1f0(%0) \n" \
163 " .set mips0 \n" \ 164 " .set pop \n" \
164 " .set reorder \n" \
165 : \ 165 : \
166 : "r" (base), \ 166 : "r" (base), \
167 "i" (op)); 167 "i" (op));
@@ -285,6 +285,7 @@ static inline void blast_scache16_page_indexed(unsigned long page)
285 285
286#define cache32_unroll32(base,op) \ 286#define cache32_unroll32(base,op) \
287 __asm__ __volatile__( \ 287 __asm__ __volatile__( \
288 " .set push \n" \
288 " .set noreorder \n" \ 289 " .set noreorder \n" \
289 " .set mips3 \n" \ 290 " .set mips3 \n" \
290 " cache %1, 0x000(%0); cache %1, 0x020(%0) \n" \ 291 " cache %1, 0x000(%0); cache %1, 0x020(%0) \n" \
@@ -303,8 +304,7 @@ static inline void blast_scache16_page_indexed(unsigned long page)
303 " cache %1, 0x340(%0); cache %1, 0x360(%0) \n" \ 304 " cache %1, 0x340(%0); cache %1, 0x360(%0) \n" \
304 " cache %1, 0x380(%0); cache %1, 0x3a0(%0) \n" \ 305 " cache %1, 0x380(%0); cache %1, 0x3a0(%0) \n" \
305 " cache %1, 0x3c0(%0); cache %1, 0x3e0(%0) \n" \ 306 " cache %1, 0x3c0(%0); cache %1, 0x3e0(%0) \n" \
306 " .set mips0 \n" \ 307 " .set pop \n" \
307 " .set reorder \n" \
308 : \ 308 : \
309 : "r" (base), \ 309 : "r" (base), \
310 "i" (op)); 310 "i" (op));
@@ -428,6 +428,7 @@ static inline void blast_scache32_page_indexed(unsigned long page)
428 428
429#define cache64_unroll32(base,op) \ 429#define cache64_unroll32(base,op) \
430 __asm__ __volatile__( \ 430 __asm__ __volatile__( \
431 " .set push \n" \
431 " .set noreorder \n" \ 432 " .set noreorder \n" \
432 " .set mips3 \n" \ 433 " .set mips3 \n" \
433 " cache %1, 0x000(%0); cache %1, 0x040(%0) \n" \ 434 " cache %1, 0x000(%0); cache %1, 0x040(%0) \n" \
@@ -446,8 +447,7 @@ static inline void blast_scache32_page_indexed(unsigned long page)
446 " cache %1, 0x680(%0); cache %1, 0x6c0(%0) \n" \ 447 " cache %1, 0x680(%0); cache %1, 0x6c0(%0) \n" \
447 " cache %1, 0x700(%0); cache %1, 0x740(%0) \n" \ 448 " cache %1, 0x700(%0); cache %1, 0x740(%0) \n" \
448 " cache %1, 0x780(%0); cache %1, 0x7c0(%0) \n" \ 449 " cache %1, 0x780(%0); cache %1, 0x7c0(%0) \n" \
449 " .set mips0 \n" \ 450 " .set pop \n" \
450 " .set reorder \n" \
451 : \ 451 : \
452 : "r" (base), \ 452 : "r" (base), \
453 "i" (op)); 453 "i" (op));
@@ -532,6 +532,7 @@ static inline void blast_scache64_page_indexed(unsigned long page)
532 532
533#define cache128_unroll32(base,op) \ 533#define cache128_unroll32(base,op) \
534 __asm__ __volatile__( \ 534 __asm__ __volatile__( \
535 " .set push \n" \
535 " .set noreorder \n" \ 536 " .set noreorder \n" \
536 " .set mips3 \n" \ 537 " .set mips3 \n" \
537 " cache %1, 0x000(%0); cache %1, 0x080(%0) \n" \ 538 " cache %1, 0x000(%0); cache %1, 0x080(%0) \n" \
@@ -550,8 +551,7 @@ static inline void blast_scache64_page_indexed(unsigned long page)
550 " cache %1, 0xd00(%0); cache %1, 0xd80(%0) \n" \ 551 " cache %1, 0xd00(%0); cache %1, 0xd80(%0) \n" \
551 " cache %1, 0xe00(%0); cache %1, 0xe80(%0) \n" \ 552 " cache %1, 0xe00(%0); cache %1, 0xe80(%0) \n" \
552 " cache %1, 0xf00(%0); cache %1, 0xf80(%0) \n" \ 553 " cache %1, 0xf00(%0); cache %1, 0xf80(%0) \n" \
553 " .set mips0 \n" \ 554 " .set pop \n" \
554 " .set reorder \n" \
555 : \ 555 : \
556 : "r" (base), \ 556 : "r" (base), \
557 "i" (op)); 557 "i" (op));
diff --git a/include/asm-mips/rtc.h b/include/asm-mips/rtc.h
index 3c4b637fd925..a60e0dc7c9b9 100644
--- a/include/asm-mips/rtc.h
+++ b/include/asm-mips/rtc.h
@@ -14,7 +14,9 @@
14 14
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16 16
17#include <linux/spinlock.h>
17#include <linux/rtc.h> 18#include <linux/rtc.h>
19#include <asm/time.h>
18 20
19#define RTC_PIE 0x40 /* periodic interrupt enable */ 21#define RTC_PIE 0x40 /* periodic interrupt enable */
20#define RTC_AIE 0x20 /* alarm interrupt enable */ 22#define RTC_AIE 0x20 /* alarm interrupt enable */
@@ -27,11 +29,52 @@
27#define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ 29#define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */
28#define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ 30#define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */
29 31
30unsigned int get_rtc_time(struct rtc_time *time); 32static DEFINE_SPINLOCK(mips_rtc_lock);
31int set_rtc_time(struct rtc_time *time);
32unsigned int get_rtc_ss(void);
33int get_rtc_pll(struct rtc_pll_info *pll);
34int set_rtc_pll(struct rtc_pll_info *pll);
35 33
34static inline unsigned int get_rtc_time(struct rtc_time *time)
35{
36 unsigned long nowtime;
37
38 spin_lock(&mips_rtc_lock);
39 nowtime = rtc_get_time();
40 to_tm(nowtime, time);
41 time->tm_year -= 1900;
42 spin_unlock(&mips_rtc_lock);
43
44 return RTC_24H;
45}
46
47static inline int set_rtc_time(struct rtc_time *time)
48{
49 unsigned long nowtime;
50 int ret;
51
52 spin_lock(&mips_rtc_lock);
53 nowtime = mktime(time->tm_year+1900, time->tm_mon+1,
54 time->tm_mday, time->tm_hour, time->tm_min,
55 time->tm_sec);
56 ret = rtc_set_time(nowtime);
57 spin_unlock(&mips_rtc_lock);
58
59 return ret;
60}
61
62static inline unsigned int get_rtc_ss(void)
63{
64 struct rtc_time h;
65
66 get_rtc_time(&h);
67 return h.tm_sec;
68}
69
70static inline int get_rtc_pll(struct rtc_pll_info *pll)
71{
72 return -EINVAL;
73}
74
75static inline int set_rtc_pll(struct rtc_pll_info *pll)
76{
77 return -EINVAL;
78}
36#endif 79#endif
37#endif 80#endif
diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h
new file mode 100644
index 000000000000..83cdf6ab0d1f
--- /dev/null
+++ b/include/asm-mips/rtlx.h
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 */
5
6#ifndef _RTLX_H
7#define _RTLX_H_
8
9#define LX_NODE_BASE 10
10
11#define MIPSCPU_INT_BASE 16
12#define MIPS_CPU_RTLX_IRQ 0
13
14#define RTLX_VERSION 1
15#define RTLX_xID 0x12345600
16#define RTLX_ID (RTLX_xID | RTLX_VERSION)
17#define RTLX_CHANNELS 8
18
19enum rtlx_state {
20 RTLX_STATE_UNUSED = 0,
21 RTLX_STATE_INITIALISED,
22 RTLX_STATE_REMOTE_READY,
23 RTLX_STATE_OPENED
24};
25
26#define RTLX_BUFFER_SIZE 1024
27/* each channel supports read and write.
28 linux (vpe0) reads lx_buffer and writes rt_buffer
29 SP (vpe1) reads rt_buffer and writes lx_buffer
30*/
31typedef struct rtlx_channel {
32 enum rtlx_state rt_state;
33 enum rtlx_state lx_state;
34
35 int buffer_size;
36
37 /* read and write indexes per buffer */
38 int rt_write, rt_read;
39 char *rt_buffer;
40
41 int lx_write, lx_read;
42 char *lx_buffer;
43
44 void *queues;
45
46} rtlx_channel_t;
47
48typedef struct rtlx_info {
49 unsigned long id;
50 enum rtlx_state state;
51
52 struct rtlx_channel channel[RTLX_CHANNELS];
53
54} rtlx_info_t;
55
56#endif
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
index 4eed8e2acdc3..e796d75f027e 100644
--- a/include/asm-mips/serial.h
+++ b/include/asm-mips/serial.h
@@ -52,16 +52,6 @@
52#define JAZZ_SERIAL_PORT_DEFNS 52#define JAZZ_SERIAL_PORT_DEFNS
53#endif 53#endif
54 54
55#ifdef CONFIG_MIPS_COBALT
56#include <asm/cobalt/cobalt.h>
57#define COBALT_BASE_BAUD (18432000 / 16)
58#define COBALT_SERIAL_PORT_DEFNS \
59 /* UART CLK PORT IRQ FLAGS */ \
60 { 0, COBALT_BASE_BAUD, 0xc800000, COBALT_SERIAL_IRQ, STD_COM_FLAGS }, /* ttyS0 */
61#else
62#define COBALT_SERIAL_PORT_DEFNS
63#endif
64
65/* 55/*
66 * Both Galileo boards have the same UART mappings. 56 * Both Galileo boards have the same UART mappings.
67 */ 57 */
@@ -113,17 +103,6 @@
113#define IVR_SERIAL_PORT_DEFNS 103#define IVR_SERIAL_PORT_DEFNS
114#endif 104#endif
115 105
116#ifdef CONFIG_TOSHIBA_JMR3927
117#include <asm/jmr3927/jmr3927.h>
118#define TXX927_SERIAL_PORT_DEFNS \
119 { .baud_base = JMR3927_BASE_BAUD, .port = UART0_ADDR, .irq = UART0_INT, \
120 .flags = UART0_FLAGS, .type = 1 }, \
121 { .baud_base = JMR3927_BASE_BAUD, .port = UART1_ADDR, .irq = UART1_INT, \
122 .flags = UART1_FLAGS, .type = 1 },
123#else
124#define TXX927_SERIAL_PORT_DEFNS
125#endif
126
127#ifdef CONFIG_SERIAL_AU1X00 106#ifdef CONFIG_SERIAL_AU1X00
128#include <asm/mach-au1x00/au1000.h> 107#include <asm/mach-au1x00/au1000.h>
129#ifdef CONFIG_SOC_AU1000 108#ifdef CONFIG_SOC_AU1000
@@ -227,9 +206,9 @@
227#define JAGUAR_ATX_SERIAL1_BASE 0xfd000023L 206#define JAGUAR_ATX_SERIAL1_BASE 0xfd000023L
228 207
229#define _JAGUAR_ATX_SERIAL_INIT(int, base) \ 208#define _JAGUAR_ATX_SERIAL_INIT(int, base) \
230 { baud_base: JAGUAR_ATX_BASE_BAUD, irq: int, \ 209 { .baud_base = JAGUAR_ATX_BASE_BAUD, irq: int, \
231 flags: (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ 210 .flags = (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
232 iomem_base: (u8 *) base, iomem_reg_shift: 2, \ 211 .iomem_base = (u8 *) base, iomem_reg_shift: 2, \
233 io_type: SERIAL_IO_MEM } 212 io_type: SERIAL_IO_MEM }
234#define MOMENCO_JAGUAR_ATX_SERIAL_PORT_DEFNS \ 213#define MOMENCO_JAGUAR_ATX_SERIAL_PORT_DEFNS \
235 _JAGUAR_ATX_SERIAL_INIT(JAGUAR_ATX_SERIAL1_IRQ, JAGUAR_ATX_SERIAL1_BASE) 214 _JAGUAR_ATX_SERIAL_INIT(JAGUAR_ATX_SERIAL1_IRQ, JAGUAR_ATX_SERIAL1_BASE)
@@ -243,9 +222,9 @@
243#define OCELOT_3_SERIAL_BASE (signed)0xfd000020 222#define OCELOT_3_SERIAL_BASE (signed)0xfd000020
244 223
245#define _OCELOT_3_SERIAL_INIT(int, base) \ 224#define _OCELOT_3_SERIAL_INIT(int, base) \
246 { baud_base: OCELOT_3_BASE_BAUD, irq: int, \ 225 { .baud_base = OCELOT_3_BASE_BAUD, irq: int, \
247 flags: STD_COM_FLAGS, \ 226 .flags = STD_COM_FLAGS, \
248 iomem_base: (u8 *) base, iomem_reg_shift: 2, \ 227 .iomem_base = (u8 *) base, iomem_reg_shift: 2, \
249 io_type: SERIAL_IO_MEM } 228 io_type: SERIAL_IO_MEM }
250 229
251#define MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS \ 230#define MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS \
@@ -342,7 +321,6 @@
342#endif /* CONFIG_SGI_IP32 */ 321#endif /* CONFIG_SGI_IP32 */
343 322
344#define SERIAL_PORT_DFNS \ 323#define SERIAL_PORT_DFNS \
345 COBALT_SERIAL_PORT_DEFNS \
346 DDB5477_SERIAL_PORT_DEFNS \ 324 DDB5477_SERIAL_PORT_DEFNS \
347 EV96100_SERIAL_PORT_DEFNS \ 325 EV96100_SERIAL_PORT_DEFNS \
348 IP32_SERIAL_PORT_DEFNS \ 326 IP32_SERIAL_PORT_DEFNS \
@@ -354,7 +332,6 @@
354 MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS \ 332 MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS \
355 MOMENCO_OCELOT_SERIAL_PORT_DEFNS \ 333 MOMENCO_OCELOT_SERIAL_PORT_DEFNS \
356 MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS \ 334 MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS \
357 TXX927_SERIAL_PORT_DEFNS \
358 AU1000_SERIAL_PORT_DEFNS 335 AU1000_SERIAL_PORT_DEFNS
359 336
360#endif /* _ASM_SERIAL_H */ 337#endif /* _ASM_SERIAL_H */
diff --git a/include/asm-mips/sgi/hpc3.h b/include/asm-mips/sgi/hpc3.h
index ac3dfc7af5b0..fcec52bafb25 100644
--- a/include/asm-mips/sgi/hpc3.h
+++ b/include/asm-mips/sgi/hpc3.h
@@ -128,26 +128,26 @@ struct hpc3_ethregs {
128 volatile u32 rx_gfptr; /* current GIO fifo ptr */ 128 volatile u32 rx_gfptr; /* current GIO fifo ptr */
129 volatile u32 rx_dfptr; /* current device fifo ptr */ 129 volatile u32 rx_dfptr; /* current device fifo ptr */
130 u32 _unused1; /* padding */ 130 u32 _unused1; /* padding */
131 volatile u32 rx_reset; /* reset register */ 131 volatile u32 reset; /* reset register */
132#define HPC3_ERXRST_CRESET 0x1 /* Reset dma channel and external controller */ 132#define HPC3_ERST_CRESET 0x1 /* Reset dma channel and external controller */
133#define HPC3_ERXRST_CLRIRQ 0x2 /* Clear channel interrupt */ 133#define HPC3_ERST_CLRIRQ 0x2 /* Clear channel interrupt */
134#define HPC3_ERXRST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */ 134#define HPC3_ERST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */
135 135
136 volatile u32 rx_dconfig; /* DMA configuration register */ 136 volatile u32 dconfig; /* DMA configuration register */
137#define HPC3_ERXDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */ 137#define HPC3_EDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */
138#define HPC3_ERXDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */ 138#define HPC3_EDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */
139#define HPC3_ERXDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */ 139#define HPC3_EDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */
140#define HPC3_ERXDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */ 140#define HPC3_EDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */
141#define HPC3_ERXDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */ 141#define HPC3_EDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */
142#define HPC3_ERXDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */ 142#define HPC3_EDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */
143#define HPC3_ERXDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */ 143#define HPC3_EDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */
144#define HPC3_ERXDCFG_PTO 0x30000 /* Programmed timeout value for above two */ 144#define HPC3_EDCFG_PTO 0x30000 /* Programmed timeout value for above two */
145 145
146 volatile u32 rx_pconfig; /* PIO configuration register */ 146 volatile u32 pconfig; /* PIO configuration register */
147#define HPC3_ERXPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */ 147#define HPC3_EPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */
148#define HPC3_ERXPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */ 148#define HPC3_EPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */
149#define HPC3_ERXPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */ 149#define HPC3_EPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */
150#define HPC3_ERXPCFG_TST 0x1000 /* Diagnistic ram test feature bit */ 150#define HPC3_EPCFG_TST 0x1000 /* Diagnistic ram test feature bit */
151 151
152 u32 _unused2[0x1000/4 - 8]; /* padding */ 152 u32 _unused2[0x1000/4 - 8]; /* padding */
153 153
diff --git a/include/asm-mips/sibyte/bcm1480_int.h b/include/asm-mips/sibyte/bcm1480_int.h
new file mode 100644
index 000000000000..42d4cf00efd3
--- /dev/null
+++ b/include/asm-mips/sibyte/bcm1480_int.h
@@ -0,0 +1,310 @@
1/* *********************************************************************
2 * BCM1280/BCM1480 Board Support Package
3 *
4 * Interrupt Mapper definitions File: bcm1480_int.h
5 *
6 * This module contains constants for manipulating the
7 * BCM1255/BCM1280/BCM1455/BCM1480's interrupt mapper and
8 * definitions for the interrupt sources.
9 *
10 * BCM1480 specification level: 1X55_1X80-UM100-D4 (11/24/03)
11 *
12 *********************************************************************
13 *
14 * Copyright 2000,2001,2002,2003
15 * Broadcom Corporation. All rights reserved.
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License as
19 * published by the Free Software Foundation; either version 2 of
20 * the License, or (at your option) any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 * MA 02111-1307 USA
31 ********************************************************************* */
32
33
34#ifndef _BCM1480_INT_H
35#define _BCM1480_INT_H
36
37#include "sb1250_defs.h"
38
39/* *********************************************************************
40 * Interrupt Mapper Constants
41 ********************************************************************* */
42
43/*
44 * The interrupt mapper deals with 128-bit logical registers that are
45 * implemented as pairs of 64-bit registers, with the "low" 64 bits in
46 * a register that has an address 0x1000 higher(!) than the
47 * corresponding "high" register.
48 *
49 * For appropriate registers, bit 0 of the "high" register is a
50 * cascade bit that summarizes (as a bit-OR) the 64 bits of the "low"
51 * register.
52 */
53
54/*
55 * This entire file uses _BCM1480_ in all the symbols because it is
56 * entirely BCM1480 specific.
57 */
58
59/*
60 * Interrupt sources (Table 22)
61 */
62
63#define K_BCM1480_INT_SOURCES 128
64
65#define _BCM1480_INT_HIGH(k) (k)
66#define _BCM1480_INT_LOW(k) ((k)+64)
67
68#define K_BCM1480_INT_ADDR_TRAP _BCM1480_INT_HIGH(1)
69#define K_BCM1480_INT_GPIO_0 _BCM1480_INT_HIGH(4)
70#define K_BCM1480_INT_GPIO_1 _BCM1480_INT_HIGH(5)
71#define K_BCM1480_INT_GPIO_2 _BCM1480_INT_HIGH(6)
72#define K_BCM1480_INT_GPIO_3 _BCM1480_INT_HIGH(7)
73#define K_BCM1480_INT_PCI_INTA _BCM1480_INT_HIGH(8)
74#define K_BCM1480_INT_PCI_INTB _BCM1480_INT_HIGH(9)
75#define K_BCM1480_INT_PCI_INTC _BCM1480_INT_HIGH(10)
76#define K_BCM1480_INT_PCI_INTD _BCM1480_INT_HIGH(11)
77#define K_BCM1480_INT_CYCLE_CP0 _BCM1480_INT_HIGH(12)
78#define K_BCM1480_INT_CYCLE_CP1 _BCM1480_INT_HIGH(13)
79#define K_BCM1480_INT_CYCLE_CP2 _BCM1480_INT_HIGH(14)
80#define K_BCM1480_INT_CYCLE_CP3 _BCM1480_INT_HIGH(15)
81#define K_BCM1480_INT_TIMER_0 _BCM1480_INT_HIGH(20)
82#define K_BCM1480_INT_TIMER_1 _BCM1480_INT_HIGH(21)
83#define K_BCM1480_INT_TIMER_2 _BCM1480_INT_HIGH(22)
84#define K_BCM1480_INT_TIMER_3 _BCM1480_INT_HIGH(23)
85#define K_BCM1480_INT_DM_CH_0 _BCM1480_INT_HIGH(28)
86#define K_BCM1480_INT_DM_CH_1 _BCM1480_INT_HIGH(29)
87#define K_BCM1480_INT_DM_CH_2 _BCM1480_INT_HIGH(30)
88#define K_BCM1480_INT_DM_CH_3 _BCM1480_INT_HIGH(31)
89#define K_BCM1480_INT_MAC_0 _BCM1480_INT_HIGH(36)
90#define K_BCM1480_INT_MAC_0_CH1 _BCM1480_INT_HIGH(37)
91#define K_BCM1480_INT_MAC_1 _BCM1480_INT_HIGH(38)
92#define K_BCM1480_INT_MAC_1_CH1 _BCM1480_INT_HIGH(39)
93#define K_BCM1480_INT_MAC_2 _BCM1480_INT_HIGH(40)
94#define K_BCM1480_INT_MAC_2_CH1 _BCM1480_INT_HIGH(41)
95#define K_BCM1480_INT_MAC_3 _BCM1480_INT_HIGH(42)
96#define K_BCM1480_INT_MAC_3_CH1 _BCM1480_INT_HIGH(43)
97#define K_BCM1480_INT_PMI_LOW _BCM1480_INT_HIGH(52)
98#define K_BCM1480_INT_PMI_HIGH _BCM1480_INT_HIGH(53)
99#define K_BCM1480_INT_PMO_LOW _BCM1480_INT_HIGH(54)
100#define K_BCM1480_INT_PMO_HIGH _BCM1480_INT_HIGH(55)
101#define K_BCM1480_INT_MBOX_0_0 _BCM1480_INT_HIGH(56)
102#define K_BCM1480_INT_MBOX_0_1 _BCM1480_INT_HIGH(57)
103#define K_BCM1480_INT_MBOX_0_2 _BCM1480_INT_HIGH(58)
104#define K_BCM1480_INT_MBOX_0_3 _BCM1480_INT_HIGH(59)
105#define K_BCM1480_INT_MBOX_1_0 _BCM1480_INT_HIGH(60)
106#define K_BCM1480_INT_MBOX_1_1 _BCM1480_INT_HIGH(61)
107#define K_BCM1480_INT_MBOX_1_2 _BCM1480_INT_HIGH(62)
108#define K_BCM1480_INT_MBOX_1_3 _BCM1480_INT_HIGH(63)
109
110#define K_BCM1480_INT_BAD_ECC _BCM1480_INT_LOW(1)
111#define K_BCM1480_INT_COR_ECC _BCM1480_INT_LOW(2)
112#define K_BCM1480_INT_IO_BUS _BCM1480_INT_LOW(3)
113#define K_BCM1480_INT_PERF_CNT _BCM1480_INT_LOW(4)
114#define K_BCM1480_INT_SW_PERF_CNT _BCM1480_INT_LOW(5)
115#define K_BCM1480_INT_TRACE_FREEZE _BCM1480_INT_LOW(6)
116#define K_BCM1480_INT_SW_TRACE_FREEZE _BCM1480_INT_LOW(7)
117#define K_BCM1480_INT_WATCHDOG_TIMER_0 _BCM1480_INT_LOW(8)
118#define K_BCM1480_INT_WATCHDOG_TIMER_1 _BCM1480_INT_LOW(9)
119#define K_BCM1480_INT_WATCHDOG_TIMER_2 _BCM1480_INT_LOW(10)
120#define K_BCM1480_INT_WATCHDOG_TIMER_3 _BCM1480_INT_LOW(11)
121#define K_BCM1480_INT_PCI_ERROR _BCM1480_INT_LOW(16)
122#define K_BCM1480_INT_PCI_RESET _BCM1480_INT_LOW(17)
123#define K_BCM1480_INT_NODE_CONTROLLER _BCM1480_INT_LOW(18)
124#define K_BCM1480_INT_HOST_BRIDGE _BCM1480_INT_LOW(19)
125#define K_BCM1480_INT_PORT_0_FATAL _BCM1480_INT_LOW(20)
126#define K_BCM1480_INT_PORT_0_NONFATAL _BCM1480_INT_LOW(21)
127#define K_BCM1480_INT_PORT_1_FATAL _BCM1480_INT_LOW(22)
128#define K_BCM1480_INT_PORT_1_NONFATAL _BCM1480_INT_LOW(23)
129#define K_BCM1480_INT_PORT_2_FATAL _BCM1480_INT_LOW(24)
130#define K_BCM1480_INT_PORT_2_NONFATAL _BCM1480_INT_LOW(25)
131#define K_BCM1480_INT_LDT_SMI _BCM1480_INT_LOW(32)
132#define K_BCM1480_INT_LDT_NMI _BCM1480_INT_LOW(33)
133#define K_BCM1480_INT_LDT_INIT _BCM1480_INT_LOW(34)
134#define K_BCM1480_INT_LDT_STARTUP _BCM1480_INT_LOW(35)
135#define K_BCM1480_INT_LDT_EXT _BCM1480_INT_LOW(36)
136#define K_BCM1480_INT_SMB_0 _BCM1480_INT_LOW(40)
137#define K_BCM1480_INT_SMB_1 _BCM1480_INT_LOW(41)
138#define K_BCM1480_INT_PCMCIA _BCM1480_INT_LOW(42)
139#define K_BCM1480_INT_UART_0 _BCM1480_INT_LOW(44)
140#define K_BCM1480_INT_UART_1 _BCM1480_INT_LOW(45)
141#define K_BCM1480_INT_UART_2 _BCM1480_INT_LOW(46)
142#define K_BCM1480_INT_UART_3 _BCM1480_INT_LOW(47)
143#define K_BCM1480_INT_GPIO_4 _BCM1480_INT_LOW(52)
144#define K_BCM1480_INT_GPIO_5 _BCM1480_INT_LOW(53)
145#define K_BCM1480_INT_GPIO_6 _BCM1480_INT_LOW(54)
146#define K_BCM1480_INT_GPIO_7 _BCM1480_INT_LOW(55)
147#define K_BCM1480_INT_GPIO_8 _BCM1480_INT_LOW(56)
148#define K_BCM1480_INT_GPIO_9 _BCM1480_INT_LOW(57)
149#define K_BCM1480_INT_GPIO_10 _BCM1480_INT_LOW(58)
150#define K_BCM1480_INT_GPIO_11 _BCM1480_INT_LOW(59)
151#define K_BCM1480_INT_GPIO_12 _BCM1480_INT_LOW(60)
152#define K_BCM1480_INT_GPIO_13 _BCM1480_INT_LOW(61)
153#define K_BCM1480_INT_GPIO_14 _BCM1480_INT_LOW(62)
154#define K_BCM1480_INT_GPIO_15 _BCM1480_INT_LOW(63)
155
156/*
157 * Mask values for each interrupt
158 */
159
160#define _BCM1480_INT_MASK1(n) _SB_MAKEMASK1(((n) & 0x3F))
161#define _BCM1480_INT_OFFSET(n) (((n) & 0x40) << 6)
162
163#define M_BCM1480_INT_CASCADE _BCM1480_INT_MASK1(_BCM1480_INT_HIGH(0))
164
165#define M_BCM1480_INT_ADDR_TRAP _BCM1480_INT_MASK1(K_BCM1480_INT_ADDR_TRAP)
166#define M_BCM1480_INT_GPIO_0 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_0)
167#define M_BCM1480_INT_GPIO_1 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_1)
168#define M_BCM1480_INT_GPIO_2 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_2)
169#define M_BCM1480_INT_GPIO_3 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_3)
170#define M_BCM1480_INT_PCI_INTA _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTA)
171#define M_BCM1480_INT_PCI_INTB _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTB)
172#define M_BCM1480_INT_PCI_INTC _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTC)
173#define M_BCM1480_INT_PCI_INTD _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTD)
174#define M_BCM1480_INT_CYCLE_CP0 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP0)
175#define M_BCM1480_INT_CYCLE_CP1 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP1)
176#define M_BCM1480_INT_CYCLE_CP2 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP2)
177#define M_BCM1480_INT_CYCLE_CP3 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP3)
178#define M_BCM1480_INT_TIMER_0 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_0)
179#define M_BCM1480_INT_TIMER_1 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_1)
180#define M_BCM1480_INT_TIMER_2 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_2)
181#define M_BCM1480_INT_TIMER_3 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_3)
182#define M_BCM1480_INT_DM_CH_0 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_0)
183#define M_BCM1480_INT_DM_CH_1 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_1)
184#define M_BCM1480_INT_DM_CH_2 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_2)
185#define M_BCM1480_INT_DM_CH_3 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_3)
186#define M_BCM1480_INT_MAC_0 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_0)
187#define M_BCM1480_INT_MAC_0_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_0_CH1)
188#define M_BCM1480_INT_MAC_1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_1)
189#define M_BCM1480_INT_MAC_1_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_1_CH1)
190#define M_BCM1480_INT_MAC_2 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_2)
191#define M_BCM1480_INT_MAC_2_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_2_CH1)
192#define M_BCM1480_INT_MAC_3 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_3)
193#define M_BCM1480_INT_MAC_3_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_3_CH1)
194#define M_BCM1480_INT_PMI_LOW _BCM1480_INT_MASK1(K_BCM1480_INT_PMI_LOW)
195#define M_BCM1480_INT_PMI_HIGH _BCM1480_INT_MASK1(K_BCM1480_INT_PMI_HIGH)
196#define M_BCM1480_INT_PMO_LOW _BCM1480_INT_MASK1(K_BCM1480_INT_PMO_LOW)
197#define M_BCM1480_INT_PMO_HIGH _BCM1480_INT_MASK1(K_BCM1480_INT_PMO_HIGH)
198#define M_BCM1480_INT_MBOX_0_0 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_0)
199#define M_BCM1480_INT_MBOX_0_1 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_1)
200#define M_BCM1480_INT_MBOX_0_2 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_2)
201#define M_BCM1480_INT_MBOX_0_3 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_3)
202#define M_BCM1480_INT_MBOX_1_0 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_0)
203#define M_BCM1480_INT_MBOX_1_1 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_1)
204#define M_BCM1480_INT_MBOX_1_2 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_2)
205#define M_BCM1480_INT_MBOX_1_3 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_3)
206#define M_BCM1480_INT_BAD_ECC _BCM1480_INT_MASK1(K_BCM1480_INT_BAD_ECC)
207#define M_BCM1480_INT_COR_ECC _BCM1480_INT_MASK1(K_BCM1480_INT_COR_ECC)
208#define M_BCM1480_INT_IO_BUS _BCM1480_INT_MASK1(K_BCM1480_INT_IO_BUS)
209#define M_BCM1480_INT_PERF_CNT _BCM1480_INT_MASK1(K_BCM1480_INT_PERF_CNT)
210#define M_BCM1480_INT_SW_PERF_CNT _BCM1480_INT_MASK1(K_BCM1480_INT_SW_PERF_CNT)
211#define M_BCM1480_INT_TRACE_FREEZE _BCM1480_INT_MASK1(K_BCM1480_INT_TRACE_FREEZE)
212#define M_BCM1480_INT_SW_TRACE_FREEZE _BCM1480_INT_MASK1(K_BCM1480_INT_SW_TRACE_FREEZE)
213#define M_BCM1480_INT_WATCHDOG_TIMER_0 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_0)
214#define M_BCM1480_INT_WATCHDOG_TIMER_1 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_1)
215#define M_BCM1480_INT_WATCHDOG_TIMER_2 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_2)
216#define M_BCM1480_INT_WATCHDOG_TIMER_3 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_3)
217#define M_BCM1480_INT_PCI_ERROR _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_ERROR)
218#define M_BCM1480_INT_PCI_RESET _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_RESET)
219#define M_BCM1480_INT_NODE_CONTROLLER _BCM1480_INT_MASK1(K_BCM1480_INT_NODE_CONTROLLER)
220#define M_BCM1480_INT_HOST_BRIDGE _BCM1480_INT_MASK1(K_BCM1480_INT_HOST_BRIDGE)
221#define M_BCM1480_INT_PORT_0_FATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_0_FATAL)
222#define M_BCM1480_INT_PORT_0_NONFATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_0_NONFATAL)
223#define M_BCM1480_INT_PORT_1_FATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_1_FATAL)
224#define M_BCM1480_INT_PORT_1_NONFATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_1_NONFATAL)
225#define M_BCM1480_INT_PORT_2_FATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_2_FATAL)
226#define M_BCM1480_INT_PORT_2_NONFATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_2_NONFATAL)
227#define M_BCM1480_INT_LDT_SMI _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_SMI)
228#define M_BCM1480_INT_LDT_NMI _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_NMI)
229#define M_BCM1480_INT_LDT_INIT _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_INIT)
230#define M_BCM1480_INT_LDT_STARTUP _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_STARTUP)
231#define M_BCM1480_INT_LDT_EXT _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_EXT)
232#define M_BCM1480_INT_SMB_0 _BCM1480_INT_MASK1(K_BCM1480_INT_SMB_0)
233#define M_BCM1480_INT_SMB_1 _BCM1480_INT_MASK1(K_BCM1480_INT_SMB_1)
234#define M_BCM1480_INT_PCMCIA _BCM1480_INT_MASK1(K_BCM1480_INT_PCMCIA)
235#define M_BCM1480_INT_UART_0 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_0)
236#define M_BCM1480_INT_UART_1 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_1)
237#define M_BCM1480_INT_UART_2 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_2)
238#define M_BCM1480_INT_UART_3 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_3)
239#define M_BCM1480_INT_GPIO_4 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_4)
240#define M_BCM1480_INT_GPIO_5 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_5)
241#define M_BCM1480_INT_GPIO_6 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_6)
242#define M_BCM1480_INT_GPIO_7 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_7)
243#define M_BCM1480_INT_GPIO_8 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_8)
244#define M_BCM1480_INT_GPIO_9 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_9)
245#define M_BCM1480_INT_GPIO_10 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_10)
246#define M_BCM1480_INT_GPIO_11 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_11)
247#define M_BCM1480_INT_GPIO_12 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_12)
248#define M_BCM1480_INT_GPIO_13 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_13)
249#define M_BCM1480_INT_GPIO_14 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_14)
250#define M_BCM1480_INT_GPIO_15 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_15)
251
252/*
253 * Interrupt mappings (Table 18)
254 */
255
256#define K_BCM1480_INT_MAP_I0 0 /* interrupt pins on processor */
257#define K_BCM1480_INT_MAP_I1 1
258#define K_BCM1480_INT_MAP_I2 2
259#define K_BCM1480_INT_MAP_I3 3
260#define K_BCM1480_INT_MAP_I4 4
261#define K_BCM1480_INT_MAP_I5 5
262#define K_BCM1480_INT_MAP_NMI 6 /* nonmaskable */
263#define K_BCM1480_INT_MAP_DINT 7 /* debug interrupt */
264
265/*
266 * Interrupt LDT Set Register (Table 19)
267 */
268
269#define S_BCM1480_INT_HT_INTMSG 0
270#define M_BCM1480_INT_HT_INTMSG _SB_MAKEMASK(3,S_BCM1480_INT_HT_INTMSG)
271#define V_BCM1480_INT_HT_INTMSG(x) _SB_MAKEVALUE(x,S_BCM1480_INT_HT_INTMSG)
272#define G_BCM1480_INT_HT_INTMSG(x) _SB_GETVALUE(x,S_BCM1480_INT_HT_INTMSG,M_BCM1480_INT_HT_INTMSG)
273
274#define K_BCM1480_INT_HT_INTMSG_FIXED 0
275#define K_BCM1480_INT_HT_INTMSG_ARBITRATED 1
276#define K_BCM1480_INT_HT_INTMSG_SMI 2
277#define K_BCM1480_INT_HT_INTMSG_NMI 3
278#define K_BCM1480_INT_HT_INTMSG_INIT 4
279#define K_BCM1480_INT_HT_INTMSG_STARTUP 5
280#define K_BCM1480_INT_HT_INTMSG_EXTINT 6
281#define K_BCM1480_INT_HT_INTMSG_RESERVED 7
282
283#define M_BCM1480_INT_HT_TRIGGERMODE _SB_MAKEMASK1(3)
284#define V_BCM1480_INT_HT_EDGETRIGGER 0
285#define V_BCM1480_INT_HT_LEVELTRIGGER M_BCM1480_INT_HT_TRIGGERMODE
286
287#define M_BCM1480_INT_HT_DESTMODE _SB_MAKEMASK1(4)
288#define V_BCM1480_INT_HT_PHYSICALDEST 0
289#define V_BCM1480_INT_HT_LOGICALDEST M_BCM1480_INT_HT_DESTMODE
290
291#define S_BCM1480_INT_HT_INTDEST 5
292#define M_BCM1480_INT_HT_INTDEST _SB_MAKEMASK(8,S_BCM1480_INT_HT_INTDEST)
293#define V_BCM1480_INT_HT_INTDEST(x) _SB_MAKEVALUE(x,S_BCM1480_INT_HT_INTDEST)
294#define G_BCM1480_INT_HT_INTDEST(x) _SB_GETVALUE(x,S_BCM1480_INT_HT_INTDEST,M_BCM1480_INT_HT_INTDEST)
295
296#define S_BCM1480_INT_HT_VECTOR 13
297#define M_BCM1480_INT_HT_VECTOR _SB_MAKEMASK(8,S_BCM1480_INT_HT_VECTOR)
298#define V_BCM1480_INT_HT_VECTOR(x) _SB_MAKEVALUE(x,S_BCM1480_INT_HT_VECTOR)
299#define G_BCM1480_INT_HT_VECTOR(x) _SB_GETVALUE(x,S_BCM1480_INT_HT_VECTOR,M_BCM1480_INT_HT_VECTOR)
300
301/*
302 * Vector prefix (Table 4-7)
303 */
304
305#define M_BCM1480_HTVECT_RAISE_INTLDT_HIGH 0x00
306#define M_BCM1480_HTVECT_RAISE_MBOX_0 0x40
307#define M_BCM1480_HTVECT_RAISE_INTLDT_LO 0x80
308#define M_BCM1480_HTVECT_RAISE_MBOX_1 0xC0
309
310#endif /* _BCM1480_INT_H */
diff --git a/include/asm-mips/sibyte/bcm1480_l2c.h b/include/asm-mips/sibyte/bcm1480_l2c.h
new file mode 100644
index 000000000000..886b099565e6
--- /dev/null
+++ b/include/asm-mips/sibyte/bcm1480_l2c.h
@@ -0,0 +1,176 @@
1/* *********************************************************************
2 * BCM1280/BCM1480 Board Support Package
3 *
4 * L2 Cache constants and macros File: bcm1480_l2c.h
5 *
6 * This module contains constants useful for manipulating the
7 * level 2 cache.
8 *
9 * BCM1400 specification level: 1280-UM100-D2 (11/14/03)
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32
33#ifndef _BCM1480_L2C_H
34#define _BCM1480_L2C_H
35
36#include "sb1250_defs.h"
37
38/*
39 * Format of level 2 cache management address (Table 55)
40 */
41
42#define S_BCM1480_L2C_MGMT_INDEX 5
43#define M_BCM1480_L2C_MGMT_INDEX _SB_MAKEMASK(12,S_BCM1480_L2C_MGMT_INDEX)
44#define V_BCM1480_L2C_MGMT_INDEX(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_MGMT_INDEX)
45#define G_BCM1480_L2C_MGMT_INDEX(x) _SB_GETVALUE(x,S_BCM1480_L2C_MGMT_INDEX,M_BCM1480_L2C_MGMT_INDEX)
46
47#define S_BCM1480_L2C_MGMT_WAY 17
48#define M_BCM1480_L2C_MGMT_WAY _SB_MAKEMASK(3,S_BCM1480_L2C_MGMT_WAY)
49#define V_BCM1480_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_MGMT_WAY)
50#define G_BCM1480_L2C_MGMT_WAY(x) _SB_GETVALUE(x,S_BCM1480_L2C_MGMT_WAY,M_BCM1480_L2C_MGMT_WAY)
51
52#define M_BCM1480_L2C_MGMT_DIRTY _SB_MAKEMASK1(20)
53#define M_BCM1480_L2C_MGMT_VALID _SB_MAKEMASK1(21)
54
55#define S_BCM1480_L2C_MGMT_ECC_DIAG 22
56#define M_BCM1480_L2C_MGMT_ECC_DIAG _SB_MAKEMASK(2,S_BCM1480_L2C_MGMT_ECC_DIAG)
57#define V_BCM1480_L2C_MGMT_ECC_DIAG(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_MGMT_ECC_DIAG)
58#define G_BCM1480_L2C_MGMT_ECC_DIAG(x) _SB_GETVALUE(x,S_BCM1480_L2C_MGMT_ECC_DIAG,M_BCM1480_L2C_MGMT_ECC_DIAG)
59
60#define A_BCM1480_L2C_MGMT_TAG_BASE 0x00D0000000
61
62#define BCM1480_L2C_ENTRIES_PER_WAY 4096
63#define BCM1480_L2C_NUM_WAYS 8
64
65
66/*
67 * Level 2 Cache Tag register (Table 59)
68 */
69
70#define S_BCM1480_L2C_TAG_MBZ 0
71#define M_BCM1480_L2C_TAG_MBZ _SB_MAKEMASK(5,S_BCM1480_L2C_TAG_MBZ)
72
73#define S_BCM1480_L2C_TAG_INDEX 5
74#define M_BCM1480_L2C_TAG_INDEX _SB_MAKEMASK(12,S_BCM1480_L2C_TAG_INDEX)
75#define V_BCM1480_L2C_TAG_INDEX(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_TAG_INDEX)
76#define G_BCM1480_L2C_TAG_INDEX(x) _SB_GETVALUE(x,S_BCM1480_L2C_TAG_INDEX,M_BCM1480_L2C_TAG_INDEX)
77
78/* Note that index bit 16 is also tag bit 40 */
79#define S_BCM1480_L2C_TAG_TAG 17
80#define M_BCM1480_L2C_TAG_TAG _SB_MAKEMASK(23,S_BCM1480_L2C_TAG_TAG)
81#define V_BCM1480_L2C_TAG_TAG(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_TAG_TAG)
82#define G_BCM1480_L2C_TAG_TAG(x) _SB_GETVALUE(x,S_BCM1480_L2C_TAG_TAG,M_BCM1480_L2C_TAG_TAG)
83
84#define S_BCM1480_L2C_TAG_ECC 40
85#define M_BCM1480_L2C_TAG_ECC _SB_MAKEMASK(6,S_BCM1480_L2C_TAG_ECC)
86#define V_BCM1480_L2C_TAG_ECC(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_TAG_ECC)
87#define G_BCM1480_L2C_TAG_ECC(x) _SB_GETVALUE(x,S_BCM1480_L2C_TAG_ECC,M_BCM1480_L2C_TAG_ECC)
88
89#define S_BCM1480_L2C_TAG_WAY 46
90#define M_BCM1480_L2C_TAG_WAY _SB_MAKEMASK(3,S_BCM1480_L2C_TAG_WAY)
91#define V_BCM1480_L2C_TAG_WAY(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_TAG_WAY)
92#define G_BCM1480_L2C_TAG_WAY(x) _SB_GETVALUE(x,S_BCM1480_L2C_TAG_WAY,M_BCM1480_L2C_TAG_WAY)
93
94#define M_BCM1480_L2C_TAG_DIRTY _SB_MAKEMASK1(49)
95#define M_BCM1480_L2C_TAG_VALID _SB_MAKEMASK1(50)
96
97#define S_BCM1480_L2C_DATA_ECC 51
98#define M_BCM1480_L2C_DATA_ECC _SB_MAKEMASK(10,S_BCM1480_L2C_DATA_ECC)
99#define V_BCM1480_L2C_DATA_ECC(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_DATA_ECC)
100#define G_BCM1480_L2C_DATA_ECC(x) _SB_GETVALUE(x,S_BCM1480_L2C_DATA_ECC,M_BCM1480_L2C_DATA_ECC)
101
102
103/*
104 * L2 Misc0 Value Register (Table 60)
105 */
106
107#define S_BCM1480_L2C_MISC0_WAY_REMOTE 0
108#define M_BCM1480_L2C_MISC0_WAY_REMOTE _SB_MAKEMASK(8,S_BCM1480_L2C_MISC0_WAY_REMOTE)
109#define G_BCM1480_L2C_MISC0_WAY_REMOTE(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC0_WAY_REMOTE,M_BCM1480_L2C_MISC0_WAY_REMOTE)
110
111#define S_BCM1480_L2C_MISC0_WAY_LOCAL 8
112#define M_BCM1480_L2C_MISC0_WAY_LOCAL _SB_MAKEMASK(8,S_BCM1480_L2C_MISC0_WAY_LOCAL)
113#define G_BCM1480_L2C_MISC0_WAY_LOCAL(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC0_WAY_LOCAL,M_BCM1480_L2C_MISC0_WAY_LOCAL)
114
115#define S_BCM1480_L2C_MISC0_WAY_ENABLE 16
116#define M_BCM1480_L2C_MISC0_WAY_ENABLE _SB_MAKEMASK(8,S_BCM1480_L2C_MISC0_WAY_ENABLE)
117#define G_BCM1480_L2C_MISC0_WAY_ENABLE(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC0_WAY_ENABLE,M_BCM1480_L2C_MISC0_WAY_ENABLE)
118
119#define S_BCM1480_L2C_MISC0_CACHE_DISABLE 24
120#define M_BCM1480_L2C_MISC0_CACHE_DISABLE _SB_MAKEMASK(2,S_BCM1480_L2C_MISC0_CACHE_DISABLE)
121#define G_BCM1480_L2C_MISC0_CACHE_DISABLE(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC0_CACHE_DISABLE,M_BCM1480_L2C_MISC0_CACHE_DISABLE)
122
123#define S_BCM1480_L2C_MISC0_CACHE_QUAD 26
124#define M_BCM1480_L2C_MISC0_CACHE_QUAD _SB_MAKEMASK(2,S_BCM1480_L2C_MISC0_CACHE_QUAD)
125#define G_BCM1480_L2C_MISC0_CACHE_QUAD(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC0_CACHE_QUAD,M_BCM1480_L2C_MISC0_CACHE_QUAD)
126
127#define S_BCM1480_L2C_MISC0_MC_PRIORITY 30
128#define M_BCM1480_L2C_MISC0_MC_PRIORITY _SB_MAKEMASK1(S_BCM1480_L2C_MISC0_MC_PRIORITY)
129
130#define S_BCM1480_L2C_MISC0_ECC_CLEANUP 31
131#define M_BCM1480_L2C_MISC0_ECC_CLEANUP _SB_MAKEMASK1(S_BCM1480_L2C_MISC0_ECC_CLEANUP)
132
133
134/*
135 * L2 Misc1 Value Register (Table 60)
136 */
137
138#define S_BCM1480_L2C_MISC1_WAY_AGENT_0 0
139#define M_BCM1480_L2C_MISC1_WAY_AGENT_0 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC1_WAY_AGENT_0)
140#define G_BCM1480_L2C_MISC1_WAY_AGENT_0(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC1_WAY_AGENT_0,M_BCM1480_L2C_MISC1_WAY_AGENT_0)
141
142#define S_BCM1480_L2C_MISC1_WAY_AGENT_1 8
143#define M_BCM1480_L2C_MISC1_WAY_AGENT_1 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC1_WAY_AGENT_1)
144#define G_BCM1480_L2C_MISC1_WAY_AGENT_1(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC1_WAY_AGENT_1,M_BCM1480_L2C_MISC1_WAY_AGENT_1)
145
146#define S_BCM1480_L2C_MISC1_WAY_AGENT_2 16
147#define M_BCM1480_L2C_MISC1_WAY_AGENT_2 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC1_WAY_AGENT_2)
148#define G_BCM1480_L2C_MISC1_WAY_AGENT_2(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC1_WAY_AGENT_2,M_BCM1480_L2C_MISC1_WAY_AGENT_2)
149
150#define S_BCM1480_L2C_MISC1_WAY_AGENT_3 24
151#define M_BCM1480_L2C_MISC1_WAY_AGENT_3 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC1_WAY_AGENT_3)
152#define G_BCM1480_L2C_MISC1_WAY_AGENT_3(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC1_WAY_AGENT_3,M_BCM1480_L2C_MISC1_WAY_AGENT_3)
153
154#define S_BCM1480_L2C_MISC1_WAY_AGENT_4 32
155#define M_BCM1480_L2C_MISC1_WAY_AGENT_4 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC1_WAY_AGENT_4)
156#define G_BCM1480_L2C_MISC1_WAY_AGENT_4(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC1_WAY_AGENT_4,M_BCM1480_L2C_MISC1_WAY_AGENT_4)
157
158
159/*
160 * L2 Misc2 Value Register (Table 60)
161 */
162
163#define S_BCM1480_L2C_MISC2_WAY_AGENT_8 0
164#define M_BCM1480_L2C_MISC2_WAY_AGENT_8 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC2_WAY_AGENT_8)
165#define G_BCM1480_L2C_MISC2_WAY_AGENT_8(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC2_WAY_AGENT_8,M_BCM1480_L2C_MISC2_WAY_AGENT_8)
166
167#define S_BCM1480_L2C_MISC2_WAY_AGENT_9 8
168#define M_BCM1480_L2C_MISC2_WAY_AGENT_9 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC2_WAY_AGENT_9)
169#define G_BCM1480_L2C_MISC2_WAY_AGENT_9(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC2_WAY_AGENT_9,M_BCM1480_L2C_MISC2_WAY_AGENT_9)
170
171#define S_BCM1480_L2C_MISC2_WAY_AGENT_A 16
172#define M_BCM1480_L2C_MISC2_WAY_AGENT_A _SB_MAKEMASK(8,S_BCM1480_L2C_MISC2_WAY_AGENT_A)
173#define G_BCM1480_L2C_MISC2_WAY_AGENT_A(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC2_WAY_AGENT_A,M_BCM1480_L2C_MISC2_WAY_AGENT_A)
174
175
176#endif /* _BCM1480_L2C_H */
diff --git a/include/asm-mips/sibyte/bcm1480_mc.h b/include/asm-mips/sibyte/bcm1480_mc.h
new file mode 100644
index 000000000000..6bdc941afc91
--- /dev/null
+++ b/include/asm-mips/sibyte/bcm1480_mc.h
@@ -0,0 +1,962 @@
1/* *********************************************************************
2 * BCM1280/BCM1480 Board Support Package
3 *
4 * Memory Controller constants File: bcm1480_mc.h
5 *
6 * This module contains constants and macros useful for
7 * programming the memory controller.
8 *
9 * BCM1400 specification level: 1280-UM100-D1 (11/14/03 Review Copy)
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32
33#ifndef _BCM1480_MC_H
34#define _BCM1480_MC_H
35
36#include "sb1250_defs.h"
37
38/*
39 * Memory Channel Configuration Register (Table 81)
40 */
41
42#define S_BCM1480_MC_INTLV0 0
43#define M_BCM1480_MC_INTLV0 _SB_MAKEMASK(6,S_BCM1480_MC_INTLV0)
44#define V_BCM1480_MC_INTLV0(x) _SB_MAKEVALUE(x,S_BCM1480_MC_INTLV0)
45#define G_BCM1480_MC_INTLV0(x) _SB_GETVALUE(x,S_BCM1480_MC_INTLV0,M_BCM1480_MC_INTLV0)
46#define V_BCM1480_MC_INTLV0_DEFAULT V_BCM1480_MC_INTLV0(0)
47
48#define S_BCM1480_MC_INTLV1 8
49#define M_BCM1480_MC_INTLV1 _SB_MAKEMASK(6,S_BCM1480_MC_INTLV1)
50#define V_BCM1480_MC_INTLV1(x) _SB_MAKEVALUE(x,S_BCM1480_MC_INTLV1)
51#define G_BCM1480_MC_INTLV1(x) _SB_GETVALUE(x,S_BCM1480_MC_INTLV1,M_BCM1480_MC_INTLV1)
52#define V_BCM1480_MC_INTLV1_DEFAULT V_BCM1480_MC_INTLV1(0)
53
54#define S_BCM1480_MC_INTLV2 16
55#define M_BCM1480_MC_INTLV2 _SB_MAKEMASK(6,S_BCM1480_MC_INTLV2)
56#define V_BCM1480_MC_INTLV2(x) _SB_MAKEVALUE(x,S_BCM1480_MC_INTLV2)
57#define G_BCM1480_MC_INTLV2(x) _SB_GETVALUE(x,S_BCM1480_MC_INTLV2,M_BCM1480_MC_INTLV2)
58#define V_BCM1480_MC_INTLV2_DEFAULT V_BCM1480_MC_INTLV2(0)
59
60#define S_BCM1480_MC_CS_MODE 32
61#define M_BCM1480_MC_CS_MODE _SB_MAKEMASK(8,S_BCM1480_MC_CS_MODE)
62#define V_BCM1480_MC_CS_MODE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS_MODE)
63#define G_BCM1480_MC_CS_MODE(x) _SB_GETVALUE(x,S_BCM1480_MC_CS_MODE,M_BCM1480_MC_CS_MODE)
64#define V_BCM1480_MC_CS_MODE_DEFAULT V_BCM1480_MC_CS_MODE(0)
65
66#define V_BCM1480_MC_CONFIG_DEFAULT (V_BCM1480_MC_INTLV0_DEFAULT | \
67 V_BCM1480_MC_INTLV1_DEFAULT | \
68 V_BCM1480_MC_INTLV2_DEFAULT | \
69 V_BCM1480_MC_CS_MODE_DEFAULT)
70
71#define K_BCM1480_MC_CS01_MODE 0x03
72#define K_BCM1480_MC_CS02_MODE 0x05
73#define K_BCM1480_MC_CS0123_MODE 0x0F
74#define K_BCM1480_MC_CS0246_MODE 0x55
75#define K_BCM1480_MC_CS0145_MODE 0x33
76#define K_BCM1480_MC_CS0167_MODE 0xC3
77#define K_BCM1480_MC_CSFULL_MODE 0xFF
78
79/*
80 * Chip Select Start Address Register (Table 82)
81 */
82
83#define S_BCM1480_MC_CS0_START 0
84#define M_BCM1480_MC_CS0_START _SB_MAKEMASK(12,S_BCM1480_MC_CS0_START)
85#define V_BCM1480_MC_CS0_START(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS0_START)
86#define G_BCM1480_MC_CS0_START(x) _SB_GETVALUE(x,S_BCM1480_MC_CS0_START,M_BCM1480_MC_CS0_START)
87
88#define S_BCM1480_MC_CS1_START 16
89#define M_BCM1480_MC_CS1_START _SB_MAKEMASK(12,S_BCM1480_MC_CS1_START)
90#define V_BCM1480_MC_CS1_START(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS1_START)
91#define G_BCM1480_MC_CS1_START(x) _SB_GETVALUE(x,S_BCM1480_MC_CS1_START,M_BCM1480_MC_CS1_START)
92
93#define S_BCM1480_MC_CS2_START 32
94#define M_BCM1480_MC_CS2_START _SB_MAKEMASK(12,S_BCM1480_MC_CS2_START)
95#define V_BCM1480_MC_CS2_START(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS2_START)
96#define G_BCM1480_MC_CS2_START(x) _SB_GETVALUE(x,S_BCM1480_MC_CS2_START,M_BCM1480_MC_CS2_START)
97
98#define S_BCM1480_MC_CS3_START 48
99#define M_BCM1480_MC_CS3_START _SB_MAKEMASK(12,S_BCM1480_MC_CS3_START)
100#define V_BCM1480_MC_CS3_START(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS3_START)
101#define G_BCM1480_MC_CS3_START(x) _SB_GETVALUE(x,S_BCM1480_MC_CS3_START,M_BCM1480_MC_CS3_START)
102
103/*
104 * Chip Select End Address Register (Table 83)
105 */
106
107#define S_BCM1480_MC_CS0_END 0
108#define M_BCM1480_MC_CS0_END _SB_MAKEMASK(12,S_BCM1480_MC_CS0_END)
109#define V_BCM1480_MC_CS0_END(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS0_END)
110#define G_BCM1480_MC_CS0_END(x) _SB_GETVALUE(x,S_BCM1480_MC_CS0_END,M_BCM1480_MC_CS0_END)
111
112#define S_BCM1480_MC_CS1_END 16
113#define M_BCM1480_MC_CS1_END _SB_MAKEMASK(12,S_BCM1480_MC_CS1_END)
114#define V_BCM1480_MC_CS1_END(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS1_END)
115#define G_BCM1480_MC_CS1_END(x) _SB_GETVALUE(x,S_BCM1480_MC_CS1_END,M_BCM1480_MC_CS1_END)
116
117#define S_BCM1480_MC_CS2_END 32
118#define M_BCM1480_MC_CS2_END _SB_MAKEMASK(12,S_BCM1480_MC_CS2_END)
119#define V_BCM1480_MC_CS2_END(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS2_END)
120#define G_BCM1480_MC_CS2_END(x) _SB_GETVALUE(x,S_BCM1480_MC_CS2_END,M_BCM1480_MC_CS2_END)
121
122#define S_BCM1480_MC_CS3_END 48
123#define M_BCM1480_MC_CS3_END _SB_MAKEMASK(12,S_BCM1480_MC_CS3_END)
124#define V_BCM1480_MC_CS3_END(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS3_END)
125#define G_BCM1480_MC_CS3_END(x) _SB_GETVALUE(x,S_BCM1480_MC_CS3_END,M_BCM1480_MC_CS3_END)
126
127/*
128 * Row Address Bit Select Register 0 (Table 84)
129 */
130
131#define S_BCM1480_MC_ROW00 0
132#define M_BCM1480_MC_ROW00 _SB_MAKEMASK(6,S_BCM1480_MC_ROW00)
133#define V_BCM1480_MC_ROW00(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW00)
134#define G_BCM1480_MC_ROW00(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW00,M_BCM1480_MC_ROW00)
135
136#define S_BCM1480_MC_ROW01 8
137#define M_BCM1480_MC_ROW01 _SB_MAKEMASK(6,S_BCM1480_MC_ROW01)
138#define V_BCM1480_MC_ROW01(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW01)
139#define G_BCM1480_MC_ROW01(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW01,M_BCM1480_MC_ROW01)
140
141#define S_BCM1480_MC_ROW02 16
142#define M_BCM1480_MC_ROW02 _SB_MAKEMASK(6,S_BCM1480_MC_ROW02)
143#define V_BCM1480_MC_ROW02(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW02)
144#define G_BCM1480_MC_ROW02(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW02,M_BCM1480_MC_ROW02)
145
146#define S_BCM1480_MC_ROW03 24
147#define M_BCM1480_MC_ROW03 _SB_MAKEMASK(6,S_BCM1480_MC_ROW03)
148#define V_BCM1480_MC_ROW03(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW03)
149#define G_BCM1480_MC_ROW03(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW03,M_BCM1480_MC_ROW03)
150
151#define S_BCM1480_MC_ROW04 32
152#define M_BCM1480_MC_ROW04 _SB_MAKEMASK(6,S_BCM1480_MC_ROW04)
153#define V_BCM1480_MC_ROW04(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW04)
154#define G_BCM1480_MC_ROW04(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW04,M_BCM1480_MC_ROW04)
155
156#define S_BCM1480_MC_ROW05 40
157#define M_BCM1480_MC_ROW05 _SB_MAKEMASK(6,S_BCM1480_MC_ROW05)
158#define V_BCM1480_MC_ROW05(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW05)
159#define G_BCM1480_MC_ROW05(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW05,M_BCM1480_MC_ROW05)
160
161#define S_BCM1480_MC_ROW06 48
162#define M_BCM1480_MC_ROW06 _SB_MAKEMASK(6,S_BCM1480_MC_ROW06)
163#define V_BCM1480_MC_ROW06(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW06)
164#define G_BCM1480_MC_ROW06(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW06,M_BCM1480_MC_ROW06)
165
166#define S_BCM1480_MC_ROW07 56
167#define M_BCM1480_MC_ROW07 _SB_MAKEMASK(6,S_BCM1480_MC_ROW07)
168#define V_BCM1480_MC_ROW07(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW07)
169#define G_BCM1480_MC_ROW07(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW07,M_BCM1480_MC_ROW07)
170
171/*
172 * Row Address Bit Select Register 1 (Table 85)
173 */
174
175#define S_BCM1480_MC_ROW08 0
176#define M_BCM1480_MC_ROW08 _SB_MAKEMASK(6,S_BCM1480_MC_ROW08)
177#define V_BCM1480_MC_ROW08(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW08)
178#define G_BCM1480_MC_ROW08(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW08,M_BCM1480_MC_ROW08)
179
180#define S_BCM1480_MC_ROW09 8
181#define M_BCM1480_MC_ROW09 _SB_MAKEMASK(6,S_BCM1480_MC_ROW09)
182#define V_BCM1480_MC_ROW09(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW09)
183#define G_BCM1480_MC_ROW09(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW09,M_BCM1480_MC_ROW09)
184
185#define S_BCM1480_MC_ROW10 16
186#define M_BCM1480_MC_ROW10 _SB_MAKEMASK(6,S_BCM1480_MC_ROW10)
187#define V_BCM1480_MC_ROW10(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW10)
188#define G_BCM1480_MC_ROW10(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW10,M_BCM1480_MC_ROW10)
189
190#define S_BCM1480_MC_ROW11 24
191#define M_BCM1480_MC_ROW11 _SB_MAKEMASK(6,S_BCM1480_MC_ROW11)
192#define V_BCM1480_MC_ROW11(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW11)
193#define G_BCM1480_MC_ROW11(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW11,M_BCM1480_MC_ROW11)
194
195#define S_BCM1480_MC_ROW12 32
196#define M_BCM1480_MC_ROW12 _SB_MAKEMASK(6,S_BCM1480_MC_ROW12)
197#define V_BCM1480_MC_ROW12(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW12)
198#define G_BCM1480_MC_ROW12(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW12,M_BCM1480_MC_ROW12)
199
200#define S_BCM1480_MC_ROW13 40
201#define M_BCM1480_MC_ROW13 _SB_MAKEMASK(6,S_BCM1480_MC_ROW13)
202#define V_BCM1480_MC_ROW13(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW13)
203#define G_BCM1480_MC_ROW13(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW13,M_BCM1480_MC_ROW13)
204
205#define S_BCM1480_MC_ROW14 48
206#define M_BCM1480_MC_ROW14 _SB_MAKEMASK(6,S_BCM1480_MC_ROW14)
207#define V_BCM1480_MC_ROW14(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW14)
208#define G_BCM1480_MC_ROW14(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW14,M_BCM1480_MC_ROW14)
209
210#define K_BCM1480_MC_ROWX_BIT_SPACING 8
211
212/*
213 * Column Address Bit Select Register 0 (Table 86)
214 */
215
216#define S_BCM1480_MC_COL00 0
217#define M_BCM1480_MC_COL00 _SB_MAKEMASK(6,S_BCM1480_MC_COL00)
218#define V_BCM1480_MC_COL00(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL00)
219#define G_BCM1480_MC_COL00(x) _SB_GETVALUE(x,S_BCM1480_MC_COL00,M_BCM1480_MC_COL00)
220
221#define S_BCM1480_MC_COL01 8
222#define M_BCM1480_MC_COL01 _SB_MAKEMASK(6,S_BCM1480_MC_COL01)
223#define V_BCM1480_MC_COL01(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL01)
224#define G_BCM1480_MC_COL01(x) _SB_GETVALUE(x,S_BCM1480_MC_COL01,M_BCM1480_MC_COL01)
225
226#define S_BCM1480_MC_COL02 16
227#define M_BCM1480_MC_COL02 _SB_MAKEMASK(6,S_BCM1480_MC_COL02)
228#define V_BCM1480_MC_COL02(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL02)
229#define G_BCM1480_MC_COL02(x) _SB_GETVALUE(x,S_BCM1480_MC_COL02,M_BCM1480_MC_COL02)
230
231#define S_BCM1480_MC_COL03 24
232#define M_BCM1480_MC_COL03 _SB_MAKEMASK(6,S_BCM1480_MC_COL03)
233#define V_BCM1480_MC_COL03(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL03)
234#define G_BCM1480_MC_COL03(x) _SB_GETVALUE(x,S_BCM1480_MC_COL03,M_BCM1480_MC_COL03)
235
236#define S_BCM1480_MC_COL04 32
237#define M_BCM1480_MC_COL04 _SB_MAKEMASK(6,S_BCM1480_MC_COL04)
238#define V_BCM1480_MC_COL04(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL04)
239#define G_BCM1480_MC_COL04(x) _SB_GETVALUE(x,S_BCM1480_MC_COL04,M_BCM1480_MC_COL04)
240
241#define S_BCM1480_MC_COL05 40
242#define M_BCM1480_MC_COL05 _SB_MAKEMASK(6,S_BCM1480_MC_COL05)
243#define V_BCM1480_MC_COL05(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL05)
244#define G_BCM1480_MC_COL05(x) _SB_GETVALUE(x,S_BCM1480_MC_COL05,M_BCM1480_MC_COL05)
245
246#define S_BCM1480_MC_COL06 48
247#define M_BCM1480_MC_COL06 _SB_MAKEMASK(6,S_BCM1480_MC_COL06)
248#define V_BCM1480_MC_COL06(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL06)
249#define G_BCM1480_MC_COL06(x) _SB_GETVALUE(x,S_BCM1480_MC_COL06,M_BCM1480_MC_COL06)
250
251#define S_BCM1480_MC_COL07 56
252#define M_BCM1480_MC_COL07 _SB_MAKEMASK(6,S_BCM1480_MC_COL07)
253#define V_BCM1480_MC_COL07(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL07)
254#define G_BCM1480_MC_COL07(x) _SB_GETVALUE(x,S_BCM1480_MC_COL07,M_BCM1480_MC_COL07)
255
256/*
257 * Column Address Bit Select Register 1 (Table 87)
258 */
259
260#define S_BCM1480_MC_COL08 0
261#define M_BCM1480_MC_COL08 _SB_MAKEMASK(6,S_BCM1480_MC_COL08)
262#define V_BCM1480_MC_COL08(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL08)
263#define G_BCM1480_MC_COL08(x) _SB_GETVALUE(x,S_BCM1480_MC_COL08,M_BCM1480_MC_COL08)
264
265#define S_BCM1480_MC_COL09 8
266#define M_BCM1480_MC_COL09 _SB_MAKEMASK(6,S_BCM1480_MC_COL09)
267#define V_BCM1480_MC_COL09(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL09)
268#define G_BCM1480_MC_COL09(x) _SB_GETVALUE(x,S_BCM1480_MC_COL09,M_BCM1480_MC_COL09)
269
270#define S_BCM1480_MC_COL10 16 /* not a valid position, must be prog as 0 */
271
272#define S_BCM1480_MC_COL11 24
273#define M_BCM1480_MC_COL11 _SB_MAKEMASK(6,S_BCM1480_MC_COL11)
274#define V_BCM1480_MC_COL11(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL11)
275#define G_BCM1480_MC_COL11(x) _SB_GETVALUE(x,S_BCM1480_MC_COL11,M_BCM1480_MC_COL11)
276
277#define S_BCM1480_MC_COL12 32
278#define M_BCM1480_MC_COL12 _SB_MAKEMASK(6,S_BCM1480_MC_COL12)
279#define V_BCM1480_MC_COL12(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL12)
280#define G_BCM1480_MC_COL12(x) _SB_GETVALUE(x,S_BCM1480_MC_COL12,M_BCM1480_MC_COL12)
281
282#define S_BCM1480_MC_COL13 40
283#define M_BCM1480_MC_COL13 _SB_MAKEMASK(6,S_BCM1480_MC_COL13)
284#define V_BCM1480_MC_COL13(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL13)
285#define G_BCM1480_MC_COL13(x) _SB_GETVALUE(x,S_BCM1480_MC_COL13,M_BCM1480_MC_COL13)
286
287#define S_BCM1480_MC_COL14 48
288#define M_BCM1480_MC_COL14 _SB_MAKEMASK(6,S_BCM1480_MC_COL14)
289#define V_BCM1480_MC_COL14(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL14)
290#define G_BCM1480_MC_COL14(x) _SB_GETVALUE(x,S_BCM1480_MC_COL14,M_BCM1480_MC_COL14)
291
292#define K_BCM1480_MC_COLX_BIT_SPACING 8
293
294/*
295 * CS0 and CS1 Bank Address Bit Select Register (Table 88)
296 */
297
298#define S_BCM1480_MC_CS01_BANK0 0
299#define M_BCM1480_MC_CS01_BANK0 _SB_MAKEMASK(6,S_BCM1480_MC_CS01_BANK0)
300#define V_BCM1480_MC_CS01_BANK0(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS01_BANK0)
301#define G_BCM1480_MC_CS01_BANK0(x) _SB_GETVALUE(x,S_BCM1480_MC_CS01_BANK0,M_BCM1480_MC_CS01_BANK0)
302
303#define S_BCM1480_MC_CS01_BANK1 8
304#define M_BCM1480_MC_CS01_BANK1 _SB_MAKEMASK(6,S_BCM1480_MC_CS01_BANK1)
305#define V_BCM1480_MC_CS01_BANK1(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS01_BANK1)
306#define G_BCM1480_MC_CS01_BANK1(x) _SB_GETVALUE(x,S_BCM1480_MC_CS01_BANK1,M_BCM1480_MC_CS01_BANK1)
307
308#define S_BCM1480_MC_CS01_BANK2 16
309#define M_BCM1480_MC_CS01_BANK2 _SB_MAKEMASK(6,S_BCM1480_MC_CS01_BANK2)
310#define V_BCM1480_MC_CS01_BANK2(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS01_BANK2)
311#define G_BCM1480_MC_CS01_BANK2(x) _SB_GETVALUE(x,S_BCM1480_MC_CS01_BANK2,M_BCM1480_MC_CS01_BANK2)
312
313/*
314 * CS2 and CS3 Bank Address Bit Select Register (Table 89)
315 */
316
317#define S_BCM1480_MC_CS23_BANK0 0
318#define M_BCM1480_MC_CS23_BANK0 _SB_MAKEMASK(6,S_BCM1480_MC_CS23_BANK0)
319#define V_BCM1480_MC_CS23_BANK0(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS23_BANK0)
320#define G_BCM1480_MC_CS23_BANK0(x) _SB_GETVALUE(x,S_BCM1480_MC_CS23_BANK0,M_BCM1480_MC_CS23_BANK0)
321
322#define S_BCM1480_MC_CS23_BANK1 8
323#define M_BCM1480_MC_CS23_BANK1 _SB_MAKEMASK(6,S_BCM1480_MC_CS23_BANK1)
324#define V_BCM1480_MC_CS23_BANK1(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS23_BANK1)
325#define G_BCM1480_MC_CS23_BANK1(x) _SB_GETVALUE(x,S_BCM1480_MC_CS23_BANK1,M_BCM1480_MC_CS23_BANK1)
326
327#define S_BCM1480_MC_CS23_BANK2 16
328#define M_BCM1480_MC_CS23_BANK2 _SB_MAKEMASK(6,S_BCM1480_MC_CS23_BANK2)
329#define V_BCM1480_MC_CS23_BANK2(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS23_BANK2)
330#define G_BCM1480_MC_CS23_BANK2(x) _SB_GETVALUE(x,S_BCM1480_MC_CS23_BANK2,M_BCM1480_MC_CS23_BANK2)
331
332#define K_BCM1480_MC_CSXX_BANKX_BIT_SPACING 8
333
334/*
335 * DRAM Command Register (Table 90)
336 */
337
338#define S_BCM1480_MC_COMMAND 0
339#define M_BCM1480_MC_COMMAND _SB_MAKEMASK(4,S_BCM1480_MC_COMMAND)
340#define V_BCM1480_MC_COMMAND(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COMMAND)
341#define G_BCM1480_MC_COMMAND(x) _SB_GETVALUE(x,S_BCM1480_MC_COMMAND,M_BCM1480_MC_COMMAND)
342
343#define K_BCM1480_MC_COMMAND_EMRS 0
344#define K_BCM1480_MC_COMMAND_MRS 1
345#define K_BCM1480_MC_COMMAND_PRE 2
346#define K_BCM1480_MC_COMMAND_AR 3
347#define K_BCM1480_MC_COMMAND_SETRFSH 4
348#define K_BCM1480_MC_COMMAND_CLRRFSH 5
349#define K_BCM1480_MC_COMMAND_SETPWRDN 6
350#define K_BCM1480_MC_COMMAND_CLRPWRDN 7
351
352#if SIBYTE_HDR_FEATURE(1480, PASS2)
353#define K_BCM1480_MC_COMMAND_EMRS2 8
354#define K_BCM1480_MC_COMMAND_EMRS3 9
355#define K_BCM1480_MC_COMMAND_ENABLE_MCLK 10
356#define K_BCM1480_MC_COMMAND_DISABLE_MCLK 11
357#endif
358
359#define V_BCM1480_MC_COMMAND_EMRS V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_EMRS)
360#define V_BCM1480_MC_COMMAND_MRS V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_MRS)
361#define V_BCM1480_MC_COMMAND_PRE V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_PRE)
362#define V_BCM1480_MC_COMMAND_AR V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_AR)
363#define V_BCM1480_MC_COMMAND_SETRFSH V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_SETRFSH)
364#define V_BCM1480_MC_COMMAND_CLRRFSH V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_CLRRFSH)
365#define V_BCM1480_MC_COMMAND_SETPWRDN V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_SETPWRDN)
366#define V_BCM1480_MC_COMMAND_CLRPWRDN V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_CLRPWRDN)
367
368#if SIBYTE_HDR_FEATURE(1480, PASS2)
369#define V_BCM1480_MC_COMMAND_EMRS2 V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_EMRS2)
370#define V_BCM1480_MC_COMMAND_EMRS3 V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_EMRS3)
371#define V_BCM1480_MC_COMMAND_ENABLE_MCLK V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_ENABLE_MCLK)
372#define V_BCM1480_MC_COMMAND_DISABLE_MCLK V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_DISABLE_MCLK)
373#endif
374
375#define S_BCM1480_MC_CS0 4
376#define M_BCM1480_MC_CS0 _SB_MAKEMASK1(4)
377#define M_BCM1480_MC_CS1 _SB_MAKEMASK1(5)
378#define M_BCM1480_MC_CS2 _SB_MAKEMASK1(6)
379#define M_BCM1480_MC_CS3 _SB_MAKEMASK1(7)
380#define M_BCM1480_MC_CS4 _SB_MAKEMASK1(8)
381#define M_BCM1480_MC_CS5 _SB_MAKEMASK1(9)
382#define M_BCM1480_MC_CS6 _SB_MAKEMASK1(10)
383#define M_BCM1480_MC_CS7 _SB_MAKEMASK1(11)
384
385#define M_BCM1480_MC_CMD_ACTIVE _SB_MAKEMASK1(16)
386
387/*
388 * DRAM Mode Register (Table 91)
389 */
390
391#define S_BCM1480_MC_EMODE 0
392#define M_BCM1480_MC_EMODE _SB_MAKEMASK(15,S_BCM1480_MC_EMODE)
393#define V_BCM1480_MC_EMODE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_EMODE)
394#define G_BCM1480_MC_EMODE(x) _SB_GETVALUE(x,S_BCM1480_MC_EMODE,M_BCM1480_MC_EMODE)
395#define V_BCM1480_MC_EMODE_DEFAULT V_BCM1480_MC_EMODE(0)
396
397#define S_BCM1480_MC_MODE 16
398#define M_BCM1480_MC_MODE _SB_MAKEMASK(15,S_BCM1480_MC_MODE)
399#define V_BCM1480_MC_MODE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_MODE)
400#define G_BCM1480_MC_MODE(x) _SB_GETVALUE(x,S_BCM1480_MC_MODE,M_BCM1480_MC_MODE)
401#define V_BCM1480_MC_MODE_DEFAULT V_BCM1480_MC_MODE(0)
402
403#define S_BCM1480_MC_DRAM_TYPE 32
404#define M_BCM1480_MC_DRAM_TYPE _SB_MAKEMASK(4,S_BCM1480_MC_DRAM_TYPE)
405#define V_BCM1480_MC_DRAM_TYPE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DRAM_TYPE)
406#define G_BCM1480_MC_DRAM_TYPE(x) _SB_GETVALUE(x,S_BCM1480_MC_DRAM_TYPE,M_BCM1480_MC_DRAM_TYPE)
407
408#define K_BCM1480_MC_DRAM_TYPE_JEDEC 0
409#define K_BCM1480_MC_DRAM_TYPE_FCRAM 1
410
411#if SIBYTE_HDR_FEATURE(1480, PASS2)
412#define K_BCM1480_MC_DRAM_TYPE_DDR2 2
413#endif
414
415#define V_BCM1480_MC_DRAM_TYPE_JEDEC V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_JEDEC)
416#define V_BCM1480_MC_DRAM_TYPE_FCRAM V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_FCRAM)
417
418#if SIBYTE_HDR_FEATURE(1480, PASS2)
419#define V_BCM1480_MC_DRAM_TYPE_DDR2 V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_DDR2)
420#endif
421
422#define M_BCM1480_MC_GANGED _SB_MAKEMASK1(36)
423#define M_BCM1480_MC_BY9_INTF _SB_MAKEMASK1(37)
424#define M_BCM1480_MC_FORCE_ECC64 _SB_MAKEMASK1(38)
425#define M_BCM1480_MC_ECC_DISABLE _SB_MAKEMASK1(39)
426
427#define S_BCM1480_MC_PG_POLICY 40
428#define M_BCM1480_MC_PG_POLICY _SB_MAKEMASK(2,S_BCM1480_MC_PG_POLICY)
429#define V_BCM1480_MC_PG_POLICY(x) _SB_MAKEVALUE(x,S_BCM1480_MC_PG_POLICY)
430#define G_BCM1480_MC_PG_POLICY(x) _SB_GETVALUE(x,S_BCM1480_MC_PG_POLICY,M_BCM1480_MC_PG_POLICY)
431
432#define K_BCM1480_MC_PG_POLICY_CLOSED 0
433#define K_BCM1480_MC_PG_POLICY_CAS_TIME_CHK 1
434
435#define V_BCM1480_MC_PG_POLICY_CLOSED V_BCM1480_MC_PG_POLICY(K_BCM1480_MC_PG_POLICY_CLOSED)
436#define V_BCM1480_MC_PG_POLICY_CAS_TIME_CHK V_BCM1480_MC_PG_POLICY(K_BCM1480_MC_PG_POLICY_CAS_TIME_CHK)
437
438#if SIBYTE_HDR_FEATURE(1480, PASS2)
439#define M_BCM1480_MC_2T_CMD _SB_MAKEMASK1(42)
440#define M_BCM1480_MC_ECC_COR_DIS _SB_MAKEMASK1(43)
441#endif
442
443#define V_BCM1480_MC_DRAMMODE_DEFAULT V_BCM1480_MC_EMODE_DEFAULT | V_BCM1480_MC_MODE_DEFAULT | V_BCM1480_MC_DRAM_TYPE_JEDEC | \
444 V_BCM1480_MC_PG_POLICY(K_BCM1480_MC_PG_POLICY_CAS_TIME_CHK)
445
446/*
447 * Memory Clock Configuration Register (Table 92)
448 */
449
450#define S_BCM1480_MC_CLK_RATIO 0
451#define M_BCM1480_MC_CLK_RATIO _SB_MAKEMASK(6,S_BCM1480_MC_CLK_RATIO)
452#define V_BCM1480_MC_CLK_RATIO(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CLK_RATIO)
453#define G_BCM1480_MC_CLK_RATIO(x) _SB_GETVALUE(x,S_BCM1480_MC_CLK_RATIO,M_BCM1480_MC_CLK_RATIO)
454
455#define V_BCM1480_MC_CLK_RATIO_DEFAULT V_BCM1480_MC_CLK_RATIO(10)
456
457#define S_BCM1480_MC_REF_RATE 8
458#define M_BCM1480_MC_REF_RATE _SB_MAKEMASK(8,S_BCM1480_MC_REF_RATE)
459#define V_BCM1480_MC_REF_RATE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_REF_RATE)
460#define G_BCM1480_MC_REF_RATE(x) _SB_GETVALUE(x,S_BCM1480_MC_REF_RATE,M_BCM1480_MC_REF_RATE)
461
462#define K_BCM1480_MC_REF_RATE_100MHz 0x31
463#define K_BCM1480_MC_REF_RATE_200MHz 0x62
464#define K_BCM1480_MC_REF_RATE_400MHz 0xC4
465
466#define V_BCM1480_MC_REF_RATE_100MHz V_BCM1480_MC_REF_RATE(K_BCM1480_MC_REF_RATE_100MHz)
467#define V_BCM1480_MC_REF_RATE_200MHz V_BCM1480_MC_REF_RATE(K_BCM1480_MC_REF_RATE_200MHz)
468#define V_BCM1480_MC_REF_RATE_400MHz V_BCM1480_MC_REF_RATE(K_BCM1480_MC_REF_RATE_400MHz)
469#define V_BCM1480_MC_REF_RATE_DEFAULT V_BCM1480_MC_REF_RATE_400MHz
470
471#if SIBYTE_HDR_FEATURE(1480, PASS2)
472#define M_BCM1480_MC_AUTO_REF_DIS _SB_MAKEMASK1(16)
473#endif
474
475/*
476 * ODT Register (Table 99)
477 */
478
479#if SIBYTE_HDR_FEATURE(1480, PASS2)
480#define M_BCM1480_MC_RD_ODT0_CS0 _SB_MAKEMASK1(0)
481#define M_BCM1480_MC_RD_ODT0_CS2 _SB_MAKEMASK1(1)
482#define M_BCM1480_MC_RD_ODT0_CS4 _SB_MAKEMASK1(2)
483#define M_BCM1480_MC_RD_ODT0_CS6 _SB_MAKEMASK1(3)
484#define M_BCM1480_MC_WR_ODT0_CS0 _SB_MAKEMASK1(4)
485#define M_BCM1480_MC_WR_ODT0_CS2 _SB_MAKEMASK1(5)
486#define M_BCM1480_MC_WR_ODT0_CS4 _SB_MAKEMASK1(6)
487#define M_BCM1480_MC_WR_ODT0_CS6 _SB_MAKEMASK1(7)
488#define M_BCM1480_MC_RD_ODT2_CS0 _SB_MAKEMASK1(8)
489#define M_BCM1480_MC_RD_ODT2_CS2 _SB_MAKEMASK1(9)
490#define M_BCM1480_MC_RD_ODT2_CS4 _SB_MAKEMASK1(10)
491#define M_BCM1480_MC_RD_ODT2_CS6 _SB_MAKEMASK1(11)
492#define M_BCM1480_MC_WR_ODT2_CS0 _SB_MAKEMASK1(12)
493#define M_BCM1480_MC_WR_ODT2_CS2 _SB_MAKEMASK1(13)
494#define M_BCM1480_MC_WR_ODT2_CS4 _SB_MAKEMASK1(14)
495#define M_BCM1480_MC_WR_ODT2_CS6 _SB_MAKEMASK1(15)
496#define M_BCM1480_MC_RD_ODT4_CS0 _SB_MAKEMASK1(16)
497#define M_BCM1480_MC_RD_ODT4_CS2 _SB_MAKEMASK1(17)
498#define M_BCM1480_MC_RD_ODT4_CS4 _SB_MAKEMASK1(18)
499#define M_BCM1480_MC_RD_ODT4_CS6 _SB_MAKEMASK1(19)
500#define M_BCM1480_MC_WR_ODT4_CS0 _SB_MAKEMASK1(20)
501#define M_BCM1480_MC_WR_ODT4_CS2 _SB_MAKEMASK1(21)
502#define M_BCM1480_MC_WR_ODT4_CS4 _SB_MAKEMASK1(22)
503#define M_BCM1480_MC_WR_ODT4_CS6 _SB_MAKEMASK1(23)
504#define M_BCM1480_MC_RD_ODT6_CS0 _SB_MAKEMASK1(24)
505#define M_BCM1480_MC_RD_ODT6_CS2 _SB_MAKEMASK1(25)
506#define M_BCM1480_MC_RD_ODT6_CS4 _SB_MAKEMASK1(26)
507#define M_BCM1480_MC_RD_ODT6_CS6 _SB_MAKEMASK1(27)
508#define M_BCM1480_MC_WR_ODT6_CS0 _SB_MAKEMASK1(28)
509#define M_BCM1480_MC_WR_ODT6_CS2 _SB_MAKEMASK1(29)
510#define M_BCM1480_MC_WR_ODT6_CS4 _SB_MAKEMASK1(30)
511#define M_BCM1480_MC_WR_ODT6_CS6 _SB_MAKEMASK1(31)
512
513#define M_BCM1480_MC_CS_ODD_ODT_EN _SB_MAKEMASK1(32)
514#endif
515
516/*
517 * Memory DLL Configuration Register (Table 93)
518 */
519
520#define S_BCM1480_MC_ADDR_COARSE_ADJ 0
521#define M_BCM1480_MC_ADDR_COARSE_ADJ _SB_MAKEMASK(6,S_BCM1480_MC_ADDR_COARSE_ADJ)
522#define V_BCM1480_MC_ADDR_COARSE_ADJ(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ADDR_COARSE_ADJ)
523#define G_BCM1480_MC_ADDR_COARSE_ADJ(x) _SB_GETVALUE(x,S_BCM1480_MC_ADDR_COARSE_ADJ,M_BCM1480_MC_ADDR_COARSE_ADJ)
524#define V_BCM1480_MC_ADDR_COARSE_ADJ_DEFAULT V_BCM1480_MC_ADDR_COARSE_ADJ(0x0)
525
526#if SIBYTE_HDR_FEATURE(1480, PASS2)
527#define S_BCM1480_MC_ADDR_FREQ_RANGE 8
528#define M_BCM1480_MC_ADDR_FREQ_RANGE _SB_MAKEMASK(4,S_BCM1480_MC_ADDR_FREQ_RANGE)
529#define V_BCM1480_MC_ADDR_FREQ_RANGE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ADDR_FREQ_RANGE)
530#define G_BCM1480_MC_ADDR_FREQ_RANGE(x) _SB_GETVALUE(x,S_BCM1480_MC_ADDR_FREQ_RANGE,M_BCM1480_MC_ADDR_FREQ_RANGE)
531#define V_BCM1480_MC_ADDR_FREQ_RANGE_DEFAULT V_BCM1480_MC_ADDR_FREQ_RANGE(0x4)
532#endif
533
534#define S_BCM1480_MC_ADDR_FINE_ADJ 8
535#define M_BCM1480_MC_ADDR_FINE_ADJ _SB_MAKEMASK(4,S_BCM1480_MC_ADDR_FINE_ADJ)
536#define V_BCM1480_MC_ADDR_FINE_ADJ(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ADDR_FINE_ADJ)
537#define G_BCM1480_MC_ADDR_FINE_ADJ(x) _SB_GETVALUE(x,S_BCM1480_MC_ADDR_FINE_ADJ,M_BCM1480_MC_ADDR_FINE_ADJ)
538#define V_BCM1480_MC_ADDR_FINE_ADJ_DEFAULT V_BCM1480_MC_ADDR_FINE_ADJ(0x8)
539
540#define S_BCM1480_MC_DQI_COARSE_ADJ 16
541#define M_BCM1480_MC_DQI_COARSE_ADJ _SB_MAKEMASK(6,S_BCM1480_MC_DQI_COARSE_ADJ)
542#define V_BCM1480_MC_DQI_COARSE_ADJ(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DQI_COARSE_ADJ)
543#define G_BCM1480_MC_DQI_COARSE_ADJ(x) _SB_GETVALUE(x,S_BCM1480_MC_DQI_COARSE_ADJ,M_BCM1480_MC_DQI_COARSE_ADJ)
544#define V_BCM1480_MC_DQI_COARSE_ADJ_DEFAULT V_BCM1480_MC_DQI_COARSE_ADJ(0x0)
545
546#if SIBYTE_HDR_FEATURE(1480, PASS2)
547#define S_BCM1480_MC_DQI_FREQ_RANGE 24
548#define M_BCM1480_MC_DQI_FREQ_RANGE _SB_MAKEMASK(4,S_BCM1480_MC_DQI_FREQ_RANGE)
549#define V_BCM1480_MC_DQI_FREQ_RANGE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DQI_FREQ_RANGE)
550#define G_BCM1480_MC_DQI_FREQ_RANGE(x) _SB_GETVALUE(x,S_BCM1480_MC_DQI_FREQ_RANGE,M_BCM1480_MC_DQI_FREQ_RANGE)
551#define V_BCM1480_MC_DQI_FREQ_RANGE_DEFAULT V_BCM1480_MC_DQI_FREQ_RANGE(0x4)
552#endif
553
554#define S_BCM1480_MC_DQI_FINE_ADJ 24
555#define M_BCM1480_MC_DQI_FINE_ADJ _SB_MAKEMASK(4,S_BCM1480_MC_DQI_FINE_ADJ)
556#define V_BCM1480_MC_DQI_FINE_ADJ(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DQI_FINE_ADJ)
557#define G_BCM1480_MC_DQI_FINE_ADJ(x) _SB_GETVALUE(x,S_BCM1480_MC_DQI_FINE_ADJ,M_BCM1480_MC_DQI_FINE_ADJ)
558#define V_BCM1480_MC_DQI_FINE_ADJ_DEFAULT V_BCM1480_MC_DQI_FINE_ADJ(0x8)
559
560#define S_BCM1480_MC_DQO_COARSE_ADJ 32
561#define M_BCM1480_MC_DQO_COARSE_ADJ _SB_MAKEMASK(6,S_BCM1480_MC_DQO_COARSE_ADJ)
562#define V_BCM1480_MC_DQO_COARSE_ADJ(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DQO_COARSE_ADJ)
563#define G_BCM1480_MC_DQO_COARSE_ADJ(x) _SB_GETVALUE(x,S_BCM1480_MC_DQO_COARSE_ADJ,M_BCM1480_MC_DQO_COARSE_ADJ)
564#define V_BCM1480_MC_DQO_COARSE_ADJ_DEFAULT V_BCM1480_MC_DQO_COARSE_ADJ(0x0)
565
566#if SIBYTE_HDR_FEATURE(1480, PASS2)
567#define S_BCM1480_MC_DQO_FREQ_RANGE 40
568#define M_BCM1480_MC_DQO_FREQ_RANGE _SB_MAKEMASK(4,S_BCM1480_MC_DQO_FREQ_RANGE)
569#define V_BCM1480_MC_DQO_FREQ_RANGE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DQO_FREQ_RANGE)
570#define G_BCM1480_MC_DQO_FREQ_RANGE(x) _SB_GETVALUE(x,S_BCM1480_MC_DQO_FREQ_RANGE,M_BCM1480_MC_DQO_FREQ_RANGE)
571#define V_BCM1480_MC_DQO_FREQ_RANGE_DEFAULT V_BCM1480_MC_DQO_FREQ_RANGE(0x4)
572#endif
573
574#define S_BCM1480_MC_DQO_FINE_ADJ 40
575#define M_BCM1480_MC_DQO_FINE_ADJ _SB_MAKEMASK(4,S_BCM1480_MC_DQO_FINE_ADJ)
576#define V_BCM1480_MC_DQO_FINE_ADJ(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DQO_FINE_ADJ)
577#define G_BCM1480_MC_DQO_FINE_ADJ(x) _SB_GETVALUE(x,S_BCM1480_MC_DQO_FINE_ADJ,M_BCM1480_MC_DQO_FINE_ADJ)
578#define V_BCM1480_MC_DQO_FINE_ADJ_DEFAULT V_BCM1480_MC_DQO_FINE_ADJ(0x8)
579
580#if SIBYTE_HDR_FEATURE(1480, PASS2)
581#define S_BCM1480_MC_DLL_PDSEL 44
582#define M_BCM1480_MC_DLL_PDSEL _SB_MAKEMASK(2,S_BCM1480_MC_DLL_PDSEL)
583#define V_BCM1480_MC_DLL_PDSEL(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DLL_PDSEL)
584#define G_BCM1480_MC_DLL_PDSEL(x) _SB_GETVALUE(x,S_BCM1480_MC_DLL_PDSEL,M_BCM1480_MC_DLL_PDSEL)
585#define V_BCM1480_MC_DLL_DEFAULT_PDSEL V_BCM1480_MC_DLL_PDSEL(0x0)
586
587#define M_BCM1480_MC_DLL_REGBYPASS _SB_MAKEMASK1(46)
588#define M_BCM1480_MC_DQO_SHIFT _SB_MAKEMASK1(47)
589#endif
590
591#define S_BCM1480_MC_DLL_DEFAULT 48
592#define M_BCM1480_MC_DLL_DEFAULT _SB_MAKEMASK(6,S_BCM1480_MC_DLL_DEFAULT)
593#define V_BCM1480_MC_DLL_DEFAULT(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DLL_DEFAULT)
594#define G_BCM1480_MC_DLL_DEFAULT(x) _SB_GETVALUE(x,S_BCM1480_MC_DLL_DEFAULT,M_BCM1480_MC_DLL_DEFAULT)
595#define V_BCM1480_MC_DLL_DEFAULT_DEFAULT V_BCM1480_MC_DLL_DEFAULT(0x10)
596
597#if SIBYTE_HDR_FEATURE(1480, PASS2)
598#define S_BCM1480_MC_DLL_REGCTRL 54
599#define M_BCM1480_MC_DLL_REGCTRL _SB_MAKEMASK(2,S_BCM1480_MC_DLL_REGCTRL)
600#define V_BCM1480_MC_DLL_REGCTRL(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DLL_REGCTRL)
601#define G_BCM1480_MC_DLL_REGCTRL(x) _SB_GETVALUE(x,S_BCM1480_MC_DLL_REGCTRL,M_BCM1480_MC_DLL_REGCTRL)
602#define V_BCM1480_MC_DLL_DEFAULT_REGCTRL V_BCM1480_MC_DLL_REGCTRL(0x0)
603#endif
604
605#if SIBYTE_HDR_FEATURE(1480, PASS2)
606#define S_BCM1480_MC_DLL_FREQ_RANGE 56
607#define M_BCM1480_MC_DLL_FREQ_RANGE _SB_MAKEMASK(4,S_BCM1480_MC_DLL_FREQ_RANGE)
608#define V_BCM1480_MC_DLL_FREQ_RANGE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DLL_FREQ_RANGE)
609#define G_BCM1480_MC_DLL_FREQ_RANGE(x) _SB_GETVALUE(x,S_BCM1480_MC_DLL_FREQ_RANGE,M_BCM1480_MC_DLL_FREQ_RANGE)
610#define V_BCM1480_MC_DLL_FREQ_RANGE_DEFAULT V_BCM1480_MC_DLL_FREQ_RANGE(0x4)
611#endif
612
613#define S_BCM1480_MC_DLL_STEP_SIZE 56
614#define M_BCM1480_MC_DLL_STEP_SIZE _SB_MAKEMASK(4,S_BCM1480_MC_DLL_STEP_SIZE)
615#define V_BCM1480_MC_DLL_STEP_SIZE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DLL_STEP_SIZE)
616#define G_BCM1480_MC_DLL_STEP_SIZE(x) _SB_GETVALUE(x,S_BCM1480_MC_DLL_STEP_SIZE,M_BCM1480_MC_DLL_STEP_SIZE)
617#define V_BCM1480_MC_DLL_STEP_SIZE_DEFAULT V_BCM1480_MC_DLL_STEP_SIZE(0x8)
618
619#if SIBYTE_HDR_FEATURE(1480, PASS2)
620#define S_BCM1480_MC_DLL_BGCTRL 60
621#define M_BCM1480_MC_DLL_BGCTRL _SB_MAKEMASK(2,S_BCM1480_MC_DLL_BGCTRL)
622#define V_BCM1480_MC_DLL_BGCTRL(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DLL_BGCTRL)
623#define G_BCM1480_MC_DLL_BGCTRL(x) _SB_GETVALUE(x,S_BCM1480_MC_DLL_BGCTRL,M_BCM1480_MC_DLL_BGCTRL)
624#define V_BCM1480_MC_DLL_DEFAULT_BGCTRL V_BCM1480_MC_DLL_BGCTRL(0x0)
625#endif
626
627#define M_BCM1480_MC_DLL_BYPASS _SB_MAKEMASK1(63)
628
629/*
630 * Memory Drive Configuration Register (Table 94)
631 */
632
633#define S_BCM1480_MC_RTT_BYP_PULLDOWN 0
634#define M_BCM1480_MC_RTT_BYP_PULLDOWN _SB_MAKEMASK(3,S_BCM1480_MC_RTT_BYP_PULLDOWN)
635#define V_BCM1480_MC_RTT_BYP_PULLDOWN(x) _SB_MAKEVALUE(x,S_BCM1480_MC_RTT_BYP_PULLDOWN)
636#define G_BCM1480_MC_RTT_BYP_PULLDOWN(x) _SB_GETVALUE(x,S_BCM1480_MC_RTT_BYP_PULLDOWN,M_BCM1480_MC_RTT_BYP_PULLDOWN)
637
638#define S_BCM1480_MC_RTT_BYP_PULLUP 6
639#define M_BCM1480_MC_RTT_BYP_PULLUP _SB_MAKEMASK(3,S_BCM1480_MC_RTT_BYP_PULLUP)
640#define V_BCM1480_MC_RTT_BYP_PULLUP(x) _SB_MAKEVALUE(x,S_BCM1480_MC_RTT_BYP_PULLUP)
641#define G_BCM1480_MC_RTT_BYP_PULLUP(x) _SB_GETVALUE(x,S_BCM1480_MC_RTT_BYP_PULLUP,M_BCM1480_MC_RTT_BYP_PULLUP)
642
643#define M_BCM1480_MC_RTT_BYPASS _SB_MAKEMASK1(8)
644#define M_BCM1480_MC_RTT_COMP_MOV_AVG _SB_MAKEMASK1(9)
645
646#define S_BCM1480_MC_PVT_BYP_C1_PULLDOWN 10
647#define M_BCM1480_MC_PVT_BYP_C1_PULLDOWN _SB_MAKEMASK(4,S_BCM1480_MC_PVT_BYP_C1_PULLDOWN)
648#define V_BCM1480_MC_PVT_BYP_C1_PULLDOWN(x) _SB_MAKEVALUE(x,S_BCM1480_MC_PVT_BYP_C1_PULLDOWN)
649#define G_BCM1480_MC_PVT_BYP_C1_PULLDOWN(x) _SB_GETVALUE(x,S_BCM1480_MC_PVT_BYP_C1_PULLDOWN,M_BCM1480_MC_PVT_BYP_C1_PULLDOWN)
650
651#define S_BCM1480_MC_PVT_BYP_C1_PULLUP 15
652#define M_BCM1480_MC_PVT_BYP_C1_PULLUP _SB_MAKEMASK(4,S_BCM1480_MC_PVT_BYP_C1_PULLUP)
653#define V_BCM1480_MC_PVT_BYP_C1_PULLUP(x) _SB_MAKEVALUE(x,S_BCM1480_MC_PVT_BYP_C1_PULLUP)
654#define G_BCM1480_MC_PVT_BYP_C1_PULLUP(x) _SB_GETVALUE(x,S_BCM1480_MC_PVT_BYP_C1_PULLUP,M_BCM1480_MC_PVT_BYP_C1_PULLUP)
655
656#define S_BCM1480_MC_PVT_BYP_C2_PULLDOWN 20
657#define M_BCM1480_MC_PVT_BYP_C2_PULLDOWN _SB_MAKEMASK(4,S_BCM1480_MC_PVT_BYP_C2_PULLDOWN)
658#define V_BCM1480_MC_PVT_BYP_C2_PULLDOWN(x) _SB_MAKEVALUE(x,S_BCM1480_MC_PVT_BYP_C2_PULLDOWN)
659#define G_BCM1480_MC_PVT_BYP_C2_PULLDOWN(x) _SB_GETVALUE(x,S_BCM1480_MC_PVT_BYP_C2_PULLDOWN,M_BCM1480_MC_PVT_BYP_C2_PULLDOWN)
660
661#define S_BCM1480_MC_PVT_BYP_C2_PULLUP 25
662#define M_BCM1480_MC_PVT_BYP_C2_PULLUP _SB_MAKEMASK(4,S_BCM1480_MC_PVT_BYP_C2_PULLUP)
663#define V_BCM1480_MC_PVT_BYP_C2_PULLUP(x) _SB_MAKEVALUE(x,S_BCM1480_MC_PVT_BYP_C2_PULLUP)
664#define G_BCM1480_MC_PVT_BYP_C2_PULLUP(x) _SB_GETVALUE(x,S_BCM1480_MC_PVT_BYP_C2_PULLUP,M_BCM1480_MC_PVT_BYP_C2_PULLUP)
665
666#define M_BCM1480_MC_PVT_BYPASS _SB_MAKEMASK1(30)
667#define M_BCM1480_MC_PVT_COMP_MOV_AVG _SB_MAKEMASK1(31)
668
669#define M_BCM1480_MC_CLK_CLASS _SB_MAKEMASK1(34)
670#define M_BCM1480_MC_DATA_CLASS _SB_MAKEMASK1(35)
671#define M_BCM1480_MC_ADDR_CLASS _SB_MAKEMASK1(36)
672
673#define M_BCM1480_MC_DQ_ODT_75 _SB_MAKEMASK1(37)
674#define M_BCM1480_MC_DQ_ODT_150 _SB_MAKEMASK1(38)
675#define M_BCM1480_MC_DQS_ODT_75 _SB_MAKEMASK1(39)
676#define M_BCM1480_MC_DQS_ODT_150 _SB_MAKEMASK1(40)
677#define M_BCM1480_MC_DQS_DIFF _SB_MAKEMASK1(41)
678
679/*
680 * ECC Test Data Register (Table 95)
681 */
682
683#define S_BCM1480_MC_DATA_INVERT 0
684#define M_DATA_ECC_INVERT _SB_MAKEMASK(64,S_BCM1480_MC_ECC_INVERT)
685
686/*
687 * ECC Test ECC Register (Table 96)
688 */
689
690#define S_BCM1480_MC_ECC_INVERT 0
691#define M_BCM1480_MC_ECC_INVERT _SB_MAKEMASK(8,S_BCM1480_MC_ECC_INVERT)
692
693/*
694 * SDRAM Timing Register (Table 97)
695 */
696
697#define S_BCM1480_MC_tRCD 0
698#define M_BCM1480_MC_tRCD _SB_MAKEMASK(4,S_BCM1480_MC_tRCD)
699#define V_BCM1480_MC_tRCD(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRCD)
700#define G_BCM1480_MC_tRCD(x) _SB_GETVALUE(x,S_BCM1480_MC_tRCD,M_BCM1480_MC_tRCD)
701#define K_BCM1480_MC_tRCD_DEFAULT 3
702#define V_BCM1480_MC_tRCD_DEFAULT V_BCM1480_MC_tRCD(K_BCM1480_MC_tRCD_DEFAULT)
703
704#define S_BCM1480_MC_tCL 4
705#define M_BCM1480_MC_tCL _SB_MAKEMASK(4,S_BCM1480_MC_tCL)
706#define V_BCM1480_MC_tCL(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tCL)
707#define G_BCM1480_MC_tCL(x) _SB_GETVALUE(x,S_BCM1480_MC_tCL,M_BCM1480_MC_tCL)
708#define K_BCM1480_MC_tCL_DEFAULT 2
709#define V_BCM1480_MC_tCL_DEFAULT V_BCM1480_MC_tCL(K_BCM1480_MC_tCL_DEFAULT)
710
711#define M_BCM1480_MC_tCrDh _SB_MAKEMASK1(8)
712
713#define S_BCM1480_MC_tWR 9
714#define M_BCM1480_MC_tWR _SB_MAKEMASK(3,S_BCM1480_MC_tWR)
715#define V_BCM1480_MC_tWR(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tWR)
716#define G_BCM1480_MC_tWR(x) _SB_GETVALUE(x,S_BCM1480_MC_tWR,M_BCM1480_MC_tWR)
717#define K_BCM1480_MC_tWR_DEFAULT 2
718#define V_BCM1480_MC_tWR_DEFAULT V_BCM1480_MC_tWR(K_BCM1480_MC_tWR_DEFAULT)
719
720#define S_BCM1480_MC_tCwD 12
721#define M_BCM1480_MC_tCwD _SB_MAKEMASK(4,S_BCM1480_MC_tCwD)
722#define V_BCM1480_MC_tCwD(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tCwD)
723#define G_BCM1480_MC_tCwD(x) _SB_GETVALUE(x,S_BCM1480_MC_tCwD,M_BCM1480_MC_tCwD)
724#define K_BCM1480_MC_tCwD_DEFAULT 1
725#define V_BCM1480_MC_tCwD_DEFAULT V_BCM1480_MC_tCwD(K_BCM1480_MC_tCwD_DEFAULT)
726
727#define S_BCM1480_MC_tRP 16
728#define M_BCM1480_MC_tRP _SB_MAKEMASK(4,S_BCM1480_MC_tRP)
729#define V_BCM1480_MC_tRP(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRP)
730#define G_BCM1480_MC_tRP(x) _SB_GETVALUE(x,S_BCM1480_MC_tRP,M_BCM1480_MC_tRP)
731#define K_BCM1480_MC_tRP_DEFAULT 4
732#define V_BCM1480_MC_tRP_DEFAULT V_BCM1480_MC_tRP(K_BCM1480_MC_tRP_DEFAULT)
733
734#define S_BCM1480_MC_tRRD 20
735#define M_BCM1480_MC_tRRD _SB_MAKEMASK(4,S_BCM1480_MC_tRRD)
736#define V_BCM1480_MC_tRRD(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRRD)
737#define G_BCM1480_MC_tRRD(x) _SB_GETVALUE(x,S_BCM1480_MC_tRRD,M_BCM1480_MC_tRRD)
738#define K_BCM1480_MC_tRRD_DEFAULT 2
739#define V_BCM1480_MC_tRRD_DEFAULT V_BCM1480_MC_tRRD(K_BCM1480_MC_tRRD_DEFAULT)
740
741#define S_BCM1480_MC_tRCw 24
742#define M_BCM1480_MC_tRCw _SB_MAKEMASK(5,S_BCM1480_MC_tRCw)
743#define V_BCM1480_MC_tRCw(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRCw)
744#define G_BCM1480_MC_tRCw(x) _SB_GETVALUE(x,S_BCM1480_MC_tRCw,M_BCM1480_MC_tRCw)
745#define K_BCM1480_MC_tRCw_DEFAULT 10
746#define V_BCM1480_MC_tRCw_DEFAULT V_BCM1480_MC_tRCw(K_BCM1480_MC_tRCw_DEFAULT)
747
748#define S_BCM1480_MC_tRCr 32
749#define M_BCM1480_MC_tRCr _SB_MAKEMASK(5,S_BCM1480_MC_tRCr)
750#define V_BCM1480_MC_tRCr(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRCr)
751#define G_BCM1480_MC_tRCr(x) _SB_GETVALUE(x,S_BCM1480_MC_tRCr,M_BCM1480_MC_tRCr)
752#define K_BCM1480_MC_tRCr_DEFAULT 9
753#define V_BCM1480_MC_tRCr_DEFAULT V_BCM1480_MC_tRCr(K_BCM1480_MC_tRCr_DEFAULT)
754
755#if SIBYTE_HDR_FEATURE(1480, PASS2)
756#define S_BCM1480_MC_tFAW 40
757#define M_BCM1480_MC_tFAW _SB_MAKEMASK(6,S_BCM1480_MC_tFAW)
758#define V_BCM1480_MC_tFAW(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tFAW)
759#define G_BCM1480_MC_tFAW(x) _SB_GETVALUE(x,S_BCM1480_MC_tFAW,M_BCM1480_MC_tFAW)
760#define K_BCM1480_MC_tFAW_DEFAULT 0
761#define V_BCM1480_MC_tFAW_DEFAULT V_BCM1480_MC_tFAW(K_BCM1480_MC_tFAW_DEFAULT)
762#endif
763
764#define S_BCM1480_MC_tRFC 48
765#define M_BCM1480_MC_tRFC _SB_MAKEMASK(7,S_BCM1480_MC_tRFC)
766#define V_BCM1480_MC_tRFC(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRFC)
767#define G_BCM1480_MC_tRFC(x) _SB_GETVALUE(x,S_BCM1480_MC_tRFC,M_BCM1480_MC_tRFC)
768#define K_BCM1480_MC_tRFC_DEFAULT 12
769#define V_BCM1480_MC_tRFC_DEFAULT V_BCM1480_MC_tRFC(K_BCM1480_MC_tRFC_DEFAULT)
770
771#define S_BCM1480_MC_tFIFO 56
772#define M_BCM1480_MC_tFIFO _SB_MAKEMASK(2,S_BCM1480_MC_tFIFO)
773#define V_BCM1480_MC_tFIFO(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tFIFO)
774#define G_BCM1480_MC_tFIFO(x) _SB_GETVALUE(x,S_BCM1480_MC_tFIFO,M_BCM1480_MC_tFIFO)
775#define K_BCM1480_MC_tFIFO_DEFAULT 0
776#define V_BCM1480_MC_tFIFO_DEFAULT V_BCM1480_MC_tFIFO(K_BCM1480_MC_tFIFO_DEFAULT)
777
778#define S_BCM1480_MC_tW2R 58
779#define M_BCM1480_MC_tW2R _SB_MAKEMASK(2,S_BCM1480_MC_tW2R)
780#define V_BCM1480_MC_tW2R(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tW2R)
781#define G_BCM1480_MC_tW2R(x) _SB_GETVALUE(x,S_BCM1480_MC_tW2R,M_BCM1480_MC_tW2R)
782#define K_BCM1480_MC_tW2R_DEFAULT 1
783#define V_BCM1480_MC_tW2R_DEFAULT V_BCM1480_MC_tW2R(K_BCM1480_MC_tW2R_DEFAULT)
784
785#define S_BCM1480_MC_tR2W 60
786#define M_BCM1480_MC_tR2W _SB_MAKEMASK(2,S_BCM1480_MC_tR2W)
787#define V_BCM1480_MC_tR2W(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tR2W)
788#define G_BCM1480_MC_tR2W(x) _SB_GETVALUE(x,S_BCM1480_MC_tR2W,M_BCM1480_MC_tR2W)
789#define K_BCM1480_MC_tR2W_DEFAULT 0
790#define V_BCM1480_MC_tR2W_DEFAULT V_BCM1480_MC_tR2W(K_BCM1480_MC_tR2W_DEFAULT)
791
792#define M_BCM1480_MC_tR2R _SB_MAKEMASK1(62)
793
794#define V_BCM1480_MC_TIMING_DEFAULT (M_BCM1480_MC_tR2R | \
795 V_BCM1480_MC_tFIFO_DEFAULT | \
796 V_BCM1480_MC_tR2W_DEFAULT | \
797 V_BCM1480_MC_tW2R_DEFAULT | \
798 V_BCM1480_MC_tRFC_DEFAULT | \
799 V_BCM1480_MC_tRCr_DEFAULT | \
800 V_BCM1480_MC_tRCw_DEFAULT | \
801 V_BCM1480_MC_tRRD_DEFAULT | \
802 V_BCM1480_MC_tRP_DEFAULT | \
803 V_BCM1480_MC_tCwD_DEFAULT | \
804 V_BCM1480_MC_tWR_DEFAULT | \
805 M_BCM1480_MC_tCrDh | \
806 V_BCM1480_MC_tCL_DEFAULT | \
807 V_BCM1480_MC_tRCD_DEFAULT)
808
809/*
810 * SDRAM Timing Register 2
811 */
812
813#if SIBYTE_HDR_FEATURE(1480, PASS2)
814
815#define S_BCM1480_MC_tAL 0
816#define M_BCM1480_MC_tAL _SB_MAKEMASK(4,S_BCM1480_MC_tAL)
817#define V_BCM1480_MC_tAL(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tAL)
818#define G_BCM1480_MC_tAL(x) _SB_GETVALUE(x,S_BCM1480_MC_tAL,M_BCM1480_MC_tAL)
819#define K_BCM1480_MC_tAL_DEFAULT 0
820#define V_BCM1480_MC_tAL_DEFAULT V_BCM1480_MC_tAL(K_BCM1480_MC_tAL_DEFAULT)
821
822#define S_BCM1480_MC_tRTP 4
823#define M_BCM1480_MC_tRTP _SB_MAKEMASK(3,S_BCM1480_MC_tRTP)
824#define V_BCM1480_MC_tRTP(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRTP)
825#define G_BCM1480_MC_tRTP(x) _SB_GETVALUE(x,S_BCM1480_MC_tRTP,M_BCM1480_MC_tRTP)
826#define K_BCM1480_MC_tRTP_DEFAULT 2
827#define V_BCM1480_MC_tRTP_DEFAULT V_BCM1480_MC_tRTP(K_BCM1480_MC_tRTP_DEFAULT)
828
829#define S_BCM1480_MC_tW2W 8
830#define M_BCM1480_MC_tW2W _SB_MAKEMASK(2,S_BCM1480_MC_tW2W)
831#define V_BCM1480_MC_tW2W(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tW2W)
832#define G_BCM1480_MC_tW2W(x) _SB_GETVALUE(x,S_BCM1480_MC_tW2W,M_BCM1480_MC_tW2W)
833#define K_BCM1480_MC_tW2W_DEFAULT 0
834#define V_BCM1480_MC_tW2W_DEFAULT V_BCM1480_MC_tW2W(K_BCM1480_MC_tW2W_DEFAULT)
835
836#define S_BCM1480_MC_tRAP 12
837#define M_BCM1480_MC_tRAP _SB_MAKEMASK(4,S_BCM1480_MC_tRAP)
838#define V_BCM1480_MC_tRAP(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRAP)
839#define G_BCM1480_MC_tRAP(x) _SB_GETVALUE(x,S_BCM1480_MC_tRAP,M_BCM1480_MC_tRAP)
840#define K_BCM1480_MC_tRAP_DEFAULT 0
841#define V_BCM1480_MC_tRAP_DEFAULT V_BCM1480_MC_tRAP(K_BCM1480_MC_tRAP_DEFAULT)
842
843#endif
844
845
846
847/*
848 * Global Registers: single instances per BCM1480
849 */
850
851/*
852 * Global Configuration Register (Table 99)
853 */
854
855#define S_BCM1480_MC_BLK_SET_MARK 8
856#define M_BCM1480_MC_BLK_SET_MARK _SB_MAKEMASK(4,S_BCM1480_MC_BLK_SET_MARK)
857#define V_BCM1480_MC_BLK_SET_MARK(x) _SB_MAKEVALUE(x,S_BCM1480_MC_BLK_SET_MARK)
858#define G_BCM1480_MC_BLK_SET_MARK(x) _SB_GETVALUE(x,S_BCM1480_MC_BLK_SET_MARK,M_BCM1480_MC_BLK_SET_MARK)
859
860#define S_BCM1480_MC_BLK_CLR_MARK 12
861#define M_BCM1480_MC_BLK_CLR_MARK _SB_MAKEMASK(4,S_BCM1480_MC_BLK_CLR_MARK)
862#define V_BCM1480_MC_BLK_CLR_MARK(x) _SB_MAKEVALUE(x,S_BCM1480_MC_BLK_CLR_MARK)
863#define G_BCM1480_MC_BLK_CLR_MARK(x) _SB_GETVALUE(x,S_BCM1480_MC_BLK_CLR_MARK,M_BCM1480_MC_BLK_CLR_MARK)
864
865#define M_BCM1480_MC_PKT_PRIORITY _SB_MAKEMASK1(16)
866
867#define S_BCM1480_MC_MAX_AGE 20
868#define M_BCM1480_MC_MAX_AGE _SB_MAKEMASK(4,S_BCM1480_MC_MAX_AGE)
869#define V_BCM1480_MC_MAX_AGE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_MAX_AGE)
870#define G_BCM1480_MC_MAX_AGE(x) _SB_GETVALUE(x,S_BCM1480_MC_MAX_AGE,M_BCM1480_MC_MAX_AGE)
871
872#define M_BCM1480_MC_BERR_DISABLE _SB_MAKEMASK1(29)
873#define M_BCM1480_MC_FORCE_SEQ _SB_MAKEMASK1(30)
874#define M_BCM1480_MC_VGEN _SB_MAKEMASK1(32)
875
876#define S_BCM1480_MC_SLEW 33
877#define M_BCM1480_MC_SLEW _SB_MAKEMASK(2,S_BCM1480_MC_SLEW)
878#define V_BCM1480_MC_SLEW(x) _SB_MAKEVALUE(x,S_BCM1480_MC_SLEW)
879#define G_BCM1480_MC_SLEW(x) _SB_GETVALUE(x,S_BCM1480_MC_SLEW,M_BCM1480_MC_SLEW)
880
881#define M_BCM1480_MC_SSTL_VOLTAGE _SB_MAKEMASK1(35)
882
883/*
884 * Global Channel Interleave Register (Table 100)
885 */
886
887#define S_BCM1480_MC_INTLV0 0
888#define M_BCM1480_MC_INTLV0 _SB_MAKEMASK(6,S_BCM1480_MC_INTLV0)
889#define V_BCM1480_MC_INTLV0(x) _SB_MAKEVALUE(x,S_BCM1480_MC_INTLV0)
890#define G_BCM1480_MC_INTLV0(x) _SB_GETVALUE(x,S_BCM1480_MC_INTLV0,M_BCM1480_MC_INTLV0)
891
892#define S_BCM1480_MC_INTLV1 8
893#define M_BCM1480_MC_INTLV1 _SB_MAKEMASK(6,S_BCM1480_MC_INTLV1)
894#define V_BCM1480_MC_INTLV1(x) _SB_MAKEVALUE(x,S_BCM1480_MC_INTLV1)
895#define G_BCM1480_MC_INTLV1(x) _SB_GETVALUE(x,S_BCM1480_MC_INTLV1,M_BCM1480_MC_INTLV1)
896
897#define S_BCM1480_MC_INTLV_MODE 16
898#define M_BCM1480_MC_INTLV_MODE _SB_MAKEMASK(3,S_BCM1480_MC_INTLV_MODE)
899#define V_BCM1480_MC_INTLV_MODE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_INTLV_MODE)
900#define G_BCM1480_MC_INTLV_MODE(x) _SB_GETVALUE(x,S_BCM1480_MC_INTLV_MODE,M_BCM1480_MC_INTLV_MODE)
901
902#define K_BCM1480_MC_INTLV_MODE_NONE 0x0
903#define K_BCM1480_MC_INTLV_MODE_01 0x1
904#define K_BCM1480_MC_INTLV_MODE_23 0x2
905#define K_BCM1480_MC_INTLV_MODE_01_23 0x3
906#define K_BCM1480_MC_INTLV_MODE_0123 0x4
907
908#define V_BCM1480_MC_INTLV_MODE_NONE V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_NONE)
909#define V_BCM1480_MC_INTLV_MODE_01 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_01)
910#define V_BCM1480_MC_INTLV_MODE_23 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_23)
911#define V_BCM1480_MC_INTLV_MODE_01_23 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_01_23)
912#define V_BCM1480_MC_INTLV_MODE_0123 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_0123)
913
914/*
915 * ECC Status Register
916 */
917
918#define S_BCM1480_MC_ECC_ERR_ADDR 0
919#define M_BCM1480_MC_ECC_ERR_ADDR _SB_MAKEMASK(37,S_BCM1480_MC_ECC_ERR_ADDR)
920#define V_BCM1480_MC_ECC_ERR_ADDR(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ECC_ERR_ADDR)
921#define G_BCM1480_MC_ECC_ERR_ADDR(x) _SB_GETVALUE(x,S_BCM1480_MC_ECC_ERR_ADDR,M_BCM1480_MC_ECC_ERR_ADDR)
922
923#if SIBYTE_HDR_FEATURE(1480, PASS2)
924#define M_BCM1480_MC_ECC_ERR_RMW _SB_MAKEMASK1(60)
925#endif
926
927#define M_BCM1480_MC_ECC_MULT_ERR_DET _SB_MAKEMASK1(61)
928#define M_BCM1480_MC_ECC_UERR_DET _SB_MAKEMASK1(62)
929#define M_BCM1480_MC_ECC_CERR_DET _SB_MAKEMASK1(63)
930
931/*
932 * Global ECC Address Register (Table 102)
933 */
934
935#define S_BCM1480_MC_ECC_CORR_ADDR 0
936#define M_BCM1480_MC_ECC_CORR_ADDR _SB_MAKEMASK(37,S_BCM1480_MC_ECC_CORR_ADDR)
937#define V_BCM1480_MC_ECC_CORR_ADDR(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ECC_CORR_ADDR)
938#define G_BCM1480_MC_ECC_CORR_ADDR(x) _SB_GETVALUE(x,S_BCM1480_MC_ECC_CORR_ADDR,M_BCM1480_MC_ECC_CORR_ADDR)
939
940/*
941 * Global ECC Correction Register (Table 103)
942 */
943
944#define S_BCM1480_MC_ECC_CORRECT 0
945#define M_BCM1480_MC_ECC_CORRECT _SB_MAKEMASK(64,S_BCM1480_MC_ECC_CORRECT)
946#define V_BCM1480_MC_ECC_CORRECT(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ECC_CORRECT)
947#define G_BCM1480_MC_ECC_CORRECT(x) _SB_GETVALUE(x,S_BCM1480_MC_ECC_CORRECT,M_BCM1480_MC_ECC_CORRECT)
948
949/*
950 * Global ECC Performance Counters Control Register (Table 104)
951 */
952
953#define S_BCM1480_MC_CHANNEL_SELECT 0
954#define M_BCM1480_MC_CHANNEL_SELECT _SB_MAKEMASK(4,S_BCM1480_MC_CHANNEL_SELECT)
955#define V_BCM1480_MC_CHANNEL_SELECT(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CHANNEL_SELECT)
956#define G_BCM1480_MC_CHANNEL_SELECT(x) _SB_GETVALUE(x,S_BCM1480_MC_CHANNEL_SELECT,M_BCM1480_MC_CHANNEL_SELECT)
957#define K_BCM1480_MC_CHANNEL_SELECT_0 0x1
958#define K_BCM1480_MC_CHANNEL_SELECT_1 0x2
959#define K_BCM1480_MC_CHANNEL_SELECT_2 0x4
960#define K_BCM1480_MC_CHANNEL_SELECT_3 0x8
961
962#endif /* _BCM1480_MC_H */
diff --git a/include/asm-mips/sibyte/bcm1480_regs.h b/include/asm-mips/sibyte/bcm1480_regs.h
new file mode 100644
index 000000000000..c2dd2fe3047c
--- /dev/null
+++ b/include/asm-mips/sibyte/bcm1480_regs.h
@@ -0,0 +1,869 @@
1/* *********************************************************************
2 * BCM1255/BCM1280/BCM1455/BCM1480 Board Support Package
3 *
4 * Register Definitions File: bcm1480_regs.h
5 *
6 * This module contains the addresses of the on-chip peripherals
7 * on the BCM1280 and BCM1480.
8 *
9 * BCM1480 specification level: 1X55_1X80-UM100-D4 (11/24/03)
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32#ifndef _BCM1480_REGS_H
33#define _BCM1480_REGS_H
34
35#include "sb1250_defs.h"
36
37/* *********************************************************************
38 * Pull in the BCM1250's registers since a great deal of the 1480's
39 * functions are the same as the BCM1250.
40 ********************************************************************* */
41
42#include "sb1250_regs.h"
43
44
45/* *********************************************************************
46 * Some general notes:
47 *
48 * Register addresses are grouped by function and follow the order
49 * of the User Manual.
50 *
51 * For the most part, when there is more than one peripheral
52 * of the same type on the SOC, the constants below will be
53 * offsets from the base of each peripheral. For example,
54 * the MAC registers are described as offsets from the first
55 * MAC register, and there will be a MAC_REGISTER() macro
56 * to calculate the base address of a given MAC.
57 *
58 * The information in this file is based on the BCM1X55/BCM1X80
59 * User Manual, Document 1X55_1X80-UM100-R, 22/12/03.
60 *
61 * This file is basically a "what's new" header file. Since the
62 * BCM1250 and the new BCM1480 (and derivatives) share many common
63 * features, this file contains only what's new or changed from
64 * the 1250. (above, you can see that we include the 1250 symbols
65 * to get the base functionality).
66 *
67 * In software, be sure to use the correct symbols, particularly
68 * for blocks that are different between the two chip families.
69 * All BCM1480-specific symbols have _BCM1480_ in their names,
70 * and all BCM1250-specific and "base" functions that are common in
71 * both chips have no special names (this is for compatibility with
72 * older include files). Therefore, if you're working with the
73 * SCD, which is very different on each chip, A_SCD_xxx implies
74 * the BCM1250 version and A_BCM1480_SCD_xxx implies the BCM1480
75 * version.
76 ********************************************************************* */
77
78
79/* *********************************************************************
80 * Memory Controller Registers (Section 6)
81 ********************************************************************* */
82
83#define A_BCM1480_MC_BASE_0 0x0010050000
84#define A_BCM1480_MC_BASE_1 0x0010051000
85#define A_BCM1480_MC_BASE_2 0x0010052000
86#define A_BCM1480_MC_BASE_3 0x0010053000
87#define BCM1480_MC_REGISTER_SPACING 0x1000
88
89#define A_BCM1480_MC_BASE(ctlid) (A_BCM1480_MC_BASE_0+(ctlid)*BCM1480_MC_REGISTER_SPACING)
90#define A_BCM1480_MC_REGISTER(ctlid,reg) (A_BCM1480_MC_BASE(ctlid)+(reg))
91
92#define R_BCM1480_MC_CONFIG 0x0000000100
93#define R_BCM1480_MC_CS_START 0x0000000120
94#define R_BCM1480_MC_CS_END 0x0000000140
95#define S_BCM1480_MC_CS_STARTEND 24
96
97#define R_BCM1480_MC_CS01_ROW0 0x0000000180
98#define R_BCM1480_MC_CS01_ROW1 0x00000001A0
99#define R_BCM1480_MC_CS23_ROW0 0x0000000200
100#define R_BCM1480_MC_CS23_ROW1 0x0000000220
101#define R_BCM1480_MC_CS01_COL0 0x0000000280
102#define R_BCM1480_MC_CS01_COL1 0x00000002A0
103#define R_BCM1480_MC_CS23_COL0 0x0000000300
104#define R_BCM1480_MC_CS23_COL1 0x0000000320
105
106#define R_BCM1480_MC_CSX_BASE 0x0000000180
107#define R_BCM1480_MC_CSX_ROW0 0x0000000000 /* relative to CSX_BASE */
108#define R_BCM1480_MC_CSX_ROW1 0x0000000020 /* relative to CSX_BASE */
109#define R_BCM1480_MC_CSX_COL0 0x0000000100 /* relative to CSX_BASE */
110#define R_BCM1480_MC_CSX_COL1 0x0000000120 /* relative to CSX_BASE */
111#define BCM1480_MC_CSX_SPACING 0x0000000080 /* CS23 relative to CS01 */
112
113#define R_BCM1480_MC_CS01_BA 0x0000000380
114#define R_BCM1480_MC_CS23_BA 0x00000003A0
115#define R_BCM1480_MC_DRAMCMD 0x0000000400
116#define R_BCM1480_MC_DRAMMODE 0x0000000420
117#define R_BCM1480_MC_CLOCK_CFG 0x0000000440
118#define R_BCM1480_MC_MCLK_CFG R_BCM1480_MC_CLOCK_CFG
119#define R_BCM1480_MC_TEST_DATA 0x0000000480
120#define R_BCM1480_MC_TEST_ECC 0x00000004A0
121#define R_BCM1480_MC_TIMING1 0x00000004C0
122#define R_BCM1480_MC_TIMING2 0x00000004E0
123#define R_BCM1480_MC_DLL_CFG 0x0000000500
124#define R_BCM1480_MC_DRIVE_CFG 0x0000000520
125
126#if SIBYTE_HDR_FEATURE(1480, PASS2)
127#define R_BCM1480_MC_ODT 0x0000000460
128#define R_BCM1480_MC_ECC_STATUS 0x0000000540
129#endif
130
131/* Global registers (single instance) */
132#define A_BCM1480_MC_GLB_CONFIG 0x0010054100
133#define A_BCM1480_MC_GLB_INTLV 0x0010054120
134#define A_BCM1480_MC_GLB_ECC_STATUS 0x0010054140
135#define A_BCM1480_MC_GLB_ECC_ADDR 0x0010054160
136#define A_BCM1480_MC_GLB_ECC_CORRECT 0x0010054180
137#define A_BCM1480_MC_GLB_PERF_CNT_CONTROL 0x00100541A0
138
139/* *********************************************************************
140 * L2 Cache Control Registers (Section 5)
141 ********************************************************************* */
142
143#define A_BCM1480_L2_BASE 0x0010040000
144
145#define A_BCM1480_L2_READ_TAG 0x0010040018
146#define A_BCM1480_L2_ECC_TAG 0x0010040038
147#define A_BCM1480_L2_MISC0_VALUE 0x0010040058
148#define A_BCM1480_L2_MISC1_VALUE 0x0010040078
149#define A_BCM1480_L2_MISC2_VALUE 0x0010040098
150#define A_BCM1480_L2_MISC_CONFIG 0x0010040040 /* x040 */
151#define A_BCM1480_L2_CACHE_DISABLE 0x0010040060 /* x060 */
152#define A_BCM1480_L2_MAKECACHEDISABLE(x) (A_BCM1480_L2_CACHE_DISABLE | (((x)&0xF) << 12))
153#define A_BCM1480_L2_WAY_ENABLE_3_0 0x0010040080 /* x080 */
154#define A_BCM1480_L2_WAY_ENABLE_7_4 0x00100400A0 /* x0A0 */
155#define A_BCM1480_L2_MAKE_WAY_ENABLE_LO(x) (A_BCM1480_L2_WAY_ENABLE_3_0 | (((x)&0xF) << 12))
156#define A_BCM1480_L2_MAKE_WAY_ENABLE_HI(x) (A_BCM1480_L2_WAY_ENABLE_7_4 | (((x)&0xF) << 12))
157#define A_BCM1480_L2_MAKE_WAY_DISABLE_LO(x) (A_BCM1480_L2_WAY_ENABLE_3_0 | (((~x)&0xF) << 12))
158#define A_BCM1480_L2_MAKE_WAY_DISABLE_HI(x) (A_BCM1480_L2_WAY_ENABLE_7_4 | (((~x)&0xF) << 12))
159#define A_BCM1480_L2_WAY_LOCAL_3_0 0x0010040100 /* x100 */
160#define A_BCM1480_L2_WAY_LOCAL_7_4 0x0010040120 /* x120 */
161#define A_BCM1480_L2_WAY_REMOTE_3_0 0x0010040140 /* x140 */
162#define A_BCM1480_L2_WAY_REMOTE_7_4 0x0010040160 /* x160 */
163#define A_BCM1480_L2_WAY_AGENT_3_0 0x00100400C0 /* xxC0 */
164#define A_BCM1480_L2_WAY_AGENT_7_4 0x00100400E0 /* xxE0 */
165#define A_BCM1480_L2_WAY_ENABLE(A, banks) (A | (((~(banks))&0x0F) << 8))
166#define A_BCM1480_L2_BANK_BASE 0x00D0300000
167#define A_BCM1480_L2_BANK_ADDRESS(b) (A_BCM1480_L2_BANK_BASE | (((b)&0x7)<<17))
168#define A_BCM1480_L2_MGMT_TAG_BASE 0x00D0000000
169
170
171/* *********************************************************************
172 * PCI-X Interface Registers (Section 7)
173 ********************************************************************* */
174
175#define A_BCM1480_PCI_BASE 0x0010061400
176
177#define A_BCM1480_PCI_RESET 0x0010061400
178#define A_BCM1480_PCI_DLL 0x0010061500
179
180#define A_BCM1480_PCI_TYPE00_HEADER 0x002E000000
181
182/* *********************************************************************
183 * Ethernet MAC Registers (Section 11) and DMA Registers (Section 10.6)
184 ********************************************************************* */
185
186/* No register changes with Rev.C BCM1250, but one additional MAC */
187
188#define A_BCM1480_MAC_BASE_2 0x0010066000
189
190#ifndef A_MAC_BASE_2
191#define A_MAC_BASE_2 A_BCM1480_MAC_BASE_2
192#endif
193
194#define A_BCM1480_MAC_BASE_3 0x0010067000
195#define A_MAC_BASE_3 A_BCM1480_MAC_BASE_3
196
197#define R_BCM1480_MAC_DMA_OODPKTLOST 0x00000038
198
199#ifndef R_MAC_DMA_OODPKTLOST
200#define R_MAC_DMA_OODPKTLOST R_BCM1480_MAC_DMA_OODPKTLOST
201#endif
202
203
204/* *********************************************************************
205 * DUART Registers (Section 14)
206 ********************************************************************* */
207
208/* No significant differences from BCM1250, two DUARTs */
209
210/* Conventions, per user manual:
211 * DUART generic, channels A,B,C,D
212 * DUART0 implementing channels A,B
213 * DUART1 inplementing channels C,D
214 */
215
216#define BCM1480_DUART_NUM_PORTS 4
217
218#define A_BCM1480_DUART0 0x0010060000
219#define A_BCM1480_DUART1 0x0010060400
220#define A_BCM1480_DUART(chan) ((((chan)&2) == 0)? A_BCM1480_DUART0 : A_BCM1480_DUART1)
221
222#define BCM1480_DUART_CHANREG_SPACING 0x100
223#define A_BCM1480_DUART_CHANREG(chan,reg) (A_BCM1480_DUART(chan) \
224 + BCM1480_DUART_CHANREG_SPACING*((chan)&1) \
225 + (reg))
226#define R_BCM1480_DUART_CHANREG(chan,reg) (BCM1480_DUART_CHANREG_SPACING*((chan)&1) + (reg))
227
228#define R_BCM1480_DUART_IMRREG(chan) (R_DUART_IMR_A + ((chan)&1)*DUART_IMRISR_SPACING)
229#define R_BCM1480_DUART_ISRREG(chan) (R_DUART_ISR_A + ((chan)&1)*DUART_IMRISR_SPACING)
230
231#define A_BCM1480_DUART_IMRREG(chan) (A_BCM1480_DUART(chan) + R_BCM1480_DUART_IMRREG(chan))
232#define A_BCM1480_DUART_ISRREG(chan) (A_BCM1480_DUART(chan) + R_BCM1480_DUART_ISRREG(chan))
233
234/*
235 * These constants are the absolute addresses.
236 */
237
238#define A_BCM1480_DUART_MODE_REG_1_C 0x0010060400
239#define A_BCM1480_DUART_MODE_REG_2_C 0x0010060410
240#define A_BCM1480_DUART_STATUS_C 0x0010060420
241#define A_BCM1480_DUART_CLK_SEL_C 0x0010060430
242#define A_BCM1480_DUART_FULL_CTL_C 0x0010060440
243#define A_BCM1480_DUART_CMD_C 0x0010060450
244#define A_BCM1480_DUART_RX_HOLD_C 0x0010060460
245#define A_BCM1480_DUART_TX_HOLD_C 0x0010060470
246#define A_BCM1480_DUART_OPCR_C 0x0010060480
247#define A_BCM1480_DUART_AUX_CTRL_C 0x0010060490
248
249#define A_BCM1480_DUART_MODE_REG_1_D 0x0010060500
250#define A_BCM1480_DUART_MODE_REG_2_D 0x0010060510
251#define A_BCM1480_DUART_STATUS_D 0x0010060520
252#define A_BCM1480_DUART_CLK_SEL_D 0x0010060530
253#define A_BCM1480_DUART_FULL_CTL_D 0x0010060540
254#define A_BCM1480_DUART_CMD_D 0x0010060550
255#define A_BCM1480_DUART_RX_HOLD_D 0x0010060560
256#define A_BCM1480_DUART_TX_HOLD_D 0x0010060570
257#define A_BCM1480_DUART_OPCR_D 0x0010060580
258#define A_BCM1480_DUART_AUX_CTRL_D 0x0010060590
259
260#define A_BCM1480_DUART_INPORT_CHNG_CD 0x0010060600
261#define A_BCM1480_DUART_AUX_CTRL_CD 0x0010060610
262#define A_BCM1480_DUART_ISR_C 0x0010060620
263#define A_BCM1480_DUART_IMR_C 0x0010060630
264#define A_BCM1480_DUART_ISR_D 0x0010060640
265#define A_BCM1480_DUART_IMR_D 0x0010060650
266#define A_BCM1480_DUART_OUT_PORT_CD 0x0010060660
267#define A_BCM1480_DUART_OPCR_CD 0x0010060670
268#define A_BCM1480_DUART_IN_PORT_CD 0x0010060680
269#define A_BCM1480_DUART_ISR_CD 0x0010060690
270#define A_BCM1480_DUART_IMR_CD 0x00100606A0
271#define A_BCM1480_DUART_SET_OPR_CD 0x00100606B0
272#define A_BCM1480_DUART_CLEAR_OPR_CD 0x00100606C0
273#define A_BCM1480_DUART_INPORT_CHNG_C 0x00100606D0
274#define A_BCM1480_DUART_INPORT_CHNG_D 0x00100606E0
275
276
277/* *********************************************************************
278 * Generic Bus Registers (Section 15) and PCMCIA Registers (Section 16)
279 ********************************************************************* */
280
281#define A_BCM1480_IO_PCMCIA_CFG_B 0x0010061A58
282#define A_BCM1480_IO_PCMCIA_STATUS_B 0x0010061A68
283
284/* *********************************************************************
285 * GPIO Registers (Section 17)
286 ********************************************************************* */
287
288/* One additional GPIO register, placed _before_ the BCM1250's GPIO block base */
289
290#define A_BCM1480_GPIO_INT_ADD_TYPE 0x0010061A78
291#define R_BCM1480_GPIO_INT_ADD_TYPE (-8)
292
293#define A_GPIO_INT_ADD_TYPE A_BCM1480_GPIO_INT_ADD_TYPE
294#define R_GPIO_INT_ADD_TYPE R_BCM1480_GPIO_INT_ADD_TYPE
295
296/* *********************************************************************
297 * SMBus Registers (Section 18)
298 ********************************************************************* */
299
300/* No changes from BCM1250 */
301
302/* *********************************************************************
303 * Timer Registers (Sections 4.6)
304 ********************************************************************* */
305
306/* BCM1480 has two additional watchdogs */
307
308/* Watchdog timers */
309
310#define A_BCM1480_SCD_WDOG_2 0x0010022050
311#define A_BCM1480_SCD_WDOG_3 0x0010022150
312
313#define BCM1480_SCD_NUM_WDOGS 4
314
315#define A_BCM1480_SCD_WDOG_BASE(w) (A_BCM1480_SCD_WDOG_0+((w)&2)*0x1000 + ((w)&1)*0x100)
316#define A_BCM1480_SCD_WDOG_REGISTER(w,r) (A_BCM1480_SCD_WDOG_BASE(w) + (r))
317
318#define A_BCM1480_SCD_WDOG_INIT_2 0x0010022050
319#define A_BCM1480_SCD_WDOG_CNT_2 0x0010022058
320#define A_BCM1480_SCD_WDOG_CFG_2 0x0010022060
321
322#define A_BCM1480_SCD_WDOG_INIT_3 0x0010022150
323#define A_BCM1480_SCD_WDOG_CNT_3 0x0010022158
324#define A_BCM1480_SCD_WDOG_CFG_3 0x0010022160
325
326/* BCM1480 has two additional compare registers */
327
328#define A_BCM1480_SCD_ZBBUS_CYCLE_COUNT A_SCD_ZBBUS_CYCLE_COUNT
329#define A_BCM1480_SCD_ZBBUS_CYCLE_CP_BASE 0x0010020C00
330#define A_BCM1480_SCD_ZBBUS_CYCLE_CP0 A_SCD_ZBBUS_CYCLE_CP0
331#define A_BCM1480_SCD_ZBBUS_CYCLE_CP1 A_SCD_ZBBUS_CYCLE_CP1
332#define A_BCM1480_SCD_ZBBUS_CYCLE_CP2 0x0010020C10
333#define A_BCM1480_SCD_ZBBUS_CYCLE_CP3 0x0010020C18
334
335/* *********************************************************************
336 * System Control Registers (Section 4.2)
337 ********************************************************************* */
338
339/* Scratch register in different place */
340
341#define A_BCM1480_SCD_SCRATCH 0x100200A0
342
343/* *********************************************************************
344 * System Address Trap Registers (Section 4.9)
345 ********************************************************************* */
346
347/* No changes from BCM1250 */
348
349/* *********************************************************************
350 * System Interrupt Mapper Registers (Sections 4.3-4.5)
351 ********************************************************************* */
352
353#define A_BCM1480_IMR_CPU0_BASE 0x0010020000
354#define A_BCM1480_IMR_CPU1_BASE 0x0010022000
355#define A_BCM1480_IMR_CPU2_BASE 0x0010024000
356#define A_BCM1480_IMR_CPU3_BASE 0x0010026000
357#define BCM1480_IMR_REGISTER_SPACING 0x2000
358#define BCM1480_IMR_REGISTER_SPACING_SHIFT 13
359
360#define A_BCM1480_IMR_MAPPER(cpu) (A_BCM1480_IMR_CPU0_BASE+(cpu)*BCM1480_IMR_REGISTER_SPACING)
361#define A_BCM1480_IMR_REGISTER(cpu,reg) (A_BCM1480_IMR_MAPPER(cpu)+(reg))
362
363/* Most IMR registers are 128 bits, implemented as non-contiguous
364 64-bit registers high (_H) and low (_L) */
365#define BCM1480_IMR_HL_SPACING 0x1000
366
367#define R_BCM1480_IMR_INTERRUPT_DIAG_H 0x0010
368#define R_BCM1480_IMR_LDT_INTERRUPT_H 0x0018
369#define R_BCM1480_IMR_LDT_INTERRUPT_CLR_H 0x0020
370#define R_BCM1480_IMR_INTERRUPT_MASK_H 0x0028
371#define R_BCM1480_IMR_INTERRUPT_TRACE_H 0x0038
372#define R_BCM1480_IMR_INTERRUPT_SOURCE_STATUS_H 0x0040
373#define R_BCM1480_IMR_LDT_INTERRUPT_SET 0x0048
374#define R_BCM1480_IMR_MAILBOX_0_CPU 0x00C0
375#define R_BCM1480_IMR_MAILBOX_0_SET_CPU 0x00C8
376#define R_BCM1480_IMR_MAILBOX_0_CLR_CPU 0x00D0
377#define R_BCM1480_IMR_MAILBOX_1_CPU 0x00E0
378#define R_BCM1480_IMR_MAILBOX_1_SET_CPU 0x00E8
379#define R_BCM1480_IMR_MAILBOX_1_CLR_CPU 0x00F0
380#define R_BCM1480_IMR_INTERRUPT_STATUS_BASE_H 0x0100
381#define BCM1480_IMR_INTERRUPT_STATUS_COUNT 8
382#define R_BCM1480_IMR_INTERRUPT_MAP_BASE_H 0x0200
383#define BCM1480_IMR_INTERRUPT_MAP_COUNT 64
384
385#define R_BCM1480_IMR_INTERRUPT_DIAG_L 0x1010
386#define R_BCM1480_IMR_LDT_INTERRUPT_L 0x1018
387#define R_BCM1480_IMR_LDT_INTERRUPT_CLR_L 0x1020
388#define R_BCM1480_IMR_INTERRUPT_MASK_L 0x1028
389#define R_BCM1480_IMR_INTERRUPT_TRACE_L 0x1038
390#define R_BCM1480_IMR_INTERRUPT_SOURCE_STATUS_L 0x1040
391#define R_BCM1480_IMR_INTERRUPT_STATUS_BASE_L 0x1100
392#define R_BCM1480_IMR_INTERRUPT_MAP_BASE_L 0x1200
393
394#define A_BCM1480_IMR_ALIAS_MAILBOX_CPU0_BASE 0x0010028000
395#define A_BCM1480_IMR_ALIAS_MAILBOX_CPU1_BASE 0x0010028100
396#define A_BCM1480_IMR_ALIAS_MAILBOX_CPU2_BASE 0x0010028200
397#define A_BCM1480_IMR_ALIAS_MAILBOX_CPU3_BASE 0x0010028300
398#define BCM1480_IMR_ALIAS_MAILBOX_SPACING 0100
399
400#define A_BCM1480_IMR_ALIAS_MAILBOX(cpu) (A_BCM1480_IMR_ALIAS_MAILBOX_CPU0_BASE + \
401 (cpu)*BCM1480_IMR_ALIAS_MAILBOX_SPACING)
402#define A_BCM1480_IMR_ALIAS_MAILBOX_REGISTER(cpu,reg) (A_BCM1480_IMR_ALIAS_MAILBOX(cpu)+(reg))
403
404#define R_BCM1480_IMR_ALIAS_MAILBOX_0 0x0000 /* 0x0x0 */
405#define R_BCM1480_IMR_ALIAS_MAILBOX_0_SET 0x0008 /* 0x0x8 */
406
407/* *********************************************************************
408 * System Performance Counter Registers (Section 4.7)
409 ********************************************************************* */
410
411/* BCM1480 has four more performance counter registers, and two control
412 registers. */
413
414#define A_BCM1480_SCD_PERF_CNT_BASE 0x00100204C0
415
416#define A_BCM1480_SCD_PERF_CNT_CFG0 0x00100204C0
417#define A_BCM1480_SCD_PERF_CNT_CFG_0 A_BCM1480_SCD_PERF_CNT_CFG0
418#define A_BCM1480_SCD_PERF_CNT_CFG1 0x00100204C8
419#define A_BCM1480_SCD_PERF_CNT_CFG_1 A_BCM1480_SCD_PERF_CNT_CFG1
420
421#define A_BCM1480_SCD_PERF_CNT_0 A_SCD_PERF_CNT_0
422#define A_BCM1480_SCD_PERF_CNT_1 A_SCD_PERF_CNT_1
423#define A_BCM1480_SCD_PERF_CNT_2 A_SCD_PERF_CNT_2
424#define A_BCM1480_SCD_PERF_CNT_3 A_SCD_PERF_CNT_3
425
426#define A_BCM1480_SCD_PERF_CNT_4 0x00100204F0
427#define A_BCM1480_SCD_PERF_CNT_5 0x00100204F8
428#define A_BCM1480_SCD_PERF_CNT_6 0x0010020500
429#define A_BCM1480_SCD_PERF_CNT_7 0x0010020508
430
431/* *********************************************************************
432 * System Bus Watcher Registers (Section 4.8)
433 ********************************************************************* */
434
435
436/* Same as 1250 except BUS_ERR_STATUS_DEBUG is in a different place. */
437
438#define A_BCM1480_BUS_ERR_STATUS_DEBUG 0x00100208D8
439
440/* *********************************************************************
441 * System Debug Controller Registers (Section 19)
442 ********************************************************************* */
443
444/* Same as 1250 */
445
446/* *********************************************************************
447 * System Trace Unit Registers (Sections 4.10)
448 ********************************************************************* */
449
450/* Same as 1250 */
451
452/* *********************************************************************
453 * Data Mover DMA Registers (Section 10.7)
454 ********************************************************************* */
455
456/* Same as 1250 */
457
458
459/* *********************************************************************
460 * HyperTransport Interface Registers (Section 8)
461 ********************************************************************* */
462
463#define BCM1480_HT_NUM_PORTS 3
464#define BCM1480_HT_PORT_SPACING 0x800
465#define A_BCM1480_HT_PORT_HEADER(x) (A_BCM1480_HT_PORT0_HEADER + ((x)*BCM1480_HT_PORT_SPACING))
466
467#define A_BCM1480_HT_PORT0_HEADER 0x00FE000000
468#define A_BCM1480_HT_PORT1_HEADER 0x00FE000800
469#define A_BCM1480_HT_PORT2_HEADER 0x00FE001000
470#define A_BCM1480_HT_TYPE00_HEADER 0x00FE002000
471
472
473/* *********************************************************************
474 * Node Controller Registers (Section 9)
475 ********************************************************************* */
476
477#define A_BCM1480_NC_BASE 0x00DFBD0000
478
479#define A_BCM1480_NC_RLD_FIELD 0x00DFBD0000
480#define A_BCM1480_NC_RLD_TRIGGER 0x00DFBD0020
481#define A_BCM1480_NC_RLD_BAD_ERROR 0x00DFBD0040
482#define A_BCM1480_NC_RLD_COR_ERROR 0x00DFBD0060
483#define A_BCM1480_NC_RLD_ECC_STATUS 0x00DFBD0080
484#define A_BCM1480_NC_RLD_WAY_ENABLE 0x00DFBD00A0
485#define A_BCM1480_NC_RLD_RANDOM_LFSR 0x00DFBD00C0
486
487#define A_BCM1480_NC_INTERRUPT_STATUS 0x00DFBD00E0
488#define A_BCM1480_NC_INTERRUPT_ENABLE 0x00DFBD0100
489#define A_BCM1480_NC_TIMEOUT_COUNTER 0x00DFBD0120
490#define A_BCM1480_NC_TIMEOUT_COUNTER_SEL 0x00DFBD0140
491
492#define A_BCM1480_NC_CREDIT_STATUS_REG0 0x00DFBD0200
493#define A_BCM1480_NC_CREDIT_STATUS_REG1 0x00DFBD0220
494#define A_BCM1480_NC_CREDIT_STATUS_REG2 0x00DFBD0240
495#define A_BCM1480_NC_CREDIT_STATUS_REG3 0x00DFBD0260
496#define A_BCM1480_NC_CREDIT_STATUS_REG4 0x00DFBD0280
497#define A_BCM1480_NC_CREDIT_STATUS_REG5 0x00DFBD02A0
498#define A_BCM1480_NC_CREDIT_STATUS_REG6 0x00DFBD02C0
499#define A_BCM1480_NC_CREDIT_STATUS_REG7 0x00DFBD02E0
500#define A_BCM1480_NC_CREDIT_STATUS_REG8 0x00DFBD0300
501#define A_BCM1480_NC_CREDIT_STATUS_REG9 0x00DFBD0320
502#define A_BCM1480_NC_CREDIT_STATUS_REG10 0x00DFBE0000
503#define A_BCM1480_NC_CREDIT_STATUS_REG11 0x00DFBE0020
504#define A_BCM1480_NC_CREDIT_STATUS_REG12 0x00DFBE0040
505
506#define A_BCM1480_NC_SR_TIMEOUT_COUNTER 0x00DFBE0060
507#define A_BCM1480_NC_SR_TIMEOUT_COUNTER_SEL 0x00DFBE0080
508
509
510/* *********************************************************************
511 * H&R Block Configuration Registers (Section 12.4)
512 ********************************************************************* */
513
514#define A_BCM1480_HR_BASE_0 0x00DF820000
515#define A_BCM1480_HR_BASE_1 0x00DF8A0000
516#define A_BCM1480_HR_BASE_2 0x00DF920000
517#define BCM1480_HR_REGISTER_SPACING 0x80000
518
519#define A_BCM1480_HR_BASE(idx) (A_BCM1480_HR_BASE_0 + ((idx)*BCM1480_HR_REGISTER_SPACING))
520#define A_BCM1480_HR_REGISTER(idx,reg) (A_BCM1480_HR_BASE(idx) + (reg))
521
522#define R_BCM1480_HR_CFG 0x0000000000
523
524#define R_BCM1480_HR_MAPPING 0x0000010010
525
526#define BCM1480_HR_RULE_SPACING 0x0000000010
527#define BCM1480_HR_NUM_RULES 16
528#define BCM1480_HR_OP_OFFSET 0x0000000100
529#define BCM1480_HR_TYPE_OFFSET 0x0000000108
530#define R_BCM1480_HR_RULE_OP(idx) (BCM1480_HR_OP_OFFSET + ((idx)*BCM1480_HR_RULE_SPACING))
531#define R_BCM1480_HR_RULE_TYPE(idx) (BCM1480_HR_TYPE_OFFSET + ((idx)*BCM1480_HR_RULE_SPACING))
532
533#define BCM1480_HR_LEAF_SPACING 0x0000000010
534#define BCM1480_HR_NUM_LEAVES 10
535#define BCM1480_HR_LEAF_OFFSET 0x0000000300
536#define R_BCM1480_HR_HA_LEAF0(idx) (BCM1480_HR_LEAF_OFFSET + ((idx)*BCM1480_HR_LEAF_SPACING))
537
538#define R_BCM1480_HR_EX_LEAF0 0x00000003A0
539
540#define BCM1480_HR_PATH_SPACING 0x0000000010
541#define BCM1480_HR_NUM_PATHS 16
542#define BCM1480_HR_PATH_OFFSET 0x0000000600
543#define R_BCM1480_HR_PATH(idx) (BCM1480_HR_PATH_OFFSET + ((idx)*BCM1480_HR_PATH_SPACING))
544
545#define R_BCM1480_HR_PATH_DEFAULT 0x0000000700
546
547#define BCM1480_HR_ROUTE_SPACING 8
548#define BCM1480_HR_NUM_ROUTES 512
549#define BCM1480_HR_ROUTE_OFFSET 0x0000001000
550#define R_BCM1480_HR_RT_WORD(idx) (BCM1480_HR_ROUTE_OFFSET + ((idx)*BCM1480_HR_ROUTE_SPACING))
551
552
553/* checked to here - ehs */
554/* *********************************************************************
555 * Packet Manager DMA Registers (Section 12.5)
556 ********************************************************************* */
557
558#define A_BCM1480_PM_BASE 0x0010056000
559
560#define A_BCM1480_PMI_LCL_0 0x0010058000
561#define A_BCM1480_PMO_LCL_0 0x001005C000
562#define A_BCM1480_PMI_OFFSET_0 (A_BCM1480_PMI_LCL_0 - A_BCM1480_PM_BASE)
563#define A_BCM1480_PMO_OFFSET_0 (A_BCM1480_PMO_LCL_0 - A_BCM1480_PM_BASE)
564
565#define BCM1480_PM_LCL_REGISTER_SPACING 0x100
566#define BCM1480_PM_NUM_CHANNELS 32
567
568#define A_BCM1480_PMI_LCL_BASE(idx) (A_BCM1480_PMI_LCL_0 + ((idx)*BCM1480_PM_LCL_REGISTER_SPACING))
569#define A_BCM1480_PMI_LCL_REGISTER(idx,reg) (A_BCM1480_PMI_LCL_BASE(idx) + (reg))
570#define A_BCM1480_PMO_LCL_BASE(idx) (A_BCM1480_PMO_LCL_0 + ((idx)*BCM1480_PM_LCL_REGISTER_SPACING))
571#define A_BCM1480_PMO_LCL_REGISTER(idx,reg) (A_BCM1480_PMO_LCL_BASE(idx) + (reg))
572
573#define BCM1480_PM_INT_PACKING 8
574#define BCM1480_PM_INT_FUNCTION_SPACING 0x40
575#define BCM1480_PM_INT_NUM_FUNCTIONS 3
576
577/*
578 * DMA channel registers relative to A_BCM1480_PMI_LCL_BASE(n) and A_BCM1480_PMO_LCL_BASE(n)
579 */
580
581#define R_BCM1480_PM_BASE_SIZE 0x0000000000
582#define R_BCM1480_PM_CNT 0x0000000008
583#define R_BCM1480_PM_PFCNT 0x0000000010
584#define R_BCM1480_PM_LAST 0x0000000018
585#define R_BCM1480_PM_PFINDX 0x0000000020
586#define R_BCM1480_PM_INT_WMK 0x0000000028
587#define R_BCM1480_PM_CONFIG0 0x0000000030
588#define R_BCM1480_PM_LOCALDEBUG 0x0000000078
589#define R_BCM1480_PM_CACHEABILITY 0x0000000080 /* PMI only */
590#define R_BCM1480_PM_INT_CNFG 0x0000000088
591#define R_BCM1480_PM_DESC_MERGE_TIMER 0x0000000090
592#define R_BCM1480_PM_LOCALDEBUG_PIB 0x00000000F8 /* PMI only */
593#define R_BCM1480_PM_LOCALDEBUG_POB 0x00000000F8 /* PMO only */
594
595/*
596 * Global Registers (Not Channelized)
597 */
598
599#define A_BCM1480_PMI_GLB_0 0x0010056000
600#define A_BCM1480_PMO_GLB_0 0x0010057000
601
602/*
603 * PM to TX Mapping Register relative to A_BCM1480_PMI_GLB_0 and A_BCM1480_PMO_GLB_0
604 */
605
606#define R_BCM1480_PM_PMO_MAPPING 0x00000008C8 /* PMO only */
607
608#define A_BCM1480_PM_PMO_MAPPING (A_BCM1480_PMO_GLB_0 + R_BCM1480_PM_PMO_MAPPING)
609
610/*
611 * Interrupt mapping registers
612 */
613
614
615#define A_BCM1480_PMI_INT_0 0x0010056800
616#define A_BCM1480_PMI_INT(q) (A_BCM1480_PMI_INT_0 + ((q>>8)<<8))
617#define A_BCM1480_PMI_INT_OFFSET_0 (A_BCM1480_PMI_INT_0 - A_BCM1480_PM_BASE)
618#define A_BCM1480_PMO_INT_0 0x0010057800
619#define A_BCM1480_PMO_INT(q) (A_BCM1480_PMO_INT_0 + ((q>>8)<<8))
620#define A_BCM1480_PMO_INT_OFFSET_0 (A_BCM1480_PMO_INT_0 - A_BCM1480_PM_BASE)
621
622/*
623 * Interrupt registers relative to A_BCM1480_PMI_INT_0 and A_BCM1480_PMO_INT_0
624 */
625
626#define R_BCM1480_PM_INT_ST 0x0000000000
627#define R_BCM1480_PM_INT_MSK 0x0000000040
628#define R_BCM1480_PM_INT_CLR 0x0000000080
629#define R_BCM1480_PM_MRGD_INT 0x00000000C0
630
631/*
632 * Debug registers (global)
633 */
634
635#define A_BCM1480_PM_GLOBALDEBUGMODE_PMI 0x0010056000
636#define A_BCM1480_PM_GLOBALDEBUG_PID 0x00100567F8
637#define A_BCM1480_PM_GLOBALDEBUG_PIB 0x0010056FF8
638#define A_BCM1480_PM_GLOBALDEBUGMODE_PMO 0x0010057000
639#define A_BCM1480_PM_GLOBALDEBUG_POD 0x00100577F8
640#define A_BCM1480_PM_GLOBALDEBUG_POB 0x0010057FF8
641
642/* *********************************************************************
643 * Switch performance counters
644 ********************************************************************* */
645
646#define A_BCM1480_SWPERF_CFG 0xdfb91800
647#define A_BCM1480_SWPERF_CNT0 0xdfb91880
648#define A_BCM1480_SWPERF_CNT1 0xdfb91888
649#define A_BCM1480_SWPERF_CNT2 0xdfb91890
650#define A_BCM1480_SWPERF_CNT3 0xdfb91898
651
652
653/* *********************************************************************
654 * Switch Trace Unit
655 ********************************************************************* */
656
657#define A_BCM1480_SWTRC_MATCH_CONTROL_0 0xDFB91000
658#define A_BCM1480_SWTRC_MATCH_DATA_VALUE_0 0xDFB91100
659#define A_BCM1480_SWTRC_MATCH_DATA_MASK_0 0xDFB91108
660#define A_BCM1480_SWTRC_MATCH_TAG_VALUE_0 0xDFB91200
661#define A_BCM1480_SWTRC_MATCH_TAG_MAKS_0 0xDFB91208
662#define A_BCM1480_SWTRC_EVENT_0 0xDFB91300
663#define A_BCM1480_SWTRC_SEQUENCE_0 0xDFB91400
664
665#define A_BCM1480_SWTRC_CFG 0xDFB91500
666#define A_BCM1480_SWTRC_READ 0xDFB91508
667
668#define A_BCM1480_SWDEBUG_SCHEDSTOP 0xDFB92000
669
670#define A_BCM1480_SWTRC_MATCH_CONTROL(x) (A_BCM1480_SWTRC_MATCH_CONTROL_0 + ((x)*8))
671#define A_BCM1480_SWTRC_EVENT(x) (A_BCM1480_SWTRC_EVENT_0 + ((x)*8))
672#define A_BCM1480_SWTRC_SEQUENCE(x) (A_BCM1480_SWTRC_SEQUENCE_0 + ((x)*8))
673
674#define A_BCM1480_SWTRC_MATCH_DATA_VALUE(x) (A_BCM1480_SWTRC_MATCH_DATA_VALUE_0 + ((x)*16))
675#define A_BCM1480_SWTRC_MATCH_DATA_MASK(x) (A_BCM1480_SWTRC_MATCH_DATA_MASK_0 + ((x)*16))
676#define A_BCM1480_SWTRC_MATCH_TAG_VALUE(x) (A_BCM1480_SWTRC_MATCH_TAG_VALUE_0 + ((x)*16))
677#define A_BCM1480_SWTRC_MATCH_TAG_MASK(x) (A_BCM1480_SWTRC_MATCH_TAG_MASK_0 + ((x)*16))
678
679
680
681/* *********************************************************************
682 * High-Speed Port Registers (Section 13)
683 ********************************************************************* */
684
685#define A_BCM1480_HSP_BASE_0 0x00DF810000
686#define A_BCM1480_HSP_BASE_1 0x00DF890000
687#define A_BCM1480_HSP_BASE_2 0x00DF910000
688#define BCM1480_HSP_REGISTER_SPACING 0x80000
689
690#define A_BCM1480_HSP_BASE(idx) (A_BCM1480_HSP_BASE_0 + ((idx)*BCM1480_HSP_REGISTER_SPACING))
691#define A_BCM1480_HSP_REGISTER(idx,reg) (A_BCM1480_HSP_BASE(idx) + (reg))
692
693#define R_BCM1480_HSP_RX_SPI4_CFG_0 0x0000000000
694#define R_BCM1480_HSP_RX_SPI4_CFG_1 0x0000000008
695#define R_BCM1480_HSP_RX_SPI4_DESKEW_OVERRIDE 0x0000000010
696#define R_BCM1480_HSP_RX_SPI4_DESKEW_DATAPATH 0x0000000018
697#define R_BCM1480_HSP_RX_SPI4_PORT_INT_EN 0x0000000020
698#define R_BCM1480_HSP_RX_SPI4_PORT_INT_STATUS 0x0000000028
699
700#define R_BCM1480_HSP_RX_SPI4_CALENDAR_0 0x0000000200
701#define R_BCM1480_HSP_RX_SPI4_CALENDAR_1 0x0000000208
702
703#define R_BCM1480_HSP_RX_PLL_CNFG 0x0000000800
704#define R_BCM1480_HSP_RX_CALIBRATION 0x0000000808
705#define R_BCM1480_HSP_RX_TEST 0x0000000810
706#define R_BCM1480_HSP_RX_DIAG_DETAILS 0x0000000818
707#define R_BCM1480_HSP_RX_DIAG_CRC_0 0x0000000820
708#define R_BCM1480_HSP_RX_DIAG_CRC_1 0x0000000828
709#define R_BCM1480_HSP_RX_DIAG_HTCMD 0x0000000830
710#define R_BCM1480_HSP_RX_DIAG_PKTCTL 0x0000000838
711
712#define R_BCM1480_HSP_RX_VIS_FLCTRL_COUNTER 0x0000000870
713
714#define R_BCM1480_HSP_RX_PKT_RAMALLOC_0 0x0000020020
715#define R_BCM1480_HSP_RX_PKT_RAMALLOC_1 0x0000020028
716#define R_BCM1480_HSP_RX_PKT_RAMALLOC_2 0x0000020030
717#define R_BCM1480_HSP_RX_PKT_RAMALLOC_3 0x0000020038
718#define R_BCM1480_HSP_RX_PKT_RAMALLOC_4 0x0000020040
719#define R_BCM1480_HSP_RX_PKT_RAMALLOC_5 0x0000020048
720#define R_BCM1480_HSP_RX_PKT_RAMALLOC_6 0x0000020050
721#define R_BCM1480_HSP_RX_PKT_RAMALLOC_7 0x0000020058
722#define R_BCM1480_HSP_RX_PKT_RAMALLOC(idx) (R_BCM1480_HSP_RX_PKT_RAMALLOC_0 + 8*(idx))
723
724/* XXX Following registers were shuffled. Renamed/renumbered per errata. */
725#define R_BCM1480_HSP_RX_HT_RAMALLOC_0 0x0000020078
726#define R_BCM1480_HSP_RX_HT_RAMALLOC_1 0x0000020080
727#define R_BCM1480_HSP_RX_HT_RAMALLOC_2 0x0000020088
728#define R_BCM1480_HSP_RX_HT_RAMALLOC_3 0x0000020090
729#define R_BCM1480_HSP_RX_HT_RAMALLOC_4 0x0000020098
730#define R_BCM1480_HSP_RX_HT_RAMALLOC_5 0x00000200A0
731
732#define R_BCM1480_HSP_RX_SPI_WATERMARK_0 0x00000200B0
733#define R_BCM1480_HSP_RX_SPI_WATERMARK_1 0x00000200B8
734#define R_BCM1480_HSP_RX_SPI_WATERMARK_2 0x00000200C0
735#define R_BCM1480_HSP_RX_SPI_WATERMARK_3 0x00000200C8
736#define R_BCM1480_HSP_RX_SPI_WATERMARK_4 0x00000200D0
737#define R_BCM1480_HSP_RX_SPI_WATERMARK_5 0x00000200D8
738#define R_BCM1480_HSP_RX_SPI_WATERMARK_6 0x00000200E0
739#define R_BCM1480_HSP_RX_SPI_WATERMARK_7 0x00000200E8
740#define R_BCM1480_HSP_RX_SPI_WATERMARK(idx) (R_BCM1480_HSP_RX_SPI_WATERMARK_0 + 8*(idx))
741
742#define R_BCM1480_HSP_RX_VIS_CMDQ_0 0x00000200F0
743#define R_BCM1480_HSP_RX_VIS_CMDQ_1 0x00000200F8
744#define R_BCM1480_HSP_RX_VIS_CMDQ_2 0x0000020100
745#define R_BCM1480_HSP_RX_RAM_READCTL 0x0000020108
746#define R_BCM1480_HSP_RX_RAM_READWINDOW 0x0000020110
747#define R_BCM1480_HSP_RX_RF_READCTL 0x0000020118
748#define R_BCM1480_HSP_RX_RF_READWINDOW 0x0000020120
749
750#define R_BCM1480_HSP_TX_SPI4_CFG_0 0x0000040000
751#define R_BCM1480_HSP_TX_SPI4_CFG_1 0x0000040008
752#define R_BCM1480_HSP_TX_SPI4_TRAINING_FMT 0x0000040010
753
754#define R_BCM1480_HSP_TX_PKT_RAMALLOC_0 0x0000040020
755#define R_BCM1480_HSP_TX_PKT_RAMALLOC_1 0x0000040028
756#define R_BCM1480_HSP_TX_PKT_RAMALLOC_2 0x0000040030
757#define R_BCM1480_HSP_TX_PKT_RAMALLOC_3 0x0000040038
758#define R_BCM1480_HSP_TX_PKT_RAMALLOC_4 0x0000040040
759#define R_BCM1480_HSP_TX_PKT_RAMALLOC_5 0x0000040048
760#define R_BCM1480_HSP_TX_PKT_RAMALLOC_6 0x0000040050
761#define R_BCM1480_HSP_TX_PKT_RAMALLOC_7 0x0000040058
762#define R_BCM1480_HSP_TX_PKT_RAMALLOC(idx) (R_BCM1480_HSP_TX_PKT_RAMALLOC_0 + 8*(idx))
763#define R_BCM1480_HSP_TX_NPC_RAMALLOC 0x0000040078
764#define R_BCM1480_HSP_TX_RSP_RAMALLOC 0x0000040080
765#define R_BCM1480_HSP_TX_PC_RAMALLOC 0x0000040088
766#define R_BCM1480_HSP_TX_HTCC_RAMALLOC_0 0x0000040090
767#define R_BCM1480_HSP_TX_HTCC_RAMALLOC_1 0x0000040098
768#define R_BCM1480_HSP_TX_HTCC_RAMALLOC_2 0x00000400A0
769
770#define R_BCM1480_HSP_TX_PKT_RXPHITCNT_0 0x00000400B0
771#define R_BCM1480_HSP_TX_PKT_RXPHITCNT_1 0x00000400B8
772#define R_BCM1480_HSP_TX_PKT_RXPHITCNT_2 0x00000400C0
773#define R_BCM1480_HSP_TX_PKT_RXPHITCNT_3 0x00000400C8
774#define R_BCM1480_HSP_TX_PKT_RXPHITCNT(idx) (R_BCM1480_HSP_TX_PKT_RXPHITCNT_0 + 8*(idx))
775#define R_BCM1480_HSP_TX_HTIO_RXPHITCNT 0x00000400D0
776#define R_BCM1480_HSP_TX_HTCC_RXPHITCNT 0x00000400D8
777
778#define R_BCM1480_HSP_TX_PKT_TXPHITCNT_0 0x00000400E0
779#define R_BCM1480_HSP_TX_PKT_TXPHITCNT_1 0x00000400E8
780#define R_BCM1480_HSP_TX_PKT_TXPHITCNT_2 0x00000400F0
781#define R_BCM1480_HSP_TX_PKT_TXPHITCNT_3 0x00000400F8
782#define R_BCM1480_HSP_TX_PKT_TXPHITCNT(idx) (R_BCM1480_HSP_TX_PKT_TXPHITCNT_0 + 8*(idx))
783#define R_BCM1480_HSP_TX_HTIO_TXPHITCNT 0x0000040100
784#define R_BCM1480_HSP_TX_HTCC_TXPHITCNT 0x0000040108
785
786#define R_BCM1480_HSP_TX_SPI4_CALENDAR_0 0x0000040200
787#define R_BCM1480_HSP_TX_SPI4_CALENDAR_1 0x0000040208
788
789#define R_BCM1480_HSP_TX_PLL_CNFG 0x0000040800
790#define R_BCM1480_HSP_TX_CALIBRATION 0x0000040808
791#define R_BCM1480_HSP_TX_TEST 0x0000040810
792
793#define R_BCM1480_HSP_TX_VIS_CMDQ_0 0x0000040840
794#define R_BCM1480_HSP_TX_VIS_CMDQ_1 0x0000040848
795#define R_BCM1480_HSP_TX_VIS_CMDQ_2 0x0000040850
796#define R_BCM1480_HSP_TX_RAM_READCTL 0x0000040860
797#define R_BCM1480_HSP_TX_RAM_READWINDOW 0x0000040868
798#define R_BCM1480_HSP_TX_RF_READCTL 0x0000040870
799#define R_BCM1480_HSP_TX_RF_READWINDOW 0x0000040878
800
801#define R_BCM1480_HSP_TX_SPI4_PORT_INT_STATUS 0x0000040880
802#define R_BCM1480_HSP_TX_SPI4_PORT_INT_EN 0x0000040888
803
804#define R_BCM1480_HSP_TX_NEXT_ADDR_BASE 0x000040400
805#define R_BCM1480_HSP_TX_NEXT_ADDR_REGISTER(x) (R_BCM1480_HSP_TX_NEXT_ADDR_BASE+ 8*(x))
806
807
808
809/* *********************************************************************
810 * Physical Address Map (Table 10 and Figure 7)
811 ********************************************************************* */
812
813#define A_BCM1480_PHYS_MEMORY_0 _SB_MAKE64(0x0000000000)
814#define A_BCM1480_PHYS_MEMORY_SIZE _SB_MAKE64((256*1024*1024))
815#define A_BCM1480_PHYS_SYSTEM_CTL _SB_MAKE64(0x0010000000)
816#define A_BCM1480_PHYS_IO_SYSTEM _SB_MAKE64(0x0010060000)
817#define A_BCM1480_PHYS_GENBUS _SB_MAKE64(0x0010090000)
818#define A_BCM1480_PHYS_GENBUS_END _SB_MAKE64(0x0028000000)
819#define A_BCM1480_PHYS_PCI_MISC_MATCH_BYTES _SB_MAKE64(0x0028000000)
820#define A_BCM1480_PHYS_PCI_IACK_MATCH_BYTES _SB_MAKE64(0x0029000000)
821#define A_BCM1480_PHYS_PCI_IO_MATCH_BYTES _SB_MAKE64(0x002C000000)
822#define A_BCM1480_PHYS_PCI_CFG_MATCH_BYTES _SB_MAKE64(0x002E000000)
823#define A_BCM1480_PHYS_PCI_OMAP_MATCH_BYTES _SB_MAKE64(0x002F000000)
824#define A_BCM1480_PHYS_PCI_MEM_MATCH_BYTES _SB_MAKE64(0x0030000000)
825#define A_BCM1480_PHYS_HT_MEM_MATCH_BYTES _SB_MAKE64(0x0040000000)
826#define A_BCM1480_PHYS_HT_MEM_MATCH_BITS _SB_MAKE64(0x0060000000)
827#define A_BCM1480_PHYS_MEMORY_1 _SB_MAKE64(0x0080000000)
828#define A_BCM1480_PHYS_MEMORY_2 _SB_MAKE64(0x0090000000)
829#define A_BCM1480_PHYS_PCI_MISC_MATCH_BITS _SB_MAKE64(0x00A8000000)
830#define A_BCM1480_PHYS_PCI_IACK_MATCH_BITS _SB_MAKE64(0x00A9000000)
831#define A_BCM1480_PHYS_PCI_IO_MATCH_BITS _SB_MAKE64(0x00AC000000)
832#define A_BCM1480_PHYS_PCI_CFG_MATCH_BITS _SB_MAKE64(0x00AE000000)
833#define A_BCM1480_PHYS_PCI_OMAP_MATCH_BITS _SB_MAKE64(0x00AF000000)
834#define A_BCM1480_PHYS_PCI_MEM_MATCH_BITS _SB_MAKE64(0x00B0000000)
835#define A_BCM1480_PHYS_MEMORY_3 _SB_MAKE64(0x00C0000000)
836#define A_BCM1480_PHYS_L2_CACHE_TEST _SB_MAKE64(0x00D0000000)
837#define A_BCM1480_PHYS_HT_SPECIAL_MATCH_BYTES _SB_MAKE64(0x00D8000000)
838#define A_BCM1480_PHYS_HT_IO_MATCH_BYTES _SB_MAKE64(0x00DC000000)
839#define A_BCM1480_PHYS_HT_CFG_MATCH_BYTES _SB_MAKE64(0x00DE000000)
840#define A_BCM1480_PHYS_HS_SUBSYS _SB_MAKE64(0x00DF000000)
841#define A_BCM1480_PHYS_HT_SPECIAL_MATCH_BITS _SB_MAKE64(0x00F8000000)
842#define A_BCM1480_PHYS_HT_IO_MATCH_BITS _SB_MAKE64(0x00FC000000)
843#define A_BCM1480_PHYS_HT_CFG_MATCH_BITS _SB_MAKE64(0x00FE000000)
844#define A_BCM1480_PHYS_MEMORY_EXP _SB_MAKE64(0x0100000000)
845#define A_BCM1480_PHYS_MEMORY_EXP_SIZE _SB_MAKE64((508*1024*1024*1024))
846#define A_BCM1480_PHYS_PCI_UPPER _SB_MAKE64(0x1000000000)
847#define A_BCM1480_PHYS_HT_UPPER_MATCH_BYTES _SB_MAKE64(0x2000000000)
848#define A_BCM1480_PHYS_HT_UPPER_MATCH_BITS _SB_MAKE64(0x3000000000)
849#define A_BCM1480_PHYS_HT_NODE_ALIAS _SB_MAKE64(0x4000000000)
850#define A_BCM1480_PHYS_HT_FULLACCESS _SB_MAKE64(0xF000000000)
851
852
853/* *********************************************************************
854 * L2 Cache as RAM (Table 54)
855 ********************************************************************* */
856
857#define A_BCM1480_PHYS_L2CACHE_WAY_SIZE _SB_MAKE64(0x0000020000)
858#define BCM1480_PHYS_L2CACHE_NUM_WAYS 8
859#define A_BCM1480_PHYS_L2CACHE_TOTAL_SIZE _SB_MAKE64(0x0000100000)
860#define A_BCM1480_PHYS_L2CACHE_WAY0 _SB_MAKE64(0x00D0300000)
861#define A_BCM1480_PHYS_L2CACHE_WAY1 _SB_MAKE64(0x00D0320000)
862#define A_BCM1480_PHYS_L2CACHE_WAY2 _SB_MAKE64(0x00D0340000)
863#define A_BCM1480_PHYS_L2CACHE_WAY3 _SB_MAKE64(0x00D0360000)
864#define A_BCM1480_PHYS_L2CACHE_WAY4 _SB_MAKE64(0x00D0380000)
865#define A_BCM1480_PHYS_L2CACHE_WAY5 _SB_MAKE64(0x00D03A0000)
866#define A_BCM1480_PHYS_L2CACHE_WAY6 _SB_MAKE64(0x00D03C0000)
867#define A_BCM1480_PHYS_L2CACHE_WAY7 _SB_MAKE64(0x00D03E0000)
868
869#endif /* _BCM1480_REGS_H */
diff --git a/include/asm-mips/sibyte/bcm1480_scd.h b/include/asm-mips/sibyte/bcm1480_scd.h
new file mode 100644
index 000000000000..648bed96780f
--- /dev/null
+++ b/include/asm-mips/sibyte/bcm1480_scd.h
@@ -0,0 +1,436 @@
1/* *********************************************************************
2 * BCM1280/BCM1400 Board Support Package
3 *
4 * SCD Constants and Macros File: bcm1480_scd.h
5 *
6 * This module contains constants and macros useful for
7 * manipulating the System Control and Debug module.
8 *
9 * BCM1400 specification level: 1X55_1X80-UM100-R (12/18/03)
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32#ifndef _BCM1480_SCD_H
33#define _BCM1480_SCD_H
34
35#include "sb1250_defs.h"
36
37/* *********************************************************************
38 * Pull in the BCM1250's SCD since lots of stuff is the same.
39 ********************************************************************* */
40
41#include "sb1250_scd.h"
42
43/* *********************************************************************
44 * Some general notes:
45 *
46 * This file is basically a "what's new" header file. Since the
47 * BCM1250 and the new BCM1480 (and derivatives) share many common
48 * features, this file contains only what's new or changed from
49 * the 1250. (above, you can see that we include the 1250 symbols
50 * to get the base functionality).
51 *
52 * In software, be sure to use the correct symbols, particularly
53 * for blocks that are different between the two chip families.
54 * All BCM1480-specific symbols have _BCM1480_ in their names,
55 * and all BCM1250-specific and "base" functions that are common in
56 * both chips have no special names (this is for compatibility with
57 * older include files). Therefore, if you're working with the
58 * SCD, which is very different on each chip, A_SCD_xxx implies
59 * the BCM1250 version and A_BCM1480_SCD_xxx implies the BCM1480
60 * version.
61 ********************************************************************* */
62
63/* *********************************************************************
64 * System control/debug registers
65 ********************************************************************* */
66
67/*
68 * System Identification and Revision Register (Table 12)
69 * Register: SCD_SYSTEM_REVISION
70 * This register is field compatible with the 1250.
71 */
72
73/*
74 * New part definitions
75 */
76
77#define K_SYS_PART_BCM1480 0x1406
78#define K_SYS_PART_BCM1280 0x1206
79#define K_SYS_PART_BCM1455 0x1407
80#define K_SYS_PART_BCM1255 0x1257
81
82/*
83 * Manufacturing Information Register (Table 14)
84 * Register: SCD_SYSTEM_MANUF
85 */
86
87/*
88 * System Configuration Register (Table 15)
89 * Register: SCD_SYSTEM_CFG
90 * Entire register is different from 1250, all new constants below
91 */
92
93#define M_BCM1480_SYS_RESERVED0 _SB_MAKEMASK1(0)
94#define M_BCM1480_SYS_HT_MINRSTCNT _SB_MAKEMASK1(1)
95#define M_BCM1480_SYS_RESERVED2 _SB_MAKEMASK1(2)
96#define M_BCM1480_SYS_RESERVED3 _SB_MAKEMASK1(3)
97#define M_BCM1480_SYS_RESERVED4 _SB_MAKEMASK1(4)
98#define M_BCM1480_SYS_IOB_DIV _SB_MAKEMASK1(5)
99
100#define S_BCM1480_SYS_PLL_DIV _SB_MAKE64(6)
101#define M_BCM1480_SYS_PLL_DIV _SB_MAKEMASK(5,S_BCM1480_SYS_PLL_DIV)
102#define V_BCM1480_SYS_PLL_DIV(x) _SB_MAKEVALUE(x,S_BCM1480_SYS_PLL_DIV)
103#define G_BCM1480_SYS_PLL_DIV(x) _SB_GETVALUE(x,S_BCM1480_SYS_PLL_DIV,M_BCM1480_SYS_PLL_DIV)
104
105#define S_BCM1480_SYS_SW_DIV _SB_MAKE64(11)
106#define M_BCM1480_SYS_SW_DIV _SB_MAKEMASK(5,S_BCM1480_SYS_SW_DIV)
107#define V_BCM1480_SYS_SW_DIV(x) _SB_MAKEVALUE(x,S_BCM1480_SYS_SW_DIV)
108#define G_BCM1480_SYS_SW_DIV(x) _SB_GETVALUE(x,S_BCM1480_SYS_SW_DIV,M_BCM1480_SYS_SW_DIV)
109
110#define M_BCM1480_SYS_PCMCIA_ENABLE _SB_MAKEMASK1(16)
111#define M_BCM1480_SYS_DUART1_ENABLE _SB_MAKEMASK1(17)
112
113#define S_BCM1480_SYS_BOOT_MODE _SB_MAKE64(18)
114#define M_BCM1480_SYS_BOOT_MODE _SB_MAKEMASK(2,S_BCM1480_SYS_BOOT_MODE)
115#define V_BCM1480_SYS_BOOT_MODE(x) _SB_MAKEVALUE(x,S_BCM1480_SYS_BOOT_MODE)
116#define G_BCM1480_SYS_BOOT_MODE(x) _SB_GETVALUE(x,S_BCM1480_SYS_BOOT_MODE,M_BCM1480_SYS_BOOT_MODE)
117#define K_BCM1480_SYS_BOOT_MODE_ROM32 0
118#define K_BCM1480_SYS_BOOT_MODE_ROM8 1
119#define K_BCM1480_SYS_BOOT_MODE_SMBUS_SMALL 2
120#define K_BCM1480_SYS_BOOT_MODE_SMBUS_BIG 3
121#define M_BCM1480_SYS_BOOT_MODE_SMBUS _SB_MAKEMASK1(19)
122
123#define M_BCM1480_SYS_PCI_HOST _SB_MAKEMASK1(20)
124#define M_BCM1480_SYS_PCI_ARBITER _SB_MAKEMASK1(21)
125#define M_BCM1480_SYS_BIG_ENDIAN _SB_MAKEMASK1(22)
126#define M_BCM1480_SYS_GENCLK_EN _SB_MAKEMASK1(23)
127#define M_BCM1480_SYS_GEN_PARITY_EN _SB_MAKEMASK1(24)
128#define M_BCM1480_SYS_RESERVED25 _SB_MAKEMASK1(25)
129
130#define S_BCM1480_SYS_CONFIG 26
131#define M_BCM1480_SYS_CONFIG _SB_MAKEMASK(6,S_BCM1480_SYS_CONFIG)
132#define V_BCM1480_SYS_CONFIG(x) _SB_MAKEVALUE(x,S_BCM1480_SYS_CONFIG)
133#define G_BCM1480_SYS_CONFIG(x) _SB_GETVALUE(x,S_BCM1480_SYS_CONFIG,M_BCM1480_SYS_CONFIG)
134
135#define M_BCM1480_SYS_RESERVED32 _SB_MAKEMASK(32,15)
136
137#define S_BCM1480_SYS_NODEID 47
138#define M_BCM1480_SYS_NODEID _SB_MAKEMASK(4,S_BCM1480_SYS_NODEID)
139#define V_BCM1480_SYS_NODEID(x) _SB_MAKEVALUE(x,S_BCM1480_SYS_NODEID)
140#define G_BCM1480_SYS_NODEID(x) _SB_GETVALUE(x,S_BCM1480_SYS_NODEID,M_BCM1480_SYS_NODEID)
141
142#define M_BCM1480_SYS_CCNUMA_EN _SB_MAKEMASK1(51)
143#define M_BCM1480_SYS_CPU_RESET_0 _SB_MAKEMASK1(52)
144#define M_BCM1480_SYS_CPU_RESET_1 _SB_MAKEMASK1(53)
145#define M_BCM1480_SYS_CPU_RESET_2 _SB_MAKEMASK1(54)
146#define M_BCM1480_SYS_CPU_RESET_3 _SB_MAKEMASK1(55)
147#define S_BCM1480_SYS_DISABLECPU0 56
148#define M_BCM1480_SYS_DISABLECPU0 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU0)
149#define S_BCM1480_SYS_DISABLECPU1 57
150#define M_BCM1480_SYS_DISABLECPU1 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU1)
151#define S_BCM1480_SYS_DISABLECPU2 58
152#define M_BCM1480_SYS_DISABLECPU2 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU2)
153#define S_BCM1480_SYS_DISABLECPU3 59
154#define M_BCM1480_SYS_DISABLECPU3 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU3)
155
156#define M_BCM1480_SYS_SB_SOFTRES _SB_MAKEMASK1(60)
157#define M_BCM1480_SYS_EXT_RESET _SB_MAKEMASK1(61)
158#define M_BCM1480_SYS_SYSTEM_RESET _SB_MAKEMASK1(62)
159#define M_BCM1480_SYS_SW_FLAG _SB_MAKEMASK1(63)
160
161/*
162 * Scratch Register (Table 16)
163 * Register: SCD_SYSTEM_SCRATCH
164 * Same as BCM1250
165 */
166
167
168/*
169 * Mailbox Registers (Table 17)
170 * Registers: SCD_MBOX_{0,1}_CPU_x
171 * Same as BCM1250
172 */
173
174
175/*
176 * See bcm1480_int.h for interrupt mapper registers.
177 */
178
179
180/*
181 * Watchdog Timer Initial Count Registers (Table 23)
182 * Registers: SCD_WDOG_INIT_CNT_x
183 *
184 * The watchdogs are almost the same as the 1250, except
185 * the configuration register has more bits to control the
186 * other CPUs.
187 */
188
189
190/*
191 * Watchdog Timer Configuration Registers (Table 25)
192 * Registers: SCD_WDOG_CFG_x
193 */
194
195#define M_BCM1480_SCD_WDOG_ENABLE _SB_MAKEMASK1(0)
196
197#define S_BCM1480_SCD_WDOG_RESET_TYPE 2
198#define M_BCM1480_SCD_WDOG_RESET_TYPE _SB_MAKEMASK(5,S_BCM1480_SCD_WDOG_RESET_TYPE)
199#define V_BCM1480_SCD_WDOG_RESET_TYPE(x) _SB_MAKEVALUE(x,S_BCM1480_SCD_WDOG_RESET_TYPE)
200#define G_BCM1480_SCD_WDOG_RESET_TYPE(x) _SB_GETVALUE(x,S_BCM1480_SCD_WDOG_RESET_TYPE,M_BCM1480_SCD_WDOG_RESET_TYPE)
201
202#define K_BCM1480_SCD_WDOG_RESET_FULL 0 /* actually, (x & 1) == 0 */
203#define K_BCM1480_SCD_WDOG_RESET_SOFT 1
204#define K_BCM1480_SCD_WDOG_RESET_CPU0 3
205#define K_BCM1480_SCD_WDOG_RESET_CPU1 5
206#define K_BCM1480_SCD_WDOG_RESET_CPU2 9
207#define K_BCM1480_SCD_WDOG_RESET_CPU3 17
208#define K_BCM1480_SCD_WDOG_RESET_ALL_CPUS 31
209
210
211#define M_BCM1480_SCD_WDOG_HAS_RESET _SB_MAKEMASK1(8)
212
213/*
214 * General Timer Initial Count Registers (Table 26)
215 * Registers: SCD_TIMER_INIT_x
216 *
217 * The timer registers are the same as the BCM1250
218 */
219
220
221/*
222 * ZBbus Count Register (Table 29)
223 * Register: ZBBUS_CYCLE_COUNT
224 *
225 * Same as BCM1250
226 */
227
228/*
229 * ZBbus Compare Registers (Table 30)
230 * Registers: ZBBUS_CYCLE_CPx
231 *
232 * Same as BCM1250
233 */
234
235
236/*
237 * System Performance Counter Configuration Register (Table 31)
238 * Register: PERF_CNT_CFG_0
239 *
240 * Since the clear/enable bits are moved compared to the
241 * 1250 and there are more fields, this register will be BCM1480 specific.
242 */
243
244#define S_BCM1480_SPC_CFG_SRC0 0
245#define M_BCM1480_SPC_CFG_SRC0 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC0)
246#define V_BCM1480_SPC_CFG_SRC0(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC0)
247#define G_BCM1480_SPC_CFG_SRC0(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC0,M_BCM1480_SPC_CFG_SRC0)
248
249#define S_BCM1480_SPC_CFG_SRC1 8
250#define M_BCM1480_SPC_CFG_SRC1 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC1)
251#define V_BCM1480_SPC_CFG_SRC1(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC1)
252#define G_BCM1480_SPC_CFG_SRC1(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC1,M_BCM1480_SPC_CFG_SRC1)
253
254#define S_BCM1480_SPC_CFG_SRC2 16
255#define M_BCM1480_SPC_CFG_SRC2 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC2)
256#define V_BCM1480_SPC_CFG_SRC2(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC2)
257#define G_BCM1480_SPC_CFG_SRC2(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC2,M_BCM1480_SPC_CFG_SRC2)
258
259#define S_BCM1480_SPC_CFG_SRC3 24
260#define M_BCM1480_SPC_CFG_SRC3 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC3)
261#define V_BCM1480_SPC_CFG_SRC3(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC3)
262#define G_BCM1480_SPC_CFG_SRC3(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC3,M_BCM1480_SPC_CFG_SRC3)
263
264#define S_BCM1480_SPC_CFG_SRC4 32
265#define M_BCM1480_SPC_CFG_SRC4 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC4)
266#define V_BCM1480_SPC_CFG_SRC4(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC4)
267#define G_BCM1480_SPC_CFG_SRC4(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC4,M_BCM1480_SPC_CFG_SRC4)
268
269#define S_BCM1480_SPC_CFG_SRC5 40
270#define M_BCM1480_SPC_CFG_SRC5 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC5)
271#define V_BCM1480_SPC_CFG_SRC5(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC5)
272#define G_BCM1480_SPC_CFG_SRC5(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC5,M_BCM1480_SPC_CFG_SRC5)
273
274#define S_BCM1480_SPC_CFG_SRC6 48
275#define M_BCM1480_SPC_CFG_SRC6 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC6)
276#define V_BCM1480_SPC_CFG_SRC6(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC6)
277#define G_BCM1480_SPC_CFG_SRC6(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC6,M_BCM1480_SPC_CFG_SRC6)
278
279#define S_BCM1480_SPC_CFG_SRC7 56
280#define M_BCM1480_SPC_CFG_SRC7 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC7)
281#define V_BCM1480_SPC_CFG_SRC7(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC7)
282#define G_BCM1480_SPC_CFG_SRC7(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC7,M_BCM1480_SPC_CFG_SRC7)
283
284/*
285 * System Performance Counter Control Register (Table 32)
286 * Register: PERF_CNT_CFG_1
287 * BCM1480 specific
288 */
289
290#define M_BCM1480_SPC_CFG_CLEAR _SB_MAKEMASK1(0)
291#define M_BCM1480_SPC_CFG_ENABLE _SB_MAKEMASK1(1)
292
293/*
294 * System Performance Counters (Table 33)
295 * Registers: PERF_CNT_x
296 */
297
298#define S_BCM1480_SPC_CNT_COUNT 0
299#define M_BCM1480_SPC_CNT_COUNT _SB_MAKEMASK(40,S_BCM1480_SPC_CNT_COUNT)
300#define V_BCM1480_SPC_CNT_COUNT(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CNT_COUNT)
301#define G_BCM1480_SPC_CNT_COUNT(x) _SB_GETVALUE(x,S_BCM1480_SPC_CNT_COUNT,M_BCM1480_SPC_CNT_COUNT)
302
303#define M_BCM1480_SPC_CNT_OFLOW _SB_MAKEMASK1(40)
304
305
306/*
307 * Bus Watcher Error Status Register (Tables 36, 37)
308 * Registers: BUS_ERR_STATUS, BUS_ERR_STATUS_DEBUG
309 * Same as BCM1250.
310 */
311
312/*
313 * Bus Watcher Error Data Registers (Table 38)
314 * Registers: BUS_ERR_DATA_x
315 * Same as BCM1250.
316 */
317
318/*
319 * Bus Watcher L2 ECC Counter Register (Table 39)
320 * Register: BUS_L2_ERRORS
321 * Same as BCM1250.
322 */
323
324
325/*
326 * Bus Watcher Memory and I/O Error Counter Register (Table 40)
327 * Register: BUS_MEM_IO_ERRORS
328 * Same as BCM1250.
329 */
330
331
332/*
333 * Address Trap Registers
334 *
335 * Register layout same as BCM1250, almost. The bus agents
336 * are different, and the address trap configuration bits are
337 * slightly different.
338 */
339
340#define M_BCM1480_ATRAP_INDEX _SB_MAKEMASK(4,0)
341#define M_BCM1480_ATRAP_ADDRESS _SB_MAKEMASK(40,0)
342
343#define S_BCM1480_ATRAP_CFG_CNT 0
344#define M_BCM1480_ATRAP_CFG_CNT _SB_MAKEMASK(3,S_BCM1480_ATRAP_CFG_CNT)
345#define V_BCM1480_ATRAP_CFG_CNT(x) _SB_MAKEVALUE(x,S_BCM1480_ATRAP_CFG_CNT)
346#define G_BCM1480_ATRAP_CFG_CNT(x) _SB_GETVALUE(x,S_BCM1480_ATRAP_CFG_CNT,M_BCM1480_ATRAP_CFG_CNT)
347
348#define M_BCM1480_ATRAP_CFG_WRITE _SB_MAKEMASK1(3)
349#define M_BCM1480_ATRAP_CFG_ALL _SB_MAKEMASK1(4)
350#define M_BCM1480_ATRAP_CFG_INV _SB_MAKEMASK1(5)
351#define M_BCM1480_ATRAP_CFG_USESRC _SB_MAKEMASK1(6)
352#define M_BCM1480_ATRAP_CFG_SRCINV _SB_MAKEMASK1(7)
353
354#define S_BCM1480_ATRAP_CFG_AGENTID 8
355#define M_BCM1480_ATRAP_CFG_AGENTID _SB_MAKEMASK(4,S_BCM1480_ATRAP_CFG_AGENTID)
356#define V_BCM1480_ATRAP_CFG_AGENTID(x) _SB_MAKEVALUE(x,S_BCM1480_ATRAP_CFG_AGENTID)
357#define G_BCM1480_ATRAP_CFG_AGENTID(x) _SB_GETVALUE(x,S_BCM1480_ATRAP_CFG_AGENTID,M_BCM1480_ATRAP_CFG_AGENTID)
358
359
360#define K_BCM1480_BUS_AGENT_CPU0 0
361#define K_BCM1480_BUS_AGENT_CPU1 1
362#define K_BCM1480_BUS_AGENT_NC 2
363#define K_BCM1480_BUS_AGENT_IOB 3
364#define K_BCM1480_BUS_AGENT_SCD 4
365#define K_BCM1480_BUS_AGENT_L2C 6
366#define K_BCM1480_BUS_AGENT_MC 7
367#define K_BCM1480_BUS_AGENT_CPU2 8
368#define K_BCM1480_BUS_AGENT_CPU3 9
369#define K_BCM1480_BUS_AGENT_PM 10
370
371#define S_BCM1480_ATRAP_CFG_CATTR 12
372#define M_BCM1480_ATRAP_CFG_CATTR _SB_MAKEMASK(2,S_BCM1480_ATRAP_CFG_CATTR)
373#define V_BCM1480_ATRAP_CFG_CATTR(x) _SB_MAKEVALUE(x,S_BCM1480_ATRAP_CFG_CATTR)
374#define G_BCM1480_ATRAP_CFG_CATTR(x) _SB_GETVALUE(x,S_BCM1480_ATRAP_CFG_CATTR,M_BCM1480_ATRAP_CFG_CATTR)
375
376#define K_BCM1480_ATRAP_CFG_CATTR_IGNORE 0
377#define K_BCM1480_ATRAP_CFG_CATTR_UNC 1
378#define K_BCM1480_ATRAP_CFG_CATTR_NONCOH 2
379#define K_BCM1480_ATRAP_CFG_CATTR_COHERENT 3
380
381#define M_BCM1480_ATRAP_CFG_CATTRINV _SB_MAKEMASK1(14)
382
383
384/*
385 * Trace Event Registers (Table 47)
386 * Same as BCM1250.
387 */
388
389/*
390 * Trace Sequence Control Registers (Table 48)
391 * Registers: TRACE_SEQUENCE_x
392 *
393 * Same as BCM1250 except for two new fields.
394 */
395
396
397#define M_BCM1480_SCD_TRSEQ_TID_MATCH_EN _SB_MAKEMASK1(25)
398
399#define S_BCM1480_SCD_TRSEQ_SWFUNC 26
400#define M_BCM1480_SCD_TRSEQ_SWFUNC _SB_MAKEMASK(2,S_BCM1480_SCD_TRSEQ_SWFUNC)
401#define V_BCM1480_SCD_TRSEQ_SWFUNC(x) _SB_MAKEVALUE(x,S_BCM1480_SCD_TRSEQ_SWFUNC)
402#define G_BCM1480_SCD_TRSEQ_SWFUNC(x) _SB_GETVALUE(x,S_BCM1480_SCD_TRSEQ_SWFUNC,M_BCM1480_SCD_TRSEQ_SWFUNC)
403
404/*
405 * Trace Control Register (Table 49)
406 * Register: TRACE_CFG
407 *
408 * Bits 0..8 are the same as the BCM1250, rest are different.
409 * Entire register is redefined below.
410 */
411
412#define M_BCM1480_SCD_TRACE_CFG_RESET _SB_MAKEMASK1(0)
413#define M_BCM1480_SCD_TRACE_CFG_START_READ _SB_MAKEMASK1(1)
414#define M_BCM1480_SCD_TRACE_CFG_START _SB_MAKEMASK1(2)
415#define M_BCM1480_SCD_TRACE_CFG_STOP _SB_MAKEMASK1(3)
416#define M_BCM1480_SCD_TRACE_CFG_FREEZE _SB_MAKEMASK1(4)
417#define M_BCM1480_SCD_TRACE_CFG_FREEZE_FULL _SB_MAKEMASK1(5)
418#define M_BCM1480_SCD_TRACE_CFG_DEBUG_FULL _SB_MAKEMASK1(6)
419#define M_BCM1480_SCD_TRACE_CFG_FULL _SB_MAKEMASK1(7)
420#define M_BCM1480_SCD_TRACE_CFG_FORCE_CNT _SB_MAKEMASK1(8)
421
422#define S_BCM1480_SCD_TRACE_CFG_MODE 16
423#define M_BCM1480_SCD_TRACE_CFG_MODE _SB_MAKEMASK(2,S_BCM1480_SCD_TRACE_CFG_MODE)
424#define V_BCM1480_SCD_TRACE_CFG_MODE(x) _SB_MAKEVALUE(x,S_BCM1480_SCD_TRACE_CFG_MODE)
425#define G_BCM1480_SCD_TRACE_CFG_MODE(x) _SB_GETVALUE(x,S_BCM1480_SCD_TRACE_CFG_MODE,M_BCM1480_SCD_TRACE_CFG_MODE)
426
427#define K_BCM1480_SCD_TRACE_CFG_MODE_BLOCKERS 0
428#define K_BCM1480_SCD_TRACE_CFG_MODE_BYTEEN_INT 1
429#define K_BCM1480_SCD_TRACE_CFG_MODE_FLOW_ID 2
430
431#define S_BCM1480_SCD_TRACE_CFG_CUR_ADDR 24
432#define M_BCM1480_SCD_TRACE_CFG_CUR_ADDR _SB_MAKEMASK(8,S_BCM1480_SCD_TRACE_CFG_CUR_ADDR)
433#define V_BCM1480_SCD_TRACE_CFG_CUR_ADDR(x) _SB_MAKEVALUE(x,S_BCM1480_SCD_TRACE_CFG_CUR_ADDR)
434#define G_BCM1480_SCD_TRACE_CFG_CUR_ADDR(x) _SB_GETVALUE(x,S_BCM1480_SCD_TRACE_CFG_CUR_ADDR,M_BCM1480_SCD_TRACE_CFG_CUR_ADDR)
435
436#endif /* _BCM1480_SCD_H */
diff --git a/include/asm-mips/sibyte/bigsur.h b/include/asm-mips/sibyte/bigsur.h
new file mode 100644
index 000000000000..ebefe797fc1d
--- /dev/null
+++ b/include/asm-mips/sibyte/bigsur.h
@@ -0,0 +1,49 @@
1/*
2 * Copyright (C) 2000,2001,2002,2003,2004 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18#ifndef __ASM_SIBYTE_BIGSUR_H
19#define __ASM_SIBYTE_BIGSUR_H
20
21#include <asm/sibyte/sb1250.h>
22#include <asm/sibyte/bcm1480_int.h>
23
24#ifdef CONFIG_SIBYTE_BIGSUR
25#define SIBYTE_BOARD_NAME "BCM91x80A/B (BigSur)"
26#define SIBYTE_HAVE_PCMCIA 1
27#define SIBYTE_HAVE_IDE 1
28#endif
29
30/* Generic bus chip selects */
31#define LEDS_CS 3
32#define LEDS_PHYS 0x100a0000
33
34#ifdef SIBYTE_HAVE_IDE
35#define IDE_CS 4
36#define IDE_PHYS 0x100b0000
37#define K_GPIO_GB_IDE 4
38#define K_INT_GB_IDE (K_INT_GPIO_0 + K_GPIO_GB_IDE)
39#endif
40
41#ifdef SIBYTE_HAVE_PCMCIA
42#define PCMCIA_CS 6
43#define PCMCIA_PHYS 0x11000000
44#define K_GPIO_PC_READY 9
45#define K_INT_PC_READY (K_INT_GPIO_0 + K_GPIO_PC_READY)
46#endif
47
48#endif /* __ASM_SIBYTE_BIGSUR_H */
49
diff --git a/include/asm-mips/sibyte/board.h b/include/asm-mips/sibyte/board.h
index d7b11b6c7c32..900edcbeec37 100644
--- a/include/asm-mips/sibyte/board.h
+++ b/include/asm-mips/sibyte/board.h
@@ -21,8 +21,6 @@
21 21
22#include <linux/config.h> 22#include <linux/config.h>
23 23
24#ifdef CONFIG_SIBYTE_BOARD
25
26#if defined(CONFIG_SIBYTE_SWARM) || defined(CONFIG_SIBYTE_PTSWARM) || \ 24#if defined(CONFIG_SIBYTE_SWARM) || defined(CONFIG_SIBYTE_PTSWARM) || \
27 defined(CONFIG_SIBYTE_CRHONE) || defined(CONFIG_SIBYTE_CRHINE) || \ 25 defined(CONFIG_SIBYTE_CRHONE) || defined(CONFIG_SIBYTE_CRHINE) || \
28 defined(CONFIG_SIBYTE_LITTLESUR) 26 defined(CONFIG_SIBYTE_LITTLESUR)
@@ -37,6 +35,10 @@
37#include <asm/sibyte/carmel.h> 35#include <asm/sibyte/carmel.h>
38#endif 36#endif
39 37
38#ifdef CONFIG_SIBYTE_BIGSUR
39#include <asm/sibyte/bigsur.h>
40#endif
41
40#ifdef __ASSEMBLY__ 42#ifdef __ASSEMBLY__
41 43
42#ifdef LEDS_PHYS 44#ifdef LEDS_PHYS
@@ -54,16 +56,6 @@
54#define setleds(t0,t1,c0,c1,c2,c3) 56#define setleds(t0,t1,c0,c1,c2,c3)
55#endif /* LEDS_PHYS */ 57#endif /* LEDS_PHYS */
56 58
57#else
58
59#ifdef LEDS_PHYS
60extern void setleds(char *str);
61#else
62#define setleds(s) do { } while (0)
63#endif /* LEDS_PHYS */
64
65#endif /* __ASSEMBLY__ */ 59#endif /* __ASSEMBLY__ */
66 60
67#endif /* CONFIG_SIBYTE_BOARD */
68
69#endif /* _SIBYTE_BOARD_H */ 61#endif /* _SIBYTE_BOARD_H */
diff --git a/include/asm-mips/sibyte/sb1250.h b/include/asm-mips/sibyte/sb1250.h
index d62da4e2dd36..a474c29cd701 100644
--- a/include/asm-mips/sibyte/sb1250.h
+++ b/include/asm-mips/sibyte/sb1250.h
@@ -27,6 +27,9 @@
27 27
28#define SB1250_NR_IRQS 64 28#define SB1250_NR_IRQS 64
29 29
30#define BCM1480_NR_IRQS 128
31#define BCM1480_NR_IRQS_HALF 64
32
30#define SB1250_DUART_MINOR_BASE 64 33#define SB1250_DUART_MINOR_BASE 64
31 34
32#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
@@ -35,6 +38,7 @@
35 38
36/* For revision/pass information */ 39/* For revision/pass information */
37#include <asm/sibyte/sb1250_scd.h> 40#include <asm/sibyte/sb1250_scd.h>
41#include <asm/sibyte/bcm1480_scd.h>
38extern unsigned int sb1_pass; 42extern unsigned int sb1_pass;
39extern unsigned int soc_pass; 43extern unsigned int soc_pass;
40extern unsigned int soc_type; 44extern unsigned int soc_type;
@@ -46,6 +50,13 @@ extern unsigned long sb1250_gettimeoffset(void);
46extern void sb1250_mask_irq(int cpu, int irq); 50extern void sb1250_mask_irq(int cpu, int irq);
47extern void sb1250_unmask_irq(int cpu, int irq); 51extern void sb1250_unmask_irq(int cpu, int irq);
48extern void sb1250_smp_finish(void); 52extern void sb1250_smp_finish(void);
53
54extern void bcm1480_time_init(void);
55extern unsigned long bcm1480_gettimeoffset(void);
56extern void bcm1480_mask_irq(int cpu, int irq);
57extern void bcm1480_unmask_irq(int cpu, int irq);
58extern void bcm1480_smp_finish(void);
59
49extern void prom_printf(char *fmt, ...); 60extern void prom_printf(char *fmt, ...);
50 61
51#define AT_spin \ 62#define AT_spin \
@@ -58,6 +69,6 @@ extern void prom_printf(char *fmt, ...);
58 69
59#endif 70#endif
60 71
61#define IOADDR(a) (IO_BASE + (a)) 72#define IOADDR(a) ((volatile void __iomem *)(IO_BASE + (a)))
62 73
63#endif 74#endif
diff --git a/include/asm-mips/sibyte/sb1250_defs.h b/include/asm-mips/sibyte/sb1250_defs.h
index 40ef97c76c8b..335dbaf1d831 100644
--- a/include/asm-mips/sibyte/sb1250_defs.h
+++ b/include/asm-mips/sibyte/sb1250_defs.h
@@ -8,8 +8,6 @@
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg
12 *
13 ********************************************************************* 11 *********************************************************************
14 * 12 *
15 * Copyright 2000,2001,2002,2003 13 * Copyright 2000,2001,2002,2003
@@ -97,13 +95,17 @@
97 * ordering, so be careful when adding support for new minor revs. 95 * ordering, so be careful when adding support for new minor revs.
98 ********************************************************************* */ 96 ********************************************************************* */
99 97
100#define SIBYTE_HDR_FMASK_1250_ALL 0x00000ff 98#define SIBYTE_HDR_FMASK_1250_ALL 0x000000ff
101#define SIBYTE_HDR_FMASK_1250_PASS1 0x0000001 99#define SIBYTE_HDR_FMASK_1250_PASS1 0x00000001
102#define SIBYTE_HDR_FMASK_1250_PASS2 0x0000002 100#define SIBYTE_HDR_FMASK_1250_PASS2 0x00000002
103#define SIBYTE_HDR_FMASK_1250_PASS3 0x0000004 101#define SIBYTE_HDR_FMASK_1250_PASS3 0x00000004
102
103#define SIBYTE_HDR_FMASK_112x_ALL 0x00000f00
104#define SIBYTE_HDR_FMASK_112x_PASS1 0x00000100
104 105
105#define SIBYTE_HDR_FMASK_112x_ALL 0x0000f00 106#define SIBYTE_HDR_FMASK_1480_ALL 0x0000f000
106#define SIBYTE_HDR_FMASK_112x_PASS1 0x0000100 107#define SIBYTE_HDR_FMASK_1480_PASS1 0x00001000
108#define SIBYTE_HDR_FMASK_1480_PASS2 0x00002000
107 109
108/* Bit mask for chip/revision. (use _ALL for all revisions of a chip). */ 110/* Bit mask for chip/revision. (use _ALL for all revisions of a chip). */
109#define SIBYTE_HDR_FMASK(chip, pass) \ 111#define SIBYTE_HDR_FMASK(chip, pass) \
@@ -111,8 +113,17 @@
111#define SIBYTE_HDR_FMASK_ALLREVS(chip) \ 113#define SIBYTE_HDR_FMASK_ALLREVS(chip) \
112 (SIBYTE_HDR_FMASK_ ## chip ## _ALL) 114 (SIBYTE_HDR_FMASK_ ## chip ## _ALL)
113 115
116/* Default constant value for all chips, all revisions */
114#define SIBYTE_HDR_FMASK_ALL \ 117#define SIBYTE_HDR_FMASK_ALL \
118 (SIBYTE_HDR_FMASK_1250_ALL | SIBYTE_HDR_FMASK_112x_ALL \
119 | SIBYTE_HDR_FMASK_1480_ALL)
120
121/* This one is used for the "original" BCM1250/BCM112x chips. We use this
122 to weed out constants and macros that do not exist on later chips like
123 the BCM1480 */
124#define SIBYTE_HDR_FMASK_1250_112x_ALL \
115 (SIBYTE_HDR_FMASK_1250_ALL | SIBYTE_HDR_FMASK_112x_ALL) 125 (SIBYTE_HDR_FMASK_1250_ALL | SIBYTE_HDR_FMASK_112x_ALL)
126#define SIBYTE_HDR_FMASK_1250_112x SIBYTE_HDR_FMASK_1250_112x_ALL
116 127
117#ifndef SIBYTE_HDR_FEATURES 128#ifndef SIBYTE_HDR_FEATURES
118#define SIBYTE_HDR_FEATURES SIBYTE_HDR_FMASK_ALL 129#define SIBYTE_HDR_FEATURES SIBYTE_HDR_FMASK_ALL
@@ -133,6 +144,12 @@
133#define SIBYTE_HDR_FEATURE_CHIP(chip) \ 144#define SIBYTE_HDR_FEATURE_CHIP(chip) \
134 (!! (SIBYTE_HDR_FMASK_ALLREVS(chip) & SIBYTE_HDR_FEATURES)) 145 (!! (SIBYTE_HDR_FMASK_ALLREVS(chip) & SIBYTE_HDR_FEATURES))
135 146
147/* True for all versions of the BCM1250 and BCM1125, but not true for
148 anything else */
149#define SIBYTE_HDR_FEATURE_1250_112x \
150 (SIBYTE_HDR_FEATURE_CHIP(1250) || SIBYTE_HDR_FEATURE_CHIP(112x))
151/* (!! (SIBYTE_HDR_FEATURES & SIBYHTE_HDR_FMASK_1250_112x)) */
152
136/* True if header features enabled for that rev or later, inclusive. */ 153/* True if header features enabled for that rev or later, inclusive. */
137#define SIBYTE_HDR_FEATURE(chip, pass) \ 154#define SIBYTE_HDR_FEATURE(chip, pass) \
138 (!! ((SIBYTE_HDR_FMASK(chip, pass) \ 155 (!! ((SIBYTE_HDR_FMASK(chip, pass) \
diff --git a/include/asm-mips/sibyte/sb1250_dma.h b/include/asm-mips/sibyte/sb1250_dma.h
index 3cdb48f50ed0..e6145f524fbd 100644
--- a/include/asm-mips/sibyte/sb1250_dma.h
+++ b/include/asm-mips/sibyte/sb1250_dma.h
@@ -7,9 +7,8 @@
7 * programming the SB1250's DMA controllers, both the data mover 7 * programming the SB1250's DMA controllers, both the data mover
8 * and the Ethernet DMA. 8 * and the Ethernet DMA.
9 * 9 *
10 * SB1250 specification level: User's manual 1/02/02 10 * SB1250 specification level: User's manual 10/21/02
11 * 11 * BCM1280 specification level: User's manual 11/24/03
12 * Author: Mitch Lichtenberg
13 * 12 *
14 ********************************************************************* 13 *********************************************************************
15 * 14 *
@@ -58,17 +57,17 @@
58#define M_DMA_RESERVED1 _SB_MAKEMASK1(2) 57#define M_DMA_RESERVED1 _SB_MAKEMASK1(2)
59 58
60#define S_DMA_DESC_TYPE _SB_MAKE64(1) 59#define S_DMA_DESC_TYPE _SB_MAKE64(1)
61#define M_DMA_DESC_TYPE _SB_MAKE64(2,S_DMA_DESC_TYPE) 60#define M_DMA_DESC_TYPE _SB_MAKEMASK(2,S_DMA_DESC_TYPE)
62#define V_DMA_DESC_TYPE(x) _SB_MAKEVALUE(x,S_DMA_DESC_TYPE) 61#define V_DMA_DESC_TYPE(x) _SB_MAKEVALUE(x,S_DMA_DESC_TYPE)
63#define G_DMA_DESC_TYPE(x) _SB_GETVALUE(x,S_DMA_DESC_TYPE,M_DMA_DESC_TYPE) 62#define G_DMA_DESC_TYPE(x) _SB_GETVALUE(x,S_DMA_DESC_TYPE,M_DMA_DESC_TYPE)
64 63
65#define K_DMA_DESC_TYPE_RING_AL 0 64#define K_DMA_DESC_TYPE_RING_AL 0
66#define K_DMA_DESC_TYPE_CHAIN_AL 1 65#define K_DMA_DESC_TYPE_CHAIN_AL 1
67 66
68#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 67#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
69#define K_DMA_DESC_TYPE_RING_UAL_WI 2 68#define K_DMA_DESC_TYPE_RING_UAL_WI 2
70#define K_DMA_DESC_TYPE_RING_UAL_RMW 3 69#define K_DMA_DESC_TYPE_RING_UAL_RMW 3
71#endif /* 1250 PASS3 || 112x PASS1 */ 70#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
72 71
73#define M_DMA_EOP_INT_EN _SB_MAKEMASK1(3) 72#define M_DMA_EOP_INT_EN _SB_MAKEMASK1(3)
74#define M_DMA_HWM_INT_EN _SB_MAKEMASK1(4) 73#define M_DMA_HWM_INT_EN _SB_MAKEMASK1(4)
@@ -111,11 +110,11 @@
111#define M_DMA_NO_DSCR_UPDT _SB_MAKEMASK1(4) 110#define M_DMA_NO_DSCR_UPDT _SB_MAKEMASK1(4)
112#define M_DMA_L2CA _SB_MAKEMASK1(5) 111#define M_DMA_L2CA _SB_MAKEMASK1(5)
113 112
114#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 113#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
115#define M_DMA_RX_XTRA_STATUS _SB_MAKEMASK1(6) 114#define M_DMA_RX_XTRA_STATUS _SB_MAKEMASK1(6)
116#define M_DMA_TX_CPU_PAUSE _SB_MAKEMASK1(6) 115#define M_DMA_TX_CPU_PAUSE _SB_MAKEMASK1(6)
117#define M_DMA_TX_FC_PAUSE_EN _SB_MAKEMASK1(7) 116#define M_DMA_TX_FC_PAUSE_EN _SB_MAKEMASK1(7)
118#endif /* 1250 PASS3 || 112x PASS1 */ 117#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
119 118
120#define M_DMA_MBZ1 _SB_MAKEMASK(6,15) 119#define M_DMA_MBZ1 _SB_MAKEMASK(6,15)
121 120
@@ -165,14 +164,14 @@
165#define S_DMA_CURDSCR_COUNT _SB_MAKE64(40) 164#define S_DMA_CURDSCR_COUNT _SB_MAKE64(40)
166#define M_DMA_CURDSCR_COUNT _SB_MAKEMASK(16,S_DMA_CURDSCR_COUNT) 165#define M_DMA_CURDSCR_COUNT _SB_MAKEMASK(16,S_DMA_CURDSCR_COUNT)
167 166
168#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 167#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
169#define M_DMA_TX_CH_PAUSE_ON _SB_MAKEMASK1(56) 168#define M_DMA_TX_CH_PAUSE_ON _SB_MAKEMASK1(56)
170#endif /* 1250 PASS3 || 112x PASS1 */ 169#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
171 170
172/* 171/*
173 * Receive Packet Drop Registers 172 * Receive Packet Drop Registers
174 */ 173 */
175#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 174#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
176#define S_DMA_OODLOST_RX _SB_MAKE64(0) 175#define S_DMA_OODLOST_RX _SB_MAKE64(0)
177#define M_DMA_OODLOST_RX _SB_MAKEMASK(16,S_DMA_OODLOST_RX) 176#define M_DMA_OODLOST_RX _SB_MAKEMASK(16,S_DMA_OODLOST_RX)
178#define G_DMA_OODLOST_RX(x) _SB_GETVALUE(x,S_DMA_OODLOST_RX,M_DMA_OODLOST_RX) 177#define G_DMA_OODLOST_RX(x) _SB_GETVALUE(x,S_DMA_OODLOST_RX,M_DMA_OODLOST_RX)
@@ -180,7 +179,7 @@
180#define S_DMA_EOP_COUNT_RX _SB_MAKE64(16) 179#define S_DMA_EOP_COUNT_RX _SB_MAKE64(16)
181#define M_DMA_EOP_COUNT_RX _SB_MAKEMASK(8,S_DMA_EOP_COUNT_RX) 180#define M_DMA_EOP_COUNT_RX _SB_MAKEMASK(8,S_DMA_EOP_COUNT_RX)
182#define G_DMA_EOP_COUNT_RX(x) _SB_GETVALUE(x,S_DMA_EOP_COUNT_RX,M_DMA_EOP_COUNT_RX) 181#define G_DMA_EOP_COUNT_RX(x) _SB_GETVALUE(x,S_DMA_EOP_COUNT_RX,M_DMA_EOP_COUNT_RX)
183#endif /* 1250 PASS3 || 112x PASS1 */ 182#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
184 183
185/* ********************************************************************* 184/* *********************************************************************
186 * DMA Descriptors 185 * DMA Descriptors
@@ -201,21 +200,21 @@
201 200
202#define M_DMA_DSCRA_A_ADDR_OFFSET (M_DMA_DSCRA_OFFSET | M_DMA_DSCRA_A_ADDR) 201#define M_DMA_DSCRA_A_ADDR_OFFSET (M_DMA_DSCRA_OFFSET | M_DMA_DSCRA_A_ADDR)
203 202
204#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 203#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
205#define S_DMA_DSCRA_A_ADDR_UA _SB_MAKE64(0) 204#define S_DMA_DSCRA_A_ADDR_UA _SB_MAKE64(0)
206#define M_DMA_DSCRA_A_ADDR_UA _SB_MAKEMASK(40,S_DMA_DSCRA_A_ADDR_UA) 205#define M_DMA_DSCRA_A_ADDR_UA _SB_MAKEMASK(40,S_DMA_DSCRA_A_ADDR_UA)
207#endif /* 1250 PASS3 || 112x PASS1 */ 206#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
208 207
209#define S_DMA_DSCRA_A_SIZE _SB_MAKE64(40) 208#define S_DMA_DSCRA_A_SIZE _SB_MAKE64(40)
210#define M_DMA_DSCRA_A_SIZE _SB_MAKEMASK(9,S_DMA_DSCRA_A_SIZE) 209#define M_DMA_DSCRA_A_SIZE _SB_MAKEMASK(9,S_DMA_DSCRA_A_SIZE)
211#define V_DMA_DSCRA_A_SIZE(x) _SB_MAKEVALUE(x,S_DMA_DSCRA_A_SIZE) 210#define V_DMA_DSCRA_A_SIZE(x) _SB_MAKEVALUE(x,S_DMA_DSCRA_A_SIZE)
212#define G_DMA_DSCRA_A_SIZE(x) _SB_GETVALUE(x,S_DMA_DSCRA_A_SIZE,M_DMA_DSCRA_A_SIZE) 211#define G_DMA_DSCRA_A_SIZE(x) _SB_GETVALUE(x,S_DMA_DSCRA_A_SIZE,M_DMA_DSCRA_A_SIZE)
213 212
214#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 213#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
215#define S_DMA_DSCRA_DSCR_CNT _SB_MAKE64(40) 214#define S_DMA_DSCRA_DSCR_CNT _SB_MAKE64(40)
216#define M_DMA_DSCRA_DSCR_CNT _SB_MAKEMASK(8,S_DMA_DSCRA_DSCR_CNT) 215#define M_DMA_DSCRA_DSCR_CNT _SB_MAKEMASK(8,S_DMA_DSCRA_DSCR_CNT)
217#define G_DMA_DSCRA_DSCR_CNT(x) _SB_GETVALUE(x,S_DMA_DSCRA_DSCR_CNT,M_DMA_DSCRA_DSCR_CNT) 216#define G_DMA_DSCRA_DSCR_CNT(x) _SB_GETVALUE(x,S_DMA_DSCRA_DSCR_CNT,M_DMA_DSCRA_DSCR_CNT)
218#endif /* 1250 PASS3 || 112x PASS1 */ 217#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
219 218
220#define M_DMA_DSCRA_INTERRUPT _SB_MAKEMASK1(49) 219#define M_DMA_DSCRA_INTERRUPT _SB_MAKEMASK1(49)
221#define M_DMA_DSCRA_OFFSETB _SB_MAKEMASK1(50) 220#define M_DMA_DSCRA_OFFSETB _SB_MAKEMASK1(50)
@@ -235,12 +234,12 @@
235#define V_DMA_DSCRB_OPTIONS(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_OPTIONS) 234#define V_DMA_DSCRB_OPTIONS(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_OPTIONS)
236#define G_DMA_DSCRB_OPTIONS(x) _SB_GETVALUE(x,S_DMA_DSCRB_OPTIONS,M_DMA_DSCRB_OPTIONS) 235#define G_DMA_DSCRB_OPTIONS(x) _SB_GETVALUE(x,S_DMA_DSCRB_OPTIONS,M_DMA_DSCRB_OPTIONS)
237 236
238#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 237#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
239#define S_DMA_DSCRB_A_SIZE _SB_MAKE64(8) 238#define S_DMA_DSCRB_A_SIZE _SB_MAKE64(8)
240#define M_DMA_DSCRB_A_SIZE _SB_MAKEMASK(14,S_DMA_DSCRB_A_SIZE) 239#define M_DMA_DSCRB_A_SIZE _SB_MAKEMASK(14,S_DMA_DSCRB_A_SIZE)
241#define V_DMA_DSCRB_A_SIZE(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_A_SIZE) 240#define V_DMA_DSCRB_A_SIZE(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_A_SIZE)
242#define G_DMA_DSCRB_A_SIZE(x) _SB_GETVALUE(x,S_DMA_DSCRB_A_SIZE,M_DMA_DSCRB_A_SIZE) 241#define G_DMA_DSCRB_A_SIZE(x) _SB_GETVALUE(x,S_DMA_DSCRB_A_SIZE,M_DMA_DSCRB_A_SIZE)
243#endif /* 1250 PASS3 || 112x PASS1 */ 242#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
244 243
245#define R_DMA_DSCRB_ADDR _SB_MAKE64(0x10) 244#define R_DMA_DSCRB_ADDR _SB_MAKE64(0x10)
246 245
@@ -255,12 +254,12 @@
255 254
256#define M_DMA_DSCRB_B_VALID _SB_MAKEMASK1(49) 255#define M_DMA_DSCRB_B_VALID _SB_MAKEMASK1(49)
257 256
258#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 257#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
259#define S_DMA_DSCRB_PKT_SIZE_MSB _SB_MAKE64(48) 258#define S_DMA_DSCRB_PKT_SIZE_MSB _SB_MAKE64(48)
260#define M_DMA_DSCRB_PKT_SIZE_MSB _SB_MAKEMASK(2,S_DMA_DSCRB_PKT_SIZE_MSB) 259#define M_DMA_DSCRB_PKT_SIZE_MSB _SB_MAKEMASK(2,S_DMA_DSCRB_PKT_SIZE_MSB)
261#define V_DMA_DSCRB_PKT_SIZE_MSB(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_PKT_SIZE_MSB) 260#define V_DMA_DSCRB_PKT_SIZE_MSB(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_PKT_SIZE_MSB)
262#define G_DMA_DSCRB_PKT_SIZE_MSB(x) _SB_GETVALUE(x,S_DMA_DSCRB_PKT_SIZE_MSB,M_DMA_DSCRB_PKT_SIZE_MSB) 261#define G_DMA_DSCRB_PKT_SIZE_MSB(x) _SB_GETVALUE(x,S_DMA_DSCRB_PKT_SIZE_MSB,M_DMA_DSCRB_PKT_SIZE_MSB)
263#endif /* 1250 PASS3 || 112x PASS1 */ 262#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
264 263
265#define S_DMA_DSCRB_PKT_SIZE _SB_MAKE64(50) 264#define S_DMA_DSCRB_PKT_SIZE _SB_MAKE64(50)
266#define M_DMA_DSCRB_PKT_SIZE _SB_MAKEMASK(14,S_DMA_DSCRB_PKT_SIZE) 265#define M_DMA_DSCRB_PKT_SIZE _SB_MAKEMASK(14,S_DMA_DSCRB_PKT_SIZE)
@@ -282,15 +281,16 @@
282#define M_DMA_ETHRX_BADIP4CS _SB_MAKEMASK1(51) 281#define M_DMA_ETHRX_BADIP4CS _SB_MAKEMASK1(51)
283#define M_DMA_ETHRX_DSCRERR _SB_MAKEMASK1(52) 282#define M_DMA_ETHRX_DSCRERR _SB_MAKEMASK1(52)
284 283
285#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 284#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
286/* Note: BADTCPCS is actually in DSCR_B options field */ 285/* Note: This bit is in the DSCR_B options field */
287#define M_DMA_ETHRX_BADTCPCS _SB_MAKEMASK1(0) 286#define M_DMA_ETHRX_BADTCPCS _SB_MAKEMASK1(0)
288#endif /* 1250 PASS2 || 112x PASS1 */ 287#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
289 288
290#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 289#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
290/* Note: These bits are in the DSCR_B options field */
291#define M_DMA_ETH_VLAN_FLAG _SB_MAKEMASK1(1) 291#define M_DMA_ETH_VLAN_FLAG _SB_MAKEMASK1(1)
292#define M_DMA_ETH_CRC_FLAG _SB_MAKEMASK1(2) 292#define M_DMA_ETH_CRC_FLAG _SB_MAKEMASK1(2)
293#endif /* 1250 PASS3 || 112x PASS1 */ 293#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
294 294
295#define S_DMA_ETHRX_RXCH 53 295#define S_DMA_ETHRX_RXCH 53
296#define M_DMA_ETHRX_RXCH _SB_MAKEMASK(2,S_DMA_ETHRX_RXCH) 296#define M_DMA_ETHRX_RXCH _SB_MAKEMASK(2,S_DMA_ETHRX_RXCH)
@@ -438,7 +438,7 @@
438 M_DM_CUR_DSCR_DSCR_COUNT) 438 M_DM_CUR_DSCR_DSCR_COUNT)
439 439
440 440
441#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 441#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
442/* 442/*
443 * Data Mover Channel Partial Result Registers 443 * Data Mover Channel Partial Result Registers
444 * Register: DM_PARTIAL_0 444 * Register: DM_PARTIAL_0
@@ -459,10 +459,10 @@
459 M_DM_PARTIAL_TCPCS_PARTIAL) 459 M_DM_PARTIAL_TCPCS_PARTIAL)
460 460
461#define M_DM_PARTIAL_ODD_BYTE _SB_MAKEMASK1(48) 461#define M_DM_PARTIAL_ODD_BYTE _SB_MAKEMASK1(48)
462#endif /* 1250 PASS3 || 112x PASS1 */ 462#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
463 463
464 464
465#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 465#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
466/* 466/*
467 * Data Mover CRC Definition Registers 467 * Data Mover CRC Definition Registers
468 * Register: CRC_DEF_0 468 * Register: CRC_DEF_0
@@ -479,10 +479,10 @@
479#define V_CRC_DEF_CRC_POLY(r) _SB_MAKEVALUE(r,S_CRC_DEF_CRC_POLY) 479#define V_CRC_DEF_CRC_POLY(r) _SB_MAKEVALUE(r,S_CRC_DEF_CRC_POLY)
480#define G_CRC_DEF_CRC_POLY(r) _SB_GETVALUE(r,S_CRC_DEF_CRC_POLY,\ 480#define G_CRC_DEF_CRC_POLY(r) _SB_GETVALUE(r,S_CRC_DEF_CRC_POLY,\
481 M_CRC_DEF_CRC_POLY) 481 M_CRC_DEF_CRC_POLY)
482#endif /* 1250 PASS3 || 112x PASS1 */ 482#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
483 483
484 484
485#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 485#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
486/* 486/*
487 * Data Mover CRC/Checksum Definition Registers 487 * Data Mover CRC/Checksum Definition Registers
488 * Register: CTCP_DEF_0 488 * Register: CTCP_DEF_0
@@ -511,7 +511,7 @@
511#define K_CTCP_DEF_CRC_WIDTH_1 2 511#define K_CTCP_DEF_CRC_WIDTH_1 2
512 512
513#define M_CTCP_DEF_CRC_BIT_ORDER _SB_MAKEMASK1(50) 513#define M_CTCP_DEF_CRC_BIT_ORDER _SB_MAKEMASK1(50)
514#endif /* 1250 PASS3 || 112x PASS1 */ 514#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
515 515
516 516
517/* 517/*
@@ -560,12 +560,12 @@
560#define M_DM_DSCRA_L2C_DEST _SB_MAKEMASK1(50) 560#define M_DM_DSCRA_L2C_DEST _SB_MAKEMASK1(50)
561#define M_DM_DSCRA_L2C_SRC _SB_MAKEMASK1(51) 561#define M_DM_DSCRA_L2C_SRC _SB_MAKEMASK1(51)
562 562
563#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 563#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
564#define M_DM_DSCRA_RD_BKOFF _SB_MAKEMASK1(52) 564#define M_DM_DSCRA_RD_BKOFF _SB_MAKEMASK1(52)
565#define M_DM_DSCRA_WR_BKOFF _SB_MAKEMASK1(53) 565#define M_DM_DSCRA_WR_BKOFF _SB_MAKEMASK1(53)
566#endif /* 1250 PASS2 || 112x PASS1 */ 566#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
567 567
568#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 568#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
569#define M_DM_DSCRA_TCPCS_EN _SB_MAKEMASK1(54) 569#define M_DM_DSCRA_TCPCS_EN _SB_MAKEMASK1(54)
570#define M_DM_DSCRA_TCPCS_RES _SB_MAKEMASK1(55) 570#define M_DM_DSCRA_TCPCS_RES _SB_MAKEMASK1(55)
571#define M_DM_DSCRA_TCPCS_AP _SB_MAKEMASK1(56) 571#define M_DM_DSCRA_TCPCS_AP _SB_MAKEMASK1(56)
@@ -574,7 +574,7 @@
574#define M_DM_DSCRA_CRC_AP _SB_MAKEMASK1(59) 574#define M_DM_DSCRA_CRC_AP _SB_MAKEMASK1(59)
575#define M_DM_DSCRA_CRC_DFN _SB_MAKEMASK1(60) 575#define M_DM_DSCRA_CRC_DFN _SB_MAKEMASK1(60)
576#define M_DM_DSCRA_CRC_XBIT _SB_MAKEMASK1(61) 576#define M_DM_DSCRA_CRC_XBIT _SB_MAKEMASK1(61)
577#endif /* 1250 PASS3 || 112x PASS1 */ 577#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
578 578
579#define M_DM_DSCRA_RESERVED2 _SB_MAKEMASK(3,61) 579#define M_DM_DSCRA_RESERVED2 _SB_MAKEMASK(3,61)
580 580
diff --git a/include/asm-mips/sibyte/sb1250_genbus.h b/include/asm-mips/sibyte/sb1250_genbus.h
index f1f509f295c4..1b5cbc5c6454 100644
--- a/include/asm-mips/sibyte/sb1250_genbus.h
+++ b/include/asm-mips/sibyte/sb1250_genbus.h
@@ -6,9 +6,8 @@
6 * This module contains constants and macros useful for 6 * This module contains constants and macros useful for
7 * manipulating the SB1250's Generic Bus interface 7 * manipulating the SB1250's Generic Bus interface
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 10/21/02
10 * 10 * BCM1280 specification level: User's Manual 11/14/03
11 * Author: Mitch Lichtenberg
12 * 11 *
13 ********************************************************************* 12 *********************************************************************
14 * 13 *
@@ -51,19 +50,21 @@
51#define M_IO_WIDTH_SEL _SB_MAKEMASK(2,S_IO_WIDTH_SEL) 50#define M_IO_WIDTH_SEL _SB_MAKEMASK(2,S_IO_WIDTH_SEL)
52#define K_IO_WIDTH_SEL_1 0 51#define K_IO_WIDTH_SEL_1 0
53#define K_IO_WIDTH_SEL_2 1 52#define K_IO_WIDTH_SEL_2 1
54#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 53#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \
54 || SIBYTE_HDR_FEATURE_CHIP(1480)
55#define K_IO_WIDTH_SEL_1L 2 55#define K_IO_WIDTH_SEL_1L 2
56#endif /* 1250 PASS2 || 112x PASS1 */ 56#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
57#define K_IO_WIDTH_SEL_4 3 57#define K_IO_WIDTH_SEL_4 3
58#define V_IO_WIDTH_SEL(x) _SB_MAKEVALUE(x,S_IO_WIDTH_SEL) 58#define V_IO_WIDTH_SEL(x) _SB_MAKEVALUE(x,S_IO_WIDTH_SEL)
59#define G_IO_WIDTH_SEL(x) _SB_GETVALUE(x,S_IO_WIDTH_SEL,M_IO_WIDTH_SEL) 59#define G_IO_WIDTH_SEL(x) _SB_GETVALUE(x,S_IO_WIDTH_SEL,M_IO_WIDTH_SEL)
60 60
61#define S_IO_PARITY_ENA 4 61#define S_IO_PARITY_ENA 4
62#define M_IO_PARITY_ENA _SB_MAKEMASK1(S_IO_PARITY_ENA) 62#define M_IO_PARITY_ENA _SB_MAKEMASK1(S_IO_PARITY_ENA)
63#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 63#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \
64 || SIBYTE_HDR_FEATURE_CHIP(1480)
64#define S_IO_BURST_EN 5 65#define S_IO_BURST_EN 5
65#define M_IO_BURST_EN _SB_MAKEMASK1(S_IO_BURST_EN) 66#define M_IO_BURST_EN _SB_MAKEMASK1(S_IO_BURST_EN)
66#endif /* 1250 PASS2 || 112x PASS1 */ 67#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
67#define S_IO_PARITY_ODD 6 68#define S_IO_PARITY_ODD 6
68#define M_IO_PARITY_ODD _SB_MAKEMASK1(S_IO_PARITY_ODD) 69#define M_IO_PARITY_ODD _SB_MAKEMASK1(S_IO_PARITY_ODD)
69#define S_IO_NONMUX 7 70#define S_IO_NONMUX 7
@@ -96,8 +97,11 @@
96 97
97#define S_IO_ADDRBASE 16 /* # bits to shift addr for this reg */ 98#define S_IO_ADDRBASE 16 /* # bits to shift addr for this reg */
98 99
100#define M_IO_BLK_CACHE _SB_MAKEMASK1(15)
101
102
99/* 103/*
100 * Generic Bus Region 0 Timing Registers (Table 11-7) 104 * Generic Bus Timing 0 Registers (Table 11-7)
101 */ 105 */
102 106
103#define S_IO_ALE_WIDTH 0 107#define S_IO_ALE_WIDTH 0
@@ -105,21 +109,23 @@
105#define V_IO_ALE_WIDTH(x) _SB_MAKEVALUE(x,S_IO_ALE_WIDTH) 109#define V_IO_ALE_WIDTH(x) _SB_MAKEVALUE(x,S_IO_ALE_WIDTH)
106#define G_IO_ALE_WIDTH(x) _SB_GETVALUE(x,S_IO_ALE_WIDTH,M_IO_ALE_WIDTH) 110#define G_IO_ALE_WIDTH(x) _SB_GETVALUE(x,S_IO_ALE_WIDTH,M_IO_ALE_WIDTH)
107 111
108#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 112#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \
113 || SIBYTE_HDR_FEATURE_CHIP(1480)
109#define M_IO_EARLY_CS _SB_MAKEMASK1(3) 114#define M_IO_EARLY_CS _SB_MAKEMASK1(3)
110#endif /* 1250 PASS2 || 112x PASS1 */ 115#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
111 116
112#define S_IO_ALE_TO_CS 4 117#define S_IO_ALE_TO_CS 4
113#define M_IO_ALE_TO_CS _SB_MAKEMASK(2,S_IO_ALE_TO_CS) 118#define M_IO_ALE_TO_CS _SB_MAKEMASK(2,S_IO_ALE_TO_CS)
114#define V_IO_ALE_TO_CS(x) _SB_MAKEVALUE(x,S_IO_ALE_TO_CS) 119#define V_IO_ALE_TO_CS(x) _SB_MAKEVALUE(x,S_IO_ALE_TO_CS)
115#define G_IO_ALE_TO_CS(x) _SB_GETVALUE(x,S_IO_ALE_TO_CS,M_IO_ALE_TO_CS) 120#define G_IO_ALE_TO_CS(x) _SB_GETVALUE(x,S_IO_ALE_TO_CS,M_IO_ALE_TO_CS)
116 121
117#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 122#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \
123 || SIBYTE_HDR_FEATURE_CHIP(1480)
118#define S_IO_BURST_WIDTH _SB_MAKE64(6) 124#define S_IO_BURST_WIDTH _SB_MAKE64(6)
119#define M_IO_BURST_WIDTH _SB_MAKEMASK(2,S_IO_BURST_WIDTH) 125#define M_IO_BURST_WIDTH _SB_MAKEMASK(2,S_IO_BURST_WIDTH)
120#define V_IO_BURST_WIDTH(x) _SB_MAKEVALUE(x,S_IO_BURST_WIDTH) 126#define V_IO_BURST_WIDTH(x) _SB_MAKEVALUE(x,S_IO_BURST_WIDTH)
121#define G_IO_BURST_WIDTH(x) _SB_GETVALUE(x,S_IO_BURST_WIDTH,M_IO_BURST_WIDTH) 127#define G_IO_BURST_WIDTH(x) _SB_GETVALUE(x,S_IO_BURST_WIDTH,M_IO_BURST_WIDTH)
122#endif /* 1250 PASS2 || 112x PASS1 */ 128#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
123 129
124#define S_IO_CS_WIDTH 8 130#define S_IO_CS_WIDTH 8
125#define M_IO_CS_WIDTH _SB_MAKEMASK(5,S_IO_CS_WIDTH) 131#define M_IO_CS_WIDTH _SB_MAKEMASK(5,S_IO_CS_WIDTH)
@@ -141,9 +147,10 @@
141#define V_IO_ALE_TO_WRITE(x) _SB_MAKEVALUE(x,S_IO_ALE_TO_WRITE) 147#define V_IO_ALE_TO_WRITE(x) _SB_MAKEVALUE(x,S_IO_ALE_TO_WRITE)
142#define G_IO_ALE_TO_WRITE(x) _SB_GETVALUE(x,S_IO_ALE_TO_WRITE,M_IO_ALE_TO_WRITE) 148#define G_IO_ALE_TO_WRITE(x) _SB_GETVALUE(x,S_IO_ALE_TO_WRITE,M_IO_ALE_TO_WRITE)
143 149
144#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 150#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \
151 || SIBYTE_HDR_FEATURE_CHIP(1480)
145#define M_IO_RDY_SYNC _SB_MAKEMASK1(3) 152#define M_IO_RDY_SYNC _SB_MAKEMASK1(3)
146#endif /* 1250 PASS2 || 112x PASS1 */ 153#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
147 154
148#define S_IO_WRITE_WIDTH 4 155#define S_IO_WRITE_WIDTH 4
149#define M_IO_WRITE_WIDTH _SB_MAKEMASK(4,S_IO_WRITE_WIDTH) 156#define M_IO_WRITE_WIDTH _SB_MAKEMASK(4,S_IO_WRITE_WIDTH)
@@ -183,9 +190,127 @@
183#define M_IO_TIMEOUT_INT _SB_MAKEMASK1(10) 190#define M_IO_TIMEOUT_INT _SB_MAKEMASK1(10)
184#define M_IO_ILL_ADDR_INT _SB_MAKEMASK1(11) 191#define M_IO_ILL_ADDR_INT _SB_MAKEMASK1(11)
185#define M_IO_MULT_CS_INT _SB_MAKEMASK1(12) 192#define M_IO_MULT_CS_INT _SB_MAKEMASK1(12)
186#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 193#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
187#define M_IO_COH_ERR _SB_MAKEMASK1(14) 194#define M_IO_COH_ERR _SB_MAKEMASK1(14)
188#endif /* 1250 PASS2 || 112x PASS1 */ 195#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
196
197
198/*
199 * Generic Bus Output Drive Control Register 0 (Table 14-18)
200 */
201
202#define S_IO_SLEW0 0
203#define M_IO_SLEW0 _SB_MAKEMASK(2,S_IO_SLEW0)
204#define V_IO_SLEW0(x) _SB_MAKEVALUE(x,S_IO_SLEW0)
205#define G_IO_SLEW0(x) _SB_GETVALUE(x,S_IO_SLEW0,M_IO_SLEW0)
206
207#define S_IO_DRV_A 2
208#define M_IO_DRV_A _SB_MAKEMASK(2,S_IO_DRV_A)
209#define V_IO_DRV_A(x) _SB_MAKEVALUE(x,S_IO_DRV_A)
210#define G_IO_DRV_A(x) _SB_GETVALUE(x,S_IO_DRV_A,M_IO_DRV_A)
211
212#define S_IO_DRV_B 6
213#define M_IO_DRV_B _SB_MAKEMASK(2,S_IO_DRV_B)
214#define V_IO_DRV_B(x) _SB_MAKEVALUE(x,S_IO_DRV_B)
215#define G_IO_DRV_B(x) _SB_GETVALUE(x,S_IO_DRV_B,M_IO_DRV_B)
216
217#define S_IO_DRV_C 10
218#define M_IO_DRV_C _SB_MAKEMASK(2,S_IO_DRV_C)
219#define V_IO_DRV_C(x) _SB_MAKEVALUE(x,S_IO_DRV_C)
220#define G_IO_DRV_C(x) _SB_GETVALUE(x,S_IO_DRV_C,M_IO_DRV_C)
221
222#define S_IO_DRV_D 14
223#define M_IO_DRV_D _SB_MAKEMASK(2,S_IO_DRV_D)
224#define V_IO_DRV_D(x) _SB_MAKEVALUE(x,S_IO_DRV_D)
225#define G_IO_DRV_D(x) _SB_GETVALUE(x,S_IO_DRV_D,M_IO_DRV_D)
226
227/*
228 * Generic Bus Output Drive Control Register 1 (Table 14-19)
229 */
230
231#define S_IO_DRV_E 2
232#define M_IO_DRV_E _SB_MAKEMASK(2,S_IO_DRV_E)
233#define V_IO_DRV_E(x) _SB_MAKEVALUE(x,S_IO_DRV_E)
234#define G_IO_DRV_E(x) _SB_GETVALUE(x,S_IO_DRV_E,M_IO_DRV_E)
235
236#define S_IO_DRV_F 6
237#define M_IO_DRV_F _SB_MAKEMASK(2,S_IO_DRV_F)
238#define V_IO_DRV_F(x) _SB_MAKEVALUE(x,S_IO_DRV_F)
239#define G_IO_DRV_F(x) _SB_GETVALUE(x,S_IO_DRV_F,M_IO_DRV_F)
240
241#define S_IO_SLEW1 8
242#define M_IO_SLEW1 _SB_MAKEMASK(2,S_IO_SLEW1)
243#define V_IO_SLEW1(x) _SB_MAKEVALUE(x,S_IO_SLEW1)
244#define G_IO_SLEW1(x) _SB_GETVALUE(x,S_IO_SLEW1,M_IO_SLEW1)
245
246#define S_IO_DRV_G 10
247#define M_IO_DRV_G _SB_MAKEMASK(2,S_IO_DRV_G)
248#define V_IO_DRV_G(x) _SB_MAKEVALUE(x,S_IO_DRV_G)
249#define G_IO_DRV_G(x) _SB_GETVALUE(x,S_IO_DRV_G,M_IO_DRV_G)
250
251#define S_IO_SLEW2 12
252#define M_IO_SLEW2 _SB_MAKEMASK(2,S_IO_SLEW2)
253#define V_IO_SLEW2(x) _SB_MAKEVALUE(x,S_IO_SLEW2)
254#define G_IO_SLEW2(x) _SB_GETVALUE(x,S_IO_SLEW2,M_IO_SLEW2)
255
256#define S_IO_DRV_H 14
257#define M_IO_DRV_H _SB_MAKEMASK(2,S_IO_DRV_H)
258#define V_IO_DRV_H(x) _SB_MAKEVALUE(x,S_IO_DRV_H)
259#define G_IO_DRV_H(x) _SB_GETVALUE(x,S_IO_DRV_H,M_IO_DRV_H)
260
261/*
262 * Generic Bus Output Drive Control Register 2 (Table 14-20)
263 */
264
265#define S_IO_DRV_J 2
266#define M_IO_DRV_J _SB_MAKEMASK(2,S_IO_DRV_J)
267#define V_IO_DRV_J(x) _SB_MAKEVALUE(x,S_IO_DRV_J)
268#define G_IO_DRV_J(x) _SB_GETVALUE(x,S_IO_DRV_J,M_IO_DRV_J)
269
270#define S_IO_DRV_K 6
271#define M_IO_DRV_K _SB_MAKEMASK(2,S_IO_DRV_K)
272#define V_IO_DRV_K(x) _SB_MAKEVALUE(x,S_IO_DRV_K)
273#define G_IO_DRV_K(x) _SB_GETVALUE(x,S_IO_DRV_K,M_IO_DRV_K)
274
275#define S_IO_DRV_L 10
276#define M_IO_DRV_L _SB_MAKEMASK(2,S_IO_DRV_L)
277#define V_IO_DRV_L(x) _SB_MAKEVALUE(x,S_IO_DRV_L)
278#define G_IO_DRV_L(x) _SB_GETVALUE(x,S_IO_DRV_L,M_IO_DRV_L)
279
280#define S_IO_DRV_M 14
281#define M_IO_DRV_M _SB_MAKEMASK(2,S_IO_DRV_M)
282#define V_IO_DRV_M(x) _SB_MAKEVALUE(x,S_IO_DRV_M)
283#define G_IO_DRV_M(x) _SB_GETVALUE(x,S_IO_DRV_M,M_IO_DRV_M)
284
285/*
286 * Generic Bus Output Drive Control Register 3 (Table 14-21)
287 */
288
289#define S_IO_SLEW3 0
290#define M_IO_SLEW3 _SB_MAKEMASK(2,S_IO_SLEW3)
291#define V_IO_SLEW3(x) _SB_MAKEVALUE(x,S_IO_SLEW3)
292#define G_IO_SLEW3(x) _SB_GETVALUE(x,S_IO_SLEW3,M_IO_SLEW3)
293
294#define S_IO_DRV_N 2
295#define M_IO_DRV_N _SB_MAKEMASK(2,S_IO_DRV_N)
296#define V_IO_DRV_N(x) _SB_MAKEVALUE(x,S_IO_DRV_N)
297#define G_IO_DRV_N(x) _SB_GETVALUE(x,S_IO_DRV_N,M_IO_DRV_N)
298
299#define S_IO_DRV_P 6
300#define M_IO_DRV_P _SB_MAKEMASK(2,S_IO_DRV_P)
301#define V_IO_DRV_P(x) _SB_MAKEVALUE(x,S_IO_DRV_P)
302#define G_IO_DRV_P(x) _SB_GETVALUE(x,S_IO_DRV_P,M_IO_DRV_P)
303
304#define S_IO_DRV_Q 10
305#define M_IO_DRV_Q _SB_MAKEMASK(2,S_IO_DRV_Q)
306#define V_IO_DRV_Q(x) _SB_MAKEVALUE(x,S_IO_DRV_Q)
307#define G_IO_DRV_Q(x) _SB_GETVALUE(x,S_IO_DRV_Q,M_IO_DRV_Q)
308
309#define S_IO_DRV_R 14
310#define M_IO_DRV_R _SB_MAKEMASK(2,S_IO_DRV_R)
311#define V_IO_DRV_R(x) _SB_MAKEVALUE(x,S_IO_DRV_R)
312#define G_IO_DRV_R(x) _SB_GETVALUE(x,S_IO_DRV_R,M_IO_DRV_R)
313
189 314
190/* 315/*
191 * PCMCIA configuration register (Table 12-6) 316 * PCMCIA configuration register (Table 12-6)
@@ -202,6 +327,22 @@
202#define M_PCMCIA_CFG_RDYMASK _SB_MAKEMASK1(8) 327#define M_PCMCIA_CFG_RDYMASK _SB_MAKEMASK1(8)
203#define M_PCMCIA_CFG_PWRCTL _SB_MAKEMASK1(9) 328#define M_PCMCIA_CFG_PWRCTL _SB_MAKEMASK1(9)
204 329
330#if SIBYTE_HDR_FEATURE_CHIP(1480)
331#define S_PCMCIA_MODE 16
332#define M_PCMCIA_MODE _SB_MAKEMASK(3,S_PCMCIA_MODE)
333#define V_PCMCIA_MODE(x) _SB_MAKEVALUE(x,S_PCMCIA_MODE)
334#define G_PCMCIA_MODE(x) _SB_GETVALUE(x,S_PCMCIA_MODE,M_PCMCIA_MODE)
335
336#define K_PCMCIA_MODE_PCMA_NOB 0 /* standard PCMCIA "A", no "B" */
337#define K_PCMCIA_MODE_IDEA_NOB 1 /* IDE "A", no "B" */
338#define K_PCMCIA_MODE_PCMIOA_NOB 2 /* PCMCIA with I/O "A", no "B" */
339#define K_PCMCIA_MODE_PCMA_PCMB 4 /* standard PCMCIA "A", standard PCMCIA "B" */
340#define K_PCMCIA_MODE_IDEA_PCMB 5 /* IDE "A", standard PCMCIA "B" */
341#define K_PCMCIA_MODE_PCMA_IDEB 6 /* standard PCMCIA "A", IDE "B" */
342#define K_PCMCIA_MODE_IDEA_IDEB 7 /* IDE "A", IDE "B" */
343#endif
344
345
205/* 346/*
206 * PCMCIA status register (Table 12-7) 347 * PCMCIA status register (Table 12-7)
207 */ 348 */
@@ -272,5 +413,62 @@
272#define V_GPIO_INTR_TYPE14(x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPE14) 413#define V_GPIO_INTR_TYPE14(x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPE14)
273#define G_GPIO_INTR_TYPE14(x) _SB_GETVALUE(x,S_GPIO_INTR_TYPE14,M_GPIO_INTR_TYPE14) 414#define G_GPIO_INTR_TYPE14(x) _SB_GETVALUE(x,S_GPIO_INTR_TYPE14,M_GPIO_INTR_TYPE14)
274 415
416#if SIBYTE_HDR_FEATURE_CHIP(1480)
417
418/*
419 * GPIO Interrupt Additional Type Register
420 */
421
422#define K_GPIO_INTR_BOTHEDGE 0
423#define K_GPIO_INTR_RISEEDGE 1
424#define K_GPIO_INTR_UNPRED1 2
425#define K_GPIO_INTR_UNPRED2 3
426
427#define S_GPIO_INTR_ATYPEX(n) (((n)/2)*2)
428#define M_GPIO_INTR_ATYPEX(n) _SB_MAKEMASK(2,S_GPIO_INTR_ATYPEX(n))
429#define V_GPIO_INTR_ATYPEX(n,x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPEX(n))
430#define G_GPIO_INTR_ATYPEX(n,x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPEX(n),M_GPIO_INTR_ATYPEX(n))
431
432#define S_GPIO_INTR_ATYPE0 0
433#define M_GPIO_INTR_ATYPE0 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE0)
434#define V_GPIO_INTR_ATYPE0(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE0)
435#define G_GPIO_INTR_ATYPE0(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE0,M_GPIO_INTR_ATYPE0)
436
437#define S_GPIO_INTR_ATYPE2 2
438#define M_GPIO_INTR_ATYPE2 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE2)
439#define V_GPIO_INTR_ATYPE2(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE2)
440#define G_GPIO_INTR_ATYPE2(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE2,M_GPIO_INTR_ATYPE2)
441
442#define S_GPIO_INTR_ATYPE4 4
443#define M_GPIO_INTR_ATYPE4 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE4)
444#define V_GPIO_INTR_ATYPE4(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE4)
445#define G_GPIO_INTR_ATYPE4(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE4,M_GPIO_INTR_ATYPE4)
446
447#define S_GPIO_INTR_ATYPE6 6
448#define M_GPIO_INTR_ATYPE6 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE6)
449#define V_GPIO_INTR_ATYPE6(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE6)
450#define G_GPIO_INTR_ATYPE6(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE6,M_GPIO_INTR_ATYPE6)
451
452#define S_GPIO_INTR_ATYPE8 8
453#define M_GPIO_INTR_ATYPE8 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE8)
454#define V_GPIO_INTR_ATYPE8(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE8)
455#define G_GPIO_INTR_ATYPE8(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE8,M_GPIO_INTR_ATYPE8)
456
457#define S_GPIO_INTR_ATYPE10 10
458#define M_GPIO_INTR_ATYPE10 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE10)
459#define V_GPIO_INTR_ATYPE10(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE10)
460#define G_GPIO_INTR_ATYPE10(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE10,M_GPIO_INTR_ATYPE10)
461
462#define S_GPIO_INTR_ATYPE12 12
463#define M_GPIO_INTR_ATYPE12 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE12)
464#define V_GPIO_INTR_ATYPE12(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE12)
465#define G_GPIO_INTR_ATYPE12(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE12,M_GPIO_INTR_ATYPE12)
466
467#define S_GPIO_INTR_ATYPE14 14
468#define M_GPIO_INTR_ATYPE14 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE14)
469#define V_GPIO_INTR_ATYPE14(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE14)
470#define G_GPIO_INTR_ATYPE14(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE14,M_GPIO_INTR_ATYPE14)
471#endif
472
275 473
276#endif 474#endif
diff --git a/include/asm-mips/sibyte/sb1250_int.h b/include/asm-mips/sibyte/sb1250_int.h
index e173e2ea4c98..05c7b39f1b02 100644
--- a/include/asm-mips/sibyte/sb1250_int.h
+++ b/include/asm-mips/sibyte/sb1250_int.h
@@ -8,8 +8,6 @@
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg
12 *
13 ********************************************************************* 11 *********************************************************************
14 * 12 *
15 * Copyright 2000,2001,2002,2003 13 * Copyright 2000,2001,2002,2003
@@ -47,6 +45,10 @@
47 * First, the interrupt numbers. 45 * First, the interrupt numbers.
48 */ 46 */
49 47
48#if SIBYTE_HDR_FEATURE_1250_112x
49
50#define K_INT_SOURCES 64
51
50#define K_INT_WATCHDOG_TIMER_0 0 52#define K_INT_WATCHDOG_TIMER_0 0
51#define K_INT_WATCHDOG_TIMER_1 1 53#define K_INT_WATCHDOG_TIMER_1 1
52#define K_INT_TIMER_0 2 54#define K_INT_TIMER_0 2
@@ -244,4 +246,6 @@
244#define M_LDTVECT_RAISEMBOX 0x40 246#define M_LDTVECT_RAISEMBOX 0x40
245 247
246 248
249#endif /* 1250/112x */
250
247#endif 251#endif
diff --git a/include/asm-mips/sibyte/sb1250_l2c.h b/include/asm-mips/sibyte/sb1250_l2c.h
index 8afe8e01581b..842f205094af 100644
--- a/include/asm-mips/sibyte/sb1250_l2c.h
+++ b/include/asm-mips/sibyte/sb1250_l2c.h
@@ -8,8 +8,6 @@
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg
12 *
13 ********************************************************************* 11 *********************************************************************
14 * 12 *
15 * Copyright 2000,2001,2002,2003 13 * Copyright 2000,2001,2002,2003
@@ -89,8 +87,13 @@
89#define V_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x,S_L2C_MGMT_WAY) 87#define V_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x,S_L2C_MGMT_WAY)
90#define G_L2C_MGMT_WAY(x) _SB_GETVALUE(x,S_L2C_MGMT_WAY,M_L2C_MGMT_WAY) 88#define G_L2C_MGMT_WAY(x) _SB_GETVALUE(x,S_L2C_MGMT_WAY,M_L2C_MGMT_WAY)
91 89
92#define S_L2C_MGMT_TAG 21 90#define S_L2C_MGMT_ECC_DIAG 21
93#define M_L2C_MGMT_TAG _SB_MAKEMASK(6,S_L2C_MGMT_TAG) 91#define M_L2C_MGMT_ECC_DIAG _SB_MAKEMASK(2,S_L2C_MGMT_ECC_DIAG)
92#define V_L2C_MGMT_ECC_DIAG(x) _SB_MAKEVALUE(x,S_L2C_MGMT_ECC_DIAG)
93#define G_L2C_MGMT_ECC_DIAG(x) _SB_GETVALUE(x,S_L2C_MGMT_ECC_DIAG,M_L2C_MGMT_ECC_DIAG)
94
95#define S_L2C_MGMT_TAG 23
96#define M_L2C_MGMT_TAG _SB_MAKEMASK(4,S_L2C_MGMT_TAG)
94#define V_L2C_MGMT_TAG(x) _SB_MAKEVALUE(x,S_L2C_MGMT_TAG) 97#define V_L2C_MGMT_TAG(x) _SB_MAKEVALUE(x,S_L2C_MGMT_TAG)
95#define G_L2C_MGMT_TAG(x) _SB_GETVALUE(x,S_L2C_MGMT_TAG,M_L2C_MGMT_TAG) 98#define G_L2C_MGMT_TAG(x) _SB_GETVALUE(x,S_L2C_MGMT_TAG,M_L2C_MGMT_TAG)
96 99
diff --git a/include/asm-mips/sibyte/sb1250_ldt.h b/include/asm-mips/sibyte/sb1250_ldt.h
index f2617ded0a8f..7092535d1108 100644
--- a/include/asm-mips/sibyte/sb1250_ldt.h
+++ b/include/asm-mips/sibyte/sb1250_ldt.h
@@ -8,8 +8,6 @@
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg
12 *
13 ********************************************************************* 11 *********************************************************************
14 * 12 *
15 * Copyright 2000,2001,2002,2003 13 * Copyright 2000,2001,2002,2003
diff --git a/include/asm-mips/sibyte/sb1250_mac.h b/include/asm-mips/sibyte/sb1250_mac.h
index 18e74e43f4a2..adfc688fa559 100644
--- a/include/asm-mips/sibyte/sb1250_mac.h
+++ b/include/asm-mips/sibyte/sb1250_mac.h
@@ -8,8 +8,6 @@
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg
12 *
13 ********************************************************************* 11 *********************************************************************
14 * 12 *
15 * Copyright 2000,2001,2002,2003 13 * Copyright 2000,2001,2002,2003
@@ -81,7 +79,10 @@
81#define M_MAC_RESERVED1 _SB_MAKEMASK(8,9) 79#define M_MAC_RESERVED1 _SB_MAKEMASK(8,9)
82 80
83#define M_MAC_AP_STAT_EN _SB_MAKEMASK1(17) 81#define M_MAC_AP_STAT_EN _SB_MAKEMASK1(17)
84#define M_MAC_RESERVED2 _SB_MAKEMASK1(18) 82
83#if SIBYTE_HDR_FEATURE_CHIP(1480)
84#define M_MAC_TIMESTAMP _SB_MAKEMASK1(18)
85#endif
85#define M_MAC_DRP_ERRPKT_EN _SB_MAKEMASK1(19) 86#define M_MAC_DRP_ERRPKT_EN _SB_MAKEMASK1(19)
86#define M_MAC_DRP_FCSERRPKT_EN _SB_MAKEMASK1(20) 87#define M_MAC_DRP_FCSERRPKT_EN _SB_MAKEMASK1(20)
87#define M_MAC_DRP_CODEERRPKT_EN _SB_MAKEMASK1(21) 88#define M_MAC_DRP_CODEERRPKT_EN _SB_MAKEMASK1(21)
@@ -132,9 +133,9 @@
132#define M_MAC_RX_CH_SEL_MSB _SB_MAKEMASK1(44) 133#define M_MAC_RX_CH_SEL_MSB _SB_MAKEMASK1(44)
133#endif /* 1250 PASS2 || 112x PASS1 */ 134#endif /* 1250 PASS2 || 112x PASS1 */
134 135
135#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 136#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
136#define M_MAC_SPLIT_CH_SEL _SB_MAKEMASK1(45) 137#define M_MAC_SPLIT_CH_SEL _SB_MAKEMASK1(45)
137#endif /* 1250 PASS3 || 112x PASS1 */ 138#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
138 139
139#define S_MAC_BYPASS_IFG _SB_MAKE64(46) 140#define S_MAC_BYPASS_IFG _SB_MAKE64(46)
140#define M_MAC_BYPASS_IFG _SB_MAKEMASK(8,S_MAC_BYPASS_IFG) 141#define M_MAC_BYPASS_IFG _SB_MAKEMASK(8,S_MAC_BYPASS_IFG)
@@ -176,10 +177,22 @@
176 177
177#define M_MAC_PORT_RESET _SB_MAKEMASK1(8) 178#define M_MAC_PORT_RESET _SB_MAKEMASK1(8)
178 179
180#if (SIBYTE_HDR_FEATURE_CHIP(1250) || SIBYTE_HDR_FEATURE_CHIP(112x))
179#define M_MAC_RX_ENABLE _SB_MAKEMASK1(10) 181#define M_MAC_RX_ENABLE _SB_MAKEMASK1(10)
180#define M_MAC_TX_ENABLE _SB_MAKEMASK1(11) 182#define M_MAC_TX_ENABLE _SB_MAKEMASK1(11)
181#define M_MAC_BYP_RX_ENABLE _SB_MAKEMASK1(12) 183#define M_MAC_BYP_RX_ENABLE _SB_MAKEMASK1(12)
182#define M_MAC_BYP_TX_ENABLE _SB_MAKEMASK1(13) 184#define M_MAC_BYP_TX_ENABLE _SB_MAKEMASK1(13)
185#endif
186
187/*
188 * MAC reset information register (1280/1255)
189 */
190#if SIBYTE_HDR_FEATURE_CHIP(1480)
191#define M_MAC_RX_CH0_PAUSE_ON _SB_MAKEMASK1(8)
192#define M_MAC_RX_CH1_PAUSE_ON _SB_MAKEMASK1(16)
193#define M_MAC_TX_CH0_PAUSE_ON _SB_MAKEMASK1(24)
194#define M_MAC_TX_CH1_PAUSE_ON _SB_MAKEMASK1(32)
195#endif
183 196
184/* 197/*
185 * MAC DMA Control Register 198 * MAC DMA Control Register
@@ -267,12 +280,12 @@
267#define V_MAC_IFG_RX(x) _SB_MAKEVALUE(x,S_MAC_IFG_RX) 280#define V_MAC_IFG_RX(x) _SB_MAKEVALUE(x,S_MAC_IFG_RX)
268#define G_MAC_IFG_RX(x) _SB_GETVALUE(x,S_MAC_IFG_RX,M_MAC_IFG_RX) 281#define G_MAC_IFG_RX(x) _SB_GETVALUE(x,S_MAC_IFG_RX,M_MAC_IFG_RX)
269 282
270#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 283#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
271#define S_MAC_PRE_LEN _SB_MAKE64(0) 284#define S_MAC_PRE_LEN _SB_MAKE64(0)
272#define M_MAC_PRE_LEN _SB_MAKEMASK(6,S_MAC_PRE_LEN) 285#define M_MAC_PRE_LEN _SB_MAKEMASK(6,S_MAC_PRE_LEN)
273#define V_MAC_PRE_LEN(x) _SB_MAKEVALUE(x,S_MAC_PRE_LEN) 286#define V_MAC_PRE_LEN(x) _SB_MAKEVALUE(x,S_MAC_PRE_LEN)
274#define G_MAC_PRE_LEN(x) _SB_GETVALUE(x,S_MAC_PRE_LEN,M_MAC_PRE_LEN) 287#define G_MAC_PRE_LEN(x) _SB_GETVALUE(x,S_MAC_PRE_LEN,M_MAC_PRE_LEN)
275#endif /* 1250 PASS3 || 112x PASS1 */ 288#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
276 289
277#define S_MAC_IFG_TX _SB_MAKE64(6) 290#define S_MAC_IFG_TX _SB_MAKE64(6)
278#define M_MAC_IFG_TX _SB_MAKEMASK(6,S_MAC_IFG_TX) 291#define M_MAC_IFG_TX _SB_MAKEMASK(6,S_MAC_IFG_TX)
@@ -458,9 +471,9 @@
458#define V_MAC_COUNTER_ADDR(x) _SB_MAKEVALUE(x,S_MAC_COUNTER_ADDR) 471#define V_MAC_COUNTER_ADDR(x) _SB_MAKEVALUE(x,S_MAC_COUNTER_ADDR)
459#define G_MAC_COUNTER_ADDR(x) _SB_GETVALUE(x,S_MAC_COUNTER_ADDR,M_MAC_COUNTER_ADDR) 472#define G_MAC_COUNTER_ADDR(x) _SB_GETVALUE(x,S_MAC_COUNTER_ADDR,M_MAC_COUNTER_ADDR)
460 473
461#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 474#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
462#define M_MAC_TX_PAUSE_ON _SB_MAKEMASK1(52) 475#define M_MAC_TX_PAUSE_ON _SB_MAKEMASK1(52)
463#endif /* 1250 PASS3 || 112x PASS1 */ 476#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
464 477
465/* 478/*
466 * MAC Fifo Pointer Registers (Table 9-19) [Debug register] 479 * MAC Fifo Pointer Registers (Table 9-19) [Debug register]
@@ -594,7 +607,7 @@
594#define V_MAC_IPHDR_OFFSET(x) _SB_MAKEVALUE(x,S_MAC_IPHDR_OFFSET) 607#define V_MAC_IPHDR_OFFSET(x) _SB_MAKEVALUE(x,S_MAC_IPHDR_OFFSET)
595#define G_MAC_IPHDR_OFFSET(x) _SB_GETVALUE(x,S_MAC_IPHDR_OFFSET,M_MAC_IPHDR_OFFSET) 608#define G_MAC_IPHDR_OFFSET(x) _SB_GETVALUE(x,S_MAC_IPHDR_OFFSET,M_MAC_IPHDR_OFFSET)
596 609
597#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 610#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
598#define S_MAC_RX_CRC_OFFSET _SB_MAKE64(16) 611#define S_MAC_RX_CRC_OFFSET _SB_MAKE64(16)
599#define M_MAC_RX_CRC_OFFSET _SB_MAKEMASK(8,S_MAC_RX_CRC_OFFSET) 612#define M_MAC_RX_CRC_OFFSET _SB_MAKEMASK(8,S_MAC_RX_CRC_OFFSET)
600#define V_MAC_RX_CRC_OFFSET(x) _SB_MAKEVALUE(x,S_MAC_RX_CRC_OFFSET) 613#define V_MAC_RX_CRC_OFFSET(x) _SB_MAKEVALUE(x,S_MAC_RX_CRC_OFFSET)
@@ -612,7 +625,7 @@
612#define M_MAC_RX_CH_MSN_SEL _SB_MAKEMASK(8,S_MAC_RX_CH_MSN_SEL) 625#define M_MAC_RX_CH_MSN_SEL _SB_MAKEMASK(8,S_MAC_RX_CH_MSN_SEL)
613#define V_MAC_RX_CH_MSN_SEL(x) _SB_MAKEVALUE(x,S_MAC_RX_CH_MSN_SEL) 626#define V_MAC_RX_CH_MSN_SEL(x) _SB_MAKEVALUE(x,S_MAC_RX_CH_MSN_SEL)
614#define G_MAC_RX_CH_MSN_SEL(x) _SB_GETVALUE(x,S_MAC_RX_CH_MSN_SEL,M_MAC_RX_CH_MSN_SEL) 627#define G_MAC_RX_CH_MSN_SEL(x) _SB_GETVALUE(x,S_MAC_RX_CH_MSN_SEL,M_MAC_RX_CH_MSN_SEL)
615#endif /* 1250 PASS3 || 112x PASS1 */ 628#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
616 629
617/* 630/*
618 * MAC Receive Channel Select Registers (Table 9-25) 631 * MAC Receive Channel Select Registers (Table 9-25)
diff --git a/include/asm-mips/sibyte/sb1250_mc.h b/include/asm-mips/sibyte/sb1250_mc.h
index 1dd41c927996..26e421498c97 100644
--- a/include/asm-mips/sibyte/sb1250_mc.h
+++ b/include/asm-mips/sibyte/sb1250_mc.h
@@ -8,8 +8,6 @@
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg
12 *
13 ********************************************************************* 11 *********************************************************************
14 * 12 *
15 * Copyright 2000,2001,2002,2003 13 * Copyright 2000,2001,2002,2003
@@ -324,6 +322,10 @@
324#define K_MC_tRFC_DEFAULT 12 322#define K_MC_tRFC_DEFAULT 12
325#define V_MC_tRFC_DEFAULT V_MC_tRFC(K_MC_tRFC_DEFAULT) 323#define V_MC_tRFC_DEFAULT V_MC_tRFC(K_MC_tRFC_DEFAULT)
326 324
325#if SIBYTE_HDR_FEATURE(1250, PASS3)
326#define M_MC_tRFC_PLUS16 _SB_MAKEMASK1(51) /* 1250C3 and later. */
327#endif
328
327#define S_MC_tCwCr 40 329#define S_MC_tCwCr 40
328#define M_MC_tCwCr _SB_MAKEMASK(4,S_MC_tCwCr) 330#define M_MC_tCwCr _SB_MAKEMASK(4,S_MC_tCwCr)
329#define V_MC_tCwCr(x) _SB_MAKEVALUE(x,S_MC_tCwCr) 331#define V_MC_tCwCr(x) _SB_MAKEVALUE(x,S_MC_tCwCr)
diff --git a/include/asm-mips/sibyte/sb1250_regs.h b/include/asm-mips/sibyte/sb1250_regs.h
index 9db80cd13a79..bab3a4580a36 100644
--- a/include/asm-mips/sibyte/sb1250_regs.h
+++ b/include/asm-mips/sibyte/sb1250_regs.h
@@ -8,8 +8,6 @@
8 * 8 *
9 * SB1250 specification level: 01/02/2002 9 * SB1250 specification level: 01/02/2002
10 * 10 *
11 * Author: Mitch Lichtenberg
12 *
13 ********************************************************************* 11 *********************************************************************
14 * 12 *
15 * Copyright 2000,2001,2002,2003 13 * Copyright 2000,2001,2002,2003
@@ -61,6 +59,8 @@
61 * XXX: can't remove MC base 0 if 112x, since it's used by other macros, 59 * XXX: can't remove MC base 0 if 112x, since it's used by other macros,
62 * since there is one reg there (but it could get its addr/offset constant). 60 * since there is one reg there (but it could get its addr/offset constant).
63 */ 61 */
62
63#if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */
64#define A_MC_BASE_0 0x0010051000 64#define A_MC_BASE_0 0x0010051000
65#define A_MC_BASE_1 0x0010052000 65#define A_MC_BASE_1 0x0010052000
66#define MC_REGISTER_SPACING 0x1000 66#define MC_REGISTER_SPACING 0x1000
@@ -101,10 +101,14 @@
101#define R_MC_TEST_ECC 0x0000000420 101#define R_MC_TEST_ECC 0x0000000420
102#define R_MC_MCLK_CFG 0x0000000500 102#define R_MC_MCLK_CFG 0x0000000500
103 103
104#endif /* 1250 & 112x */
105
104/* ********************************************************************* 106/* *********************************************************************
105 * L2 Cache Control Registers 107 * L2 Cache Control Registers
106 ********************************************************************* */ 108 ********************************************************************* */
107 109
110#if SIBYTE_HDR_FEATURE_1250_112x /* This L2C only on 1250/112x */
111
108#define A_L2_READ_TAG 0x0010040018 112#define A_L2_READ_TAG 0x0010040018
109#define A_L2_ECC_TAG 0x0010040038 113#define A_L2_ECC_TAG 0x0010040038
110#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) 114#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
@@ -125,13 +129,16 @@
125#define A_L2_READ_ADDRESS A_L2_READ_TAG 129#define A_L2_READ_ADDRESS A_L2_READ_TAG
126#define A_L2_EEC_ADDRESS A_L2_ECC_TAG 130#define A_L2_EEC_ADDRESS A_L2_ECC_TAG
127 131
132#endif
128 133
129/* ********************************************************************* 134/* *********************************************************************
130 * PCI Interface Registers 135 * PCI Interface Registers
131 ********************************************************************* */ 136 ********************************************************************* */
132 137
138#if SIBYTE_HDR_FEATURE_1250_112x /* This PCI/HT only on 1250/112x */
133#define A_PCI_TYPE00_HEADER 0x00DE000000 139#define A_PCI_TYPE00_HEADER 0x00DE000000
134#define A_PCI_TYPE01_HEADER 0x00DE000800 140#define A_PCI_TYPE01_HEADER 0x00DE000800
141#endif
135 142
136 143
137/* ********************************************************************* 144/* *********************************************************************
@@ -264,15 +271,15 @@
264 ********************************************************************* */ 271 ********************************************************************* */
265 272
266 273
274#if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */
267#define R_DUART_NUM_PORTS 2 275#define R_DUART_NUM_PORTS 2
268 276
269#define A_DUART 0x0010060000 277#define A_DUART 0x0010060000
270 278
271#define A_DUART_REG(r)
272
273#define DUART_CHANREG_SPACING 0x100 279#define DUART_CHANREG_SPACING 0x100
274#define A_DUART_CHANREG(chan,reg) (A_DUART + DUART_CHANREG_SPACING*(chan) + (reg)) 280#define A_DUART_CHANREG(chan,reg) (A_DUART + DUART_CHANREG_SPACING*(chan) + (reg))
275#define R_DUART_CHANREG(chan,reg) (DUART_CHANREG_SPACING*(chan) + (reg)) 281#define R_DUART_CHANREG(chan,reg) (DUART_CHANREG_SPACING*(chan) + (reg))
282#endif /* 1250 & 112x */
276 283
277#define R_DUART_MODE_REG_1 0x100 284#define R_DUART_MODE_REG_1 0x100
278#define R_DUART_MODE_REG_2 0x110 285#define R_DUART_MODE_REG_2 0x110
@@ -307,11 +314,13 @@
307 314
308#define DUART_IMRISR_SPACING 0x20 315#define DUART_IMRISR_SPACING 0x20
309 316
317#if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */
310#define R_DUART_IMRREG(chan) (R_DUART_IMR_A + (chan)*DUART_IMRISR_SPACING) 318#define R_DUART_IMRREG(chan) (R_DUART_IMR_A + (chan)*DUART_IMRISR_SPACING)
311#define R_DUART_ISRREG(chan) (R_DUART_ISR_A + (chan)*DUART_IMRISR_SPACING) 319#define R_DUART_ISRREG(chan) (R_DUART_ISR_A + (chan)*DUART_IMRISR_SPACING)
312 320
313#define A_DUART_IMRREG(chan) (A_DUART + R_DUART_IMRREG(chan)) 321#define A_DUART_IMRREG(chan) (A_DUART + R_DUART_IMRREG(chan))
314#define A_DUART_ISRREG(chan) (A_DUART + R_DUART_ISRREG(chan)) 322#define A_DUART_ISRREG(chan) (A_DUART + R_DUART_ISRREG(chan))
323#endif /* 1250 & 112x */
315 324
316 325
317 326
@@ -368,6 +377,8 @@
368 ********************************************************************* */ 377 ********************************************************************* */
369 378
370 379
380#if SIBYTE_HDR_FEATURE_1250_112x /* sync serial only on 1250/112x */
381
371#define A_SER_BASE_0 0x0010060400 382#define A_SER_BASE_0 0x0010060400
372#define A_SER_BASE_1 0x0010060800 383#define A_SER_BASE_1 0x0010060800
373#define SER_SPACING 0x400 384#define SER_SPACING 0x400
@@ -457,6 +468,8 @@
457#define R_SER_RMON_RX_ERRORS 0x000001F0 468#define R_SER_RMON_RX_ERRORS 0x000001F0
458#define R_SER_RMON_RX_BADADDR 0x000001F8 469#define R_SER_RMON_RX_BADADDR 0x000001F8
459 470
471#endif /* 1250/112x */
472
460/* ********************************************************************* 473/* *********************************************************************
461 * Generic Bus Registers 474 * Generic Bus Registers
462 ********************************************************************* */ 475 ********************************************************************* */
@@ -634,12 +647,13 @@
634 647
635#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 648#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
636#define A_SCD_SCRATCH 0x0010020C10 649#define A_SCD_SCRATCH 0x0010020C10
650#endif /* 1250 PASS2 || 112x PASS1 */
637 651
652#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
638#define A_SCD_ZBBUS_CYCLE_COUNT 0x0010030000 653#define A_SCD_ZBBUS_CYCLE_COUNT 0x0010030000
639#define A_SCD_ZBBUS_CYCLE_CP0 0x0010020C00 654#define A_SCD_ZBBUS_CYCLE_CP0 0x0010020C00
640#define A_SCD_ZBBUS_CYCLE_CP1 0x0010020C08 655#define A_SCD_ZBBUS_CYCLE_CP1 0x0010020C08
641#endif /* 1250 PASS2 || 112x PASS1 */ 656#endif
642
643 657
644/* ********************************************************************* 658/* *********************************************************************
645 * System Control Registers 659 * System Control Registers
@@ -667,15 +681,16 @@
667#define A_ADDR_TRAP_CFG_1 0x0010020448 681#define A_ADDR_TRAP_CFG_1 0x0010020448
668#define A_ADDR_TRAP_CFG_2 0x0010020450 682#define A_ADDR_TRAP_CFG_2 0x0010020450
669#define A_ADDR_TRAP_CFG_3 0x0010020458 683#define A_ADDR_TRAP_CFG_3 0x0010020458
670#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 684#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
671#define A_ADDR_TRAP_REG_DEBUG 0x0010020460 685#define A_ADDR_TRAP_REG_DEBUG 0x0010020460
672#endif /* 1250 PASS2 || 112x PASS1 */ 686#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
673 687
674 688
675/* ********************************************************************* 689/* *********************************************************************
676 * System Interrupt Mapper Registers 690 * System Interrupt Mapper Registers
677 ********************************************************************* */ 691 ********************************************************************* */
678 692
693#if SIBYTE_HDR_FEATURE_1250_112x
679#define A_IMR_CPU0_BASE 0x0010020000 694#define A_IMR_CPU0_BASE 0x0010020000
680#define A_IMR_CPU1_BASE 0x0010022000 695#define A_IMR_CPU1_BASE 0x0010022000
681#define IMR_REGISTER_SPACING 0x2000 696#define IMR_REGISTER_SPACING 0x2000
@@ -700,6 +715,7 @@
700#define R_IMR_INTERRUPT_STATUS_COUNT 7 715#define R_IMR_INTERRUPT_STATUS_COUNT 7
701#define R_IMR_INTERRUPT_MAP_BASE 0x0200 716#define R_IMR_INTERRUPT_MAP_BASE 0x0200
702#define R_IMR_INTERRUPT_MAP_COUNT 64 717#define R_IMR_INTERRUPT_MAP_COUNT 64
718#endif /* 1250/112x */
703 719
704/* ********************************************************************* 720/* *********************************************************************
705 * System Performance Counter Registers 721 * System Performance Counter Registers
@@ -718,6 +734,7 @@
718#define A_SCD_BUS_ERR_STATUS 0x0010020880 734#define A_SCD_BUS_ERR_STATUS 0x0010020880
719#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 735#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
720#define A_SCD_BUS_ERR_STATUS_DEBUG 0x00100208D0 736#define A_SCD_BUS_ERR_STATUS_DEBUG 0x00100208D0
737#define A_BUS_ERR_STATUS_DEBUG 0x00100208D0
721#endif /* 1250 PASS2 || 112x PASS1 */ 738#endif /* 1250 PASS2 || 112x PASS1 */
722#define A_BUS_ERR_DATA_0 0x00100208A0 739#define A_BUS_ERR_DATA_0 0x00100208A0
723#define A_BUS_ERR_DATA_1 0x00100208A8 740#define A_BUS_ERR_DATA_1 0x00100208A8
@@ -798,6 +815,7 @@
798 * Physical Address Map 815 * Physical Address Map
799 ********************************************************************* */ 816 ********************************************************************* */
800 817
818#if SIBYTE_HDR_FEATURE_1250_112x
801#define A_PHYS_MEMORY_0 _SB_MAKE64(0x0000000000) 819#define A_PHYS_MEMORY_0 _SB_MAKE64(0x0000000000)
802#define A_PHYS_MEMORY_SIZE _SB_MAKE64((256*1024*1024)) 820#define A_PHYS_MEMORY_SIZE _SB_MAKE64((256*1024*1024))
803#define A_PHYS_SYSTEM_CTL _SB_MAKE64(0x0010000000) 821#define A_PHYS_SYSTEM_CTL _SB_MAKE64(0x0010000000)
@@ -831,6 +849,7 @@
831#define A_PHYS_L2CACHE_WAY1 _SB_MAKE64(0x00D01A0000) 849#define A_PHYS_L2CACHE_WAY1 _SB_MAKE64(0x00D01A0000)
832#define A_PHYS_L2CACHE_WAY2 _SB_MAKE64(0x00D01C0000) 850#define A_PHYS_L2CACHE_WAY2 _SB_MAKE64(0x00D01C0000)
833#define A_PHYS_L2CACHE_WAY3 _SB_MAKE64(0x00D01E0000) 851#define A_PHYS_L2CACHE_WAY3 _SB_MAKE64(0x00D01E0000)
852#endif
834 853
835 854
836#endif 855#endif
diff --git a/include/asm-mips/sibyte/sb1250_scd.h b/include/asm-mips/sibyte/sb1250_scd.h
index dbbd682fb47e..a667bc14a7cd 100644
--- a/include/asm-mips/sibyte/sb1250_scd.h
+++ b/include/asm-mips/sibyte/sb1250_scd.h
@@ -8,8 +8,6 @@
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg
12 *
13 ********************************************************************* 11 *********************************************************************
14 * 12 *
15 * Copyright 2000,2001,2002,2003 13 * Copyright 2000,2001,2002,2003
@@ -51,26 +49,70 @@
51#define V_SYS_REVISION(x) _SB_MAKEVALUE(x,S_SYS_REVISION) 49#define V_SYS_REVISION(x) _SB_MAKEVALUE(x,S_SYS_REVISION)
52#define G_SYS_REVISION(x) _SB_GETVALUE(x,S_SYS_REVISION,M_SYS_REVISION) 50#define G_SYS_REVISION(x) _SB_GETVALUE(x,S_SYS_REVISION,M_SYS_REVISION)
53 51
54#if SIBYTE_HDR_FEATURE_CHIP(1250) 52#define K_SYS_REVISION_BCM1250_PASS1 0x01
55#define K_SYS_REVISION_BCM1250_PASS1 1 53
56#define K_SYS_REVISION_BCM1250_PASS2 3 54#define K_SYS_REVISION_BCM1250_PASS2 0x03
57#define K_SYS_REVISION_BCM1250_A10 11 55#define K_SYS_REVISION_BCM1250_A1 0x03 /* Pass 2.0 WB */
58#define K_SYS_REVISION_BCM1250_PASS2_2 16 56#define K_SYS_REVISION_BCM1250_A2 0x04 /* Pass 2.0 FC */
59#define K_SYS_REVISION_BCM1250_B2 17 57#define K_SYS_REVISION_BCM1250_A3 0x05 /* Pass 2.1 FC */
60#define K_SYS_REVISION_BCM1250_PASS3 32 58#define K_SYS_REVISION_BCM1250_A4 0x06 /* Pass 2.1 WB */
61#define K_SYS_REVISION_BCM1250_C1 33 59#define K_SYS_REVISION_BCM1250_A6 0x07 /* OR 0x04 (A2) w/WID != 0 */
60#define K_SYS_REVISION_BCM1250_A8 0x0b /* A8/A10 */
61#define K_SYS_REVISION_BCM1250_A9 0x08
62#define K_SYS_REVISION_BCM1250_A10 K_SYS_REVISION_BCM1250_A8
62 63
64#define K_SYS_REVISION_BCM1250_PASS2_2 0x10
65#define K_SYS_REVISION_BCM1250_B0 K_SYS_REVISION_BCM1250_B1
66#define K_SYS_REVISION_BCM1250_B1 0x10
67#define K_SYS_REVISION_BCM1250_B2 0x11
68
69#define K_SYS_REVISION_BCM1250_C0 0x20
70#define K_SYS_REVISION_BCM1250_C1 0x21
71#define K_SYS_REVISION_BCM1250_C2 0x22
72#define K_SYS_REVISION_BCM1250_C3 0x23
73
74#if SIBYTE_HDR_FEATURE_CHIP(1250)
63/* XXX: discourage people from using these constants. */ 75/* XXX: discourage people from using these constants. */
64#define K_SYS_REVISION_PASS1 K_SYS_REVISION_BCM1250_PASS1 76#define K_SYS_REVISION_PASS1 K_SYS_REVISION_BCM1250_PASS1
65#define K_SYS_REVISION_PASS2 K_SYS_REVISION_BCM1250_PASS2 77#define K_SYS_REVISION_PASS2 K_SYS_REVISION_BCM1250_PASS2
66#define K_SYS_REVISION_PASS2_2 K_SYS_REVISION_BCM1250_PASS2_2 78#define K_SYS_REVISION_PASS2_2 K_SYS_REVISION_BCM1250_PASS2_2
67#define K_SYS_REVISION_PASS3 K_SYS_REVISION_BCM1250_PASS3 79#define K_SYS_REVISION_PASS3 K_SYS_REVISION_BCM1250_PASS3
80#define K_SYS_REVISION_BCM1250_PASS3 K_SYS_REVISION_BCM1250_C0
68#endif /* 1250 */ 81#endif /* 1250 */
69 82
70#if SIBYTE_HDR_FEATURE_CHIP(112x) 83#define K_SYS_REVISION_BCM112x_A1 0x20
71#define K_SYS_REVISION_BCM112x_A1 32 84#define K_SYS_REVISION_BCM112x_A2 0x21
72#define K_SYS_REVISION_BCM112x_A2 33 85#define K_SYS_REVISION_BCM112x_A3 0x22
73#endif /* 112x */ 86#define K_SYS_REVISION_BCM112x_A4 0x23
87
88#define K_SYS_REVISION_BCM1480_S0 0x01
89#define K_SYS_REVISION_BCM1480_A1 0x02
90#define K_SYS_REVISION_BCM1480_A2 0x03
91#define K_SYS_REVISION_BCM1480_A3 0x04
92#define K_SYS_REVISION_BCM1480_B0 0x11
93
94/*Cache size - 23:20 of revision register*/
95#define S_SYS_L2C_SIZE _SB_MAKE64(20)
96#define M_SYS_L2C_SIZE _SB_MAKEMASK(4,S_SYS_L2C_SIZE)
97#define V_SYS_L2C_SIZE(x) _SB_MAKEVALUE(x,S_SYS_L2C_SIZE)
98#define G_SYS_L2C_SIZE(x) _SB_GETVALUE(x,S_SYS_L2C_SIZE,M_SYS_L2C_SIZE)
99
100#define K_SYS_L2C_SIZE_1MB 0
101#define K_SYS_L2C_SIZE_512KB 5
102#define K_SYS_L2C_SIZE_256KB 2
103#define K_SYS_L2C_SIZE_128KB 1
104
105#define K_SYS_L2C_SIZE_BCM1250 K_SYS_L2C_SIZE_512KB
106#define K_SYS_L2C_SIZE_BCM1125 K_SYS_L2C_SIZE_256KB
107#define K_SYS_L2C_SIZE_BCM1122 K_SYS_L2C_SIZE_128KB
108
109
110/* Number of CPU cores, bits 27:24 of revision register*/
111#define S_SYS_NUM_CPUS _SB_MAKE64(24)
112#define M_SYS_NUM_CPUS _SB_MAKEMASK(4,S_SYS_NUM_CPUS)
113#define V_SYS_NUM_CPUS(x) _SB_MAKEVALUE(x,S_SYS_NUM_CPUS)
114#define G_SYS_NUM_CPUS(x) _SB_GETVALUE(x,S_SYS_NUM_CPUS,M_SYS_NUM_CPUS)
115
74 116
75/* XXX: discourage people from using these constants. */ 117/* XXX: discourage people from using these constants. */
76#define S_SYS_PART _SB_MAKE64(16) 118#define S_SYS_PART _SB_MAKE64(16)
@@ -83,6 +125,8 @@
83#define K_SYS_PART_BCM1120 0x1121 125#define K_SYS_PART_BCM1120 0x1121
84#define K_SYS_PART_BCM1125 0x1123 126#define K_SYS_PART_BCM1125 0x1123
85#define K_SYS_PART_BCM1125H 0x1124 127#define K_SYS_PART_BCM1125H 0x1124
128#define K_SYS_PART_BCM1122 0x1113
129
86 130
87/* The "peripheral set" (SOC type) is the low 4 bits of the "part" field. */ 131/* The "peripheral set" (SOC type) is the low 4 bits of the "part" field. */
88#define S_SYS_SOC_TYPE _SB_MAKE64(16) 132#define S_SYS_SOC_TYPE _SB_MAKE64(16)
@@ -96,6 +140,8 @@
96#define K_SYS_SOC_TYPE_BCM1125 0x3 140#define K_SYS_SOC_TYPE_BCM1125 0x3
97#define K_SYS_SOC_TYPE_BCM1125H 0x4 141#define K_SYS_SOC_TYPE_BCM1125H 0x4
98#define K_SYS_SOC_TYPE_BCM1250_ALT2 0x5 /* 1250pass2 w/ 1/2 L2. */ 142#define K_SYS_SOC_TYPE_BCM1250_ALT2 0x5 /* 1250pass2 w/ 1/2 L2. */
143#define K_SYS_SOC_TYPE_BCM1x80 0x6
144#define K_SYS_SOC_TYPE_BCM1x55 0x7
99 145
100/* 146/*
101 * Calculate correct SOC type given a copy of system revision register. 147 * Calculate correct SOC type given a copy of system revision register.
@@ -127,10 +173,12 @@
127#define V_SYS_WID(x) _SB_MAKEVALUE(x,S_SYS_WID) 173#define V_SYS_WID(x) _SB_MAKEVALUE(x,S_SYS_WID)
128#define G_SYS_WID(x) _SB_GETVALUE(x,S_SYS_WID,M_SYS_WID) 174#define G_SYS_WID(x) _SB_GETVALUE(x,S_SYS_WID,M_SYS_WID)
129 175
130/* System Manufacturing Register 176/*
131* Register: SCD_SYSTEM_MANUF 177 * System Manufacturing Register
132*/ 178 * Register: SCD_SYSTEM_MANUF
179 */
133 180
181#if SIBYTE_HDR_FEATURE_1250_112x
134/* Wafer ID: bits 31:0 */ 182/* Wafer ID: bits 31:0 */
135#define S_SYS_WAFERID1_200 _SB_MAKE64(0) 183#define S_SYS_WAFERID1_200 _SB_MAKE64(0)
136#define M_SYS_WAFERID1_200 _SB_MAKEMASK(32,S_SYS_WAFERID1_200) 184#define M_SYS_WAFERID1_200 _SB_MAKEMASK(32,S_SYS_WAFERID1_200)
@@ -139,8 +187,8 @@
139 187
140#define S_SYS_BIN _SB_MAKE64(32) 188#define S_SYS_BIN _SB_MAKE64(32)
141#define M_SYS_BIN _SB_MAKEMASK(4,S_SYS_BIN) 189#define M_SYS_BIN _SB_MAKEMASK(4,S_SYS_BIN)
142#define V_SYS_BIN _SB_MAKEVALUE(x,S_SYS_BIN) 190#define V_SYS_BIN(x) _SB_MAKEVALUE(x,S_SYS_BIN)
143#define G_SYS_BIN _SB_GETVALUE(x,S_SYS_BIN,M_SYS_BIN) 191#define G_SYS_BIN(x) _SB_GETVALUE(x,S_SYS_BIN,M_SYS_BIN)
144 192
145/* Wafer ID: bits 39:36 */ 193/* Wafer ID: bits 39:36 */
146#define S_SYS_WAFERID2_200 _SB_MAKE64(36) 194#define S_SYS_WAFERID2_200 _SB_MAKE64(36)
@@ -163,12 +211,14 @@
163#define M_SYS_YPOS _SB_MAKEMASK(6,S_SYS_YPOS) 211#define M_SYS_YPOS _SB_MAKEMASK(6,S_SYS_YPOS)
164#define V_SYS_YPOS(x) _SB_MAKEVALUE(x,S_SYS_YPOS) 212#define V_SYS_YPOS(x) _SB_MAKEVALUE(x,S_SYS_YPOS)
165#define G_SYS_YPOS(x) _SB_GETVALUE(x,S_SYS_YPOS,M_SYS_YPOS) 213#define G_SYS_YPOS(x) _SB_GETVALUE(x,S_SYS_YPOS,M_SYS_YPOS)
214#endif
166 215
167/* 216/*
168 * System Config Register (Table 4-2) 217 * System Config Register (Table 4-2)
169 * Register: SCD_SYSTEM_CFG 218 * Register: SCD_SYSTEM_CFG
170 */ 219 */
171 220
221#if SIBYTE_HDR_FEATURE_1250_112x
172#define M_SYS_LDT_PLL_BYP _SB_MAKEMASK1(3) 222#define M_SYS_LDT_PLL_BYP _SB_MAKEMASK1(3)
173#define M_SYS_PCI_SYNC_TEST_MODE _SB_MAKEMASK1(4) 223#define M_SYS_PCI_SYNC_TEST_MODE _SB_MAKEMASK1(4)
174#define M_SYS_IOB0_DIV _SB_MAKEMASK1(5) 224#define M_SYS_IOB0_DIV _SB_MAKEMASK1(5)
@@ -253,6 +303,8 @@
253#define M_SYS_SW_FLAG _SB_MAKEMASK1(63) 303#define M_SYS_SW_FLAG _SB_MAKEMASK1(63)
254#endif /* 1250 PASS2 || 112x PASS1 */ 304#endif /* 1250 PASS2 || 112x PASS1 */
255 305
306#endif
307
256 308
257/* 309/*
258 * Mailbox Registers (Table 4-3) 310 * Mailbox Registers (Table 4-3)
@@ -326,6 +378,7 @@
326 * System Performance Counters 378 * System Performance Counters
327 */ 379 */
328 380
381#if SIBYTE_HDR_FEATURE_1250_112x
329#define S_SPC_CFG_SRC0 0 382#define S_SPC_CFG_SRC0 0
330#define M_SPC_CFG_SRC0 _SB_MAKEMASK(8,S_SPC_CFG_SRC0) 383#define M_SPC_CFG_SRC0 _SB_MAKEMASK(8,S_SPC_CFG_SRC0)
331#define V_SPC_CFG_SRC0(x) _SB_MAKEVALUE(x,S_SPC_CFG_SRC0) 384#define V_SPC_CFG_SRC0(x) _SB_MAKEVALUE(x,S_SPC_CFG_SRC0)
@@ -348,6 +401,7 @@
348 401
349#define M_SPC_CFG_CLEAR _SB_MAKEMASK1(32) 402#define M_SPC_CFG_CLEAR _SB_MAKEMASK1(32)
350#define M_SPC_CFG_ENABLE _SB_MAKEMASK1(33) 403#define M_SPC_CFG_ENABLE _SB_MAKEMASK1(33)
404#endif
351 405
352 406
353/* 407/*
@@ -412,6 +466,7 @@
412 * Address Trap Registers 466 * Address Trap Registers
413 */ 467 */
414 468
469#if SIBYTE_HDR_FEATURE_1250_112x
415#define M_ATRAP_INDEX _SB_MAKEMASK(4,0) 470#define M_ATRAP_INDEX _SB_MAKEMASK(4,0)
416#define M_ATRAP_ADDRESS _SB_MAKEMASK(40,0) 471#define M_ATRAP_ADDRESS _SB_MAKEMASK(40,0)
417 472
@@ -436,7 +491,6 @@
436#define K_BUS_AGENT_IOB0 2 491#define K_BUS_AGENT_IOB0 2
437#define K_BUS_AGENT_IOB1 3 492#define K_BUS_AGENT_IOB1 3
438#define K_BUS_AGENT_SCD 4 493#define K_BUS_AGENT_SCD 4
439#define K_BUS_AGENT_RESERVED 5
440#define K_BUS_AGENT_L2C 6 494#define K_BUS_AGENT_L2C 6
441#define K_BUS_AGENT_MC 7 495#define K_BUS_AGENT_MC 7
442 496
@@ -454,10 +508,14 @@
454#define K_ATRAP_CFG_CATTR_NOTNONCOH 6 508#define K_ATRAP_CFG_CATTR_NOTNONCOH 6
455#define K_ATRAP_CFG_CATTR_NOTCOHERENT 7 509#define K_ATRAP_CFG_CATTR_NOTCOHERENT 7
456 510
511#endif /* 1250/112x */
512
457/* 513/*
458 * Trace Buffer Config register 514 * Trace Buffer Config register
459 */ 515 */
460 516
517#if SIBYTE_HDR_FEATURE_1250_112x
518
461#define M_SCD_TRACE_CFG_RESET _SB_MAKEMASK1(0) 519#define M_SCD_TRACE_CFG_RESET _SB_MAKEMASK1(0)
462#define M_SCD_TRACE_CFG_START_READ _SB_MAKEMASK1(1) 520#define M_SCD_TRACE_CFG_START_READ _SB_MAKEMASK1(1)
463#define M_SCD_TRACE_CFG_START _SB_MAKEMASK1(2) 521#define M_SCD_TRACE_CFG_START _SB_MAKEMASK1(2)
@@ -475,6 +533,8 @@
475#define V_SCD_TRACE_CFG_CUR_ADDR(x) _SB_MAKEVALUE(x,S_SCD_TRACE_CFG_CUR_ADDR) 533#define V_SCD_TRACE_CFG_CUR_ADDR(x) _SB_MAKEVALUE(x,S_SCD_TRACE_CFG_CUR_ADDR)
476#define G_SCD_TRACE_CFG_CUR_ADDR(x) _SB_GETVALUE(x,S_SCD_TRACE_CFG_CUR_ADDR,M_SCD_TRACE_CFG_CUR_ADDR) 534#define G_SCD_TRACE_CFG_CUR_ADDR(x) _SB_GETVALUE(x,S_SCD_TRACE_CFG_CUR_ADDR,M_SCD_TRACE_CFG_CUR_ADDR)
477 535
536#endif /* 1250/112x */
537
478/* 538/*
479 * Trace Event registers 539 * Trace Event registers
480 */ 540 */
@@ -578,5 +638,7 @@
578#define M_SCD_TRSEQ_DEBUGPIN _SB_MAKEMASK1(20) 638#define M_SCD_TRSEQ_DEBUGPIN _SB_MAKEMASK1(20)
579#define M_SCD_TRSEQ_DEBUGCPU _SB_MAKEMASK1(21) 639#define M_SCD_TRSEQ_DEBUGCPU _SB_MAKEMASK1(21)
580#define M_SCD_TRSEQ_CLEARUSE _SB_MAKEMASK1(22) 640#define M_SCD_TRSEQ_CLEARUSE _SB_MAKEMASK1(22)
641#define M_SCD_TRSEQ_ALLD_A _SB_MAKEMASK1(23)
642#define M_SCD_TRSEQ_ALL_A _SB_MAKEMASK1(24)
581 643
582#endif 644#endif
diff --git a/include/asm-mips/sibyte/sb1250_smbus.h b/include/asm-mips/sibyte/sb1250_smbus.h
index 335c53e92936..279a912213cd 100644
--- a/include/asm-mips/sibyte/sb1250_smbus.h
+++ b/include/asm-mips/sibyte/sb1250_smbus.h
@@ -6,9 +6,8 @@
6 * This module contains constants and macros useful for 6 * This module contains constants and macros useful for
7 * manipulating the SB1250's SMbus devices. 7 * manipulating the SB1250's SMbus devices.
8 * 8 *
9 * SB1250 specification level: 01/02/2002 9 * SB1250 specification level: 10/21/02
10 * 10 * BCM1280 specification level: 11/24/03
11 * Author: Mitch Lichtenberg
12 * 11 *
13 ********************************************************************* 12 *********************************************************************
14 * 13 *
@@ -47,6 +46,7 @@
47 46
48#define K_SMB_FREQ_400KHZ 0x1F 47#define K_SMB_FREQ_400KHZ 0x1F
49#define K_SMB_FREQ_100KHZ 0x7D 48#define K_SMB_FREQ_100KHZ 0x7D
49#define K_SMB_FREQ_10KHZ 1250
50 50
51#define S_SMB_CMD 0 51#define S_SMB_CMD 0
52#define M_SMB_CMD _SB_MAKEMASK(8,S_SMB_CMD) 52#define M_SMB_CMD _SB_MAKEMASK(8,S_SMB_CMD)
@@ -58,7 +58,11 @@
58 58
59#define M_SMB_ERR_INTR _SB_MAKEMASK1(0) 59#define M_SMB_ERR_INTR _SB_MAKEMASK1(0)
60#define M_SMB_FINISH_INTR _SB_MAKEMASK1(1) 60#define M_SMB_FINISH_INTR _SB_MAKEMASK1(1)
61#define M_SMB_DATA_OUT _SB_MAKEMASK1(4) 61
62#define S_SMB_DATA_OUT 4
63#define M_SMB_DATA_OUT _SB_MAKEMASK1(S_SMB_DATA_OUT)
64#define V_SMB_DATA_OUT(x) _SB_MAKEVALUE(x,S_SMB_DATA_OUT)
65
62#define M_SMB_DATA_DIR _SB_MAKEMASK1(5) 66#define M_SMB_DATA_DIR _SB_MAKEMASK1(5)
63#define M_SMB_DATA_DIR_OUTPUT M_SMB_DATA_DIR 67#define M_SMB_DATA_DIR_OUTPUT M_SMB_DATA_DIR
64#define M_SMB_CLK_OUT _SB_MAKEMASK1(6) 68#define M_SMB_CLK_OUT _SB_MAKEMASK1(6)
@@ -71,8 +75,23 @@
71#define M_SMB_BUSY _SB_MAKEMASK1(0) 75#define M_SMB_BUSY _SB_MAKEMASK1(0)
72#define M_SMB_ERROR _SB_MAKEMASK1(1) 76#define M_SMB_ERROR _SB_MAKEMASK1(1)
73#define M_SMB_ERROR_TYPE _SB_MAKEMASK1(2) 77#define M_SMB_ERROR_TYPE _SB_MAKEMASK1(2)
74#define M_SMB_REF _SB_MAKEMASK1(6) 78
75#define M_SMB_DATA_IN _SB_MAKEMASK1(7) 79#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
80#define S_SMB_SCL_IN 5
81#define M_SMB_SCL_IN _SB_MAKEMASK1(S_SMB_SCL_IN)
82#define V_SMB_SCL_IN(x) _SB_MAKEVALUE(x,S_SMB_SCL_IN)
83#define G_SMB_SCL_IN(x) _SB_GETVALUE(x,S_SMB_SCL_IN,M_SMB_SCL_IN)
84#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
85
86#define S_SMB_REF 6
87#define M_SMB_REF _SB_MAKEMASK1(S_SMB_REF)
88#define V_SMB_REF(x) _SB_MAKEVALUE(x,S_SMB_REF)
89#define G_SMB_REF(x) _SB_GETVALUE(x,S_SMB_REF,M_SMB_REF)
90
91#define S_SMB_DATA_IN 7
92#define M_SMB_DATA_IN _SB_MAKEMASK1(S_SMB_DATA_IN)
93#define V_SMB_DATA_IN(x) _SB_MAKEVALUE(x,S_SMB_DATA_IN)
94#define G_SMB_DATA_IN(x) _SB_GETVALUE(x,S_SMB_DATA_IN,M_SMB_DATA_IN)
76 95
77/* 96/*
78 * SMBus Start/Command registers (Table 14-9) 97 * SMBus Start/Command registers (Table 14-9)
@@ -132,16 +151,14 @@
132#define V_SPEC_MB(x) _SB_MAKEVALUE(x,S_SPEC_PEC) 151#define V_SPEC_MB(x) _SB_MAKEVALUE(x,S_SPEC_PEC)
133 152
134 153
135#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 154#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
136 155
137#define S_SMB_CMDH 8 156#define S_SMB_CMDH 8
138#define M_SMB_CMDH _SB_MAKEMASK(8,S_SMBH_CMD) 157#define M_SMB_CMDH _SB_MAKEMASK(8,S_SMB_CMDH)
139#define V_SMB_CMDH(x) _SB_MAKEVALUE(x,S_SMBH_CMD) 158#define V_SMB_CMDH(x) _SB_MAKEVALUE(x,S_SMB_CMDH)
140 159
141#define M_SMB_EXTEND _SB_MAKEMASK1(14) 160#define M_SMB_EXTEND _SB_MAKEMASK1(14)
142 161
143#define M_SMB_DIR _SB_MAKEMASK1(13)
144
145#define S_SMB_DFMT 8 162#define S_SMB_DFMT 8
146#define M_SMB_DFMT _SB_MAKEMASK(3,S_SMB_DFMT) 163#define M_SMB_DFMT _SB_MAKEMASK(3,S_SMB_DFMT)
147#define V_SMB_DFMT(x) _SB_MAKEVALUE(x,S_SMB_DFMT) 164#define V_SMB_DFMT(x) _SB_MAKEVALUE(x,S_SMB_DFMT)
@@ -165,6 +182,23 @@
165#define V_SMB_DFMT_CMD5BYTE V_SMB_DFMT(K_SMB_DFMT_CMD5BYTE) 182#define V_SMB_DFMT_CMD5BYTE V_SMB_DFMT(K_SMB_DFMT_CMD5BYTE)
166#define V_SMB_DFMT_RESERVED V_SMB_DFMT(K_SMB_DFMT_RESERVED) 183#define V_SMB_DFMT_RESERVED V_SMB_DFMT(K_SMB_DFMT_RESERVED)
167 184
168#endif /* 1250 PASS2 || 112x PASS1 */ 185#define S_SMB_AFMT 11
186#define M_SMB_AFMT _SB_MAKEMASK(2,S_SMB_AFMT)
187#define V_SMB_AFMT(x) _SB_MAKEVALUE(x,S_SMB_AFMT)
188#define G_SMB_AFMT(x) _SB_GETVALUE(x,S_SMB_AFMT,M_SMB_AFMT)
189
190#define K_SMB_AFMT_NONE 0
191#define K_SMB_AFMT_ADDR 1
192#define K_SMB_AFMT_ADDR_CMD1BYTE 2
193#define K_SMB_AFMT_ADDR_CMD2BYTE 3
194
195#define V_SMB_AFMT_NONE V_SMB_AFMT(K_SMB_AFMT_NONE)
196#define V_SMB_AFMT_ADDR V_SMB_AFMT(K_SMB_AFMT_ADDR)
197#define V_SMB_AFMT_ADDR_CMD1BYTE V_SMB_AFMT(K_SMB_AFMT_ADDR_CMD1BYTE)
198#define V_SMB_AFMT_ADDR_CMD2BYTE V_SMB_AFMT(K_SMB_AFMT_ADDR_CMD2BYTE)
199
200#define M_SMB_DIR _SB_MAKEMASK1(13)
201
202#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
169 203
170#endif 204#endif
diff --git a/include/asm-mips/sibyte/sb1250_syncser.h b/include/asm-mips/sibyte/sb1250_syncser.h
index fa2760d38b8b..dd154ac505d8 100644
--- a/include/asm-mips/sibyte/sb1250_syncser.h
+++ b/include/asm-mips/sibyte/sb1250_syncser.h
@@ -8,8 +8,6 @@
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg
12 *
13 ********************************************************************* 11 *********************************************************************
14 * 12 *
15 * Copyright 2000,2001,2002,2003 13 * Copyright 2000,2001,2002,2003
diff --git a/include/asm-mips/sibyte/sb1250_uart.h b/include/asm-mips/sibyte/sb1250_uart.h
index 923ea4f44e0f..e87045e62bf0 100644
--- a/include/asm-mips/sibyte/sb1250_uart.h
+++ b/include/asm-mips/sibyte/sb1250_uart.h
@@ -8,8 +8,6 @@
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg
12 *
13 ********************************************************************* 11 *********************************************************************
14 * 12 *
15 * Copyright 2000,2001,2002,2003 13 * Copyright 2000,2001,2002,2003
@@ -240,7 +238,12 @@
240 */ 238 */
241 239
242#define M_DUART_ISR_TX_A _SB_MAKEMASK1(0) 240#define M_DUART_ISR_TX_A _SB_MAKEMASK1(0)
243#define M_DUART_ISR_RX_A _SB_MAKEMASK1(1) 241
242#define S_DUART_ISR_RX_A 1
243#define M_DUART_ISR_RX_A _SB_MAKEMASK1(S_DUART_ISR_RX_A)
244#define V_DUART_ISR_RX_A(x) _SB_MAKEVALUE(x,S_DUART_ISR_RX_A)
245#define G_DUART_ISR_RX_A(x) _SB_GETVALUE(x,S_DUART_ISR_RX_A,M_DUART_ISR_RX_A)
246
244#define M_DUART_ISR_BRK_A _SB_MAKEMASK1(2) 247#define M_DUART_ISR_BRK_A _SB_MAKEMASK1(2)
245#define M_DUART_ISR_IN_A _SB_MAKEMASK1(3) 248#define M_DUART_ISR_IN_A _SB_MAKEMASK1(3)
246#define M_DUART_ISR_TX_B _SB_MAKEMASK1(4) 249#define M_DUART_ISR_TX_B _SB_MAKEMASK1(4)
@@ -331,7 +334,7 @@
331#define M_DUART_OUT_PIN_CLR(chan) \ 334#define M_DUART_OUT_PIN_CLR(chan) \
332 (chan == 0 ? M_DUART_OUT_PIN_CLR0 : M_DUART_OUT_PIN_CLR1) 335 (chan == 0 ? M_DUART_OUT_PIN_CLR0 : M_DUART_OUT_PIN_CLR1)
333 336
334#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 337#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
335/* 338/*
336 * Full Interrupt Control Register 339 * Full Interrupt Control Register
337 */ 340 */
@@ -345,7 +348,7 @@
345#define M_DUART_INT_TIME _SB_MAKEMASK(4,S_DUART_INT_TIME) 348#define M_DUART_INT_TIME _SB_MAKEMASK(4,S_DUART_INT_TIME)
346#define V_DUART_INT_TIME(x) _SB_MAKEVALUE(x,S_DUART_INT_TIME) 349#define V_DUART_INT_TIME(x) _SB_MAKEVALUE(x,S_DUART_INT_TIME)
347#define G_DUART_INT_TIME(x) _SB_GETVALUE(x,S_DUART_INT_TIME,M_DUART_INT_TIME) 350#define G_DUART_INT_TIME(x) _SB_GETVALUE(x,S_DUART_INT_TIME,M_DUART_INT_TIME)
348#endif /* 1250 PASS2 || 112x PASS1 */ 351#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
349 352
350 353
351/* ********************************************************************** */ 354/* ********************************************************************** */
diff --git a/include/asm-mips/sibyte/swarm.h b/include/asm-mips/sibyte/swarm.h
index 97fa0494c30c..06e1d528e03a 100644
--- a/include/asm-mips/sibyte/swarm.h
+++ b/include/asm-mips/sibyte/swarm.h
@@ -34,7 +34,7 @@
34#define SIBYTE_DEFAULT_CONSOLE "ttyS0,115200" 34#define SIBYTE_DEFAULT_CONSOLE "ttyS0,115200"
35#endif 35#endif
36#ifdef CONFIG_SIBYTE_LITTLESUR 36#ifdef CONFIG_SIBYTE_LITTLESUR
37#define SIBYTE_BOARD_NAME "BCM1250C2 (LittleSur)" 37#define SIBYTE_BOARD_NAME "BCM91250C2 (LittleSur)"
38#define SIBYTE_HAVE_PCMCIA 0 38#define SIBYTE_HAVE_PCMCIA 0
39#define SIBYTE_HAVE_IDE 1 39#define SIBYTE_HAVE_IDE 1
40#define SIBYTE_DEFAULT_CONSOLE "cfe0" 40#define SIBYTE_DEFAULT_CONSOLE "cfe0"
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h
index f7fbebaa0744..8edabb0be23f 100644
--- a/include/asm-mips/sigcontext.h
+++ b/include/asm-mips/sigcontext.h
@@ -27,14 +27,15 @@ struct sigcontext {
27 unsigned int sc_fpc_csr; 27 unsigned int sc_fpc_csr;
28 unsigned int sc_fpc_eir; /* Unused */ 28 unsigned int sc_fpc_eir; /* Unused */
29 unsigned int sc_used_math; 29 unsigned int sc_used_math;
30 unsigned int sc_ssflags; /* Unused */ 30 unsigned int sc_dsp; /* dsp status, was sc_ssflags */
31 unsigned long long sc_mdhi; 31 unsigned long long sc_mdhi;
32 unsigned long long sc_mdlo; 32 unsigned long long sc_mdlo;
33 33 unsigned long sc_hi1; /* Was sc_cause */
34 unsigned int sc_cause; /* Unused */ 34 unsigned long sc_lo1; /* Was sc_badvaddr */
35 unsigned int sc_badvaddr; /* Unused */ 35 unsigned long sc_hi2; /* Was sc_sigset[4] */
36 36 unsigned long sc_lo2;
37 unsigned long sc_sigset[4]; /* kernel's sigset_t */ 37 unsigned long sc_hi3;
38 unsigned long sc_lo3;
38}; 39};
39 40
40#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 41#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
@@ -48,19 +49,19 @@ struct sigcontext {
48 * Warning: this structure illdefined with sc_badvaddr being just an unsigned 49 * Warning: this structure illdefined with sc_badvaddr being just an unsigned
49 * int so it was changed to unsigned long in 2.6.0-test1. This may break 50 * int so it was changed to unsigned long in 2.6.0-test1. This may break
50 * binary compatibility - no prisoners. 51 * binary compatibility - no prisoners.
52 * DSP ASE in 2.6.12-rc4. Turn sc_mdhi and sc_mdlo into an array of four
53 * entries, add sc_dsp and sc_reserved for padding. No prisoners.
51 */ 54 */
52struct sigcontext { 55struct sigcontext {
53 unsigned long sc_regs[32]; 56 unsigned long sc_regs[32];
54 unsigned long sc_fpregs[32]; 57 unsigned long sc_fpregs[32];
55 unsigned long sc_mdhi; 58 unsigned long sc_hi[4];
56 unsigned long sc_mdlo; 59 unsigned long sc_lo[4];
57 unsigned long sc_pc; 60 unsigned long sc_pc;
58 unsigned long sc_badvaddr;
59 unsigned int sc_status;
60 unsigned int sc_fpc_csr; 61 unsigned int sc_fpc_csr;
61 unsigned int sc_fpc_eir;
62 unsigned int sc_used_math; 62 unsigned int sc_used_math;
63 unsigned int sc_cause; 63 unsigned int sc_dsp;
64 unsigned int sc_reserved;
64}; 65};
65 66
66#ifdef __KERNEL__ 67#ifdef __KERNEL__
@@ -68,23 +69,24 @@ struct sigcontext {
68#include <linux/posix_types.h> 69#include <linux/posix_types.h>
69 70
70struct sigcontext32 { 71struct sigcontext32 {
71 __u32 sc_regmask; /* Unused */ 72 __u32 sc_regmask; /* Unused */
72 __u32 sc_status; 73 __u32 sc_status;
73 __u64 sc_pc; 74 __u64 sc_pc;
74 __u64 sc_regs[32]; 75 __u64 sc_regs[32];
75 __u64 sc_fpregs[32]; 76 __u64 sc_fpregs[32];
76 __u32 sc_ownedfp; /* Unused */ 77 __u32 sc_ownedfp; /* Unused */
77 __u32 sc_fpc_csr; 78 __u32 sc_fpc_csr;
78 __u32 sc_fpc_eir; /* Unused */ 79 __u32 sc_fpc_eir; /* Unused */
79 __u32 sc_used_math; 80 __u32 sc_used_math;
80 __u32 sc_ssflags; /* Unused */ 81 __u32 sc_dsp; /* dsp status, was sc_ssflags */
81 __u64 sc_mdhi; 82 __u64 sc_mdhi;
82 __u64 sc_mdlo; 83 __u64 sc_mdlo;
83 84 __u32 sc_hi1; /* Was sc_cause */
84 __u32 sc_cause; /* Unused */ 85 __u32 sc_lo1; /* Was sc_badvaddr */
85 __u32 sc_badvaddr; /* Unused */ 86 __u32 sc_hi2; /* Was sc_sigset[4] */
86 87 __u32 sc_lo2;
87 __u32 sc_sigset[4]; /* kernel's sigset_t */ 88 __u32 sc_hi3;
89 __u32 sc_lo3;
88}; 90};
89#endif /* __KERNEL__ */ 91#endif /* __KERNEL__ */
90 92
diff --git a/include/asm-mips/siginfo.h b/include/asm-mips/siginfo.h
index 698becab5a9e..2ba313d94a78 100644
--- a/include/asm-mips/siginfo.h
+++ b/include/asm-mips/siginfo.h
@@ -11,6 +11,7 @@
11 11
12#include <linux/config.h> 12#include <linux/config.h>
13 13
14#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
14#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */ 15#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
15 16
16#define HAVE_ARCH_SIGINFO_T 17#define HAVE_ARCH_SIGINFO_T
diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h
index f2c470f1d369..8ca539e80d87 100644
--- a/include/asm-mips/signal.h
+++ b/include/asm-mips/signal.h
@@ -98,12 +98,39 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */
98#define MINSIGSTKSZ 2048 98#define MINSIGSTKSZ 2048
99#define SIGSTKSZ 8192 99#define SIGSTKSZ 8192
100 100
101#ifdef __KERNEL__
102
103/*
104 * These values of sa_flags are used only by the kernel as part of the
105 * irq handling routines.
106 *
107 * SA_INTERRUPT is also used by the irq handling routines.
108 * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
109 */
110#define SA_SAMPLE_RANDOM SA_RESTART
111
112#ifdef CONFIG_TRAD_SIGNALS
113#define sig_uses_siginfo(ka) ((ka)->sa.sa_flags & SA_SIGINFO)
114#else
115#define sig_uses_siginfo(ka) (1)
116#endif
117
118#endif /* __KERNEL__ */
119
101#define SIG_BLOCK 1 /* for blocking signals */ 120#define SIG_BLOCK 1 /* for blocking signals */
102#define SIG_UNBLOCK 2 /* for unblocking signals */ 121#define SIG_UNBLOCK 2 /* for unblocking signals */
103#define SIG_SETMASK 3 /* for setting the signal mask */ 122#define SIG_SETMASK 3 /* for setting the signal mask */
104#define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility: 123#define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility:
105 set only the low 32 bit of the sigset. */ 124 set only the low 32 bit of the sigset. */
106#include <asm-generic/signal.h> 125
126/* Type of a signal handler. */
127typedef void __signalfn_t(int);
128typedef __signalfn_t __user *__sighandler_t;
129
130/* Fake signal functions */
131#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
132#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
133#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
107 134
108struct sigaction { 135struct sigaction {
109 unsigned int sa_flags; 136 unsigned int sa_flags;
diff --git a/include/asm-mips/sn/sn0/arch.h b/include/asm-mips/sn/sn0/arch.h
index 0e00dd474afc..fb78773a5efe 100644
--- a/include/asm-mips/sn/sn0/arch.h
+++ b/include/asm-mips/sn/sn0/arch.h
@@ -74,13 +74,8 @@
74#define MAX_MEM_SLOTS 32 /* max slots per node */ 74#define MAX_MEM_SLOTS 32 /* max slots per node */
75#endif /* defined(N_MODE) */ 75#endif /* defined(N_MODE) */
76 76
77#if SABLE_RTL
78#define SLOT_SHIFT (28)
79#define SLOT_MIN_MEM_SIZE (16*1024*1024)
80#else
81#define SLOT_SHIFT (27) 77#define SLOT_SHIFT (27)
82#define SLOT_MIN_MEM_SIZE (32*1024*1024) 78#define SLOT_MIN_MEM_SIZE (32*1024*1024)
83#endif
84 79
85#define CPUS_PER_NODE 2 /* CPUs on a single hub */ 80#define CPUS_PER_NODE 2 /* CPUs on a single hub */
86#define CPUS_PER_NODE_SHFT 1 /* Bits to shift in the node number */ 81#define CPUS_PER_NODE_SHFT 1 /* Bits to shift in the node number */
diff --git a/include/asm-mips/socket.h b/include/asm-mips/socket.h
index 753b6620e6fa..0bb31e5aaca6 100644
--- a/include/asm-mips/socket.h
+++ b/include/asm-mips/socket.h
@@ -37,8 +37,6 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
37#define SO_ERROR 0x1007 /* get error status and clear */ 37#define SO_ERROR 0x1007 /* get error status and clear */
38#define SO_SNDBUF 0x1001 /* Send buffer size. */ 38#define SO_SNDBUF 0x1001 /* Send buffer size. */
39#define SO_RCVBUF 0x1002 /* Receive buffer. */ 39#define SO_RCVBUF 0x1002 /* Receive buffer. */
40#define SO_SNDBUFFORCE 0x100a
41#define SO_RCVBUFFORCE 0x100b
42#define SO_SNDLOWAT 0x1003 /* send low-water mark */ 40#define SO_SNDLOWAT 0x1003 /* send low-water mark */
43#define SO_RCVLOWAT 0x1004 /* receive low-water mark */ 41#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
44#define SO_SNDTIMEO 0x1005 /* send timeout */ 42#define SO_SNDTIMEO 0x1005 /* send timeout */
@@ -69,6 +67,8 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
69#define SCM_TIMESTAMP SO_TIMESTAMP 67#define SCM_TIMESTAMP SO_TIMESTAMP
70 68
71#define SO_PEERSEC 30 69#define SO_PEERSEC 30
70#define SO_SNDBUFFORCE 31
71#define SO_RCVBUFFORCE 33
72 72
73#ifdef __KERNEL__ 73#ifdef __KERNEL__
74 74
@@ -92,6 +92,7 @@ enum sock_type {
92 SOCK_RAW = 3, 92 SOCK_RAW = 3,
93 SOCK_RDM = 4, 93 SOCK_RDM = 4,
94 SOCK_SEQPACKET = 5, 94 SOCK_SEQPACKET = 5,
95 SOCK_DCCP = 6,
95 SOCK_PACKET = 10, 96 SOCK_PACKET = 10,
96}; 97};
97 98
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h
index 4d0135b11156..669b8e349ff2 100644
--- a/include/asm-mips/spinlock.h
+++ b/include/asm-mips/spinlock.h
@@ -9,17 +9,16 @@
9#ifndef _ASM_SPINLOCK_H 9#ifndef _ASM_SPINLOCK_H
10#define _ASM_SPINLOCK_H 10#define _ASM_SPINLOCK_H
11 11
12#include <linux/config.h>
13#include <asm/war.h> 12#include <asm/war.h>
14 13
15/* 14/*
16 * Your basic SMP spinlocks, allowing only a single CPU anywhere 15 * Your basic SMP spinlocks, allowing only a single CPU anywhere
17 */ 16 */
18 17
19#define __raw_spin_is_locked(x) ((x)->lock != 0) 18#define __raw_spin_is_locked(x) ((x)->lock != 0)
20#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) 19#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
21#define __raw_spin_unlock_wait(x) \ 20#define __raw_spin_unlock_wait(x) \
22 do { cpu_relax(); } while ((x)->lock) 21 do { cpu_relax(); } while ((x)->lock)
23 22
24/* 23/*
25 * Simple spin lock operations. There are two variants, one clears IRQ's 24 * Simple spin lock operations. There are two variants, one clears IRQ's
@@ -119,6 +118,18 @@ static inline unsigned int __raw_spin_trylock(raw_spinlock_t *lock)
119 * read-locks. 118 * read-locks.
120 */ 119 */
121 120
121/*
122 * read_can_lock - would read_trylock() succeed?
123 * @lock: the rwlock in question.
124 */
125#define __raw_read_can_lock(rw) ((rw)->lock >= 0)
126
127/*
128 * write_can_lock - would write_trylock() succeed?
129 * @lock: the rwlock in question.
130 */
131#define __raw_write_can_lock(rw) (!(rw)->lock)
132
122static inline void __raw_read_lock(raw_rwlock_t *rw) 133static inline void __raw_read_lock(raw_rwlock_t *rw)
123{ 134{
124 unsigned int tmp; 135 unsigned int tmp;
@@ -197,8 +208,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw)
197 " lui %1, 0x8000 \n" 208 " lui %1, 0x8000 \n"
198 " sc %1, %0 \n" 209 " sc %1, %0 \n"
199 " beqzl %1, 1b \n" 210 " beqzl %1, 1b \n"
200 " nop \n" 211 " sync \n"
201 " sync \n"
202 " .set reorder \n" 212 " .set reorder \n"
203 : "=m" (rw->lock), "=&r" (tmp) 213 : "=m" (rw->lock), "=&r" (tmp)
204 : "m" (rw->lock) 214 : "m" (rw->lock)
@@ -211,8 +221,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw)
211 " lui %1, 0x8000 \n" 221 " lui %1, 0x8000 \n"
212 " sc %1, %0 \n" 222 " sc %1, %0 \n"
213 " beqz %1, 1b \n" 223 " beqz %1, 1b \n"
214 " nop \n" 224 " sync \n"
215 " sync \n"
216 " .set reorder \n" 225 " .set reorder \n"
217 : "=m" (rw->lock), "=&r" (tmp) 226 : "=m" (rw->lock), "=&r" (tmp)
218 : "m" (rw->lock) 227 : "m" (rw->lock)
@@ -246,8 +255,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
246 " lui %1, 0x8000 \n" 255 " lui %1, 0x8000 \n"
247 " sc %1, %0 \n" 256 " sc %1, %0 \n"
248 " beqzl %1, 1b \n" 257 " beqzl %1, 1b \n"
249 " nop \n" 258 " sync \n"
250 " sync \n"
251 " li %2, 1 \n" 259 " li %2, 1 \n"
252 " .set reorder \n" 260 " .set reorder \n"
253 "2: \n" 261 "2: \n"
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index 7b5e64600bc8..a8919dcc93c8 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -60,7 +60,6 @@
60 mfc0 k0, CP0_CONTEXT 60 mfc0 k0, CP0_CONTEXT
61 lui k1, %hi(kernelsp) 61 lui k1, %hi(kernelsp)
62 srl k0, k0, 23 62 srl k0, k0, 23
63 sll k0, k0, 2
64 addu k1, k0 63 addu k1, k0
65 LONG_L k1, %lo(kernelsp)(k1) 64 LONG_L k1, %lo(kernelsp)(k1)
66#endif 65#endif
@@ -76,9 +75,14 @@
76#endif 75#endif
77#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) 76#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64)
78 MFC0 k1, CP0_CONTEXT 77 MFC0 k1, CP0_CONTEXT
78 lui k0, %highest(kernelsp)
79 dsrl k1, 23 79 dsrl k1, 23
80 dsll k1, k1, 3 80 daddiu k0, %higher(kernelsp)
81 LONG_L k1, kernelsp(k1) 81 dsll k0, k0, 16
82 daddiu k0, %hi(kernelsp)
83 dsll k0, k0, 16
84 daddu k1, k1, k0
85 LONG_L k1, %lo(kernelsp)(k1)
82#endif 86#endif
83 .endm 87 .endm
84 88
@@ -86,25 +90,28 @@
86#ifdef CONFIG_32BIT 90#ifdef CONFIG_32BIT
87 mfc0 \temp, CP0_CONTEXT 91 mfc0 \temp, CP0_CONTEXT
88 srl \temp, 23 92 srl \temp, 23
89 sll \temp, 2
90 LONG_S \stackp, kernelsp(\temp)
91#endif 93#endif
92#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) 94#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
93 lw \temp, TI_CPU(gp) 95 lw \temp, TI_CPU(gp)
94 dsll \temp, 3 96 dsll \temp, 3
95 lui \temp2, %hi(kernelsp)
96 daddu \temp, \temp2
97 LONG_S \stackp, %lo(kernelsp)(\temp)
98#endif 97#endif
99#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) 98#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64)
100 lw \temp, TI_CPU(gp) 99 MFC0 \temp, CP0_CONTEXT
101 dsll \temp, 3 100 dsrl \temp, 23
102 LONG_S \stackp, kernelsp(\temp)
103#endif 101#endif
102 LONG_S \stackp, kernelsp(\temp)
104 .endm 103 .endm
105#else 104#else
106 .macro get_saved_sp /* Uniprocessor variation */ 105 .macro get_saved_sp /* Uniprocessor variation */
106#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64)
107 lui k1, %highest(kernelsp)
108 daddiu k1, %higher(kernelsp)
109 dsll k1, k1, 16
110 daddiu k1, %hi(kernelsp)
111 dsll k1, k1, 16
112#else
107 lui k1, %hi(kernelsp) 113 lui k1, %hi(kernelsp)
114#endif
108 LONG_L k1, %lo(kernelsp)(k1) 115 LONG_L k1, %lo(kernelsp)(k1)
109 .endm 116 .endm
110 117
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 6663efd49b27..330c4e497af3 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -17,6 +17,7 @@
17 17
18#include <asm/addrspace.h> 18#include <asm/addrspace.h>
19#include <asm/cpu-features.h> 19#include <asm/cpu-features.h>
20#include <asm/dsp.h>
20#include <asm/ptrace.h> 21#include <asm/ptrace.h>
21#include <asm/war.h> 22#include <asm/war.h>
22#include <asm/interrupt.h> 23#include <asm/interrupt.h>
@@ -70,7 +71,7 @@
70 * does not enforce ordering, since there is no data dependency between 71 * does not enforce ordering, since there is no data dependency between
71 * the read of "a" and the read of "b". Therefore, on some CPUs, such 72 * the read of "a" and the read of "b". Therefore, on some CPUs, such
72 * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() 73 * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb()
73 * in cases like thiswhere there are no data dependencies. 74 * in cases like this where there are no data dependencies.
74 */ 75 */
75 76
76#define read_barrier_depends() do { } while(0) 77#define read_barrier_depends() do { } while(0)
@@ -154,15 +155,15 @@ extern asmlinkage void *resume(void *last, void *next, void *next_ti);
154 155
155struct task_struct; 156struct task_struct;
156 157
157#define switch_to(prev,next,last) \ 158#define switch_to(prev,next,last) \
158do { \ 159do { \
159 (last) = resume(prev, next, next->thread_info); \ 160 if (cpu_has_dsp) \
161 __save_dsp(prev); \
162 (last) = resume(prev, next, next->thread_info); \
163 if (cpu_has_dsp) \
164 __restore_dsp(current); \
160} while(0) 165} while(0)
161 166
162#define ROT_IN_PIECES \
163 " .set noreorder \n" \
164 " .set reorder \n"
165
166static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) 167static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
167{ 168{
168 __u32 retval; 169 __u32 retval;
@@ -171,14 +172,17 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
171 unsigned long dummy; 172 unsigned long dummy;
172 173
173 __asm__ __volatile__( 174 __asm__ __volatile__(
175 " .set mips3 \n"
174 "1: ll %0, %3 # xchg_u32 \n" 176 "1: ll %0, %3 # xchg_u32 \n"
177 " .set mips0 \n"
175 " move %2, %z4 \n" 178 " move %2, %z4 \n"
179 " .set mips3 \n"
176 " sc %2, %1 \n" 180 " sc %2, %1 \n"
177 " beqzl %2, 1b \n" 181 " beqzl %2, 1b \n"
178 ROT_IN_PIECES
179#ifdef CONFIG_SMP 182#ifdef CONFIG_SMP
180 " sync \n" 183 " sync \n"
181#endif 184#endif
185 " .set mips0 \n"
182 : "=&r" (retval), "=m" (*m), "=&r" (dummy) 186 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
183 : "R" (*m), "Jr" (val) 187 : "R" (*m), "Jr" (val)
184 : "memory"); 188 : "memory");
@@ -186,13 +190,17 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
186 unsigned long dummy; 190 unsigned long dummy;
187 191
188 __asm__ __volatile__( 192 __asm__ __volatile__(
193 " .set mips3 \n"
189 "1: ll %0, %3 # xchg_u32 \n" 194 "1: ll %0, %3 # xchg_u32 \n"
195 " .set mips0 \n"
190 " move %2, %z4 \n" 196 " move %2, %z4 \n"
197 " .set mips3 \n"
191 " sc %2, %1 \n" 198 " sc %2, %1 \n"
192 " beqz %2, 1b \n" 199 " beqz %2, 1b \n"
193#ifdef CONFIG_SMP 200#ifdef CONFIG_SMP
194 " sync \n" 201 " sync \n"
195#endif 202#endif
203 " .set mips0 \n"
196 : "=&r" (retval), "=m" (*m), "=&r" (dummy) 204 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
197 : "R" (*m), "Jr" (val) 205 : "R" (*m), "Jr" (val)
198 : "memory"); 206 : "memory");
@@ -217,14 +225,15 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
217 unsigned long dummy; 225 unsigned long dummy;
218 226
219 __asm__ __volatile__( 227 __asm__ __volatile__(
228 " .set mips3 \n"
220 "1: lld %0, %3 # xchg_u64 \n" 229 "1: lld %0, %3 # xchg_u64 \n"
221 " move %2, %z4 \n" 230 " move %2, %z4 \n"
222 " scd %2, %1 \n" 231 " scd %2, %1 \n"
223 " beqzl %2, 1b \n" 232 " beqzl %2, 1b \n"
224 ROT_IN_PIECES
225#ifdef CONFIG_SMP 233#ifdef CONFIG_SMP
226 " sync \n" 234 " sync \n"
227#endif 235#endif
236 " .set mips0 \n"
228 : "=&r" (retval), "=m" (*m), "=&r" (dummy) 237 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
229 : "R" (*m), "Jr" (val) 238 : "R" (*m), "Jr" (val)
230 : "memory"); 239 : "memory");
@@ -232,6 +241,7 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
232 unsigned long dummy; 241 unsigned long dummy;
233 242
234 __asm__ __volatile__( 243 __asm__ __volatile__(
244 " .set mips3 \n"
235 "1: lld %0, %3 # xchg_u64 \n" 245 "1: lld %0, %3 # xchg_u64 \n"
236 " move %2, %z4 \n" 246 " move %2, %z4 \n"
237 " scd %2, %1 \n" 247 " scd %2, %1 \n"
@@ -239,6 +249,7 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
239#ifdef CONFIG_SMP 249#ifdef CONFIG_SMP
240 " sync \n" 250 " sync \n"
241#endif 251#endif
252 " .set mips0 \n"
242 : "=&r" (retval), "=m" (*m), "=&r" (dummy) 253 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
243 : "R" (*m), "Jr" (val) 254 : "R" (*m), "Jr" (val)
244 : "memory"); 255 : "memory");
@@ -286,34 +297,41 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old,
286 297
287 if (cpu_has_llsc && R10000_LLSC_WAR) { 298 if (cpu_has_llsc && R10000_LLSC_WAR) {
288 __asm__ __volatile__( 299 __asm__ __volatile__(
300 " .set push \n"
289 " .set noat \n" 301 " .set noat \n"
302 " .set mips3 \n"
290 "1: ll %0, %2 # __cmpxchg_u32 \n" 303 "1: ll %0, %2 # __cmpxchg_u32 \n"
291 " bne %0, %z3, 2f \n" 304 " bne %0, %z3, 2f \n"
305 " .set mips0 \n"
292 " move $1, %z4 \n" 306 " move $1, %z4 \n"
307 " .set mips3 \n"
293 " sc $1, %1 \n" 308 " sc $1, %1 \n"
294 " beqzl $1, 1b \n" 309 " beqzl $1, 1b \n"
295 ROT_IN_PIECES
296#ifdef CONFIG_SMP 310#ifdef CONFIG_SMP
297 " sync \n" 311 " sync \n"
298#endif 312#endif
299 "2: \n" 313 "2: \n"
300 " .set at \n" 314 " .set pop \n"
301 : "=&r" (retval), "=m" (*m) 315 : "=&r" (retval), "=m" (*m)
302 : "R" (*m), "Jr" (old), "Jr" (new) 316 : "R" (*m), "Jr" (old), "Jr" (new)
303 : "memory"); 317 : "memory");
304 } else if (cpu_has_llsc) { 318 } else if (cpu_has_llsc) {
305 __asm__ __volatile__( 319 __asm__ __volatile__(
320 " .set push \n"
306 " .set noat \n" 321 " .set noat \n"
322 " .set mips3 \n"
307 "1: ll %0, %2 # __cmpxchg_u32 \n" 323 "1: ll %0, %2 # __cmpxchg_u32 \n"
308 " bne %0, %z3, 2f \n" 324 " bne %0, %z3, 2f \n"
325 " .set mips0 \n"
309 " move $1, %z4 \n" 326 " move $1, %z4 \n"
327 " .set mips3 \n"
310 " sc $1, %1 \n" 328 " sc $1, %1 \n"
311 " beqz $1, 1b \n" 329 " beqz $1, 1b \n"
312#ifdef CONFIG_SMP 330#ifdef CONFIG_SMP
313 " sync \n" 331 " sync \n"
314#endif 332#endif
315 "2: \n" 333 "2: \n"
316 " .set at \n" 334 " .set pop \n"
317 : "=&r" (retval), "=m" (*m) 335 : "=&r" (retval), "=m" (*m)
318 : "R" (*m), "Jr" (old), "Jr" (new) 336 : "R" (*m), "Jr" (old), "Jr" (new)
319 : "memory"); 337 : "memory");
@@ -338,24 +356,27 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
338 356
339 if (cpu_has_llsc) { 357 if (cpu_has_llsc) {
340 __asm__ __volatile__( 358 __asm__ __volatile__(
359 " .set push \n"
341 " .set noat \n" 360 " .set noat \n"
361 " .set mips3 \n"
342 "1: lld %0, %2 # __cmpxchg_u64 \n" 362 "1: lld %0, %2 # __cmpxchg_u64 \n"
343 " bne %0, %z3, 2f \n" 363 " bne %0, %z3, 2f \n"
344 " move $1, %z4 \n" 364 " move $1, %z4 \n"
345 " scd $1, %1 \n" 365 " scd $1, %1 \n"
346 " beqzl $1, 1b \n" 366 " beqzl $1, 1b \n"
347 ROT_IN_PIECES
348#ifdef CONFIG_SMP 367#ifdef CONFIG_SMP
349 " sync \n" 368 " sync \n"
350#endif 369#endif
351 "2: \n" 370 "2: \n"
352 " .set at \n" 371 " .set pop \n"
353 : "=&r" (retval), "=m" (*m) 372 : "=&r" (retval), "=m" (*m)
354 : "R" (*m), "Jr" (old), "Jr" (new) 373 : "R" (*m), "Jr" (old), "Jr" (new)
355 : "memory"); 374 : "memory");
356 } else if (cpu_has_llsc) { 375 } else if (cpu_has_llsc) {
357 __asm__ __volatile__( 376 __asm__ __volatile__(
377 " .set push \n"
358 " .set noat \n" 378 " .set noat \n"
379 " .set mips3 \n"
359 "1: lld %0, %2 # __cmpxchg_u64 \n" 380 "1: lld %0, %2 # __cmpxchg_u64 \n"
360 " bne %0, %z3, 2f \n" 381 " bne %0, %z3, 2f \n"
361 " move $1, %z4 \n" 382 " move $1, %z4 \n"
@@ -365,7 +386,7 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
365 " sync \n" 386 " sync \n"
366#endif 387#endif
367 "2: \n" 388 "2: \n"
368 " .set at \n" 389 " .set pop \n"
369 : "=&r" (retval), "=m" (*m) 390 : "=&r" (retval), "=m" (*m)
370 : "R" (*m), "Jr" (old), "Jr" (new) 391 : "R" (*m), "Jr" (old), "Jr" (new)
371 : "memory"); 392 : "memory");
@@ -406,18 +427,20 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
406 427
407#define cmpxchg(ptr,old,new) ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr)))) 428#define cmpxchg(ptr,old,new) ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr))))
408 429
430extern void set_handler (unsigned long offset, void *addr, unsigned long len);
431extern void set_uncached_handler (unsigned long offset, void *addr, unsigned long len);
432extern void *set_vi_handler (int n, void *addr);
433extern void *set_vi_srs_handler (int n, void *addr, int regset);
409extern void *set_except_vector(int n, void *addr); 434extern void *set_except_vector(int n, void *addr);
410extern void per_cpu_trap_init(void); 435extern void per_cpu_trap_init(void);
411 436
412extern NORET_TYPE void __die(const char *, struct pt_regs *, const char *file, 437extern NORET_TYPE void die(const char *, struct pt_regs *);
413 const char *func, unsigned long line);
414extern void __die_if_kernel(const char *, struct pt_regs *, const char *file,
415 const char *func, unsigned long line);
416 438
417#define die(msg, regs) \ 439static inline void die_if_kernel(const char *str, struct pt_regs *regs)
418 __die(msg, regs, __FILE__ ":", __FUNCTION__, __LINE__) 440{
419#define die_if_kernel(msg, regs) \ 441 if (unlikely(!user_mode(regs)))
420 __die_if_kernel(msg, regs, __FILE__ ":", __FUNCTION__, __LINE__) 442 die(str, regs);
443}
421 444
422extern int stop_a_enabled; 445extern int stop_a_enabled;
423 446
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h
index a70cb0854c8a..e6c24472e03f 100644
--- a/include/asm-mips/thread_info.h
+++ b/include/asm-mips/thread_info.h
@@ -26,6 +26,7 @@ struct thread_info {
26 struct task_struct *task; /* main task structure */ 26 struct task_struct *task; /* main task structure */
27 struct exec_domain *exec_domain; /* execution domain */ 27 struct exec_domain *exec_domain; /* execution domain */
28 unsigned long flags; /* low level flags */ 28 unsigned long flags; /* low level flags */
29 unsigned long tp_value; /* thread pointer */
29 __u32 cpu; /* current CPU */ 30 __u32 cpu; /* current CPU */
30 int preempt_count; /* 0 => preemptable, <0 => BUG */ 31 int preempt_count; /* 0 => preemptable, <0 => BUG */
31 32
@@ -114,6 +115,7 @@ register struct thread_info *__current_thread_info __asm__("$28");
114#define TIF_SIGPENDING 2 /* signal pending */ 115#define TIF_SIGPENDING 2 /* signal pending */
115#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 116#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
116#define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ 117#define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */
118#define TIF_SECCOMP 5 /* secure computing */
117#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 119#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
118#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 120#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */
119#define TIF_MEMDIE 18 121#define TIF_MEMDIE 18
@@ -124,13 +126,14 @@ register struct thread_info *__current_thread_info __asm__("$28");
124#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 126#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
125#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 127#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
126#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 128#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
129#define _TIF_SECCOMP (1<<TIF_SECCOMP)
127#define _TIF_USEDFPU (1<<TIF_USEDFPU) 130#define _TIF_USEDFPU (1<<TIF_USEDFPU)
128#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 131#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
129 132
130#define _TIF_WORK_MASK 0x0000ffef /* work to do on 133/* work to do on interrupt/exception return */
131 interrupt/exception return */ 134#define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP)
132#define _TIF_ALLWORK_MASK 0x8000ffff /* work to do on any return to 135/* work to do on any return to u-space */
133 u-space */ 136#define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP)
134 137
135#endif /* __KERNEL__ */ 138#endif /* __KERNEL__ */
136 139
diff --git a/include/asm-mips/traps.h b/include/asm-mips/traps.h
index 179012263007..d02e019b0127 100644
--- a/include/asm-mips/traps.h
+++ b/include/asm-mips/traps.h
@@ -21,4 +21,7 @@
21extern void (*board_be_init)(void); 21extern void (*board_be_init)(void);
22extern int (*board_be_handler)(struct pt_regs *regs, int is_fixup); 22extern int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
23 23
24extern void (*board_nmi_handler_setup)(void);
25extern void (*board_ejtag_handler_setup)(void);
26
24#endif /* _ASM_TRAPS_H */ 27#endif /* _ASM_TRAPS_H */
diff --git a/include/asm-mips/tx4938/rbtx4938.h b/include/asm-mips/tx4938/rbtx4938.h
new file mode 100644
index 000000000000..0fbedafdcea8
--- /dev/null
+++ b/include/asm-mips/tx4938/rbtx4938.h
@@ -0,0 +1,207 @@
1/*
2 * linux/include/asm-mips/tx4938/rbtx4938.h
3 * Definitions for TX4937/TX4938
4 *
5 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
6 * terms of the GNU General Public License version 2. This program is
7 * licensed "as is" without any warranty of any kind, whether express
8 * or implied.
9 *
10 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
11 */
12#ifndef __ASM_TX_BOARDS_RBTX4938_H
13#define __ASM_TX_BOARDS_RBTX4938_H
14
15#include <asm/addrspace.h>
16#include <asm/tx4938/tx4938.h>
17
18/* CS */
19#define RBTX4938_CE0 0x1c000000 /* 64M */
20#define RBTX4938_CE2 0x17f00000 /* 1M */
21
22/* Address map */
23#define RBTX4938_FPGA_REG_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000000)
24#define RBTX4938_FPGA_REV_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000002)
25#define RBTX4938_CONFIG1_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000004)
26#define RBTX4938_CONFIG2_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000006)
27#define RBTX4938_CONFIG3_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000008)
28#define RBTX4938_LED_ADDR (KSEG1 + RBTX4938_CE2 + 0x00001000)
29#define RBTX4938_DIPSW_ADDR (KSEG1 + RBTX4938_CE2 + 0x00001002)
30#define RBTX4938_BDIPSW_ADDR (KSEG1 + RBTX4938_CE2 + 0x00001004)
31#define RBTX4938_IMASK_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002000)
32#define RBTX4938_IMASK2_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002002)
33#define RBTX4938_INTPOL_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002004)
34#define RBTX4938_ISTAT_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002006)
35#define RBTX4938_ISTAT2_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002008)
36#define RBTX4938_IMSTAT_ADDR (KSEG1 + RBTX4938_CE2 + 0x0000200a)
37#define RBTX4938_IMSTAT2_ADDR (KSEG1 + RBTX4938_CE2 + 0x0000200c)
38#define RBTX4938_SOFTINT_ADDR (KSEG1 + RBTX4938_CE2 + 0x00003000)
39#define RBTX4938_PIOSEL_ADDR (KSEG1 + RBTX4938_CE2 + 0x00005000)
40#define RBTX4938_SPICS_ADDR (KSEG1 + RBTX4938_CE2 + 0x00005002)
41#define RBTX4938_SFPWR_ADDR (KSEG1 + RBTX4938_CE2 + 0x00005008)
42#define RBTX4938_SFVOL_ADDR (KSEG1 + RBTX4938_CE2 + 0x0000500a)
43#define RBTX4938_SOFTRESET_ADDR (KSEG1 + RBTX4938_CE2 + 0x00007000)
44#define RBTX4938_SOFTRESETLOCK_ADDR (KSEG1 + RBTX4938_CE2 + 0x00007002)
45#define RBTX4938_PCIRESET_ADDR (KSEG1 + RBTX4938_CE2 + 0x00007004)
46#define RBTX4938_ETHER_BASE (KSEG1 + RBTX4938_CE2 + 0x00020000)
47
48/* Ethernet port address (Jumperless Mode (W12:Open)) */
49#define RBTX4938_ETHER_ADDR (RBTX4938_ETHER_BASE + 0x280)
50
51/* bits for ISTAT/IMASK/IMSTAT */
52#define RBTX4938_INTB_PCID 0
53#define RBTX4938_INTB_PCIC 1
54#define RBTX4938_INTB_PCIB 2
55#define RBTX4938_INTB_PCIA 3
56#define RBTX4938_INTB_RTC 4
57#define RBTX4938_INTB_ATA 5
58#define RBTX4938_INTB_MODEM 6
59#define RBTX4938_INTB_SWINT 7
60#define RBTX4938_INTF_PCID (1 << RBTX4938_INTB_PCID)
61#define RBTX4938_INTF_PCIC (1 << RBTX4938_INTB_PCIC)
62#define RBTX4938_INTF_PCIB (1 << RBTX4938_INTB_PCIB)
63#define RBTX4938_INTF_PCIA (1 << RBTX4938_INTB_PCIA)
64#define RBTX4938_INTF_RTC (1 << RBTX4938_INTB_RTC)
65#define RBTX4938_INTF_ATA (1 << RBTX4938_INTB_ATA)
66#define RBTX4938_INTF_MODEM (1 << RBTX4938_INTB_MODEM)
67#define RBTX4938_INTF_SWINT (1 << RBTX4938_INTB_SWINT)
68
69#define rbtx4938_fpga_rev_ptr \
70 ((volatile unsigned char *)RBTX4938_FPGA_REV_ADDR)
71#define rbtx4938_led_ptr \
72 ((volatile unsigned char *)RBTX4938_LED_ADDR)
73#define rbtx4938_dipsw_ptr \
74 ((volatile unsigned char *)RBTX4938_DIPSW_ADDR)
75#define rbtx4938_bdipsw_ptr \
76 ((volatile unsigned char *)RBTX4938_BDIPSW_ADDR)
77#define rbtx4938_imask_ptr \
78 ((volatile unsigned char *)RBTX4938_IMASK_ADDR)
79#define rbtx4938_imask2_ptr \
80 ((volatile unsigned char *)RBTX4938_IMASK2_ADDR)
81#define rbtx4938_intpol_ptr \
82 ((volatile unsigned char *)RBTX4938_INTPOL_ADDR)
83#define rbtx4938_istat_ptr \
84 ((volatile unsigned char *)RBTX4938_ISTAT_ADDR)
85#define rbtx4938_istat2_ptr \
86 ((volatile unsigned char *)RBTX4938_ISTAT2_ADDR)
87#define rbtx4938_imstat_ptr \
88 ((volatile unsigned char *)RBTX4938_IMSTAT_ADDR)
89#define rbtx4938_imstat2_ptr \
90 ((volatile unsigned char *)RBTX4938_IMSTAT2_ADDR)
91#define rbtx4938_softint_ptr \
92 ((volatile unsigned char *)RBTX4938_SOFTINT_ADDR)
93#define rbtx4938_piosel_ptr \
94 ((volatile unsigned char *)RBTX4938_PIOSEL_ADDR)
95#define rbtx4938_spics_ptr \
96 ((volatile unsigned char *)RBTX4938_SPICS_ADDR)
97#define rbtx4938_sfpwr_ptr \
98 ((volatile unsigned char *)RBTX4938_SFPWR_ADDR)
99#define rbtx4938_sfvol_ptr \
100 ((volatile unsigned char *)RBTX4938_SFVOL_ADDR)
101#define rbtx4938_softreset_ptr \
102 ((volatile unsigned char *)RBTX4938_SOFTRESET_ADDR)
103#define rbtx4938_softresetlock_ptr \
104 ((volatile unsigned char *)RBTX4938_SOFTRESETLOCK_ADDR)
105#define rbtx4938_pcireset_ptr \
106 ((volatile unsigned char *)RBTX4938_PCIRESET_ADDR)
107
108/* SPI */
109#define RBTX4938_SEEPROM1_CHIPID 0
110#define RBTX4938_SEEPROM2_CHIPID 1
111#define RBTX4938_SEEPROM3_CHIPID 2
112#define RBTX4938_SRTC_CHIPID 3
113
114/*
115 * IRQ mappings
116 */
117
118#define RBTX4938_SOFT_INT0 0 /* not used */
119#define RBTX4938_SOFT_INT1 1 /* not used */
120#define RBTX4938_IRC_INT 2
121#define RBTX4938_TIMER_INT 7
122
123/* These are the virtual IRQ numbers, we divide all IRQ's into
124 * 'spaces', the 'space' determines where and how to enable/disable
125 * that particular IRQ on an RBTX4938 machine. Add new 'spaces' as new
126 * IRQ hardware is supported.
127 */
128#define RBTX4938_NR_IRQ_LOCAL 8
129#define RBTX4938_NR_IRQ_IRC 32 /* On-Chip IRC */
130#define RBTX4938_NR_IRQ_IOC 8
131
132#define MI8259_IRQ_ISA_RAW_BEG 0 /* optional backplane i8259 */
133#define MI8259_IRQ_ISA_RAW_END 15
134#define TX4938_IRQ_CP0_RAW_BEG 0 /* tx4938 cpu built-in cp0 */
135#define TX4938_IRQ_CP0_RAW_END 7
136#define TX4938_IRQ_PIC_RAW_BEG 0 /* tx4938 cpu build-in pic */
137#define TX4938_IRQ_PIC_RAW_END 31
138
139#define MI8259_IRQ_ISA_BEG MI8259_IRQ_ISA_RAW_BEG /* 0 */
140#define MI8259_IRQ_ISA_END MI8259_IRQ_ISA_RAW_END /* 15 */
141
142#define TX4938_IRQ_CP0_BEG ((MI8259_IRQ_ISA_END+1)+TX4938_IRQ_CP0_RAW_BEG) /* 16 */
143#define TX4938_IRQ_CP0_END ((MI8259_IRQ_ISA_END+1)+TX4938_IRQ_CP0_RAW_END) /* 23 */
144
145#define TX4938_IRQ_PIC_BEG ((TX4938_IRQ_CP0_END+1)+TX4938_IRQ_PIC_RAW_BEG) /* 24 */
146#define TX4938_IRQ_PIC_END ((TX4938_IRQ_CP0_END+1)+TX4938_IRQ_PIC_RAW_END) /* 55 */
147#define TX4938_IRQ_NEST_EXT_ON_PIC (TX4938_IRQ_PIC_BEG+2)
148#define TX4938_IRQ_NEST_PIC_ON_CP0 (TX4938_IRQ_CP0_BEG+2)
149#define TX4938_IRQ_USER0 (TX4938_IRQ_CP0_BEG+0)
150#define TX4938_IRQ_USER1 (TX4938_IRQ_CP0_BEG+1)
151#define TX4938_IRQ_CPU_TIMER (TX4938_IRQ_CP0_BEG+7)
152
153#define TOSHIBA_RBTX4938_IRQ_IOC_RAW_BEG 0
154#define TOSHIBA_RBTX4938_IRQ_IOC_RAW_END 7
155
156#define TOSHIBA_RBTX4938_IRQ_IOC_BEG ((TX4938_IRQ_PIC_END+1)+TOSHIBA_RBTX4938_IRQ_IOC_RAW_BEG) /* 56 */
157#define TOSHIBA_RBTX4938_IRQ_IOC_END ((TX4938_IRQ_PIC_END+1)+TOSHIBA_RBTX4938_IRQ_IOC_RAW_END) /* 63 */
158#define RBTX4938_IRQ_LOCAL TX4938_IRQ_CP0_BEG
159#define RBTX4938_IRQ_IRC (RBTX4938_IRQ_LOCAL + RBTX4938_NR_IRQ_LOCAL)
160#define RBTX4938_IRQ_IOC (RBTX4938_IRQ_IRC + RBTX4938_NR_IRQ_IRC)
161#define RBTX4938_IRQ_END (RBTX4938_IRQ_IOC + RBTX4938_NR_IRQ_IOC)
162
163#define RBTX4938_IRQ_LOCAL_SOFT0 (RBTX4938_IRQ_LOCAL + RBTX4938_SOFT_INT0)
164#define RBTX4938_IRQ_LOCAL_SOFT1 (RBTX4938_IRQ_LOCAL + RBTX4938_SOFT_INT1)
165#define RBTX4938_IRQ_LOCAL_IRC (RBTX4938_IRQ_LOCAL + RBTX4938_IRC_INT)
166#define RBTX4938_IRQ_LOCAL_TIMER (RBTX4938_IRQ_LOCAL + RBTX4938_TIMER_INT)
167#define RBTX4938_IRQ_IRC_ECCERR (RBTX4938_IRQ_IRC + TX4938_IR_ECCERR)
168#define RBTX4938_IRQ_IRC_WTOERR (RBTX4938_IRQ_IRC + TX4938_IR_WTOERR)
169#define RBTX4938_IRQ_IRC_INT(n) (RBTX4938_IRQ_IRC + TX4938_IR_INT(n))
170#define RBTX4938_IRQ_IRC_SIO(n) (RBTX4938_IRQ_IRC + TX4938_IR_SIO(n))
171#define RBTX4938_IRQ_IRC_DMA(ch,n) (RBTX4938_IRQ_IRC + TX4938_IR_DMA(ch,n))
172#define RBTX4938_IRQ_IRC_PIO (RBTX4938_IRQ_IRC + TX4938_IR_PIO)
173#define RBTX4938_IRQ_IRC_PDMAC (RBTX4938_IRQ_IRC + TX4938_IR_PDMAC)
174#define RBTX4938_IRQ_IRC_PCIC (RBTX4938_IRQ_IRC + TX4938_IR_PCIC)
175#define RBTX4938_IRQ_IRC_TMR(n) (RBTX4938_IRQ_IRC + TX4938_IR_TMR(n))
176#define RBTX4938_IRQ_IRC_NDFMC (RBTX4938_IRQ_IRC + TX4938_IR_NDFMC)
177#define RBTX4938_IRQ_IRC_PCIERR (RBTX4938_IRQ_IRC + TX4938_IR_PCIERR)
178#define RBTX4938_IRQ_IRC_PCIPME (RBTX4938_IRQ_IRC + TX4938_IR_PCIPME)
179#define RBTX4938_IRQ_IRC_ACLC (RBTX4938_IRQ_IRC + TX4938_IR_ACLC)
180#define RBTX4938_IRQ_IRC_ACLCPME (RBTX4938_IRQ_IRC + TX4938_IR_ACLCPME)
181#define RBTX4938_IRQ_IRC_PCIC1 (RBTX4938_IRQ_IRC + TX4938_IR_PCIC1)
182#define RBTX4938_IRQ_IRC_SPI (RBTX4938_IRQ_IRC + TX4938_IR_SPI)
183#define RBTX4938_IRQ_IOC_PCID (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCID)
184#define RBTX4938_IRQ_IOC_PCIC (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIC)
185#define RBTX4938_IRQ_IOC_PCIB (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIB)
186#define RBTX4938_IRQ_IOC_PCIA (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIA)
187#define RBTX4938_IRQ_IOC_RTC (RBTX4938_IRQ_IOC + RBTX4938_INTB_RTC)
188#define RBTX4938_IRQ_IOC_ATA (RBTX4938_IRQ_IOC + RBTX4938_INTB_ATA)
189#define RBTX4938_IRQ_IOC_MODEM (RBTX4938_IRQ_IOC + RBTX4938_INTB_MODEM)
190#define RBTX4938_IRQ_IOC_SWINT (RBTX4938_IRQ_IOC + RBTX4938_INTB_SWINT)
191
192
193/* IOC (PCI, etc) */
194#define RBTX4938_IRQ_IOCINT (TX4938_IRQ_NEST_EXT_ON_PIC)
195/* Onboard 10M Ether */
196#define RBTX4938_IRQ_ETHER (TX4938_IRQ_NEST_EXT_ON_PIC + 1)
197
198#define RBTX4938_RTL_8019_BASE (RBTX4938_ETHER_ADDR - mips_io_port_base)
199#define RBTX4938_RTL_8019_IRQ (RBTX4938_IRQ_ETHER)
200
201/* IRCR : Int. Control */
202#define TX4938_IRCR_LOW 0x00000000
203#define TX4938_IRCR_HIGH 0x00000001
204#define TX4938_IRCR_DOWN 0x00000002
205#define TX4938_IRCR_UP 0x00000003
206
207#endif /* __ASM_TX_BOARDS_RBTX4938_H */
diff --git a/include/asm-mips/tx4938/spi.h b/include/asm-mips/tx4938/spi.h
new file mode 100644
index 000000000000..0dbbab820a5a
--- /dev/null
+++ b/include/asm-mips/tx4938/spi.h
@@ -0,0 +1,74 @@
1/*
2 * linux/include/asm-mips/tx4938/spi.h
3 * Definitions for TX4937/TX4938 SPI
4 *
5 * Copyright (C) 2000-2001 Toshiba Corporation
6 *
7 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 *
12 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
13 */
14#ifndef __ASM_TX_BOARDS_TX4938_SPI_H
15#define __ASM_TX_BOARDS_TX4938_SPI_H
16
17/* SPI */
18struct spi_dev_desc {
19 unsigned int baud;
20 unsigned short tcss, tcsh, tcsr; /* CS setup/hold/recovery time */
21 unsigned int byteorder:1; /* 0:LSB-First, 1:MSB-First */
22 unsigned int polarity:1; /* 0:High-Active */
23 unsigned int phase:1; /* 0:Sample-Then-Shift */
24};
25
26extern void txx9_spi_init(unsigned long base, int (*cs_func)(int chipid, int on)) __init;
27extern void txx9_spi_irqinit(int irc_irq) __init;
28extern int txx9_spi_io(int chipid, struct spi_dev_desc *desc,
29 unsigned char **inbufs, unsigned int *incounts,
30 unsigned char **outbufs, unsigned int *outcounts,
31 int cansleep);
32extern int spi_eeprom_write_enable(int chipid, int enable);
33extern int spi_eeprom_read_status(int chipid);
34extern int spi_eeprom_read(int chipid, int address, unsigned char *buf, int len);
35extern int spi_eeprom_write(int chipid, int address, unsigned char *buf, int len);
36extern void spi_eeprom_proc_create(struct proc_dir_entry *dir, int chipid) __init;
37
38#define TXX9_IMCLK (txx9_gbus_clock / 2)
39
40/*
41* SPI
42*/
43
44/* SPMCR : SPI Master Control */
45#define TXx9_SPMCR_OPMODE 0xc0
46#define TXx9_SPMCR_CONFIG 0x40
47#define TXx9_SPMCR_ACTIVE 0x80
48#define TXx9_SPMCR_SPSTP 0x02
49#define TXx9_SPMCR_BCLR 0x01
50
51/* SPCR0 : SPI Status */
52#define TXx9_SPCR0_TXIFL_MASK 0xc000
53#define TXx9_SPCR0_RXIFL_MASK 0x3000
54#define TXx9_SPCR0_SIDIE 0x0800
55#define TXx9_SPCR0_SOEIE 0x0400
56#define TXx9_SPCR0_RBSIE 0x0200
57#define TXx9_SPCR0_TBSIE 0x0100
58#define TXx9_SPCR0_IFSPSE 0x0010
59#define TXx9_SPCR0_SBOS 0x0004
60#define TXx9_SPCR0_SPHA 0x0002
61#define TXx9_SPCR0_SPOL 0x0001
62
63/* SPSR : SPI Status */
64#define TXx9_SPSR_TBSI 0x8000
65#define TXx9_SPSR_RBSI 0x4000
66#define TXx9_SPSR_TBS_MASK 0x3800
67#define TXx9_SPSR_RBS_MASK 0x0700
68#define TXx9_SPSR_SPOE 0x0080
69#define TXx9_SPSR_IFSD 0x0008
70#define TXx9_SPSR_SIDLE 0x0004
71#define TXx9_SPSR_STRDY 0x0002
72#define TXx9_SPSR_SRRDY 0x0001
73
74#endif /* __ASM_TX_BOARDS_TX4938_SPI_H */
diff --git a/include/asm-mips/tx4938/tx4938.h b/include/asm-mips/tx4938/tx4938.h
new file mode 100644
index 000000000000..e25b1a0975cb
--- /dev/null
+++ b/include/asm-mips/tx4938/tx4938.h
@@ -0,0 +1,706 @@
1/*
2 * linux/include/asm-mips/tx4938/tx4938.h
3 * Definitions for TX4937/TX4938
4 * Copyright (C) 2000-2001 Toshiba Corporation
5 *
6 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
7 * terms of the GNU General Public License version 2. This program is
8 * licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
12 */
13#ifndef __ASM_TX_BOARDS_TX4938_H
14#define __ASM_TX_BOARDS_TX4938_H
15
16#include <asm/tx4938/tx4938_mips.h>
17
18#define tx4938_read_nfmc(addr) (*(volatile unsigned int *)(addr))
19#define tx4938_write_nfmc(b,addr) (*(volatile unsigned int *)(addr)) = (b)
20
21#define TX4938_NR_IRQ_LOCAL TX4938_IRQ_PIC_BEG
22
23#define TX4938_IRQ_IRC_PCIC (TX4938_NR_IRQ_LOCAL + TX4938_IR_PCIC)
24#define TX4938_IRQ_IRC_PCIERR (TX4938_NR_IRQ_LOCAL + TX4938_IR_PCIERR)
25
26#define TX4938_PCIIO_0 0x10000000
27#define TX4938_PCIIO_1 0x01010000
28#define TX4938_PCIMEM_0 0x08000000
29#define TX4938_PCIMEM_1 0x11000000
30
31#define TX4938_PCIIO_SIZE_0 0x01000000
32#define TX4938_PCIIO_SIZE_1 0x00010000
33#define TX4938_PCIMEM_SIZE_0 0x08000000
34#define TX4938_PCIMEM_SIZE_1 0x00010000
35
36#define TX4938_REG_BASE 0xff1f0000 /* == TX4937_REG_BASE */
37#define TX4938_REG_SIZE 0x00010000 /* == TX4937_REG_SIZE */
38
39/* NDFMC, SRAMC, PCIC1, SPIC: TX4938 only */
40#define TX4938_NDFMC_REG (TX4938_REG_BASE + 0x5000)
41#define TX4938_SRAMC_REG (TX4938_REG_BASE + 0x6000)
42#define TX4938_PCIC1_REG (TX4938_REG_BASE + 0x7000)
43#define TX4938_SDRAMC_REG (TX4938_REG_BASE + 0x8000)
44#define TX4938_EBUSC_REG (TX4938_REG_BASE + 0x9000)
45#define TX4938_DMA_REG(ch) (TX4938_REG_BASE + 0xb000 + (ch) * 0x800)
46#define TX4938_PCIC_REG (TX4938_REG_BASE + 0xd000)
47#define TX4938_CCFG_REG (TX4938_REG_BASE + 0xe000)
48#define TX4938_NR_TMR 3
49#define TX4938_TMR_REG(ch) ((TX4938_REG_BASE + 0xf000) + (ch) * 0x100)
50#define TX4938_NR_SIO 2
51#define TX4938_SIO_REG(ch) ((TX4938_REG_BASE + 0xf300) + (ch) * 0x100)
52#define TX4938_PIO_REG (TX4938_REG_BASE + 0xf500)
53#define TX4938_IRC_REG (TX4938_REG_BASE + 0xf600)
54#define TX4938_ACLC_REG (TX4938_REG_BASE + 0xf700)
55#define TX4938_SPI_REG (TX4938_REG_BASE + 0xf800)
56
57#ifndef _LANGUAGE_ASSEMBLY
58#include <asm/byteorder.h>
59
60#define TX4938_MKA(x) ((u32)( ((u32)(TX4938_REG_BASE)) | ((u32)(x)) ))
61
62#define TX4938_RD08( reg ) (*(vu08*)(reg))
63#define TX4938_WR08( reg, val ) ((*(vu08*)(reg))=(val))
64
65#define TX4938_RD16( reg ) (*(vu16*)(reg))
66#define TX4938_WR16( reg, val ) ((*(vu16*)(reg))=(val))
67
68#define TX4938_RD32( reg ) (*(vu32*)(reg))
69#define TX4938_WR32( reg, val ) ((*(vu32*)(reg))=(val))
70
71#define TX4938_RD64( reg ) (*(vu64*)(reg))
72#define TX4938_WR64( reg, val ) ((*(vu64*)(reg))=(val))
73
74#define TX4938_RD( reg ) TX4938_RD32( reg )
75#define TX4938_WR( reg, val ) TX4938_WR32( reg, val )
76
77#endif /* !__ASSEMBLY__ */
78
79#ifdef __ASSEMBLY__
80#define _CONST64(c) c
81#else
82#define _CONST64(c) c##ull
83
84#include <asm/byteorder.h>
85
86#ifdef __BIG_ENDIAN
87#define endian_def_l2(e1,e2) \
88 volatile unsigned long e1,e2
89#define endian_def_s2(e1,e2) \
90 volatile unsigned short e1,e2
91#define endian_def_sb2(e1,e2,e3) \
92 volatile unsigned short e1;volatile unsigned char e2,e3
93#define endian_def_b2s(e1,e2,e3) \
94 volatile unsigned char e1,e2;volatile unsigned short e3
95#define endian_def_b4(e1,e2,e3,e4) \
96 volatile unsigned char e1,e2,e3,e4
97#else
98#define endian_def_l2(e1,e2) \
99 volatile unsigned long e2,e1
100#define endian_def_s2(e1,e2) \
101 volatile unsigned short e2,e1
102#define endian_def_sb2(e1,e2,e3) \
103 volatile unsigned char e3,e2;volatile unsigned short e1
104#define endian_def_b2s(e1,e2,e3) \
105 volatile unsigned short e3;volatile unsigned char e2,e1
106#define endian_def_b4(e1,e2,e3,e4) \
107 volatile unsigned char e4,e3,e2,e1
108#endif
109
110
111struct tx4938_sdramc_reg {
112 volatile unsigned long long cr[4];
113 volatile unsigned long long unused0[4];
114 volatile unsigned long long tr;
115 volatile unsigned long long unused1[2];
116 volatile unsigned long long cmd;
117 volatile unsigned long long sfcmd;
118};
119
120struct tx4938_ebusc_reg {
121 volatile unsigned long long cr[8];
122};
123
124struct tx4938_dma_reg {
125 struct tx4938_dma_ch_reg {
126 volatile unsigned long long cha;
127 volatile unsigned long long sar;
128 volatile unsigned long long dar;
129 endian_def_l2(unused0, cntr);
130 endian_def_l2(unused1, sair);
131 endian_def_l2(unused2, dair);
132 endian_def_l2(unused3, ccr);
133 endian_def_l2(unused4, csr);
134 } ch[4];
135 volatile unsigned long long dbr[8];
136 volatile unsigned long long tdhr;
137 volatile unsigned long long midr;
138 endian_def_l2(unused0, mcr);
139};
140
141struct tx4938_pcic_reg {
142 volatile unsigned long pciid;
143 volatile unsigned long pcistatus;
144 volatile unsigned long pciccrev;
145 volatile unsigned long pcicfg1;
146 volatile unsigned long p2gm0plbase; /* +10 */
147 volatile unsigned long p2gm0pubase;
148 volatile unsigned long p2gm1plbase;
149 volatile unsigned long p2gm1pubase;
150 volatile unsigned long p2gm2pbase; /* +20 */
151 volatile unsigned long p2giopbase;
152 volatile unsigned long unused0;
153 volatile unsigned long pcisid;
154 volatile unsigned long unused1; /* +30 */
155 volatile unsigned long pcicapptr;
156 volatile unsigned long unused2;
157 volatile unsigned long pcicfg2;
158 volatile unsigned long g2ptocnt; /* +40 */
159 volatile unsigned long unused3[15];
160 volatile unsigned long g2pstatus; /* +80 */
161 volatile unsigned long g2pmask;
162 volatile unsigned long pcisstatus;
163 volatile unsigned long pcimask;
164 volatile unsigned long p2gcfg; /* +90 */
165 volatile unsigned long p2gstatus;
166 volatile unsigned long p2gmask;
167 volatile unsigned long p2gccmd;
168 volatile unsigned long unused4[24]; /* +a0 */
169 volatile unsigned long pbareqport; /* +100 */
170 volatile unsigned long pbacfg;
171 volatile unsigned long pbastatus;
172 volatile unsigned long pbamask;
173 volatile unsigned long pbabm; /* +110 */
174 volatile unsigned long pbacreq;
175 volatile unsigned long pbacgnt;
176 volatile unsigned long pbacstate;
177 volatile unsigned long long g2pmgbase[3]; /* +120 */
178 volatile unsigned long long g2piogbase;
179 volatile unsigned long g2pmmask[3]; /* +140 */
180 volatile unsigned long g2piomask;
181 volatile unsigned long long g2pmpbase[3]; /* +150 */
182 volatile unsigned long long g2piopbase;
183 volatile unsigned long pciccfg; /* +170 */
184 volatile unsigned long pcicstatus;
185 volatile unsigned long pcicmask;
186 volatile unsigned long unused5;
187 volatile unsigned long long p2gmgbase[3]; /* +180 */
188 volatile unsigned long long p2giogbase;
189 volatile unsigned long g2pcfgadrs; /* +1a0 */
190 volatile unsigned long g2pcfgdata;
191 volatile unsigned long unused6[8];
192 volatile unsigned long g2pintack;
193 volatile unsigned long g2pspc;
194 volatile unsigned long unused7[12]; /* +1d0 */
195 volatile unsigned long long pdmca; /* +200 */
196 volatile unsigned long long pdmga;
197 volatile unsigned long long pdmpa;
198 volatile unsigned long long pdmctr;
199 volatile unsigned long long pdmcfg; /* +220 */
200 volatile unsigned long long pdmsts;
201};
202
203struct tx4938_aclc_reg {
204 volatile unsigned long acctlen;
205 volatile unsigned long acctldis;
206 volatile unsigned long acregacc;
207 volatile unsigned long unused0;
208 volatile unsigned long acintsts;
209 volatile unsigned long acintmsts;
210 volatile unsigned long acinten;
211 volatile unsigned long acintdis;
212 volatile unsigned long acsemaph;
213 volatile unsigned long unused1[7];
214 volatile unsigned long acgpidat;
215 volatile unsigned long acgpodat;
216 volatile unsigned long acslten;
217 volatile unsigned long acsltdis;
218 volatile unsigned long acfifosts;
219 volatile unsigned long unused2[11];
220 volatile unsigned long acdmasts;
221 volatile unsigned long acdmasel;
222 volatile unsigned long unused3[6];
223 volatile unsigned long acaudodat;
224 volatile unsigned long acsurrdat;
225 volatile unsigned long accentdat;
226 volatile unsigned long aclfedat;
227 volatile unsigned long acaudiat;
228 volatile unsigned long unused4;
229 volatile unsigned long acmodoat;
230 volatile unsigned long acmodidat;
231 volatile unsigned long unused5[15];
232 volatile unsigned long acrevid;
233};
234
235
236struct tx4938_tmr_reg {
237 volatile unsigned long tcr;
238 volatile unsigned long tisr;
239 volatile unsigned long cpra;
240 volatile unsigned long cprb;
241 volatile unsigned long itmr;
242 volatile unsigned long unused0[3];
243 volatile unsigned long ccdr;
244 volatile unsigned long unused1[3];
245 volatile unsigned long pgmr;
246 volatile unsigned long unused2[3];
247 volatile unsigned long wtmr;
248 volatile unsigned long unused3[43];
249 volatile unsigned long trr;
250};
251
252struct tx4938_sio_reg {
253 volatile unsigned long lcr;
254 volatile unsigned long dicr;
255 volatile unsigned long disr;
256 volatile unsigned long cisr;
257 volatile unsigned long fcr;
258 volatile unsigned long flcr;
259 volatile unsigned long bgr;
260 volatile unsigned long tfifo;
261 volatile unsigned long rfifo;
262};
263
264struct tx4938_pio_reg {
265 volatile unsigned long dout;
266 volatile unsigned long din;
267 volatile unsigned long dir;
268 volatile unsigned long od;
269 volatile unsigned long flag[2];
270 volatile unsigned long pol;
271 volatile unsigned long intc;
272 volatile unsigned long maskcpu;
273 volatile unsigned long maskext;
274};
275struct tx4938_irc_reg {
276 volatile unsigned long cer;
277 volatile unsigned long cr[2];
278 volatile unsigned long unused0;
279 volatile unsigned long ilr[8];
280 volatile unsigned long unused1[4];
281 volatile unsigned long imr;
282 volatile unsigned long unused2[7];
283 volatile unsigned long scr;
284 volatile unsigned long unused3[7];
285 volatile unsigned long ssr;
286 volatile unsigned long unused4[7];
287 volatile unsigned long csr;
288};
289
290struct tx4938_ndfmc_reg {
291 endian_def_l2(unused0, dtr);
292 endian_def_l2(unused1, mcr);
293 endian_def_l2(unused2, sr);
294 endian_def_l2(unused3, isr);
295 endian_def_l2(unused4, imr);
296 endian_def_l2(unused5, spr);
297 endian_def_l2(unused6, rstr);
298};
299
300struct tx4938_spi_reg {
301 volatile unsigned long mcr;
302 volatile unsigned long cr0;
303 volatile unsigned long cr1;
304 volatile unsigned long fs;
305 volatile unsigned long unused1;
306 volatile unsigned long sr;
307 volatile unsigned long dr;
308 volatile unsigned long unused2;
309};
310
311struct tx4938_sramc_reg {
312 volatile unsigned long long cr;
313};
314
315struct tx4938_ccfg_reg {
316 volatile unsigned long long ccfg;
317 volatile unsigned long long crir;
318 volatile unsigned long long pcfg;
319 volatile unsigned long long tear;
320 volatile unsigned long long clkctr;
321 volatile unsigned long long unused0;
322 volatile unsigned long long garbc;
323 volatile unsigned long long unused1;
324 volatile unsigned long long unused2;
325 volatile unsigned long long ramp;
326 volatile unsigned long long unused3;
327 volatile unsigned long long jmpadr;
328};
329
330#undef endian_def_l2
331#undef endian_def_s2
332#undef endian_def_sb2
333#undef endian_def_b2s
334#undef endian_def_b4
335
336#endif /* __ASSEMBLY__ */
337
338/*
339 * NDFMC
340 */
341
342/* NDFMCR : NDFMC Mode Control */
343#define TX4938_NDFMCR_WE 0x80
344#define TX4938_NDFMCR_ECC_ALL 0x60
345#define TX4938_NDFMCR_ECC_RESET 0x60
346#define TX4938_NDFMCR_ECC_READ 0x40
347#define TX4938_NDFMCR_ECC_ON 0x20
348#define TX4938_NDFMCR_ECC_OFF 0x00
349#define TX4938_NDFMCR_CE 0x10
350#define TX4938_NDFMCR_BSPRT 0x04
351#define TX4938_NDFMCR_ALE 0x02
352#define TX4938_NDFMCR_CLE 0x01
353
354/* NDFMCR : NDFMC Status */
355#define TX4938_NDFSR_BUSY 0x80
356
357/* NDFMCR : NDFMC Reset */
358#define TX4938_NDFRSTR_RST 0x01
359
360/*
361 * IRC
362 */
363
364#define TX4938_IR_ECCERR 0
365#define TX4938_IR_WTOERR 1
366#define TX4938_NUM_IR_INT 6
367#define TX4938_IR_INT(n) (2 + (n))
368#define TX4938_NUM_IR_SIO 2
369#define TX4938_IR_SIO(n) (8 + (n))
370#define TX4938_NUM_IR_DMA 4
371#define TX4938_IR_DMA(ch,n) ((ch ? 27 : 10) + (n)) /* 10-13,27-30 */
372#define TX4938_IR_PIO 14
373#define TX4938_IR_PDMAC 15
374#define TX4938_IR_PCIC 16
375#define TX4938_NUM_IR_TMR 3
376#define TX4938_IR_TMR(n) (17 + (n))
377#define TX4938_IR_NDFMC 21
378#define TX4938_IR_PCIERR 22
379#define TX4938_IR_PCIPME 23
380#define TX4938_IR_ACLC 24
381#define TX4938_IR_ACLCPME 25
382#define TX4938_IR_PCIC1 26
383#define TX4938_IR_SPI 31
384#define TX4938_NUM_IR 32
385/* multiplex */
386#define TX4938_IR_ETH0 TX4938_IR_INT(4)
387#define TX4938_IR_ETH1 TX4938_IR_INT(3)
388
389/*
390 * CCFG
391 */
392/* CCFG : Chip Configuration */
393#define TX4938_CCFG_WDRST _CONST64(0x0000020000000000)
394#define TX4938_CCFG_WDREXEN _CONST64(0x0000010000000000)
395#define TX4938_CCFG_BCFG_MASK _CONST64(0x000000ff00000000)
396#define TX4938_CCFG_TINTDIS 0x01000000
397#define TX4938_CCFG_PCI66 0x00800000
398#define TX4938_CCFG_PCIMODE 0x00400000
399#define TX4938_CCFG_PCI1_66 0x00200000
400#define TX4938_CCFG_DIVMODE_MASK 0x001e0000
401#define TX4938_CCFG_DIVMODE_2 (0x4 << 17)
402#define TX4938_CCFG_DIVMODE_2_5 (0xf << 17)
403#define TX4938_CCFG_DIVMODE_3 (0x5 << 17)
404#define TX4938_CCFG_DIVMODE_4 (0x6 << 17)
405#define TX4938_CCFG_DIVMODE_4_5 (0xd << 17)
406#define TX4938_CCFG_DIVMODE_8 (0x0 << 17)
407#define TX4938_CCFG_DIVMODE_10 (0xb << 17)
408#define TX4938_CCFG_DIVMODE_12 (0x1 << 17)
409#define TX4938_CCFG_DIVMODE_16 (0x2 << 17)
410#define TX4938_CCFG_DIVMODE_18 (0x9 << 17)
411#define TX4938_CCFG_BEOW 0x00010000
412#define TX4938_CCFG_WR 0x00008000
413#define TX4938_CCFG_TOE 0x00004000
414#define TX4938_CCFG_PCIXARB 0x00002000
415#define TX4938_CCFG_PCIDIVMODE_MASK 0x00001c00
416#define TX4938_CCFG_PCIDIVMODE_4 (0x1 << 10)
417#define TX4938_CCFG_PCIDIVMODE_4_5 (0x3 << 10)
418#define TX4938_CCFG_PCIDIVMODE_5 (0x5 << 10)
419#define TX4938_CCFG_PCIDIVMODE_5_5 (0x7 << 10)
420#define TX4938_CCFG_PCIDIVMODE_8 (0x0 << 10)
421#define TX4938_CCFG_PCIDIVMODE_9 (0x2 << 10)
422#define TX4938_CCFG_PCIDIVMODE_10 (0x4 << 10)
423#define TX4938_CCFG_PCIDIVMODE_11 (0x6 << 10)
424#define TX4938_CCFG_PCI1DMD 0x00000100
425#define TX4938_CCFG_SYSSP_MASK 0x000000c0
426#define TX4938_CCFG_ENDIAN 0x00000004
427#define TX4938_CCFG_HALT 0x00000002
428#define TX4938_CCFG_ACEHOLD 0x00000001
429
430/* PCFG : Pin Configuration */
431#define TX4938_PCFG_ETH0_SEL _CONST64(0x8000000000000000)
432#define TX4938_PCFG_ETH1_SEL _CONST64(0x4000000000000000)
433#define TX4938_PCFG_ATA_SEL _CONST64(0x2000000000000000)
434#define TX4938_PCFG_ISA_SEL _CONST64(0x1000000000000000)
435#define TX4938_PCFG_SPI_SEL _CONST64(0x0800000000000000)
436#define TX4938_PCFG_NDF_SEL _CONST64(0x0400000000000000)
437#define TX4938_PCFG_SDCLKDLY_MASK 0x30000000
438#define TX4938_PCFG_SDCLKDLY(d) ((d)<<28)
439#define TX4938_PCFG_SYSCLKEN 0x08000000
440#define TX4938_PCFG_SDCLKEN_ALL 0x07800000
441#define TX4938_PCFG_SDCLKEN(ch) (0x00800000<<(ch))
442#define TX4938_PCFG_PCICLKEN_ALL 0x003f0000
443#define TX4938_PCFG_PCICLKEN(ch) (0x00010000<<(ch))
444#define TX4938_PCFG_SEL2 0x00000200
445#define TX4938_PCFG_SEL1 0x00000100
446#define TX4938_PCFG_DMASEL_ALL 0x0000000f
447#define TX4938_PCFG_DMASEL0_DRQ0 0x00000000
448#define TX4938_PCFG_DMASEL0_SIO1 0x00000001
449#define TX4938_PCFG_DMASEL1_DRQ1 0x00000000
450#define TX4938_PCFG_DMASEL1_SIO1 0x00000002
451#define TX4938_PCFG_DMASEL2_DRQ2 0x00000000
452#define TX4938_PCFG_DMASEL2_SIO0 0x00000004
453#define TX4938_PCFG_DMASEL3_DRQ3 0x00000000
454#define TX4938_PCFG_DMASEL3_SIO0 0x00000008
455
456/* CLKCTR : Clock Control */
457#define TX4938_CLKCTR_NDFCKD _CONST64(0x0001000000000000)
458#define TX4938_CLKCTR_NDFRST _CONST64(0x0000000100000000)
459#define TX4938_CLKCTR_ETH1CKD 0x80000000
460#define TX4938_CLKCTR_ETH0CKD 0x40000000
461#define TX4938_CLKCTR_SPICKD 0x20000000
462#define TX4938_CLKCTR_SRAMCKD 0x10000000
463#define TX4938_CLKCTR_PCIC1CKD 0x08000000
464#define TX4938_CLKCTR_DMA1CKD 0x04000000
465#define TX4938_CLKCTR_ACLCKD 0x02000000
466#define TX4938_CLKCTR_PIOCKD 0x01000000
467#define TX4938_CLKCTR_DMACKD 0x00800000
468#define TX4938_CLKCTR_PCICKD 0x00400000
469#define TX4938_CLKCTR_TM0CKD 0x00100000
470#define TX4938_CLKCTR_TM1CKD 0x00080000
471#define TX4938_CLKCTR_TM2CKD 0x00040000
472#define TX4938_CLKCTR_SIO0CKD 0x00020000
473#define TX4938_CLKCTR_SIO1CKD 0x00010000
474#define TX4938_CLKCTR_ETH1RST 0x00008000
475#define TX4938_CLKCTR_ETH0RST 0x00004000
476#define TX4938_CLKCTR_SPIRST 0x00002000
477#define TX4938_CLKCTR_SRAMRST 0x00001000
478#define TX4938_CLKCTR_PCIC1RST 0x00000800
479#define TX4938_CLKCTR_DMA1RST 0x00000400
480#define TX4938_CLKCTR_ACLRST 0x00000200
481#define TX4938_CLKCTR_PIORST 0x00000100
482#define TX4938_CLKCTR_DMARST 0x00000080
483#define TX4938_CLKCTR_PCIRST 0x00000040
484#define TX4938_CLKCTR_TM0RST 0x00000010
485#define TX4938_CLKCTR_TM1RST 0x00000008
486#define TX4938_CLKCTR_TM2RST 0x00000004
487#define TX4938_CLKCTR_SIO0RST 0x00000002
488#define TX4938_CLKCTR_SIO1RST 0x00000001
489
490/* bits for G2PSTATUS/G2PMASK */
491#define TX4938_PCIC_G2PSTATUS_ALL 0x00000003
492#define TX4938_PCIC_G2PSTATUS_TTOE 0x00000002
493#define TX4938_PCIC_G2PSTATUS_RTOE 0x00000001
494
495/* bits for PCIMASK (see also PCI_STATUS_XXX in linux/pci.h */
496#define TX4938_PCIC_PCISTATUS_ALL 0x0000f900
497
498/* bits for PBACFG */
499#define TX4938_PCIC_PBACFG_FIXPA 0x00000008
500#define TX4938_PCIC_PBACFG_RPBA 0x00000004
501#define TX4938_PCIC_PBACFG_PBAEN 0x00000002
502#define TX4938_PCIC_PBACFG_BMCEN 0x00000001
503
504/* bits for G2PMnGBASE */
505#define TX4938_PCIC_G2PMnGBASE_BSDIS _CONST64(0x0000002000000000)
506#define TX4938_PCIC_G2PMnGBASE_ECHG _CONST64(0x0000001000000000)
507
508/* bits for G2PIOGBASE */
509#define TX4938_PCIC_G2PIOGBASE_BSDIS _CONST64(0x0000002000000000)
510#define TX4938_PCIC_G2PIOGBASE_ECHG _CONST64(0x0000001000000000)
511
512/* bits for PCICSTATUS/PCICMASK */
513#define TX4938_PCIC_PCICSTATUS_ALL 0x000007b8
514#define TX4938_PCIC_PCICSTATUS_PME 0x00000400
515#define TX4938_PCIC_PCICSTATUS_TLB 0x00000200
516#define TX4938_PCIC_PCICSTATUS_NIB 0x00000100
517#define TX4938_PCIC_PCICSTATUS_ZIB 0x00000080
518#define TX4938_PCIC_PCICSTATUS_PERR 0x00000020
519#define TX4938_PCIC_PCICSTATUS_SERR 0x00000010
520#define TX4938_PCIC_PCICSTATUS_GBE 0x00000008
521#define TX4938_PCIC_PCICSTATUS_IWB 0x00000002
522#define TX4938_PCIC_PCICSTATUS_E2PDONE 0x00000001
523
524/* bits for PCICCFG */
525#define TX4938_PCIC_PCICCFG_GBWC_MASK 0x0fff0000
526#define TX4938_PCIC_PCICCFG_HRST 0x00000800
527#define TX4938_PCIC_PCICCFG_SRST 0x00000400
528#define TX4938_PCIC_PCICCFG_IRBER 0x00000200
529#define TX4938_PCIC_PCICCFG_G2PMEN(ch) (0x00000100>>(ch))
530#define TX4938_PCIC_PCICCFG_G2PM0EN 0x00000100
531#define TX4938_PCIC_PCICCFG_G2PM1EN 0x00000080
532#define TX4938_PCIC_PCICCFG_G2PM2EN 0x00000040
533#define TX4938_PCIC_PCICCFG_G2PIOEN 0x00000020
534#define TX4938_PCIC_PCICCFG_TCAR 0x00000010
535#define TX4938_PCIC_PCICCFG_ICAEN 0x00000008
536
537/* bits for P2GMnGBASE */
538#define TX4938_PCIC_P2GMnGBASE_TMEMEN _CONST64(0x0000004000000000)
539#define TX4938_PCIC_P2GMnGBASE_TBSDIS _CONST64(0x0000002000000000)
540#define TX4938_PCIC_P2GMnGBASE_TECHG _CONST64(0x0000001000000000)
541
542/* bits for P2GIOGBASE */
543#define TX4938_PCIC_P2GIOGBASE_TIOEN _CONST64(0x0000004000000000)
544#define TX4938_PCIC_P2GIOGBASE_TBSDIS _CONST64(0x0000002000000000)
545#define TX4938_PCIC_P2GIOGBASE_TECHG _CONST64(0x0000001000000000)
546
547#define TX4938_PCIC_IDSEL_AD_TO_SLOT(ad) ((ad) - 11)
548#define TX4938_PCIC_MAX_DEVNU TX4938_PCIC_IDSEL_AD_TO_SLOT(32)
549
550/* bits for PDMCFG */
551#define TX4938_PCIC_PDMCFG_RSTFIFO 0x00200000
552#define TX4938_PCIC_PDMCFG_EXFER 0x00100000
553#define TX4938_PCIC_PDMCFG_REQDLY_MASK 0x00003800
554#define TX4938_PCIC_PDMCFG_REQDLY_NONE (0 << 11)
555#define TX4938_PCIC_PDMCFG_REQDLY_16 (1 << 11)
556#define TX4938_PCIC_PDMCFG_REQDLY_32 (2 << 11)
557#define TX4938_PCIC_PDMCFG_REQDLY_64 (3 << 11)
558#define TX4938_PCIC_PDMCFG_REQDLY_128 (4 << 11)
559#define TX4938_PCIC_PDMCFG_REQDLY_256 (5 << 11)
560#define TX4938_PCIC_PDMCFG_REQDLY_512 (6 << 11)
561#define TX4938_PCIC_PDMCFG_REQDLY_1024 (7 << 11)
562#define TX4938_PCIC_PDMCFG_ERRIE 0x00000400
563#define TX4938_PCIC_PDMCFG_NCCMPIE 0x00000200
564#define TX4938_PCIC_PDMCFG_NTCMPIE 0x00000100
565#define TX4938_PCIC_PDMCFG_CHNEN 0x00000080
566#define TX4938_PCIC_PDMCFG_XFRACT 0x00000040
567#define TX4938_PCIC_PDMCFG_BSWAP 0x00000020
568#define TX4938_PCIC_PDMCFG_XFRSIZE_MASK 0x0000000c
569#define TX4938_PCIC_PDMCFG_XFRSIZE_1DW 0x00000000
570#define TX4938_PCIC_PDMCFG_XFRSIZE_1QW 0x00000004
571#define TX4938_PCIC_PDMCFG_XFRSIZE_4QW 0x00000008
572#define TX4938_PCIC_PDMCFG_XFRDIRC 0x00000002
573#define TX4938_PCIC_PDMCFG_CHRST 0x00000001
574
575/* bits for PDMSTS */
576#define TX4938_PCIC_PDMSTS_REQCNT_MASK 0x3f000000
577#define TX4938_PCIC_PDMSTS_FIFOCNT_MASK 0x00f00000
578#define TX4938_PCIC_PDMSTS_FIFOWP_MASK 0x000c0000
579#define TX4938_PCIC_PDMSTS_FIFORP_MASK 0x00030000
580#define TX4938_PCIC_PDMSTS_ERRINT 0x00000800
581#define TX4938_PCIC_PDMSTS_DONEINT 0x00000400
582#define TX4938_PCIC_PDMSTS_CHNEN 0x00000200
583#define TX4938_PCIC_PDMSTS_XFRACT 0x00000100
584#define TX4938_PCIC_PDMSTS_ACCMP 0x00000080
585#define TX4938_PCIC_PDMSTS_NCCMP 0x00000040
586#define TX4938_PCIC_PDMSTS_NTCMP 0x00000020
587#define TX4938_PCIC_PDMSTS_CFGERR 0x00000008
588#define TX4938_PCIC_PDMSTS_PCIERR 0x00000004
589#define TX4938_PCIC_PDMSTS_CHNERR 0x00000002
590#define TX4938_PCIC_PDMSTS_DATAERR 0x00000001
591#define TX4938_PCIC_PDMSTS_ALL_CMP 0x000000e0
592#define TX4938_PCIC_PDMSTS_ALL_ERR 0x0000000f
593
594/*
595 * DMA
596 */
597/* bits for MCR */
598#define TX4938_DMA_MCR_EIS(ch) (0x10000000<<(ch))
599#define TX4938_DMA_MCR_DIS(ch) (0x01000000<<(ch))
600#define TX4938_DMA_MCR_RSFIF 0x00000080
601#define TX4938_DMA_MCR_FIFUM(ch) (0x00000008<<(ch))
602#define TX4938_DMA_MCR_RPRT 0x00000002
603#define TX4938_DMA_MCR_MSTEN 0x00000001
604
605/* bits for CCRn */
606#define TX4938_DMA_CCR_IMMCHN 0x20000000
607#define TX4938_DMA_CCR_USEXFSZ 0x10000000
608#define TX4938_DMA_CCR_LE 0x08000000
609#define TX4938_DMA_CCR_DBINH 0x04000000
610#define TX4938_DMA_CCR_SBINH 0x02000000
611#define TX4938_DMA_CCR_CHRST 0x01000000
612#define TX4938_DMA_CCR_RVBYTE 0x00800000
613#define TX4938_DMA_CCR_ACKPOL 0x00400000
614#define TX4938_DMA_CCR_REQPL 0x00200000
615#define TX4938_DMA_CCR_EGREQ 0x00100000
616#define TX4938_DMA_CCR_CHDN 0x00080000
617#define TX4938_DMA_CCR_DNCTL 0x00060000
618#define TX4938_DMA_CCR_EXTRQ 0x00010000
619#define TX4938_DMA_CCR_INTRQD 0x0000e000
620#define TX4938_DMA_CCR_INTENE 0x00001000
621#define TX4938_DMA_CCR_INTENC 0x00000800
622#define TX4938_DMA_CCR_INTENT 0x00000400
623#define TX4938_DMA_CCR_CHNEN 0x00000200
624#define TX4938_DMA_CCR_XFACT 0x00000100
625#define TX4938_DMA_CCR_SMPCHN 0x00000020
626#define TX4938_DMA_CCR_XFSZ(order) (((order) << 2) & 0x0000001c)
627#define TX4938_DMA_CCR_XFSZ_1W TX4938_DMA_CCR_XFSZ(2)
628#define TX4938_DMA_CCR_XFSZ_2W TX4938_DMA_CCR_XFSZ(3)
629#define TX4938_DMA_CCR_XFSZ_4W TX4938_DMA_CCR_XFSZ(4)
630#define TX4938_DMA_CCR_XFSZ_8W TX4938_DMA_CCR_XFSZ(5)
631#define TX4938_DMA_CCR_XFSZ_16W TX4938_DMA_CCR_XFSZ(6)
632#define TX4938_DMA_CCR_XFSZ_32W TX4938_DMA_CCR_XFSZ(7)
633#define TX4938_DMA_CCR_MEMIO 0x00000002
634#define TX4938_DMA_CCR_SNGAD 0x00000001
635
636/* bits for CSRn */
637#define TX4938_DMA_CSR_CHNEN 0x00000400
638#define TX4938_DMA_CSR_STLXFER 0x00000200
639#define TX4938_DMA_CSR_CHNACT 0x00000100
640#define TX4938_DMA_CSR_ABCHC 0x00000080
641#define TX4938_DMA_CSR_NCHNC 0x00000040
642#define TX4938_DMA_CSR_NTRNFC 0x00000020
643#define TX4938_DMA_CSR_EXTDN 0x00000010
644#define TX4938_DMA_CSR_CFERR 0x00000008
645#define TX4938_DMA_CSR_CHERR 0x00000004
646#define TX4938_DMA_CSR_DESERR 0x00000002
647#define TX4938_DMA_CSR_SORERR 0x00000001
648
649/* TX4938 Interrupt Controller (32-bit registers) */
650#define TX4938_IRC_BASE 0xf510
651#define TX4938_IRC_IRFLAG0 0xf510
652#define TX4938_IRC_IRFLAG1 0xf514
653#define TX4938_IRC_IRPOL 0xf518
654#define TX4938_IRC_IRRCNT 0xf51c
655#define TX4938_IRC_IRMASKINT 0xf520
656#define TX4938_IRC_IRMASKEXT 0xf524
657#define TX4938_IRC_IRDEN 0xf600
658#define TX4938_IRC_IRDM0 0xf604
659#define TX4938_IRC_IRDM1 0xf608
660#define TX4938_IRC_IRLVL0 0xf610
661#define TX4938_IRC_IRLVL1 0xf614
662#define TX4938_IRC_IRLVL2 0xf618
663#define TX4938_IRC_IRLVL3 0xf61c
664#define TX4938_IRC_IRLVL4 0xf620
665#define TX4938_IRC_IRLVL5 0xf624
666#define TX4938_IRC_IRLVL6 0xf628
667#define TX4938_IRC_IRLVL7 0xf62c
668#define TX4938_IRC_IRMSK 0xf640
669#define TX4938_IRC_IREDC 0xf660
670#define TX4938_IRC_IRPND 0xf680
671#define TX4938_IRC_IRCS 0xf6a0
672#define TX4938_IRC_LIMIT 0xf6ff
673
674
675#ifndef __ASSEMBLY__
676
677#define tx4938_sdramcptr ((struct tx4938_sdramc_reg *)TX4938_SDRAMC_REG)
678#define tx4938_ebuscptr ((struct tx4938_ebusc_reg *)TX4938_EBUSC_REG)
679#define tx4938_dmaptr(ch) ((struct tx4938_dma_reg *)TX4938_DMA_REG(ch))
680#define tx4938_ndfmcptr ((struct tx4938_ndfmc_reg *)TX4938_NDFMC_REG)
681#define tx4938_ircptr ((struct tx4938_irc_reg *)TX4938_IRC_REG)
682#define tx4938_pcicptr ((struct tx4938_pcic_reg *)TX4938_PCIC_REG)
683#define tx4938_pcic1ptr ((struct tx4938_pcic_reg *)TX4938_PCIC1_REG)
684#define tx4938_ccfgptr ((struct tx4938_ccfg_reg *)TX4938_CCFG_REG)
685#define tx4938_tmrptr(ch) ((struct tx4938_tmr_reg *)TX4938_TMR_REG(ch))
686#define tx4938_sioptr(ch) ((struct tx4938_sio_reg *)TX4938_SIO_REG(ch))
687#define tx4938_pioptr ((struct tx4938_pio_reg *)TX4938_PIO_REG)
688#define tx4938_aclcptr ((struct tx4938_aclc_reg *)TX4938_ACLC_REG)
689#define tx4938_spiptr ((struct tx4938_spi_reg *)TX4938_SPI_REG)
690#define tx4938_sramcptr ((struct tx4938_sramc_reg *)TX4938_SRAMC_REG)
691
692
693#define TX4938_REV_MAJ_MIN() ((unsigned long)tx4938_ccfgptr->crir & 0x00ff)
694#define TX4938_REV_PCODE() ((unsigned long)tx4938_ccfgptr->crir >> 16)
695
696#define TX4938_SDRAMC_BA(ch) ((tx4938_sdramcptr->cr[ch] >> 49) << 21)
697#define TX4938_SDRAMC_SIZE(ch) (((tx4938_sdramcptr->cr[ch] >> 33) + 1) << 21)
698
699#define TX4938_EBUSC_BA(ch) ((tx4938_ebuscptr->cr[ch] >> 48) << 20)
700#define TX4938_EBUSC_SIZE(ch) \
701 (0x00100000 << ((unsigned long)(tx4938_ebuscptr->cr[ch] >> 8) & 0xf))
702
703
704#endif /* !__ASSEMBLY__ */
705
706#endif
diff --git a/include/asm-mips/tx4938/tx4938_mips.h b/include/asm-mips/tx4938/tx4938_mips.h
new file mode 100644
index 000000000000..cf89b205f103
--- /dev/null
+++ b/include/asm-mips/tx4938/tx4938_mips.h
@@ -0,0 +1,54 @@
1/*
2 * linux/include/asm-mips/tx4938/tx4938_bitmask.h
3 * Generic bitmask definitions
4 *
5 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
6 * terms of the GNU General Public License version 2. This program is
7 * licensed "as is" without any warranty of any kind, whether express
8 * or implied.
9 *
10 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
11 */
12
13#ifndef TX4938_TX4938_MIPS_H
14#define TX4938_TX4938_MIPS_H
15#ifndef __ASSEMBLY__
16
17#define reg_rd08(r) ((u8 )(*((vu8 *)(r))))
18#define reg_rd16(r) ((u16)(*((vu16*)(r))))
19#define reg_rd32(r) ((u32)(*((vu32*)(r))))
20#define reg_rd64(r) ((u64)(*((vu64*)(r))))
21
22#define reg_wr08(r,v) ((*((vu8 *)(r)))=((u8 )(v)))
23#define reg_wr16(r,v) ((*((vu16*)(r)))=((u16)(v)))
24#define reg_wr32(r,v) ((*((vu32*)(r)))=((u32)(v)))
25#define reg_wr64(r,v) ((*((vu64*)(r)))=((u64)(v)))
26
27typedef volatile __signed char vs8;
28typedef volatile unsigned char vu8;
29
30typedef volatile __signed short vs16;
31typedef volatile unsigned short vu16;
32
33typedef volatile __signed int vs32;
34typedef volatile unsigned int vu32;
35
36typedef s8 s08;
37typedef vs8 vs08;
38
39typedef u8 u08;
40typedef vu8 vu08;
41
42#if (_MIPS_SZLONG == 64)
43
44typedef volatile __signed__ long vs64;
45typedef volatile unsigned long vu64;
46
47#else
48
49typedef volatile __signed__ long long vs64;
50typedef volatile unsigned long long vu64;
51
52#endif
53#endif
54#endif
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h
index 5c2c98329012..41bb96bb2120 100644
--- a/include/asm-mips/uaccess.h
+++ b/include/asm-mips/uaccess.h
@@ -196,63 +196,55 @@
196 __get_user_nocheck((x),(ptr),sizeof(*(ptr))) 196 __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
197 197
198struct __large_struct { unsigned long buf[100]; }; 198struct __large_struct { unsigned long buf[100]; };
199#define __m(x) (*(struct __large_struct *)(x)) 199#define __m(x) (*(struct __large_struct __user *)(x))
200 200
201/* 201/*
202 * Yuck. We need two variants, one for 64bit operation and one 202 * Yuck. We need two variants, one for 64bit operation and one
203 * for 32 bit mode and old iron. 203 * for 32 bit mode and old iron.
204 */ 204 */
205#ifdef __mips64 205#ifdef __mips64
206#define __GET_USER_DW(__gu_err) __get_user_asm("ld", __gu_err) 206#define __GET_USER_DW(ptr) __get_user_asm("ld", ptr)
207#else 207#else
208#define __GET_USER_DW(__gu_err) __get_user_asm_ll32(__gu_err) 208#define __GET_USER_DW(ptr) __get_user_asm_ll32(ptr)
209#endif 209#endif
210 210
211#define __get_user_nocheck(x,ptr,size) \ 211#define __get_user_nocheck(x,ptr,size) \
212({ \ 212({ \
213 __typeof(*(ptr)) __gu_val = 0; \ 213 __typeof(*(ptr)) __gu_val = (__typeof(*(ptr))) 0; \
214 long __gu_addr; \
215 long __gu_err = 0; \ 214 long __gu_err = 0; \
216 \ 215 \
217 might_sleep(); \
218 __gu_addr = (long) (ptr); \
219 switch (size) { \ 216 switch (size) { \
220 case 1: __get_user_asm("lb", __gu_err); break; \ 217 case 1: __get_user_asm("lb", ptr); break; \
221 case 2: __get_user_asm("lh", __gu_err); break; \ 218 case 2: __get_user_asm("lh", ptr); break; \
222 case 4: __get_user_asm("lw", __gu_err); break; \ 219 case 4: __get_user_asm("lw", ptr); break; \
223 case 8: __GET_USER_DW(__gu_err); break; \ 220 case 8: __GET_USER_DW(ptr); break; \
224 default: __get_user_unknown(); break; \ 221 default: __get_user_unknown(); break; \
225 } \ 222 } \
226 x = (__typeof__(*(ptr))) __gu_val; \ 223 (x) = (__typeof__(*(ptr))) __gu_val; \
227 __gu_err; \ 224 __gu_err; \
228}) 225})
229 226
230#define __get_user_check(x,ptr,size) \ 227#define __get_user_check(x,ptr,size) \
231({ \ 228({ \
229 const __typeof__(*(ptr)) __user * __gu_addr = (ptr); \
232 __typeof__(*(ptr)) __gu_val = 0; \ 230 __typeof__(*(ptr)) __gu_val = 0; \
233 long __gu_addr; \ 231 long __gu_err = -EFAULT; \
234 long __gu_err; \
235 \
236 might_sleep(); \
237 __gu_addr = (long) (ptr); \
238 __gu_err = access_ok(VERIFY_READ, (void *) __gu_addr, size) \
239 ? 0 : -EFAULT; \
240 \ 232 \
241 if (likely(!__gu_err)) { \ 233 if (likely(access_ok(VERIFY_READ, __gu_addr, size))) { \
242 switch (size) { \ 234 switch (size) { \
243 case 1: __get_user_asm("lb", __gu_err); break; \ 235 case 1: __get_user_asm("lb", __gu_addr); break; \
244 case 2: __get_user_asm("lh", __gu_err); break; \ 236 case 2: __get_user_asm("lh", __gu_addr); break; \
245 case 4: __get_user_asm("lw", __gu_err); break; \ 237 case 4: __get_user_asm("lw", __gu_addr); break; \
246 case 8: __GET_USER_DW(__gu_err); break; \ 238 case 8: __GET_USER_DW(__gu_addr); break; \
247 default: __get_user_unknown(); break; \ 239 default: __get_user_unknown(); break; \
248 } \ 240 } \
249 } \ 241 } \
250 x = (__typeof__(*(ptr))) __gu_val; \ 242 (x) = (__typeof__(*(ptr))) __gu_val; \
251 __gu_err; \ 243 __gu_err; \
252}) 244})
253 245
254#define __get_user_asm(insn,__gu_err) \ 246#define __get_user_asm(insn, addr) \
255({ \ 247{ \
256 __asm__ __volatile__( \ 248 __asm__ __volatile__( \
257 "1: " insn " %1, %3 \n" \ 249 "1: " insn " %1, %3 \n" \
258 "2: \n" \ 250 "2: \n" \
@@ -264,20 +256,20 @@ struct __large_struct { unsigned long buf[100]; };
264 " "__UA_ADDR "\t1b, 3b \n" \ 256 " "__UA_ADDR "\t1b, 3b \n" \
265 " .previous \n" \ 257 " .previous \n" \
266 : "=r" (__gu_err), "=r" (__gu_val) \ 258 : "=r" (__gu_err), "=r" (__gu_val) \
267 : "0" (__gu_err), "o" (__m(__gu_addr)), "i" (-EFAULT)); \ 259 : "0" (0), "o" (__m(addr)), "i" (-EFAULT)); \
268}) 260}
269 261
270/* 262/*
271 * Get a long long 64 using 32 bit registers. 263 * Get a long long 64 using 32 bit registers.
272 */ 264 */
273#define __get_user_asm_ll32(__gu_err) \ 265#define __get_user_asm_ll32(addr) \
274({ \ 266{ \
275 __asm__ __volatile__( \ 267 __asm__ __volatile__( \
276 "1: lw %1, %3 \n" \ 268 "1: lw %1, (%3) \n" \
277 "2: lw %D1, %4 \n" \ 269 "2: lw %D1, 4(%3) \n" \
278 " move %0, $0 \n" \ 270 " move %0, $0 \n" \
279 "3: .section .fixup,\"ax\" \n" \ 271 "3: .section .fixup,\"ax\" \n" \
280 "4: li %0, %5 \n" \ 272 "4: li %0, %4 \n" \
281 " move %1, $0 \n" \ 273 " move %1, $0 \n" \
282 " move %D1, $0 \n" \ 274 " move %D1, $0 \n" \
283 " j 3b \n" \ 275 " j 3b \n" \
@@ -287,9 +279,8 @@ struct __large_struct { unsigned long buf[100]; };
287 " " __UA_ADDR " 2b, 4b \n" \ 279 " " __UA_ADDR " 2b, 4b \n" \
288 " .previous \n" \ 280 " .previous \n" \
289 : "=r" (__gu_err), "=&r" (__gu_val) \ 281 : "=r" (__gu_err), "=&r" (__gu_val) \
290 : "0" (__gu_err), "o" (__m(__gu_addr)), \ 282 : "0" (0), "r" (addr), "i" (-EFAULT)); \
291 "o" (__m(__gu_addr + 4)), "i" (-EFAULT)); \ 283}
292})
293 284
294extern void __get_user_unknown(void); 285extern void __get_user_unknown(void);
295 286
@@ -298,25 +289,22 @@ extern void __get_user_unknown(void);
298 * for 32 bit mode and old iron. 289 * for 32 bit mode and old iron.
299 */ 290 */
300#ifdef __mips64 291#ifdef __mips64
301#define __PUT_USER_DW(__pu_val) __put_user_asm("sd", __pu_val) 292#define __PUT_USER_DW(ptr) __put_user_asm("sd", ptr)
302#else 293#else
303#define __PUT_USER_DW(__pu_val) __put_user_asm_ll32(__pu_val) 294#define __PUT_USER_DW(ptr) __put_user_asm_ll32(ptr)
304#endif 295#endif
305 296
306#define __put_user_nocheck(x,ptr,size) \ 297#define __put_user_nocheck(x,ptr,size) \
307({ \ 298({ \
308 __typeof__(*(ptr)) __pu_val; \ 299 __typeof__(*(ptr)) __pu_val; \
309 long __pu_addr; \
310 long __pu_err = 0; \ 300 long __pu_err = 0; \
311 \ 301 \
312 might_sleep(); \
313 __pu_val = (x); \ 302 __pu_val = (x); \
314 __pu_addr = (long) (ptr); \
315 switch (size) { \ 303 switch (size) { \
316 case 1: __put_user_asm("sb", __pu_val); break; \ 304 case 1: __put_user_asm("sb", ptr); break; \
317 case 2: __put_user_asm("sh", __pu_val); break; \ 305 case 2: __put_user_asm("sh", ptr); break; \
318 case 4: __put_user_asm("sw", __pu_val); break; \ 306 case 4: __put_user_asm("sw", ptr); break; \
319 case 8: __PUT_USER_DW(__pu_val); break; \ 307 case 8: __PUT_USER_DW(ptr); break; \
320 default: __put_user_unknown(); break; \ 308 default: __put_user_unknown(); break; \
321 } \ 309 } \
322 __pu_err; \ 310 __pu_err; \
@@ -324,30 +312,24 @@ extern void __get_user_unknown(void);
324 312
325#define __put_user_check(x,ptr,size) \ 313#define __put_user_check(x,ptr,size) \
326({ \ 314({ \
327 __typeof__(*(ptr)) __pu_val; \ 315 __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
328 long __pu_addr; \ 316 __typeof__(*(ptr)) __pu_val = (x); \
329 long __pu_err; \ 317 long __pu_err = -EFAULT; \
330 \ 318 \
331 might_sleep(); \ 319 if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \
332 __pu_val = (x); \
333 __pu_addr = (long) (ptr); \
334 __pu_err = access_ok(VERIFY_WRITE, (void *) __pu_addr, size) \
335 ? 0 : -EFAULT; \
336 \
337 if (likely(!__pu_err)) { \
338 switch (size) { \ 320 switch (size) { \
339 case 1: __put_user_asm("sb", __pu_val); break; \ 321 case 1: __put_user_asm("sb", __pu_addr); break; \
340 case 2: __put_user_asm("sh", __pu_val); break; \ 322 case 2: __put_user_asm("sh", __pu_addr); break; \
341 case 4: __put_user_asm("sw", __pu_val); break; \ 323 case 4: __put_user_asm("sw", __pu_addr); break; \
342 case 8: __PUT_USER_DW(__pu_val); break; \ 324 case 8: __PUT_USER_DW(__pu_addr); break; \
343 default: __put_user_unknown(); break; \ 325 default: __put_user_unknown(); break; \
344 } \ 326 } \
345 } \ 327 } \
346 __pu_err; \ 328 __pu_err; \
347}) 329})
348 330
349#define __put_user_asm(insn, __pu_val) \ 331#define __put_user_asm(insn, ptr) \
350({ \ 332{ \
351 __asm__ __volatile__( \ 333 __asm__ __volatile__( \
352 "1: " insn " %z2, %3 # __put_user_asm\n" \ 334 "1: " insn " %z2, %3 # __put_user_asm\n" \
353 "2: \n" \ 335 "2: \n" \
@@ -359,18 +341,18 @@ extern void __get_user_unknown(void);
359 " " __UA_ADDR " 1b, 3b \n" \ 341 " " __UA_ADDR " 1b, 3b \n" \
360 " .previous \n" \ 342 " .previous \n" \
361 : "=r" (__pu_err) \ 343 : "=r" (__pu_err) \
362 : "0" (__pu_err), "Jr" (__pu_val), "o" (__m(__pu_addr)), \ 344 : "0" (0), "Jr" (__pu_val), "o" (__m(ptr)), \
363 "i" (-EFAULT)); \ 345 "i" (-EFAULT)); \
364}) 346}
365 347
366#define __put_user_asm_ll32(__pu_val) \ 348#define __put_user_asm_ll32(ptr) \
367({ \ 349{ \
368 __asm__ __volatile__( \ 350 __asm__ __volatile__( \
369 "1: sw %2, %3 # __put_user_asm_ll32 \n" \ 351 "1: sw %2, (%3) # __put_user_asm_ll32 \n" \
370 "2: sw %D2, %4 \n" \ 352 "2: sw %D2, 4(%3) \n" \
371 "3: \n" \ 353 "3: \n" \
372 " .section .fixup,\"ax\" \n" \ 354 " .section .fixup,\"ax\" \n" \
373 "4: li %0, %5 \n" \ 355 "4: li %0, %4 \n" \
374 " j 3b \n" \ 356 " j 3b \n" \
375 " .previous \n" \ 357 " .previous \n" \
376 " .section __ex_table,\"a\" \n" \ 358 " .section __ex_table,\"a\" \n" \
@@ -378,9 +360,9 @@ extern void __get_user_unknown(void);
378 " " __UA_ADDR " 2b, 4b \n" \ 360 " " __UA_ADDR " 2b, 4b \n" \
379 " .previous" \ 361 " .previous" \
380 : "=r" (__pu_err) \ 362 : "=r" (__pu_err) \
381 : "0" (__pu_err), "r" (__pu_val), "o" (__m(__pu_addr)), \ 363 : "0" (0), "r" (__pu_val), "r" (ptr), \
382 "o" (__m(__pu_addr + 4)), "i" (-EFAULT)); \ 364 "i" (-EFAULT)); \
383}) 365}
384 366
385extern void __put_user_unknown(void); 367extern void __put_user_unknown(void);
386 368
@@ -403,7 +385,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
403 385
404#define __invoke_copy_to_user(to,from,n) \ 386#define __invoke_copy_to_user(to,from,n) \
405({ \ 387({ \
406 register void *__cu_to_r __asm__ ("$4"); \ 388 register void __user *__cu_to_r __asm__ ("$4"); \
407 register const void *__cu_from_r __asm__ ("$5"); \ 389 register const void *__cu_from_r __asm__ ("$5"); \
408 register long __cu_len_r __asm__ ("$6"); \ 390 register long __cu_len_r __asm__ ("$6"); \
409 \ 391 \
@@ -435,7 +417,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
435 */ 417 */
436#define __copy_to_user(to,from,n) \ 418#define __copy_to_user(to,from,n) \
437({ \ 419({ \
438 void *__cu_to; \ 420 void __user *__cu_to; \
439 const void *__cu_from; \ 421 const void *__cu_from; \
440 long __cu_len; \ 422 long __cu_len; \
441 \ 423 \
@@ -465,7 +447,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
465 */ 447 */
466#define copy_to_user(to,from,n) \ 448#define copy_to_user(to,from,n) \
467({ \ 449({ \
468 void *__cu_to; \ 450 void __user *__cu_to; \
469 const void *__cu_from; \ 451 const void *__cu_from; \
470 long __cu_len; \ 452 long __cu_len; \
471 \ 453 \
@@ -482,7 +464,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
482#define __invoke_copy_from_user(to,from,n) \ 464#define __invoke_copy_from_user(to,from,n) \
483({ \ 465({ \
484 register void *__cu_to_r __asm__ ("$4"); \ 466 register void *__cu_to_r __asm__ ("$4"); \
485 register const void *__cu_from_r __asm__ ("$5"); \ 467 register const void __user *__cu_from_r __asm__ ("$5"); \
486 register long __cu_len_r __asm__ ("$6"); \ 468 register long __cu_len_r __asm__ ("$6"); \
487 \ 469 \
488 __cu_to_r = (to); \ 470 __cu_to_r = (to); \
@@ -521,7 +503,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
521#define __copy_from_user(to,from,n) \ 503#define __copy_from_user(to,from,n) \
522({ \ 504({ \
523 void *__cu_to; \ 505 void *__cu_to; \
524 const void *__cu_from; \ 506 const void __user *__cu_from; \
525 long __cu_len; \ 507 long __cu_len; \
526 \ 508 \
527 might_sleep(); \ 509 might_sleep(); \
@@ -552,7 +534,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
552#define copy_from_user(to,from,n) \ 534#define copy_from_user(to,from,n) \
553({ \ 535({ \
554 void *__cu_to; \ 536 void *__cu_to; \
555 const void *__cu_from; \ 537 const void __user *__cu_from; \
556 long __cu_len; \ 538 long __cu_len; \
557 \ 539 \
558 might_sleep(); \ 540 might_sleep(); \
@@ -569,8 +551,8 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
569 551
570#define copy_in_user(to,from,n) \ 552#define copy_in_user(to,from,n) \
571({ \ 553({ \
572 void *__cu_to; \ 554 void __user *__cu_to; \
573 const void *__cu_from; \ 555 const void __user *__cu_from; \
574 long __cu_len; \ 556 long __cu_len; \
575 \ 557 \
576 might_sleep(); \ 558 might_sleep(); \
@@ -596,7 +578,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
596 * On success, this will be zero. 578 * On success, this will be zero.
597 */ 579 */
598static inline __kernel_size_t 580static inline __kernel_size_t
599__clear_user(void *addr, __kernel_size_t size) 581__clear_user(void __user *addr, __kernel_size_t size)
600{ 582{
601 __kernel_size_t res; 583 __kernel_size_t res;
602 584
@@ -616,7 +598,7 @@ __clear_user(void *addr, __kernel_size_t size)
616 598
617#define clear_user(addr,n) \ 599#define clear_user(addr,n) \
618({ \ 600({ \
619 void * __cl_addr = (addr); \ 601 void __user * __cl_addr = (addr); \
620 unsigned long __cl_size = (n); \ 602 unsigned long __cl_size = (n); \
621 if (__cl_size && access_ok(VERIFY_WRITE, \ 603 if (__cl_size && access_ok(VERIFY_WRITE, \
622 ((unsigned long)(__cl_addr)), __cl_size)) \ 604 ((unsigned long)(__cl_addr)), __cl_size)) \
@@ -645,7 +627,7 @@ __clear_user(void *addr, __kernel_size_t size)
645 * and returns @count. 627 * and returns @count.
646 */ 628 */
647static inline long 629static inline long
648__strncpy_from_user(char *__to, const char *__from, long __len) 630__strncpy_from_user(char *__to, const char __user *__from, long __len)
649{ 631{
650 long res; 632 long res;
651 633
@@ -682,7 +664,7 @@ __strncpy_from_user(char *__to, const char *__from, long __len)
682 * and returns @count. 664 * and returns @count.
683 */ 665 */
684static inline long 666static inline long
685strncpy_from_user(char *__to, const char *__from, long __len) 667strncpy_from_user(char *__to, const char __user *__from, long __len)
686{ 668{
687 long res; 669 long res;
688 670
@@ -701,7 +683,7 @@ strncpy_from_user(char *__to, const char *__from, long __len)
701} 683}
702 684
703/* Returns: 0 if bad, string length+1 (memory size) of string if ok */ 685/* Returns: 0 if bad, string length+1 (memory size) of string if ok */
704static inline long __strlen_user(const char *s) 686static inline long __strlen_user(const char __user *s)
705{ 687{
706 long res; 688 long res;
707 689
@@ -731,7 +713,7 @@ static inline long __strlen_user(const char *s)
731 * If there is a limit on the length of a valid string, you may wish to 713 * If there is a limit on the length of a valid string, you may wish to
732 * consider using strnlen_user() instead. 714 * consider using strnlen_user() instead.
733 */ 715 */
734static inline long strlen_user(const char *s) 716static inline long strlen_user(const char __user *s)
735{ 717{
736 long res; 718 long res;
737 719
@@ -748,7 +730,7 @@ static inline long strlen_user(const char *s)
748} 730}
749 731
750/* Returns: 0 if bad, string length+1 (memory size) of string if ok */ 732/* Returns: 0 if bad, string length+1 (memory size) of string if ok */
751static inline long __strnlen_user(const char *s, long n) 733static inline long __strnlen_user(const char __user *s, long n)
752{ 734{
753 long res; 735 long res;
754 736
@@ -779,7 +761,7 @@ static inline long __strnlen_user(const char *s, long n)
779 * If there is a limit on the length of a valid string, you may wish to 761 * If there is a limit on the length of a valid string, you may wish to
780 * consider using strnlen_user() instead. 762 * consider using strnlen_user() instead.
781 */ 763 */
782static inline long strnlen_user(const char *s, long n) 764static inline long strnlen_user(const char __user *s, long n)
783{ 765{
784 long res; 766 long res;
785 767
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index ad4d48056307..c9eaf4c104de 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -303,16 +303,21 @@
303#define __NR_add_key (__NR_Linux + 280) 303#define __NR_add_key (__NR_Linux + 280)
304#define __NR_request_key (__NR_Linux + 281) 304#define __NR_request_key (__NR_Linux + 281)
305#define __NR_keyctl (__NR_Linux + 282) 305#define __NR_keyctl (__NR_Linux + 282)
306#define __NR_set_thread_area (__NR_Linux + 283)
307#define __NR_inotify_init (__NR_Linux + 284)
308#define __NR_inotify_add_watch (__NR_Linux + 285)
309#define __NR_inotify_rm_watch (__NR_Linux + 286)
310
306 311
307/* 312/*
308 * Offset of the last Linux o32 flavoured syscall 313 * Offset of the last Linux o32 flavoured syscall
309 */ 314 */
310#define __NR_Linux_syscalls 282 315#define __NR_Linux_syscalls 286
311 316
312#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 317#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
313 318
314#define __NR_O32_Linux 4000 319#define __NR_O32_Linux 4000
315#define __NR_O32_Linux_syscalls 282 320#define __NR_O32_Linux_syscalls 283
316 321
317#if _MIPS_SIM == _MIPS_SIM_ABI64 322#if _MIPS_SIM == _MIPS_SIM_ABI64
318 323
@@ -562,16 +567,20 @@
562#define __NR_add_key (__NR_Linux + 239) 567#define __NR_add_key (__NR_Linux + 239)
563#define __NR_request_key (__NR_Linux + 240) 568#define __NR_request_key (__NR_Linux + 240)
564#define __NR_keyctl (__NR_Linux + 241) 569#define __NR_keyctl (__NR_Linux + 241)
570#define __NR_set_thread_area (__NR_Linux + 242)
571#define __NR_inotify_init (__NR_Linux + 243)
572#define __NR_inotify_add_watch (__NR_Linux + 244)
573#define __NR_inotify_rm_watch (__NR_Linux + 245)
565 574
566/* 575/*
567 * Offset of the last Linux 64-bit flavoured syscall 576 * Offset of the last Linux 64-bit flavoured syscall
568 */ 577 */
569#define __NR_Linux_syscalls 241 578#define __NR_Linux_syscalls 245
570 579
571#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 580#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
572 581
573#define __NR_64_Linux 5000 582#define __NR_64_Linux 5000
574#define __NR_64_Linux_syscalls 241 583#define __NR_64_Linux_syscalls 242
575 584
576#if _MIPS_SIM == _MIPS_SIM_NABI32 585#if _MIPS_SIM == _MIPS_SIM_NABI32
577 586
@@ -825,16 +834,20 @@
825#define __NR_add_key (__NR_Linux + 243) 834#define __NR_add_key (__NR_Linux + 243)
826#define __NR_request_key (__NR_Linux + 244) 835#define __NR_request_key (__NR_Linux + 244)
827#define __NR_keyctl (__NR_Linux + 245) 836#define __NR_keyctl (__NR_Linux + 245)
837#define __NR_set_thread_area (__NR_Linux + 246)
838#define __NR_inotify_init (__NR_Linux + 247)
839#define __NR_inotify_add_watch (__NR_Linux + 248)
840#define __NR_inotify_rm_watch (__NR_Linux + 249)
828 841
829/* 842/*
830 * Offset of the last N32 flavoured syscall 843 * Offset of the last N32 flavoured syscall
831 */ 844 */
832#define __NR_Linux_syscalls 245 845#define __NR_Linux_syscalls 249
833 846
834#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 847#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
835 848
836#define __NR_N32_Linux 6000 849#define __NR_N32_Linux 6000
837#define __NR_N32_Linux_syscalls 245 850#define __NR_N32_Linux_syscalls 246
838 851
839#ifndef __ASSEMBLY__ 852#ifndef __ASSEMBLY__
840 853
diff --git a/include/asm-mips/vga.h b/include/asm-mips/vga.h
index 6b35cf054c79..ca5cec97e167 100644
--- a/include/asm-mips/vga.h
+++ b/include/asm-mips/vga.h
@@ -6,6 +6,8 @@
6#ifndef _ASM_VGA_H 6#ifndef _ASM_VGA_H
7#define _ASM_VGA_H 7#define _ASM_VGA_H
8 8
9#include <asm/byteorder.h>
10
9/* 11/*
10 * On the PC, we can just recalculate addresses and then 12 * On the PC, we can just recalculate addresses and then
11 * access the videoram directly without any black magic. 13 * access the videoram directly without any black magic.
@@ -16,4 +18,27 @@
16#define vga_readb(x) (*(x)) 18#define vga_readb(x) (*(x))
17#define vga_writeb(x,y) (*(y) = (x)) 19#define vga_writeb(x,y) (*(y) = (x))
18 20
21#define VT_BUF_HAVE_RW
22/*
23 * These are only needed for supporting VGA or MDA text mode, which use little
24 * endian byte ordering.
25 * In other cases, we can optimize by using native byte ordering and
26 * <linux/vt_buffer.h> has already done the right job for us.
27 */
28
29static inline void scr_writew(u16 val, volatile u16 *addr)
30{
31 *addr = cpu_to_le16(val);
32}
33
34static inline u16 scr_readw(volatile const u16 *addr)
35{
36 return le16_to_cpu(*addr);
37}
38
39#define scr_memcpyw(d, s, c) memcpy(d, s, c)
40#define scr_memmovew(d, s, c) memmove(d, s, c)
41#define VT_BUF_HAVE_MEMCPYW
42#define VT_BUF_HAVE_MEMMOVEW
43
19#endif /* _ASM_VGA_H */ 44#endif /* _ASM_VGA_H */
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h
index 04ee53b34c2e..ad374bd3f130 100644
--- a/include/asm-mips/war.h
+++ b/include/asm-mips/war.h
@@ -177,6 +177,17 @@
177#endif 177#endif
178 178
179/* 179/*
180 * The RM9000 has a bug (though PMC-Sierra opposes it being called that)
181 * where invalid instructions in the same I-cache line worth of instructions
182 * being fetched may case spurious exceptions.
183 */
184#if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_MOMENCO_OCELOT_3) || \
185 defined(CONFIG_PMC_YOSEMITE)
186#define ICACHE_REFILLS_WORKAROUND_WAR 1
187#endif
188
189
190/*
180 * ON the R10000 upto version 2.6 (not sure about 2.7) there is a bug that 191 * ON the R10000 upto version 2.6 (not sure about 2.7) there is a bug that
181 * may cause ll / sc and lld / scd sequences to execute non-atomically. 192 * may cause ll / sc and lld / scd sequences to execute non-atomically.
182 */ 193 */
@@ -187,6 +198,9 @@
187/* 198/*
188 * Workarounds default to off 199 * Workarounds default to off
189 */ 200 */
201#ifndef ICACHE_REFILLS_WORKAROUND_WAR
202#define ICACHE_REFILLS_WORKAROUND_WAR 0
203#endif
190#ifndef R4600_V1_INDEX_ICACHEOP_WAR 204#ifndef R4600_V1_INDEX_ICACHEOP_WAR
191#define R4600_V1_INDEX_ICACHEOP_WAR 0 205#define R4600_V1_INDEX_ICACHEOP_WAR 0
192#endif 206#endif
diff --git a/include/asm-parisc/assembly.h b/include/asm-parisc/assembly.h
index 30b023411fef..3ce3440d1b0c 100644
--- a/include/asm-parisc/assembly.h
+++ b/include/asm-parisc/assembly.h
@@ -21,7 +21,9 @@
21#ifndef _PARISC_ASSEMBLY_H 21#ifndef _PARISC_ASSEMBLY_H
22#define _PARISC_ASSEMBLY_H 22#define _PARISC_ASSEMBLY_H
23 23
24#ifdef __LP64__ 24#define CALLEE_FLOAT_FRAME_SIZE 80
25
26#ifdef CONFIG_64BIT
25#define LDREG ldd 27#define LDREG ldd
26#define STREG std 28#define STREG std
27#define LDREGX ldd,s 29#define LDREGX ldd,s
@@ -30,8 +32,8 @@
30#define SHRREG shrd 32#define SHRREG shrd
31#define RP_OFFSET 16 33#define RP_OFFSET 16
32#define FRAME_SIZE 128 34#define FRAME_SIZE 128
33#define CALLEE_SAVE_FRAME_SIZE 144 35#define CALLEE_REG_FRAME_SIZE 144
34#else 36#else /* CONFIG_64BIT */
35#define LDREG ldw 37#define LDREG ldw
36#define STREG stw 38#define STREG stw
37#define LDREGX ldwx,s 39#define LDREGX ldwx,s
@@ -40,9 +42,11 @@
40#define SHRREG shr 42#define SHRREG shr
41#define RP_OFFSET 20 43#define RP_OFFSET 20
42#define FRAME_SIZE 64 44#define FRAME_SIZE 64
43#define CALLEE_SAVE_FRAME_SIZE 128 45#define CALLEE_REG_FRAME_SIZE 128
44#endif 46#endif
45 47
48#define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE)
49
46#ifdef CONFIG_PA20 50#ifdef CONFIG_PA20
47#define BL b,l 51#define BL b,l
48# ifdef CONFIG_64BIT 52# ifdef CONFIG_64BIT
@@ -300,9 +304,35 @@
300 fldd,mb -8(\regs), %fr0 304 fldd,mb -8(\regs), %fr0
301 .endm 305 .endm
302 306
307 .macro callee_save_float
308 fstd,ma %fr12, 8(%r30)
309 fstd,ma %fr13, 8(%r30)
310 fstd,ma %fr14, 8(%r30)
311 fstd,ma %fr15, 8(%r30)
312 fstd,ma %fr16, 8(%r30)
313 fstd,ma %fr17, 8(%r30)
314 fstd,ma %fr18, 8(%r30)
315 fstd,ma %fr19, 8(%r30)
316 fstd,ma %fr20, 8(%r30)
317 fstd,ma %fr21, 8(%r30)
318 .endm
319
320 .macro callee_rest_float
321 fldd,mb -8(%r30), %fr21
322 fldd,mb -8(%r30), %fr20
323 fldd,mb -8(%r30), %fr19
324 fldd,mb -8(%r30), %fr18
325 fldd,mb -8(%r30), %fr17
326 fldd,mb -8(%r30), %fr16
327 fldd,mb -8(%r30), %fr15
328 fldd,mb -8(%r30), %fr14
329 fldd,mb -8(%r30), %fr13
330 fldd,mb -8(%r30), %fr12
331 .endm
332
303#ifdef __LP64__ 333#ifdef __LP64__
304 .macro callee_save 334 .macro callee_save
305 std,ma %r3, CALLEE_SAVE_FRAME_SIZE(%r30) 335 std,ma %r3, CALLEE_REG_FRAME_SIZE(%r30)
306 mfctl %cr27, %r3 336 mfctl %cr27, %r3
307 std %r4, -136(%r30) 337 std %r4, -136(%r30)
308 std %r5, -128(%r30) 338 std %r5, -128(%r30)
@@ -340,13 +370,13 @@
340 ldd -128(%r30), %r5 370 ldd -128(%r30), %r5
341 ldd -136(%r30), %r4 371 ldd -136(%r30), %r4
342 mtctl %r3, %cr27 372 mtctl %r3, %cr27
343 ldd,mb -CALLEE_SAVE_FRAME_SIZE(%r30), %r3 373 ldd,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3
344 .endm 374 .endm
345 375
346#else /* ! __LP64__ */ 376#else /* ! __LP64__ */
347 377
348 .macro callee_save 378 .macro callee_save
349 stw,ma %r3, CALLEE_SAVE_FRAME_SIZE(%r30) 379 stw,ma %r3, CALLEE_REG_FRAME_SIZE(%r30)
350 mfctl %cr27, %r3 380 mfctl %cr27, %r3
351 stw %r4, -124(%r30) 381 stw %r4, -124(%r30)
352 stw %r5, -120(%r30) 382 stw %r5, -120(%r30)
@@ -384,7 +414,7 @@
384 ldw -120(%r30), %r5 414 ldw -120(%r30), %r5
385 ldw -124(%r30), %r4 415 ldw -124(%r30), %r4
386 mtctl %r3, %cr27 416 mtctl %r3, %cr27
387 ldw,mb -CALLEE_SAVE_FRAME_SIZE(%r30), %r3 417 ldw,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3
388 .endm 418 .endm
389#endif /* ! __LP64__ */ 419#endif /* ! __LP64__ */
390 420
@@ -450,5 +480,30 @@
450 REST_CR (%cr22, PT_PSW (\regs)) 480 REST_CR (%cr22, PT_PSW (\regs))
451 .endm 481 .endm
452 482
483
484 /* First step to create a "relied upon translation"
485 * See PA 2.0 Arch. page F-4 and F-5.
486 *
487 * The ssm was originally necessary due to a "PCxT bug".
488 * But someone decided it needed to be added to the architecture
489 * and this "feature" went into rev3 of PA-RISC 1.1 Arch Manual.
490 * It's been carried forward into PA 2.0 Arch as well. :^(
491 *
492 * "ssm 0,%r0" is a NOP with side effects (prefetch barrier).
493 * rsm/ssm prevents the ifetch unit from speculatively fetching
494 * instructions past this line in the code stream.
495 * PA 2.0 processor will single step all insn in the same QUAD (4 insn).
496 */
497 .macro pcxt_ssm_bug
498 rsm PSW_SM_I,%r0
499 nop /* 1 */
500 nop /* 2 */
501 nop /* 3 */
502 nop /* 4 */
503 nop /* 5 */
504 nop /* 6 */
505 nop /* 7 */
506 .endm
507
453#endif /* __ASSEMBLY__ */ 508#endif /* __ASSEMBLY__ */
454#endif 509#endif
diff --git a/include/asm-parisc/bitops.h b/include/asm-parisc/bitops.h
index af7db694b22d..55b98c67fd82 100644
--- a/include/asm-parisc/bitops.h
+++ b/include/asm-parisc/bitops.h
@@ -2,7 +2,7 @@
2#define _PARISC_BITOPS_H 2#define _PARISC_BITOPS_H
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <asm/spinlock.h> 5#include <asm/types.h> /* for BITS_PER_LONG/SHIFT_PER_LONG */
6#include <asm/byteorder.h> 6#include <asm/byteorder.h>
7#include <asm/atomic.h> 7#include <asm/atomic.h>
8 8
@@ -12,193 +12,157 @@
12 * to include/asm-i386/bitops.h or kerneldoc 12 * to include/asm-i386/bitops.h or kerneldoc
13 */ 13 */
14 14
15#ifdef __LP64__ 15#define CHOP_SHIFTCOUNT(x) (((unsigned long) (x)) & (BITS_PER_LONG - 1))
16# define SHIFT_PER_LONG 6
17#ifndef BITS_PER_LONG
18# define BITS_PER_LONG 64
19#endif
20#else
21# define SHIFT_PER_LONG 5
22#ifndef BITS_PER_LONG
23# define BITS_PER_LONG 32
24#endif
25#endif
26
27#define CHOP_SHIFTCOUNT(x) ((x) & (BITS_PER_LONG - 1))
28 16
29 17
30#define smp_mb__before_clear_bit() smp_mb() 18#define smp_mb__before_clear_bit() smp_mb()
31#define smp_mb__after_clear_bit() smp_mb() 19#define smp_mb__after_clear_bit() smp_mb()
32 20
33static __inline__ void set_bit(int nr, volatile unsigned long * address) 21/* See http://marc.theaimsgroup.com/?t=108826637900003 for discussion
22 * on use of volatile and __*_bit() (set/clear/change):
23 * *_bit() want use of volatile.
24 * __*_bit() are "relaxed" and don't use spinlock or volatile.
25 */
26
27static __inline__ void set_bit(int nr, volatile unsigned long * addr)
34{ 28{
35 unsigned long mask; 29 unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
36 unsigned long *addr = (unsigned long *) address;
37 unsigned long flags; 30 unsigned long flags;
38 31
39 addr += (nr >> SHIFT_PER_LONG); 32 addr += (nr >> SHIFT_PER_LONG);
40 mask = 1L << CHOP_SHIFTCOUNT(nr);
41 _atomic_spin_lock_irqsave(addr, flags); 33 _atomic_spin_lock_irqsave(addr, flags);
42 *addr |= mask; 34 *addr |= mask;
43 _atomic_spin_unlock_irqrestore(addr, flags); 35 _atomic_spin_unlock_irqrestore(addr, flags);
44} 36}
45 37
46static __inline__ void __set_bit(int nr, volatile unsigned long * address) 38static __inline__ void __set_bit(unsigned long nr, volatile unsigned long * addr)
47{ 39{
48 unsigned long mask; 40 unsigned long *m = (unsigned long *) addr + (nr >> SHIFT_PER_LONG);
49 unsigned long *addr = (unsigned long *) address;
50 41
51 addr += (nr >> SHIFT_PER_LONG); 42 *m |= 1UL << CHOP_SHIFTCOUNT(nr);
52 mask = 1L << CHOP_SHIFTCOUNT(nr);
53 *addr |= mask;
54} 43}
55 44
56static __inline__ void clear_bit(int nr, volatile unsigned long * address) 45static __inline__ void clear_bit(int nr, volatile unsigned long * addr)
57{ 46{
58 unsigned long mask; 47 unsigned long mask = ~(1UL << CHOP_SHIFTCOUNT(nr));
59 unsigned long *addr = (unsigned long *) address;
60 unsigned long flags; 48 unsigned long flags;
61 49
62 addr += (nr >> SHIFT_PER_LONG); 50 addr += (nr >> SHIFT_PER_LONG);
63 mask = 1L << CHOP_SHIFTCOUNT(nr);
64 _atomic_spin_lock_irqsave(addr, flags); 51 _atomic_spin_lock_irqsave(addr, flags);
65 *addr &= ~mask; 52 *addr &= mask;
66 _atomic_spin_unlock_irqrestore(addr, flags); 53 _atomic_spin_unlock_irqrestore(addr, flags);
67} 54}
68 55
69static __inline__ void __clear_bit(unsigned long nr, volatile unsigned long * address) 56static __inline__ void __clear_bit(unsigned long nr, volatile unsigned long * addr)
70{ 57{
71 unsigned long mask; 58 unsigned long *m = (unsigned long *) addr + (nr >> SHIFT_PER_LONG);
72 unsigned long *addr = (unsigned long *) address;
73 59
74 addr += (nr >> SHIFT_PER_LONG); 60 *m &= ~(1UL << CHOP_SHIFTCOUNT(nr));
75 mask = 1L << CHOP_SHIFTCOUNT(nr);
76 *addr &= ~mask;
77} 61}
78 62
79static __inline__ void change_bit(int nr, volatile unsigned long * address) 63static __inline__ void change_bit(int nr, volatile unsigned long * addr)
80{ 64{
81 unsigned long mask; 65 unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
82 unsigned long *addr = (unsigned long *) address;
83 unsigned long flags; 66 unsigned long flags;
84 67
85 addr += (nr >> SHIFT_PER_LONG); 68 addr += (nr >> SHIFT_PER_LONG);
86 mask = 1L << CHOP_SHIFTCOUNT(nr);
87 _atomic_spin_lock_irqsave(addr, flags); 69 _atomic_spin_lock_irqsave(addr, flags);
88 *addr ^= mask; 70 *addr ^= mask;
89 _atomic_spin_unlock_irqrestore(addr, flags); 71 _atomic_spin_unlock_irqrestore(addr, flags);
90} 72}
91 73
92static __inline__ void __change_bit(int nr, volatile unsigned long * address) 74static __inline__ void __change_bit(unsigned long nr, volatile unsigned long * addr)
93{ 75{
94 unsigned long mask; 76 unsigned long *m = (unsigned long *) addr + (nr >> SHIFT_PER_LONG);
95 unsigned long *addr = (unsigned long *) address;
96 77
97 addr += (nr >> SHIFT_PER_LONG); 78 *m ^= 1UL << CHOP_SHIFTCOUNT(nr);
98 mask = 1L << CHOP_SHIFTCOUNT(nr);
99 *addr ^= mask;
100} 79}
101 80
102static __inline__ int test_and_set_bit(int nr, volatile unsigned long * address) 81static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr)
103{ 82{
104 unsigned long mask; 83 unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
105 unsigned long *addr = (unsigned long *) address; 84 unsigned long oldbit;
106 int oldbit;
107 unsigned long flags; 85 unsigned long flags;
108 86
109 addr += (nr >> SHIFT_PER_LONG); 87 addr += (nr >> SHIFT_PER_LONG);
110 mask = 1L << CHOP_SHIFTCOUNT(nr);
111 _atomic_spin_lock_irqsave(addr, flags); 88 _atomic_spin_lock_irqsave(addr, flags);
112 oldbit = (*addr & mask) ? 1 : 0; 89 oldbit = *addr;
113 *addr |= mask; 90 *addr = oldbit | mask;
114 _atomic_spin_unlock_irqrestore(addr, flags); 91 _atomic_spin_unlock_irqrestore(addr, flags);
115 92
116 return oldbit; 93 return (oldbit & mask) ? 1 : 0;
117} 94}
118 95
119static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * address) 96static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * address)
120{ 97{
121 unsigned long mask; 98 unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
122 unsigned long *addr = (unsigned long *) address; 99 unsigned long oldbit;
123 int oldbit; 100 unsigned long *addr = (unsigned long *)address + (nr >> SHIFT_PER_LONG);
124 101
125 addr += (nr >> SHIFT_PER_LONG); 102 oldbit = *addr;
126 mask = 1L << CHOP_SHIFTCOUNT(nr); 103 *addr = oldbit | mask;
127 oldbit = (*addr & mask) ? 1 : 0;
128 *addr |= mask;
129 104
130 return oldbit; 105 return (oldbit & mask) ? 1 : 0;
131} 106}
132 107
133static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * address) 108static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr)
134{ 109{
135 unsigned long mask; 110 unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
136 unsigned long *addr = (unsigned long *) address; 111 unsigned long oldbit;
137 int oldbit;
138 unsigned long flags; 112 unsigned long flags;
139 113
140 addr += (nr >> SHIFT_PER_LONG); 114 addr += (nr >> SHIFT_PER_LONG);
141 mask = 1L << CHOP_SHIFTCOUNT(nr);
142 _atomic_spin_lock_irqsave(addr, flags); 115 _atomic_spin_lock_irqsave(addr, flags);
143 oldbit = (*addr & mask) ? 1 : 0; 116 oldbit = *addr;
144 *addr &= ~mask; 117 *addr = oldbit & ~mask;
145 _atomic_spin_unlock_irqrestore(addr, flags); 118 _atomic_spin_unlock_irqrestore(addr, flags);
146 119
147 return oldbit; 120 return (oldbit & mask) ? 1 : 0;
148} 121}
149 122
150static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long * address) 123static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long * address)
151{ 124{
152 unsigned long mask; 125 unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
153 unsigned long *addr = (unsigned long *) address; 126 unsigned long *addr = (unsigned long *)address + (nr >> SHIFT_PER_LONG);
154 int oldbit; 127 unsigned long oldbit;
155 128
156 addr += (nr >> SHIFT_PER_LONG); 129 oldbit = *addr;
157 mask = 1L << CHOP_SHIFTCOUNT(nr); 130 *addr = oldbit & ~mask;
158 oldbit = (*addr & mask) ? 1 : 0;
159 *addr &= ~mask;
160 131
161 return oldbit; 132 return (oldbit & mask) ? 1 : 0;
162} 133}
163 134
164static __inline__ int test_and_change_bit(int nr, volatile unsigned long * address) 135static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr)
165{ 136{
166 unsigned long mask; 137 unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
167 unsigned long *addr = (unsigned long *) address; 138 unsigned long oldbit;
168 int oldbit;
169 unsigned long flags; 139 unsigned long flags;
170 140
171 addr += (nr >> SHIFT_PER_LONG); 141 addr += (nr >> SHIFT_PER_LONG);
172 mask = 1L << CHOP_SHIFTCOUNT(nr);
173 _atomic_spin_lock_irqsave(addr, flags); 142 _atomic_spin_lock_irqsave(addr, flags);
174 oldbit = (*addr & mask) ? 1 : 0; 143 oldbit = *addr;
175 *addr ^= mask; 144 *addr = oldbit ^ mask;
176 _atomic_spin_unlock_irqrestore(addr, flags); 145 _atomic_spin_unlock_irqrestore(addr, flags);
177 146
178 return oldbit; 147 return (oldbit & mask) ? 1 : 0;
179} 148}
180 149
181static __inline__ int __test_and_change_bit(int nr, volatile unsigned long * address) 150static __inline__ int __test_and_change_bit(int nr, volatile unsigned long * address)
182{ 151{
183 unsigned long mask; 152 unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
184 unsigned long *addr = (unsigned long *) address; 153 unsigned long *addr = (unsigned long *)address + (nr >> SHIFT_PER_LONG);
185 int oldbit; 154 unsigned long oldbit;
186 155
187 addr += (nr >> SHIFT_PER_LONG); 156 oldbit = *addr;
188 mask = 1L << CHOP_SHIFTCOUNT(nr); 157 *addr = oldbit ^ mask;
189 oldbit = (*addr & mask) ? 1 : 0;
190 *addr ^= mask;
191 158
192 return oldbit; 159 return (oldbit & mask) ? 1 : 0;
193} 160}
194 161
195static __inline__ int test_bit(int nr, const volatile unsigned long *address) 162static __inline__ int test_bit(int nr, const volatile unsigned long *address)
196{ 163{
197 unsigned long mask; 164 unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
198 const unsigned long *addr = (const unsigned long *)address; 165 const unsigned long *addr = (const unsigned long *)address + (nr >> SHIFT_PER_LONG);
199
200 addr += (nr >> SHIFT_PER_LONG);
201 mask = 1L << CHOP_SHIFTCOUNT(nr);
202 166
203 return !!(*addr & mask); 167 return !!(*addr & mask);
204} 168}
@@ -229,7 +193,7 @@ static __inline__ unsigned long __ffs(unsigned long x)
229 unsigned long ret; 193 unsigned long ret;
230 194
231 __asm__( 195 __asm__(
232#if BITS_PER_LONG > 32 196#ifdef __LP64__
233 " ldi 63,%1\n" 197 " ldi 63,%1\n"
234 " extrd,u,*<> %0,63,32,%%r0\n" 198 " extrd,u,*<> %0,63,32,%%r0\n"
235 " extrd,u,*TR %0,31,32,%0\n" /* move top 32-bits down */ 199 " extrd,u,*TR %0,31,32,%0\n" /* move top 32-bits down */
@@ -304,14 +268,7 @@ static __inline__ int fls(int x)
304 * hweightN: returns the hamming weight (i.e. the number 268 * hweightN: returns the hamming weight (i.e. the number
305 * of bits set) of a N-bit word 269 * of bits set) of a N-bit word
306 */ 270 */
307#define hweight64(x) \ 271#define hweight64(x) generic_hweight64(x)
308({ \
309 unsigned long __x = (x); \
310 unsigned int __w; \
311 __w = generic_hweight32((unsigned int) __x); \
312 __w += generic_hweight32((unsigned int) (__x>>32)); \
313 __w; \
314})
315#define hweight32(x) generic_hweight32(x) 272#define hweight32(x) generic_hweight32(x)
316#define hweight16(x) generic_hweight16(x) 273#define hweight16(x) generic_hweight16(x)
317#define hweight8(x) generic_hweight8(x) 274#define hweight8(x) generic_hweight8(x)
@@ -324,7 +281,13 @@ static __inline__ int fls(int x)
324 */ 281 */
325static inline int sched_find_first_bit(const unsigned long *b) 282static inline int sched_find_first_bit(const unsigned long *b)
326{ 283{
327#ifndef __LP64__ 284#ifdef __LP64__
285 if (unlikely(b[0]))
286 return __ffs(b[0]);
287 if (unlikely(b[1]))
288 return __ffs(b[1]) + 64;
289 return __ffs(b[2]) + 128;
290#else
328 if (unlikely(b[0])) 291 if (unlikely(b[0]))
329 return __ffs(b[0]); 292 return __ffs(b[0]);
330 if (unlikely(b[1])) 293 if (unlikely(b[1]))
@@ -334,14 +297,6 @@ static inline int sched_find_first_bit(const unsigned long *b)
334 if (b[3]) 297 if (b[3])
335 return __ffs(b[3]) + 96; 298 return __ffs(b[3]) + 96;
336 return __ffs(b[4]) + 128; 299 return __ffs(b[4]) + 128;
337#else
338 if (unlikely(b[0]))
339 return __ffs(b[0]);
340 if (unlikely(((unsigned int)b[1])))
341 return __ffs(b[1]) + 64;
342 if (b[1] >> 32)
343 return __ffs(b[1] >> 32) + 96;
344 return __ffs(b[2]) + 128;
345#endif 300#endif
346} 301}
347 302
@@ -391,7 +346,7 @@ found_middle:
391 346
392static __inline__ unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset) 347static __inline__ unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset)
393{ 348{
394 const unsigned long *p = addr + (offset >> 6); 349 const unsigned long *p = addr + (offset >> SHIFT_PER_LONG);
395 unsigned long result = offset & ~(BITS_PER_LONG-1); 350 unsigned long result = offset & ~(BITS_PER_LONG-1);
396 unsigned long tmp; 351 unsigned long tmp;
397 352
@@ -445,71 +400,90 @@ found_middle:
445 * test_and_{set,clear}_bit guarantee atomicity without 400 * test_and_{set,clear}_bit guarantee atomicity without
446 * disabling interrupts. 401 * disabling interrupts.
447 */ 402 */
448#ifdef __LP64__
449#define ext2_set_bit(nr, addr) __test_and_set_bit((nr) ^ 0x38, (unsigned long *)addr)
450#define ext2_set_bit_atomic(l,nr,addr) test_and_set_bit((nr) ^ 0x38, (unsigned long *)addr)
451#define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 0x38, (unsigned long *)addr)
452#define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x38, (unsigned long *)addr)
453#else
454#define ext2_set_bit(nr, addr) __test_and_set_bit((nr) ^ 0x18, (unsigned long *)addr)
455#define ext2_set_bit_atomic(l,nr,addr) test_and_set_bit((nr) ^ 0x18, (unsigned long *)addr)
456#define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 0x18, (unsigned long *)addr)
457#define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x18, (unsigned long *)addr)
458#endif
459 403
460#endif /* __KERNEL__ */ 404/* '3' is bits per byte */
405#define LE_BYTE_ADDR ((sizeof(unsigned long) - 1) << 3)
461 406
462static __inline__ int ext2_test_bit(int nr, __const__ void * addr) 407#define ext2_test_bit(nr, addr) \
463{ 408 test_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr)
464 __const__ unsigned char *ADDR = (__const__ unsigned char *) addr; 409#define ext2_set_bit(nr, addr) \
410 __test_and_set_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr)
411#define ext2_clear_bit(nr, addr) \
412 __test_and_clear_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr)
465 413
466 return (ADDR[nr >> 3] >> (nr & 7)) & 1; 414#define ext2_set_bit_atomic(l,nr,addr) \
467} 415 test_and_set_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr)
416#define ext2_clear_bit_atomic(l,nr,addr) \
417 test_and_clear_bit( (nr) ^ LE_BYTE_ADDR, (unsigned long *)addr)
418
419#endif /* __KERNEL__ */
468 420
469/*
470 * This implementation of ext2_find_{first,next}_zero_bit was stolen from
471 * Linus' asm-alpha/bitops.h and modified for a big-endian machine.
472 */
473 421
474#define ext2_find_first_zero_bit(addr, size) \ 422#define ext2_find_first_zero_bit(addr, size) \
475 ext2_find_next_zero_bit((addr), (size), 0) 423 ext2_find_next_zero_bit((addr), (size), 0)
476 424
477extern __inline__ unsigned long ext2_find_next_zero_bit(void *addr, 425/* include/linux/byteorder does not support "unsigned long" type */
478 unsigned long size, unsigned long offset) 426static inline unsigned long ext2_swabp(unsigned long * x)
479{ 427{
480 unsigned int *p = ((unsigned int *) addr) + (offset >> 5); 428#ifdef __LP64__
481 unsigned int result = offset & ~31UL; 429 return (unsigned long) __swab64p((u64 *) x);
482 unsigned int tmp; 430#else
431 return (unsigned long) __swab32p((u32 *) x);
432#endif
433}
434
435/* include/linux/byteorder doesn't support "unsigned long" type */
436static inline unsigned long ext2_swab(unsigned long y)
437{
438#ifdef __LP64__
439 return (unsigned long) __swab64((u64) y);
440#else
441 return (unsigned long) __swab32((u32) y);
442#endif
443}
444
445static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
446{
447 unsigned long *p = (unsigned long *) addr + (offset >> SHIFT_PER_LONG);
448 unsigned long result = offset & ~(BITS_PER_LONG - 1);
449 unsigned long tmp;
483 450
484 if (offset >= size) 451 if (offset >= size)
485 return size; 452 return size;
486 size -= result; 453 size -= result;
487 offset &= 31UL; 454 offset &= (BITS_PER_LONG - 1UL);
488 if (offset) { 455 if (offset) {
489 tmp = cpu_to_le32p(p++); 456 tmp = ext2_swabp(p++);
490 tmp |= ~0UL >> (32-offset); 457 tmp |= (~0UL >> (BITS_PER_LONG - offset));
491 if (size < 32) 458 if (size < BITS_PER_LONG)
492 goto found_first; 459 goto found_first;
493 if (tmp != ~0U) 460 if (~tmp)
494 goto found_middle; 461 goto found_middle;
495 size -= 32; 462 size -= BITS_PER_LONG;
496 result += 32; 463 result += BITS_PER_LONG;
497 } 464 }
498 while (size >= 32) { 465
499 if ((tmp = cpu_to_le32p(p++)) != ~0U) 466 while (size & ~(BITS_PER_LONG - 1)) {
500 goto found_middle; 467 if (~(tmp = *(p++)))
501 result += 32; 468 goto found_middle_swap;
502 size -= 32; 469 result += BITS_PER_LONG;
470 size -= BITS_PER_LONG;
503 } 471 }
504 if (!size) 472 if (!size)
505 return result; 473 return result;
506 tmp = cpu_to_le32p(p); 474 tmp = ext2_swabp(p);
507found_first: 475found_first:
508 tmp |= ~0U << size; 476 tmp |= ~0UL << size;
477 if (tmp == ~0UL) /* Are any bits zero? */
478 return result + size; /* Nope. Skip ffz */
509found_middle: 479found_middle:
510 return result + ffz(tmp); 480 return result + ffz(tmp);
481
482found_middle_swap:
483 return result + ffz(ext2_swab(tmp));
511} 484}
512 485
486
513/* Bitmap functions for the minix filesystem. */ 487/* Bitmap functions for the minix filesystem. */
514#define minix_test_and_set_bit(nr,addr) ext2_set_bit(nr,addr) 488#define minix_test_and_set_bit(nr,addr) ext2_set_bit(nr,addr)
515#define minix_set_bit(nr,addr) ((void)ext2_set_bit(nr,addr)) 489#define minix_set_bit(nr,addr) ((void)ext2_set_bit(nr,addr))
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h
index aa592d8c0e39..1bc3c83ee74b 100644
--- a/include/asm-parisc/cacheflush.h
+++ b/include/asm-parisc/cacheflush.h
@@ -100,30 +100,34 @@ static inline void flush_cache_range(struct vm_area_struct *vma,
100 100
101/* Simple function to work out if we have an existing address translation 101/* Simple function to work out if we have an existing address translation
102 * for a user space vma. */ 102 * for a user space vma. */
103static inline pte_t *__translation_exists(struct mm_struct *mm, 103static inline int translation_exists(struct vm_area_struct *vma,
104 unsigned long addr) 104 unsigned long addr, unsigned long pfn)
105{ 105{
106 pgd_t *pgd = pgd_offset(mm, addr); 106 pgd_t *pgd = pgd_offset(vma->vm_mm, addr);
107 pmd_t *pmd; 107 pmd_t *pmd;
108 pte_t *pte; 108 pte_t pte;
109 109
110 if(pgd_none(*pgd)) 110 if(pgd_none(*pgd))
111 return NULL; 111 return 0;
112 112
113 pmd = pmd_offset(pgd, addr); 113 pmd = pmd_offset(pgd, addr);
114 if(pmd_none(*pmd) || pmd_bad(*pmd)) 114 if(pmd_none(*pmd) || pmd_bad(*pmd))
115 return NULL; 115 return 0;
116 116
117 pte = pte_offset_map(pmd, addr); 117 /* We cannot take the pte lock here: flush_cache_page is usually
118 * called with pte lock already held. Whereas flush_dcache_page
119 * takes flush_dcache_mmap_lock, which is lower in the hierarchy:
120 * the vma itself is secure, but the pte might come or go racily.
121 */
122 pte = *pte_offset_map(pmd, addr);
123 /* But pte_unmap() does nothing on this architecture */
118 124
119 /* The PA flush mappings show up as pte_none, but they're 125 /* Filter out coincidental file entries and swap entries */
120 * valid none the less */ 126 if (!(pte_val(pte) & (_PAGE_FLUSH|_PAGE_PRESENT)))
121 if(pte_none(*pte) && ((pte_val(*pte) & _PAGE_FLUSH) == 0)) 127 return 0;
122 return NULL;
123 return pte;
124}
125#define translation_exists(vma, addr) __translation_exists((vma)->vm_mm, addr)
126 128
129 return pte_pfn(pte) == pfn;
130}
127 131
128/* Private function to flush a page from the cache of a non-current 132/* Private function to flush a page from the cache of a non-current
129 * process. cr25 contains the Page Directory of the current user 133 * process. cr25 contains the Page Directory of the current user
@@ -175,9 +179,8 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
175{ 179{
176 BUG_ON(!vma->vm_mm->context); 180 BUG_ON(!vma->vm_mm->context);
177 181
178 if(likely(translation_exists(vma, vmaddr))) 182 if (likely(translation_exists(vma, vmaddr, pfn)))
179 __flush_cache_page(vma, vmaddr); 183 __flush_cache_page(vma, vmaddr);
180 184
181} 185}
182#endif 186#endif
183
diff --git a/include/asm-parisc/dma-mapping.h b/include/asm-parisc/dma-mapping.h
index 4db84f969e9e..74d4ac6f2151 100644
--- a/include/asm-parisc/dma-mapping.h
+++ b/include/asm-parisc/dma-mapping.h
@@ -9,8 +9,8 @@
9/* See Documentation/DMA-mapping.txt */ 9/* See Documentation/DMA-mapping.txt */
10struct hppa_dma_ops { 10struct hppa_dma_ops {
11 int (*dma_supported)(struct device *dev, u64 mask); 11 int (*dma_supported)(struct device *dev, u64 mask);
12 void *(*alloc_consistent)(struct device *dev, size_t size, dma_addr_t *iova, int flag); 12 void *(*alloc_consistent)(struct device *dev, size_t size, dma_addr_t *iova, gfp_t flag);
13 void *(*alloc_noncoherent)(struct device *dev, size_t size, dma_addr_t *iova, int flag); 13 void *(*alloc_noncoherent)(struct device *dev, size_t size, dma_addr_t *iova, gfp_t flag);
14 void (*free_consistent)(struct device *dev, size_t size, void *vaddr, dma_addr_t iova); 14 void (*free_consistent)(struct device *dev, size_t size, void *vaddr, dma_addr_t iova);
15 dma_addr_t (*map_single)(struct device *dev, void *addr, size_t size, enum dma_data_direction direction); 15 dma_addr_t (*map_single)(struct device *dev, void *addr, size_t size, enum dma_data_direction direction);
16 void (*unmap_single)(struct device *dev, dma_addr_t iova, size_t size, enum dma_data_direction direction); 16 void (*unmap_single)(struct device *dev, dma_addr_t iova, size_t size, enum dma_data_direction direction);
@@ -49,14 +49,14 @@ extern struct hppa_dma_ops *hppa_dma_ops;
49 49
50static inline void * 50static inline void *
51dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 51dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
52 int flag) 52 gfp_t flag)
53{ 53{
54 return hppa_dma_ops->alloc_consistent(dev, size, dma_handle, flag); 54 return hppa_dma_ops->alloc_consistent(dev, size, dma_handle, flag);
55} 55}
56 56
57static inline void * 57static inline void *
58dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 58dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
59 int flag) 59 gfp_t flag)
60{ 60{
61 return hppa_dma_ops->alloc_noncoherent(dev, size, dma_handle, flag); 61 return hppa_dma_ops->alloc_noncoherent(dev, size, dma_handle, flag);
62} 62}
diff --git a/include/asm-parisc/errno.h b/include/asm-parisc/errno.h
index 08464c405471..e2f3ddc796be 100644
--- a/include/asm-parisc/errno.h
+++ b/include/asm-parisc/errno.h
@@ -114,6 +114,7 @@
114 114
115#define ENOTSUP 252 /* Function not implemented (POSIX.4 / HPUX) */ 115#define ENOTSUP 252 /* Function not implemented (POSIX.4 / HPUX) */
116#define ECANCELLED 253 /* aio request was canceled before complete (POSIX.4 / HPUX) */ 116#define ECANCELLED 253 /* aio request was canceled before complete (POSIX.4 / HPUX) */
117#define ECANCELED ECANCELLED /* SuSv3 and Solaris wants one 'L' */
117 118
118/* for robust mutexes */ 119/* for robust mutexes */
119#define EOWNERDEAD 254 /* Owner died */ 120#define EOWNERDEAD 254 /* Owner died */
diff --git a/include/asm-parisc/grfioctl.h b/include/asm-parisc/grfioctl.h
index d3cfc0168fb1..6a910311b56b 100644
--- a/include/asm-parisc/grfioctl.h
+++ b/include/asm-parisc/grfioctl.h
@@ -69,6 +69,8 @@
69#define CRT_ID_TVRX S9000_ID_98765 /* TVRX (gto/falcon) */ 69#define CRT_ID_TVRX S9000_ID_98765 /* TVRX (gto/falcon) */
70#define CRT_ID_ARTIST S9000_ID_ARTIST /* Artist */ 70#define CRT_ID_ARTIST S9000_ID_ARTIST /* Artist */
71#define CRT_ID_SUMMIT 0x2FC1066B /* Summit FX2, FX4, FX6 ... */ 71#define CRT_ID_SUMMIT 0x2FC1066B /* Summit FX2, FX4, FX6 ... */
72#define CRT_ID_LEGO 0x35ACDA30 /* Lego FX5, FX10 ... */
73#define CRT_ID_PINNACLE 0x35ACDA16 /* Pinnacle FXe */
72 74
73/* structure for ioctl(GCDESCRIBE) */ 75/* structure for ioctl(GCDESCRIBE) */
74 76
diff --git a/include/asm-parisc/led.h b/include/asm-parisc/led.h
index 1ac8ab6c580d..efadfd543ec6 100644
--- a/include/asm-parisc/led.h
+++ b/include/asm-parisc/led.h
@@ -23,9 +23,6 @@
23 23
24#define LED_CMD_REG_NONE 0 /* NULL == no addr for the cmd register */ 24#define LED_CMD_REG_NONE 0 /* NULL == no addr for the cmd register */
25 25
26/* led tasklet struct */
27extern struct tasklet_struct led_tasklet;
28
29/* register_led_driver() */ 26/* register_led_driver() */
30int __init register_led_driver(int model, unsigned long cmd_reg, unsigned long data_reg); 27int __init register_led_driver(int model, unsigned long cmd_reg, unsigned long data_reg);
31 28
diff --git a/include/asm-parisc/mmzone.h b/include/asm-parisc/mmzone.h
index 595d3dce120a..ae039f4fd711 100644
--- a/include/asm-parisc/mmzone.h
+++ b/include/asm-parisc/mmzone.h
@@ -27,12 +27,6 @@ extern struct node_map_data node_data[];
27}) 27})
28#define node_localnr(pfn, nid) ((pfn) - node_start_pfn(nid)) 28#define node_localnr(pfn, nid) ((pfn) - node_start_pfn(nid))
29 29
30#define local_mapnr(kvaddr) \
31({ \
32 unsigned long __pfn = __pa(kvaddr) >> PAGE_SHIFT; \
33 (__pfn - node_start_pfn(pfn_to_nid(__pfn))); \
34})
35
36#define pfn_to_page(pfn) \ 30#define pfn_to_page(pfn) \
37({ \ 31({ \
38 unsigned long __pfn = (pfn); \ 32 unsigned long __pfn = (pfn); \
diff --git a/include/asm-parisc/parisc-device.h b/include/asm-parisc/parisc-device.h
index ef69ab4b17a9..1d247e32a608 100644
--- a/include/asm-parisc/parisc-device.h
+++ b/include/asm-parisc/parisc-device.h
@@ -1,7 +1,7 @@
1#include <linux/device.h> 1#include <linux/device.h>
2 2
3struct parisc_device { 3struct parisc_device {
4 unsigned long hpa; /* Hard Physical Address */ 4 struct resource hpa; /* Hard Physical Address */
5 struct parisc_device_id id; 5 struct parisc_device_id id;
6 struct parisc_driver *driver; /* Driver for this device */ 6 struct parisc_driver *driver; /* Driver for this device */
7 char name[80]; /* The hardware description */ 7 char name[80]; /* The hardware description */
@@ -39,6 +39,11 @@ struct parisc_driver {
39#define to_parisc_driver(d) container_of(d, struct parisc_driver, drv) 39#define to_parisc_driver(d) container_of(d, struct parisc_driver, drv)
40#define parisc_parent(d) to_parisc_device(d->dev.parent) 40#define parisc_parent(d) to_parisc_device(d->dev.parent)
41 41
42static inline char *parisc_pathname(struct parisc_device *d)
43{
44 return d->dev.bus_id;
45}
46
42static inline void 47static inline void
43parisc_set_drvdata(struct parisc_device *d, void *p) 48parisc_set_drvdata(struct parisc_device *d, void *p)
44{ 49{
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h
index d0b761f690b5..fa39d07d49e9 100644
--- a/include/asm-parisc/pci.h
+++ b/include/asm-parisc/pci.h
@@ -69,7 +69,7 @@ struct pci_hba_data {
69#define PCI_PORT_HBA(a) ((a) >> HBA_PORT_SPACE_BITS) 69#define PCI_PORT_HBA(a) ((a) >> HBA_PORT_SPACE_BITS)
70#define PCI_PORT_ADDR(a) ((a) & (HBA_PORT_SPACE_SIZE - 1)) 70#define PCI_PORT_ADDR(a) ((a) & (HBA_PORT_SPACE_SIZE - 1))
71 71
72#if CONFIG_64BIT 72#ifdef CONFIG_64BIT
73#define PCI_F_EXTEND 0xffffffff00000000UL 73#define PCI_F_EXTEND 0xffffffff00000000UL
74#define PCI_IS_LMMIO(hba,a) pci_is_lmmio(hba,a) 74#define PCI_IS_LMMIO(hba,a) pci_is_lmmio(hba,a)
75 75
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index 820c6e712cd7..c28fb6f48c6c 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -501,6 +501,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
501#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 501#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
502 remap_pfn_range(vma, vaddr, pfn, size, prot) 502 remap_pfn_range(vma, vaddr, pfn, size, prot)
503 503
504#define pgprot_noncached(prot) __pgprot(pgprot_val(prot) | _PAGE_NO_CACHE)
505
504#define MK_IOSPACE_PFN(space, pfn) (pfn) 506#define MK_IOSPACE_PFN(space, pfn) (pfn)
505#define GET_IOSPACE(pfn) 0 507#define GET_IOSPACE(pfn) 0
506#define GET_PFN(pfn) (pfn) 508#define GET_PFN(pfn) (pfn)
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h
index a9dfadd05658..aae40e8c3aa8 100644
--- a/include/asm-parisc/processor.h
+++ b/include/asm-parisc/processor.h
@@ -122,8 +122,27 @@ struct thread_struct {
122}; 122};
123 123
124/* Thread struct flags. */ 124/* Thread struct flags. */
125#define PARISC_UAC_NOPRINT (1UL << 0) /* see prctl and unaligned.c */
126#define PARISC_UAC_SIGBUS (1UL << 1)
125#define PARISC_KERNEL_DEATH (1UL << 31) /* see die_if_kernel()... */ 127#define PARISC_KERNEL_DEATH (1UL << 31) /* see die_if_kernel()... */
126 128
129#define PARISC_UAC_SHIFT 0
130#define PARISC_UAC_MASK (PARISC_UAC_NOPRINT|PARISC_UAC_SIGBUS)
131
132#define SET_UNALIGN_CTL(task,value) \
133 ({ \
134 (task)->thread.flags = (((task)->thread.flags & ~PARISC_UAC_MASK) \
135 | (((value) << PARISC_UAC_SHIFT) & \
136 PARISC_UAC_MASK)); \
137 0; \
138 })
139
140#define GET_UNALIGN_CTL(task,addr) \
141 ({ \
142 put_user(((task)->thread.flags & PARISC_UAC_MASK) \
143 >> PARISC_UAC_SHIFT, (int __user *) (addr)); \
144 })
145
127#define INIT_THREAD { \ 146#define INIT_THREAD { \
128 regs: { gr: { 0, }, \ 147 regs: { gr: { 0, }, \
129 fr: { 0, }, \ 148 fr: { 0, }, \
diff --git a/include/asm-parisc/psw.h b/include/asm-parisc/psw.h
index 51323029f377..4334d6ca2add 100644
--- a/include/asm-parisc/psw.h
+++ b/include/asm-parisc/psw.h
@@ -1,4 +1,7 @@
1#ifndef _PARISC_PSW_H 1#ifndef _PARISC_PSW_H
2
3#include <linux/config.h>
4
2#define PSW_I 0x00000001 5#define PSW_I 0x00000001
3#define PSW_D 0x00000002 6#define PSW_D 0x00000002
4#define PSW_P 0x00000004 7#define PSW_P 0x00000004
@@ -9,6 +12,16 @@
9#define PSW_G 0x00000040 /* PA1.x only */ 12#define PSW_G 0x00000040 /* PA1.x only */
10#define PSW_O 0x00000080 /* PA2.0 only */ 13#define PSW_O 0x00000080 /* PA2.0 only */
11 14
15/* ssm/rsm instructions number PSW_W and PSW_E differently */
16#define PSW_SM_I PSW_I /* Enable External Interrupts */
17#define PSW_SM_D PSW_D
18#define PSW_SM_P PSW_P
19#define PSW_SM_Q PSW_Q /* Enable Interrupt State Collection */
20#define PSW_SM_R PSW_R /* Enable Recover Counter Trap */
21#define PSW_SM_W 0x200 /* PA2.0 only : Enable Wide Mode */
22
23#define PSW_SM_QUIET PSW_SM_R+PSW_SM_Q+PSW_SM_P+PSW_SM_D+PSW_SM_I
24
12#define PSW_CB 0x0000ff00 25#define PSW_CB 0x0000ff00
13 26
14#define PSW_M 0x00010000 27#define PSW_M 0x00010000
@@ -30,33 +43,21 @@
30#define PSW_Z 0x40000000 /* PA1.x only */ 43#define PSW_Z 0x40000000 /* PA1.x only */
31#define PSW_Y 0x80000000 /* PA1.x only */ 44#define PSW_Y 0x80000000 /* PA1.x only */
32 45
33#ifdef __LP64__ 46#ifdef CONFIG_64BIT
34#define PSW_HI_CB 0x000000ff /* PA2.0 only */ 47# define PSW_HI_CB 0x000000ff /* PA2.0 only */
35#endif 48#endif
36 49
37/* PSW bits to be used with ssm/rsm */ 50#ifdef CONFIG_64BIT
38#define PSW_SM_I 0x1 51# define USER_PSW_HI_MASK PSW_HI_CB
39#define PSW_SM_D 0x2 52# define WIDE_PSW PSW_W
40#define PSW_SM_P 0x4 53#else
41#define PSW_SM_Q 0x8 54# define WIDE_PSW 0
42#define PSW_SM_R 0x10
43#define PSW_SM_F 0x20
44#define PSW_SM_G 0x40
45#define PSW_SM_O 0x80
46#define PSW_SM_E 0x100
47#define PSW_SM_W 0x200
48
49#ifdef __LP64__
50# define USER_PSW (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I)
51# define KERNEL_PSW (PSW_W | PSW_C | PSW_Q | PSW_P | PSW_D)
52# define REAL_MODE_PSW (PSW_W | PSW_Q)
53# define USER_PSW_MASK (PSW_W | PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB)
54# define USER_PSW_HI_MASK (PSW_HI_CB)
55#else
56# define USER_PSW (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I)
57# define KERNEL_PSW (PSW_C | PSW_Q | PSW_P | PSW_D)
58# define REAL_MODE_PSW (PSW_Q)
59# define USER_PSW_MASK (PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB)
60#endif 55#endif
61 56
57/* Used when setting up for rfi */
58#define KERNEL_PSW (WIDE_PSW | PSW_C | PSW_Q | PSW_P | PSW_D)
59#define REAL_MODE_PSW (WIDE_PSW | PSW_Q)
60#define USER_PSW_MASK (WIDE_PSW | PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB)
61#define USER_PSW (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I)
62
62#endif 63#endif
diff --git a/include/asm-parisc/ptrace.h b/include/asm-parisc/ptrace.h
index 3f428aa371a4..93f990e418f1 100644
--- a/include/asm-parisc/ptrace.h
+++ b/include/asm-parisc/ptrace.h
@@ -49,7 +49,7 @@ struct pt_regs {
49#define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) 49#define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0)
50#define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) 50#define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0)
51#define instruction_pointer(regs) ((regs)->iaoq[0] & ~3) 51#define instruction_pointer(regs) ((regs)->iaoq[0] & ~3)
52#define profile_pc(regs) instruction_pointer(regs) 52unsigned long profile_pc(struct pt_regs *);
53extern void show_regs(struct pt_regs *); 53extern void show_regs(struct pt_regs *);
54#endif 54#endif
55 55
diff --git a/include/asm-parisc/spinlock.h b/include/asm-parisc/spinlock.h
index 43eaa6e742e0..7c3f406a746a 100644
--- a/include/asm-parisc/spinlock.h
+++ b/include/asm-parisc/spinlock.h
@@ -5,11 +5,6 @@
5#include <asm/processor.h> 5#include <asm/processor.h>
6#include <asm/spinlock_types.h> 6#include <asm/spinlock_types.h>
7 7
8/* Note that PA-RISC has to use `1' to mean unlocked and `0' to mean locked
9 * since it only has load-and-zero. Moreover, at least on some PA processors,
10 * the semaphore address has to be 16-byte aligned.
11 */
12
13static inline int __raw_spin_is_locked(raw_spinlock_t *x) 8static inline int __raw_spin_is_locked(raw_spinlock_t *x)
14{ 9{
15 volatile unsigned int *a = __ldcw_align(x); 10 volatile unsigned int *a = __ldcw_align(x);
diff --git a/include/asm-parisc/spinlock_types.h b/include/asm-parisc/spinlock_types.h
index 785bba822fbf..d6b479bdb886 100644
--- a/include/asm-parisc/spinlock_types.h
+++ b/include/asm-parisc/spinlock_types.h
@@ -6,11 +6,15 @@
6#endif 6#endif
7 7
8typedef struct { 8typedef struct {
9#ifdef CONFIG_PA20
10 volatile unsigned int slock;
11# define __RAW_SPIN_LOCK_UNLOCKED { 1 }
12#else
9 volatile unsigned int lock[4]; 13 volatile unsigned int lock[4];
14# define __RAW_SPIN_LOCK_UNLOCKED { { 1, 1, 1, 1 } }
15#endif
10} raw_spinlock_t; 16} raw_spinlock_t;
11 17
12#define __RAW_SPIN_LOCK_UNLOCKED { { 1, 1, 1, 1 } }
13
14typedef struct { 18typedef struct {
15 raw_spinlock_t lock; 19 raw_spinlock_t lock;
16 volatile int counter; 20 volatile int counter;
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h
index 26ff844a21c1..f3928d3a80cb 100644
--- a/include/asm-parisc/system.h
+++ b/include/asm-parisc/system.h
@@ -138,13 +138,7 @@ static inline void set_eiem(unsigned long val)
138#define set_wmb(var, value) do { var = value; wmb(); } while (0) 138#define set_wmb(var, value) do { var = value; wmb(); } while (0)
139 139
140 140
141/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ 141#ifndef CONFIG_PA20
142#define __ldcw(a) ({ \
143 unsigned __ret; \
144 __asm__ __volatile__("ldcw 0(%1),%0" : "=r" (__ret) : "r" (a)); \
145 __ret; \
146})
147
148/* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data, 142/* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data,
149 and GCC only guarantees 8-byte alignment for stack locals, we can't 143 and GCC only guarantees 8-byte alignment for stack locals, we can't
150 be assured of 16-byte alignment for atomic lock data even if we 144 be assured of 16-byte alignment for atomic lock data even if we
@@ -152,37 +146,41 @@ static inline void set_eiem(unsigned long val)
152 we use a struct containing an array of four ints for the atomic lock 146 we use a struct containing an array of four ints for the atomic lock
153 type and dynamically select the 16-byte aligned int from the array 147 type and dynamically select the 16-byte aligned int from the array
154 for the semaphore. */ 148 for the semaphore. */
149
155#define __PA_LDCW_ALIGNMENT 16 150#define __PA_LDCW_ALIGNMENT 16
156#define __ldcw_align(a) ({ \ 151#define __ldcw_align(a) ({ \
157 unsigned long __ret = (unsigned long) &(a)->lock[0]; \ 152 unsigned long __ret = (unsigned long) &(a)->lock[0]; \
158 __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1); \ 153 __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1); \
159 (volatile unsigned int *) __ret; \ 154 (volatile unsigned int *) __ret; \
160}) 155})
156#define LDCW "ldcw"
161 157
162#ifdef CONFIG_SMP 158#else /*CONFIG_PA20*/
163# define __lock_aligned __attribute__((__section__(".data.lock_aligned"))) 159/* From: "Jim Hull" <jim.hull of hp.com>
164#endif 160 I've attached a summary of the change, but basically, for PA 2.0, as
161 long as the ",CO" (coherent operation) completer is specified, then the
162 16-byte alignment requirement for ldcw and ldcd is relaxed, and instead
163 they only require "natural" alignment (4-byte for ldcw, 8-byte for
164 ldcd). */
165 165
166#define KERNEL_START (0x10100000 - 0x1000) 166#define __PA_LDCW_ALIGNMENT 4
167#define __ldcw_align(a) ((volatile unsigned int *)a)
168#define LDCW "ldcw,co"
167 169
168/* This is for the serialisation of PxTLB broadcasts. At least on the 170#endif /*!CONFIG_PA20*/
169 * N class systems, only one PxTLB inter processor broadcast can be
170 * active at any one time on the Merced bus. This tlb purge
171 * synchronisation is fairly lightweight and harmless so we activate
172 * it on all SMP systems not just the N class. */
173#ifdef CONFIG_SMP
174extern spinlock_t pa_tlb_lock;
175 171
176#define purge_tlb_start(x) spin_lock(&pa_tlb_lock) 172/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */
177#define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) 173#define __ldcw(a) ({ \
178 174 unsigned __ret; \
179#else 175 __asm__ __volatile__(LDCW " 0(%1),%0" : "=r" (__ret) : "r" (a)); \
180 176 __ret; \
181#define purge_tlb_start(x) do { } while(0) 177})
182#define purge_tlb_end(x) do { } while (0)
183 178
179#ifdef CONFIG_SMP
180# define __lock_aligned __attribute__((__section__(".data.lock_aligned")))
184#endif 181#endif
185 182
183#define KERNEL_START (0x10100000 - 0x1000)
186#define arch_align_stack(x) (x) 184#define arch_align_stack(x) (x)
187 185
188#endif 186#endif
diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h
index eb27b78930e8..e97aa8d1eff5 100644
--- a/include/asm-parisc/tlbflush.h
+++ b/include/asm-parisc/tlbflush.h
@@ -7,6 +7,26 @@
7#include <linux/mm.h> 7#include <linux/mm.h>
8#include <asm/mmu_context.h> 8#include <asm/mmu_context.h>
9 9
10
11/* This is for the serialisation of PxTLB broadcasts. At least on the
12 * N class systems, only one PxTLB inter processor broadcast can be
13 * active at any one time on the Merced bus. This tlb purge
14 * synchronisation is fairly lightweight and harmless so we activate
15 * it on all SMP systems not just the N class. */
16#ifdef CONFIG_SMP
17extern spinlock_t pa_tlb_lock;
18
19#define purge_tlb_start(x) spin_lock(&pa_tlb_lock)
20#define purge_tlb_end(x) spin_unlock(&pa_tlb_lock)
21
22#else
23
24#define purge_tlb_start(x) do { } while(0)
25#define purge_tlb_end(x) do { } while (0)
26
27#endif
28
29
10extern void flush_tlb_all(void); 30extern void flush_tlb_all(void);
11 31
12/* 32/*
@@ -64,29 +84,27 @@ static inline void flush_tlb_range(struct vm_area_struct *vma,
64{ 84{
65 unsigned long npages; 85 unsigned long npages;
66 86
67
68 npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT; 87 npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
69 if (npages >= 512) /* XXX arbitrary, should be tuned */ 88 if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */
70 flush_tlb_all(); 89 flush_tlb_all();
71 else { 90 else {
72 91 preempt_disable();
73 mtsp(vma->vm_mm->context,1); 92 mtsp(vma->vm_mm->context,1);
93 purge_tlb_start();
74 if (split_tlb) { 94 if (split_tlb) {
75 purge_tlb_start();
76 while (npages--) { 95 while (npages--) {
77 pdtlb(start); 96 pdtlb(start);
78 pitlb(start); 97 pitlb(start);
79 start += PAGE_SIZE; 98 start += PAGE_SIZE;
80 } 99 }
81 purge_tlb_end();
82 } else { 100 } else {
83 purge_tlb_start();
84 while (npages--) { 101 while (npages--) {
85 pdtlb(start); 102 pdtlb(start);
86 start += PAGE_SIZE; 103 start += PAGE_SIZE;
87 } 104 }
88 purge_tlb_end(); 105 preempt_enable();
89 } 106 }
107 purge_tlb_end();
90 } 108 }
91} 109}
92 110
diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h
index d21b9d0d63ea..34fdce361a5a 100644
--- a/include/asm-parisc/types.h
+++ b/include/asm-parisc/types.h
@@ -33,8 +33,10 @@ typedef unsigned long long __u64;
33 33
34#ifdef __LP64__ 34#ifdef __LP64__
35#define BITS_PER_LONG 64 35#define BITS_PER_LONG 64
36#define SHIFT_PER_LONG 6
36#else 37#else
37#define BITS_PER_LONG 32 38#define BITS_PER_LONG 32
39#define SHIFT_PER_LONG 5
38#endif 40#endif
39 41
40#ifndef __ASSEMBLY__ 42#ifndef __ASSEMBLY__
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index 6a9f0cadff58..e7a620c5c5e6 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -687,8 +687,8 @@
687#define __NR_shmget (__NR_Linux + 194) 687#define __NR_shmget (__NR_Linux + 194)
688#define __NR_shmctl (__NR_Linux + 195) 688#define __NR_shmctl (__NR_Linux + 195)
689 689
690#define __NR_getpmsg (__NR_Linux + 196) /* some people actually want streams */ 690#define __NR_getpmsg (__NR_Linux + 196) /* Somebody *wants* streams? */
691#define __NR_putpmsg (__NR_Linux + 197) /* some people actually want streams */ 691#define __NR_putpmsg (__NR_Linux + 197)
692 692
693#define __NR_lstat64 (__NR_Linux + 198) 693#define __NR_lstat64 (__NR_Linux + 198)
694#define __NR_truncate64 (__NR_Linux + 199) 694#define __NR_truncate64 (__NR_Linux + 199)
@@ -755,8 +755,14 @@
755#define __NR_mbind (__NR_Linux + 260) 755#define __NR_mbind (__NR_Linux + 260)
756#define __NR_get_mempolicy (__NR_Linux + 261) 756#define __NR_get_mempolicy (__NR_Linux + 261)
757#define __NR_set_mempolicy (__NR_Linux + 262) 757#define __NR_set_mempolicy (__NR_Linux + 262)
758#define __NR_vserver (__NR_Linux + 263)
759#define __NR_add_key (__NR_Linux + 264)
760#define __NR_request_key (__NR_Linux + 265)
761#define __NR_keyctl (__NR_Linux + 266)
762#define __NR_ioprio_set (__NR_Linux + 267)
763#define __NR_ioprio_get (__NR_Linux + 268)
758 764
759#define __NR_Linux_syscalls 263 765#define __NR_Linux_syscalls 269
760 766
761#define HPUX_GATEWAY_ADDR 0xC0000004 767#define HPUX_GATEWAY_ADDR 0xC0000004
762#define LINUX_GATEWAY_ADDR 0x100 768#define LINUX_GATEWAY_ADDR 0x100
@@ -807,10 +813,10 @@
807#define K_INLINE_SYSCALL(name, nr, args...) ({ \ 813#define K_INLINE_SYSCALL(name, nr, args...) ({ \
808 long __sys_res; \ 814 long __sys_res; \
809 { \ 815 { \
810 register unsigned long __res asm("r28"); \ 816 register unsigned long __res __asm__("r28"); \
811 K_LOAD_ARGS_##nr(args) \ 817 K_LOAD_ARGS_##nr(args) \
812 /* FIXME: HACK stw/ldw r19 around syscall */ \ 818 /* FIXME: HACK stw/ldw r19 around syscall */ \
813 asm volatile( \ 819 __asm__ volatile( \
814 K_STW_ASM_PIC \ 820 K_STW_ASM_PIC \
815 " ble 0x100(%%sr2, %%r0)\n" \ 821 " ble 0x100(%%sr2, %%r0)\n" \
816 " ldi %1, %%r20\n" \ 822 " ldi %1, %%r20\n" \
diff --git a/include/asm-ppc/dma-mapping.h b/include/asm-ppc/dma-mapping.h
index 061bfcac1bf1..6e9635114433 100644
--- a/include/asm-ppc/dma-mapping.h
+++ b/include/asm-ppc/dma-mapping.h
@@ -19,7 +19,7 @@
19 * allocate the space "normally" and use the cache management functions 19 * allocate the space "normally" and use the cache management functions
20 * to ensure it is consistent. 20 * to ensure it is consistent.
21 */ 21 */
22extern void *__dma_alloc_coherent(size_t size, dma_addr_t *handle, int gfp); 22extern void *__dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp);
23extern void __dma_free_coherent(size_t size, void *vaddr); 23extern void __dma_free_coherent(size_t size, void *vaddr);
24extern void __dma_sync(void *vaddr, size_t size, int direction); 24extern void __dma_sync(void *vaddr, size_t size, int direction);
25extern void __dma_sync_page(struct page *page, unsigned long offset, 25extern void __dma_sync_page(struct page *page, unsigned long offset,
diff --git a/include/asm-ppc/rwsem.h b/include/asm-ppc/rwsem.h
index 3e738f483c11..3501ea72f88c 100644
--- a/include/asm-ppc/rwsem.h
+++ b/include/asm-ppc/rwsem.h
@@ -168,5 +168,10 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
168 return atomic_add_return(delta, (atomic_t *)(&sem->count)); 168 return atomic_add_return(delta, (atomic_t *)(&sem->count));
169} 169}
170 170
171static inline int rwsem_is_locked(struct rw_semaphore *sem)
172{
173 return (sem->count != 0);
174}
175
171#endif /* __KERNEL__ */ 176#endif /* __KERNEL__ */
172#endif /* _PPC_RWSEM_XADD_H */ 177#endif /* _PPC_RWSEM_XADD_H */
diff --git a/include/asm-ppc64/mmzone.h b/include/asm-ppc64/mmzone.h
index ed473f4b0152..80a708e7093a 100644
--- a/include/asm-ppc64/mmzone.h
+++ b/include/asm-ppc64/mmzone.h
@@ -67,9 +67,6 @@ static inline int pa_to_nid(unsigned long pa)
67#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) 67#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
68#define node_end_pfn(nid) (NODE_DATA(nid)->node_end_pfn) 68#define node_end_pfn(nid) (NODE_DATA(nid)->node_end_pfn)
69 69
70#define local_mapnr(kvaddr) \
71 ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr))
72
73#ifdef CONFIG_DISCONTIGMEM 70#ifdef CONFIG_DISCONTIGMEM
74 71
75/* 72/*
diff --git a/include/asm-ppc64/pgtable.h b/include/asm-ppc64/pgtable.h
index c83679c9d2b0..2eb1778a3a15 100644
--- a/include/asm-ppc64/pgtable.h
+++ b/include/asm-ppc64/pgtable.h
@@ -478,10 +478,12 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr,
478#define __HAVE_ARCH_PTE_SAME 478#define __HAVE_ARCH_PTE_SAME
479#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0) 479#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0)
480 480
481#define pte_ERROR(e) \
482 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
481#define pmd_ERROR(e) \ 483#define pmd_ERROR(e) \
482 printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) 484 printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
483#define pud_ERROR(e) \ 485#define pud_ERROR(e) \
484 printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pud_val(e)) 486 printk("%s:%d: bad pud %08lx.\n", __FILE__, __LINE__, pud_val(e))
485#define pgd_ERROR(e) \ 487#define pgd_ERROR(e) \
486 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) 488 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
487 489
diff --git a/include/asm-ppc64/rwsem.h b/include/asm-ppc64/rwsem.h
index bd5c2f093575..7a647fae3765 100644
--- a/include/asm-ppc64/rwsem.h
+++ b/include/asm-ppc64/rwsem.h
@@ -163,5 +163,10 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
163 return atomic_add_return(delta, (atomic_t *)(&sem->count)); 163 return atomic_add_return(delta, (atomic_t *)(&sem->count));
164} 164}
165 165
166static inline int rwsem_is_locked(struct rw_semaphore *sem)
167{
168 return (sem->count != 0);
169}
170
166#endif /* __KERNEL__ */ 171#endif /* __KERNEL__ */
167#endif /* _PPC_RWSEM_XADD_H */ 172#endif /* _PPC_RWSEM_XADD_H */
diff --git a/include/asm-s390/rwsem.h b/include/asm-s390/rwsem.h
index 8c0cebbfc034..0422a085dd56 100644
--- a/include/asm-s390/rwsem.h
+++ b/include/asm-s390/rwsem.h
@@ -351,5 +351,10 @@ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
351 return new; 351 return new;
352} 352}
353 353
354static inline int rwsem_is_locked(struct rw_semaphore *sem)
355{
356 return (sem->count != 0);
357}
358
354#endif /* __KERNEL__ */ 359#endif /* __KERNEL__ */
355#endif /* _S390_RWSEM_H */ 360#endif /* _S390_RWSEM_H */
diff --git a/include/asm-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h
index 80d164c1529e..d3fa5c2b889d 100644
--- a/include/asm-sh/dma-mapping.h
+++ b/include/asm-sh/dma-mapping.h
@@ -9,7 +9,7 @@
9extern struct bus_type pci_bus_type; 9extern struct bus_type pci_bus_type;
10 10
11/* arch/sh/mm/consistent.c */ 11/* arch/sh/mm/consistent.c */
12extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle); 12extern void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *handle);
13extern void consistent_free(void *vaddr, size_t size); 13extern void consistent_free(void *vaddr, size_t size);
14extern void consistent_sync(void *vaddr, size_t size, int direction); 14extern void consistent_sync(void *vaddr, size_t size, int direction);
15 15
@@ -26,7 +26,7 @@ static inline int dma_set_mask(struct device *dev, u64 mask)
26} 26}
27 27
28static inline void *dma_alloc_coherent(struct device *dev, size_t size, 28static inline void *dma_alloc_coherent(struct device *dev, size_t size,
29 dma_addr_t *dma_handle, int flag) 29 dma_addr_t *dma_handle, gfp_t flag)
30{ 30{
31 if (sh_mv.mv_consistent_alloc) { 31 if (sh_mv.mv_consistent_alloc) {
32 void *ret; 32 void *ret;
diff --git a/include/asm-sh/machvec.h b/include/asm-sh/machvec.h
index 5771f4baa478..3f18aa180516 100644
--- a/include/asm-sh/machvec.h
+++ b/include/asm-sh/machvec.h
@@ -64,7 +64,7 @@ struct sh_machine_vector
64 64
65 void (*mv_heartbeat)(void); 65 void (*mv_heartbeat)(void);
66 66
67 void *(*mv_consistent_alloc)(struct device *, size_t, dma_addr_t *, int); 67 void *(*mv_consistent_alloc)(struct device *, size_t, dma_addr_t *, gfp_t);
68 int (*mv_consistent_free)(struct device *, size_t, void *, dma_addr_t); 68 int (*mv_consistent_free)(struct device *, size_t, void *, dma_addr_t);
69}; 69};
70 70
diff --git a/include/asm-sh/rwsem.h b/include/asm-sh/rwsem.h
index 1be4337f5259..0262d3d1e5e0 100644
--- a/include/asm-sh/rwsem.h
+++ b/include/asm-sh/rwsem.h
@@ -166,5 +166,10 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
166 return atomic_add_return(delta, (atomic_t *)(&sem->count)); 166 return atomic_add_return(delta, (atomic_t *)(&sem->count));
167} 167}
168 168
169static inline int rwsem_is_locked(struct rw_semaphore *sem)
170{
171 return (sem->count != 0);
172}
173
169#endif /* __KERNEL__ */ 174#endif /* __KERNEL__ */
170#endif /* _ASM_SH_RWSEM_H */ 175#endif /* _ASM_SH_RWSEM_H */
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h
index b8d26fe677f4..cc9a2e86f5b4 100644
--- a/include/asm-sh64/dma-mapping.h
+++ b/include/asm-sh64/dma-mapping.h
@@ -25,7 +25,7 @@ static inline int dma_set_mask(struct device *dev, u64 mask)
25} 25}
26 26
27static inline void *dma_alloc_coherent(struct device *dev, size_t size, 27static inline void *dma_alloc_coherent(struct device *dev, size_t size,
28 dma_addr_t *dma_handle, int flag) 28 dma_addr_t *dma_handle, gfp_t flag)
29{ 29{
30 return consistent_alloc(NULL, size, dma_handle); 30 return consistent_alloc(NULL, size, dma_handle);
31} 31}
diff --git a/include/asm-sparc/dma-mapping.h b/include/asm-sparc/dma-mapping.h
index 2dc5bb8effa6..d7c3b0f0a901 100644
--- a/include/asm-sparc/dma-mapping.h
+++ b/include/asm-sparc/dma-mapping.h
@@ -8,7 +8,7 @@
8#else 8#else
9 9
10static inline void *dma_alloc_coherent(struct device *dev, size_t size, 10static inline void *dma_alloc_coherent(struct device *dev, size_t size,
11 dma_addr_t *dma_handle, int flag) 11 dma_addr_t *dma_handle, gfp_t flag)
12{ 12{
13 BUG(); 13 BUG();
14 return NULL; 14 return NULL;
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h
index 1c5da41653a4..c7d5804ba76d 100644
--- a/include/asm-sparc64/dma-mapping.h
+++ b/include/asm-sparc64/dma-mapping.h
@@ -10,7 +10,7 @@
10struct device; 10struct device;
11 11
12static inline void *dma_alloc_coherent(struct device *dev, size_t size, 12static inline void *dma_alloc_coherent(struct device *dev, size_t size,
13 dma_addr_t *dma_handle, int flag) 13 dma_addr_t *dma_handle, gfp_t flag)
14{ 14{
15 BUG(); 15 BUG();
16 return NULL; 16 return NULL;
diff --git a/include/asm-sparc64/rwsem.h b/include/asm-sparc64/rwsem.h
index 4568ee4022df..cef5e8270421 100644
--- a/include/asm-sparc64/rwsem.h
+++ b/include/asm-sparc64/rwsem.h
@@ -56,6 +56,11 @@ static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
56 atomic_add(delta, (atomic_t *)(&sem->count)); 56 atomic_add(delta, (atomic_t *)(&sem->count));
57} 57}
58 58
59static inline int rwsem_is_locked(struct rw_semaphore *sem)
60{
61 return (sem->count != 0);
62}
63
59#endif /* __KERNEL__ */ 64#endif /* __KERNEL__ */
60 65
61#endif /* _SPARC64_RWSEM_H */ 66#endif /* _SPARC64_RWSEM_H */
diff --git a/include/asm-sparc64/tlb.h b/include/asm-sparc64/tlb.h
index 9baf57db01d2..66138d959df5 100644
--- a/include/asm-sparc64/tlb.h
+++ b/include/asm-sparc64/tlb.h
@@ -25,9 +25,8 @@ struct mmu_gather {
25 struct mm_struct *mm; 25 struct mm_struct *mm;
26 unsigned int pages_nr; 26 unsigned int pages_nr;
27 unsigned int need_flush; 27 unsigned int need_flush;
28 unsigned int tlb_frozen; 28 unsigned int fullmm;
29 unsigned int tlb_nr; 29 unsigned int tlb_nr;
30 unsigned long freed;
31 unsigned long vaddrs[TLB_BATCH_NR]; 30 unsigned long vaddrs[TLB_BATCH_NR];
32 struct page *pages[FREE_PTE_NR]; 31 struct page *pages[FREE_PTE_NR];
33}; 32};
@@ -44,14 +43,13 @@ extern void flush_tlb_pending(void);
44 43
45static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) 44static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
46{ 45{
47 struct mmu_gather *mp = &__get_cpu_var(mmu_gathers); 46 struct mmu_gather *mp = &get_cpu_var(mmu_gathers);
48 47
49 BUG_ON(mp->tlb_nr); 48 BUG_ON(mp->tlb_nr);
50 49
51 mp->mm = mm; 50 mp->mm = mm;
52 mp->pages_nr = num_online_cpus() > 1 ? 0U : ~0U; 51 mp->pages_nr = num_online_cpus() > 1 ? 0U : ~0U;
53 mp->tlb_frozen = full_mm_flush; 52 mp->fullmm = full_mm_flush;
54 mp->freed = 0;
55 53
56 return mp; 54 return mp;
57} 55}
@@ -78,30 +76,19 @@ extern void smp_flush_tlb_mm(struct mm_struct *mm);
78 76
79static inline void tlb_finish_mmu(struct mmu_gather *mp, unsigned long start, unsigned long end) 77static inline void tlb_finish_mmu(struct mmu_gather *mp, unsigned long start, unsigned long end)
80{ 78{
81 unsigned long freed = mp->freed;
82 struct mm_struct *mm = mp->mm;
83 unsigned long rss = get_mm_counter(mm, rss);
84
85 if (rss < freed)
86 freed = rss;
87 add_mm_counter(mm, rss, -freed);
88
89 tlb_flush_mmu(mp); 79 tlb_flush_mmu(mp);
90 80
91 if (mp->tlb_frozen) { 81 if (mp->fullmm) {
92 if (CTX_VALID(mm->context)) 82 if (CTX_VALID(mp->mm->context))
93 do_flush_tlb_mm(mm); 83 do_flush_tlb_mm(mp->mm);
94 mp->tlb_frozen = 0; 84 mp->fullmm = 0;
95 } else 85 } else
96 flush_tlb_pending(); 86 flush_tlb_pending();
97 87
98 /* keep the page table cache within bounds */ 88 /* keep the page table cache within bounds */
99 check_pgt_cache(); 89 check_pgt_cache();
100}
101 90
102static inline unsigned int tlb_is_full_mm(struct mmu_gather *mp) 91 put_cpu_var(mmu_gathers);
103{
104 return mp->tlb_frozen;
105} 92}
106 93
107static inline void tlb_remove_page(struct mmu_gather *mp, struct page *page) 94static inline void tlb_remove_page(struct mmu_gather *mp, struct page *page)
diff --git a/include/asm-um/dma-mapping.h b/include/asm-um/dma-mapping.h
index 13e6291f7151..babd29895114 100644
--- a/include/asm-um/dma-mapping.h
+++ b/include/asm-um/dma-mapping.h
@@ -19,7 +19,7 @@ dma_set_mask(struct device *dev, u64 dma_mask)
19 19
20static inline void * 20static inline void *
21dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 21dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
22 int flag) 22 gfp_t flag)
23{ 23{
24 BUG(); 24 BUG();
25 return((void *) 0); 25 return((void *) 0);
diff --git a/include/asm-um/page.h b/include/asm-um/page.h
index 2c192abe9aeb..0229814af31e 100644
--- a/include/asm-um/page.h
+++ b/include/asm-um/page.h
@@ -115,7 +115,7 @@ extern unsigned long uml_physmem;
115#define pfn_valid(pfn) ((pfn) < max_mapnr) 115#define pfn_valid(pfn) ((pfn) < max_mapnr)
116#define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) 116#define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v)))
117 117
118extern struct page *arch_validate(struct page *page, int mask, int order); 118extern struct page *arch_validate(struct page *page, gfp_t mask, int order);
119#define HAVE_ARCH_VALIDATE 119#define HAVE_ARCH_VALIDATE
120 120
121extern void arch_free_page(struct page *page, int order); 121extern void arch_free_page(struct page *page, int order);
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h
index 616d02b57ea9..ac64eb955868 100644
--- a/include/asm-um/pgtable.h
+++ b/include/asm-um/pgtable.h
@@ -138,7 +138,7 @@ extern unsigned long pg0[1024];
138 138
139#define pte_clear(mm,addr,xp) pte_set_val(*(xp), (phys_t) 0, __pgprot(_PAGE_NEWPAGE)) 139#define pte_clear(mm,addr,xp) pte_set_val(*(xp), (phys_t) 0, __pgprot(_PAGE_NEWPAGE))
140 140
141#define pmd_none(x) (!(pmd_val(x) & ~_PAGE_NEWPAGE)) 141#define pmd_none(x) (!((unsigned long)pmd_val(x) & ~_PAGE_NEWPAGE))
142#define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) 142#define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
143#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) 143#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT)
144#define pmd_clear(xp) do { pmd_val(*(xp)) = _PAGE_NEWPAGE; } while (0) 144#define pmd_clear(xp) do { pmd_val(*(xp)) = _PAGE_NEWPAGE; } while (0)
diff --git a/include/asm-x86_64/dma-mapping.h b/include/asm-x86_64/dma-mapping.h
index e784fdc524f1..54a380efed41 100644
--- a/include/asm-x86_64/dma-mapping.h
+++ b/include/asm-x86_64/dma-mapping.h
@@ -17,7 +17,7 @@ extern dma_addr_t bad_dma_address;
17 (swiotlb ? swiotlb_dma_mapping_error(x) : ((x) == bad_dma_address)) 17 (swiotlb ? swiotlb_dma_mapping_error(x) : ((x) == bad_dma_address))
18 18
19void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 19void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
20 unsigned gfp); 20 gfp_t gfp);
21void dma_free_coherent(struct device *dev, size_t size, void *vaddr, 21void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
22 dma_addr_t dma_handle); 22 dma_addr_t dma_handle);
23 23
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h
index 5a82a6762c21..eeb3088a1c9e 100644
--- a/include/asm-x86_64/pci.h
+++ b/include/asm-x86_64/pci.h
@@ -50,10 +50,10 @@ extern int iommu_setup(char *opt);
50 * address space. The networking and block device layers use 50 * address space. The networking and block device layers use
51 * this boolean for bounce buffer decisions 51 * this boolean for bounce buffer decisions
52 * 52 *
53 * On x86-64 it mostly equals, but we set it to zero to tell some subsystems 53 * On AMD64 it mostly equals, but we set it to zero to tell some subsystems
54 * that an hard or soft IOMMU is available. 54 * that an IOMMU is available.
55 */ 55 */
56#define PCI_DMA_BUS_IS_PHYS 0 56#define PCI_DMA_BUS_IS_PHYS (no_iommu ? 1 : 0)
57 57
58/* 58/*
59 * x86-64 always supports DAC, but sometimes it is useful to force 59 * x86-64 always supports DAC, but sometimes it is useful to force
diff --git a/include/asm-x86_64/rwsem.h b/include/asm-x86_64/rwsem.h
index c002175b6e82..46077e9c1910 100644
--- a/include/asm-x86_64/rwsem.h
+++ b/include/asm-x86_64/rwsem.h
@@ -274,5 +274,10 @@ LOCK_PREFIX "xaddl %0,(%2)"
274 return tmp+delta; 274 return tmp+delta;
275} 275}
276 276
277static inline int rwsem_is_locked(struct rw_semaphore *sem)
278{
279 return (sem->count != 0);
280}
281
277#endif /* __KERNEL__ */ 282#endif /* __KERNEL__ */
278#endif /* _X8664_RWSEM_H */ 283#endif /* _X8664_RWSEM_H */
diff --git a/include/asm-x86_64/swiotlb.h b/include/asm-x86_64/swiotlb.h
index 36293061f4ed..7cbfd10ecc3c 100644
--- a/include/asm-x86_64/swiotlb.h
+++ b/include/asm-x86_64/swiotlb.h
@@ -27,7 +27,7 @@ extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg,
27 int nents, int direction); 27 int nents, int direction);
28extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr); 28extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr);
29extern void *swiotlb_alloc_coherent (struct device *hwdev, size_t size, 29extern void *swiotlb_alloc_coherent (struct device *hwdev, size_t size,
30 dma_addr_t *dma_handle, int flags); 30 dma_addr_t *dma_handle, gfp_t flags);
31extern void swiotlb_free_coherent (struct device *hwdev, size_t size, 31extern void swiotlb_free_coherent (struct device *hwdev, size_t size,
32 void *vaddr, dma_addr_t dma_handle); 32 void *vaddr, dma_addr_t dma_handle);
33 33
diff --git a/include/asm-xtensa/dma-mapping.h b/include/asm-xtensa/dma-mapping.h
index e86a206f1209..c425f10d086a 100644
--- a/include/asm-xtensa/dma-mapping.h
+++ b/include/asm-xtensa/dma-mapping.h
@@ -28,7 +28,7 @@ extern void consistent_sync(void*, size_t, int);
28#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 28#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
29 29
30void *dma_alloc_coherent(struct device *dev, size_t size, 30void *dma_alloc_coherent(struct device *dev, size_t size,
31 dma_addr_t *dma_handle, int flag); 31 dma_addr_t *dma_handle, gfp_t flag);
32 32
33void dma_free_coherent(struct device *dev, size_t size, 33void dma_free_coherent(struct device *dev, size_t size,
34 void *vaddr, dma_addr_t dma_handle); 34 void *vaddr, dma_addr_t dma_handle);
diff --git a/include/linux/ata.h b/include/linux/ata.h
index a5b74efab067..d2873b732bb1 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -42,13 +42,18 @@ enum {
42 ATA_SECT_SIZE = 512, 42 ATA_SECT_SIZE = 512,
43 43
44 ATA_ID_WORDS = 256, 44 ATA_ID_WORDS = 256,
45 ATA_ID_PROD_OFS = 27,
46 ATA_ID_FW_REV_OFS = 23,
47 ATA_ID_SERNO_OFS = 10, 45 ATA_ID_SERNO_OFS = 10,
48 ATA_ID_MAJOR_VER = 80, 46 ATA_ID_FW_REV_OFS = 23,
49 ATA_ID_PIO_MODES = 64, 47 ATA_ID_PROD_OFS = 27,
48 ATA_ID_OLD_PIO_MODES = 51,
49 ATA_ID_FIELD_VALID = 53,
50 ATA_ID_MWDMA_MODES = 63, 50 ATA_ID_MWDMA_MODES = 63,
51 ATA_ID_PIO_MODES = 64,
52 ATA_ID_EIDE_DMA_MIN = 65,
53 ATA_ID_EIDE_PIO = 67,
54 ATA_ID_EIDE_PIO_IORDY = 68,
51 ATA_ID_UDMA_MODES = 88, 55 ATA_ID_UDMA_MODES = 88,
56 ATA_ID_MAJOR_VER = 80,
52 ATA_ID_PIO4 = (1 << 1), 57 ATA_ID_PIO4 = (1 << 1),
53 58
54 ATA_PCI_CTL_OFS = 2, 59 ATA_PCI_CTL_OFS = 2,
@@ -128,10 +133,15 @@ enum {
128 ATA_CMD_PIO_READ_EXT = 0x24, 133 ATA_CMD_PIO_READ_EXT = 0x24,
129 ATA_CMD_PIO_WRITE = 0x30, 134 ATA_CMD_PIO_WRITE = 0x30,
130 ATA_CMD_PIO_WRITE_EXT = 0x34, 135 ATA_CMD_PIO_WRITE_EXT = 0x34,
136 ATA_CMD_READ_MULTI = 0xC4,
137 ATA_CMD_READ_MULTI_EXT = 0x29,
138 ATA_CMD_WRITE_MULTI = 0xC5,
139 ATA_CMD_WRITE_MULTI_EXT = 0x39,
131 ATA_CMD_SET_FEATURES = 0xEF, 140 ATA_CMD_SET_FEATURES = 0xEF,
132 ATA_CMD_PACKET = 0xA0, 141 ATA_CMD_PACKET = 0xA0,
133 ATA_CMD_VERIFY = 0x40, 142 ATA_CMD_VERIFY = 0x40,
134 ATA_CMD_VERIFY_EXT = 0x42, 143 ATA_CMD_VERIFY_EXT = 0x42,
144 ATA_CMD_INIT_DEV_PARAMS = 0x91,
135 145
136 /* SETFEATURES stuff */ 146 /* SETFEATURES stuff */
137 SETFEATURES_XFER = 0x03, 147 SETFEATURES_XFER = 0x03,
@@ -146,14 +156,14 @@ enum {
146 XFER_MW_DMA_2 = 0x22, 156 XFER_MW_DMA_2 = 0x22,
147 XFER_MW_DMA_1 = 0x21, 157 XFER_MW_DMA_1 = 0x21,
148 XFER_MW_DMA_0 = 0x20, 158 XFER_MW_DMA_0 = 0x20,
159 XFER_SW_DMA_2 = 0x12,
160 XFER_SW_DMA_1 = 0x11,
161 XFER_SW_DMA_0 = 0x10,
149 XFER_PIO_4 = 0x0C, 162 XFER_PIO_4 = 0x0C,
150 XFER_PIO_3 = 0x0B, 163 XFER_PIO_3 = 0x0B,
151 XFER_PIO_2 = 0x0A, 164 XFER_PIO_2 = 0x0A,
152 XFER_PIO_1 = 0x09, 165 XFER_PIO_1 = 0x09,
153 XFER_PIO_0 = 0x08, 166 XFER_PIO_0 = 0x08,
154 XFER_SW_DMA_2 = 0x12,
155 XFER_SW_DMA_1 = 0x11,
156 XFER_SW_DMA_0 = 0x10,
157 XFER_PIO_SLOW = 0x00, 167 XFER_PIO_SLOW = 0x00,
158 168
159 /* ATAPI stuff */ 169 /* ATAPI stuff */
@@ -181,6 +191,7 @@ enum {
181 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ 191 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
182 ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ 192 ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */
183 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ 193 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
194 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
184}; 195};
185 196
186enum ata_tf_protocols { 197enum ata_tf_protocols {
@@ -250,7 +261,19 @@ struct ata_taskfile {
250 ((u64) (id)[(n) + 1] << 16) | \ 261 ((u64) (id)[(n) + 1] << 16) | \
251 ((u64) (id)[(n) + 0]) ) 262 ((u64) (id)[(n) + 0]) )
252 263
253static inline int atapi_cdb_len(u16 *dev_id) 264static inline int ata_id_current_chs_valid(const u16 *id)
265{
266 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
267 has not been issued to the device then the values of
268 id[54] to id[56] are vendor specific. */
269 return (id[53] & 0x01) && /* Current translation valid */
270 id[54] && /* cylinders in current translation */
271 id[55] && /* heads in current translation */
272 id[55] <= 16 &&
273 id[56]; /* sectors in current translation */
274}
275
276static inline int atapi_cdb_len(const u16 *dev_id)
254{ 277{
255 u16 tmp = dev_id[0] & 0x3; 278 u16 tmp = dev_id[0] & 0x3;
256 switch (tmp) { 279 switch (tmp) {
@@ -260,7 +283,7 @@ static inline int atapi_cdb_len(u16 *dev_id)
260 } 283 }
261} 284}
262 285
263static inline int is_atapi_taskfile(struct ata_taskfile *tf) 286static inline int is_atapi_taskfile(const struct ata_taskfile *tf)
264{ 287{
265 return (tf->protocol == ATA_PROT_ATAPI) || 288 return (tf->protocol == ATA_PROT_ATAPI) ||
266 (tf->protocol == ATA_PROT_ATAPI_NODATA) || 289 (tf->protocol == ATA_PROT_ATAPI_NODATA) ||
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b2a2509bd7ea..da3c01955f3d 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -260,11 +260,11 @@ extern int audit_filter_user(struct netlink_skb_parms *cb, int type);
260#ifdef CONFIG_AUDIT 260#ifdef CONFIG_AUDIT
261/* These are defined in audit.c */ 261/* These are defined in audit.c */
262 /* Public API */ 262 /* Public API */
263extern void audit_log(struct audit_context *ctx, int gfp_mask, 263extern void audit_log(struct audit_context *ctx, gfp_t gfp_mask,
264 int type, const char *fmt, ...) 264 int type, const char *fmt, ...)
265 __attribute__((format(printf,4,5))); 265 __attribute__((format(printf,4,5)));
266 266
267extern struct audit_buffer *audit_log_start(struct audit_context *ctx, int gfp_mask, int type); 267extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
268extern void audit_log_format(struct audit_buffer *ab, 268extern void audit_log_format(struct audit_buffer *ab,
269 const char *fmt, ...) 269 const char *fmt, ...)
270 __attribute__((format(printf,2,3))); 270 __attribute__((format(printf,2,3)));
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 3344b4e8e43a..685fd3720df5 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -301,7 +301,7 @@ extern struct bio *bio_map_user_iov(struct request_queue *,
301 struct sg_iovec *, int, int); 301 struct sg_iovec *, int, int);
302extern void bio_unmap_user(struct bio *); 302extern void bio_unmap_user(struct bio *);
303extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, 303extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
304 unsigned int); 304 gfp_t);
305extern void bio_set_pages_dirty(struct bio *bio); 305extern void bio_set_pages_dirty(struct bio *bio);
306extern void bio_check_pages_dirty(struct bio *bio); 306extern void bio_check_pages_dirty(struct bio *bio);
307extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); 307extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index efdc9b5bc05c..025a7f084dbd 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -96,8 +96,8 @@ struct io_context {
96 96
97void put_io_context(struct io_context *ioc); 97void put_io_context(struct io_context *ioc);
98void exit_io_context(void); 98void exit_io_context(void);
99struct io_context *current_io_context(int gfp_flags); 99struct io_context *current_io_context(gfp_t gfp_flags);
100struct io_context *get_io_context(int gfp_flags); 100struct io_context *get_io_context(gfp_t gfp_flags);
101void copy_io_context(struct io_context **pdst, struct io_context **psrc); 101void copy_io_context(struct io_context **pdst, struct io_context **psrc);
102void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); 102void swap_io_context(struct io_context **ioc1, struct io_context **ioc2);
103 103
@@ -107,9 +107,9 @@ typedef void (rq_end_io_fn)(struct request *);
107struct request_list { 107struct request_list {
108 int count[2]; 108 int count[2];
109 int starved[2]; 109 int starved[2];
110 int elvpriv;
110 mempool_t *rq_pool; 111 mempool_t *rq_pool;
111 wait_queue_head_t wait[2]; 112 wait_queue_head_t wait[2];
112 wait_queue_head_t drain;
113}; 113};
114 114
115#define BLK_MAX_CDB 16 115#define BLK_MAX_CDB 16
@@ -203,6 +203,7 @@ struct request {
203enum rq_flag_bits { 203enum rq_flag_bits {
204 __REQ_RW, /* not set, read. set, write */ 204 __REQ_RW, /* not set, read. set, write */
205 __REQ_FAILFAST, /* no low level driver retries */ 205 __REQ_FAILFAST, /* no low level driver retries */
206 __REQ_SORTED, /* elevator knows about this request */
206 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ 207 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
207 __REQ_HARDBARRIER, /* may not be passed by drive either */ 208 __REQ_HARDBARRIER, /* may not be passed by drive either */
208 __REQ_CMD, /* is a regular fs rw request */ 209 __REQ_CMD, /* is a regular fs rw request */
@@ -210,6 +211,7 @@ enum rq_flag_bits {
210 __REQ_STARTED, /* drive already may have started this one */ 211 __REQ_STARTED, /* drive already may have started this one */
211 __REQ_DONTPREP, /* don't call prep for this one */ 212 __REQ_DONTPREP, /* don't call prep for this one */
212 __REQ_QUEUED, /* uses queueing */ 213 __REQ_QUEUED, /* uses queueing */
214 __REQ_ELVPRIV, /* elevator private data attached */
213 /* 215 /*
214 * for ATA/ATAPI devices 216 * for ATA/ATAPI devices
215 */ 217 */
@@ -235,6 +237,7 @@ enum rq_flag_bits {
235 237
236#define REQ_RW (1 << __REQ_RW) 238#define REQ_RW (1 << __REQ_RW)
237#define REQ_FAILFAST (1 << __REQ_FAILFAST) 239#define REQ_FAILFAST (1 << __REQ_FAILFAST)
240#define REQ_SORTED (1 << __REQ_SORTED)
238#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) 241#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
239#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) 242#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
240#define REQ_CMD (1 << __REQ_CMD) 243#define REQ_CMD (1 << __REQ_CMD)
@@ -242,6 +245,7 @@ enum rq_flag_bits {
242#define REQ_STARTED (1 << __REQ_STARTED) 245#define REQ_STARTED (1 << __REQ_STARTED)
243#define REQ_DONTPREP (1 << __REQ_DONTPREP) 246#define REQ_DONTPREP (1 << __REQ_DONTPREP)
244#define REQ_QUEUED (1 << __REQ_QUEUED) 247#define REQ_QUEUED (1 << __REQ_QUEUED)
248#define REQ_ELVPRIV (1 << __REQ_ELVPRIV)
245#define REQ_PC (1 << __REQ_PC) 249#define REQ_PC (1 << __REQ_PC)
246#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC) 250#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC)
247#define REQ_SENSE (1 << __REQ_SENSE) 251#define REQ_SENSE (1 << __REQ_SENSE)
@@ -333,6 +337,12 @@ struct request_queue
333 end_flush_fn *end_flush_fn; 337 end_flush_fn *end_flush_fn;
334 338
335 /* 339 /*
340 * Dispatch queue sorting
341 */
342 sector_t end_sector;
343 struct request *boundary_rq;
344
345 /*
336 * Auto-unplugging state 346 * Auto-unplugging state
337 */ 347 */
338 struct timer_list unplug_timer; 348 struct timer_list unplug_timer;
@@ -354,7 +364,7 @@ struct request_queue
354 * queue needs bounce pages for pages above this limit 364 * queue needs bounce pages for pages above this limit
355 */ 365 */
356 unsigned long bounce_pfn; 366 unsigned long bounce_pfn;
357 unsigned int bounce_gfp; 367 gfp_t bounce_gfp;
358 368
359 /* 369 /*
360 * various queue flags, see QUEUE_* below 370 * various queue flags, see QUEUE_* below
@@ -405,8 +415,6 @@ struct request_queue
405 unsigned int sg_reserved_size; 415 unsigned int sg_reserved_size;
406 int node; 416 int node;
407 417
408 struct list_head drain_list;
409
410 /* 418 /*
411 * reserved for flush operations 419 * reserved for flush operations
412 */ 420 */
@@ -434,7 +442,7 @@ enum {
434#define QUEUE_FLAG_DEAD 5 /* queue being torn down */ 442#define QUEUE_FLAG_DEAD 5 /* queue being torn down */
435#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ 443#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */
436#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ 444#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */
437#define QUEUE_FLAG_DRAIN 8 /* draining queue for sched switch */ 445#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */
438#define QUEUE_FLAG_FLUSH 9 /* doing barrier flush sequence */ 446#define QUEUE_FLAG_FLUSH 9 /* doing barrier flush sequence */
439 447
440#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) 448#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
@@ -454,6 +462,7 @@ enum {
454#define blk_pm_request(rq) \ 462#define blk_pm_request(rq) \
455 ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) 463 ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME))
456 464
465#define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED)
457#define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) 466#define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER)
458#define blk_barrier_preflush(rq) ((rq)->flags & REQ_BAR_PREFLUSH) 467#define blk_barrier_preflush(rq) ((rq)->flags & REQ_BAR_PREFLUSH)
459#define blk_barrier_postflush(rq) ((rq)->flags & REQ_BAR_POSTFLUSH) 468#define blk_barrier_postflush(rq) ((rq)->flags & REQ_BAR_POSTFLUSH)
@@ -550,7 +559,7 @@ extern void generic_make_request(struct bio *bio);
550extern void blk_put_request(struct request *); 559extern void blk_put_request(struct request *);
551extern void blk_end_sync_rq(struct request *rq); 560extern void blk_end_sync_rq(struct request *rq);
552extern void blk_attempt_remerge(request_queue_t *, struct request *); 561extern void blk_attempt_remerge(request_queue_t *, struct request *);
553extern struct request *blk_get_request(request_queue_t *, int, int); 562extern struct request *blk_get_request(request_queue_t *, int, gfp_t);
554extern void blk_insert_request(request_queue_t *, struct request *, int, void *); 563extern void blk_insert_request(request_queue_t *, struct request *, int, void *);
555extern void blk_requeue_request(request_queue_t *, struct request *); 564extern void blk_requeue_request(request_queue_t *, struct request *);
556extern void blk_plug_device(request_queue_t *); 565extern void blk_plug_device(request_queue_t *);
@@ -565,7 +574,7 @@ extern void blk_run_queue(request_queue_t *);
565extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); 574extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
566extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); 575extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int);
567extern int blk_rq_unmap_user(struct bio *, unsigned int); 576extern int blk_rq_unmap_user(struct bio *, unsigned int);
568extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, unsigned int); 577extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t);
569extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); 578extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int);
570extern int blk_execute_rq(request_queue_t *, struct gendisk *, 579extern int blk_execute_rq(request_queue_t *, struct gendisk *,
571 struct request *, int); 580 struct request *, int);
@@ -611,12 +620,21 @@ extern void end_request(struct request *req, int uptodate);
611 620
612static inline void blkdev_dequeue_request(struct request *req) 621static inline void blkdev_dequeue_request(struct request *req)
613{ 622{
614 BUG_ON(list_empty(&req->queuelist)); 623 elv_dequeue_request(req->q, req);
624}
615 625
616 list_del_init(&req->queuelist); 626/*
627 * This should be in elevator.h, but that requires pulling in rq and q
628 */
629static inline void elv_dispatch_add_tail(struct request_queue *q,
630 struct request *rq)
631{
632 if (q->last_merge == rq)
633 q->last_merge = NULL;
617 634
618 if (req->rl) 635 q->end_sector = rq_end_sector(rq);
619 elv_remove_request(req->q, req); 636 q->boundary_rq = rq;
637 list_add_tail(&rq->queuelist, &q->queue_head);
620} 638}
621 639
622/* 640/*
@@ -650,12 +668,10 @@ extern void blk_dump_rq_flags(struct request *, char *);
650extern void generic_unplug_device(request_queue_t *); 668extern void generic_unplug_device(request_queue_t *);
651extern void __generic_unplug_device(request_queue_t *); 669extern void __generic_unplug_device(request_queue_t *);
652extern long nr_blockdev_pages(void); 670extern long nr_blockdev_pages(void);
653extern void blk_wait_queue_drained(request_queue_t *, int);
654extern void blk_finish_queue_drain(request_queue_t *);
655 671
656int blk_get_queue(request_queue_t *); 672int blk_get_queue(request_queue_t *);
657request_queue_t *blk_alloc_queue(int gfp_mask); 673request_queue_t *blk_alloc_queue(gfp_t);
658request_queue_t *blk_alloc_queue_node(int,int); 674request_queue_t *blk_alloc_queue_node(gfp_t, int);
659#define blk_put_queue(q) blk_cleanup_queue((q)) 675#define blk_put_queue(q) blk_cleanup_queue((q))
660 676
661/* 677/*
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 6a1d154c0825..c937d6e65502 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -126,8 +126,8 @@ BUFFER_FNS(Eopnotsupp, eopnotsupp)
126/* If we *know* page->private refers to buffer_heads */ 126/* If we *know* page->private refers to buffer_heads */
127#define page_buffers(page) \ 127#define page_buffers(page) \
128 ({ \ 128 ({ \
129 BUG_ON(!PagePrivate(page)); \ 129 BUG_ON(!PagePrivate(page)); \
130 ((struct buffer_head *)(page)->private); \ 130 ((struct buffer_head *)page_private(page)); \
131 }) 131 })
132#define page_has_buffers(page) PagePrivate(page) 132#define page_has_buffers(page) PagePrivate(page)
133 133
@@ -188,7 +188,7 @@ extern int buffer_heads_over_limit;
188 * Generic address_space_operations implementations for buffer_head-backed 188 * Generic address_space_operations implementations for buffer_head-backed
189 * address_spaces. 189 * address_spaces.
190 */ 190 */
191int try_to_release_page(struct page * page, int gfp_mask); 191int try_to_release_page(struct page * page, gfp_t gfp_mask);
192int block_invalidatepage(struct page *page, unsigned long offset); 192int block_invalidatepage(struct page *page, unsigned long offset);
193int block_write_full_page(struct page *page, get_block_t *get_block, 193int block_write_full_page(struct page *page, get_block_t *get_block,
194 struct writeback_control *wbc); 194 struct writeback_control *wbc);
@@ -219,7 +219,7 @@ static inline void attach_page_buffers(struct page *page,
219{ 219{
220 page_cache_get(page); 220 page_cache_get(page);
221 SetPagePrivate(page); 221 SetPagePrivate(page);
222 page->private = (unsigned long)head; 222 set_page_private(page, (unsigned long)head);
223} 223}
224 224
225static inline void get_bh(struct buffer_head *bh) 225static inline void get_bh(struct buffer_head *bh)
diff --git a/include/linux/cyclomx.h b/include/linux/cyclomx.h
index 04fa7dff079c..300d704bdb9a 100644
--- a/include/linux/cyclomx.h
+++ b/include/linux/cyclomx.h
@@ -37,8 +37,6 @@
37#include <linux/cycx_x25.h> 37#include <linux/cycx_x25.h>
38#endif 38#endif
39 39
40#define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0)
41
42/* Adapter Data Space. 40/* Adapter Data Space.
43 * This structure is needed because we handle multiple cards, otherwise 41 * This structure is needed because we handle multiple cards, otherwise
44 * static data would do it. 42 * static data would do it.
diff --git a/include/linux/cycx_drv.h b/include/linux/cycx_drv.h
index 6621df86a748..12fe6b0bfcff 100644
--- a/include/linux/cycx_drv.h
+++ b/include/linux/cycx_drv.h
@@ -60,6 +60,5 @@ extern int cycx_peek(struct cycx_hw *hw, u32 addr, void *buf, u32 len);
60extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len); 60extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len);
61extern int cycx_exec(void __iomem *addr); 61extern int cycx_exec(void __iomem *addr);
62 62
63extern void cycx_inten(struct cycx_hw *hw);
64extern void cycx_intr(struct cycx_hw *hw); 63extern void cycx_intr(struct cycx_hw *hw);
65#endif /* _CYCX_DRV_H */ 64#endif /* _CYCX_DRV_H */
diff --git a/include/linux/device.h b/include/linux/device.h
index 95d607a48f06..a9e72ac3fb9f 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -28,19 +28,6 @@
28#define BUS_ID_SIZE KOBJ_NAME_LEN 28#define BUS_ID_SIZE KOBJ_NAME_LEN
29 29
30 30
31enum {
32 SUSPEND_NOTIFY,
33 SUSPEND_SAVE_STATE,
34 SUSPEND_DISABLE,
35 SUSPEND_POWER_DOWN,
36};
37
38enum {
39 RESUME_POWER_ON,
40 RESUME_RESTORE_STATE,
41 RESUME_ENABLE,
42};
43
44struct device; 31struct device;
45struct device_driver; 32struct device_driver;
46struct class; 33struct class;
@@ -115,8 +102,8 @@ struct device_driver {
115 int (*probe) (struct device * dev); 102 int (*probe) (struct device * dev);
116 int (*remove) (struct device * dev); 103 int (*remove) (struct device * dev);
117 void (*shutdown) (struct device * dev); 104 void (*shutdown) (struct device * dev);
118 int (*suspend) (struct device * dev, pm_message_t state, u32 level); 105 int (*suspend) (struct device * dev, pm_message_t state);
119 int (*resume) (struct device * dev, u32 level); 106 int (*resume) (struct device * dev);
120}; 107};
121 108
122 109
@@ -190,7 +177,43 @@ struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store)
190extern int class_create_file(struct class *, const struct class_attribute *); 177extern int class_create_file(struct class *, const struct class_attribute *);
191extern void class_remove_file(struct class *, const struct class_attribute *); 178extern void class_remove_file(struct class *, const struct class_attribute *);
192 179
180struct class_device_attribute {
181 struct attribute attr;
182 ssize_t (*show)(struct class_device *, char * buf);
183 ssize_t (*store)(struct class_device *, const char * buf, size_t count);
184};
185
186#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store) \
187struct class_device_attribute class_device_attr_##_name = \
188 __ATTR(_name,_mode,_show,_store)
189
190extern int class_device_create_file(struct class_device *,
191 const struct class_device_attribute *);
193 192
193/**
194 * struct class_device - class devices
195 * @class: pointer to the parent class for this class device. This is required.
196 * @devt: for internal use by the driver core only.
197 * @node: for internal use by the driver core only.
198 * @kobj: for internal use by the driver core only.
199 * @devt_attr: for internal use by the driver core only.
200 * @dev: if set, a symlink to the struct device is created in the sysfs
201 * directory for this struct class device.
202 * @class_data: pointer to whatever you want to store here for this struct
203 * class_device. Use class_get_devdata() and class_set_devdata() to get and
204 * set this pointer.
205 * @parent: pointer to a struct class_device that is the parent of this struct
206 * class_device. If NULL, this class_device will show up at the root of the
207 * struct class in sysfs (which is probably what you want to have happen.)
208 * @release: pointer to a release function for this struct class_device. If
209 * set, this will be called instead of the class specific release function.
210 * Only use this if you want to override the default release function, like
211 * when you are nesting class_device structures.
212 * @hotplug: pointer to a hotplug function for this struct class_device. If
213 * set, this will be called instead of the class specific hotplug function.
214 * Only use this if you want to override the default hotplug function, like
215 * when you are nesting class_device structures.
216 */
194struct class_device { 217struct class_device {
195 struct list_head node; 218 struct list_head node;
196 219
@@ -198,9 +221,14 @@ struct class_device {
198 struct class * class; /* required */ 221 struct class * class; /* required */
199 dev_t devt; /* dev_t, creates the sysfs "dev" */ 222 dev_t devt; /* dev_t, creates the sysfs "dev" */
200 struct class_device_attribute *devt_attr; 223 struct class_device_attribute *devt_attr;
224 struct class_device_attribute uevent_attr;
201 struct device * dev; /* not necessary, but nice to have */ 225 struct device * dev; /* not necessary, but nice to have */
202 void * class_data; /* class-specific data */ 226 void * class_data; /* class-specific data */
227 struct class_device *parent; /* parent of this child device, if there is one */
203 228
229 void (*release)(struct class_device *dev);
230 int (*hotplug)(struct class_device *dev, char **envp,
231 int num_envp, char *buffer, int buffer_size);
204 char class_id[BUS_ID_SIZE]; /* unique to this class */ 232 char class_id[BUS_ID_SIZE]; /* unique to this class */
205}; 233};
206 234
@@ -228,18 +256,6 @@ extern int class_device_rename(struct class_device *, char *);
228extern struct class_device * class_device_get(struct class_device *); 256extern struct class_device * class_device_get(struct class_device *);
229extern void class_device_put(struct class_device *); 257extern void class_device_put(struct class_device *);
230 258
231struct class_device_attribute {
232 struct attribute attr;
233 ssize_t (*show)(struct class_device *, char * buf);
234 ssize_t (*store)(struct class_device *, const char * buf, size_t count);
235};
236
237#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store) \
238struct class_device_attribute class_device_attr_##_name = \
239 __ATTR(_name,_mode,_show,_store)
240
241extern int class_device_create_file(struct class_device *,
242 const struct class_device_attribute *);
243extern void class_device_remove_file(struct class_device *, 259extern void class_device_remove_file(struct class_device *,
244 const struct class_device_attribute *); 260 const struct class_device_attribute *);
245extern int class_device_create_bin_file(struct class_device *, 261extern int class_device_create_bin_file(struct class_device *,
@@ -251,8 +267,8 @@ struct class_interface {
251 struct list_head node; 267 struct list_head node;
252 struct class *class; 268 struct class *class;
253 269
254 int (*add) (struct class_device *); 270 int (*add) (struct class_device *, struct class_interface *);
255 void (*remove) (struct class_device *); 271 void (*remove) (struct class_device *, struct class_interface *);
256}; 272};
257 273
258extern int class_interface_register(struct class_interface *); 274extern int class_interface_register(struct class_interface *);
@@ -260,12 +276,29 @@ extern void class_interface_unregister(struct class_interface *);
260 276
261extern struct class *class_create(struct module *owner, char *name); 277extern struct class *class_create(struct module *owner, char *name);
262extern void class_destroy(struct class *cls); 278extern void class_destroy(struct class *cls);
263extern struct class_device *class_device_create(struct class *cls, dev_t devt, 279extern struct class_device *class_device_create(struct class *cls,
264 struct device *device, char *fmt, ...) 280 struct class_device *parent,
265 __attribute__((format(printf,4,5))); 281 dev_t devt,
282 struct device *device,
283 char *fmt, ...)
284 __attribute__((format(printf,5,6)));
266extern void class_device_destroy(struct class *cls, dev_t devt); 285extern void class_device_destroy(struct class *cls, dev_t devt);
267 286
268 287
288/* interface for exporting device attributes */
289struct device_attribute {
290 struct attribute attr;
291 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
292 char *buf);
293 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
294 const char *buf, size_t count);
295};
296
297#define DEVICE_ATTR(_name,_mode,_show,_store) \
298struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store)
299
300extern int device_create_file(struct device *device, struct device_attribute * entry);
301extern void device_remove_file(struct device * dev, struct device_attribute * attr);
269struct device { 302struct device {
270 struct klist klist_children; 303 struct klist klist_children;
271 struct klist_node knode_parent; /* node in sibling list */ 304 struct klist_node knode_parent; /* node in sibling list */
@@ -275,6 +308,7 @@ struct device {
275 308
276 struct kobject kobj; 309 struct kobject kobj;
277 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 310 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
311 struct device_attribute uevent_attr;
278 312
279 struct semaphore sem; /* semaphore to synchronize calls to 313 struct semaphore sem; /* semaphore to synchronize calls to
280 * its driver. 314 * its driver.
@@ -343,23 +377,6 @@ extern int device_attach(struct device * dev);
343extern void driver_attach(struct device_driver * drv); 377extern void driver_attach(struct device_driver * drv);
344 378
345 379
346/* driverfs interface for exporting device attributes */
347
348struct device_attribute {
349 struct attribute attr;
350 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
351 char *buf);
352 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
353 const char *buf, size_t count);
354};
355
356#define DEVICE_ATTR(_name,_mode,_show,_store) \
357struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store)
358
359
360extern int device_create_file(struct device *device, struct device_attribute * entry);
361extern void device_remove_file(struct device * dev, struct device_attribute * attr);
362
363/* 380/*
364 * Platform "fixup" functions - allow the platform to have their say 381 * Platform "fixup" functions - allow the platform to have their say
365 * about devices and actions that the general device layer doesn't 382 * about devices and actions that the general device layer doesn't
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index ea6bbc2d7407..a74c27e460ba 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -8,18 +8,17 @@ typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struc
8 8
9typedef void (elevator_merged_fn) (request_queue_t *, struct request *); 9typedef void (elevator_merged_fn) (request_queue_t *, struct request *);
10 10
11typedef struct request *(elevator_next_req_fn) (request_queue_t *); 11typedef int (elevator_dispatch_fn) (request_queue_t *, int);
12 12
13typedef void (elevator_add_req_fn) (request_queue_t *, struct request *, int); 13typedef void (elevator_add_req_fn) (request_queue_t *, struct request *);
14typedef int (elevator_queue_empty_fn) (request_queue_t *); 14typedef int (elevator_queue_empty_fn) (request_queue_t *);
15typedef void (elevator_remove_req_fn) (request_queue_t *, struct request *);
16typedef void (elevator_requeue_req_fn) (request_queue_t *, struct request *);
17typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); 15typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *);
18typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); 16typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
19typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *); 17typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *);
20 18
21typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, int); 19typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, gfp_t);
22typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); 20typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
21typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *);
23typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 22typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
24 23
25typedef int (elevator_init_fn) (request_queue_t *, elevator_t *); 24typedef int (elevator_init_fn) (request_queue_t *, elevator_t *);
@@ -31,10 +30,9 @@ struct elevator_ops
31 elevator_merged_fn *elevator_merged_fn; 30 elevator_merged_fn *elevator_merged_fn;
32 elevator_merge_req_fn *elevator_merge_req_fn; 31 elevator_merge_req_fn *elevator_merge_req_fn;
33 32
34 elevator_next_req_fn *elevator_next_req_fn; 33 elevator_dispatch_fn *elevator_dispatch_fn;
35 elevator_add_req_fn *elevator_add_req_fn; 34 elevator_add_req_fn *elevator_add_req_fn;
36 elevator_remove_req_fn *elevator_remove_req_fn; 35 elevator_activate_req_fn *elevator_activate_req_fn;
37 elevator_requeue_req_fn *elevator_requeue_req_fn;
38 elevator_deactivate_req_fn *elevator_deactivate_req_fn; 36 elevator_deactivate_req_fn *elevator_deactivate_req_fn;
39 37
40 elevator_queue_empty_fn *elevator_queue_empty_fn; 38 elevator_queue_empty_fn *elevator_queue_empty_fn;
@@ -81,15 +79,15 @@ struct elevator_queue
81/* 79/*
82 * block elevator interface 80 * block elevator interface
83 */ 81 */
82extern void elv_dispatch_sort(request_queue_t *, struct request *);
84extern void elv_add_request(request_queue_t *, struct request *, int, int); 83extern void elv_add_request(request_queue_t *, struct request *, int, int);
85extern void __elv_add_request(request_queue_t *, struct request *, int, int); 84extern void __elv_add_request(request_queue_t *, struct request *, int, int);
86extern int elv_merge(request_queue_t *, struct request **, struct bio *); 85extern int elv_merge(request_queue_t *, struct request **, struct bio *);
87extern void elv_merge_requests(request_queue_t *, struct request *, 86extern void elv_merge_requests(request_queue_t *, struct request *,
88 struct request *); 87 struct request *);
89extern void elv_merged_request(request_queue_t *, struct request *); 88extern void elv_merged_request(request_queue_t *, struct request *);
90extern void elv_remove_request(request_queue_t *, struct request *); 89extern void elv_dequeue_request(request_queue_t *, struct request *);
91extern void elv_requeue_request(request_queue_t *, struct request *); 90extern void elv_requeue_request(request_queue_t *, struct request *);
92extern void elv_deactivate_request(request_queue_t *, struct request *);
93extern int elv_queue_empty(request_queue_t *); 91extern int elv_queue_empty(request_queue_t *);
94extern struct request *elv_next_request(struct request_queue *q); 92extern struct request *elv_next_request(struct request_queue *q);
95extern struct request *elv_former_request(request_queue_t *, struct request *); 93extern struct request *elv_former_request(request_queue_t *, struct request *);
@@ -98,7 +96,7 @@ extern int elv_register_queue(request_queue_t *q);
98extern void elv_unregister_queue(request_queue_t *q); 96extern void elv_unregister_queue(request_queue_t *q);
99extern int elv_may_queue(request_queue_t *, int, struct bio *); 97extern int elv_may_queue(request_queue_t *, int, struct bio *);
100extern void elv_completed_request(request_queue_t *, struct request *); 98extern void elv_completed_request(request_queue_t *, struct request *);
101extern int elv_set_request(request_queue_t *, struct request *, struct bio *, int); 99extern int elv_set_request(request_queue_t *, struct request *, struct bio *, gfp_t);
102extern void elv_put_request(request_queue_t *, struct request *); 100extern void elv_put_request(request_queue_t *, struct request *);
103 101
104/* 102/*
@@ -142,4 +140,6 @@ enum {
142 ELV_MQUEUE_MUST, 140 ELV_MQUEUE_MUST,
143}; 141};
144 142
143#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors)
144
145#endif 145#endif
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 4522c7186bf3..cc84934f9059 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -104,6 +104,22 @@ static inline void random_ether_addr(u8 *addr)
104 addr [0] &= 0xfe; /* clear multicast bit */ 104 addr [0] &= 0xfe; /* clear multicast bit */
105 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ 105 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
106} 106}
107
108/**
109 * compare_ether_addr - Compare two Ethernet addresses
110 * @addr1: Pointer to a six-byte array containing the Ethernet address
111 * @addr2 Pointer other six-byte array containing the Ethernet address
112 *
113 * Compare two ethernet addresses, returns 0 if equal
114 */
115static inline unsigned compare_ether_addr(const u8 *_a, const u8 *_b)
116{
117 const u16 *a = (const u16 *) _a;
118 const u16 *b = (const u16 *) _b;
119
120 BUILD_BUG_ON(ETH_ALEN != 6);
121 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
122}
107#endif /* __KERNEL__ */ 123#endif /* __KERNEL__ */
108 124
109#endif /* _LINUX_ETHERDEVICE_H */ 125#endif /* _LINUX_ETHERDEVICE_H */
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index ed1440ea4c91..d2c390eff1b2 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -269,6 +269,8 @@ u32 ethtool_op_get_tso(struct net_device *dev);
269int ethtool_op_set_tso(struct net_device *dev, u32 data); 269int ethtool_op_set_tso(struct net_device *dev, u32 data);
270int ethtool_op_get_perm_addr(struct net_device *dev, 270int ethtool_op_get_perm_addr(struct net_device *dev,
271 struct ethtool_perm_addr *addr, u8 *data); 271 struct ethtool_perm_addr *addr, u8 *data);
272u32 ethtool_op_get_ufo(struct net_device *dev);
273int ethtool_op_set_ufo(struct net_device *dev, u32 data);
272 274
273/** 275/**
274 * &ethtool_ops - Alter and report network device settings 276 * &ethtool_ops - Alter and report network device settings
@@ -298,6 +300,8 @@ int ethtool_op_get_perm_addr(struct net_device *dev,
298 * set_sg: Turn scatter-gather on or off 300 * set_sg: Turn scatter-gather on or off
299 * get_tso: Report whether TCP segmentation offload is enabled 301 * get_tso: Report whether TCP segmentation offload is enabled
300 * set_tso: Turn TCP segmentation offload on or off 302 * set_tso: Turn TCP segmentation offload on or off
303 * get_ufo: Report whether UDP fragmentation offload is enabled
304 * set_ufo: Turn UDP fragmentation offload on or off
301 * self_test: Run specified self-tests 305 * self_test: Run specified self-tests
302 * get_strings: Return a set of strings that describe the requested objects 306 * get_strings: Return a set of strings that describe the requested objects
303 * phys_id: Identify the device 307 * phys_id: Identify the device
@@ -364,6 +368,8 @@ struct ethtool_ops {
364 int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *); 368 int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *);
365 int (*begin)(struct net_device *); 369 int (*begin)(struct net_device *);
366 void (*complete)(struct net_device *); 370 void (*complete)(struct net_device *);
371 u32 (*get_ufo)(struct net_device *);
372 int (*set_ufo)(struct net_device *, u32);
367}; 373};
368 374
369/* CMDs currently supported */ 375/* CMDs currently supported */
@@ -400,6 +406,8 @@ struct ethtool_ops {
400#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ 406#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
401#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ 407#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
402#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ 408#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
409#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
410#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
403 411
404/* compatibility with older code */ 412/* compatibility with older code */
405#define SPARC_ETH_GSET ETHTOOL_GSET 413#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/include/linux/fs.h b/include/linux/fs.h
index e0b77c5af9a0..f83d997c5582 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -320,7 +320,7 @@ struct address_space_operations {
320 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ 320 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */
321 sector_t (*bmap)(struct address_space *, sector_t); 321 sector_t (*bmap)(struct address_space *, sector_t);
322 int (*invalidatepage) (struct page *, unsigned long); 322 int (*invalidatepage) (struct page *, unsigned long);
323 int (*releasepage) (struct page *, int); 323 int (*releasepage) (struct page *, gfp_t);
324 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, 324 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
325 loff_t offset, unsigned long nr_segs); 325 loff_t offset, unsigned long nr_segs);
326 struct page* (*get_xip_page)(struct address_space *, sector_t, 326 struct page* (*get_xip_page)(struct address_space *, sector_t,
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
new file mode 100644
index 000000000000..bef23bbf8690
--- /dev/null
+++ b/include/linux/fs_enet_pd.h
@@ -0,0 +1,136 @@
1/*
2 * Platform information definitions for the
3 * universal Freescale Ethernet driver.
4 *
5 * Copyright (c) 2003 Intracom S.A.
6 * by Pantelis Antoniou <panto@intracom.gr>
7 *
8 * 2005 (c) MontaVista Software, Inc.
9 * Vitaly Bordug <vbordug@ru.mvista.com>
10 *
11 * This file is licensed under the terms of the GNU General Public License
12 * version 2. This program is licensed "as is" without any warranty of any
13 * kind, whether express or implied.
14 */
15
16#ifndef FS_ENET_PD_H
17#define FS_ENET_PD_H
18
19#include <linux/version.h>
20#include <asm/types.h>
21
22#define FS_ENET_NAME "fs_enet"
23
24enum fs_id {
25 fsid_fec1,
26 fsid_fec2,
27 fsid_fcc1,
28 fsid_fcc2,
29 fsid_fcc3,
30 fsid_scc1,
31 fsid_scc2,
32 fsid_scc3,
33 fsid_scc4,
34};
35
36#define FS_MAX_INDEX 9
37
38static inline int fs_get_fec_index(enum fs_id id)
39{
40 if (id >= fsid_fec1 && id <= fsid_fec2)
41 return id - fsid_fec1;
42 return -1;
43}
44
45static inline int fs_get_fcc_index(enum fs_id id)
46{
47 if (id >= fsid_fcc1 && id <= fsid_fcc3)
48 return id - fsid_fcc1;
49 return -1;
50}
51
52static inline int fs_get_scc_index(enum fs_id id)
53{
54 if (id >= fsid_scc1 && id <= fsid_scc4)
55 return id - fsid_scc1;
56 return -1;
57}
58
59enum fs_mii_method {
60 fsmii_fixed,
61 fsmii_fec,
62 fsmii_bitbang,
63};
64
65enum fs_ioport {
66 fsiop_porta,
67 fsiop_portb,
68 fsiop_portc,
69 fsiop_portd,
70 fsiop_porte,
71};
72
73struct fs_mii_bus_info {
74 int method; /* mii method */
75 int id; /* the id of the mii_bus */
76 int disable_aneg; /* if the controller needs to negothiate speed & duplex */
77 int lpa; /* the default board-specific vallues will be applied otherwise */
78
79 union {
80 struct {
81 int duplex;
82 int speed;
83 } fixed;
84
85 struct {
86 /* nothing */
87 } fec;
88
89 struct {
90 /* nothing */
91 } scc;
92
93 struct {
94 int mdio_port; /* port & bit for MDIO */
95 int mdio_bit;
96 int mdc_port; /* port & bit for MDC */
97 int mdc_bit;
98 int delay; /* delay in us */
99 } bitbang;
100 } i;
101};
102
103struct fs_platform_info {
104
105 void(*init_ioports)(void);
106 /* device specific information */
107 int fs_no; /* controller index */
108
109 u32 cp_page; /* CPM page */
110 u32 cp_block; /* CPM sblock */
111
112 u32 clk_trx; /* some stuff for pins & mux configuration*/
113 u32 clk_route;
114 u32 clk_mask;
115
116 u32 mem_offset;
117 u32 dpram_offset;
118 u32 fcc_regs_c;
119
120 u32 device_flags;
121
122 int phy_addr; /* the phy address (-1 no phy) */
123 int phy_irq; /* the phy irq (if it exists) */
124
125 const struct fs_mii_bus_info *bus_info;
126
127 int rx_ring, tx_ring; /* number of buffers on rx */
128 __u8 macaddr[6]; /* mac address */
129 int rx_copybreak; /* limit we copy small frames */
130 int use_napi; /* use NAPI */
131 int napi_weight; /* NAPI weight */
132
133 int use_rmii; /* use RMII mode */
134};
135
136#endif
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 01796c41c951..eabdb5cce357 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -119,7 +119,7 @@ struct gendisk {
119 int policy; 119 int policy;
120 120
121 atomic_t sync_io; /* RAID */ 121 atomic_t sync_io; /* RAID */
122 unsigned long stamp, stamp_idle; 122 unsigned long stamp;
123 int in_flight; 123 int in_flight;
124#ifdef CONFIG_SMP 124#ifdef CONFIG_SMP
125 struct disk_stats *dkstats; 125 struct disk_stats *dkstats;
@@ -132,6 +132,7 @@ struct gendisk {
132struct disk_attribute { 132struct disk_attribute {
133 struct attribute attr; 133 struct attribute attr;
134 ssize_t (*show)(struct gendisk *, char *); 134 ssize_t (*show)(struct gendisk *, char *);
135 ssize_t (*store)(struct gendisk *, const char *, size_t);
135}; 136};
136 137
137/* 138/*
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 3010e172394d..c3779432a723 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -12,8 +12,8 @@ struct vm_area_struct;
12 * GFP bitmasks.. 12 * GFP bitmasks..
13 */ 13 */
14/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ 14/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */
15#define __GFP_DMA 0x01u 15#define __GFP_DMA ((__force gfp_t)0x01u)
16#define __GFP_HIGHMEM 0x02u 16#define __GFP_HIGHMEM ((__force gfp_t)0x02u)
17 17
18/* 18/*
19 * Action modifiers - doesn't change the zoning 19 * Action modifiers - doesn't change the zoning
@@ -26,24 +26,24 @@ struct vm_area_struct;
26 * 26 *
27 * __GFP_NORETRY: The VM implementation must not retry indefinitely. 27 * __GFP_NORETRY: The VM implementation must not retry indefinitely.
28 */ 28 */
29#define __GFP_WAIT 0x10u /* Can wait and reschedule? */ 29#define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */
30#define __GFP_HIGH 0x20u /* Should access emergency pools? */ 30#define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */
31#define __GFP_IO 0x40u /* Can start physical IO? */ 31#define __GFP_IO ((__force gfp_t)0x40u) /* Can start physical IO? */
32#define __GFP_FS 0x80u /* Can call down to low-level FS? */ 32#define __GFP_FS ((__force gfp_t)0x80u) /* Can call down to low-level FS? */
33#define __GFP_COLD 0x100u /* Cache-cold page required */ 33#define __GFP_COLD ((__force gfp_t)0x100u) /* Cache-cold page required */
34#define __GFP_NOWARN 0x200u /* Suppress page allocation failure warning */ 34#define __GFP_NOWARN ((__force gfp_t)0x200u) /* Suppress page allocation failure warning */
35#define __GFP_REPEAT 0x400u /* Retry the allocation. Might fail */ 35#define __GFP_REPEAT ((__force gfp_t)0x400u) /* Retry the allocation. Might fail */
36#define __GFP_NOFAIL 0x800u /* Retry for ever. Cannot fail */ 36#define __GFP_NOFAIL ((__force gfp_t)0x800u) /* Retry for ever. Cannot fail */
37#define __GFP_NORETRY 0x1000u /* Do not retry. Might fail */ 37#define __GFP_NORETRY ((__force gfp_t)0x1000u)/* Do not retry. Might fail */
38#define __GFP_NO_GROW 0x2000u /* Slab internal usage */ 38#define __GFP_NO_GROW ((__force gfp_t)0x2000u)/* Slab internal usage */
39#define __GFP_COMP 0x4000u /* Add compound page metadata */ 39#define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */
40#define __GFP_ZERO 0x8000u /* Return zeroed page on success */ 40#define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */
41#define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ 41#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */
42#define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */ 42#define __GFP_NORECLAIM ((__force gfp_t)0x20000u) /* No realy zone reclaim during allocation */
43#define __GFP_HARDWALL 0x40000u /* Enforce hardwall cpuset memory allocs */ 43#define __GFP_HARDWALL ((__force gfp_t)0x40000u) /* Enforce hardwall cpuset memory allocs */
44 44
45#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ 45#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */
46#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) 46#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
47 47
48/* if you forget to add the bitmask here kernel will crash, period */ 48/* if you forget to add the bitmask here kernel will crash, period */
49#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ 49#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
@@ -64,6 +64,7 @@ struct vm_area_struct;
64 64
65#define GFP_DMA __GFP_DMA 65#define GFP_DMA __GFP_DMA
66 66
67#define gfp_zone(mask) ((__force int)((mask) & (__force gfp_t)GFP_ZONEMASK))
67 68
68/* 69/*
69 * There is only one page-allocator function, and two main namespaces to 70 * There is only one page-allocator function, and two main namespaces to
@@ -94,7 +95,7 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
94 return NULL; 95 return NULL;
95 96
96 return __alloc_pages(gfp_mask, order, 97 return __alloc_pages(gfp_mask, order,
97 NODE_DATA(nid)->node_zonelists + (gfp_mask & GFP_ZONEMASK)); 98 NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask));
98} 99}
99 100
100#ifdef CONFIG_NUMA 101#ifdef CONFIG_NUMA
diff --git a/include/linux/hil.h b/include/linux/hil.h
new file mode 100644
index 000000000000..13352d7d0caf
--- /dev/null
+++ b/include/linux/hil.h
@@ -0,0 +1,483 @@
1#ifndef _HIL_H_
2#define _HIL_H_
3
4/*
5 * Hewlett Packard Human Interface Loop (HP-HIL) Protocol -- header.
6 *
7 * Copyright (c) 2001 Brian S. Julin
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions, and the following disclaimer,
15 * without modification.
16 * 2. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
18 *
19 * Alternatively, this software may be distributed under the terms of the
20 * GNU General Public License ("GPL").
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
26 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 *
32 * References:
33 * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A
34 *
35 * A note of thanks to HP for providing and shipping reference materials
36 * free of charge to help in the development of HIL support for Linux.
37 *
38 */
39
40#include <asm/types.h>
41
42/* Physical constants relevant to raw loop/device timing.
43 */
44
45#define HIL_CLOCK 8MHZ
46#define HIL_EK1_CLOCK 30HZ
47#define HIL_EK2_CLOCK 60HZ
48
49#define HIL_TIMEOUT_DEV 5 /* ms */
50#define HIL_TIMEOUT_DEVS 10 /* ms */
51#define HIL_TIMEOUT_NORESP 10 /* ms */
52#define HIL_TIMEOUT_DEVS_DATA 16 /* ms */
53#define HIL_TIMEOUT_SELFTEST 200 /* ms */
54
55
56/* Actual wire line coding. These will only be useful if someone is
57 * implementing a software MLC to run HIL devices on a non-parisc machine.
58 */
59
60#define HIL_WIRE_PACKET_LEN 15
61enum hil_wire_bitpos {
62 HIL_WIRE_START = 0,
63 HIL_WIRE_ADDR2,
64 HIL_WIRE_ADDR1,
65 HIL_WIRE_ADDR0,
66 HIL_WIRE_COMMAND,
67 HIL_WIRE_DATA7,
68 HIL_WIRE_DATA6,
69 HIL_WIRE_DATA5,
70 HIL_WIRE_DATA4,
71 HIL_WIRE_DATA3,
72 HIL_WIRE_DATA2,
73 HIL_WIRE_DATA1,
74 HIL_WIRE_DATA0,
75 HIL_WIRE_PARITY,
76 HIL_WIRE_STOP
77};
78
79/* HP documentation uses these bit positions to refer to commands;
80 * we will call these "packets".
81 */
82enum hil_pkt_bitpos {
83 HIL_PKT_CMD = 0x00000800,
84 HIL_PKT_ADDR2 = 0x00000400,
85 HIL_PKT_ADDR1 = 0x00000200,
86 HIL_PKT_ADDR0 = 0x00000100,
87 HIL_PKT_ADDR_MASK = 0x00000700,
88 HIL_PKT_ADDR_SHIFT = 8,
89 HIL_PKT_DATA7 = 0x00000080,
90 HIL_PKT_DATA6 = 0x00000040,
91 HIL_PKT_DATA5 = 0x00000020,
92 HIL_PKT_DATA4 = 0x00000010,
93 HIL_PKT_DATA3 = 0x00000008,
94 HIL_PKT_DATA2 = 0x00000004,
95 HIL_PKT_DATA1 = 0x00000002,
96 HIL_PKT_DATA0 = 0x00000001,
97 HIL_PKT_DATA_MASK = 0x000000FF,
98 HIL_PKT_DATA_SHIFT = 0
99};
100
101/* The HIL MLC also has several error/status/control bits. We extend the
102 * "packet" to include these when direct access to the MLC is available,
103 * or emulate them in cases where they are not available.
104 *
105 * This way the device driver knows that the underlying MLC driver
106 * has had to deal with loop errors.
107 */
108enum hil_error_bitpos {
109 HIL_ERR_OB = 0x00000800, /* MLC is busy sending an auto-poll,
110 or we have filled up the output
111 buffer and must wait. */
112 HIL_ERR_INT = 0x00010000, /* A normal interrupt has occurred. */
113 HIL_ERR_NMI = 0x00020000, /* An NMI has occurred. */
114 HIL_ERR_LERR = 0x00040000, /* A poll didn't come back. */
115 HIL_ERR_PERR = 0x01000000, /* There was a Parity Error. */
116 HIL_ERR_FERR = 0x02000000, /* There was a Framing Error. */
117 HIL_ERR_FOF = 0x04000000 /* Input FIFO Overflowed. */
118};
119
120enum hil_control_bitpos {
121 HIL_CTRL_TEST = 0x00010000,
122 HIL_CTRL_IPF = 0x00040000,
123 HIL_CTRL_APE = 0x02000000
124};
125
126/* Bits 30,31 are unused, we use them to control write behavior. */
127#define HIL_DO_ALTER_CTRL 0x40000000 /* Write MSW of packet to control
128 before writing LSW to loop */
129#define HIL_CTRL_ONLY 0xc0000000 /* *Only* alter the control registers */
130
131/* This gives us a 32-bit "packet"
132 */
133typedef u32 hil_packet;
134
135
136/* HIL Loop commands
137 */
138enum hil_command {
139 HIL_CMD_IFC = 0x00, /* Interface Clear */
140 HIL_CMD_EPT = 0x01, /* Enter Pass-Thru Mode */
141 HIL_CMD_ELB = 0x02, /* Enter Loop-Back Mode */
142 HIL_CMD_IDD = 0x03, /* Identify and Describe */
143 HIL_CMD_DSR = 0x04, /* Device Soft Reset */
144 HIL_CMD_PST = 0x05, /* Perform Self Test */
145 HIL_CMD_RRG = 0x06, /* Read Register */
146 HIL_CMD_WRG = 0x07, /* Write Register */
147 HIL_CMD_ACF = 0x08, /* Auto Configure */
148 HIL_CMDID_ACF = 0x07, /* Auto Configure bits with incremented ID */
149 HIL_CMD_POL = 0x10, /* Poll */
150 HIL_CMDCT_POL = 0x0f, /* Poll command bits with item count */
151 HIL_CMD_RPL = 0x20, /* RePoll */
152 HIL_CMDCT_RPL = 0x0f, /* RePoll command bits with item count */
153 HIL_CMD_RNM = 0x30, /* Report Name */
154 HIL_CMD_RST = 0x31, /* Report Status */
155 HIL_CMD_EXD = 0x32, /* Extended Describe */
156 HIL_CMD_RSC = 0x33, /* Report Security Code */
157
158 /* 0x34 to 0x3c reserved for future use */
159
160 HIL_CMD_DKA = 0x3d, /* Disable Keyswitch Autorepeat */
161 HIL_CMD_EK1 = 0x3e, /* Enable Keyswitch Autorepeat 1 */
162 HIL_CMD_EK2 = 0x3f, /* Enable Keyswitch Autorepeat 2 */
163 HIL_CMD_PR1 = 0x40, /* Prompt1 */
164 HIL_CMD_PR2 = 0x41, /* Prompt2 */
165 HIL_CMD_PR3 = 0x42, /* Prompt3 */
166 HIL_CMD_PR4 = 0x43, /* Prompt4 */
167 HIL_CMD_PR5 = 0x44, /* Prompt5 */
168 HIL_CMD_PR6 = 0x45, /* Prompt6 */
169 HIL_CMD_PR7 = 0x46, /* Prompt7 */
170 HIL_CMD_PRM = 0x47, /* Prompt (General Purpose) */
171 HIL_CMD_AK1 = 0x48, /* Acknowlege1 */
172 HIL_CMD_AK2 = 0x49, /* Acknowlege2 */
173 HIL_CMD_AK3 = 0x4a, /* Acknowlege3 */
174 HIL_CMD_AK4 = 0x4b, /* Acknowlege4 */
175 HIL_CMD_AK5 = 0x4c, /* Acknowlege5 */
176 HIL_CMD_AK6 = 0x4d, /* Acknowlege6 */
177 HIL_CMD_AK7 = 0x4e, /* Acknowlege7 */
178 HIL_CMD_ACK = 0x4f, /* Acknowlege (General Purpose) */
179
180 /* 0x50 to 0x78 reserved for future use */
181 /* 0x80 to 0xEF device-specific commands */
182 /* 0xf0 to 0xf9 reserved for future use */
183
184 HIL_CMD_RIO = 0xfa, /* Register I/O Error */
185 HIL_CMD_SHR = 0xfb, /* System Hard Reset */
186 HIL_CMD_TER = 0xfc, /* Transmission Error */
187 HIL_CMD_CAE = 0xfd, /* Configuration Address Error */
188 HIL_CMD_DHR = 0xfe, /* Device Hard Reset */
189
190 /* 0xff is prohibited from use. */
191};
192
193
194/*
195 * Response "records" to HIL commands
196 */
197
198/* Device ID byte
199 */
200#define HIL_IDD_DID_TYPE_MASK 0xe0 /* Primary type bits */
201#define HIL_IDD_DID_TYPE_KB_INTEGRAL 0xa0 /* Integral keyboard */
202#define HIL_IDD_DID_TYPE_KB_ITF 0xc0 /* ITD keyboard */
203#define HIL_IDD_DID_TYPE_KB_RSVD 0xe0 /* Reserved keyboard type */
204#define HIL_IDD_DID_TYPE_KB_LANG_MASK 0x1f /* Keyboard locale bits */
205#define HIL_IDD_DID_KBLANG_USE_ESD 0x00 /* Use ESD Locale instead */
206#define HIL_IDD_DID_TYPE_ABS 0x80 /* Absolute Positioners */
207#define HIL_IDD_DID_ABS_RSVD1_MASK 0xf8 /* Reserved */
208#define HIL_IDD_DID_ABS_RSVD1 0x98
209#define HIL_IDD_DID_ABS_TABLET_MASK 0xf8 /* Tablets and digitizers */
210#define HIL_IDD_DID_ABS_TABLET 0x90
211#define HIL_IDD_DID_ABS_TSCREEN_MASK 0xfc /* Touch screens */
212#define HIL_IDD_DID_ABS_TSCREEN 0x8c
213#define HIL_IDD_DID_ABS_RSVD2_MASK 0xfc /* Reserved */
214#define HIL_IDD_DID_ABS_RSVD2 0x88
215#define HIL_IDD_DID_ABS_RSVD3_MASK 0xfc /* Reserved */
216#define HIL_IDD_DID_ABS_RSVD3 0x80
217#define HIL_IDD_DID_TYPE_REL 0x60 /* Relative Positioners */
218#define HIL_IDD_DID_REL_RSVD1_MASK 0xf0 /* Reserved */
219#define HIL_IDD_DID_REL_RSVD1 0x70
220#define HIL_IDD_DID_REL_RSVD2_MASK 0xfc /* Reserved */
221#define HIL_IDD_DID_REL_RSVD2 0x6c
222#define HIL_IDD_DID_REL_MOUSE_MASK 0xfc /* Mouse */
223#define HIL_IDD_DID_REL_MOUSE 0x68
224#define HIL_IDD_DID_REL_QUAD_MASK 0xf8 /* Other Quadrature Devices */
225#define HIL_IDD_DID_REL_QUAD 0x60
226#define HIL_IDD_DID_TYPE_CHAR 0x40 /* Character Entry */
227#define HIL_IDD_DID_CHAR_BARCODE_MASK 0xfc /* Barcode Reader */
228#define HIL_IDD_DID_CHAR_BARCODE 0x5c
229#define HIL_IDD_DID_CHAR_RSVD1_MASK 0xfc /* Reserved */
230#define HIL_IDD_DID_CHAR_RSVD1 0x58
231#define HIL_IDD_DID_CHAR_RSVD2_MASK 0xf8 /* Reserved */
232#define HIL_IDD_DID_CHAR_RSVD2 0x50
233#define HIL_IDD_DID_CHAR_RSVD3_MASK 0xf0 /* Reserved */
234#define HIL_IDD_DID_CHAR_RSVD3 0x40
235#define HIL_IDD_DID_TYPE_OTHER 0x20 /* Miscellaneous */
236#define HIL_IDD_DID_OTHER_RSVD1_MASK 0xf0 /* Reserved */
237#define HIL_IDD_DID_OTHER_RSVD1 0x30
238#define HIL_IDD_DID_OTHER_BARCODE_MASK 0xfc /* Tone Generator */
239#define HIL_IDD_DID_OTHER_BARCODE 0x2c
240#define HIL_IDD_DID_OTHER_RSVD2_MASK 0xfc /* Reserved */
241#define HIL_IDD_DID_OTHER_RSVD2 0x28
242#define HIL_IDD_DID_OTHER_RSVD3_MASK 0xf8 /* Reserved */
243#define HIL_IDD_DID_OTHER_RSVD3 0x20
244#define HIL_IDD_DID_TYPE_KEYPAD 0x00 /* Vectra Keyboard */
245
246/* IDD record header
247 */
248#define HIL_IDD_HEADER_AXSET_MASK 0x03 /* Number of axis in a set */
249#define HIL_IDD_HEADER_RSC 0x04 /* Supports RSC command */
250#define HIL_IDD_HEADER_EXD 0x08 /* Supports EXD command */
251#define HIL_IDD_HEADER_IOD 0x10 /* IOD byte to follow */
252#define HIL_IDD_HEADER_16BIT 0x20 /* 16 (vs. 8) bit resolution */
253#define HIL_IDD_HEADER_ABS 0x40 /* Reports Absolute Position */
254#define HIL_IDD_HEADER_2X_AXIS 0x80 /* Two sets of 1-3 axis */
255
256/* I/O Descriptor
257 */
258#define HIL_IDD_IOD_NBUTTON_MASK 0x07 /* Number of buttons */
259#define HIL_IDD_IOD_PROXIMITY 0x08 /* Proximity in/out events */
260#define HIL_IDD_IOD_PROMPT_MASK 0x70 /* Number of prompts/acks */
261#define HIL_IDD_IOD_PROMPT_SHIFT 4
262#define HIL_IDD_IOD_PROMPT 0x80 /* Generic prompt/ack */
263
264#define HIL_IDD_NUM_AXES_PER_SET(header_packet) \
265((header_packet) & HIL_IDD_HEADER_AXSET_MASK)
266
267#define HIL_IDD_NUM_AXSETS(header_packet) \
268(2 - !((header_packet) & HIL_IDD_HEADER_2X_AXIS))
269
270#define HIL_IDD_LEN(header_packet) \
271((4 - !(header_packet & HIL_IDD_HEADER_IOD) - \
272 2 * !(HIL_IDD_NUM_AXES_PER_SET(header_packet))) + \
273 2 * HIL_IDD_NUM_AXES_PER_SET(header_packet) * \
274 !!((header_packet) & HIL_IDD_HEADER_ABS))
275
276/* The following HIL_IDD_* macros assume you have an array of
277 * packets and/or unpacked 8-bit data in the order that they
278 * were received.
279 */
280
281#define HIL_IDD_AXIS_COUNTS_PER_M(header_ptr) \
282(!(HIL_IDD_NUM_AXSETS(*(header_ptr))) ? -1 : \
283(((*(header_ptr + 1) & HIL_PKT_DATA_MASK) + \
284 ((*(header_ptr + 2) & HIL_PKT_DATA_MASK)) << 8) \
285* ((*(header_ptr) & HIL_IDD_HEADER_16BIT) ? 100 : 1)))
286
287#define HIL_IDD_AXIS_MAX(header_ptr, __axnum) \
288((!(*(header_ptr) & HIL_IDD_HEADER_ABS) || \
289 (HIL_IDD_NUM_AXES_PER_SET(*(header_ptr)) <= __axnum)) ? 0 : \
290 ((HIL_PKT_DATA_MASK & *((header_ptr) + 3 + 2 * __axnum)) + \
291 ((HIL_PKT_DATA_MASK & *((header_ptr) + 4 + 2 * __axnum)) << 8)))
292
293#define HIL_IDD_IOD(header_ptr) \
294(*(header_ptr + HIL_IDD_LEN((*header_ptr)) - 1))
295
296#define HIL_IDD_HAS_GEN_PROMPT(header_ptr) \
297((*header_ptr & HIL_IDD_HEADER_IOD) && \
298 (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROMPT))
299
300#define HIL_IDD_HAS_GEN_PROXIMITY(header_ptr) \
301((*header_ptr & HIL_IDD_HEADER_IOD) && \
302 (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROXIMITY))
303
304#define HIL_IDD_NUM_BUTTONS(header_ptr) \
305((*header_ptr & HIL_IDD_HEADER_IOD) ? \
306 (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NBUTTON_MASK) : 0)
307
308#define HIL_IDD_NUM_PROMPTS(header_ptr) \
309((*header_ptr & HIL_IDD_HEADER_IOD) ? \
310 ((HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NPROMPT_MASK) \
311 >> HIL_IDD_IOD_PROMPT_SHIFT) : 0)
312
313/* The response to HIL EXD commands -- the "extended describe record" */
314#define HIL_EXD_HEADER_WRG 0x03 /* Supports type2 WRG */
315#define HIL_EXD_HEADER_WRG_TYPE1 0x01 /* Supports type1 WRG */
316#define HIL_EXD_HEADER_WRG_TYPE2 0x02 /* Supports type2 WRG */
317#define HIL_EXD_HEADER_RRG 0x04 /* Supports RRG command */
318#define HIL_EXD_HEADER_RNM 0x10 /* Supports RNM command */
319#define HIL_EXD_HEADER_RST 0x20 /* Supports RST command */
320#define HIL_EXD_HEADER_LOCALE 0x40 /* Contains locale code */
321
322#define HIL_EXD_NUM_RRG(header_ptr) \
323((*header_ptr & HIL_EXD_HEADER_RRG) ? \
324 (*(header_ptr + 1) & HIL_PKT_DATA_MASK) : 0)
325
326#define HIL_EXD_NUM_WWG(header_ptr) \
327((*header_ptr & HIL_EXD_HEADER_WRG) ? \
328 (*(header_ptr + 2 - !(*header_ptr & HIL_EXD_HEADER_RRG)) & \
329 HIL_PKT_DATA_MASK) : 0)
330
331#define HIL_EXD_LEN(header_ptr) \
332(!!(*header_ptr & HIL_EXD_HEADER_RRG) + \
333 !!(*header_ptr & HIL_EXD_HEADER_WRG) + \
334 !!(*header_ptr & HIL_EXD_HEADER_LOCALE) + \
335 2 * !!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) + 1)
336
337#define HIL_EXD_LOCALE(header_ptr) \
338(!(*header_ptr & HIL_EXD_HEADER_LOCALE) ? -1 : \
339 (*(header_ptr + HIL_EXD_LEN(header_ptr) - 1) & HIL_PKT_DATA_MASK))
340
341#define HIL_EXD_WRG_TYPE2_LEN(header_ptr) \
342(!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) ? -1 : \
343 (*(header_ptr + HIL_EXD_LEN(header_ptr) - 2 - \
344 !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) + \
345 ((*(header_ptr + HIL_EXD_LEN(header_ptr) - 1 - \
346 !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) << 8))
347
348/* Device locale codes. */
349
350/* Last defined locale code. Everything above this is "Reserved",
351 and note that this same table applies to the Device ID Byte where
352 keyboards may have a nationality code which is only 5 bits. */
353#define HIL_LOCALE_MAX 0x1f
354
355/* Map to hopefully useful strings. I was trying to make these look
356 like locale.aliases strings do; maybe that isn't the right table to
357 emulate. In either case, I didn't have much to work on. */
358#define HIL_LOCALE_MAP \
359"", /* 0x00 Reserved */ \
360"", /* 0x01 Reserved */ \
361"", /* 0x02 Reserved */ \
362"swiss.french", /* 0x03 Swiss/French */ \
363"portuguese", /* 0x04 Portuguese */ \
364"arabic", /* 0x05 Arabic */ \
365"hebrew", /* 0x06 Hebrew */ \
366"english.canadian", /* 0x07 Canadian English */ \
367"turkish", /* 0x08 Turkish */ \
368"greek", /* 0x09 Greek */ \
369"thai", /* 0x0a Thai (Thailand) */ \
370"italian", /* 0x0b Italian */ \
371"korean", /* 0x0c Hangul (Korea) */ \
372"dutch", /* 0x0d Dutch */ \
373"swedish", /* 0x0e Swedish */ \
374"german", /* 0x0f German */ \
375"chinese", /* 0x10 Chinese-PRC */ \
376"chinese", /* 0x11 Chinese-ROC */ \
377"swiss.french", /* 0x12 Swiss/French II */ \
378"spanish", /* 0x13 Spanish */ \
379"swiss.german", /* 0x14 Swiss/German II */ \
380"flemish", /* 0x15 Belgian (Flemish) */ \
381"finnish", /* 0x16 Finnish */ \
382"english.uk", /* 0x17 United Kingdom */ \
383"french.canadian", /* 0x18 French/Canadian */ \
384"swiss.german", /* 0x19 Swiss/German */ \
385"norwegian", /* 0x1a Norwegian */ \
386"french", /* 0x1b French */ \
387"danish", /* 0x1c Danish */ \
388"japanese", /* 0x1d Katakana */ \
389"spanish", /* 0x1e Latin American/Spanish*/\
390"english.us" /* 0x1f United States */ \
391
392
393/* HIL keycodes */
394#define HIL_KEYCODES_SET1_TBLSIZE 128
395#define HIL_KEYCODES_SET1 \
396 KEY_5, KEY_RESERVED, KEY_RIGHTALT, KEY_LEFTALT, \
397 KEY_RIGHTSHIFT, KEY_LEFTSHIFT, KEY_LEFTCTRL, KEY_SYSRQ, \
398 KEY_KP4, KEY_KP8, KEY_KP5, KEY_KP9, \
399 KEY_KP6, KEY_KP7, KEY_KPCOMMA, KEY_KPENTER, \
400 KEY_KP1, KEY_KPSLASH, KEY_KP2, KEY_KPPLUS, \
401 KEY_KP3, KEY_KPASTERISK, KEY_KP0, KEY_KPMINUS, \
402 KEY_B, KEY_V, KEY_C, KEY_X, \
403 KEY_Z, KEY_RESERVED, KEY_RESERVED, KEY_ESC, \
404 KEY_6, KEY_F10, KEY_3, KEY_F11, \
405 KEY_KPDOT, KEY_F9, KEY_TAB /*KP*/, KEY_F12, \
406 KEY_H, KEY_G, KEY_F, KEY_D, \
407 KEY_S, KEY_A, KEY_RESERVED, KEY_CAPSLOCK, \
408 KEY_U, KEY_Y, KEY_T, KEY_R, \
409 KEY_E, KEY_W, KEY_Q, KEY_TAB, \
410 KEY_7, KEY_6, KEY_5, KEY_4, \
411 KEY_3, KEY_2, KEY_1, KEY_GRAVE, \
412 KEY_F13, KEY_F14, KEY_F15, KEY_F16, \
413 KEY_F17, KEY_F18, KEY_F19, KEY_F20, \
414 KEY_MENU, KEY_F4, KEY_F3, KEY_F2, \
415 KEY_F1, KEY_VOLUMEUP, KEY_STOP, KEY_SENDFILE, \
416 KEY_SYSRQ, KEY_F5, KEY_F6, KEY_F7, \
417 KEY_F8, KEY_VOLUMEDOWN, KEY_DEL_EOL, KEY_DEL_EOS, \
418 KEY_8, KEY_9, KEY_0, KEY_MINUS, \
419 KEY_EQUAL, KEY_BACKSPACE, KEY_INS_LINE, KEY_DEL_LINE, \
420 KEY_I, KEY_O, KEY_P, KEY_LEFTBRACE, \
421 KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_INSERT, KEY_DELETE, \
422 KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, \
423 KEY_APOSTROPHE, KEY_ENTER, KEY_HOME, KEY_PAGEUP, \
424 KEY_M, KEY_COMMA, KEY_DOT, KEY_SLASH, \
425 KEY_BACKSLASH, KEY_SELECT, KEY_102ND, KEY_PAGEDOWN, \
426 KEY_N, KEY_SPACE, KEY_NEXT, KEY_RESERVED, \
427 KEY_LEFT, KEY_DOWN, KEY_UP, KEY_RIGHT
428
429
430#define HIL_KEYCODES_SET3_TBLSIZE 128
431#define HIL_KEYCODES_SET3 \
432 KEY_RESERVED, KEY_ESC, KEY_1, KEY_2, \
433 KEY_3, KEY_4, KEY_5, KEY_6, \
434 KEY_7, KEY_8, KEY_9, KEY_0, \
435 KEY_MINUS, KEY_EQUAL, KEY_BACKSPACE, KEY_TAB, \
436 KEY_Q, KEY_W, KEY_E, KEY_R, \
437 KEY_T, KEY_Y, KEY_U, KEY_I, \
438 KEY_O, KEY_P, KEY_LEFTBRACE, KEY_RIGHTBRACE, \
439 KEY_ENTER, KEY_LEFTCTRL, KEY_A, KEY_S, \
440 KEY_D, KEY_F, KEY_G, KEY_H, \
441 KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, \
442 KEY_APOSTROPHE,KEY_GRAVE, KEY_LEFTSHIFT, KEY_BACKSLASH, \
443 KEY_Z, KEY_X, KEY_C, KEY_V, \
444 KEY_B, KEY_N, KEY_M, KEY_COMMA, \
445 KEY_DOT, KEY_SLASH, KEY_RIGHTSHIFT, KEY_KPASTERISK, \
446 KEY_LEFTALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, \
447 KEY_F2, KEY_F3, KEY_F4, KEY_F5, \
448 KEY_F6, KEY_F7, KEY_F8, KEY_F9, \
449 KEY_F10, KEY_NUMLOCK, KEY_SCROLLLOCK, KEY_KP7, \
450 KEY_KP8, KEY_KP9, KEY_KPMINUS, KEY_KP4, \
451 KEY_KP5, KEY_KP6, KEY_KPPLUS, KEY_KP1, \
452 KEY_KP2, KEY_KP3, KEY_KP0, KEY_KPDOT, \
453 KEY_SYSRQ, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
454 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
455 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
456 KEY_UP, KEY_LEFT, KEY_DOWN, KEY_RIGHT, \
457 KEY_HOME, KEY_PAGEUP, KEY_END, KEY_PAGEDOWN, \
458 KEY_INSERT, KEY_DELETE, KEY_102ND, KEY_RESERVED, \
459 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
460 KEY_F1, KEY_F2, KEY_F3, KEY_F4, \
461 KEY_F5, KEY_F6, KEY_F7, KEY_F8, \
462 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
463 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED
464
465
466/* Response to POL command, the "poll record header" */
467
468#define HIL_POL_NUM_AXES_MASK 0x03 /* Number of axis reported */
469#define HIL_POL_CTS 0x04 /* Device ready to receive data */
470#define HIL_POL_STATUS_PENDING 0x08 /* Device has status to report */
471#define HIL_POL_CHARTYPE_MASK 0x70 /* Type of character data to follow */
472#define HIL_POL_CHARTYPE_NONE 0x00 /* No character data to follow */
473#define HIL_POL_CHARTYPE_RSVD1 0x10 /* Reserved Set 1 */
474#define HIL_POL_CHARTYPE_ASCII 0x20 /* U.S. ASCII */
475#define HIL_POL_CHARTYPE_BINARY 0x30 /* Binary data */
476#define HIL_POL_CHARTYPE_SET1 0x40 /* Keycode Set 1 */
477#define HIL_POL_CHARTYPE_RSVD2 0x50 /* Reserved Set 2 */
478#define HIL_POL_CHARTYPE_SET2 0x60 /* Keycode Set 2 */
479#define HIL_POL_CHARTYPE_SET3 0x70 /* Keycode Set 3 */
480#define HIL_POL_AXIS_ALT 0x80 /* Data is from axis set 2 */
481
482
483#endif /* _HIL_H_ */
diff --git a/include/linux/hil_mlc.h b/include/linux/hil_mlc.h
new file mode 100644
index 000000000000..8df29ca48a13
--- /dev/null
+++ b/include/linux/hil_mlc.h
@@ -0,0 +1,168 @@
1/*
2 * HP Human Interface Loop Master Link Controller driver.
3 *
4 * Copyright (c) 2001 Brian S. Julin
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions, and the following disclaimer,
12 * without modification.
13 * 2. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * Alternatively, this software may be distributed under the terms of the
17 * GNU General Public License ("GPL").
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 *
29 * References:
30 * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A
31 *
32 */
33
34#include <linux/hil.h>
35#include <linux/time.h>
36#include <linux/interrupt.h>
37#include <asm/semaphore.h>
38#include <linux/serio.h>
39#include <linux/list.h>
40
41typedef struct hil_mlc hil_mlc;
42
43/* The HIL has a complicated state engine.
44 * We define the structure of nodes in the state engine here.
45 */
46enum hilse_act {
47 /* HILSE_OUT prepares to receive input if the next node
48 * is an IN or EXPECT, and then sends the given packet.
49 */
50 HILSE_OUT = 0,
51
52 /* HILSE_CTS checks if the loop is busy. */
53 HILSE_CTS,
54
55 /* HILSE_OUT_LAST sends the given command packet to
56 * the last configured/running device on the loop.
57 */
58 HILSE_OUT_LAST,
59
60 /* HILSE_OUT_DISC sends the given command packet to
61 * the next device past the last configured/running one.
62 */
63 HILSE_OUT_DISC,
64
65 /* HILSE_FUNC runs a callback function with given arguments.
66 * a positive return value causes the "ugly" branch to be taken.
67 */
68 HILSE_FUNC,
69
70 /* HILSE_IN simply expects any non-errored packet to arrive
71 * within arg usecs.
72 */
73 HILSE_IN = 0x100,
74
75 /* HILSE_EXPECT expects a particular packet to arrive
76 * within arg usecs, any other packet is considered an error.
77 */
78 HILSE_EXPECT,
79
80 /* HILSE_EXPECT_LAST as above but dev field should be last
81 * discovered/operational device.
82 */
83 HILSE_EXPECT_LAST,
84
85 /* HILSE_EXPECT_LAST as above but dev field should be first
86 * undiscovered/inoperational device.
87 */
88 HILSE_EXPECT_DISC
89};
90
91typedef int (hilse_func) (hil_mlc *mlc, int arg);
92struct hilse_node {
93 enum hilse_act act; /* How to process this node */
94 union {
95 hilse_func *func; /* Function to call if HILSE_FUNC */
96 hil_packet packet; /* Packet to send or to compare */
97 } object;
98 int arg; /* Timeout in usec or parm for func */
99 int good; /* Node to jump to on success */
100 int bad; /* Node to jump to on error */
101 int ugly; /* Node to jump to on timeout */
102};
103
104/* Methods for back-end drivers, e.g. hp_sdc_mlc */
105typedef int (hil_mlc_cts) (hil_mlc *mlc);
106typedef void (hil_mlc_out) (hil_mlc *mlc);
107typedef int (hil_mlc_in) (hil_mlc *mlc, suseconds_t timeout);
108
109struct hil_mlc_devinfo {
110 uint8_t idd[16]; /* Device ID Byte and Describe Record */
111 uint8_t rsc[16]; /* Security Code Header and Record */
112 uint8_t exd[16]; /* Extended Describe Record */
113 uint8_t rnm[16]; /* Device name as returned by RNM command */
114};
115
116struct hil_mlc_serio_map {
117 hil_mlc *mlc;
118 int di_revmap;
119 int didx;
120};
121
122/* How many (possibly old/detached) devices the we try to keep track of */
123#define HIL_MLC_DEVMEM 16
124
125struct hil_mlc {
126 struct list_head list; /* hil_mlc is organized as linked list */
127
128 rwlock_t lock;
129
130 void *priv; /* Data specific to a particular type of MLC */
131
132 int seidx; /* Current node in state engine */
133 int istarted, ostarted;
134
135 hil_mlc_cts *cts;
136 struct semaphore csem; /* Raised when loop idle */
137
138 hil_mlc_out *out;
139 struct semaphore osem; /* Raised when outpacket dispatched */
140 hil_packet opacket;
141
142 hil_mlc_in *in;
143 struct semaphore isem; /* Raised when a packet arrives */
144 hil_packet ipacket[16];
145 hil_packet imatch;
146 int icount;
147 struct timeval instart;
148 suseconds_t intimeout;
149
150 int ddi; /* Last operational device id */
151 int lcv; /* LCV to throttle loops */
152 struct timeval lcv_tv; /* Time loop was started */
153
154 int di_map[7]; /* Maps below items to live devs */
155 struct hil_mlc_devinfo di[HIL_MLC_DEVMEM];
156 struct serio *serio[HIL_MLC_DEVMEM];
157 struct hil_mlc_serio_map serio_map[HIL_MLC_DEVMEM];
158 hil_packet serio_opacket[HIL_MLC_DEVMEM];
159 int serio_oidx[HIL_MLC_DEVMEM];
160 struct hil_mlc_devinfo di_scratch; /* Temporary area */
161
162 int opercnt;
163
164 struct tasklet_struct *tasklet;
165};
166
167int hil_mlc_register(hil_mlc *mlc);
168int hil_mlc_unregister(hil_mlc *mlc);
diff --git a/include/linux/hp_sdc.h b/include/linux/hp_sdc.h
new file mode 100644
index 000000000000..debd71515312
--- /dev/null
+++ b/include/linux/hp_sdc.h
@@ -0,0 +1,300 @@
1/*
2 * HP i8042 System Device Controller -- header
3 *
4 * Copyright (c) 2001 Brian S. Julin
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions, and the following disclaimer,
12 * without modification.
13 * 2. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * Alternatively, this software may be distributed under the terms of the
17 * GNU General Public License ("GPL").
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 *
29 * References:
30 *
31 * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A
32 *
33 * System Device Controller Microprocessor Firmware Theory of Operation
34 * for Part Number 1820-4784 Revision B. Dwg No. A-1820-4784-2
35 *
36 */
37
38#ifndef _LINUX_HP_SDC_H
39#define _LINUX_HP_SDC_H
40
41#include <linux/interrupt.h>
42#include <linux/types.h>
43#include <linux/time.h>
44#include <linux/timer.h>
45#if defined(__hppa__)
46#include <asm/hardware.h>
47#endif
48
49
50/* No 4X status reads take longer than this (in usec).
51 */
52#define HP_SDC_MAX_REG_DELAY 20000
53
54typedef void (hp_sdc_irqhook) (int irq, void *dev_id,
55 uint8_t status, uint8_t data);
56
57int hp_sdc_request_timer_irq(hp_sdc_irqhook *callback);
58int hp_sdc_request_hil_irq(hp_sdc_irqhook *callback);
59int hp_sdc_request_cooked_irq(hp_sdc_irqhook *callback);
60int hp_sdc_release_timer_irq(hp_sdc_irqhook *callback);
61int hp_sdc_release_hil_irq(hp_sdc_irqhook *callback);
62int hp_sdc_release_cooked_irq(hp_sdc_irqhook *callback);
63
64typedef struct {
65 int actidx; /* Start of act. Acts are atomic WRT I/O to SDC */
66 int idx; /* Index within the act */
67 int endidx; /* transaction is over and done if idx == endidx */
68 uint8_t *seq; /* commands/data for the transaction */
69 union {
70 hp_sdc_irqhook *irqhook; /* Callback, isr or tasklet context */
71 struct semaphore *semaphore; /* Semaphore to sleep on. */
72 } act;
73} hp_sdc_transaction;
74int hp_sdc_enqueue_transaction(hp_sdc_transaction *this);
75int hp_sdc_dequeue_transaction(hp_sdc_transaction *this);
76
77/* The HP_SDC_ACT* values are peculiar to this driver.
78 * Nuance: never HP_SDC_ACT_DATAIN | HP_SDC_ACT_DEALLOC, use another
79 * act to perform the dealloc.
80 */
81#define HP_SDC_ACT_PRECMD 0x01 /* Send a command first */
82#define HP_SDC_ACT_DATAREG 0x02 /* Set data registers */
83#define HP_SDC_ACT_DATAOUT 0x04 /* Send data bytes */
84#define HP_SDC_ACT_POSTCMD 0x08 /* Send command after */
85#define HP_SDC_ACT_DATAIN 0x10 /* Collect data after */
86#define HP_SDC_ACT_DURING 0x1f
87#define HP_SDC_ACT_SEMAPHORE 0x20 /* Raise semaphore after */
88#define HP_SDC_ACT_CALLBACK 0x40 /* Pass data to IRQ handler */
89#define HP_SDC_ACT_DEALLOC 0x80 /* Destroy transaction after */
90#define HP_SDC_ACT_AFTER 0xe0
91#define HP_SDC_ACT_DEAD 0x60 /* Act timed out. */
92
93/* Rest of the flags are straightforward representation of the SDC interface */
94#define HP_SDC_STATUS_IBF 0x02 /* Input buffer full */
95
96#define HP_SDC_STATUS_IRQMASK 0xf0 /* Bits containing "level 1" irq */
97#define HP_SDC_STATUS_PERIODIC 0x10 /* Periodic 10ms timer */
98#define HP_SDC_STATUS_USERTIMER 0x20 /* "Special purpose" timer */
99#define HP_SDC_STATUS_TIMER 0x30 /* Both PERIODIC and USERTIMER */
100#define HP_SDC_STATUS_REG 0x40 /* Data from an i8042 register */
101#define HP_SDC_STATUS_HILCMD 0x50 /* Command from HIL MLC */
102#define HP_SDC_STATUS_HILDATA 0x60 /* Data from HIL MLC */
103#define HP_SDC_STATUS_PUP 0x70 /* Sucessful power-up self test */
104#define HP_SDC_STATUS_KCOOKED 0x80 /* Key from cooked kbd */
105#define HP_SDC_STATUS_KRPG 0xc0 /* Key from Repeat Gen */
106#define HP_SDC_STATUS_KMOD_SUP 0x10 /* Shift key is up */
107#define HP_SDC_STATUS_KMOD_CUP 0x20 /* Control key is up */
108
109#define HP_SDC_NMISTATUS_FHS 0x40 /* NMI is a fast handshake irq */
110
111/* Internal i8042 registers (there are more, but they are not too useful). */
112
113#define HP_SDC_USE 0x02 /* Resource usage (including OB bit) */
114#define HP_SDC_IM 0x04 /* Interrupt mask */
115#define HP_SDC_CFG 0x11 /* Configuration register */
116#define HP_SDC_KBLANGUAGE 0x12 /* Keyboard language */
117
118#define HP_SDC_D0 0x70 /* General purpose data buffer 0 */
119#define HP_SDC_D1 0x71 /* General purpose data buffer 1 */
120#define HP_SDC_D2 0x72 /* General purpose data buffer 2 */
121#define HP_SDC_D3 0x73 /* General purpose data buffer 3 */
122#define HP_SDC_VT1 0x74 /* Timer for voice 1 */
123#define HP_SDC_VT2 0x75 /* Timer for voice 2 */
124#define HP_SDC_VT3 0x76 /* Timer for voice 3 */
125#define HP_SDC_VT4 0x77 /* Timer for voice 4 */
126#define HP_SDC_KBN 0x78 /* Which HIL devs are Nimitz */
127#define HP_SDC_KBC 0x79 /* Which HIL devs are cooked kbds */
128#define HP_SDC_LPS 0x7a /* i8042's view of HIL status */
129#define HP_SDC_LPC 0x7b /* i8042's view of HIL "control" */
130#define HP_SDC_RSV 0x7c /* Reserved "for testing" */
131#define HP_SDC_LPR 0x7d /* i8042 count of HIL reconfigs */
132#define HP_SDC_XTD 0x7e /* "Extended Configuration" register */
133#define HP_SDC_STR 0x7f /* i8042 self-test result */
134
135/* Bitfields for above registers */
136#define HP_SDC_USE_LOOP 0x04 /* Command is currently on the loop. */
137
138#define HP_SDC_IM_MASK 0x1f /* these bits not part of cmd/status */
139#define HP_SDC_IM_FH 0x10 /* Mask the fast handshake irq */
140#define HP_SDC_IM_PT 0x08 /* Mask the periodic timer irq */
141#define HP_SDC_IM_TIMERS 0x04 /* Mask the MT/DT/CT irq */
142#define HP_SDC_IM_RESET 0x02 /* Mask the reset key irq */
143#define HP_SDC_IM_HIL 0x01 /* Mask the HIL MLC irq */
144
145#define HP_SDC_CFG_ROLLOVER 0x08 /* WTF is "N-key rollover"? */
146#define HP_SDC_CFG_KBD 0x10 /* There is a keyboard */
147#define HP_SDC_CFG_NEW 0x20 /* Supports/uses HIL MLC */
148#define HP_SDC_CFG_KBD_OLD 0x03 /* keyboard code for non-HIL */
149#define HP_SDC_CFG_KBD_NEW 0x07 /* keyboard code from HIL autoconfig */
150#define HP_SDC_CFG_REV 0x40 /* Code revision bit */
151#define HP_SDC_CFG_IDPROM 0x80 /* IDPROM present in kbd (not HIL) */
152
153#define HP_SDC_LPS_NDEV 0x07 /* # devices autoconfigured on HIL */
154#define HP_SDC_LPS_ACSUCC 0x08 /* loop autoconfigured successfully */
155#define HP_SDC_LPS_ACFAIL 0x80 /* last loop autoconfigure failed */
156
157#define HP_SDC_LPC_APE_IPF 0x01 /* HIL MLC APE/IPF (autopoll) set */
158#define HP_SDC_LPC_ARCONERR 0x02 /* i8042 autoreconfigs loop on err */
159#define HP_SDC_LPC_ARCQUIET 0x03 /* i8042 doesn't report autoreconfigs*/
160#define HP_SDC_LPC_COOK 0x10 /* i8042 cooks devices in _KBN */
161#define HP_SDC_LPC_RC 0x80 /* causes autoreconfig */
162
163#define HP_SDC_XTD_REV 0x07 /* contains revision code */
164#define HP_SDC_XTD_REV_STRINGS(val, str) \
165switch (val) { \
166 case 0x1: str = "1820-3712"; break; \
167 case 0x2: str = "1820-4379"; break; \
168 case 0x3: str = "1820-4784"; break; \
169 default: str = "unknown"; \
170};
171#define HP_SDC_XTD_BEEPER 0x08 /* TI SN76494 beeper available */
172#define HP_SDC_XTD_BBRTC 0x20 /* OKI MSM-58321 BBRTC present */
173
174#define HP_SDC_CMD_LOAD_RT 0x31 /* Load real time (from 8042) */
175#define HP_SDC_CMD_LOAD_FHS 0x36 /* Load the fast handshake timer */
176#define HP_SDC_CMD_LOAD_MT 0x38 /* Load the match timer */
177#define HP_SDC_CMD_LOAD_DT 0x3B /* Load the delay timer */
178#define HP_SDC_CMD_LOAD_CT 0x3E /* Load the cycle timer */
179
180#define HP_SDC_CMD_SET_IM 0x40 /* 010xxxxx == set irq mask */
181
182/* The documents provided do not explicitly state that all registers betweem
183 * 0x01 and 0x1f inclusive can be read by sending their register index as a
184 * command, but this is implied and appears to be the case.
185 */
186#define HP_SDC_CMD_READ_RAM 0x00 /* Load from i8042 RAM (autoinc) */
187#define HP_SDC_CMD_READ_USE 0x02 /* Undocumented! Load from usage reg */
188#define HP_SDC_CMD_READ_IM 0x04 /* Load current interrupt mask */
189#define HP_SDC_CMD_READ_KCC 0x11 /* Load primary kbd config code */
190#define HP_SDC_CMD_READ_KLC 0x12 /* Load primary kbd language code */
191#define HP_SDC_CMD_READ_T1 0x13 /* Load timer output buffer byte 1 */
192#define HP_SDC_CMD_READ_T2 0x14 /* Load timer output buffer byte 1 */
193#define HP_SDC_CMD_READ_T3 0x15 /* Load timer output buffer byte 1 */
194#define HP_SDC_CMD_READ_T4 0x16 /* Load timer output buffer byte 1 */
195#define HP_SDC_CMD_READ_T5 0x17 /* Load timer output buffer byte 1 */
196#define HP_SDC_CMD_READ_D0 0xf0 /* Load from i8042 RAM location 0x70 */
197#define HP_SDC_CMD_READ_D1 0xf1 /* Load from i8042 RAM location 0x71 */
198#define HP_SDC_CMD_READ_D2 0xf2 /* Load from i8042 RAM location 0x72 */
199#define HP_SDC_CMD_READ_D3 0xf3 /* Load from i8042 RAM location 0x73 */
200#define HP_SDC_CMD_READ_VT1 0xf4 /* Load from i8042 RAM location 0x74 */
201#define HP_SDC_CMD_READ_VT2 0xf5 /* Load from i8042 RAM location 0x75 */
202#define HP_SDC_CMD_READ_VT3 0xf6 /* Load from i8042 RAM location 0x76 */
203#define HP_SDC_CMD_READ_VT4 0xf7 /* Load from i8042 RAM location 0x77 */
204#define HP_SDC_CMD_READ_KBN 0xf8 /* Load from i8042 RAM location 0x78 */
205#define HP_SDC_CMD_READ_KBC 0xf9 /* Load from i8042 RAM location 0x79 */
206#define HP_SDC_CMD_READ_LPS 0xfa /* Load from i8042 RAM location 0x7a */
207#define HP_SDC_CMD_READ_LPC 0xfb /* Load from i8042 RAM location 0x7b */
208#define HP_SDC_CMD_READ_RSV 0xfc /* Load from i8042 RAM location 0x7c */
209#define HP_SDC_CMD_READ_LPR 0xfd /* Load from i8042 RAM location 0x7d */
210#define HP_SDC_CMD_READ_XTD 0xfe /* Load from i8042 RAM location 0x7e */
211#define HP_SDC_CMD_READ_STR 0xff /* Load from i8042 RAM location 0x7f */
212
213#define HP_SDC_CMD_SET_ARD 0xA0 /* Set emulated autorepeat delay */
214#define HP_SDC_CMD_SET_ARR 0xA2 /* Set emulated autorepeat rate */
215#define HP_SDC_CMD_SET_BELL 0xA3 /* Set voice 3 params for "beep" cmd */
216#define HP_SDC_CMD_SET_RPGR 0xA6 /* Set "RPG" irq rate (doesn't work) */
217#define HP_SDC_CMD_SET_RTMS 0xAD /* Set the RTC time (milliseconds) */
218#define HP_SDC_CMD_SET_RTD 0xAF /* Set the RTC time (days) */
219#define HP_SDC_CMD_SET_FHS 0xB2 /* Set fast handshake timer */
220#define HP_SDC_CMD_SET_MT 0xB4 /* Set match timer */
221#define HP_SDC_CMD_SET_DT 0xB7 /* Set delay timer */
222#define HP_SDC_CMD_SET_CT 0xBA /* Set cycle timer */
223#define HP_SDC_CMD_SET_RAMP 0xC1 /* Reset READ_RAM autoinc counter */
224#define HP_SDC_CMD_SET_D0 0xe0 /* Load to i8042 RAM location 0x70 */
225#define HP_SDC_CMD_SET_D1 0xe1 /* Load to i8042 RAM location 0x71 */
226#define HP_SDC_CMD_SET_D2 0xe2 /* Load to i8042 RAM location 0x72 */
227#define HP_SDC_CMD_SET_D3 0xe3 /* Load to i8042 RAM location 0x73 */
228#define HP_SDC_CMD_SET_VT1 0xe4 /* Load to i8042 RAM location 0x74 */
229#define HP_SDC_CMD_SET_VT2 0xe5 /* Load to i8042 RAM location 0x75 */
230#define HP_SDC_CMD_SET_VT3 0xe6 /* Load to i8042 RAM location 0x76 */
231#define HP_SDC_CMD_SET_VT4 0xe7 /* Load to i8042 RAM location 0x77 */
232#define HP_SDC_CMD_SET_KBN 0xe8 /* Load to i8042 RAM location 0x78 */
233#define HP_SDC_CMD_SET_KBC 0xe9 /* Load to i8042 RAM location 0x79 */
234#define HP_SDC_CMD_SET_LPS 0xea /* Load to i8042 RAM location 0x7a */
235#define HP_SDC_CMD_SET_LPC 0xeb /* Load to i8042 RAM location 0x7b */
236#define HP_SDC_CMD_SET_RSV 0xec /* Load to i8042 RAM location 0x7c */
237#define HP_SDC_CMD_SET_LPR 0xed /* Load to i8042 RAM location 0x7d */
238#define HP_SDC_CMD_SET_XTD 0xee /* Load to i8042 RAM location 0x7e */
239#define HP_SDC_CMD_SET_STR 0xef /* Load to i8042 RAM location 0x7f */
240
241#define HP_SDC_CMD_DO_RTCW 0xc2 /* i8042 RAM 0x70 --> RTC */
242#define HP_SDC_CMD_DO_RTCR 0xc3 /* RTC[0x70 0:3] --> irq/status/data */
243#define HP_SDC_CMD_DO_BEEP 0xc4 /* i8042 RAM 0x70-74 --> beeper,VT3 */
244#define HP_SDC_CMD_DO_HIL 0xc5 /* i8042 RAM 0x70-73 -->
245 HIL MLC R0,R1 i8042 HIL watchdog */
246
247/* Values used to (de)mangle input/output to/from the HIL MLC */
248#define HP_SDC_DATA 0x40 /* Data from an 8042 register */
249#define HP_SDC_HIL_CMD 0x50 /* Data from HIL MLC R1/8042 */
250#define HP_SDC_HIL_R1MASK 0x0f /* Contents of HIL MLC R1 0:3 */
251#define HP_SDC_HIL_AUTO 0x10 /* Set if POL results from i8042 */
252#define HP_SDC_HIL_ISERR 0x80 /* Has meaning as in next 4 values */
253#define HP_SDC_HIL_RC_DONE 0x80 /* i8042 auto-configured loop */
254#define HP_SDC_HIL_ERR 0x81 /* HIL MLC R2 had a bit set */
255#define HP_SDC_HIL_TO 0x82 /* i8042 HIL watchdog expired */
256#define HP_SDC_HIL_RC 0x84 /* i8042 is auto-configuring loop */
257#define HP_SDC_HIL_DAT 0x60 /* Data from HIL MLC R0 */
258
259
260typedef struct {
261 rwlock_t ibf_lock;
262 rwlock_t lock; /* user/tasklet lock */
263 rwlock_t rtq_lock; /* isr/tasklet lock */
264 rwlock_t hook_lock; /* isr/user lock for handler add/del */
265
266 unsigned int irq, nmi; /* Our IRQ lines */
267 unsigned long base_io, status_io, data_io; /* Our IO ports */
268
269 uint8_t im; /* Interrupt mask */
270 int set_im; /* Interrupt mask needs to be set. */
271
272 int ibf; /* Last known status of IBF flag */
273 uint8_t wi; /* current i8042 write index */
274 uint8_t r7[4]; /* current i8042[0x70 - 0x74] values */
275 uint8_t r11, r7e; /* Values from version/revision regs */
276
277 hp_sdc_irqhook *timer, *reg, *hil, *pup, *cooked;
278
279#define HP_SDC_QUEUE_LEN 16
280 hp_sdc_transaction *tq[HP_SDC_QUEUE_LEN]; /* All pending read/writes */
281
282 int rcurr, rqty; /* Current read transact in process */
283 struct timeval rtv; /* Time when current read started */
284 int wcurr; /* Current write transact in process */
285
286 int dev_err; /* carries status from registration */
287#if defined(__hppa__)
288 struct parisc_device *dev;
289#elif defined(__mc68000__)
290 void *dev;
291#else
292#error No support for device registration on this arch yet.
293#endif
294
295 struct timer_list kicker; /* Keeps below task alive */
296 struct tasklet_struct task;
297
298} hp_i8042_sdc;
299
300#endif /* _LINUX_HP_SDC_H */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index d664330d900e..0cea162b08c0 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -16,7 +16,6 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
16int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); 16int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
17int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); 17int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
18int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int); 18int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int);
19void zap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
20void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); 19void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
21int hugetlb_prefault(struct address_space *, struct vm_area_struct *); 20int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
22int hugetlb_report_meminfo(char *); 21int hugetlb_report_meminfo(char *);
@@ -87,7 +86,6 @@ static inline unsigned long hugetlb_total_pages(void)
87#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) 86#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL)
88#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) 87#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })
89#define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) 88#define hugetlb_prefault(mapping, vma) ({ BUG(); 0; })
90#define zap_hugepage_range(vma, start, len) BUG()
91#define unmap_hugepage_range(vma, start, end) BUG() 89#define unmap_hugepage_range(vma, start, end) BUG()
92#define is_hugepage_mem_enough(size) 0 90#define is_hugepage_mem_enough(size) 0
93#define hugetlb_report_meminfo(buf) 0 91#define hugetlb_report_meminfo(buf) 0
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h
index 110904481238..c0e7fab28ce3 100644
--- a/include/linux/i2c-algo-bit.h
+++ b/include/linux/i2c-algo-bit.h
@@ -21,8 +21,6 @@
21/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even 21/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
22 Frodo Looijaard <frodol@dds.nl> */ 22 Frodo Looijaard <frodol@dds.nl> */
23 23
24/* $Id: i2c-algo-bit.h,v 1.10 2003/01/21 08:08:16 kmalkki Exp $ */
25
26#ifndef _LINUX_I2C_ALGO_BIT_H 24#ifndef _LINUX_I2C_ALGO_BIT_H
27#define _LINUX_I2C_ALGO_BIT_H 25#define _LINUX_I2C_ALGO_BIT_H
28 26
@@ -46,8 +44,6 @@ struct i2c_algo_bit_data {
46 int timeout; /* in jiffies */ 44 int timeout; /* in jiffies */
47}; 45};
48 46
49#define I2C_BIT_ADAP_MAX 16
50
51int i2c_bit_add_bus(struct i2c_adapter *); 47int i2c_bit_add_bus(struct i2c_adapter *);
52int i2c_bit_del_bus(struct i2c_adapter *); 48int i2c_bit_del_bus(struct i2c_adapter *);
53 49
diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h
index 941b786c5732..226693e0d88b 100644
--- a/include/linux/i2c-algo-pca.h
+++ b/include/linux/i2c-algo-pca.h
@@ -9,8 +9,6 @@ struct i2c_algo_pca_data {
9 int (*wait_for_interrupt) (struct i2c_algo_pca_data *adap); 9 int (*wait_for_interrupt) (struct i2c_algo_pca_data *adap);
10}; 10};
11 11
12#define I2C_PCA_ADAP_MAX 16
13
14int i2c_pca_add_bus(struct i2c_adapter *); 12int i2c_pca_add_bus(struct i2c_adapter *);
15int i2c_pca_del_bus(struct i2c_adapter *); 13int i2c_pca_del_bus(struct i2c_adapter *);
16 14
diff --git a/include/linux/i2c-algo-pcf.h b/include/linux/i2c-algo-pcf.h
index 2a508562255f..18b0adf57a3d 100644
--- a/include/linux/i2c-algo-pcf.h
+++ b/include/linux/i2c-algo-pcf.h
@@ -22,8 +22,6 @@
22/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even 22/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
23 Frodo Looijaard <frodol@dds.nl> */ 23 Frodo Looijaard <frodol@dds.nl> */
24 24
25/* $Id: i2c-algo-pcf.h,v 1.8 2003/01/21 08:08:16 kmalkki Exp $ */
26
27#ifndef _LINUX_I2C_ALGO_PCF_H 25#ifndef _LINUX_I2C_ALGO_PCF_H
28#define _LINUX_I2C_ALGO_PCF_H 26#define _LINUX_I2C_ALGO_PCF_H
29 27
@@ -41,8 +39,6 @@ struct i2c_algo_pcf_data {
41 int timeout; 39 int timeout;
42}; 40};
43 41
44#define I2C_PCF_ADAP_MAX 16
45
46int i2c_pcf_add_bus(struct i2c_adapter *); 42int i2c_pcf_add_bus(struct i2c_adapter *);
47int i2c_pcf_del_bus(struct i2c_adapter *); 43int i2c_pcf_del_bus(struct i2c_adapter *);
48 44
diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h
index 541695679762..81c229a0fbca 100644
--- a/include/linux/i2c-dev.h
+++ b/include/linux/i2c-dev.h
@@ -19,8 +19,6 @@
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/ 20*/
21 21
22/* $Id: i2c-dev.h,v 1.13 2003/01/21 08:08:16 kmalkki Exp $ */
23
24#ifndef _LINUX_I2C_DEV_H 22#ifndef _LINUX_I2C_DEV_H
25#define _LINUX_I2C_DEV_H 23#define _LINUX_I2C_DEV_H
26 24
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 44f30876a1c9..1ce4b54caa21 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -164,10 +164,7 @@
164 164
165/* --- Bit algorithm adapters */ 165/* --- Bit algorithm adapters */
166#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ 166#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */
167#define I2C_HW_B_LPC 0x010001 /* Parallel port control reg. */
168#define I2C_HW_B_SER 0x010002 /* Serial line interface */ 167#define I2C_HW_B_SER 0x010002 /* Serial line interface */
169#define I2C_HW_B_ELV 0x010003 /* ELV Card */
170#define I2C_HW_B_VELLE 0x010004 /* Vellemann K8000 */
171#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ 168#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */
172#define I2C_HW_B_WNV 0x010006 /* Winnov Videums */ 169#define I2C_HW_B_WNV 0x010006 /* Winnov Videums */
173#define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ 170#define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 3d49a305bf88..f88577ca3b3a 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -23,14 +23,13 @@
23/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and 23/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
24 Frodo Looijaard <frodol@dds.nl> */ 24 Frodo Looijaard <frodol@dds.nl> */
25 25
26/* $Id: i2c.h,v 1.68 2003/01/21 08:08:16 kmalkki Exp $ */
27
28#ifndef _LINUX_I2C_H 26#ifndef _LINUX_I2C_H
29#define _LINUX_I2C_H 27#define _LINUX_I2C_H
30 28
31#include <linux/module.h> 29#include <linux/module.h>
32#include <linux/types.h> 30#include <linux/types.h>
33#include <linux/i2c-id.h> 31#include <linux/i2c-id.h>
32#include <linux/mod_devicetable.h>
34#include <linux/device.h> /* for struct device */ 33#include <linux/device.h> /* for struct device */
35#include <asm/semaphore.h> 34#include <asm/semaphore.h>
36 35
@@ -94,10 +93,10 @@ extern s32 i2c_smbus_write_byte_data(struct i2c_client * client,
94extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); 93extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command);
95extern s32 i2c_smbus_write_word_data(struct i2c_client * client, 94extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
96 u8 command, u16 value); 95 u8 command, u16 value);
97/* Returns the number of bytes transferred */
98extern s32 i2c_smbus_write_block_data(struct i2c_client * client, 96extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
99 u8 command, u8 length, 97 u8 command, u8 length,
100 u8 *values); 98 u8 *values);
99/* Returns the number of read bytes */
101extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, 100extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
102 u8 command, u8 *values); 101 u8 command, u8 *values);
103 102
@@ -391,10 +390,6 @@ struct i2c_msg {
391#define I2C_FUNC_10BIT_ADDR 0x00000002 390#define I2C_FUNC_10BIT_ADDR 0x00000002
392#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ 391#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
393#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ 392#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */
394#define I2C_FUNC_SMBUS_READ_WORD_DATA_PEC 0x00000800 /* SMBus 2.0 */
395#define I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC 0x00001000 /* SMBus 2.0 */
396#define I2C_FUNC_SMBUS_PROC_CALL_PEC 0x00002000 /* SMBus 2.0 */
397#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL_PEC 0x00004000 /* SMBus 2.0 */
398#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ 393#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
399#define I2C_FUNC_SMBUS_QUICK 0x00010000 394#define I2C_FUNC_SMBUS_QUICK 0x00010000
400#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 395#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
@@ -410,8 +405,6 @@ struct i2c_msg {
410#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ 405#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
411#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ 406#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */
412#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */ 407#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */
413#define I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC 0x40000000 /* SMBus 2.0 */
414#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC 0x80000000 /* SMBus 2.0 */
415 408
416#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ 409#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
417 I2C_FUNC_SMBUS_WRITE_BYTE) 410 I2C_FUNC_SMBUS_WRITE_BYTE)
@@ -425,17 +418,6 @@ struct i2c_msg {
425 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) 418 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
426#define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \ 419#define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \
427 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2) 420 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2)
428#define I2C_FUNC_SMBUS_BLOCK_DATA_PEC (I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC | \
429 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC)
430#define I2C_FUNC_SMBUS_WORD_DATA_PEC (I2C_FUNC_SMBUS_READ_WORD_DATA_PEC | \
431 I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC)
432
433#define I2C_FUNC_SMBUS_READ_BYTE_PEC I2C_FUNC_SMBUS_READ_BYTE_DATA
434#define I2C_FUNC_SMBUS_WRITE_BYTE_PEC I2C_FUNC_SMBUS_WRITE_BYTE_DATA
435#define I2C_FUNC_SMBUS_READ_BYTE_DATA_PEC I2C_FUNC_SMBUS_READ_WORD_DATA
436#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA_PEC I2C_FUNC_SMBUS_WRITE_WORD_DATA
437#define I2C_FUNC_SMBUS_BYTE_PEC I2C_FUNC_SMBUS_BYTE_DATA
438#define I2C_FUNC_SMBUS_BYTE_DATA_PEC I2C_FUNC_SMBUS_WORD_DATA
439 421
440#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \ 422#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \
441 I2C_FUNC_SMBUS_BYTE | \ 423 I2C_FUNC_SMBUS_BYTE | \
@@ -443,20 +425,17 @@ struct i2c_msg {
443 I2C_FUNC_SMBUS_WORD_DATA | \ 425 I2C_FUNC_SMBUS_WORD_DATA | \
444 I2C_FUNC_SMBUS_PROC_CALL | \ 426 I2C_FUNC_SMBUS_PROC_CALL | \
445 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ 427 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
446 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC | \
447 I2C_FUNC_SMBUS_I2C_BLOCK) 428 I2C_FUNC_SMBUS_I2C_BLOCK)
448 429
449/* 430/*
450 * Data for SMBus Messages 431 * Data for SMBus Messages
451 */ 432 */
452#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ 433#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
453#define I2C_SMBUS_I2C_BLOCK_MAX 32 /* Not specified but we use same structure */
454union i2c_smbus_data { 434union i2c_smbus_data {
455 __u8 byte; 435 __u8 byte;
456 __u16 word; 436 __u16 word;
457 __u8 block[I2C_SMBUS_BLOCK_MAX + 3]; /* block[0] is used for length */ 437 __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
458 /* one more for read length in block process call */ 438 /* and one more for user-space compatibility */
459 /* and one more for PEC */
460}; 439};
461 440
462/* smbus_access read or write markers */ 441/* smbus_access read or write markers */
@@ -473,10 +452,6 @@ union i2c_smbus_data {
473#define I2C_SMBUS_BLOCK_DATA 5 452#define I2C_SMBUS_BLOCK_DATA 5
474#define I2C_SMBUS_I2C_BLOCK_DATA 6 453#define I2C_SMBUS_I2C_BLOCK_DATA 6
475#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ 454#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
476#define I2C_SMBUS_BLOCK_DATA_PEC 8 /* SMBus 2.0 */
477#define I2C_SMBUS_PROC_CALL_PEC 9 /* SMBus 2.0 */
478#define I2C_SMBUS_BLOCK_PROC_CALL_PEC 10 /* SMBus 2.0 */
479#define I2C_SMBUS_WORD_DATA_PEC 11 /* SMBus 2.0 */
480 455
481 456
482/* ----- commands for the ioctl like i2c_command call: 457/* ----- commands for the ioctl like i2c_command call:
@@ -506,11 +481,6 @@ union i2c_smbus_data {
506 481
507#define I2C_SMBUS 0x0720 /* SMBus-level access */ 482#define I2C_SMBUS 0x0720 /* SMBus-level access */
508 483
509/* ... algo-bit.c recognizes */
510#define I2C_UDELAY 0x0705 /* set delay in microsecs between each */
511 /* written byte (except address) */
512#define I2C_MDELAY 0x0706 /* millisec delay between written bytes */
513
514/* ----- I2C-DEV: char device interface stuff ------------------------- */ 484/* ----- I2C-DEV: char device interface stuff ------------------------- */
515 485
516#define I2C_MAJOR 89 /* Device major number */ 486#define I2C_MAJOR 89 /* Device major number */
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index bdc286ec947c..92300325dbcd 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -66,8 +66,6 @@ struct i2o_device {
66 struct device device; 66 struct device device;
67 67
68 struct semaphore lock; /* device lock */ 68 struct semaphore lock; /* device lock */
69
70 struct class_device classdev; /* i2o device class */
71}; 69};
72 70
73/* 71/*
@@ -194,7 +192,7 @@ struct i2o_controller {
194 struct resource mem_resource; /* Mem resource allocated to the IOP */ 192 struct resource mem_resource; /* Mem resource allocated to the IOP */
195 193
196 struct device device; 194 struct device device;
197 struct class_device classdev; /* I2O controller class */ 195 struct class_device *classdev; /* I2O controller class device */
198 struct i2o_device *exec; /* Executive */ 196 struct i2o_device *exec; /* Executive */
199#if BITS_PER_LONG == 64 197#if BITS_PER_LONG == 64
200 spinlock_t context_list_lock; /* lock for context_list */ 198 spinlock_t context_list_lock; /* lock for context_list */
@@ -492,7 +490,7 @@ static inline int i2o_dma_map_sg(struct i2o_controller *c,
492 * Returns 0 on success or -ENOMEM on failure. 490 * Returns 0 on success or -ENOMEM on failure.
493 */ 491 */
494static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr, 492static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr,
495 size_t len, unsigned int gfp_mask) 493 size_t len, gfp_t gfp_mask)
496{ 494{
497 struct pci_dev *pdev = to_pci_dev(dev); 495 struct pci_dev *pdev = to_pci_dev(dev);
498 int dma_64 = 0; 496 int dma_64 = 0;
@@ -551,7 +549,7 @@ static inline void i2o_dma_free(struct device *dev, struct i2o_dma *addr)
551 * Returns the 0 on success or negative error code on failure. 549 * Returns the 0 on success or negative error code on failure.
552 */ 550 */
553static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr, 551static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr,
554 size_t len, unsigned int gfp_mask) 552 size_t len, gfp_t gfp_mask)
555{ 553{
556 i2o_dma_free(dev, addr); 554 i2o_dma_free(dev, addr);
557 555
diff --git a/include/linux/ibmtr.h b/include/linux/ibmtr.h
index 2ef0b21517fb..1c7a0dd5536a 100644
--- a/include/linux/ibmtr.h
+++ b/include/linux/ibmtr.h
@@ -7,8 +7,8 @@
7/* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */ 7/* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */
8 8
9#define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */ 9#define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */
10#define TR_RST_TIME (HZ/20) /* 5 on PC = 50 ms */ 10#define TR_RST_TIME (msecs_to_jiffies(50)) /* 5 on PC = 50 ms */
11#define TR_BUSY_INTERVAL (HZ/5) /* 5 on PC = 200 ms */ 11#define TR_BUSY_INTERVAL (msecs_to_jiffies(200)) /* 5 on PC = 200 ms */
12#define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */ 12#define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */
13 13
14#define TR_ISA 1 14#define TR_ISA 1
diff --git a/include/linux/ide.h b/include/linux/ide.h
index a6dbb51ecd7b..3461abc1e854 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -218,7 +218,7 @@ typedef enum { ide_unknown, ide_generic, ide_pci,
218 ide_rz1000, ide_trm290, 218 ide_rz1000, ide_trm290,
219 ide_cmd646, ide_cy82c693, ide_4drives, 219 ide_cmd646, ide_cy82c693, ide_4drives,
220 ide_pmac, ide_etrax100, ide_acorn, 220 ide_pmac, ide_etrax100, ide_acorn,
221 ide_forced 221 ide_au1xxx, ide_forced
222} hwif_chipset_t; 222} hwif_chipset_t;
223 223
224/* 224/*
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 3d5de45f961b..7fb3ff9c7b0e 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -71,7 +71,7 @@ struct idr {
71 */ 71 */
72 72
73void *idr_find(struct idr *idp, int id); 73void *idr_find(struct idr *idp, int id);
74int idr_pre_get(struct idr *idp, unsigned gfp_mask); 74int idr_pre_get(struct idr *idp, gfp_t gfp_mask);
75int idr_get_new(struct idr *idp, void *ptr, int *id); 75int idr_get_new(struct idr *idp, void *ptr, int *id);
76int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); 76int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);
77void idr_remove(struct idr *idp, int id); 77void idr_remove(struct idr *idp, int id);
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index 0856548a2a08..a8b1a2071838 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -84,6 +84,7 @@
84#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ 84#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */
85#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ 85#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */
86#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ 86#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */
87#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */
87 88
88#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ 89#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
89#define ARPHRD_NONE 0xFFFE /* zero header length */ 90#define ARPHRD_NONE 0xFFFE /* zero header length */
diff --git a/include/linux/input.h b/include/linux/input.h
index e8c296ff6257..f623c745c21c 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -12,6 +12,7 @@
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/device.h>
15#else 16#else
16#include <sys/time.h> 17#include <sys/time.h>
17#include <sys/ioctl.h> 18#include <sys/ioctl.h>
@@ -644,6 +645,7 @@ struct input_absinfo {
644#define BUS_ADB 0x17 645#define BUS_ADB 0x17
645#define BUS_I2C 0x18 646#define BUS_I2C 0x18
646#define BUS_HOST 0x19 647#define BUS_HOST 0x19
648#define BUS_GSC 0x1A
647 649
648/* 650/*
649 * Values describing the status of an effect 651 * Values describing the status of an effect
@@ -889,11 +891,15 @@ struct input_dev {
889 struct semaphore sem; /* serializes open and close operations */ 891 struct semaphore sem; /* serializes open and close operations */
890 unsigned int users; 892 unsigned int users;
891 893
892 struct device *dev; 894 struct class_device cdev;
895 struct device *dev; /* will be removed soon */
896
897 int dynalloc; /* temporarily */
893 898
894 struct list_head h_list; 899 struct list_head h_list;
895 struct list_head node; 900 struct list_head node;
896}; 901};
902#define to_input_dev(d) container_of(d, struct input_dev, cdev)
897 903
898/* 904/*
899 * Structure for hotplug & device<->driver matching. 905 * Structure for hotplug & device<->driver matching.
@@ -984,6 +990,23 @@ static inline void init_input_dev(struct input_dev *dev)
984 INIT_LIST_HEAD(&dev->node); 990 INIT_LIST_HEAD(&dev->node);
985} 991}
986 992
993struct input_dev *input_allocate_device(void);
994
995static inline void input_free_device(struct input_dev *dev)
996{
997 kfree(dev);
998}
999
1000static inline struct input_dev *input_get_device(struct input_dev *dev)
1001{
1002 return to_input_dev(class_device_get(&dev->cdev));
1003}
1004
1005static inline void input_put_device(struct input_dev *dev)
1006{
1007 class_device_put(&dev->cdev);
1008}
1009
987void input_register_device(struct input_dev *); 1010void input_register_device(struct input_dev *);
988void input_unregister_device(struct input_dev *); 1011void input_unregister_device(struct input_dev *);
989 1012
@@ -1052,7 +1075,7 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min
1052 dev->absbit[LONG(axis)] |= BIT(axis); 1075 dev->absbit[LONG(axis)] |= BIT(axis);
1053} 1076}
1054 1077
1055extern struct class *input_class; 1078extern struct class input_class;
1056 1079
1057#endif 1080#endif
1058#endif 1081#endif
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index ff853b3173c6..be197eb90077 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -69,7 +69,7 @@ extern int journal_enable_debug;
69#define jbd_debug(f, a...) /**/ 69#define jbd_debug(f, a...) /**/
70#endif 70#endif
71 71
72extern void * __jbd_kmalloc (const char *where, size_t size, int flags, int retry); 72extern void * __jbd_kmalloc (const char *where, size_t size, gfp_t flags, int retry);
73#define jbd_kmalloc(size, flags) \ 73#define jbd_kmalloc(size, flags) \
74 __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry) 74 __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry)
75#define jbd_rep_kmalloc(size, flags) \ 75#define jbd_rep_kmalloc(size, flags) \
@@ -890,7 +890,7 @@ extern int journal_forget (handle_t *, struct buffer_head *);
890extern void journal_sync_buffer (struct buffer_head *); 890extern void journal_sync_buffer (struct buffer_head *);
891extern int journal_invalidatepage(journal_t *, 891extern int journal_invalidatepage(journal_t *,
892 struct page *, unsigned long); 892 struct page *, unsigned long);
893extern int journal_try_to_free_buffers(journal_t *, struct page *, int); 893extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t);
894extern int journal_stop(handle_t *); 894extern int journal_stop(handle_t *);
895extern int journal_flush (journal_t *); 895extern int journal_flush (journal_t *);
896extern void journal_lock_updates (journal_t *); 896extern void journal_lock_updates (journal_t *);
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 3b22304f12fd..7f7403aa4a41 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -65,7 +65,7 @@ extern void kobject_unregister(struct kobject *);
65extern struct kobject * kobject_get(struct kobject *); 65extern struct kobject * kobject_get(struct kobject *);
66extern void kobject_put(struct kobject *); 66extern void kobject_put(struct kobject *);
67 67
68extern char * kobject_get_path(struct kobject *, int); 68extern char * kobject_get_path(struct kobject *, gfp_t);
69 69
70struct kobj_type { 70struct kobj_type {
71 void (*release)(struct kobject *); 71 void (*release)(struct kobject *);
diff --git a/include/linux/libata.h b/include/linux/libata.h
index ceee1fc42c60..00a8a5738858 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -91,12 +91,13 @@ enum {
91 ATA_SHT_EMULATED = 1, 91 ATA_SHT_EMULATED = 1,
92 ATA_SHT_CMD_PER_LUN = 1, 92 ATA_SHT_CMD_PER_LUN = 1,
93 ATA_SHT_THIS_ID = -1, 93 ATA_SHT_THIS_ID = -1,
94 ATA_SHT_USE_CLUSTERING = 0, 94 ATA_SHT_USE_CLUSTERING = 1,
95 95
96 /* struct ata_device stuff */ 96 /* struct ata_device stuff */
97 ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ 97 ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */
98 ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ 98 ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */
99 ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ 99 ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */
100 ATA_DFLAG_LBA = (1 << 3), /* device supports LBA */
100 101
101 ATA_DEV_UNKNOWN = 0, /* unknown device */ 102 ATA_DEV_UNKNOWN = 0, /* unknown device */
102 ATA_DEV_ATA = 1, /* ATA device */ 103 ATA_DEV_ATA = 1, /* ATA device */
@@ -154,17 +155,21 @@ enum {
154 ATA_SHIFT_UDMA = 0, 155 ATA_SHIFT_UDMA = 0,
155 ATA_SHIFT_MWDMA = 8, 156 ATA_SHIFT_MWDMA = 8,
156 ATA_SHIFT_PIO = 11, 157 ATA_SHIFT_PIO = 11,
158
159 /* Masks for port functions */
160 ATA_PORT_PRIMARY = (1 << 0),
161 ATA_PORT_SECONDARY = (1 << 1),
157}; 162};
158 163
159enum pio_task_states { 164enum hsm_task_states {
160 PIO_ST_UNKNOWN, 165 HSM_ST_UNKNOWN,
161 PIO_ST_IDLE, 166 HSM_ST_IDLE,
162 PIO_ST_POLL, 167 HSM_ST_POLL,
163 PIO_ST_TMOUT, 168 HSM_ST_TMOUT,
164 PIO_ST, 169 HSM_ST,
165 PIO_ST_LAST, 170 HSM_ST_LAST,
166 PIO_ST_LAST_POLL, 171 HSM_ST_LAST_POLL,
167 PIO_ST_ERR, 172 HSM_ST_ERR,
168}; 173};
169 174
170/* forward declarations */ 175/* forward declarations */
@@ -197,7 +202,7 @@ struct ata_ioports {
197struct ata_probe_ent { 202struct ata_probe_ent {
198 struct list_head node; 203 struct list_head node;
199 struct device *dev; 204 struct device *dev;
200 struct ata_port_operations *port_ops; 205 const struct ata_port_operations *port_ops;
201 Scsi_Host_Template *sht; 206 Scsi_Host_Template *sht;
202 struct ata_ioports port[ATA_MAX_PORTS]; 207 struct ata_ioports port[ATA_MAX_PORTS];
203 unsigned int n_ports; 208 unsigned int n_ports;
@@ -220,7 +225,7 @@ struct ata_host_set {
220 void __iomem *mmio_base; 225 void __iomem *mmio_base;
221 unsigned int n_ports; 226 unsigned int n_ports;
222 void *private_data; 227 void *private_data;
223 struct ata_port_operations *ops; 228 const struct ata_port_operations *ops;
224 struct ata_port * ports[0]; 229 struct ata_port * ports[0];
225}; 230};
226 231
@@ -278,15 +283,18 @@ struct ata_device {
278 u8 xfer_mode; 283 u8 xfer_mode;
279 unsigned int xfer_shift; /* ATA_SHIFT_xxx */ 284 unsigned int xfer_shift; /* ATA_SHIFT_xxx */
280 285
281 /* cache info about current transfer mode */ 286 unsigned int multi_count; /* sectors count for
282 u8 xfer_protocol; /* taskfile xfer protocol */ 287 READ/WRITE MULTIPLE */
283 u8 read_cmd; /* opcode to use on read */ 288
284 u8 write_cmd; /* opcode to use on write */ 289 /* for CHS addressing */
290 u16 cylinders; /* Number of cylinders */
291 u16 heads; /* Number of heads */
292 u16 sectors; /* Number of sectors per track */
285}; 293};
286 294
287struct ata_port { 295struct ata_port {
288 struct Scsi_Host *host; /* our co-allocated scsi host */ 296 struct Scsi_Host *host; /* our co-allocated scsi host */
289 struct ata_port_operations *ops; 297 const struct ata_port_operations *ops;
290 unsigned long flags; /* ATA_FLAG_xxx */ 298 unsigned long flags; /* ATA_FLAG_xxx */
291 unsigned int id; /* unique id req'd by scsi midlyr */ 299 unsigned int id; /* unique id req'd by scsi midlyr */
292 unsigned int port_no; /* unique port #; from zero */ 300 unsigned int port_no; /* unique port #; from zero */
@@ -319,7 +327,7 @@ struct ata_port {
319 struct work_struct packet_task; 327 struct work_struct packet_task;
320 328
321 struct work_struct pio_task; 329 struct work_struct pio_task;
322 unsigned int pio_task_state; 330 unsigned int hsm_task_state;
323 unsigned long pio_task_timeout; 331 unsigned long pio_task_timeout;
324 332
325 void *private_data; 333 void *private_data;
@@ -333,10 +341,10 @@ struct ata_port_operations {
333 void (*set_piomode) (struct ata_port *, struct ata_device *); 341 void (*set_piomode) (struct ata_port *, struct ata_device *);
334 void (*set_dmamode) (struct ata_port *, struct ata_device *); 342 void (*set_dmamode) (struct ata_port *, struct ata_device *);
335 343
336 void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); 344 void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf);
337 void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); 345 void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
338 346
339 void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); 347 void (*exec_command)(struct ata_port *ap, const struct ata_taskfile *tf);
340 u8 (*check_status)(struct ata_port *ap); 348 u8 (*check_status)(struct ata_port *ap);
341 u8 (*check_altstatus)(struct ata_port *ap); 349 u8 (*check_altstatus)(struct ata_port *ap);
342 u8 (*check_err)(struct ata_port *ap); 350 u8 (*check_err)(struct ata_port *ap);
@@ -377,9 +385,22 @@ struct ata_port_info {
377 unsigned long pio_mask; 385 unsigned long pio_mask;
378 unsigned long mwdma_mask; 386 unsigned long mwdma_mask;
379 unsigned long udma_mask; 387 unsigned long udma_mask;
380 struct ata_port_operations *port_ops; 388 const struct ata_port_operations *port_ops;
389};
390
391struct ata_timing {
392 unsigned short mode; /* ATA mode */
393 unsigned short setup; /* t1 */
394 unsigned short act8b; /* t2 for 8-bit I/O */
395 unsigned short rec8b; /* t2i for 8-bit I/O */
396 unsigned short cyc8b; /* t0 for 8-bit I/O */
397 unsigned short active; /* t2 or tD */
398 unsigned short recover; /* t2i or tK */
399 unsigned short cycle; /* t0 */
400 unsigned short udma; /* t2CYCTYP/2 */
381}; 401};
382 402
403#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin)
383 404
384extern void ata_port_probe(struct ata_port *); 405extern void ata_port_probe(struct ata_port *);
385extern void __sata_phy_reset(struct ata_port *ap); 406extern void __sata_phy_reset(struct ata_port *ap);
@@ -392,7 +413,7 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i
392 unsigned int n_ports); 413 unsigned int n_ports);
393extern void ata_pci_remove_one (struct pci_dev *pdev); 414extern void ata_pci_remove_one (struct pci_dev *pdev);
394#endif /* CONFIG_PCI */ 415#endif /* CONFIG_PCI */
395extern int ata_device_add(struct ata_probe_ent *ent); 416extern int ata_device_add(const struct ata_probe_ent *ent);
396extern void ata_host_set_remove(struct ata_host_set *host_set); 417extern void ata_host_set_remove(struct ata_host_set *host_set);
397extern int ata_scsi_detect(Scsi_Host_Template *sht); 418extern int ata_scsi_detect(Scsi_Host_Template *sht);
398extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 419extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
@@ -400,19 +421,21 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn
400extern int ata_scsi_error(struct Scsi_Host *host); 421extern int ata_scsi_error(struct Scsi_Host *host);
401extern int ata_scsi_release(struct Scsi_Host *host); 422extern int ata_scsi_release(struct Scsi_Host *host);
402extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 423extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
424extern int ata_ratelimit(void);
425
403/* 426/*
404 * Default driver ops implementations 427 * Default driver ops implementations
405 */ 428 */
406extern void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf); 429extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
407extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); 430extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
408extern void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp); 431extern void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp);
409extern void ata_tf_from_fis(u8 *fis, struct ata_taskfile *tf); 432extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf);
410extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); 433extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device);
411extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); 434extern void ata_std_dev_select (struct ata_port *ap, unsigned int device);
412extern u8 ata_check_status(struct ata_port *ap); 435extern u8 ata_check_status(struct ata_port *ap);
413extern u8 ata_altstatus(struct ata_port *ap); 436extern u8 ata_altstatus(struct ata_port *ap);
414extern u8 ata_chk_err(struct ata_port *ap); 437extern u8 ata_chk_err(struct ata_port *ap);
415extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf); 438extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf);
416extern int ata_port_start (struct ata_port *ap); 439extern int ata_port_start (struct ata_port *ap);
417extern void ata_port_stop (struct ata_port *ap); 440extern void ata_port_stop (struct ata_port *ap);
418extern void ata_host_stop (struct ata_host_set *host_set); 441extern void ata_host_stop (struct ata_host_set *host_set);
@@ -423,8 +446,8 @@ extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf,
423 unsigned int buflen); 446 unsigned int buflen);
424extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, 447extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
425 unsigned int n_elem); 448 unsigned int n_elem);
426extern unsigned int ata_dev_classify(struct ata_taskfile *tf); 449extern unsigned int ata_dev_classify(const struct ata_taskfile *tf);
427extern void ata_dev_id_string(u16 *id, unsigned char *s, 450extern void ata_dev_id_string(const u16 *id, unsigned char *s,
428 unsigned int ofs, unsigned int len); 451 unsigned int ofs, unsigned int len);
429extern void ata_dev_config(struct ata_port *ap, unsigned int i); 452extern void ata_dev_config(struct ata_port *ap, unsigned int i);
430extern void ata_bmdma_setup (struct ata_queued_cmd *qc); 453extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
@@ -441,6 +464,32 @@ extern int ata_std_bios_param(struct scsi_device *sdev,
441 sector_t capacity, int geom[]); 464 sector_t capacity, int geom[]);
442extern int ata_scsi_slave_config(struct scsi_device *sdev); 465extern int ata_scsi_slave_config(struct scsi_device *sdev);
443 466
467/*
468 * Timing helpers
469 */
470extern int ata_timing_compute(struct ata_device *, unsigned short,
471 struct ata_timing *, int, int);
472extern void ata_timing_merge(const struct ata_timing *,
473 const struct ata_timing *, struct ata_timing *,
474 unsigned int);
475
476enum {
477 ATA_TIMING_SETUP = (1 << 0),
478 ATA_TIMING_ACT8B = (1 << 1),
479 ATA_TIMING_REC8B = (1 << 2),
480 ATA_TIMING_CYC8B = (1 << 3),
481 ATA_TIMING_8BIT = ATA_TIMING_ACT8B | ATA_TIMING_REC8B |
482 ATA_TIMING_CYC8B,
483 ATA_TIMING_ACTIVE = (1 << 4),
484 ATA_TIMING_RECOVER = (1 << 5),
485 ATA_TIMING_CYCLE = (1 << 6),
486 ATA_TIMING_UDMA = (1 << 7),
487 ATA_TIMING_ALL = ATA_TIMING_SETUP | ATA_TIMING_ACT8B |
488 ATA_TIMING_REC8B | ATA_TIMING_CYC8B |
489 ATA_TIMING_ACTIVE | ATA_TIMING_RECOVER |
490 ATA_TIMING_CYCLE | ATA_TIMING_UDMA,
491};
492
444 493
445#ifdef CONFIG_PCI 494#ifdef CONFIG_PCI
446struct pci_bits { 495struct pci_bits {
@@ -452,8 +501,8 @@ struct pci_bits {
452 501
453extern void ata_pci_host_stop (struct ata_host_set *host_set); 502extern void ata_pci_host_stop (struct ata_host_set *host_set);
454extern struct ata_probe_ent * 503extern struct ata_probe_ent *
455ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port); 504ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask);
456extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); 505extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
457 506
458#endif /* CONFIG_PCI */ 507#endif /* CONFIG_PCI */
459 508
@@ -463,7 +512,7 @@ static inline unsigned int ata_tag_valid(unsigned int tag)
463 return (tag < ATA_MAX_QUEUE) ? 1 : 0; 512 return (tag < ATA_MAX_QUEUE) ? 1 : 0;
464} 513}
465 514
466static inline unsigned int ata_dev_present(struct ata_device *dev) 515static inline unsigned int ata_dev_present(const struct ata_device *dev)
467{ 516{
468 return ((dev->class == ATA_DEV_ATA) || 517 return ((dev->class == ATA_DEV_ATA) ||
469 (dev->class == ATA_DEV_ATAPI)); 518 (dev->class == ATA_DEV_ATAPI));
@@ -662,7 +711,7 @@ static inline unsigned int sata_dev_present(struct ata_port *ap)
662 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; 711 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0;
663} 712}
664 713
665static inline int ata_try_flush_cache(struct ata_device *dev) 714static inline int ata_try_flush_cache(const struct ata_device *dev)
666{ 715{
667 return ata_id_wcache_enabled(dev->id) || 716 return ata_id_wcache_enabled(dev->id) ||
668 ata_id_has_flush(dev->id) || 717 ata_id_has_flush(dev->id) ||
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 53fa51595443..40f63c9879d2 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -52,7 +52,7 @@ struct loop_device {
52 unsigned lo_blocksize; 52 unsigned lo_blocksize;
53 void *key_data; 53 void *key_data;
54 54
55 int old_gfp_mask; 55 gfp_t old_gfp_mask;
56 56
57 spinlock_t lo_lock; 57 spinlock_t lo_lock;
58 struct bio *lo_bio; 58 struct bio *lo_bio;
diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h
index 9263d2db2d67..99e044b4efc6 100644
--- a/include/linux/mbcache.h
+++ b/include/linux/mbcache.h
@@ -22,7 +22,7 @@ struct mb_cache_entry {
22}; 22};
23 23
24struct mb_cache_op { 24struct mb_cache_op {
25 int (*free)(struct mb_cache_entry *, int); 25 int (*free)(struct mb_cache_entry *, gfp_t);
26}; 26};
27 27
28/* Functions on caches */ 28/* Functions on caches */
diff --git a/include/linux/memory.h b/include/linux/memory.h
new file mode 100644
index 000000000000..0def328ab5cf
--- /dev/null
+++ b/include/linux/memory.h
@@ -0,0 +1,94 @@
1/*
2 * include/linux/memory.h - generic memory definition
3 *
4 * This is mainly for topological representation. We define the
5 * basic "struct memory_block" here, which can be embedded in per-arch
6 * definitions or NUMA information.
7 *
8 * Basic handling of the devices is done in drivers/base/memory.c
9 * and system devices are handled in drivers/base/sys.c.
10 *
11 * Memory block are exported via sysfs in the class/memory/devices/
12 * directory.
13 *
14 */
15#ifndef _LINUX_MEMORY_H_
16#define _LINUX_MEMORY_H_
17
18#include <linux/sysdev.h>
19#include <linux/node.h>
20#include <linux/compiler.h>
21
22#include <asm/semaphore.h>
23
24struct memory_block {
25 unsigned long phys_index;
26 unsigned long state;
27 /*
28 * This serializes all state change requests. It isn't
29 * held during creation because the control files are
30 * created long after the critical areas during
31 * initialization.
32 */
33 struct semaphore state_sem;
34 int phys_device; /* to which fru does this belong? */
35 void *hw; /* optional pointer to fw/hw data */
36 int (*phys_callback)(struct memory_block *);
37 struct sys_device sysdev;
38};
39
40/* These states are exposed to userspace as text strings in sysfs */
41#define MEM_ONLINE (1<<0) /* exposed to userspace */
42#define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */
43#define MEM_OFFLINE (1<<2) /* exposed to userspace */
44
45/*
46 * All of these states are currently kernel-internal for notifying
47 * kernel components and architectures.
48 *
49 * For MEM_MAPPING_INVALID, all notifier chains with priority >0
50 * are called before pfn_to_page() becomes invalid. The priority=0
51 * entry is reserved for the function that actually makes
52 * pfn_to_page() stop working. Any notifiers that want to be called
53 * after that should have priority <0.
54 */
55#define MEM_MAPPING_INVALID (1<<3)
56
57#ifndef CONFIG_MEMORY_HOTPLUG
58static inline int memory_dev_init(void)
59{
60 return 0;
61}
62static inline int register_memory_notifier(struct notifier_block *nb)
63{
64 return 0;
65}
66static inline void unregister_memory_notifier(struct notifier_block *nb)
67{
68}
69#else
70extern int register_memory(struct memory_block *, struct mem_section *section, struct node *);
71extern int register_new_memory(struct mem_section *);
72extern int unregister_memory_section(struct mem_section *);
73extern int memory_dev_init(void);
74extern int register_memory_notifier(struct notifier_block *nb);
75extern void unregister_memory_notifier(struct notifier_block *nb);
76
77#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
78
79extern int invalidate_phys_mapping(unsigned long, unsigned long);
80struct notifier_block;
81
82extern int register_memory_notifier(struct notifier_block *nb);
83extern void unregister_memory_notifier(struct notifier_block *nb);
84
85extern struct sysdev_class memory_sysdev_class;
86#endif /* CONFIG_MEMORY_HOTPLUG */
87
88#define hotplug_memory_notifier(fn, pri) { \
89 static struct notifier_block fn##_mem_nb = \
90 { .notifier_call = fn, .priority = pri }; \
91 register_memory_notifier(&fn##_mem_nb); \
92}
93
94#endif /* _LINUX_MEMORY_H_ */
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
new file mode 100644
index 000000000000..01f03bc06eff
--- /dev/null
+++ b/include/linux/memory_hotplug.h
@@ -0,0 +1,104 @@
1#ifndef __LINUX_MEMORY_HOTPLUG_H
2#define __LINUX_MEMORY_HOTPLUG_H
3
4#include <linux/mmzone.h>
5#include <linux/spinlock.h>
6#include <linux/mmzone.h>
7#include <linux/notifier.h>
8
9#ifdef CONFIG_MEMORY_HOTPLUG
10/*
11 * pgdat resizing functions
12 */
13static inline
14void pgdat_resize_lock(struct pglist_data *pgdat, unsigned long *flags)
15{
16 spin_lock_irqsave(&pgdat->node_size_lock, *flags);
17}
18static inline
19void pgdat_resize_unlock(struct pglist_data *pgdat, unsigned long *flags)
20{
21 spin_unlock_irqrestore(&pgdat->node_size_lock, *flags);
22}
23static inline
24void pgdat_resize_init(struct pglist_data *pgdat)
25{
26 spin_lock_init(&pgdat->node_size_lock);
27}
28/*
29 * Zone resizing functions
30 */
31static inline unsigned zone_span_seqbegin(struct zone *zone)
32{
33 return read_seqbegin(&zone->span_seqlock);
34}
35static inline int zone_span_seqretry(struct zone *zone, unsigned iv)
36{
37 return read_seqretry(&zone->span_seqlock, iv);
38}
39static inline void zone_span_writelock(struct zone *zone)
40{
41 write_seqlock(&zone->span_seqlock);
42}
43static inline void zone_span_writeunlock(struct zone *zone)
44{
45 write_sequnlock(&zone->span_seqlock);
46}
47static inline void zone_seqlock_init(struct zone *zone)
48{
49 seqlock_init(&zone->span_seqlock);
50}
51extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages);
52extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages);
53extern int add_one_highpage(struct page *page, int pfn, int bad_ppro);
54/* need some defines for these for archs that don't support it */
55extern void online_page(struct page *page);
56/* VM interface that may be used by firmware interface */
57extern int add_memory(u64 start, u64 size);
58extern int remove_memory(u64 start, u64 size);
59extern int online_pages(unsigned long, unsigned long);
60
61/* reasonably generic interface to expand the physical pages in a zone */
62extern int __add_pages(struct zone *zone, unsigned long start_pfn,
63 unsigned long nr_pages);
64#else /* ! CONFIG_MEMORY_HOTPLUG */
65/*
66 * Stub functions for when hotplug is off
67 */
68static inline void pgdat_resize_lock(struct pglist_data *p, unsigned long *f) {}
69static inline void pgdat_resize_unlock(struct pglist_data *p, unsigned long *f) {}
70static inline void pgdat_resize_init(struct pglist_data *pgdat) {}
71
72static inline unsigned zone_span_seqbegin(struct zone *zone)
73{
74 return 0;
75}
76static inline int zone_span_seqretry(struct zone *zone, unsigned iv)
77{
78 return 0;
79}
80static inline void zone_span_writelock(struct zone *zone) {}
81static inline void zone_span_writeunlock(struct zone *zone) {}
82static inline void zone_seqlock_init(struct zone *zone) {}
83
84static inline int mhp_notimplemented(const char *func)
85{
86 printk(KERN_WARNING "%s() called, with CONFIG_MEMORY_HOTPLUG disabled\n", func);
87 dump_stack();
88 return -ENOSYS;
89}
90
91static inline int __add_pages(struct zone *zone, unsigned long start_pfn,
92 unsigned long nr_pages)
93{
94 return mhp_notimplemented(__FUNCTION__);
95}
96#endif /* ! CONFIG_MEMORY_HOTPLUG */
97static inline int __remove_pages(struct zone *zone, unsigned long start_pfn,
98 unsigned long nr_pages)
99{
100 printk(KERN_WARNING "%s() called, not yet supported\n", __FUNCTION__);
101 dump_stack();
102 return -ENOSYS;
103}
104#endif /* __LINUX_MEMORY_HOTPLUG_H */
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 58385ee1c0ac..7af8cb836e78 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -27,10 +27,10 @@
27 27
28#include <linux/config.h> 28#include <linux/config.h>
29#include <linux/mmzone.h> 29#include <linux/mmzone.h>
30#include <linux/bitmap.h>
31#include <linux/slab.h> 30#include <linux/slab.h>
32#include <linux/rbtree.h> 31#include <linux/rbtree.h>
33#include <linux/spinlock.h> 32#include <linux/spinlock.h>
33#include <linux/nodemask.h>
34 34
35struct vm_area_struct; 35struct vm_area_struct;
36 36
@@ -47,8 +47,7 @@ struct vm_area_struct;
47 * Locking policy for interlave: 47 * Locking policy for interlave:
48 * In process context there is no locking because only the process accesses 48 * In process context there is no locking because only the process accesses
49 * its own state. All vma manipulation is somewhat protected by a down_read on 49 * its own state. All vma manipulation is somewhat protected by a down_read on
50 * mmap_sem. For allocating in the interleave policy the page_table_lock 50 * mmap_sem.
51 * must be also aquired to protect il_next.
52 * 51 *
53 * Freeing policy: 52 * Freeing policy:
54 * When policy is MPOL_BIND v.zonelist is kmalloc'ed and must be kfree'd. 53 * When policy is MPOL_BIND v.zonelist is kmalloc'ed and must be kfree'd.
@@ -63,7 +62,7 @@ struct mempolicy {
63 union { 62 union {
64 struct zonelist *zonelist; /* bind */ 63 struct zonelist *zonelist; /* bind */
65 short preferred_node; /* preferred */ 64 short preferred_node; /* preferred */
66 DECLARE_BITMAP(nodes, MAX_NUMNODES); /* interleave */ 65 nodemask_t nodes; /* interleave */
67 /* undefined for default */ 66 /* undefined for default */
68 } v; 67 } v;
69}; 68};
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 9b8d0476988a..68f5a0f392dd 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -158,6 +158,7 @@ extern int mii_link_ok (struct mii_if_info *mii);
158extern int mii_nway_restart (struct mii_if_info *mii); 158extern int mii_nway_restart (struct mii_if_info *mii);
159extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); 159extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
160extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); 160extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
161extern int mii_check_gmii_support(struct mii_if_info *mii);
161extern void mii_check_link (struct mii_if_info *mii); 162extern void mii_check_link (struct mii_if_info *mii);
162extern unsigned int mii_check_media (struct mii_if_info *mii, 163extern unsigned int mii_check_media (struct mii_if_info *mii,
163 unsigned int ok_to_print, 164 unsigned int ok_to_print,
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 097b3a3c693d..5c1fb0a2e806 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -157,7 +157,7 @@ extern unsigned int kobjsize(const void *objp);
157 157
158#define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */ 158#define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */
159#define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ 159#define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */
160#define VM_RESERVED 0x00080000 /* Don't unmap it from swap_out */ 160#define VM_RESERVED 0x00080000 /* Pages managed in a special way */
161#define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ 161#define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */
162#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ 162#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
163#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ 163#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
@@ -226,13 +226,18 @@ struct page {
226 * to show when page is mapped 226 * to show when page is mapped
227 * & limit reverse map searches. 227 * & limit reverse map searches.
228 */ 228 */
229 unsigned long private; /* Mapping-private opaque data: 229 union {
230 unsigned long private; /* Mapping-private opaque data:
230 * usually used for buffer_heads 231 * usually used for buffer_heads
231 * if PagePrivate set; used for 232 * if PagePrivate set; used for
232 * swp_entry_t if PageSwapCache 233 * swp_entry_t if PageSwapCache
233 * When page is free, this indicates 234 * When page is free, this indicates
234 * order in the buddy system. 235 * order in the buddy system.
235 */ 236 */
237#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
238 spinlock_t ptl;
239#endif
240 } u;
236 struct address_space *mapping; /* If low bit clear, points to 241 struct address_space *mapping; /* If low bit clear, points to
237 * inode address_space, or NULL. 242 * inode address_space, or NULL.
238 * If page mapped as anonymous 243 * If page mapped as anonymous
@@ -260,6 +265,9 @@ struct page {
260#endif /* WANT_PAGE_VIRTUAL */ 265#endif /* WANT_PAGE_VIRTUAL */
261}; 266};
262 267
268#define page_private(page) ((page)->u.private)
269#define set_page_private(page, v) ((page)->u.private = (v))
270
263/* 271/*
264 * FIXME: take this include out, include page-flags.h in 272 * FIXME: take this include out, include page-flags.h in
265 * files which need it (119 of them) 273 * files which need it (119 of them)
@@ -311,17 +319,17 @@ extern void FASTCALL(__page_cache_release(struct page *));
311 319
312#ifdef CONFIG_HUGETLB_PAGE 320#ifdef CONFIG_HUGETLB_PAGE
313 321
314static inline int page_count(struct page *p) 322static inline int page_count(struct page *page)
315{ 323{
316 if (PageCompound(p)) 324 if (PageCompound(page))
317 p = (struct page *)p->private; 325 page = (struct page *)page_private(page);
318 return atomic_read(&(p)->_count) + 1; 326 return atomic_read(&page->_count) + 1;
319} 327}
320 328
321static inline void get_page(struct page *page) 329static inline void get_page(struct page *page)
322{ 330{
323 if (unlikely(PageCompound(page))) 331 if (unlikely(PageCompound(page)))
324 page = (struct page *)page->private; 332 page = (struct page *)page_private(page);
325 atomic_inc(&page->_count); 333 atomic_inc(&page->_count);
326} 334}
327 335
@@ -338,7 +346,7 @@ static inline void get_page(struct page *page)
338 346
339static inline void put_page(struct page *page) 347static inline void put_page(struct page *page)
340{ 348{
341 if (!PageReserved(page) && put_page_testzero(page)) 349 if (put_page_testzero(page))
342 __page_cache_release(page); 350 __page_cache_release(page);
343} 351}
344 352
@@ -587,7 +595,7 @@ static inline int PageAnon(struct page *page)
587static inline pgoff_t page_index(struct page *page) 595static inline pgoff_t page_index(struct page *page)
588{ 596{
589 if (unlikely(PageSwapCache(page))) 597 if (unlikely(PageSwapCache(page)))
590 return page->private; 598 return page_private(page);
591 return page->index; 599 return page->index;
592} 600}
593 601
@@ -682,7 +690,7 @@ struct zap_details {
682 690
683unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, 691unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address,
684 unsigned long size, struct zap_details *); 692 unsigned long size, struct zap_details *);
685unsigned long unmap_vmas(struct mmu_gather **tlb, struct mm_struct *mm, 693unsigned long unmap_vmas(struct mmu_gather **tlb,
686 struct vm_area_struct *start_vma, unsigned long start_addr, 694 struct vm_area_struct *start_vma, unsigned long start_addr,
687 unsigned long end_addr, unsigned long *nr_accounted, 695 unsigned long end_addr, unsigned long *nr_accounted,
688 struct zap_details *); 696 struct zap_details *);
@@ -704,10 +712,6 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
704} 712}
705 713
706extern int vmtruncate(struct inode * inode, loff_t offset); 714extern int vmtruncate(struct inode * inode, loff_t offset);
707extern pud_t *FASTCALL(__pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address));
708extern pmd_t *FASTCALL(__pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address));
709extern pte_t *FASTCALL(pte_alloc_kernel(struct mm_struct *mm, pmd_t *pmd, unsigned long address));
710extern pte_t *FASTCALL(pte_alloc_map(struct mm_struct *mm, pmd_t *pmd, unsigned long address));
711extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); 715extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot);
712extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); 716extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot);
713extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access); 717extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access);
@@ -723,6 +727,7 @@ void install_arg_page(struct vm_area_struct *, struct page *, unsigned long);
723 727
724int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, 728int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start,
725 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); 729 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas);
730void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long);
726 731
727int __set_page_dirty_buffers(struct page *page); 732int __set_page_dirty_buffers(struct page *page);
728int __set_page_dirty_nobuffers(struct page *page); 733int __set_page_dirty_nobuffers(struct page *page);
@@ -747,7 +752,7 @@ extern unsigned long do_mremap(unsigned long addr,
747 * The callback will be passed nr_to_scan == 0 when the VM is querying the 752 * The callback will be passed nr_to_scan == 0 when the VM is querying the
748 * cache size, so a fastpath for that case is appropriate. 753 * cache size, so a fastpath for that case is appropriate.
749 */ 754 */
750typedef int (*shrinker_t)(int nr_to_scan, unsigned int gfp_mask); 755typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask);
751 756
752/* 757/*
753 * Add an aging callback. The int is the number of 'seeks' it takes 758 * Add an aging callback. The int is the number of 'seeks' it takes
@@ -759,38 +764,83 @@ struct shrinker;
759extern struct shrinker *set_shrinker(int, shrinker_t); 764extern struct shrinker *set_shrinker(int, shrinker_t);
760extern void remove_shrinker(struct shrinker *shrinker); 765extern void remove_shrinker(struct shrinker *shrinker);
761 766
762/* 767int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
763 * On a two-level or three-level page table, this ends up being trivial. Thus 768int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address);
764 * the inlining and the symmetry break with pte_alloc_map() that does all 769int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address);
765 * of this out-of-line. 770int __pte_alloc_kernel(pmd_t *pmd, unsigned long address);
766 */ 771
767/* 772/*
768 * The following ifdef needed to get the 4level-fixup.h header to work. 773 * The following ifdef needed to get the 4level-fixup.h header to work.
769 * Remove it when 4level-fixup.h has been removed. 774 * Remove it when 4level-fixup.h has been removed.
770 */ 775 */
771#ifdef CONFIG_MMU 776#if defined(CONFIG_MMU) && !defined(__ARCH_HAS_4LEVEL_HACK)
772#ifndef __ARCH_HAS_4LEVEL_HACK
773static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) 777static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
774{ 778{
775 if (pgd_none(*pgd)) 779 return (unlikely(pgd_none(*pgd)) && __pud_alloc(mm, pgd, address))?
776 return __pud_alloc(mm, pgd, address); 780 NULL: pud_offset(pgd, address);
777 return pud_offset(pgd, address);
778} 781}
779 782
780static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) 783static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
781{ 784{
782 if (pud_none(*pud)) 785 return (unlikely(pud_none(*pud)) && __pmd_alloc(mm, pud, address))?
783 return __pmd_alloc(mm, pud, address); 786 NULL: pmd_offset(pud, address);
784 return pmd_offset(pud, address);
785} 787}
786#endif 788#endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */
787#endif /* CONFIG_MMU */ 789
790#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
791/*
792 * We tuck a spinlock to guard each pagetable page into its struct page,
793 * at page->private, with BUILD_BUG_ON to make sure that this will not
794 * overflow into the next struct page (as it might with DEBUG_SPINLOCK).
795 * When freeing, reset page->mapping so free_pages_check won't complain.
796 */
797#define __pte_lockptr(page) &((page)->u.ptl)
798#define pte_lock_init(_page) do { \
799 spin_lock_init(__pte_lockptr(_page)); \
800} while (0)
801#define pte_lock_deinit(page) ((page)->mapping = NULL)
802#define pte_lockptr(mm, pmd) ({(void)(mm); __pte_lockptr(pmd_page(*(pmd)));})
803#else
804/*
805 * We use mm->page_table_lock to guard all pagetable pages of the mm.
806 */
807#define pte_lock_init(page) do {} while (0)
808#define pte_lock_deinit(page) do {} while (0)
809#define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;})
810#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
811
812#define pte_offset_map_lock(mm, pmd, address, ptlp) \
813({ \
814 spinlock_t *__ptl = pte_lockptr(mm, pmd); \
815 pte_t *__pte = pte_offset_map(pmd, address); \
816 *(ptlp) = __ptl; \
817 spin_lock(__ptl); \
818 __pte; \
819})
820
821#define pte_unmap_unlock(pte, ptl) do { \
822 spin_unlock(ptl); \
823 pte_unmap(pte); \
824} while (0)
825
826#define pte_alloc_map(mm, pmd, address) \
827 ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \
828 NULL: pte_offset_map(pmd, address))
829
830#define pte_alloc_map_lock(mm, pmd, address, ptlp) \
831 ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \
832 NULL: pte_offset_map_lock(mm, pmd, address, ptlp))
833
834#define pte_alloc_kernel(pmd, address) \
835 ((unlikely(!pmd_present(*(pmd))) && __pte_alloc_kernel(pmd, address))? \
836 NULL: pte_offset_kernel(pmd, address))
788 837
789extern void free_area_init(unsigned long * zones_size); 838extern void free_area_init(unsigned long * zones_size);
790extern void free_area_init_node(int nid, pg_data_t *pgdat, 839extern void free_area_init_node(int nid, pg_data_t *pgdat,
791 unsigned long * zones_size, unsigned long zone_start_pfn, 840 unsigned long * zones_size, unsigned long zone_start_pfn,
792 unsigned long *zholes_size); 841 unsigned long *zholes_size);
793extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); 842extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long);
843extern void setup_per_zone_pages_min(void);
794extern void mem_init(void); 844extern void mem_init(void);
795extern void show_mem(void); 845extern void show_mem(void);
796extern void si_meminfo(struct sysinfo * val); 846extern void si_meminfo(struct sysinfo * val);
@@ -834,6 +884,7 @@ extern int split_vma(struct mm_struct *,
834extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *); 884extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
835extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *, 885extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *,
836 struct rb_node **, struct rb_node *); 886 struct rb_node **, struct rb_node *);
887extern void unlink_file_vma(struct vm_area_struct *);
837extern struct vm_area_struct *copy_vma(struct vm_area_struct **, 888extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
838 unsigned long addr, unsigned long len, pgoff_t pgoff); 889 unsigned long addr, unsigned long len, pgoff_t pgoff);
839extern void exit_mmap(struct mm_struct *); 890extern void exit_mmap(struct mm_struct *);
@@ -894,7 +945,8 @@ void handle_ra_miss(struct address_space *mapping,
894unsigned long max_sane_readahead(unsigned long nr); 945unsigned long max_sane_readahead(unsigned long nr);
895 946
896/* Do stack extension */ 947/* Do stack extension */
897extern int expand_stack(struct vm_area_struct * vma, unsigned long address); 948extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
949extern int expand_upwards(struct vm_area_struct *vma, unsigned long address);
898 950
899/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ 951/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */
900extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); 952extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr);
@@ -917,40 +969,28 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma)
917 return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 969 return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
918} 970}
919 971
920extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr); 972struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
973struct page *vmalloc_to_page(void *addr);
974unsigned long vmalloc_to_pfn(void *addr);
975int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
976 unsigned long pfn, unsigned long size, pgprot_t);
921 977
922extern struct page * vmalloc_to_page(void *addr); 978struct page *follow_page(struct mm_struct *, unsigned long address,
923extern unsigned long vmalloc_to_pfn(void *addr); 979 unsigned int foll_flags);
924extern struct page * follow_page(struct mm_struct *mm, unsigned long address, 980#define FOLL_WRITE 0x01 /* check pte is writable */
925 int write); 981#define FOLL_TOUCH 0x02 /* mark page accessed */
926extern int check_user_page_readable(struct mm_struct *mm, unsigned long address); 982#define FOLL_GET 0x04 /* do get_page on page */
927int remap_pfn_range(struct vm_area_struct *, unsigned long, 983#define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */
928 unsigned long, unsigned long, pgprot_t);
929 984
930#ifdef CONFIG_PROC_FS 985#ifdef CONFIG_PROC_FS
931void __vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); 986void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
932#else 987#else
933static inline void __vm_stat_account(struct mm_struct *mm, 988static inline void vm_stat_account(struct mm_struct *mm,
934 unsigned long flags, struct file *file, long pages) 989 unsigned long flags, struct file *file, long pages)
935{ 990{
936} 991}
937#endif /* CONFIG_PROC_FS */ 992#endif /* CONFIG_PROC_FS */
938 993
939static inline void vm_stat_account(struct vm_area_struct *vma)
940{
941 __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file,
942 vma_pages(vma));
943}
944
945static inline void vm_stat_unaccount(struct vm_area_struct *vma)
946{
947 __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file,
948 -vma_pages(vma));
949}
950
951/* update per process rss and vm hiwater data */
952extern void update_mem_hiwater(struct task_struct *tsk);
953
954#ifndef CONFIG_DEBUG_PAGEALLOC 994#ifndef CONFIG_DEBUG_PAGEALLOC
955static inline void 995static inline void
956kernel_map_pages(struct page *page, int numpages, int enable) 996kernel_map_pages(struct page *page, int numpages, int enable)
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 1ab78e8d6c53..aef6042f8f0b 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -50,7 +50,7 @@ struct mmc_command {
50#define MMC_ERR_INVALID 5 50#define MMC_ERR_INVALID 5
51 51
52 struct mmc_data *data; /* data segment associated with cmd */ 52 struct mmc_data *data; /* data segment associated with cmd */
53 struct mmc_request *mrq; /* assoicated request */ 53 struct mmc_request *mrq; /* associated request */
54}; 54};
55 55
56struct mmc_data { 56struct mmc_data {
@@ -68,7 +68,7 @@ struct mmc_data {
68 unsigned int bytes_xfered; 68 unsigned int bytes_xfered;
69 69
70 struct mmc_command *stop; /* stop command */ 70 struct mmc_command *stop; /* stop command */
71 struct mmc_request *mrq; /* assoicated request */ 71 struct mmc_request *mrq; /* associated request */
72 72
73 unsigned int sg_len; /* size of scatter list */ 73 unsigned int sg_len; /* size of scatter list */
74 struct scatterlist *sg; /* I/O scatter list */ 74 struct scatterlist *sg; /* I/O scatter list */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 5ed471b58f4f..f5fa3082fd6a 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -12,6 +12,7 @@
12#include <linux/threads.h> 12#include <linux/threads.h>
13#include <linux/numa.h> 13#include <linux/numa.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/seqlock.h>
15#include <asm/atomic.h> 16#include <asm/atomic.h>
16 17
17/* Free memory management - zoned buddy allocator. */ 18/* Free memory management - zoned buddy allocator. */
@@ -137,6 +138,10 @@ struct zone {
137 * free areas of different sizes 138 * free areas of different sizes
138 */ 139 */
139 spinlock_t lock; 140 spinlock_t lock;
141#ifdef CONFIG_MEMORY_HOTPLUG
142 /* see spanned/present_pages for more description */
143 seqlock_t span_seqlock;
144#endif
140 struct free_area free_area[MAX_ORDER]; 145 struct free_area free_area[MAX_ORDER];
141 146
142 147
@@ -220,6 +225,16 @@ struct zone {
220 /* zone_start_pfn == zone_start_paddr >> PAGE_SHIFT */ 225 /* zone_start_pfn == zone_start_paddr >> PAGE_SHIFT */
221 unsigned long zone_start_pfn; 226 unsigned long zone_start_pfn;
222 227
228 /*
229 * zone_start_pfn, spanned_pages and present_pages are all
230 * protected by span_seqlock. It is a seqlock because it has
231 * to be read outside of zone->lock, and it is done in the main
232 * allocator path. But, it is written quite infrequently.
233 *
234 * The lock is declared along with zone->lock because it is
235 * frequently read in proximity to zone->lock. It's good to
236 * give them a chance of being in the same cacheline.
237 */
223 unsigned long spanned_pages; /* total size, including holes */ 238 unsigned long spanned_pages; /* total size, including holes */
224 unsigned long present_pages; /* amount of memory (excluding holes) */ 239 unsigned long present_pages; /* amount of memory (excluding holes) */
225 240
@@ -273,6 +288,16 @@ typedef struct pglist_data {
273 struct page *node_mem_map; 288 struct page *node_mem_map;
274#endif 289#endif
275 struct bootmem_data *bdata; 290 struct bootmem_data *bdata;
291#ifdef CONFIG_MEMORY_HOTPLUG
292 /*
293 * Must be held any time you expect node_start_pfn, node_present_pages
294 * or node_spanned_pages stay constant. Holding this will also
295 * guarantee that any pfn_valid() stays that way.
296 *
297 * Nests above zone->lock and zone->size_seqlock.
298 */
299 spinlock_t node_size_lock;
300#endif
276 unsigned long node_start_pfn; 301 unsigned long node_start_pfn;
277 unsigned long node_present_pages; /* total number of physical pages */ 302 unsigned long node_present_pages; /* total number of physical pages */
278 unsigned long node_spanned_pages; /* total size of physical page 303 unsigned long node_spanned_pages; /* total size of physical page
@@ -293,6 +318,8 @@ typedef struct pglist_data {
293#endif 318#endif
294#define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) 319#define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr))
295 320
321#include <linux/memory_hotplug.h>
322
296extern struct pglist_data *pgdat_list; 323extern struct pglist_data *pgdat_list;
297 324
298void __get_zone_counts(unsigned long *active, unsigned long *inactive, 325void __get_zone_counts(unsigned long *active, unsigned long *inactive,
@@ -302,7 +329,7 @@ void get_zone_counts(unsigned long *active, unsigned long *inactive,
302void build_all_zonelists(void); 329void build_all_zonelists(void);
303void wakeup_kswapd(struct zone *zone, int order); 330void wakeup_kswapd(struct zone *zone, int order);
304int zone_watermark_ok(struct zone *z, int order, unsigned long mark, 331int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
305 int alloc_type, int can_try_harder, int gfp_high); 332 int alloc_type, int can_try_harder, gfp_t gfp_high);
306 333
307#ifdef CONFIG_HAVE_MEMORY_PRESENT 334#ifdef CONFIG_HAVE_MEMORY_PRESENT
308void memory_present(int nid, unsigned long start, unsigned long end); 335void memory_present(int nid, unsigned long start, unsigned long end);
@@ -509,6 +536,7 @@ static inline struct mem_section *__nr_to_section(unsigned long nr)
509 return NULL; 536 return NULL;
510 return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; 537 return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK];
511} 538}
539extern int __section_nr(struct mem_section* ms);
512 540
513/* 541/*
514 * We use the lower bits of the mem_map pointer to store 542 * We use the lower bits of the mem_map pointer to store
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 2f0299a448f6..7b08c11ec4cc 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -244,4 +244,9 @@ struct pcmcia_device_id {
244#define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200 244#define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200
245#define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400 245#define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400
246 246
247/* I2C */
248struct i2c_device_id {
249 __u16 id;
250};
251
247#endif /* LINUX_MOD_DEVICETABLE_H */ 252#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 7db67b008cac..1c975d0d9e94 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -8,6 +8,7 @@ struct vfsmount;
8struct open_intent { 8struct open_intent {
9 int flags; 9 int flags;
10 int create_mode; 10 int create_mode;
11 struct file *file;
11}; 12};
12 13
13enum { MAX_NESTED_LINKS = 5 }; 14enum { MAX_NESTED_LINKS = 5 };
@@ -65,6 +66,13 @@ extern int FASTCALL(link_path_walk(const char *, struct nameidata *));
65extern void path_release(struct nameidata *); 66extern void path_release(struct nameidata *);
66extern void path_release_on_umount(struct nameidata *); 67extern void path_release_on_umount(struct nameidata *);
67 68
69extern int __user_path_lookup_open(const char __user *, unsigned lookup_flags, struct nameidata *nd, int open_flags);
70extern int path_lookup_open(const char *, unsigned lookup_flags, struct nameidata *, int open_flags);
71extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
72 int (*open)(struct inode *, struct file *));
73extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
74extern void release_open_intent(struct nameidata *);
75
68extern struct dentry * lookup_one_len(const char *, struct dentry *, int); 76extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
69extern struct dentry * lookup_hash(struct qstr *, struct dentry *); 77extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
70 78
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 368e4c825ff1..c6efce4a04a4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -308,6 +308,7 @@ struct net_device
308#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ 308#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
309#define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ 309#define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */
310#define NETIF_F_LLTX 4096 /* LockLess TX */ 310#define NETIF_F_LLTX 4096 /* LockLess TX */
311#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/
311 312
312 struct net_device *next_sched; 313 struct net_device *next_sched;
313 314
@@ -873,11 +874,9 @@ static inline void netif_rx_complete(struct net_device *dev)
873 874
874static inline void netif_poll_disable(struct net_device *dev) 875static inline void netif_poll_disable(struct net_device *dev)
875{ 876{
876 while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) { 877 while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state))
877 /* No hurry. */ 878 /* No hurry. */
878 current->state = TASK_INTERRUPTIBLE; 879 schedule_timeout_interruptible(1);
879 schedule_timeout(1);
880 }
881} 880}
882 881
883static inline void netif_poll_enable(struct net_device *dev) 882static inline void netif_poll_enable(struct net_device *dev)
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 9a6047ff1b25..325fe7ae49bb 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -41,6 +41,10 @@
41#define NFS_MAX_FILE_IO_BUFFER_SIZE 32768 41#define NFS_MAX_FILE_IO_BUFFER_SIZE 32768
42#define NFS_DEF_FILE_IO_BUFFER_SIZE 4096 42#define NFS_DEF_FILE_IO_BUFFER_SIZE 4096
43 43
44/* Default timeout values */
45#define NFS_MAX_UDP_TIMEOUT (60*HZ)
46#define NFS_MAX_TCP_TIMEOUT (600*HZ)
47
44/* 48/*
45 * superblock magic number for NFS 49 * superblock magic number for NFS
46 */ 50 */
@@ -137,6 +141,7 @@ struct nfs_inode {
137 unsigned long attrtimeo_timestamp; 141 unsigned long attrtimeo_timestamp;
138 __u64 change_attr; /* v4 only */ 142 __u64 change_attr; /* v4 only */
139 143
144 unsigned long last_updated;
140 /* "Generation counter" for the attribute cache. This is 145 /* "Generation counter" for the attribute cache. This is
141 * bumped whenever we update the metadata on the 146 * bumped whenever we update the metadata on the
142 * server. 147 * server.
@@ -236,13 +241,17 @@ static inline int nfs_caches_unstable(struct inode *inode)
236 return atomic_read(&NFS_I(inode)->data_updates) != 0; 241 return atomic_read(&NFS_I(inode)->data_updates) != 0;
237} 242}
238 243
244static inline void nfs_mark_for_revalidate(struct inode *inode)
245{
246 spin_lock(&inode->i_lock);
247 NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS;
248 spin_unlock(&inode->i_lock);
249}
250
239static inline void NFS_CACHEINV(struct inode *inode) 251static inline void NFS_CACHEINV(struct inode *inode)
240{ 252{
241 if (!nfs_caches_unstable(inode)) { 253 if (!nfs_caches_unstable(inode))
242 spin_lock(&inode->i_lock); 254 nfs_mark_for_revalidate(inode);
243 NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS;
244 spin_unlock(&inode->i_lock);
245 }
246} 255}
247 256
248static inline int nfs_server_capable(struct inode *inode, int cap) 257static inline int nfs_server_capable(struct inode *inode, int cap)
@@ -276,7 +285,7 @@ static inline long nfs_save_change_attribute(struct inode *inode)
276static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr) 285static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr)
277{ 286{
278 return !nfs_caches_unstable(inode) 287 return !nfs_caches_unstable(inode)
279 && chattr == NFS_I(inode)->cache_change_attribute; 288 && time_after_eq(chattr, NFS_I(inode)->cache_change_attribute);
280} 289}
281 290
282/* 291/*
@@ -286,6 +295,7 @@ extern void nfs_zap_caches(struct inode *);
286extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, 295extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
287 struct nfs_fattr *); 296 struct nfs_fattr *);
288extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); 297extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
298extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr);
289extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 299extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
290extern int nfs_permission(struct inode *, int, struct nameidata *); 300extern int nfs_permission(struct inode *, int, struct nameidata *);
291extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *); 301extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *);
@@ -312,6 +322,12 @@ extern void nfs_file_clear_open_context(struct file *filp);
312/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ 322/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
313extern u32 root_nfs_parse_addr(char *name); /*__init*/ 323extern u32 root_nfs_parse_addr(char *name); /*__init*/
314 324
325static inline void nfs_fattr_init(struct nfs_fattr *fattr)
326{
327 fattr->valid = 0;
328 fattr->time_start = jiffies;
329}
330
315/* 331/*
316 * linux/fs/nfs/file.c 332 * linux/fs/nfs/file.c
317 */ 333 */
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index a2bf6914ff1b..40718669b9c8 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -41,7 +41,7 @@ struct nfs_fattr {
41 __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */ 41 __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */
42 __u64 change_attr; /* NFSv4 change attribute */ 42 __u64 change_attr; /* NFSv4 change attribute */
43 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ 43 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
44 unsigned long timestamp; 44 unsigned long time_start;
45}; 45};
46 46
47#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ 47#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */
@@ -96,12 +96,13 @@ struct nfs4_change_info {
96 u64 after; 96 u64 after;
97}; 97};
98 98
99struct nfs_seqid;
99/* 100/*
100 * Arguments to the open call. 101 * Arguments to the open call.
101 */ 102 */
102struct nfs_openargs { 103struct nfs_openargs {
103 const struct nfs_fh * fh; 104 const struct nfs_fh * fh;
104 __u32 seqid; 105 struct nfs_seqid * seqid;
105 int open_flags; 106 int open_flags;
106 __u64 clientid; 107 __u64 clientid;
107 __u32 id; 108 __u32 id;
@@ -123,6 +124,7 @@ struct nfs_openres {
123 struct nfs4_change_info cinfo; 124 struct nfs4_change_info cinfo;
124 __u32 rflags; 125 __u32 rflags;
125 struct nfs_fattr * f_attr; 126 struct nfs_fattr * f_attr;
127 struct nfs_fattr * dir_attr;
126 const struct nfs_server *server; 128 const struct nfs_server *server;
127 int delegation_type; 129 int delegation_type;
128 nfs4_stateid delegation; 130 nfs4_stateid delegation;
@@ -136,7 +138,7 @@ struct nfs_openres {
136struct nfs_open_confirmargs { 138struct nfs_open_confirmargs {
137 const struct nfs_fh * fh; 139 const struct nfs_fh * fh;
138 nfs4_stateid stateid; 140 nfs4_stateid stateid;
139 __u32 seqid; 141 struct nfs_seqid * seqid;
140}; 142};
141 143
142struct nfs_open_confirmres { 144struct nfs_open_confirmres {
@@ -148,13 +150,16 @@ struct nfs_open_confirmres {
148 */ 150 */
149struct nfs_closeargs { 151struct nfs_closeargs {
150 struct nfs_fh * fh; 152 struct nfs_fh * fh;
151 nfs4_stateid stateid; 153 nfs4_stateid * stateid;
152 __u32 seqid; 154 struct nfs_seqid * seqid;
153 int open_flags; 155 int open_flags;
156 const u32 * bitmask;
154}; 157};
155 158
156struct nfs_closeres { 159struct nfs_closeres {
157 nfs4_stateid stateid; 160 nfs4_stateid stateid;
161 struct nfs_fattr * fattr;
162 const struct nfs_server *server;
158}; 163};
159/* 164/*
160 * * Arguments to the lock,lockt, and locku call. 165 * * Arguments to the lock,lockt, and locku call.
@@ -164,30 +169,19 @@ struct nfs_lowner {
164 u32 id; 169 u32 id;
165}; 170};
166 171
167struct nfs_open_to_lock {
168 __u32 open_seqid;
169 nfs4_stateid open_stateid;
170 __u32 lock_seqid;
171 struct nfs_lowner lock_owner;
172};
173
174struct nfs_exist_lock {
175 nfs4_stateid stateid;
176 __u32 seqid;
177};
178
179struct nfs_lock_opargs { 172struct nfs_lock_opargs {
173 struct nfs_seqid * lock_seqid;
174 nfs4_stateid * lock_stateid;
175 struct nfs_seqid * open_seqid;
176 nfs4_stateid * open_stateid;
177 struct nfs_lowner lock_owner;
180 __u32 reclaim; 178 __u32 reclaim;
181 __u32 new_lock_owner; 179 __u32 new_lock_owner;
182 union {
183 struct nfs_open_to_lock *open_lock;
184 struct nfs_exist_lock *exist_lock;
185 } u;
186}; 180};
187 181
188struct nfs_locku_opargs { 182struct nfs_locku_opargs {
189 __u32 seqid; 183 struct nfs_seqid * seqid;
190 nfs4_stateid stateid; 184 nfs4_stateid * stateid;
191}; 185};
192 186
193struct nfs_lockargs { 187struct nfs_lockargs {
@@ -262,6 +256,7 @@ struct nfs_writeargs {
262 enum nfs3_stable_how stable; 256 enum nfs3_stable_how stable;
263 unsigned int pgbase; 257 unsigned int pgbase;
264 struct page ** pages; 258 struct page ** pages;
259 const u32 * bitmask;
265}; 260};
266 261
267struct nfs_writeverf { 262struct nfs_writeverf {
@@ -273,6 +268,7 @@ struct nfs_writeres {
273 struct nfs_fattr * fattr; 268 struct nfs_fattr * fattr;
274 struct nfs_writeverf * verf; 269 struct nfs_writeverf * verf;
275 __u32 count; 270 __u32 count;
271 const struct nfs_server *server;
276}; 272};
277 273
278/* 274/*
@@ -550,6 +546,7 @@ struct nfs4_create_res {
550 struct nfs_fh * fh; 546 struct nfs_fh * fh;
551 struct nfs_fattr * fattr; 547 struct nfs_fattr * fattr;
552 struct nfs4_change_info dir_cinfo; 548 struct nfs4_change_info dir_cinfo;
549 struct nfs_fattr * dir_fattr;
553}; 550};
554 551
555struct nfs4_fsinfo_arg { 552struct nfs4_fsinfo_arg {
@@ -571,8 +568,17 @@ struct nfs4_link_arg {
571 const struct nfs_fh * fh; 568 const struct nfs_fh * fh;
572 const struct nfs_fh * dir_fh; 569 const struct nfs_fh * dir_fh;
573 const struct qstr * name; 570 const struct qstr * name;
571 const u32 * bitmask;
572};
573
574struct nfs4_link_res {
575 const struct nfs_server * server;
576 struct nfs_fattr * fattr;
577 struct nfs4_change_info cinfo;
578 struct nfs_fattr * dir_attr;
574}; 579};
575 580
581
576struct nfs4_lookup_arg { 582struct nfs4_lookup_arg {
577 const struct nfs_fh * dir_fh; 583 const struct nfs_fh * dir_fh;
578 const struct qstr * name; 584 const struct qstr * name;
@@ -619,6 +625,13 @@ struct nfs4_readlink {
619struct nfs4_remove_arg { 625struct nfs4_remove_arg {
620 const struct nfs_fh * fh; 626 const struct nfs_fh * fh;
621 const struct qstr * name; 627 const struct qstr * name;
628 const u32 * bitmask;
629};
630
631struct nfs4_remove_res {
632 const struct nfs_server * server;
633 struct nfs4_change_info cinfo;
634 struct nfs_fattr * dir_attr;
622}; 635};
623 636
624struct nfs4_rename_arg { 637struct nfs4_rename_arg {
@@ -626,11 +639,15 @@ struct nfs4_rename_arg {
626 const struct nfs_fh * new_dir; 639 const struct nfs_fh * new_dir;
627 const struct qstr * old_name; 640 const struct qstr * old_name;
628 const struct qstr * new_name; 641 const struct qstr * new_name;
642 const u32 * bitmask;
629}; 643};
630 644
631struct nfs4_rename_res { 645struct nfs4_rename_res {
646 const struct nfs_server * server;
632 struct nfs4_change_info old_cinfo; 647 struct nfs4_change_info old_cinfo;
648 struct nfs_fattr * old_fattr;
633 struct nfs4_change_info new_cinfo; 649 struct nfs4_change_info new_cinfo;
650 struct nfs_fattr * new_fattr;
634}; 651};
635 652
636struct nfs4_setclientid { 653struct nfs4_setclientid {
@@ -722,7 +739,7 @@ struct nfs_rpc_ops {
722 int (*write) (struct nfs_write_data *); 739 int (*write) (struct nfs_write_data *);
723 int (*commit) (struct nfs_write_data *); 740 int (*commit) (struct nfs_write_data *);
724 int (*create) (struct inode *, struct dentry *, 741 int (*create) (struct inode *, struct dentry *,
725 struct iattr *, int); 742 struct iattr *, int, struct nameidata *);
726 int (*remove) (struct inode *, struct qstr *); 743 int (*remove) (struct inode *, struct qstr *);
727 int (*unlink_setup) (struct rpc_message *, 744 int (*unlink_setup) (struct rpc_message *,
728 struct dentry *, struct qstr *); 745 struct dentry *, struct qstr *);
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index acbf31c154f8..ba6c310a055f 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -21,16 +21,17 @@
21 21
22static inline gfp_t mapping_gfp_mask(struct address_space * mapping) 22static inline gfp_t mapping_gfp_mask(struct address_space * mapping)
23{ 23{
24 return mapping->flags & __GFP_BITS_MASK; 24 return (__force gfp_t)mapping->flags & __GFP_BITS_MASK;
25} 25}
26 26
27/* 27/*
28 * This is non-atomic. Only to be used before the mapping is activated. 28 * This is non-atomic. Only to be used before the mapping is activated.
29 * Probably needs a barrier... 29 * Probably needs a barrier...
30 */ 30 */
31static inline void mapping_set_gfp_mask(struct address_space *m, int mask) 31static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask)
32{ 32{
33 m->flags = (m->flags & ~__GFP_BITS_MASK) | mask; 33 m->flags = (m->flags & ~(__force unsigned long)__GFP_BITS_MASK) |
34 (__force unsigned long)mask;
34} 35}
35 36
36/* 37/*
@@ -69,7 +70,7 @@ extern struct page * find_lock_page(struct address_space *mapping,
69extern struct page * find_trylock_page(struct address_space *mapping, 70extern struct page * find_trylock_page(struct address_space *mapping,
70 unsigned long index); 71 unsigned long index);
71extern struct page * find_or_create_page(struct address_space *mapping, 72extern struct page * find_or_create_page(struct address_space *mapping,
72 unsigned long index, unsigned int gfp_mask); 73 unsigned long index, gfp_t gfp_mask);
73unsigned find_get_pages(struct address_space *mapping, pgoff_t start, 74unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
74 unsigned int nr_pages, struct page **pages); 75 unsigned int nr_pages, struct page **pages);
75unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, 76unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index,
@@ -92,9 +93,9 @@ extern int read_cache_pages(struct address_space *mapping,
92 struct list_head *pages, filler_t *filler, void *data); 93 struct list_head *pages, filler_t *filler, void *data);
93 94
94int add_to_page_cache(struct page *page, struct address_space *mapping, 95int add_to_page_cache(struct page *page, struct address_space *mapping,
95 unsigned long index, int gfp_mask); 96 unsigned long index, gfp_t gfp_mask);
96int add_to_page_cache_lru(struct page *page, struct address_space *mapping, 97int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
97 unsigned long index, int gfp_mask); 98 unsigned long index, gfp_t gfp_mask);
98extern void remove_from_page_cache(struct page *page); 99extern void remove_from_page_cache(struct page *page);
99extern void __remove_from_page_cache(struct page *page); 100extern void __remove_from_page_cache(struct page *page);
100 101
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 7349058ed778..3596ac94ecff 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -132,6 +132,7 @@ struct pci_dev {
132 unsigned int is_enabled:1; /* pci_enable_device has been called */ 132 unsigned int is_enabled:1; /* pci_enable_device has been called */
133 unsigned int is_busmaster:1; /* device is busmaster */ 133 unsigned int is_busmaster:1; /* device is busmaster */
134 unsigned int no_msi:1; /* device may not use msi */ 134 unsigned int no_msi:1; /* device may not use msi */
135 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */
135 136
136 u32 saved_config_space[16]; /* config space saved at suspend time */ 137 u32 saved_config_space[16]; /* config space saved at suspend time */
137 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ 138 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */
@@ -490,6 +491,9 @@ extern void pci_disable_msix(struct pci_dev *dev);
490extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); 491extern void msi_remove_pci_irq_vectors(struct pci_dev *dev);
491#endif 492#endif
492 493
494extern void pci_block_user_cfg_access(struct pci_dev *dev);
495extern void pci_unblock_user_cfg_access(struct pci_dev *dev);
496
493/* 497/*
494 * PCI domain support. Sometimes called PCI segment (eg by ACPI), 498 * PCI domain support. Sometimes called PCI segment (eg by ACPI),
495 * a PCI domain is defined to be a set of PCI busses which share 499 * a PCI domain is defined to be a set of PCI busses which share
@@ -560,6 +564,9 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int en
560 564
561#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) 565#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
562 566
567static inline void pci_block_user_cfg_access(struct pci_dev *dev) { }
568static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { }
569
563#endif /* CONFIG_PCI */ 570#endif /* CONFIG_PCI */
564 571
565/* Include architecture-dependent settings and functions */ 572/* Include architecture-dependent settings and functions */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index f74ed9462475..56192005fa4d 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -96,6 +96,9 @@
96#define PCI_CLASS_SERIAL_ACCESS 0x0c01 96#define PCI_CLASS_SERIAL_ACCESS 0x0c01
97#define PCI_CLASS_SERIAL_SSA 0x0c02 97#define PCI_CLASS_SERIAL_SSA 0x0c02
98#define PCI_CLASS_SERIAL_USB 0x0c03 98#define PCI_CLASS_SERIAL_USB 0x0c03
99#define PCI_CLASS_SERIAL_USB_UHCI 0x0c0300
100#define PCI_CLASS_SERIAL_USB_OHCI 0x0c0310
101#define PCI_CLASS_SERIAL_USB_EHCI 0x0c0320
99#define PCI_CLASS_SERIAL_FIBER 0x0c04 102#define PCI_CLASS_SERIAL_FIBER 0x0c04
100#define PCI_CLASS_SERIAL_SMBUS 0x0c05 103#define PCI_CLASS_SERIAL_SMBUS 0x0c05
101 104
@@ -132,9 +135,6 @@
132 135
133#define PCI_VENDOR_ID_COMPAQ 0x0e11 136#define PCI_VENDOR_ID_COMPAQ 0x0e11
134#define PCI_DEVICE_ID_COMPAQ_TOKENRING 0x0508 137#define PCI_DEVICE_ID_COMPAQ_TOKENRING 0x0508
135#define PCI_DEVICE_ID_COMPAQ_1280 0x3033
136#define PCI_DEVICE_ID_COMPAQ_TRIFLEX 0x4000
137#define PCI_DEVICE_ID_COMPAQ_6010 0x6010
138#define PCI_DEVICE_ID_COMPAQ_TACHYON 0xa0fc 138#define PCI_DEVICE_ID_COMPAQ_TACHYON 0xa0fc
139#define PCI_DEVICE_ID_COMPAQ_SMART2P 0xae10 139#define PCI_DEVICE_ID_COMPAQ_SMART2P 0xae10
140#define PCI_DEVICE_ID_COMPAQ_NETEL100 0xae32 140#define PCI_DEVICE_ID_COMPAQ_NETEL100 0xae32
@@ -274,7 +274,6 @@
274#define PCI_DEVICE_ID_ATI_RAGE128_PP 0x5050 274#define PCI_DEVICE_ID_ATI_RAGE128_PP 0x5050
275#define PCI_DEVICE_ID_ATI_RAGE128_PQ 0x5051 275#define PCI_DEVICE_ID_ATI_RAGE128_PQ 0x5051
276#define PCI_DEVICE_ID_ATI_RAGE128_PR 0x5052 276#define PCI_DEVICE_ID_ATI_RAGE128_PR 0x5052
277#define PCI_DEVICE_ID_ATI_RAGE128_TR 0x5452
278#define PCI_DEVICE_ID_ATI_RAGE128_PS 0x5053 277#define PCI_DEVICE_ID_ATI_RAGE128_PS 0x5053
279#define PCI_DEVICE_ID_ATI_RAGE128_PT 0x5054 278#define PCI_DEVICE_ID_ATI_RAGE128_PT 0x5054
280#define PCI_DEVICE_ID_ATI_RAGE128_PU 0x5055 279#define PCI_DEVICE_ID_ATI_RAGE128_PU 0x5055
@@ -282,8 +281,6 @@
282#define PCI_DEVICE_ID_ATI_RAGE128_PW 0x5057 281#define PCI_DEVICE_ID_ATI_RAGE128_PW 0x5057
283#define PCI_DEVICE_ID_ATI_RAGE128_PX 0x5058 282#define PCI_DEVICE_ID_ATI_RAGE128_PX 0x5058
284/* Rage128 M4 */ 283/* Rage128 M4 */
285#define PCI_DEVICE_ID_ATI_RADEON_LE 0x4d45
286#define PCI_DEVICE_ID_ATI_RADEON_LF 0x4d46
287/* Radeon R100 */ 284/* Radeon R100 */
288#define PCI_DEVICE_ID_ATI_RADEON_QD 0x5144 285#define PCI_DEVICE_ID_ATI_RADEON_QD 0x5144
289#define PCI_DEVICE_ID_ATI_RADEON_QE 0x5145 286#define PCI_DEVICE_ID_ATI_RADEON_QE 0x5145
@@ -304,32 +301,22 @@
304#define PCI_DEVICE_ID_ATI_RADEON_QW 0x5157 301#define PCI_DEVICE_ID_ATI_RADEON_QW 0x5157
305#define PCI_DEVICE_ID_ATI_RADEON_QX 0x5158 302#define PCI_DEVICE_ID_ATI_RADEON_QX 0x5158
306/* Radeon NV-100 */ 303/* Radeon NV-100 */
307#define PCI_DEVICE_ID_ATI_RADEON_N1 0x5159
308#define PCI_DEVICE_ID_ATI_RADEON_N2 0x515a
309/* Radeon RV250 (9000) */ 304/* Radeon RV250 (9000) */
310#define PCI_DEVICE_ID_ATI_RADEON_Id 0x4964 305#define PCI_DEVICE_ID_ATI_RADEON_Id 0x4964
311#define PCI_DEVICE_ID_ATI_RADEON_Ie 0x4965 306#define PCI_DEVICE_ID_ATI_RADEON_Ie 0x4965
312#define PCI_DEVICE_ID_ATI_RADEON_If 0x4966 307#define PCI_DEVICE_ID_ATI_RADEON_If 0x4966
313#define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967 308#define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967
314/* Radeon RV280 (9200) */ 309/* Radeon RV280 (9200) */
315#define PCI_DEVICE_ID_ATI_RADEON_Y_ 0x5960
316#define PCI_DEVICE_ID_ATI_RADEON_Ya 0x5961 310#define PCI_DEVICE_ID_ATI_RADEON_Ya 0x5961
317#define PCI_DEVICE_ID_ATI_RADEON_Yd 0x5964 311#define PCI_DEVICE_ID_ATI_RADEON_Yd 0x5964
318/* Radeon R300 (9500) */ 312/* Radeon R300 (9500) */
319#define PCI_DEVICE_ID_ATI_RADEON_AD 0x4144
320/* Radeon R300 (9700) */ 313/* Radeon R300 (9700) */
321#define PCI_DEVICE_ID_ATI_RADEON_ND 0x4e44 314#define PCI_DEVICE_ID_ATI_RADEON_ND 0x4e44
322#define PCI_DEVICE_ID_ATI_RADEON_NE 0x4e45 315#define PCI_DEVICE_ID_ATI_RADEON_NE 0x4e45
323#define PCI_DEVICE_ID_ATI_RADEON_NF 0x4e46 316#define PCI_DEVICE_ID_ATI_RADEON_NF 0x4e46
324#define PCI_DEVICE_ID_ATI_RADEON_NG 0x4e47 317#define PCI_DEVICE_ID_ATI_RADEON_NG 0x4e47
325#define PCI_DEVICE_ID_ATI_RADEON_AE 0x4145
326#define PCI_DEVICE_ID_ATI_RADEON_AF 0x4146
327/* Radeon R350 (9800) */ 318/* Radeon R350 (9800) */
328#define PCI_DEVICE_ID_ATI_RADEON_NH 0x4e48
329#define PCI_DEVICE_ID_ATI_RADEON_NI 0x4e49
330/* Radeon RV350 (9600) */ 319/* Radeon RV350 (9600) */
331#define PCI_DEVICE_ID_ATI_RADEON_AP 0x4150
332#define PCI_DEVICE_ID_ATI_RADEON_AR 0x4152
333/* Radeon M6 */ 320/* Radeon M6 */
334#define PCI_DEVICE_ID_ATI_RADEON_LY 0x4c59 321#define PCI_DEVICE_ID_ATI_RADEON_LY 0x4c59
335#define PCI_DEVICE_ID_ATI_RADEON_LZ 0x4c5a 322#define PCI_DEVICE_ID_ATI_RADEON_LZ 0x4c5a
@@ -342,10 +329,6 @@
342#define PCI_DEVICE_ID_ATI_RADEON_Lf 0x4c66 329#define PCI_DEVICE_ID_ATI_RADEON_Lf 0x4c66
343#define PCI_DEVICE_ID_ATI_RADEON_Lg 0x4c67 330#define PCI_DEVICE_ID_ATI_RADEON_Lg 0x4c67
344/* Radeon */ 331/* Radeon */
345#define PCI_DEVICE_ID_ATI_RADEON_RA 0x5144
346#define PCI_DEVICE_ID_ATI_RADEON_RB 0x5145
347#define PCI_DEVICE_ID_ATI_RADEON_RC 0x5146
348#define PCI_DEVICE_ID_ATI_RADEON_RD 0x5147
349/* RadeonIGP */ 332/* RadeonIGP */
350#define PCI_DEVICE_ID_ATI_RS100 0xcab0 333#define PCI_DEVICE_ID_ATI_RS100 0xcab0
351#define PCI_DEVICE_ID_ATI_RS200 0xcab2 334#define PCI_DEVICE_ID_ATI_RS200 0xcab2
@@ -446,45 +429,28 @@
446#define PCI_DEVICE_ID_CIRRUS_5465 0x00d6 429#define PCI_DEVICE_ID_CIRRUS_5465 0x00d6
447#define PCI_DEVICE_ID_CIRRUS_6729 0x1100 430#define PCI_DEVICE_ID_CIRRUS_6729 0x1100
448#define PCI_DEVICE_ID_CIRRUS_6832 0x1110 431#define PCI_DEVICE_ID_CIRRUS_6832 0x1110
449#define PCI_DEVICE_ID_CIRRUS_7542 0x1200
450#define PCI_DEVICE_ID_CIRRUS_7543 0x1202 432#define PCI_DEVICE_ID_CIRRUS_7543 0x1202
451#define PCI_DEVICE_ID_CIRRUS_7541 0x1204
452#define PCI_DEVICE_ID_CIRRUS_4610 0x6001 433#define PCI_DEVICE_ID_CIRRUS_4610 0x6001
453#define PCI_DEVICE_ID_CIRRUS_4612 0x6003 434#define PCI_DEVICE_ID_CIRRUS_4612 0x6003
454#define PCI_DEVICE_ID_CIRRUS_4615 0x6004 435#define PCI_DEVICE_ID_CIRRUS_4615 0x6004
455#define PCI_DEVICE_ID_CIRRUS_4281 0x6005
456 436
457#define PCI_VENDOR_ID_IBM 0x1014 437#define PCI_VENDOR_ID_IBM 0x1014
458#define PCI_DEVICE_ID_IBM_FIRE_CORAL 0x000a
459#define PCI_DEVICE_ID_IBM_TR 0x0018 438#define PCI_DEVICE_ID_IBM_TR 0x0018
460#define PCI_DEVICE_ID_IBM_82G2675 0x001d
461#define PCI_DEVICE_ID_IBM_MCA 0x0020
462#define PCI_DEVICE_ID_IBM_82351 0x0022
463#define PCI_DEVICE_ID_IBM_PYTHON 0x002d
464#define PCI_DEVICE_ID_IBM_SERVERAID 0x002e
465#define PCI_DEVICE_ID_IBM_TR_WAKE 0x003e 439#define PCI_DEVICE_ID_IBM_TR_WAKE 0x003e
466#define PCI_DEVICE_ID_IBM_MPIC 0x0046
467#define PCI_DEVICE_ID_IBM_3780IDSP 0x007d
468#define PCI_DEVICE_ID_IBM_CHUKAR 0x0096
469#define PCI_DEVICE_ID_IBM_CPC710_PCI64 0x00fc 440#define PCI_DEVICE_ID_IBM_CPC710_PCI64 0x00fc
470#define PCI_DEVICE_ID_IBM_CPC710_PCI32 0x0105
471#define PCI_DEVICE_ID_IBM_405GP 0x0156
472#define PCI_DEVICE_ID_IBM_SNIPE 0x0180 441#define PCI_DEVICE_ID_IBM_SNIPE 0x0180
473#define PCI_DEVICE_ID_IBM_SERVERAIDI960 0x01bd
474#define PCI_DEVICE_ID_IBM_CITRINE 0x028C 442#define PCI_DEVICE_ID_IBM_CITRINE 0x028C
475#define PCI_DEVICE_ID_IBM_GEMSTONE 0xB166 443#define PCI_DEVICE_ID_IBM_GEMSTONE 0xB166
476#define PCI_DEVICE_ID_IBM_MPIC_2 0xffff
477#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_1 0x0031 444#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_1 0x0031
478#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2 0x0219 445#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2 0x0219
479#define PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX 0x021A 446#define PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX 0x021A
480#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM 0x0251 447#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM 0x0251
481#define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 448#define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252
482 449
483#define PCI_VENDOR_ID_COMPEX2 0x101a // pci.ids says "AT&T GIS (NCR)" 450#define PCI_VENDOR_ID_COMPEX2 0x101a /* pci.ids says "AT&T GIS (NCR)" */
484#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005 451#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005
485 452
486#define PCI_VENDOR_ID_WD 0x101c 453#define PCI_VENDOR_ID_WD 0x101c
487#define PCI_DEVICE_ID_WD_7197 0x3296
488#define PCI_DEVICE_ID_WD_90C 0xc24a 454#define PCI_DEVICE_ID_WD_90C 0xc24a
489 455
490#define PCI_VENDOR_ID_AMI 0x101e 456#define PCI_VENDOR_ID_AMI 0x101e
@@ -501,33 +467,18 @@
501#define PCI_DEVICE_ID_AMD_FE_GATE_7006 0x7006 467#define PCI_DEVICE_ID_AMD_FE_GATE_7006 0x7006
502#define PCI_DEVICE_ID_AMD_FE_GATE_7007 0x7007 468#define PCI_DEVICE_ID_AMD_FE_GATE_7007 0x7007
503#define PCI_DEVICE_ID_AMD_FE_GATE_700C 0x700C 469#define PCI_DEVICE_ID_AMD_FE_GATE_700C 0x700C
504#define PCI_DEVICE_ID_AMD_FE_GATE_700D 0x700D
505#define PCI_DEVICE_ID_AMD_FE_GATE_700E 0x700E 470#define PCI_DEVICE_ID_AMD_FE_GATE_700E 0x700E
506#define PCI_DEVICE_ID_AMD_FE_GATE_700F 0x700F
507#define PCI_DEVICE_ID_AMD_COBRA_7400 0x7400
508#define PCI_DEVICE_ID_AMD_COBRA_7401 0x7401 471#define PCI_DEVICE_ID_AMD_COBRA_7401 0x7401
509#define PCI_DEVICE_ID_AMD_COBRA_7403 0x7403
510#define PCI_DEVICE_ID_AMD_COBRA_7404 0x7404
511#define PCI_DEVICE_ID_AMD_VIPER_7408 0x7408
512#define PCI_DEVICE_ID_AMD_VIPER_7409 0x7409 472#define PCI_DEVICE_ID_AMD_VIPER_7409 0x7409
513#define PCI_DEVICE_ID_AMD_VIPER_740B 0x740B 473#define PCI_DEVICE_ID_AMD_VIPER_740B 0x740B
514#define PCI_DEVICE_ID_AMD_VIPER_740C 0x740C
515#define PCI_DEVICE_ID_AMD_VIPER_7410 0x7410 474#define PCI_DEVICE_ID_AMD_VIPER_7410 0x7410
516#define PCI_DEVICE_ID_AMD_VIPER_7411 0x7411 475#define PCI_DEVICE_ID_AMD_VIPER_7411 0x7411
517#define PCI_DEVICE_ID_AMD_VIPER_7413 0x7413 476#define PCI_DEVICE_ID_AMD_VIPER_7413 0x7413
518#define PCI_DEVICE_ID_AMD_VIPER_7414 0x7414 477#define PCI_DEVICE_ID_AMD_VIPER_7440 0x7440
519#define PCI_DEVICE_ID_AMD_OPUS_7440 0x7440
520# define PCI_DEVICE_ID_AMD_VIPER_7440 PCI_DEVICE_ID_AMD_OPUS_7440
521#define PCI_DEVICE_ID_AMD_OPUS_7441 0x7441 478#define PCI_DEVICE_ID_AMD_OPUS_7441 0x7441
522# define PCI_DEVICE_ID_AMD_VIPER_7441 PCI_DEVICE_ID_AMD_OPUS_7441
523#define PCI_DEVICE_ID_AMD_OPUS_7443 0x7443 479#define PCI_DEVICE_ID_AMD_OPUS_7443 0x7443
524# define PCI_DEVICE_ID_AMD_VIPER_7443 PCI_DEVICE_ID_AMD_OPUS_7443 480#define PCI_DEVICE_ID_AMD_VIPER_7443 0x7443
525#define PCI_DEVICE_ID_AMD_OPUS_7445 0x7445 481#define PCI_DEVICE_ID_AMD_OPUS_7445 0x7445
526#define PCI_DEVICE_ID_AMD_OPUS_7448 0x7448
527# define PCI_DEVICE_ID_AMD_VIPER_7448 PCI_DEVICE_ID_AMD_OPUS_7448
528#define PCI_DEVICE_ID_AMD_OPUS_7449 0x7449
529# define PCI_DEVICE_ID_AMD_VIPER_7449 PCI_DEVICE_ID_AMD_OPUS_7449
530#define PCI_DEVICE_ID_AMD_8111_LAN 0x7462
531#define PCI_DEVICE_ID_AMD_8111_LPC 0x7468 482#define PCI_DEVICE_ID_AMD_8111_LPC 0x7468
532#define PCI_DEVICE_ID_AMD_8111_IDE 0x7469 483#define PCI_DEVICE_ID_AMD_8111_IDE 0x7469
533#define PCI_DEVICE_ID_AMD_8111_SMBUS2 0x746a 484#define PCI_DEVICE_ID_AMD_8111_SMBUS2 0x746a
@@ -585,7 +536,6 @@
585#define PCI_DEVICE_ID_CT_65550 0x00e0 536#define PCI_DEVICE_ID_CT_65550 0x00e0
586#define PCI_DEVICE_ID_CT_65554 0x00e4 537#define PCI_DEVICE_ID_CT_65554 0x00e4
587#define PCI_DEVICE_ID_CT_65555 0x00e5 538#define PCI_DEVICE_ID_CT_65555 0x00e5
588#define PCI_DEVICE_ID_CT_69000 0x00c0
589 539
590#define PCI_VENDOR_ID_MIRO 0x1031 540#define PCI_VENDOR_ID_MIRO 0x1031
591#define PCI_DEVICE_ID_MIRO_36050 0x5601 541#define PCI_DEVICE_ID_MIRO_36050 0x5601
@@ -639,7 +589,6 @@
639#define PCI_DEVICE_ID_SI_550 0x0550 589#define PCI_DEVICE_ID_SI_550 0x0550
640#define PCI_DEVICE_ID_SI_540_VGA 0x5300 590#define PCI_DEVICE_ID_SI_540_VGA 0x5300
641#define PCI_DEVICE_ID_SI_550_VGA 0x5315 591#define PCI_DEVICE_ID_SI_550_VGA 0x5315
642#define PCI_DEVICE_ID_SI_601 0x0601
643#define PCI_DEVICE_ID_SI_620 0x0620 592#define PCI_DEVICE_ID_SI_620 0x0620
644#define PCI_DEVICE_ID_SI_630 0x0630 593#define PCI_DEVICE_ID_SI_630 0x0630
645#define PCI_DEVICE_ID_SI_633 0x0633 594#define PCI_DEVICE_ID_SI_633 0x0633
@@ -650,30 +599,22 @@
650#define PCI_DEVICE_ID_SI_648 0x0648 599#define PCI_DEVICE_ID_SI_648 0x0648
651#define PCI_DEVICE_ID_SI_650 0x0650 600#define PCI_DEVICE_ID_SI_650 0x0650
652#define PCI_DEVICE_ID_SI_651 0x0651 601#define PCI_DEVICE_ID_SI_651 0x0651
653#define PCI_DEVICE_ID_SI_652 0x0652
654#define PCI_DEVICE_ID_SI_655 0x0655 602#define PCI_DEVICE_ID_SI_655 0x0655
655#define PCI_DEVICE_ID_SI_661 0x0661 603#define PCI_DEVICE_ID_SI_661 0x0661
656#define PCI_DEVICE_ID_SI_730 0x0730 604#define PCI_DEVICE_ID_SI_730 0x0730
657#define PCI_DEVICE_ID_SI_733 0x0733 605#define PCI_DEVICE_ID_SI_733 0x0733
658#define PCI_DEVICE_ID_SI_630_VGA 0x6300 606#define PCI_DEVICE_ID_SI_630_VGA 0x6300
659#define PCI_DEVICE_ID_SI_730_VGA 0x7300
660#define PCI_DEVICE_ID_SI_735 0x0735 607#define PCI_DEVICE_ID_SI_735 0x0735
661#define PCI_DEVICE_ID_SI_740 0x0740 608#define PCI_DEVICE_ID_SI_740 0x0740
662#define PCI_DEVICE_ID_SI_741 0x0741 609#define PCI_DEVICE_ID_SI_741 0x0741
663#define PCI_DEVICE_ID_SI_745 0x0745 610#define PCI_DEVICE_ID_SI_745 0x0745
664#define PCI_DEVICE_ID_SI_746 0x0746 611#define PCI_DEVICE_ID_SI_746 0x0746
665#define PCI_DEVICE_ID_SI_748 0x0748
666#define PCI_DEVICE_ID_SI_750 0x0750
667#define PCI_DEVICE_ID_SI_751 0x0751
668#define PCI_DEVICE_ID_SI_752 0x0752
669#define PCI_DEVICE_ID_SI_755 0x0755 612#define PCI_DEVICE_ID_SI_755 0x0755
670#define PCI_DEVICE_ID_SI_760 0x0760 613#define PCI_DEVICE_ID_SI_760 0x0760
671#define PCI_DEVICE_ID_SI_900 0x0900 614#define PCI_DEVICE_ID_SI_900 0x0900
672#define PCI_DEVICE_ID_SI_961 0x0961 615#define PCI_DEVICE_ID_SI_961 0x0961
673#define PCI_DEVICE_ID_SI_962 0x0962 616#define PCI_DEVICE_ID_SI_962 0x0962
674#define PCI_DEVICE_ID_SI_963 0x0963 617#define PCI_DEVICE_ID_SI_963 0x0963
675#define PCI_DEVICE_ID_SI_5107 0x5107
676#define PCI_DEVICE_ID_SI_5300 0x5300
677#define PCI_DEVICE_ID_SI_5511 0x5511 618#define PCI_DEVICE_ID_SI_5511 0x5511
678#define PCI_DEVICE_ID_SI_5513 0x5513 619#define PCI_DEVICE_ID_SI_5513 0x5513
679#define PCI_DEVICE_ID_SI_5518 0x5518 620#define PCI_DEVICE_ID_SI_5518 0x5518
@@ -685,10 +626,6 @@
685#define PCI_DEVICE_ID_SI_5597 0x5597 626#define PCI_DEVICE_ID_SI_5597 0x5597
686#define PCI_DEVICE_ID_SI_5598 0x5598 627#define PCI_DEVICE_ID_SI_5598 0x5598
687#define PCI_DEVICE_ID_SI_5600 0x5600 628#define PCI_DEVICE_ID_SI_5600 0x5600
688#define PCI_DEVICE_ID_SI_6300 0x6300
689#define PCI_DEVICE_ID_SI_6306 0x6306
690#define PCI_DEVICE_ID_SI_6326 0x6326
691#define PCI_DEVICE_ID_SI_7001 0x7001
692#define PCI_DEVICE_ID_SI_7012 0x7012 629#define PCI_DEVICE_ID_SI_7012 0x7012
693#define PCI_DEVICE_ID_SI_7013 0x7013 630#define PCI_DEVICE_ID_SI_7013 0x7013
694#define PCI_DEVICE_ID_SI_7016 0x7016 631#define PCI_DEVICE_ID_SI_7016 0x7016
@@ -709,23 +646,19 @@
709#define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049 646#define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049
710#define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A 647#define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A
711#define PCI_DEVICE_ID_HP_DIVA_MAESTRO 0x104B 648#define PCI_DEVICE_ID_HP_DIVA_MAESTRO 0x104B
712#define PCI_DEVICE_ID_HP_PCI_LBA 0x1054
713#define PCI_DEVICE_ID_HP_REO_SBA 0x10f0
714#define PCI_DEVICE_ID_HP_REO_IOC 0x10f1 649#define PCI_DEVICE_ID_HP_REO_IOC 0x10f1
715#define PCI_DEVICE_ID_HP_VISUALIZE_FXE 0x108b 650#define PCI_DEVICE_ID_HP_VISUALIZE_FXE 0x108b
716#define PCI_DEVICE_ID_HP_DIVA_HALFDOME 0x1223 651#define PCI_DEVICE_ID_HP_DIVA_HALFDOME 0x1223
717#define PCI_DEVICE_ID_HP_DIVA_KEYSTONE 0x1226 652#define PCI_DEVICE_ID_HP_DIVA_KEYSTONE 0x1226
718#define PCI_DEVICE_ID_HP_DIVA_POWERBAR 0x1227 653#define PCI_DEVICE_ID_HP_DIVA_POWERBAR 0x1227
719#define PCI_DEVICE_ID_HP_ZX1_SBA 0x1229
720#define PCI_DEVICE_ID_HP_ZX1_IOC 0x122a 654#define PCI_DEVICE_ID_HP_ZX1_IOC 0x122a
721#define PCI_DEVICE_ID_HP_PCIX_LBA 0x122e 655#define PCI_DEVICE_ID_HP_PCIX_LBA 0x122e
722#define PCI_DEVICE_ID_HP_SX1000_IOC 0x127c 656#define PCI_DEVICE_ID_HP_SX1000_IOC 0x127c
723#define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282 657#define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282
724#define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290 658#define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290
725#define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301 659#define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301
726#define PCI_DEVICE_ID_HP_CISS 0x3210 660#define PCI_DEVICE_ID_HP_DIVA_HURRICANE 0x132a
727#define PCI_DEVICE_ID_HP_CISSA 0x3220 661#define PCI_DEVICE_ID_HP_CISSA 0x3220
728#define PCI_DEVICE_ID_HP_CISSB 0x3222
729#define PCI_DEVICE_ID_HP_CISSC 0x3230 662#define PCI_DEVICE_ID_HP_CISSC 0x3230
730#define PCI_DEVICE_ID_HP_CISSD 0x3238 663#define PCI_DEVICE_ID_HP_CISSD 0x3238
731#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031 664#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031
@@ -733,8 +666,6 @@
733#define PCI_VENDOR_ID_PCTECH 0x1042 666#define PCI_VENDOR_ID_PCTECH 0x1042
734#define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000 667#define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000
735#define PCI_DEVICE_ID_PCTECH_RZ1001 0x1001 668#define PCI_DEVICE_ID_PCTECH_RZ1001 0x1001
736#define PCI_DEVICE_ID_PCTECH_SAMURAI_0 0x3000
737#define PCI_DEVICE_ID_PCTECH_SAMURAI_1 0x3010
738#define PCI_DEVICE_ID_PCTECH_SAMURAI_IDE 0x3020 669#define PCI_DEVICE_ID_PCTECH_SAMURAI_IDE 0x3020
739 670
740#define PCI_VENDOR_ID_ASUSTEK 0x1043 671#define PCI_VENDOR_ID_ASUSTEK 0x1043
@@ -744,24 +675,15 @@
744#define PCI_DEVICE_ID_DPT 0xa400 675#define PCI_DEVICE_ID_DPT 0xa400
745 676
746#define PCI_VENDOR_ID_OPTI 0x1045 677#define PCI_VENDOR_ID_OPTI 0x1045
747#define PCI_DEVICE_ID_OPTI_92C178 0xc178
748#define PCI_DEVICE_ID_OPTI_82C557 0xc557
749#define PCI_DEVICE_ID_OPTI_82C558 0xc558 678#define PCI_DEVICE_ID_OPTI_82C558 0xc558
750#define PCI_DEVICE_ID_OPTI_82C621 0xc621 679#define PCI_DEVICE_ID_OPTI_82C621 0xc621
751#define PCI_DEVICE_ID_OPTI_82C700 0xc700 680#define PCI_DEVICE_ID_OPTI_82C700 0xc700
752#define PCI_DEVICE_ID_OPTI_82C701 0xc701
753#define PCI_DEVICE_ID_OPTI_82C814 0xc814
754#define PCI_DEVICE_ID_OPTI_82C822 0xc822
755#define PCI_DEVICE_ID_OPTI_82C861 0xc861
756#define PCI_DEVICE_ID_OPTI_82C825 0xd568 681#define PCI_DEVICE_ID_OPTI_82C825 0xd568
757 682
758#define PCI_VENDOR_ID_ELSA 0x1048 683#define PCI_VENDOR_ID_ELSA 0x1048
759#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 684#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
760#define PCI_DEVICE_ID_ELSA_QS3000 0x3000 685#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
761 686
762#define PCI_VENDOR_ID_SGS 0x104a
763#define PCI_DEVICE_ID_SGS_2000 0x0008
764#define PCI_DEVICE_ID_SGS_1764 0x0009
765 687
766#define PCI_VENDOR_ID_BUSLOGIC 0x104B 688#define PCI_VENDOR_ID_BUSLOGIC 0x104B
767#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 689#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140
@@ -769,7 +691,6 @@
769#define PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT 0x8130 691#define PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT 0x8130
770 692
771#define PCI_VENDOR_ID_TI 0x104c 693#define PCI_VENDOR_ID_TI 0x104c
772#define PCI_DEVICE_ID_TI_TVP4010 0x3d04
773#define PCI_DEVICE_ID_TI_TVP4020 0x3d07 694#define PCI_DEVICE_ID_TI_TVP4020 0x3d07
774#define PCI_DEVICE_ID_TI_4450 0x8011 695#define PCI_DEVICE_ID_TI_4450 0x8011
775#define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 696#define PCI_DEVICE_ID_TI_XX21_XX11 0x8031
@@ -803,14 +724,10 @@
803#define PCI_DEVICE_ID_TI_X420 0xac8e 724#define PCI_DEVICE_ID_TI_X420 0xac8e
804 725
805#define PCI_VENDOR_ID_SONY 0x104d 726#define PCI_VENDOR_ID_SONY 0x104d
806#define PCI_DEVICE_ID_SONY_CXD3222 0x8039
807 727
808#define PCI_VENDOR_ID_OAK 0x104e
809#define PCI_DEVICE_ID_OAK_OTI107 0x0107
810 728
811/* Winbond have two vendor IDs! See 0x10ad as well */ 729/* Winbond have two vendor IDs! See 0x10ad as well */
812#define PCI_VENDOR_ID_WINBOND2 0x1050 730#define PCI_VENDOR_ID_WINBOND2 0x1050
813#define PCI_DEVICE_ID_WINBOND2_89C940 0x0940
814#define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a 731#define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a
815#define PCI_DEVICE_ID_WINBOND2_6692 0x6692 732#define PCI_DEVICE_ID_WINBOND2_6692 0x6692
816 733
@@ -819,19 +736,15 @@
819 736
820#define PCI_VENDOR_ID_EFAR 0x1055 737#define PCI_VENDOR_ID_EFAR 0x1055
821#define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130 738#define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130
822#define PCI_DEVICE_ID_EFAR_SLC90E66_0 0x9460
823#define PCI_DEVICE_ID_EFAR_SLC90E66_2 0x9462
824#define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463 739#define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463
825 740
826#define PCI_VENDOR_ID_MOTOROLA 0x1057 741#define PCI_VENDOR_ID_MOTOROLA 0x1057
827#define PCI_VENDOR_ID_MOTOROLA_OOPS 0x1507
828#define PCI_DEVICE_ID_MOTOROLA_MPC105 0x0001 742#define PCI_DEVICE_ID_MOTOROLA_MPC105 0x0001
829#define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002 743#define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002
830#define PCI_DEVICE_ID_MOTOROLA_MPC107 0x0004 744#define PCI_DEVICE_ID_MOTOROLA_MPC107 0x0004
831#define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801 745#define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801
832#define PCI_DEVICE_ID_MOTOROLA_FALCON 0x4802 746#define PCI_DEVICE_ID_MOTOROLA_FALCON 0x4802
833#define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803 747#define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803
834#define PCI_DEVICE_ID_MOTOROLA_CPX8216 0x4806
835#define PCI_DEVICE_ID_MOTOROLA_HARRIER 0x480b 748#define PCI_DEVICE_ID_MOTOROLA_HARRIER 0x480b
836#define PCI_DEVICE_ID_MOTOROLA_MPC5200 0x5803 749#define PCI_DEVICE_ID_MOTOROLA_MPC5200 0x5803
837 750
@@ -842,33 +755,19 @@
842#define PCI_DEVICE_ID_PROMISE_20262 0x4d38 755#define PCI_DEVICE_ID_PROMISE_20262 0x4d38
843#define PCI_DEVICE_ID_PROMISE_20263 0x0D38 756#define PCI_DEVICE_ID_PROMISE_20263 0x0D38
844#define PCI_DEVICE_ID_PROMISE_20268 0x4d68 757#define PCI_DEVICE_ID_PROMISE_20268 0x4d68
845#define PCI_DEVICE_ID_PROMISE_20268R 0x6268
846#define PCI_DEVICE_ID_PROMISE_20269 0x4d69 758#define PCI_DEVICE_ID_PROMISE_20269 0x4d69
847#define PCI_DEVICE_ID_PROMISE_20270 0x6268 759#define PCI_DEVICE_ID_PROMISE_20270 0x6268
848#define PCI_DEVICE_ID_PROMISE_20271 0x6269 760#define PCI_DEVICE_ID_PROMISE_20271 0x6269
849#define PCI_DEVICE_ID_PROMISE_20275 0x1275 761#define PCI_DEVICE_ID_PROMISE_20275 0x1275
850#define PCI_DEVICE_ID_PROMISE_20276 0x5275 762#define PCI_DEVICE_ID_PROMISE_20276 0x5275
851#define PCI_DEVICE_ID_PROMISE_20277 0x7275 763#define PCI_DEVICE_ID_PROMISE_20277 0x7275
852#define PCI_DEVICE_ID_PROMISE_5300 0x5300
853 764
854#define PCI_VENDOR_ID_N9 0x105d
855#define PCI_DEVICE_ID_N9_I128 0x2309
856#define PCI_DEVICE_ID_N9_I128_2 0x2339
857#define PCI_DEVICE_ID_N9_I128_T2R 0x493d
858 765
859#define PCI_VENDOR_ID_UMC 0x1060 766#define PCI_VENDOR_ID_UMC 0x1060
860#define PCI_DEVICE_ID_UMC_UM8673F 0x0101 767#define PCI_DEVICE_ID_UMC_UM8673F 0x0101
861#define PCI_DEVICE_ID_UMC_UM8891A 0x0891
862#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a 768#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a
863#define PCI_DEVICE_ID_UMC_UM8886A 0x886a 769#define PCI_DEVICE_ID_UMC_UM8886A 0x886a
864#define PCI_DEVICE_ID_UMC_UM8881F 0x8881
865#define PCI_DEVICE_ID_UMC_UM8886F 0x8886
866#define PCI_DEVICE_ID_UMC_UM9017F 0x9017
867#define PCI_DEVICE_ID_UMC_UM8886N 0xe886
868#define PCI_DEVICE_ID_UMC_UM8891N 0xe891
869 770
870#define PCI_VENDOR_ID_X 0x1061
871#define PCI_DEVICE_ID_X_AGX016 0x0001
872 771
873#define PCI_VENDOR_ID_MYLEX 0x1069 772#define PCI_VENDOR_ID_MYLEX 0x1069
874#define PCI_DEVICE_ID_MYLEX_DAC960_P 0x0001 773#define PCI_DEVICE_ID_MYLEX_DAC960_P 0x0001
@@ -879,37 +778,26 @@
879#define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56 778#define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56
880#define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166 779#define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166
881 780
882#define PCI_VENDOR_ID_PICOP 0x1066
883#define PCI_DEVICE_ID_PICOP_PT86C52X 0x0001
884#define PCI_DEVICE_ID_PICOP_PT80C524 0x8002
885 781
886#define PCI_VENDOR_ID_APPLE 0x106b 782#define PCI_VENDOR_ID_APPLE 0x106b
887#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001 783#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001
888#define PCI_DEVICE_ID_APPLE_GC 0x0002
889#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e 784#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e
890#define PCI_DEVICE_ID_APPLE_UNI_N_FW 0x0018 785#define PCI_DEVICE_ID_APPLE_UNI_N_FW 0x0018
891#define PCI_DEVICE_ID_APPLE_KL_USB 0x0019
892#define PCI_DEVICE_ID_APPLE_UNI_N_AGP 0x0020 786#define PCI_DEVICE_ID_APPLE_UNI_N_AGP 0x0020
893#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC 0x0021 787#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC 0x0021
894#define PCI_DEVICE_ID_APPLE_KEYLARGO 0x0022
895#define PCI_DEVICE_ID_APPLE_UNI_N_GMACP 0x0024 788#define PCI_DEVICE_ID_APPLE_UNI_N_GMACP 0x0024
896#define PCI_DEVICE_ID_APPLE_KEYLARGO_P 0x0025
897#define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026
898#define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027 789#define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027
899#define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d 790#define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d
900#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e 791#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e
901#define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030
902#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 792#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032
903#define PCI_DEVICE_ID_APPLE_UNI_N_ATA 0x0033 793#define PCI_DEVICE_ID_APPLE_UNI_N_ATA 0x0033
904#define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034 794#define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034
905#define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b 795#define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b
906#define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e
907#define PCI_DEVICE_ID_APPLE_K2_ATA100 0x0043 796#define PCI_DEVICE_ID_APPLE_K2_ATA100 0x0043
908#define PCI_DEVICE_ID_APPLE_U3_AGP 0x004b 797#define PCI_DEVICE_ID_APPLE_U3_AGP 0x004b
909#define PCI_DEVICE_ID_APPLE_K2_GMAC 0x004c 798#define PCI_DEVICE_ID_APPLE_K2_GMAC 0x004c
910#define PCI_DEVICE_ID_APPLE_SH_ATA 0x0050 799#define PCI_DEVICE_ID_APPLE_SH_ATA 0x0050
911#define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051 800#define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051
912#define PCI_DEVICE_ID_APPLE_SH_FW 0x0052
913#define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058 801#define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058
914#define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059 802#define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059
915#define PCI_DEVICE_ID_APPLE_TIGON3 0x1645 803#define PCI_DEVICE_ID_APPLE_TIGON3 0x1645
@@ -922,12 +810,9 @@
922#define PCI_DEVICE_ID_YAMAHA_744 0x0010 810#define PCI_DEVICE_ID_YAMAHA_744 0x0010
923#define PCI_DEVICE_ID_YAMAHA_754 0x0012 811#define PCI_DEVICE_ID_YAMAHA_754 0x0012
924 812
925#define PCI_VENDOR_ID_NEXGEN 0x1074
926#define PCI_DEVICE_ID_NEXGEN_82C501 0x4e78
927 813
928#define PCI_VENDOR_ID_QLOGIC 0x1077 814#define PCI_VENDOR_ID_QLOGIC 0x1077
929#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 815#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020
930#define PCI_DEVICE_ID_QLOGIC_ISP1022 0x1022
931#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 816#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100
932#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 817#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200
933#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 818#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300
@@ -945,32 +830,20 @@
945#define PCI_DEVICE_ID_CYRIX_PCI_MASTER 0x0001 830#define PCI_DEVICE_ID_CYRIX_PCI_MASTER 0x0001
946#define PCI_DEVICE_ID_CYRIX_5520 0x0002 831#define PCI_DEVICE_ID_CYRIX_5520 0x0002
947#define PCI_DEVICE_ID_CYRIX_5530_LEGACY 0x0100 832#define PCI_DEVICE_ID_CYRIX_5530_LEGACY 0x0100
948#define PCI_DEVICE_ID_CYRIX_5530_SMI 0x0101
949#define PCI_DEVICE_ID_CYRIX_5530_IDE 0x0102 833#define PCI_DEVICE_ID_CYRIX_5530_IDE 0x0102
950#define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103 834#define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103
951#define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104 835#define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104
952 836
953#define PCI_VENDOR_ID_LEADTEK 0x107d
954#define PCI_DEVICE_ID_LEADTEK_805 0x0000
955 837
956#define PCI_VENDOR_ID_INTERPHASE 0x107e
957#define PCI_DEVICE_ID_INTERPHASE_5526 0x0004
958#define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005
959#define PCI_DEVICE_ID_INTERPHASE_5575 0x0008
960 838
961#define PCI_VENDOR_ID_CONTAQ 0x1080 839#define PCI_VENDOR_ID_CONTAQ 0x1080
962#define PCI_DEVICE_ID_CONTAQ_82C599 0x0600
963#define PCI_DEVICE_ID_CONTAQ_82C693 0xc693 840#define PCI_DEVICE_ID_CONTAQ_82C693 0xc693
964 841
965#define PCI_VENDOR_ID_FOREX 0x1083
966 842
967#define PCI_VENDOR_ID_OLICOM 0x108d 843#define PCI_VENDOR_ID_OLICOM 0x108d
968#define PCI_DEVICE_ID_OLICOM_OC3136 0x0001
969#define PCI_DEVICE_ID_OLICOM_OC2315 0x0011
970#define PCI_DEVICE_ID_OLICOM_OC2325 0x0012 844#define PCI_DEVICE_ID_OLICOM_OC2325 0x0012
971#define PCI_DEVICE_ID_OLICOM_OC2183 0x0013 845#define PCI_DEVICE_ID_OLICOM_OC2183 0x0013
972#define PCI_DEVICE_ID_OLICOM_OC2326 0x0014 846#define PCI_DEVICE_ID_OLICOM_OC2326 0x0014
973#define PCI_DEVICE_ID_OLICOM_OC6151 0x0021
974 847
975#define PCI_VENDOR_ID_SUN 0x108e 848#define PCI_VENDOR_ID_SUN 0x108e
976#define PCI_DEVICE_ID_SUN_EBUS 0x1000 849#define PCI_DEVICE_ID_SUN_EBUS 0x1000
@@ -989,49 +862,31 @@
989#define PCI_DEVICE_ID_SUN_CASSINI 0xabba 862#define PCI_DEVICE_ID_SUN_CASSINI 0xabba
990 863
991#define PCI_VENDOR_ID_CMD 0x1095 864#define PCI_VENDOR_ID_CMD 0x1095
992#define PCI_DEVICE_ID_CMD_640 0x0640
993#define PCI_DEVICE_ID_CMD_643 0x0643 865#define PCI_DEVICE_ID_CMD_643 0x0643
994#define PCI_DEVICE_ID_CMD_646 0x0646 866#define PCI_DEVICE_ID_CMD_646 0x0646
995#define PCI_DEVICE_ID_CMD_647 0x0647
996#define PCI_DEVICE_ID_CMD_648 0x0648 867#define PCI_DEVICE_ID_CMD_648 0x0648
997#define PCI_DEVICE_ID_CMD_649 0x0649 868#define PCI_DEVICE_ID_CMD_649 0x0649
998#define PCI_DEVICE_ID_CMD_670 0x0670
999#define PCI_DEVICE_ID_CMD_680 0x0680
1000 869
1001#define PCI_DEVICE_ID_SII_680 0x0680 870#define PCI_DEVICE_ID_SII_680 0x0680
1002#define PCI_DEVICE_ID_SII_3112 0x3112 871#define PCI_DEVICE_ID_SII_3112 0x3112
1003#define PCI_DEVICE_ID_SII_1210SA 0x0240 872#define PCI_DEVICE_ID_SII_1210SA 0x0240
1004 873
1005#define PCI_VENDOR_ID_VISION 0x1098
1006#define PCI_DEVICE_ID_VISION_QD8500 0x0001
1007#define PCI_DEVICE_ID_VISION_QD8580 0x0002
1008 874
1009#define PCI_VENDOR_ID_BROOKTREE 0x109e 875#define PCI_VENDOR_ID_BROOKTREE 0x109e
1010#define PCI_DEVICE_ID_BROOKTREE_848 0x0350
1011#define PCI_DEVICE_ID_BROOKTREE_849A 0x0351
1012#define PCI_DEVICE_ID_BROOKTREE_878_1 0x036e
1013#define PCI_DEVICE_ID_BROOKTREE_878 0x0878 876#define PCI_DEVICE_ID_BROOKTREE_878 0x0878
1014#define PCI_DEVICE_ID_BROOKTREE_879 0x0879 877#define PCI_DEVICE_ID_BROOKTREE_879 0x0879
1015#define PCI_DEVICE_ID_BROOKTREE_8474 0x8474
1016 878
1017#define PCI_VENDOR_ID_SIERRA 0x10a8
1018#define PCI_DEVICE_ID_SIERRA_STB 0x0000
1019 879
1020#define PCI_VENDOR_ID_SGI 0x10a9 880#define PCI_VENDOR_ID_SGI 0x10a9
1021#define PCI_DEVICE_ID_SGI_IOC3 0x0003 881#define PCI_DEVICE_ID_SGI_IOC3 0x0003
1022#define PCI_DEVICE_ID_SGI_IOC4 0x100a 882#define PCI_DEVICE_ID_SGI_IOC4 0x100a
1023#define PCI_VENDOR_ID_SGI_LITHIUM 0x1002 883#define PCI_VENDOR_ID_SGI_LITHIUM 0x1002
1024 884
1025#define PCI_VENDOR_ID_ACC 0x10aa
1026#define PCI_DEVICE_ID_ACC_2056 0x0000
1027 885
1028#define PCI_VENDOR_ID_WINBOND 0x10ad 886#define PCI_VENDOR_ID_WINBOND 0x10ad
1029#define PCI_DEVICE_ID_WINBOND_83769 0x0001
1030#define PCI_DEVICE_ID_WINBOND_82C105 0x0105 887#define PCI_DEVICE_ID_WINBOND_82C105 0x0105
1031#define PCI_DEVICE_ID_WINBOND_83C553 0x0565 888#define PCI_DEVICE_ID_WINBOND_83C553 0x0565
1032 889
1033#define PCI_VENDOR_ID_DATABOOK 0x10b3
1034#define PCI_DEVICE_ID_DATABOOK_87144 0xb106
1035 890
1036#define PCI_VENDOR_ID_PLX 0x10b5 891#define PCI_VENDOR_ID_PLX 0x10b5
1037#define PCI_DEVICE_ID_PLX_R685 0x1030 892#define PCI_DEVICE_ID_PLX_R685 0x1030
@@ -1042,33 +897,19 @@
1042#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151 897#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151
1043#define PCI_DEVICE_ID_PLX_R753 0x1152 898#define PCI_DEVICE_ID_PLX_R753 0x1152
1044#define PCI_DEVICE_ID_PLX_OLITEC 0x1187 899#define PCI_DEVICE_ID_PLX_OLITEC 0x1187
1045#define PCI_DEVICE_ID_PLX_9030 0x9030
1046#define PCI_DEVICE_ID_PLX_9050 0x9050 900#define PCI_DEVICE_ID_PLX_9050 0x9050
1047#define PCI_DEVICE_ID_PLX_9060 0x9060
1048#define PCI_DEVICE_ID_PLX_9060ES 0x906E
1049#define PCI_DEVICE_ID_PLX_9060SD 0x906D
1050#define PCI_DEVICE_ID_PLX_9080 0x9080 901#define PCI_DEVICE_ID_PLX_9080 0x9080
1051#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 902#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001
1052 903
1053#define PCI_VENDOR_ID_MADGE 0x10b6 904#define PCI_VENDOR_ID_MADGE 0x10b6
1054#define PCI_DEVICE_ID_MADGE_MK2 0x0002 905#define PCI_DEVICE_ID_MADGE_MK2 0x0002
1055#define PCI_DEVICE_ID_MADGE_C155S 0x1001
1056 906
1057#define PCI_VENDOR_ID_3COM 0x10b7 907#define PCI_VENDOR_ID_3COM 0x10b7
1058#define PCI_DEVICE_ID_3COM_3C985 0x0001 908#define PCI_DEVICE_ID_3COM_3C985 0x0001
1059#define PCI_DEVICE_ID_3COM_3C940 0x1700 909#define PCI_DEVICE_ID_3COM_3C940 0x1700
1060#define PCI_DEVICE_ID_3COM_3C339 0x3390 910#define PCI_DEVICE_ID_3COM_3C339 0x3390
1061#define PCI_DEVICE_ID_3COM_3C359 0x3590 911#define PCI_DEVICE_ID_3COM_3C359 0x3590
1062#define PCI_DEVICE_ID_3COM_3C590 0x5900
1063#define PCI_DEVICE_ID_3COM_3C595TX 0x5950
1064#define PCI_DEVICE_ID_3COM_3C595T4 0x5951
1065#define PCI_DEVICE_ID_3COM_3C595MII 0x5952
1066#define PCI_DEVICE_ID_3COM_3C940B 0x80eb 912#define PCI_DEVICE_ID_3COM_3C940B 0x80eb
1067#define PCI_DEVICE_ID_3COM_3C900TPO 0x9000
1068#define PCI_DEVICE_ID_3COM_3C900COMBO 0x9001
1069#define PCI_DEVICE_ID_3COM_3C905TX 0x9050
1070#define PCI_DEVICE_ID_3COM_3C905T4 0x9051
1071#define PCI_DEVICE_ID_3COM_3C905B_TX 0x9055
1072#define PCI_DEVICE_ID_3COM_3CR990 0x9900 913#define PCI_DEVICE_ID_3COM_3CR990 0x9900
1073#define PCI_DEVICE_ID_3COM_3CR990_TX_95 0x9902 914#define PCI_DEVICE_ID_3COM_3CR990_TX_95 0x9902
1074#define PCI_DEVICE_ID_3COM_3CR990_TX_97 0x9903 915#define PCI_DEVICE_ID_3COM_3CR990_TX_97 0x9903
@@ -1078,24 +919,11 @@
1078#define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909 919#define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909
1079#define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a 920#define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a
1080 921
1081#define PCI_VENDOR_ID_SMC 0x10b8
1082#define PCI_DEVICE_ID_SMC_EPIC100 0x0005
1083 922
1084#define PCI_VENDOR_ID_AL 0x10b9 923#define PCI_VENDOR_ID_AL 0x10b9
1085#define PCI_DEVICE_ID_AL_M1445 0x1445
1086#define PCI_DEVICE_ID_AL_M1449 0x1449
1087#define PCI_DEVICE_ID_AL_M1451 0x1451
1088#define PCI_DEVICE_ID_AL_M1461 0x1461
1089#define PCI_DEVICE_ID_AL_M1489 0x1489
1090#define PCI_DEVICE_ID_AL_M1511 0x1511
1091#define PCI_DEVICE_ID_AL_M1513 0x1513
1092#define PCI_DEVICE_ID_AL_M1521 0x1521
1093#define PCI_DEVICE_ID_AL_M1523 0x1523
1094#define PCI_DEVICE_ID_AL_M1531 0x1531
1095#define PCI_DEVICE_ID_AL_M1533 0x1533 924#define PCI_DEVICE_ID_AL_M1533 0x1533
1096#define PCI_DEVICE_ID_AL_M1535 0x1535 925#define PCI_DEVICE_ID_AL_M1535 0x1535
1097#define PCI_DEVICE_ID_AL_M1541 0x1541 926#define PCI_DEVICE_ID_AL_M1541 0x1541
1098#define PCI_DEVICE_ID_AL_M1543 0x1543
1099#define PCI_DEVICE_ID_AL_M1563 0x1563 927#define PCI_DEVICE_ID_AL_M1563 0x1563
1100#define PCI_DEVICE_ID_AL_M1621 0x1621 928#define PCI_DEVICE_ID_AL_M1621 0x1621
1101#define PCI_DEVICE_ID_AL_M1631 0x1631 929#define PCI_DEVICE_ID_AL_M1631 0x1631
@@ -1108,49 +936,23 @@
1108#define PCI_DEVICE_ID_AL_M1681 0x1681 936#define PCI_DEVICE_ID_AL_M1681 0x1681
1109#define PCI_DEVICE_ID_AL_M1683 0x1683 937#define PCI_DEVICE_ID_AL_M1683 0x1683
1110#define PCI_DEVICE_ID_AL_M1689 0x1689 938#define PCI_DEVICE_ID_AL_M1689 0x1689
1111#define PCI_DEVICE_ID_AL_M3307 0x3307
1112#define PCI_DEVICE_ID_AL_M4803 0x5215
1113#define PCI_DEVICE_ID_AL_M5219 0x5219 939#define PCI_DEVICE_ID_AL_M5219 0x5219
1114#define PCI_DEVICE_ID_AL_M5228 0x5228 940#define PCI_DEVICE_ID_AL_M5228 0x5228
1115#define PCI_DEVICE_ID_AL_M5229 0x5229 941#define PCI_DEVICE_ID_AL_M5229 0x5229
1116#define PCI_DEVICE_ID_AL_M5237 0x5237
1117#define PCI_DEVICE_ID_AL_M5243 0x5243
1118#define PCI_DEVICE_ID_AL_M5451 0x5451 942#define PCI_DEVICE_ID_AL_M5451 0x5451
1119#define PCI_DEVICE_ID_AL_M7101 0x7101 943#define PCI_DEVICE_ID_AL_M7101 0x7101
1120 944
1121#define PCI_VENDOR_ID_MITSUBISHI 0x10ba
1122 945
1123#define PCI_VENDOR_ID_SURECOM 0x10bd
1124#define PCI_DEVICE_ID_SURECOM_NE34 0x0e34
1125 946
1126#define PCI_VENDOR_ID_NEOMAGIC 0x10c8 947#define PCI_VENDOR_ID_NEOMAGIC 0x10c8
1127#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2070 0x0001
1128#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128V 0x0002
1129#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZV 0x0003
1130#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2160 0x0004
1131#define PCI_DEVICE_ID_NEOMAGIC_MAGICMEDIA_256AV 0x0005
1132#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZVPLUS 0x0083
1133#define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005 948#define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005
1134#define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006 949#define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006
1135#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016 950#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016
1136 951
1137#define PCI_VENDOR_ID_ASP 0x10cd
1138#define PCI_DEVICE_ID_ASP_ABP940 0x1200
1139#define PCI_DEVICE_ID_ASP_ABP940U 0x1300
1140#define PCI_DEVICE_ID_ASP_ABP940UW 0x2300
1141
1142#define PCI_VENDOR_ID_MACRONIX 0x10d9
1143#define PCI_DEVICE_ID_MACRONIX_MX98713 0x0512
1144#define PCI_DEVICE_ID_MACRONIX_MX987x5 0x0531
1145 952
1146#define PCI_VENDOR_ID_TCONRAD 0x10da 953#define PCI_VENDOR_ID_TCONRAD 0x10da
1147#define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508 954#define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508
1148 955
1149#define PCI_VENDOR_ID_CERN 0x10dc
1150#define PCI_DEVICE_ID_CERN_SPSB_PMC 0x0001
1151#define PCI_DEVICE_ID_CERN_SPSB_PCI 0x0002
1152#define PCI_DEVICE_ID_CERN_HIPPI_DST 0x0021
1153#define PCI_DEVICE_ID_CERN_HIPPI_SRC 0x0022
1154 956
1155#define PCI_VENDOR_ID_NVIDIA 0x10de 957#define PCI_VENDOR_ID_NVIDIA 0x10de
1156#define PCI_DEVICE_ID_NVIDIA_TNT 0x0020 958#define PCI_DEVICE_ID_NVIDIA_TNT 0x0020
@@ -1196,7 +998,6 @@
1196#define PCI_DEVICE_ID_QUADRO_FX_GO1400 0x00cc 998#define PCI_DEVICE_ID_QUADRO_FX_GO1400 0x00cc
1197#define PCI_DEVICE_ID_QUADRO_FX_1400 0x00ce 999#define PCI_DEVICE_ID_QUADRO_FX_1400 0x00ce
1198#define PCI_DEVICE_ID_NVIDIA_NFORCE3 0x00d1 1000#define PCI_DEVICE_ID_NVIDIA_NFORCE3 0x00d1
1199#define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO 0x00da
1200#define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS 0x00d4 1001#define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS 0x00d4
1201#define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE 0x00d5 1002#define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE 0x00d5
1202#define PCI_DEVICE_ID_NVIDIA_NVENET_3 0x00d6 1003#define PCI_DEVICE_ID_NVIDIA_NVENET_3 0x00d6
@@ -1283,7 +1084,6 @@
1283#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F 1084#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F
1284#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 1085#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268
1285#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 1086#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269
1286#define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B
1287#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280 1087#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280
1288#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281 1088#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281
1289#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282 1089#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282
@@ -1334,24 +1134,13 @@
1334#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 1134#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
1335 1135
1336#define PCI_VENDOR_ID_IMS 0x10e0 1136#define PCI_VENDOR_ID_IMS 0x10e0
1337#define PCI_DEVICE_ID_IMS_8849 0x8849
1338#define PCI_DEVICE_ID_IMS_TT128 0x9128 1137#define PCI_DEVICE_ID_IMS_TT128 0x9128
1339#define PCI_DEVICE_ID_IMS_TT3D 0x9135 1138#define PCI_DEVICE_ID_IMS_TT3D 0x9135
1340 1139
1341#define PCI_VENDOR_ID_TEKRAM2 0x10e1
1342#define PCI_DEVICE_ID_TEKRAM2_690c 0x690c
1343 1140
1344#define PCI_VENDOR_ID_TUNDRA 0x10e3
1345#define PCI_DEVICE_ID_TUNDRA_CA91C042 0x0000
1346 1141
1347#define PCI_VENDOR_ID_AMCC 0x10e8
1348#define PCI_DEVICE_ID_AMCC_MYRINET 0x8043
1349#define PCI_DEVICE_ID_AMCC_PARASTATION 0x8062
1350#define PCI_DEVICE_ID_AMCC_S5933 0x807d
1351#define PCI_DEVICE_ID_AMCC_S5933_HEPC3 0x809c
1352 1142
1353#define PCI_VENDOR_ID_INTERG 0x10ea 1143#define PCI_VENDOR_ID_INTERG 0x10ea
1354#define PCI_DEVICE_ID_INTERG_1680 0x1680
1355#define PCI_DEVICE_ID_INTERG_1682 0x1682 1144#define PCI_DEVICE_ID_INTERG_1682 0x1682
1356#define PCI_DEVICE_ID_INTERG_2000 0x2000 1145#define PCI_DEVICE_ID_INTERG_2000 0x2000
1357#define PCI_DEVICE_ID_INTERG_2010 0x2010 1146#define PCI_DEVICE_ID_INTERG_2010 0x2010
@@ -1359,32 +1148,23 @@
1359#define PCI_DEVICE_ID_INTERG_5050 0x5050 1148#define PCI_DEVICE_ID_INTERG_5050 0x5050
1360 1149
1361#define PCI_VENDOR_ID_REALTEK 0x10ec 1150#define PCI_VENDOR_ID_REALTEK 0x10ec
1362#define PCI_DEVICE_ID_REALTEK_8029 0x8029
1363#define PCI_DEVICE_ID_REALTEK_8129 0x8129
1364#define PCI_DEVICE_ID_REALTEK_8139 0x8139 1151#define PCI_DEVICE_ID_REALTEK_8139 0x8139
1365#define PCI_DEVICE_ID_REALTEK_8169 0x8169
1366 1152
1367#define PCI_VENDOR_ID_XILINX 0x10ee 1153#define PCI_VENDOR_ID_XILINX 0x10ee
1368#define PCI_DEVICE_ID_RME_DIGI96 0x3fc0 1154#define PCI_DEVICE_ID_RME_DIGI96 0x3fc0
1369#define PCI_DEVICE_ID_RME_DIGI96_8 0x3fc1 1155#define PCI_DEVICE_ID_RME_DIGI96_8 0x3fc1
1370#define PCI_DEVICE_ID_RME_DIGI96_8_PRO 0x3fc2 1156#define PCI_DEVICE_ID_RME_DIGI96_8_PRO 0x3fc2
1371#define PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST 0x3fc3 1157#define PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST 0x3fc3
1372#define PCI_DEVICE_ID_XILINX_HAMMERFALL 0x3fc4
1373#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5 1158#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5
1374#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6 1159#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6
1375#define PCI_DEVICE_ID_TURBOPAM 0x4020
1376 1160
1377#define PCI_VENDOR_ID_TRUEVISION 0x10fa
1378#define PCI_DEVICE_ID_TRUEVISION_T1000 0x000c
1379 1161
1380#define PCI_VENDOR_ID_INIT 0x1101 1162#define PCI_VENDOR_ID_INIT 0x1101
1381#define PCI_DEVICE_ID_INIT_320P 0x9100
1382#define PCI_DEVICE_ID_INIT_360P 0x9500
1383 1163
1384#define PCI_VENDOR_ID_CREATIVE 0x1102 // duplicate: ECTIVA 1164#define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */
1385#define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002 1165#define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002
1386 1166
1387#define PCI_VENDOR_ID_ECTIVA 0x1102 // duplicate: CREATIVE 1167#define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */
1388#define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938 1168#define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938
1389 1169
1390#define PCI_VENDOR_ID_TTI 0x1103 1170#define PCI_VENDOR_ID_TTI 0x1103
@@ -1394,7 +1174,7 @@
1394#define PCI_DEVICE_ID_TTI_HPT302 0x0006 1174#define PCI_DEVICE_ID_TTI_HPT302 0x0006
1395#define PCI_DEVICE_ID_TTI_HPT371 0x0007 1175#define PCI_DEVICE_ID_TTI_HPT371 0x0007
1396#define PCI_DEVICE_ID_TTI_HPT374 0x0008 1176#define PCI_DEVICE_ID_TTI_HPT374 0x0008
1397#define PCI_DEVICE_ID_TTI_HPT372N 0x0009 // apparently a 372N variant? 1177#define PCI_DEVICE_ID_TTI_HPT372N 0x0009 /* apparently a 372N variant? */
1398 1178
1399#define PCI_VENDOR_ID_VIA 0x1106 1179#define PCI_VENDOR_ID_VIA 0x1106
1400#define PCI_DEVICE_ID_VIA_8763_0 0x0198 1180#define PCI_DEVICE_ID_VIA_8763_0 0x0198
@@ -1407,36 +1187,25 @@
1407#define PCI_DEVICE_ID_VIA_8363_0 0x0305 1187#define PCI_DEVICE_ID_VIA_8363_0 0x0305
1408#define PCI_DEVICE_ID_VIA_8371_0 0x0391 1188#define PCI_DEVICE_ID_VIA_8371_0 0x0391
1409#define PCI_DEVICE_ID_VIA_8501_0 0x0501 1189#define PCI_DEVICE_ID_VIA_8501_0 0x0501
1410#define PCI_DEVICE_ID_VIA_82C505 0x0505
1411#define PCI_DEVICE_ID_VIA_82C561 0x0561 1190#define PCI_DEVICE_ID_VIA_82C561 0x0561
1412#define PCI_DEVICE_ID_VIA_82C586_1 0x0571 1191#define PCI_DEVICE_ID_VIA_82C586_1 0x0571
1413#define PCI_DEVICE_ID_VIA_82C576 0x0576 1192#define PCI_DEVICE_ID_VIA_82C576 0x0576
1414#define PCI_DEVICE_ID_VIA_82C585 0x0585
1415#define PCI_DEVICE_ID_VIA_82C586_0 0x0586 1193#define PCI_DEVICE_ID_VIA_82C586_0 0x0586
1416#define PCI_DEVICE_ID_VIA_82C595 0x0595
1417#define PCI_DEVICE_ID_VIA_82C596 0x0596 1194#define PCI_DEVICE_ID_VIA_82C596 0x0596
1418#define PCI_DEVICE_ID_VIA_82C597_0 0x0597 1195#define PCI_DEVICE_ID_VIA_82C597_0 0x0597
1419#define PCI_DEVICE_ID_VIA_82C598_0 0x0598 1196#define PCI_DEVICE_ID_VIA_82C598_0 0x0598
1420#define PCI_DEVICE_ID_VIA_8601_0 0x0601 1197#define PCI_DEVICE_ID_VIA_8601_0 0x0601
1421#define PCI_DEVICE_ID_VIA_8605_0 0x0605 1198#define PCI_DEVICE_ID_VIA_8605_0 0x0605
1422#define PCI_DEVICE_ID_VIA_82C680 0x0680
1423#define PCI_DEVICE_ID_VIA_82C686 0x0686 1199#define PCI_DEVICE_ID_VIA_82C686 0x0686
1424#define PCI_DEVICE_ID_VIA_82C691_0 0x0691 1200#define PCI_DEVICE_ID_VIA_82C691_0 0x0691
1425#define PCI_DEVICE_ID_VIA_82C693 0x0693
1426#define PCI_DEVICE_ID_VIA_82C693_1 0x0698
1427#define PCI_DEVICE_ID_VIA_82C926 0x0926
1428#define PCI_DEVICE_ID_VIA_82C576_1 0x1571 1201#define PCI_DEVICE_ID_VIA_82C576_1 0x1571
1429#define PCI_DEVICE_ID_VIA_82C595_97 0x1595
1430#define PCI_DEVICE_ID_VIA_82C586_2 0x3038 1202#define PCI_DEVICE_ID_VIA_82C586_2 0x3038
1431#define PCI_DEVICE_ID_VIA_82C586_3 0x3040 1203#define PCI_DEVICE_ID_VIA_82C586_3 0x3040
1432#define PCI_DEVICE_ID_VIA_6305 0x3044
1433#define PCI_DEVICE_ID_VIA_82C596_3 0x3050 1204#define PCI_DEVICE_ID_VIA_82C596_3 0x3050
1434#define PCI_DEVICE_ID_VIA_82C596B_3 0x3051 1205#define PCI_DEVICE_ID_VIA_82C596B_3 0x3051
1435#define PCI_DEVICE_ID_VIA_82C686_4 0x3057 1206#define PCI_DEVICE_ID_VIA_82C686_4 0x3057
1436#define PCI_DEVICE_ID_VIA_82C686_5 0x3058 1207#define PCI_DEVICE_ID_VIA_82C686_5 0x3058
1437#define PCI_DEVICE_ID_VIA_8233_5 0x3059 1208#define PCI_DEVICE_ID_VIA_8233_5 0x3059
1438#define PCI_DEVICE_ID_VIA_8233_7 0x3065
1439#define PCI_DEVICE_ID_VIA_82C686_6 0x3068
1440#define PCI_DEVICE_ID_VIA_8233_0 0x3074 1209#define PCI_DEVICE_ID_VIA_8233_0 0x3074
1441#define PCI_DEVICE_ID_VIA_8633_0 0x3091 1210#define PCI_DEVICE_ID_VIA_8633_0 0x3091
1442#define PCI_DEVICE_ID_VIA_8367_0 0x3099 1211#define PCI_DEVICE_ID_VIA_8367_0 0x3099
@@ -1454,38 +1223,23 @@
1454#define PCI_DEVICE_ID_VIA_XN266 0x3156 1223#define PCI_DEVICE_ID_VIA_XN266 0x3156
1455#define PCI_DEVICE_ID_VIA_8754C_0 0x3168 1224#define PCI_DEVICE_ID_VIA_8754C_0 0x3168
1456#define PCI_DEVICE_ID_VIA_8235 0x3177 1225#define PCI_DEVICE_ID_VIA_8235 0x3177
1457#define PCI_DEVICE_ID_VIA_P4N333 0x3178
1458#define PCI_DEVICE_ID_VIA_8385_0 0x3188 1226#define PCI_DEVICE_ID_VIA_8385_0 0x3188
1459#define PCI_DEVICE_ID_VIA_8377_0 0x3189 1227#define PCI_DEVICE_ID_VIA_8377_0 0x3189
1460#define PCI_DEVICE_ID_VIA_8378_0 0x3205 1228#define PCI_DEVICE_ID_VIA_8378_0 0x3205
1461#define PCI_DEVICE_ID_VIA_8783_0 0x3208 1229#define PCI_DEVICE_ID_VIA_8783_0 0x3208
1462#define PCI_DEVICE_ID_VIA_P4M400 0x3209
1463#define PCI_DEVICE_ID_VIA_8237 0x3227 1230#define PCI_DEVICE_ID_VIA_8237 0x3227
1464#define PCI_DEVICE_ID_VIA_3296_0 0x0296 1231#define PCI_DEVICE_ID_VIA_3296_0 0x0296
1465#define PCI_DEVICE_ID_VIA_86C100A 0x6100
1466#define PCI_DEVICE_ID_VIA_8231 0x8231 1232#define PCI_DEVICE_ID_VIA_8231 0x8231
1467#define PCI_DEVICE_ID_VIA_8231_4 0x8235 1233#define PCI_DEVICE_ID_VIA_8231_4 0x8235
1468#define PCI_DEVICE_ID_VIA_8365_1 0x8305 1234#define PCI_DEVICE_ID_VIA_8365_1 0x8305
1469#define PCI_DEVICE_ID_VIA_8371_1 0x8391 1235#define PCI_DEVICE_ID_VIA_8371_1 0x8391
1470#define PCI_DEVICE_ID_VIA_8501_1 0x8501
1471#define PCI_DEVICE_ID_VIA_82C597_1 0x8597
1472#define PCI_DEVICE_ID_VIA_82C598_1 0x8598 1236#define PCI_DEVICE_ID_VIA_82C598_1 0x8598
1473#define PCI_DEVICE_ID_VIA_8601_1 0x8601
1474#define PCI_DEVICE_ID_VIA_8505_1 0x8605
1475#define PCI_DEVICE_ID_VIA_8633_1 0xB091
1476#define PCI_DEVICE_ID_VIA_8367_1 0xB099
1477#define PCI_DEVICE_ID_VIA_P4X266_1 0xB101
1478#define PCI_DEVICE_ID_VIA_8615_1 0xB103
1479#define PCI_DEVICE_ID_VIA_8361_1 0xB112
1480#define PCI_DEVICE_ID_VIA_8235_1 0xB168
1481#define PCI_DEVICE_ID_VIA_838X_1 0xB188 1237#define PCI_DEVICE_ID_VIA_838X_1 0xB188
1482#define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198 1238#define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198
1483 1239
1484#define PCI_VENDOR_ID_SIEMENS 0x110A 1240#define PCI_VENDOR_ID_SIEMENS 0x110A
1485#define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102 1241#define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102
1486 1242
1487#define PCI_VENDOR_ID_SMC2 0x1113
1488#define PCI_DEVICE_ID_SMC2_1211TX 0x1211
1489 1243
1490#define PCI_VENDOR_ID_VORTEX 0x1119 1244#define PCI_VENDOR_ID_VORTEX 0x1119
1491#define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000 1245#define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000
@@ -1508,18 +1262,6 @@
1508#define PCI_DEVICE_ID_VORTEX_GDT6557RP 0x0103 1262#define PCI_DEVICE_ID_VORTEX_GDT6557RP 0x0103
1509#define PCI_DEVICE_ID_VORTEX_GDT6x11RP 0x0104 1263#define PCI_DEVICE_ID_VORTEX_GDT6x11RP 0x0104
1510#define PCI_DEVICE_ID_VORTEX_GDT6x21RP 0x0105 1264#define PCI_DEVICE_ID_VORTEX_GDT6x21RP 0x0105
1511#define PCI_DEVICE_ID_VORTEX_GDT6x17RP1 0x0110
1512#define PCI_DEVICE_ID_VORTEX_GDT6x27RP1 0x0111
1513#define PCI_DEVICE_ID_VORTEX_GDT6537RP1 0x0112
1514#define PCI_DEVICE_ID_VORTEX_GDT6557RP1 0x0113
1515#define PCI_DEVICE_ID_VORTEX_GDT6x11RP1 0x0114
1516#define PCI_DEVICE_ID_VORTEX_GDT6x21RP1 0x0115
1517#define PCI_DEVICE_ID_VORTEX_GDT6x17RP2 0x0120
1518#define PCI_DEVICE_ID_VORTEX_GDT6x27RP2 0x0121
1519#define PCI_DEVICE_ID_VORTEX_GDT6537RP2 0x0122
1520#define PCI_DEVICE_ID_VORTEX_GDT6557RP2 0x0123
1521#define PCI_DEVICE_ID_VORTEX_GDT6x11RP2 0x0124
1522#define PCI_DEVICE_ID_VORTEX_GDT6x21RP2 0x0125
1523 1265
1524#define PCI_VENDOR_ID_EF 0x111a 1266#define PCI_VENDOR_ID_EF 0x111a
1525#define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000 1267#define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000
@@ -1531,21 +1273,15 @@
1531#define PCI_DEVICE_ID_IDT_IDT77201 0x0001 1273#define PCI_DEVICE_ID_IDT_IDT77201 0x0001
1532 1274
1533#define PCI_VENDOR_ID_FORE 0x1127 1275#define PCI_VENDOR_ID_FORE 0x1127
1534#define PCI_DEVICE_ID_FORE_PCA200PC 0x0210
1535#define PCI_DEVICE_ID_FORE_PCA200E 0x0300 1276#define PCI_DEVICE_ID_FORE_PCA200E 0x0300
1536 1277
1537#define PCI_VENDOR_ID_IMAGINGTECH 0x112f
1538#define PCI_DEVICE_ID_IMAGINGTECH_ICPCI 0x0000
1539 1278
1540#define PCI_VENDOR_ID_PHILIPS 0x1131 1279#define PCI_VENDOR_ID_PHILIPS 0x1131
1541#define PCI_DEVICE_ID_PHILIPS_SAA7145 0x7145
1542#define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146 1280#define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146
1543#define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730 1281#define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730
1544 1282
1545#define PCI_VENDOR_ID_EICON 0x1133 1283#define PCI_VENDOR_ID_EICON 0x1133
1546#define PCI_DEVICE_ID_EICON_DIVA20PRO 0xe001
1547#define PCI_DEVICE_ID_EICON_DIVA20 0xe002 1284#define PCI_DEVICE_ID_EICON_DIVA20 0xe002
1548#define PCI_DEVICE_ID_EICON_DIVA20PRO_U 0xe003
1549#define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004 1285#define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004
1550#define PCI_DEVICE_ID_EICON_DIVA201 0xe005 1286#define PCI_DEVICE_ID_EICON_DIVA201 0xe005
1551#define PCI_DEVICE_ID_EICON_DIVA202 0xe00b 1287#define PCI_DEVICE_ID_EICON_DIVA202 0xe00b
@@ -1557,35 +1293,17 @@
1557#define PCI_VENDOR_ID_ZIATECH 0x1138 1293#define PCI_VENDOR_ID_ZIATECH 0x1138
1558#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 1294#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550
1559 1295
1560#define PCI_VENDOR_ID_CYCLONE 0x113c
1561#define PCI_DEVICE_ID_CYCLONE_SDK 0x0001
1562 1296
1563#define PCI_VENDOR_ID_ALLIANCE 0x1142
1564#define PCI_DEVICE_ID_ALLIANCE_PROMOTIO 0x3210
1565#define PCI_DEVICE_ID_ALLIANCE_PROVIDEO 0x6422
1566#define PCI_DEVICE_ID_ALLIANCE_AT24 0x6424
1567#define PCI_DEVICE_ID_ALLIANCE_AT3D 0x643d
1568 1297
1569#define PCI_VENDOR_ID_SYSKONNECT 0x1148 1298#define PCI_VENDOR_ID_SYSKONNECT 0x1148
1570#define PCI_DEVICE_ID_SYSKONNECT_FP 0x4000
1571#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200 1299#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200
1572#define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300 1300#define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300
1573#define PCI_DEVICE_ID_SYSKONNECT_YU 0x4320 1301#define PCI_DEVICE_ID_SYSKONNECT_YU 0x4320
1574#define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400 1302#define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400
1575#define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500 1303#define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500
1576 1304
1577#define PCI_VENDOR_ID_VMIC 0x114a
1578#define PCI_DEVICE_ID_VMIC_VME 0x7587
1579 1305
1580#define PCI_VENDOR_ID_DIGI 0x114f 1306#define PCI_VENDOR_ID_DIGI 0x114f
1581#define PCI_DEVICE_ID_DIGI_EPC 0x0002
1582#define PCI_DEVICE_ID_DIGI_RIGHTSWITCH 0x0003
1583#define PCI_DEVICE_ID_DIGI_XEM 0x0004
1584#define PCI_DEVICE_ID_DIGI_XR 0x0005
1585#define PCI_DEVICE_ID_DIGI_CX 0x0006
1586#define PCI_DEVICE_ID_DIGI_XRJ 0x0009
1587#define PCI_DEVICE_ID_DIGI_EPCJ 0x000a
1588#define PCI_DEVICE_ID_DIGI_XR_920 0x0027
1589#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070 1307#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070
1590#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071 1308#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071
1591#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072 1309#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072
@@ -1595,23 +1313,15 @@
1595#define PCI_DEVICE_ID_NEO_2RJ45 0x00CA 1313#define PCI_DEVICE_ID_NEO_2RJ45 0x00CA
1596#define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB 1314#define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB
1597 1315
1598#define PCI_VENDOR_ID_MUTECH 0x1159
1599#define PCI_DEVICE_ID_MUTECH_MV1000 0x0001
1600 1316
1601#define PCI_VENDOR_ID_XIRCOM 0x115d 1317#define PCI_VENDOR_ID_XIRCOM 0x115d
1602#define PCI_DEVICE_ID_XIRCOM_X3201_ETH 0x0003
1603#define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101 1318#define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101
1604#define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103 1319#define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103
1605 1320
1606#define PCI_VENDOR_ID_RENDITION 0x1163
1607#define PCI_DEVICE_ID_RENDITION_VERITE 0x0001
1608#define PCI_DEVICE_ID_RENDITION_VERITE2100 0x2000
1609 1321
1610#define PCI_VENDOR_ID_SERVERWORKS 0x1166 1322#define PCI_VENDOR_ID_SERVERWORKS 0x1166
1611#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008 1323#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008
1612#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 1324#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009
1613#define PCI_DEVICE_ID_SERVERWORKS_CIOB30 0x0010
1614#define PCI_DEVICE_ID_SERVERWORKS_CMIC_HE 0x0011
1615#define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 1325#define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017
1616#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 1326#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200
1617#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 1327#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201
@@ -1621,13 +1331,7 @@
1621#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 1331#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213
1622#define PCI_DEVICE_ID_SERVERWORKS_HT1000IDE 0x0214 1332#define PCI_DEVICE_ID_SERVERWORKS_HT1000IDE 0x0214
1623#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217 1333#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217
1624#define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220
1625#define PCI_DEVICE_ID_SERVERWORKS_CSB5USB PCI_DEVICE_ID_SERVERWORKS_OSB4USB
1626#define PCI_DEVICE_ID_SERVERWORKS_CSB6USB 0x0221
1627#define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227 1334#define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227
1628#define PCI_DEVICE_ID_SERVERWORKS_GCLE 0x0225
1629#define PCI_DEVICE_ID_SERVERWORKS_GCLE2 0x0227
1630#define PCI_DEVICE_ID_SERVERWORKS_CSB5ISA 0x0230
1631 1335
1632#define PCI_VENDOR_ID_SBE 0x1176 1336#define PCI_VENDOR_ID_SBE 0x1176
1633#define PCI_DEVICE_ID_SBE_WANXL100 0x0301 1337#define PCI_DEVICE_ID_SBE_WANXL100 0x0301
@@ -1638,17 +1342,12 @@
1638#define PCI_DEVICE_ID_TOSHIBA_PICCOLO 0x0102 1342#define PCI_DEVICE_ID_TOSHIBA_PICCOLO 0x0102
1639#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0103 1343#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0103
1640#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_2 0x0105 1344#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_2 0x0105
1641#define PCI_DEVICE_ID_TOSHIBA_601 0x0601
1642#define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a 1345#define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a
1643#define PCI_DEVICE_ID_TOSHIBA_TOPIC95_A 0x0603
1644#define PCI_DEVICE_ID_TOSHIBA_TOPIC95_B 0x060a
1645#define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f 1346#define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f
1646#define PCI_DEVICE_ID_TOSHIBA_TOPIC100 0x0617 1347#define PCI_DEVICE_ID_TOSHIBA_TOPIC100 0x0617
1647 1348
1648#define PCI_VENDOR_ID_TOSHIBA_2 0x102f 1349#define PCI_VENDOR_ID_TOSHIBA_2 0x102f
1649#define PCI_DEVICE_ID_TOSHIBA_TX3927 0x000a
1650#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 1350#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030
1651#define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180
1652#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 1351#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108
1653#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3 1352#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3
1654 1353
@@ -1663,7 +1362,6 @@
1663#define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00 1362#define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00
1664 1363
1665#define PCI_VENDOR_ID_ARTOP 0x1191 1364#define PCI_VENDOR_ID_ARTOP 0x1191
1666#define PCI_DEVICE_ID_ARTOP_ATP8400 0x0004
1667#define PCI_DEVICE_ID_ARTOP_ATP850UF 0x0005 1365#define PCI_DEVICE_ID_ARTOP_ATP850UF 0x0005
1668#define PCI_DEVICE_ID_ARTOP_ATP860 0x0006 1366#define PCI_DEVICE_ID_ARTOP_ATP860 0x0006
1669#define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007 1367#define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007
@@ -1676,16 +1374,11 @@
1676#define PCI_DEVICE_ID_ARTOP_AEC7612D 0x8040 1374#define PCI_DEVICE_ID_ARTOP_AEC7612D 0x8040
1677#define PCI_DEVICE_ID_ARTOP_AEC7612SUW 0x8050 1375#define PCI_DEVICE_ID_ARTOP_AEC7612SUW 0x8050
1678#define PCI_DEVICE_ID_ARTOP_8060 0x8060 1376#define PCI_DEVICE_ID_ARTOP_8060 0x8060
1679#define PCI_DEVICE_ID_ARTOP_AEC67160 0x8080
1680#define PCI_DEVICE_ID_ARTOP_AEC67160_2 0x8081
1681#define PCI_DEVICE_ID_ARTOP_AEC67162 0x808a
1682 1377
1683#define PCI_VENDOR_ID_ZEITNET 0x1193 1378#define PCI_VENDOR_ID_ZEITNET 0x1193
1684#define PCI_DEVICE_ID_ZEITNET_1221 0x0001 1379#define PCI_DEVICE_ID_ZEITNET_1221 0x0001
1685#define PCI_DEVICE_ID_ZEITNET_1225 0x0002 1380#define PCI_DEVICE_ID_ZEITNET_1225 0x0002
1686 1381
1687#define PCI_VENDOR_ID_OMEGA 0x119b
1688#define PCI_DEVICE_ID_OMEGA_82C092G 0x1221
1689 1382
1690#define PCI_VENDOR_ID_FUJITSU_ME 0x119e 1383#define PCI_VENDOR_ID_FUJITSU_ME 0x119e
1691#define PCI_DEVICE_ID_FUJITSU_FS155 0x0001 1384#define PCI_DEVICE_ID_FUJITSU_FS155 0x0001
@@ -1695,61 +1388,41 @@
1695#define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334 1388#define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334
1696 1389
1697#define PCI_VENDOR_ID_MARVELL 0x11ab 1390#define PCI_VENDOR_ID_MARVELL 0x11ab
1698#define PCI_DEVICE_ID_MARVELL_GT64011 0x4146
1699#define PCI_DEVICE_ID_MARVELL_GT64111 0x4146
1700#define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 1391#define PCI_DEVICE_ID_MARVELL_GT64260 0x6430
1701#define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 1392#define PCI_DEVICE_ID_MARVELL_MV64360 0x6460
1702#define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 1393#define PCI_DEVICE_ID_MARVELL_MV64460 0x6480
1703#define PCI_DEVICE_ID_MARVELL_GT96100 0x9652 1394#define PCI_DEVICE_ID_MARVELL_GT96100 0x9652
1704#define PCI_DEVICE_ID_MARVELL_GT96100A 0x9653 1395#define PCI_DEVICE_ID_MARVELL_GT96100A 0x9653
1705 1396
1706#define PCI_VENDOR_ID_LITEON 0x11ad
1707#define PCI_DEVICE_ID_LITEON_LNE100TX 0x0002
1708 1397
1709#define PCI_VENDOR_ID_V3 0x11b0 1398#define PCI_VENDOR_ID_V3 0x11b0
1710#define PCI_DEVICE_ID_V3_V960 0x0001 1399#define PCI_DEVICE_ID_V3_V960 0x0001
1711#define PCI_DEVICE_ID_V3_V350 0x0001
1712#define PCI_DEVICE_ID_V3_V961 0x0002
1713#define PCI_DEVICE_ID_V3_V351 0x0002 1400#define PCI_DEVICE_ID_V3_V351 0x0002
1714 1401
1715#define PCI_VENDOR_ID_NP 0x11bc
1716#define PCI_DEVICE_ID_NP_PCI_FDDI 0x0001
1717 1402
1718#define PCI_VENDOR_ID_ATT 0x11c1 1403#define PCI_VENDOR_ID_ATT 0x11c1
1719#define PCI_DEVICE_ID_ATT_L56XMF 0x0440
1720#define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480 1404#define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480
1721 1405
1722#define PCI_VENDOR_ID_NEC2 0x11c3 /* NEC (2nd) */
1723 1406
1724#define PCI_VENDOR_ID_SPECIALIX 0x11cb 1407#define PCI_VENDOR_ID_SPECIALIX 0x11cb
1725#define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000 1408#define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000
1726#define PCI_DEVICE_ID_SPECIALIX_XIO 0x4000
1727#define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000 1409#define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000
1728#define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004 1410#define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004
1729 1411
1730#define PCI_VENDOR_ID_AURAVISION 0x11d1
1731#define PCI_DEVICE_ID_AURAVISION_VXP524 0x01f7
1732 1412
1733#define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4 1413#define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4
1734#define PCI_DEVICE_ID_AD1889JS 0x1889 1414#define PCI_DEVICE_ID_AD1889JS 0x1889
1735 1415
1736#define PCI_VENDOR_ID_IKON 0x11d5
1737#define PCI_DEVICE_ID_IKON_10115 0x0115
1738#define PCI_DEVICE_ID_IKON_10117 0x0117
1739 1416
1740#define PCI_VENDOR_ID_SEGA 0x11db
1741#define PCI_DEVICE_ID_SEGA_BBA 0x1234 1417#define PCI_DEVICE_ID_SEGA_BBA 0x1234
1742 1418
1743#define PCI_VENDOR_ID_ZORAN 0x11de 1419#define PCI_VENDOR_ID_ZORAN 0x11de
1744#define PCI_DEVICE_ID_ZORAN_36057 0x6057 1420#define PCI_DEVICE_ID_ZORAN_36057 0x6057
1745#define PCI_DEVICE_ID_ZORAN_36120 0x6120 1421#define PCI_DEVICE_ID_ZORAN_36120 0x6120
1746 1422
1747#define PCI_VENDOR_ID_KINETIC 0x11f4
1748#define PCI_DEVICE_ID_KINETIC_2915 0x2915
1749 1423
1750#define PCI_VENDOR_ID_COMPEX 0x11f6 1424#define PCI_VENDOR_ID_COMPEX 0x11f6
1751#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 1425#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112
1752#define PCI_DEVICE_ID_COMPEX_RL2000 0x1401
1753 1426
1754#define PCI_VENDOR_ID_RP 0x11fe 1427#define PCI_VENDOR_ID_RP 0x11fe
1755#define PCI_DEVICE_ID_RP32INTF 0x0001 1428#define PCI_DEVICE_ID_RP32INTF 0x0001
@@ -1763,7 +1436,6 @@
1763#define PCI_DEVICE_ID_RP16SNI 0x0009 1436#define PCI_DEVICE_ID_RP16SNI 0x0009
1764#define PCI_DEVICE_ID_RPP4 0x000A 1437#define PCI_DEVICE_ID_RPP4 0x000A
1765#define PCI_DEVICE_ID_RPP8 0x000B 1438#define PCI_DEVICE_ID_RPP8 0x000B
1766#define PCI_DEVICE_ID_RP8M 0x000C
1767#define PCI_DEVICE_ID_RP4M 0x000D 1439#define PCI_DEVICE_ID_RP4M 0x000D
1768#define PCI_DEVICE_ID_RP2_232 0x000E 1440#define PCI_DEVICE_ID_RP2_232 0x000E
1769#define PCI_DEVICE_ID_RP2_422 0x000F 1441#define PCI_DEVICE_ID_RP2_422 0x000F
@@ -1791,10 +1463,6 @@
1791#define PCI_DEVICE_ID_PC300_TE_M_2 0x0320 1463#define PCI_DEVICE_ID_PC300_TE_M_2 0x0320
1792#define PCI_DEVICE_ID_PC300_TE_M_1 0x0321 1464#define PCI_DEVICE_ID_PC300_TE_M_1 0x0321
1793 1465
1794/* Allied Telesyn */
1795#define PCI_VENDOR_ID_AT 0x1259
1796#define PCI_SUBDEVICE_ID_AT_2701FX 0x2703
1797
1798#define PCI_VENDOR_ID_ESSENTIAL 0x120f 1466#define PCI_VENDOR_ID_ESSENTIAL 0x120f
1799#define PCI_DEVICE_ID_ESSENTIAL_ROADRUNNER 0x0001 1467#define PCI_DEVICE_ID_ESSENTIAL_ROADRUNNER 0x0001
1800 1468
@@ -1811,10 +1479,7 @@
1811#define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005 1479#define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005
1812#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009 1480#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009
1813 1481
1814#define PCI_VENDOR_ID_SIGMADES 0x1236
1815#define PCI_DEVICE_ID_SIGMADES_6425 0x6401
1816 1482
1817#define PCI_VENDOR_ID_CCUBE 0x123f
1818 1483
1819#define PCI_VENDOR_ID_AVM 0x1244 1484#define PCI_VENDOR_ID_AVM 0x1244
1820#define PCI_DEVICE_ID_AVM_B1 0x0700 1485#define PCI_DEVICE_ID_AVM_B1 0x0700
@@ -1824,19 +1489,8 @@
1824#define PCI_DEVICE_ID_AVM_C2 0x1100 1489#define PCI_DEVICE_ID_AVM_C2 0x1100
1825#define PCI_DEVICE_ID_AVM_T1 0x1200 1490#define PCI_DEVICE_ID_AVM_T1 0x1200
1826 1491
1827#define PCI_VENDOR_ID_DIPIX 0x1246
1828 1492
1829#define PCI_VENDOR_ID_STALLION 0x124d 1493#define PCI_VENDOR_ID_STALLION 0x124d
1830#define PCI_DEVICE_ID_STALLION_ECHPCI832 0x0000
1831#define PCI_DEVICE_ID_STALLION_ECHPCI864 0x0002
1832#define PCI_DEVICE_ID_STALLION_EIOPCI 0x0003
1833
1834#define PCI_VENDOR_ID_OPTIBASE 0x1255
1835#define PCI_DEVICE_ID_OPTIBASE_FORGE 0x1110
1836#define PCI_DEVICE_ID_OPTIBASE_FUSION 0x1210
1837#define PCI_DEVICE_ID_OPTIBASE_VPLEX 0x2110
1838#define PCI_DEVICE_ID_OPTIBASE_VPLEXCC 0x2120
1839#define PCI_DEVICE_ID_OPTIBASE_VQUEST 0x2130
1840 1494
1841/* Allied Telesyn */ 1495/* Allied Telesyn */
1842#define PCI_VENDOR_ID_AT 0x1259 1496#define PCI_VENDOR_ID_AT 0x1259
@@ -1845,7 +1499,6 @@
1845 1499
1846#define PCI_VENDOR_ID_ESS 0x125d 1500#define PCI_VENDOR_ID_ESS 0x125d
1847#define PCI_DEVICE_ID_ESS_ESS1968 0x1968 1501#define PCI_DEVICE_ID_ESS_ESS1968 0x1968
1848#define PCI_DEVICE_ID_ESS_AUDIOPCI 0x1969
1849#define PCI_DEVICE_ID_ESS_ESS1978 0x1978 1502#define PCI_DEVICE_ID_ESS_ESS1978 0x1978
1850#define PCI_DEVICE_ID_ESS_ALLEGRO_1 0x1988 1503#define PCI_DEVICE_ID_ESS_ALLEGRO_1 0x1988
1851#define PCI_DEVICE_ID_ESS_ALLEGRO 0x1989 1504#define PCI_DEVICE_ID_ESS_ALLEGRO 0x1989
@@ -1858,11 +1511,7 @@
1858 1511
1859#define PCI_VENDOR_ID_SATSAGEM 0x1267 1512#define PCI_VENDOR_ID_SATSAGEM 0x1267
1860#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016 1513#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016
1861#define PCI_DEVICE_ID_SATSAGEM_PCR2101 0x5352
1862#define PCI_DEVICE_ID_SATSAGEM_TELSATTURBO 0x5a4b
1863 1514
1864#define PCI_VENDOR_ID_HUGHES 0x1273
1865#define PCI_DEVICE_ID_HUGHES_DIRECPC 0x0002
1866 1515
1867#define PCI_VENDOR_ID_ENSONIQ 0x1274 1516#define PCI_VENDOR_ID_ENSONIQ 0x1274
1868#define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880 1517#define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880
@@ -1883,13 +1532,10 @@
1883#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886 1532#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886
1884 1533
1885/* formerly Platform Tech */ 1534/* formerly Platform Tech */
1886#define PCI_VENDOR_ID_ESS_OLD 0x1285
1887#define PCI_DEVICE_ID_ESS_ESS0100 0x0100 1535#define PCI_DEVICE_ID_ESS_ESS0100 0x0100
1888 1536
1889#define PCI_VENDOR_ID_ALTEON 0x12ae 1537#define PCI_VENDOR_ID_ALTEON 0x12ae
1890#define PCI_DEVICE_ID_ALTEON_ACENIC 0x0001
1891 1538
1892#define PCI_VENDOR_ID_USR 0x12B9
1893 1539
1894#define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4 1540#define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4
1895#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001 1541#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001
@@ -1904,8 +1550,6 @@
1904#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1 0x000A 1550#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1 0x000A
1905#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1 0x000B 1551#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1 0x000B
1906 1552
1907#define PCI_VENDOR_ID_PICTUREL 0x12c5
1908#define PCI_DEVICE_ID_PICTUREL_PCIVST 0x0081
1909 1553
1910#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2 1554#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2
1911#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018 1555#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018
@@ -1927,8 +1571,6 @@
1927#define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8 1571#define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8
1928#define PCI_DEVICE_ID_LML_33R10 0x8a02 1572#define PCI_DEVICE_ID_LML_33R10 0x8a02
1929 1573
1930#define PCI_VENDOR_ID_CBOARDS 0x1307
1931#define PCI_DEVICE_ID_CBOARDS_DAS1602_16 0x0001
1932 1574
1933#define PCI_VENDOR_ID_SIIG 0x131f 1575#define PCI_VENDOR_ID_SIIG 0x131f
1934#define PCI_SUBVENDOR_ID_SIIG 0x131f 1576#define PCI_SUBVENDOR_ID_SIIG 0x131f
@@ -1972,7 +1614,6 @@
1972#define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 1614#define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050
1973 1615
1974#define PCI_VENDOR_ID_RADISYS 0x1331 1616#define PCI_VENDOR_ID_RADISYS 0x1331
1975#define PCI_DEVICE_ID_RADISYS_ENP2611 0x0030
1976 1617
1977#define PCI_VENDOR_ID_DOMEX 0x134a 1618#define PCI_VENDOR_ID_DOMEX 0x134a
1978#define PCI_DEVICE_ID_DOMEX_DMX3191D 0x0001 1619#define PCI_DEVICE_ID_DOMEX_DMX3191D 0x0001
@@ -1980,8 +1621,6 @@
1980#define PCI_VENDOR_ID_QUATECH 0x135C 1621#define PCI_VENDOR_ID_QUATECH 0x135C
1981#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010 1622#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010
1982#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 1623#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020
1983#define PCI_DEVICE_ID_QUATECH_DSC200 0x0030
1984#define PCI_DEVICE_ID_QUATECH_QSC200 0x0040
1985#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 1624#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050
1986#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 1625#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060
1987 1626
@@ -2000,7 +1639,6 @@
2000#define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106 1639#define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106
2001#define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107 1640#define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107
2002#define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108 1641#define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108
2003#define PCI_SUBDEVICE_ID_HYPERCOPE_PLEXUS 0x0109
2004 1642
2005#define PCI_VENDOR_ID_KAWASAKI 0x136b 1643#define PCI_VENDOR_ID_KAWASAKI 0x136b
2006#define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01 1644#define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01
@@ -2014,12 +1652,9 @@
2014#define PCI_DEVICE_ID_LMC_SSI 0x0005 1652#define PCI_DEVICE_ID_LMC_SSI 0x0005
2015#define PCI_DEVICE_ID_LMC_T1 0x0006 1653#define PCI_DEVICE_ID_LMC_T1 0x0006
2016 1654
2017#define PCI_VENDOR_ID_MARIAN 0x1382
2018#define PCI_DEVICE_ID_MARIAN_PRODIF_PLUS 0x2048
2019 1655
2020#define PCI_VENDOR_ID_NETGEAR 0x1385 1656#define PCI_VENDOR_ID_NETGEAR 0x1385
2021#define PCI_DEVICE_ID_NETGEAR_GA620 0x620a 1657#define PCI_DEVICE_ID_NETGEAR_GA620 0x620a
2022#define PCI_DEVICE_ID_NETGEAR_GA622 0x622a
2023 1658
2024#define PCI_VENDOR_ID_APPLICOM 0x1389 1659#define PCI_VENDOR_ID_APPLICOM 0x1389
2025#define PCI_DEVICE_ID_APPLICOM_PCIGENERIC 0x0001 1660#define PCI_DEVICE_ID_APPLICOM_PCIGENERIC 0x0001
@@ -2042,9 +1677,6 @@
2042#define PCI_DEVICE_ID_MOXA_CP134U 0x1340 1677#define PCI_DEVICE_ID_MOXA_CP134U 0x1340
2043#define PCI_DEVICE_ID_MOXA_C168 0x1680 1678#define PCI_DEVICE_ID_MOXA_C168 0x1680
2044#define PCI_DEVICE_ID_MOXA_CP168U 0x1681 1679#define PCI_DEVICE_ID_MOXA_CP168U 0x1681
2045#define PCI_DEVICE_ID_MOXA_CP204J 0x2040
2046#define PCI_DEVICE_ID_MOXA_C218 0x2180
2047#define PCI_DEVICE_ID_MOXA_C320 0x3200
2048 1680
2049#define PCI_VENDOR_ID_CCD 0x1397 1681#define PCI_VENDOR_ID_CCD 0x1397
2050#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 1682#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0
@@ -2065,9 +1697,7 @@
2065 1697
2066#define PCI_VENDOR_ID_MICROGATE 0x13c0 1698#define PCI_VENDOR_ID_MICROGATE 0x13c0
2067#define PCI_DEVICE_ID_MICROGATE_USC 0x0010 1699#define PCI_DEVICE_ID_MICROGATE_USC 0x0010
2068#define PCI_DEVICE_ID_MICROGATE_SCC 0x0020
2069#define PCI_DEVICE_ID_MICROGATE_SCA 0x0030 1700#define PCI_DEVICE_ID_MICROGATE_SCA 0x0030
2070#define PCI_DEVICE_ID_MICROGATE_USC2 0x0210
2071 1701
2072#define PCI_VENDOR_ID_3WARE 0x13C1 1702#define PCI_VENDOR_ID_3WARE 0x13C1
2073#define PCI_DEVICE_ID_3WARE_1000 0x1000 1703#define PCI_DEVICE_ID_3WARE_1000 0x1000
@@ -2118,10 +1748,6 @@
2118 1748
2119#define PCI_VENDOR_ID_SAMSUNG 0x144d 1749#define PCI_VENDOR_ID_SAMSUNG 0x144d
2120 1750
2121#define PCI_VENDOR_ID_AIRONET 0x14b9
2122#define PCI_DEVICE_ID_AIRONET_4800_1 0x0001
2123#define PCI_DEVICE_ID_AIRONET_4800 0x4500 // values switched? see
2124#define PCI_DEVICE_ID_AIRONET_4500 0x4800 // drivers/net/aironet4500_card.c
2125 1751
2126#define PCI_VENDOR_ID_TITAN 0x14D2 1752#define PCI_VENDOR_ID_TITAN 0x14D2
2127#define PCI_DEVICE_ID_TITAN_010L 0x8001 1753#define PCI_DEVICE_ID_TITAN_010L 0x8001
@@ -2140,8 +1766,6 @@
2140#define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400 1766#define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400
2141#define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402 1767#define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402
2142 1768
2143#define PCI_VENDOR_ID_SIPACKETS 0x14d9
2144#define PCI_DEVICE_ID_SP_HT 0x0010
2145 1769
2146#define PCI_VENDOR_ID_AFAVLAB 0x14db 1770#define PCI_VENDOR_ID_AFAVLAB 0x14db
2147#define PCI_DEVICE_ID_AFAVLAB_P028 0x2180 1771#define PCI_DEVICE_ID_AFAVLAB_P028 0x2180
@@ -2164,11 +1788,13 @@
2164#define PCI_DEVICE_ID_TIGON3_5721 0x1659 1788#define PCI_DEVICE_ID_TIGON3_5721 0x1659
2165#define PCI_DEVICE_ID_TIGON3_5705M 0x165d 1789#define PCI_DEVICE_ID_TIGON3_5705M 0x165d
2166#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e 1790#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e
1791#define PCI_DEVICE_ID_TIGON3_5714 0x1668
2167#define PCI_DEVICE_ID_TIGON3_5780 0x166a 1792#define PCI_DEVICE_ID_TIGON3_5780 0x166a
2168#define PCI_DEVICE_ID_TIGON3_5780S 0x166b 1793#define PCI_DEVICE_ID_TIGON3_5780S 0x166b
2169#define PCI_DEVICE_ID_TIGON3_5705F 0x166e 1794#define PCI_DEVICE_ID_TIGON3_5705F 0x166e
2170#define PCI_DEVICE_ID_TIGON3_5750 0x1676 1795#define PCI_DEVICE_ID_TIGON3_5750 0x1676
2171#define PCI_DEVICE_ID_TIGON3_5751 0x1677 1796#define PCI_DEVICE_ID_TIGON3_5751 0x1677
1797#define PCI_DEVICE_ID_TIGON3_5715 0x1678
2172#define PCI_DEVICE_ID_TIGON3_5750M 0x167c 1798#define PCI_DEVICE_ID_TIGON3_5750M 0x167c
2173#define PCI_DEVICE_ID_TIGON3_5751M 0x167d 1799#define PCI_DEVICE_ID_TIGON3_5751M 0x167d
2174#define PCI_DEVICE_ID_TIGON3_5751F 0x167e 1800#define PCI_DEVICE_ID_TIGON3_5751F 0x167e
@@ -2206,8 +1832,6 @@
2206 1832
2207#define PCI_VENDOR_ID_CHELSIO 0x1425 1833#define PCI_VENDOR_ID_CHELSIO 0x1425
2208 1834
2209#define PCI_VENDOR_ID_MIPS 0x153f
2210#define PCI_DEVICE_ID_SOC_IT 0x0001
2211 1835
2212#define PCI_VENDOR_ID_SYBA 0x1592 1836#define PCI_VENDOR_ID_SYBA 0x1592
2213#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 1837#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782
@@ -2227,15 +1851,7 @@
2227#define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 1851#define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274
2228 1852
2229#define PCI_VENDOR_ID_PDC 0x15e9 1853#define PCI_VENDOR_ID_PDC 0x15e9
2230#define PCI_DEVICE_ID_PDC_1841 0x1841
2231 1854
2232#define PCI_VENDOR_ID_MACROLINK 0x15ed
2233#define PCI_DEVICE_ID_MACROLINK_MCCS8 0x1000
2234#define PCI_DEVICE_ID_MACROLINK_MCCS 0x1001
2235#define PCI_DEVICE_ID_MACROLINK_MCCS8H 0x1002
2236#define PCI_DEVICE_ID_MACROLINK_MCCSH 0x1003
2237#define PCI_DEVICE_ID_MACROLINK_MCCR8 0x2000
2238#define PCI_DEVICE_ID_MACROLINK_MCCR 0x2001
2239 1855
2240#define PCI_VENDOR_ID_FARSITE 0x1619 1856#define PCI_VENDOR_ID_FARSITE 0x1619
2241#define PCI_DEVICE_ID_FARSITE_T2P 0x0400 1857#define PCI_DEVICE_ID_FARSITE_T2P 0x0400
@@ -2253,7 +1869,6 @@
2253#define PCI_DEVICE_ID_REVOLUTION 0x0044 1869#define PCI_DEVICE_ID_REVOLUTION 0x0044
2254 1870
2255#define PCI_VENDOR_ID_LINKSYS 0x1737 1871#define PCI_VENDOR_ID_LINKSYS 0x1737
2256#define PCI_DEVICE_ID_LINKSYS_EG1032 0x1032
2257#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 1872#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064
2258 1873
2259#define PCI_VENDOR_ID_ALTIMA 0x173b 1874#define PCI_VENDOR_ID_ALTIMA 0x173b
@@ -2268,7 +1883,6 @@
2268#define PCI_DEVICE_ID_HERC_WIN 0x5732 1883#define PCI_DEVICE_ID_HERC_WIN 0x5732
2269#define PCI_DEVICE_ID_HERC_UNI 0x5832 1884#define PCI_DEVICE_ID_HERC_UNI 0x5832
2270 1885
2271#define PCI_VENDOR_ID_INFINICON 0x1820
2272 1886
2273#define PCI_VENDOR_ID_SITECOM 0x182d 1887#define PCI_VENDOR_ID_SITECOM 0x182d
2274#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 1888#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069
@@ -2278,8 +1892,6 @@
2278#define PCI_VENDOR_ID_TDI 0x192E 1892#define PCI_VENDOR_ID_TDI 0x192E
2279#define PCI_DEVICE_ID_TDI_EHCI 0x0101 1893#define PCI_DEVICE_ID_TDI_EHCI 0x0101
2280 1894
2281#define PCI_VENDOR_ID_SYMPHONY 0x1c1c
2282#define PCI_DEVICE_ID_SYMPHONY_101 0x0001
2283 1895
2284#define PCI_VENDOR_ID_TEKRAM 0x1de1 1896#define PCI_VENDOR_ID_TEKRAM 0x1de1
2285#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 1897#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29
@@ -2288,70 +1900,33 @@
2288#define PCI_DEVICE_ID_HINT_VXPROII_IDE 0x8013 1900#define PCI_DEVICE_ID_HINT_VXPROII_IDE 0x8013
2289 1901
2290#define PCI_VENDOR_ID_3DLABS 0x3d3d 1902#define PCI_VENDOR_ID_3DLABS 0x3d3d
2291#define PCI_DEVICE_ID_3DLABS_300SX 0x0001
2292#define PCI_DEVICE_ID_3DLABS_500TX 0x0002
2293#define PCI_DEVICE_ID_3DLABS_DELTA 0x0003
2294#define PCI_DEVICE_ID_3DLABS_PERMEDIA 0x0004
2295#define PCI_DEVICE_ID_3DLABS_MX 0x0006
2296#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 1903#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007
2297#define PCI_DEVICE_ID_3DLABS_GAMMA 0x0008
2298#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 1904#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009
2299 1905
2300#define PCI_VENDOR_ID_AVANCE 0x4005
2301#define PCI_DEVICE_ID_AVANCE_ALG2064 0x2064
2302#define PCI_DEVICE_ID_AVANCE_2302 0x2302
2303 1906
2304#define PCI_VENDOR_ID_AKS 0x416c 1907#define PCI_VENDOR_ID_AKS 0x416c
2305#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 1908#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100
2306#define PCI_DEVICE_ID_AKS_CPC 0x0200
2307 1909
2308#define PCI_VENDOR_ID_REDCREEK 0x4916
2309#define PCI_DEVICE_ID_RC45 0x1960
2310 1910
2311#define PCI_VENDOR_ID_NETVIN 0x4a14
2312#define PCI_DEVICE_ID_NETVIN_NV5000SC 0x5000
2313 1911
2314#define PCI_VENDOR_ID_S3 0x5333 1912#define PCI_VENDOR_ID_S3 0x5333
2315#define PCI_DEVICE_ID_S3_PLATO_PXS 0x0551
2316#define PCI_DEVICE_ID_S3_ViRGE 0x5631
2317#define PCI_DEVICE_ID_S3_TRIO 0x8811 1913#define PCI_DEVICE_ID_S3_TRIO 0x8811
2318#define PCI_DEVICE_ID_S3_AURORA64VP 0x8812
2319#define PCI_DEVICE_ID_S3_TRIO64UVP 0x8814
2320#define PCI_DEVICE_ID_S3_ViRGE_VX 0x883d
2321#define PCI_DEVICE_ID_S3_868 0x8880 1914#define PCI_DEVICE_ID_S3_868 0x8880
2322#define PCI_DEVICE_ID_S3_928 0x88b0
2323#define PCI_DEVICE_ID_S3_864_1 0x88c0
2324#define PCI_DEVICE_ID_S3_864_2 0x88c1
2325#define PCI_DEVICE_ID_S3_964_1 0x88d0
2326#define PCI_DEVICE_ID_S3_964_2 0x88d1
2327#define PCI_DEVICE_ID_S3_968 0x88f0 1915#define PCI_DEVICE_ID_S3_968 0x88f0
2328#define PCI_DEVICE_ID_S3_TRIO64V2 0x8901
2329#define PCI_DEVICE_ID_S3_PLATO_PXG 0x8902
2330#define PCI_DEVICE_ID_S3_ViRGE_DXGX 0x8a01
2331#define PCI_DEVICE_ID_S3_ViRGE_GX2 0x8a10
2332#define PCI_DEVICE_ID_S3_SAVAGE4 0x8a25 1916#define PCI_DEVICE_ID_S3_SAVAGE4 0x8a25
2333#define PCI_DEVICE_ID_S3_ViRGE_MX 0x8c01
2334#define PCI_DEVICE_ID_S3_ViRGE_MXP 0x8c02
2335#define PCI_DEVICE_ID_S3_ViRGE_MXPMV 0x8c03
2336#define PCI_DEVICE_ID_S3_PROSAVAGE8 0x8d04 1917#define PCI_DEVICE_ID_S3_PROSAVAGE8 0x8d04
2337#define PCI_DEVICE_ID_S3_SONICVIBES 0xca00 1918#define PCI_DEVICE_ID_S3_SONICVIBES 0xca00
2338 1919
2339#define PCI_VENDOR_ID_DUNORD 0x5544 1920#define PCI_VENDOR_ID_DUNORD 0x5544
2340#define PCI_DEVICE_ID_DUNORD_I3000 0x0001 1921#define PCI_DEVICE_ID_DUNORD_I3000 0x0001
2341 1922
1923
2342#define PCI_VENDOR_ID_DCI 0x6666 1924#define PCI_VENDOR_ID_DCI 0x6666
2343#define PCI_DEVICE_ID_DCI_PCCOM4 0x0001 1925#define PCI_DEVICE_ID_DCI_PCCOM4 0x0001
2344#define PCI_DEVICE_ID_DCI_PCCOM8 0x0002 1926#define PCI_DEVICE_ID_DCI_PCCOM8 0x0002
2345 1927
2346#define PCI_VENDOR_ID_DUNORD 0x5544
2347#define PCI_DEVICE_ID_DUNORD_I3000 0x0001
2348
2349#define PCI_VENDOR_ID_GENROCO 0x5555
2350#define PCI_DEVICE_ID_GENROCO_HFP832 0x0003
2351
2352#define PCI_VENDOR_ID_INTEL 0x8086 1928#define PCI_VENDOR_ID_INTEL 0x8086
2353#define PCI_DEVICE_ID_INTEL_EESSC 0x0008 1929#define PCI_DEVICE_ID_INTEL_EESSC 0x0008
2354#define PCI_DEVICE_ID_INTEL_21145 0x0039
2355#define PCI_DEVICE_ID_INTEL_PXHD_0 0x0320 1930#define PCI_DEVICE_ID_INTEL_PXHD_0 0x0320
2356#define PCI_DEVICE_ID_INTEL_PXHD_1 0x0321 1931#define PCI_DEVICE_ID_INTEL_PXHD_1 0x0321
2357#define PCI_DEVICE_ID_INTEL_PXH_0 0x0329 1932#define PCI_DEVICE_ID_INTEL_PXH_0 0x0329
@@ -2360,30 +1935,17 @@
2360#define PCI_DEVICE_ID_INTEL_82375 0x0482 1935#define PCI_DEVICE_ID_INTEL_82375 0x0482
2361#define PCI_DEVICE_ID_INTEL_82424 0x0483 1936#define PCI_DEVICE_ID_INTEL_82424 0x0483
2362#define PCI_DEVICE_ID_INTEL_82378 0x0484 1937#define PCI_DEVICE_ID_INTEL_82378 0x0484
2363#define PCI_DEVICE_ID_INTEL_82430 0x0486
2364#define PCI_DEVICE_ID_INTEL_82434 0x04a3
2365#define PCI_DEVICE_ID_INTEL_I960 0x0960 1938#define PCI_DEVICE_ID_INTEL_I960 0x0960
2366#define PCI_DEVICE_ID_INTEL_I960RM 0x0962 1939#define PCI_DEVICE_ID_INTEL_I960RM 0x0962
2367#define PCI_DEVICE_ID_INTEL_82562ET 0x1031
2368#define PCI_DEVICE_ID_INTEL_82801CAM 0x1038
2369#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130 1940#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130
2370#define PCI_DEVICE_ID_INTEL_82815_AB 0x1131
2371#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132 1941#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132
2372#define PCI_DEVICE_ID_INTEL_82559ER 0x1209
2373#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221 1942#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221
2374#define PCI_DEVICE_ID_INTEL_82092AA_1 0x1222
2375#define PCI_DEVICE_ID_INTEL_7116 0x1223
2376#define PCI_DEVICE_ID_INTEL_7505_0 0x2550 1943#define PCI_DEVICE_ID_INTEL_7505_0 0x2550
2377#define PCI_DEVICE_ID_INTEL_7505_1 0x2552
2378#define PCI_DEVICE_ID_INTEL_7205_0 0x255d 1944#define PCI_DEVICE_ID_INTEL_7205_0 0x255d
2379#define PCI_DEVICE_ID_INTEL_82596 0x1226
2380#define PCI_DEVICE_ID_INTEL_82865 0x1227
2381#define PCI_DEVICE_ID_INTEL_82557 0x1229
2382#define PCI_DEVICE_ID_INTEL_82437 0x122d 1945#define PCI_DEVICE_ID_INTEL_82437 0x122d
2383#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e 1946#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e
2384#define PCI_DEVICE_ID_INTEL_82371FB_1 0x1230 1947#define PCI_DEVICE_ID_INTEL_82371FB_1 0x1230
2385#define PCI_DEVICE_ID_INTEL_82371MX 0x1234 1948#define PCI_DEVICE_ID_INTEL_82371MX 0x1234
2386#define PCI_DEVICE_ID_INTEL_82437MX 0x1235
2387#define PCI_DEVICE_ID_INTEL_82441 0x1237 1949#define PCI_DEVICE_ID_INTEL_82441 0x1237
2388#define PCI_DEVICE_ID_INTEL_82380FB 0x124b 1950#define PCI_DEVICE_ID_INTEL_82380FB 0x124b
2389#define PCI_DEVICE_ID_INTEL_82439 0x1250 1951#define PCI_DEVICE_ID_INTEL_82439 0x1250
@@ -2392,83 +1954,53 @@
2392#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 1954#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30
2393#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 1955#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410
2394#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 1956#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411
2395#define PCI_DEVICE_ID_INTEL_82801AA_2 0x2412
2396#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 1957#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
2397#define PCI_DEVICE_ID_INTEL_82801AA_5 0x2415 1958#define PCI_DEVICE_ID_INTEL_82801AA_5 0x2415
2398#define PCI_DEVICE_ID_INTEL_82801AA_6 0x2416 1959#define PCI_DEVICE_ID_INTEL_82801AA_6 0x2416
2399#define PCI_DEVICE_ID_INTEL_82801AA_8 0x2418 1960#define PCI_DEVICE_ID_INTEL_82801AA_8 0x2418
2400#define PCI_DEVICE_ID_INTEL_82801AB_0 0x2420 1961#define PCI_DEVICE_ID_INTEL_82801AB_0 0x2420
2401#define PCI_DEVICE_ID_INTEL_82801AB_1 0x2421 1962#define PCI_DEVICE_ID_INTEL_82801AB_1 0x2421
2402#define PCI_DEVICE_ID_INTEL_82801AB_2 0x2422
2403#define PCI_DEVICE_ID_INTEL_82801AB_3 0x2423 1963#define PCI_DEVICE_ID_INTEL_82801AB_3 0x2423
2404#define PCI_DEVICE_ID_INTEL_82801AB_5 0x2425 1964#define PCI_DEVICE_ID_INTEL_82801AB_5 0x2425
2405#define PCI_DEVICE_ID_INTEL_82801AB_6 0x2426 1965#define PCI_DEVICE_ID_INTEL_82801AB_6 0x2426
2406#define PCI_DEVICE_ID_INTEL_82801AB_8 0x2428 1966#define PCI_DEVICE_ID_INTEL_82801AB_8 0x2428
2407#define PCI_DEVICE_ID_INTEL_82801BA_0 0x2440 1967#define PCI_DEVICE_ID_INTEL_82801BA_0 0x2440
2408#define PCI_DEVICE_ID_INTEL_82801BA_1 0x2442
2409#define PCI_DEVICE_ID_INTEL_82801BA_2 0x2443 1968#define PCI_DEVICE_ID_INTEL_82801BA_2 0x2443
2410#define PCI_DEVICE_ID_INTEL_82801BA_3 0x2444
2411#define PCI_DEVICE_ID_INTEL_82801BA_4 0x2445 1969#define PCI_DEVICE_ID_INTEL_82801BA_4 0x2445
2412#define PCI_DEVICE_ID_INTEL_82801BA_5 0x2446
2413#define PCI_DEVICE_ID_INTEL_82801BA_6 0x2448 1970#define PCI_DEVICE_ID_INTEL_82801BA_6 0x2448
2414#define PCI_DEVICE_ID_INTEL_82801BA_7 0x2449
2415#define PCI_DEVICE_ID_INTEL_82801BA_8 0x244a 1971#define PCI_DEVICE_ID_INTEL_82801BA_8 0x244a
2416#define PCI_DEVICE_ID_INTEL_82801BA_9 0x244b 1972#define PCI_DEVICE_ID_INTEL_82801BA_9 0x244b
2417#define PCI_DEVICE_ID_INTEL_82801BA_10 0x244c 1973#define PCI_DEVICE_ID_INTEL_82801BA_10 0x244c
2418#define PCI_DEVICE_ID_INTEL_82801BA_11 0x244e 1974#define PCI_DEVICE_ID_INTEL_82801BA_11 0x244e
2419#define PCI_DEVICE_ID_INTEL_82801E_0 0x2450 1975#define PCI_DEVICE_ID_INTEL_82801E_0 0x2450
2420#define PCI_DEVICE_ID_INTEL_82801E_2 0x2452
2421#define PCI_DEVICE_ID_INTEL_82801E_3 0x2453
2422#define PCI_DEVICE_ID_INTEL_82801E_9 0x2459
2423#define PCI_DEVICE_ID_INTEL_82801E_11 0x245b 1976#define PCI_DEVICE_ID_INTEL_82801E_11 0x245b
2424#define PCI_DEVICE_ID_INTEL_82801E_13 0x245d
2425#define PCI_DEVICE_ID_INTEL_82801E_14 0x245e
2426#define PCI_DEVICE_ID_INTEL_82801CA_0 0x2480 1977#define PCI_DEVICE_ID_INTEL_82801CA_0 0x2480
2427#define PCI_DEVICE_ID_INTEL_82801CA_2 0x2482
2428#define PCI_DEVICE_ID_INTEL_82801CA_3 0x2483 1978#define PCI_DEVICE_ID_INTEL_82801CA_3 0x2483
2429#define PCI_DEVICE_ID_INTEL_82801CA_4 0x2484
2430#define PCI_DEVICE_ID_INTEL_82801CA_5 0x2485 1979#define PCI_DEVICE_ID_INTEL_82801CA_5 0x2485
2431#define PCI_DEVICE_ID_INTEL_82801CA_6 0x2486 1980#define PCI_DEVICE_ID_INTEL_82801CA_6 0x2486
2432#define PCI_DEVICE_ID_INTEL_82801CA_7 0x2487
2433#define PCI_DEVICE_ID_INTEL_82801CA_10 0x248a 1981#define PCI_DEVICE_ID_INTEL_82801CA_10 0x248a
2434#define PCI_DEVICE_ID_INTEL_82801CA_11 0x248b 1982#define PCI_DEVICE_ID_INTEL_82801CA_11 0x248b
2435#define PCI_DEVICE_ID_INTEL_82801CA_12 0x248c 1983#define PCI_DEVICE_ID_INTEL_82801CA_12 0x248c
2436#define PCI_DEVICE_ID_INTEL_82801DB_0 0x24c0 1984#define PCI_DEVICE_ID_INTEL_82801DB_0 0x24c0
2437#define PCI_DEVICE_ID_INTEL_82801DB_1 0x24c1 1985#define PCI_DEVICE_ID_INTEL_82801DB_1 0x24c1
2438#define PCI_DEVICE_ID_INTEL_82801DB_2 0x24c2
2439#define PCI_DEVICE_ID_INTEL_82801DB_3 0x24c3 1986#define PCI_DEVICE_ID_INTEL_82801DB_3 0x24c3
2440#define PCI_DEVICE_ID_INTEL_82801DB_4 0x24c4
2441#define PCI_DEVICE_ID_INTEL_82801DB_5 0x24c5 1987#define PCI_DEVICE_ID_INTEL_82801DB_5 0x24c5
2442#define PCI_DEVICE_ID_INTEL_82801DB_6 0x24c6 1988#define PCI_DEVICE_ID_INTEL_82801DB_6 0x24c6
2443#define PCI_DEVICE_ID_INTEL_82801DB_7 0x24c7
2444#define PCI_DEVICE_ID_INTEL_82801DB_9 0x24c9 1989#define PCI_DEVICE_ID_INTEL_82801DB_9 0x24c9
2445#define PCI_DEVICE_ID_INTEL_82801DB_10 0x24ca 1990#define PCI_DEVICE_ID_INTEL_82801DB_10 0x24ca
2446#define PCI_DEVICE_ID_INTEL_82801DB_11 0x24cb 1991#define PCI_DEVICE_ID_INTEL_82801DB_11 0x24cb
2447#define PCI_DEVICE_ID_INTEL_82801DB_12 0x24cc 1992#define PCI_DEVICE_ID_INTEL_82801DB_12 0x24cc
2448#define PCI_DEVICE_ID_INTEL_82801DB_13 0x24cd
2449#define PCI_DEVICE_ID_INTEL_82801EB_0 0x24d0 1993#define PCI_DEVICE_ID_INTEL_82801EB_0 0x24d0
2450#define PCI_DEVICE_ID_INTEL_82801EB_1 0x24d1 1994#define PCI_DEVICE_ID_INTEL_82801EB_1 0x24d1
2451#define PCI_DEVICE_ID_INTEL_82801EB_2 0x24d2
2452#define PCI_DEVICE_ID_INTEL_82801EB_3 0x24d3 1995#define PCI_DEVICE_ID_INTEL_82801EB_3 0x24d3
2453#define PCI_DEVICE_ID_INTEL_82801EB_4 0x24d4
2454#define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5 1996#define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5
2455#define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6 1997#define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6
2456#define PCI_DEVICE_ID_INTEL_82801EB_7 0x24d7
2457#define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db 1998#define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db
2458#define PCI_DEVICE_ID_INTEL_82801EB_13 0x24dd
2459#define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1 1999#define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1
2460#define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2 2000#define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2
2461#define PCI_DEVICE_ID_INTEL_ESB_3 0x25a3
2462#define PCI_DEVICE_ID_INTEL_ESB_31 0x25b0
2463#define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4 2001#define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4
2464#define PCI_DEVICE_ID_INTEL_ESB_5 0x25a6 2002#define PCI_DEVICE_ID_INTEL_ESB_5 0x25a6
2465#define PCI_DEVICE_ID_INTEL_ESB_6 0x25a7
2466#define PCI_DEVICE_ID_INTEL_ESB_7 0x25a9
2467#define PCI_DEVICE_ID_INTEL_ESB_8 0x25aa
2468#define PCI_DEVICE_ID_INTEL_ESB_9 0x25ab 2003#define PCI_DEVICE_ID_INTEL_ESB_9 0x25ab
2469#define PCI_DEVICE_ID_INTEL_ESB_11 0x25ac
2470#define PCI_DEVICE_ID_INTEL_ESB_12 0x25ad
2471#define PCI_DEVICE_ID_INTEL_ESB_13 0x25ae
2472#define PCI_DEVICE_ID_INTEL_82820_HB 0x2500 2004#define PCI_DEVICE_ID_INTEL_82820_HB 0x2500
2473#define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501 2005#define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501
2474#define PCI_DEVICE_ID_INTEL_82850_HB 0x2530 2006#define PCI_DEVICE_ID_INTEL_82850_HB 0x2530
@@ -2478,7 +2010,6 @@
2478#define PCI_DEVICE_ID_INTEL_82865_HB 0x2570 2010#define PCI_DEVICE_ID_INTEL_82865_HB 0x2570
2479#define PCI_DEVICE_ID_INTEL_82865_IG 0x2572 2011#define PCI_DEVICE_ID_INTEL_82865_IG 0x2572
2480#define PCI_DEVICE_ID_INTEL_82875_HB 0x2578 2012#define PCI_DEVICE_ID_INTEL_82875_HB 0x2578
2481#define PCI_DEVICE_ID_INTEL_82875_IG 0x257b
2482#define PCI_DEVICE_ID_INTEL_82915G_HB 0x2580 2013#define PCI_DEVICE_ID_INTEL_82915G_HB 0x2580
2483#define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582 2014#define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582
2484#define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590 2015#define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590
@@ -2488,80 +2019,23 @@
2488#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 2019#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640
2489#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 2020#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641
2490#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 2021#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642
2491#define PCI_DEVICE_ID_INTEL_ICH6_3 0x2651
2492#define PCI_DEVICE_ID_INTEL_ICH6_4 0x2652
2493#define PCI_DEVICE_ID_INTEL_ICH6_5 0x2653
2494#define PCI_DEVICE_ID_INTEL_ICH6_6 0x2658
2495#define PCI_DEVICE_ID_INTEL_ICH6_7 0x2659
2496#define PCI_DEVICE_ID_INTEL_ICH6_8 0x265a
2497#define PCI_DEVICE_ID_INTEL_ICH6_9 0x265b
2498#define PCI_DEVICE_ID_INTEL_ICH6_10 0x265c
2499#define PCI_DEVICE_ID_INTEL_ICH6_11 0x2660
2500#define PCI_DEVICE_ID_INTEL_ICH6_12 0x2662
2501#define PCI_DEVICE_ID_INTEL_ICH6_13 0x2664
2502#define PCI_DEVICE_ID_INTEL_ICH6_14 0x2666
2503#define PCI_DEVICE_ID_INTEL_ICH6_15 0x2668
2504#define PCI_DEVICE_ID_INTEL_ICH6_16 0x266a 2022#define PCI_DEVICE_ID_INTEL_ICH6_16 0x266a
2505#define PCI_DEVICE_ID_INTEL_ICH6_17 0x266d 2023#define PCI_DEVICE_ID_INTEL_ICH6_17 0x266d
2506#define PCI_DEVICE_ID_INTEL_ICH6_18 0x266e 2024#define PCI_DEVICE_ID_INTEL_ICH6_18 0x266e
2507#define PCI_DEVICE_ID_INTEL_ICH6_19 0x266f 2025#define PCI_DEVICE_ID_INTEL_ICH6_19 0x266f
2508#define PCI_DEVICE_ID_INTEL_ESB2_0 0x2670 2026#define PCI_DEVICE_ID_INTEL_ESB2_0 0x2670
2509#define PCI_DEVICE_ID_INTEL_ESB2_1 0x2680
2510#define PCI_DEVICE_ID_INTEL_ESB2_2 0x2681
2511#define PCI_DEVICE_ID_INTEL_ESB2_3 0x2682
2512#define PCI_DEVICE_ID_INTEL_ESB2_4 0x2683
2513#define PCI_DEVICE_ID_INTEL_ESB2_5 0x2688
2514#define PCI_DEVICE_ID_INTEL_ESB2_6 0x2689
2515#define PCI_DEVICE_ID_INTEL_ESB2_7 0x268a
2516#define PCI_DEVICE_ID_INTEL_ESB2_8 0x268b
2517#define PCI_DEVICE_ID_INTEL_ESB2_9 0x268c
2518#define PCI_DEVICE_ID_INTEL_ESB2_10 0x2690
2519#define PCI_DEVICE_ID_INTEL_ESB2_11 0x2692
2520#define PCI_DEVICE_ID_INTEL_ESB2_12 0x2694
2521#define PCI_DEVICE_ID_INTEL_ESB2_13 0x2696
2522#define PCI_DEVICE_ID_INTEL_ESB2_14 0x2698 2027#define PCI_DEVICE_ID_INTEL_ESB2_14 0x2698
2523#define PCI_DEVICE_ID_INTEL_ESB2_15 0x2699
2524#define PCI_DEVICE_ID_INTEL_ESB2_16 0x269a
2525#define PCI_DEVICE_ID_INTEL_ESB2_17 0x269b 2028#define PCI_DEVICE_ID_INTEL_ESB2_17 0x269b
2526#define PCI_DEVICE_ID_INTEL_ESB2_18 0x269e 2029#define PCI_DEVICE_ID_INTEL_ESB2_18 0x269e
2527#define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8 2030#define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8
2528#define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9 2031#define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9
2529#define PCI_DEVICE_ID_INTEL_ICH7_2 0x27c0
2530#define PCI_DEVICE_ID_INTEL_ICH7_3 0x27c1
2531#define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0 2032#define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0
2532#define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd 2033#define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd
2533#define PCI_DEVICE_ID_INTEL_ICH7_5 0x27c4
2534#define PCI_DEVICE_ID_INTEL_ICH7_6 0x27c5
2535#define PCI_DEVICE_ID_INTEL_ICH7_7 0x27c8
2536#define PCI_DEVICE_ID_INTEL_ICH7_8 0x27c9
2537#define PCI_DEVICE_ID_INTEL_ICH7_9 0x27ca
2538#define PCI_DEVICE_ID_INTEL_ICH7_10 0x27cb
2539#define PCI_DEVICE_ID_INTEL_ICH7_11 0x27cc
2540#define PCI_DEVICE_ID_INTEL_ICH7_12 0x27d0
2541#define PCI_DEVICE_ID_INTEL_ICH7_13 0x27d2
2542#define PCI_DEVICE_ID_INTEL_ICH7_14 0x27d4
2543#define PCI_DEVICE_ID_INTEL_ICH7_15 0x27d6
2544#define PCI_DEVICE_ID_INTEL_ICH7_16 0x27d8
2545#define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da 2034#define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da
2546#define PCI_DEVICE_ID_INTEL_ICH7_18 0x27dc
2547#define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd 2035#define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd
2548#define PCI_DEVICE_ID_INTEL_ICH7_20 0x27de 2036#define PCI_DEVICE_ID_INTEL_ICH7_20 0x27de
2549#define PCI_DEVICE_ID_INTEL_ICH7_21 0x27df 2037#define PCI_DEVICE_ID_INTEL_ICH7_21 0x27df
2550#define PCI_DEVICE_ID_INTEL_ICH7_22 0x27e0
2551#define PCI_DEVICE_ID_INTEL_ICH7_23 0x27e2
2552#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 2038#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
2553#define PCI_DEVICE_ID_INTEL_ESB2_19 0x3500
2554#define PCI_DEVICE_ID_INTEL_ESB2_20 0x3501
2555#define PCI_DEVICE_ID_INTEL_ESB2_21 0x3504
2556#define PCI_DEVICE_ID_INTEL_ESB2_22 0x3505
2557#define PCI_DEVICE_ID_INTEL_ESB2_23 0x350c
2558#define PCI_DEVICE_ID_INTEL_ESB2_24 0x350d
2559#define PCI_DEVICE_ID_INTEL_ESB2_25 0x3510
2560#define PCI_DEVICE_ID_INTEL_ESB2_26 0x3511
2561#define PCI_DEVICE_ID_INTEL_ESB2_27 0x3514
2562#define PCI_DEVICE_ID_INTEL_ESB2_28 0x3515
2563#define PCI_DEVICE_ID_INTEL_ESB2_29 0x3518
2564#define PCI_DEVICE_ID_INTEL_ESB2_30 0x3519
2565#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 2039#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
2566#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 2040#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
2567#define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580 2041#define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580
@@ -2575,7 +2049,6 @@
2575#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 2049#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599
2576#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a 2050#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a
2577#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e 2051#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e
2578#define PCI_DEVICE_ID_INTEL_80310 0x530d
2579#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 2052#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000
2580#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 2053#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010
2581#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 2054#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020
@@ -2600,22 +2073,15 @@
2600#define PCI_DEVICE_ID_INTEL_440MX_6 0x7196 2073#define PCI_DEVICE_ID_INTEL_440MX_6 0x7196
2601#define PCI_DEVICE_ID_INTEL_82443MX_0 0x7198 2074#define PCI_DEVICE_ID_INTEL_82443MX_0 0x7198
2602#define PCI_DEVICE_ID_INTEL_82443MX_1 0x7199 2075#define PCI_DEVICE_ID_INTEL_82443MX_1 0x7199
2603#define PCI_DEVICE_ID_INTEL_82443MX_2 0x719a
2604#define PCI_DEVICE_ID_INTEL_82443MX_3 0x719b 2076#define PCI_DEVICE_ID_INTEL_82443MX_3 0x719b
2605#define PCI_DEVICE_ID_INTEL_82443GX_0 0x71a0 2077#define PCI_DEVICE_ID_INTEL_82443GX_0 0x71a0
2606#define PCI_DEVICE_ID_INTEL_82443GX_1 0x71a1
2607#define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2 2078#define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2
2608#define PCI_DEVICE_ID_INTEL_82372FB_0 0x7600
2609#define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601 2079#define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601
2610#define PCI_DEVICE_ID_INTEL_82372FB_2 0x7602
2611#define PCI_DEVICE_ID_INTEL_82372FB_3 0x7603
2612#define PCI_DEVICE_ID_INTEL_82454GX 0x84c4 2080#define PCI_DEVICE_ID_INTEL_82454GX 0x84c4
2613#define PCI_DEVICE_ID_INTEL_82450GX 0x84c5
2614#define PCI_DEVICE_ID_INTEL_82451NX 0x84ca 2081#define PCI_DEVICE_ID_INTEL_82451NX 0x84ca
2615#define PCI_DEVICE_ID_INTEL_82454NX 0x84cb 2082#define PCI_DEVICE_ID_INTEL_82454NX 0x84cb
2616#define PCI_DEVICE_ID_INTEL_84460GX 0x84ea 2083#define PCI_DEVICE_ID_INTEL_84460GX 0x84ea
2617#define PCI_DEVICE_ID_INTEL_IXP4XX 0x8500 2084#define PCI_DEVICE_ID_INTEL_IXP4XX 0x8500
2618#define PCI_DEVICE_ID_INTEL_IXP2400 0x9001
2619#define PCI_DEVICE_ID_INTEL_IXP2800 0x9004 2085#define PCI_DEVICE_ID_INTEL_IXP2800 0x9004
2620#define PCI_DEVICE_ID_INTEL_S21152BB 0xb152 2086#define PCI_DEVICE_ID_INTEL_S21152BB 0xb152
2621 2087
@@ -2628,7 +2094,6 @@
2628#define PCI_SUBDEVICE_ID_COMPUTONE_PG6 0x0003 2094#define PCI_SUBDEVICE_ID_COMPUTONE_PG6 0x0003
2629 2095
2630#define PCI_VENDOR_ID_KTI 0x8e2e 2096#define PCI_VENDOR_ID_KTI 0x8e2e
2631#define PCI_DEVICE_ID_KTI_ET32P2 0x3000
2632 2097
2633#define PCI_VENDOR_ID_ADAPTEC 0x9004 2098#define PCI_VENDOR_ID_ADAPTEC 0x9004
2634#define PCI_DEVICE_ID_ADAPTEC_7810 0x1078 2099#define PCI_DEVICE_ID_ADAPTEC_7810 0x1078
@@ -2636,7 +2101,6 @@
2636#define PCI_DEVICE_ID_ADAPTEC_38602 0x3860 2101#define PCI_DEVICE_ID_ADAPTEC_38602 0x3860
2637#define PCI_DEVICE_ID_ADAPTEC_7850 0x5078 2102#define PCI_DEVICE_ID_ADAPTEC_7850 0x5078
2638#define PCI_DEVICE_ID_ADAPTEC_7855 0x5578 2103#define PCI_DEVICE_ID_ADAPTEC_7855 0x5578
2639#define PCI_DEVICE_ID_ADAPTEC_5800 0x5800
2640#define PCI_DEVICE_ID_ADAPTEC_3860 0x6038 2104#define PCI_DEVICE_ID_ADAPTEC_3860 0x6038
2641#define PCI_DEVICE_ID_ADAPTEC_1480A 0x6075 2105#define PCI_DEVICE_ID_ADAPTEC_1480A 0x6075
2642#define PCI_DEVICE_ID_ADAPTEC_7860 0x6078 2106#define PCI_DEVICE_ID_ADAPTEC_7860 0x6078
@@ -2656,7 +2120,6 @@
2656#define PCI_DEVICE_ID_ADAPTEC_7886 0x8678 2120#define PCI_DEVICE_ID_ADAPTEC_7886 0x8678
2657#define PCI_DEVICE_ID_ADAPTEC_7887 0x8778 2121#define PCI_DEVICE_ID_ADAPTEC_7887 0x8778
2658#define PCI_DEVICE_ID_ADAPTEC_7888 0x8878 2122#define PCI_DEVICE_ID_ADAPTEC_7888 0x8878
2659#define PCI_DEVICE_ID_ADAPTEC_1030 0x8b78
2660 2123
2661#define PCI_VENDOR_ID_ADAPTEC2 0x9005 2124#define PCI_VENDOR_ID_ADAPTEC2 0x9005
2662#define PCI_DEVICE_ID_ADAPTEC2_2940U2 0x0010 2125#define PCI_DEVICE_ID_ADAPTEC2_2940U2 0x0010
@@ -2676,8 +2139,6 @@
2676#define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf 2139#define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf
2677#define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503 2140#define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503
2678 2141
2679#define PCI_VENDOR_ID_ATRONICS 0x907f
2680#define PCI_DEVICE_ID_ATRONICS_2015 0x2015
2681 2142
2682#define PCI_VENDOR_ID_HOLTEK 0x9412 2143#define PCI_VENDOR_ID_HOLTEK 0x9412
2683#define PCI_DEVICE_ID_HOLTEK_6565 0x6565 2144#define PCI_DEVICE_ID_HOLTEK_6565 0x6565
@@ -2696,6 +2157,7 @@
2696 2157
2697#define PCI_SUBVENDOR_ID_EXSYS 0xd84d 2158#define PCI_SUBVENDOR_ID_EXSYS 0xd84d
2698#define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014 2159#define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014
2160#define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055
2699 2161
2700#define PCI_VENDOR_ID_TIGERJET 0xe159 2162#define PCI_VENDOR_ID_TIGERJET 0xe159
2701#define PCI_DEVICE_ID_TIGERJET_300 0x0001 2163#define PCI_DEVICE_ID_TIGERJET_300 0x0001
@@ -2709,7 +2171,3 @@
2709#define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 2171#define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897
2710#define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 2172#define PCI_DEVICE_ID_RME_DIGI32_8 0x9898
2711 2173
2712#define PCI_VENDOR_ID_ARK 0xedd8
2713#define PCI_DEVICE_ID_ARK_STING 0xa091
2714#define PCI_DEVICE_ID_ARK_STINGARK 0xa099
2715#define PCI_DEVICE_ID_ARK_2000MT 0xa0a1
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 5cfb07648eca..c61d5de837ef 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -219,10 +219,11 @@ typedef struct pm_message {
219 219
220struct dev_pm_info { 220struct dev_pm_info {
221 pm_message_t power_state; 221 pm_message_t power_state;
222 unsigned can_wakeup:1;
222#ifdef CONFIG_PM 223#ifdef CONFIG_PM
224 unsigned should_wakeup:1;
223 pm_message_t prev_state; 225 pm_message_t prev_state;
224 void * saved_state; 226 void * saved_state;
225 atomic_t pm_users;
226 struct device * pm_parent; 227 struct device * pm_parent;
227 struct list_head entry; 228 struct list_head entry;
228#endif 229#endif
@@ -236,13 +237,48 @@ extern void device_resume(void);
236 237
237#ifdef CONFIG_PM 238#ifdef CONFIG_PM
238extern int device_suspend(pm_message_t state); 239extern int device_suspend(pm_message_t state);
239#else 240
241#define device_set_wakeup_enable(dev,val) \
242 ((dev)->power.should_wakeup = !!(val))
243#define device_may_wakeup(dev) \
244 (device_can_wakeup(dev) && (dev)->power.should_wakeup)
245
246extern int dpm_runtime_suspend(struct device *, pm_message_t);
247extern void dpm_runtime_resume(struct device *);
248
249#else /* !CONFIG_PM */
250
240static inline int device_suspend(pm_message_t state) 251static inline int device_suspend(pm_message_t state)
241{ 252{
242 return 0; 253 return 0;
243} 254}
255
256#define device_set_wakeup_enable(dev,val) do{}while(0)
257#define device_may_wakeup(dev) (0)
258
259static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state)
260{
261 return 0;
262}
263
264static inline void dpm_runtime_resume(struct device * dev)
265{
266
267}
268
244#endif 269#endif
245 270
271/* changes to device_may_wakeup take effect on the next pm state change.
272 * by default, devices should wakeup if they can.
273 */
274#define device_can_wakeup(dev) \
275 ((dev)->power.can_wakeup)
276#define device_init_wakeup(dev,val) \
277 do { \
278 device_can_wakeup(dev) = !!(val); \
279 device_set_wakeup_enable(dev,val); \
280 } while(0)
281
246#endif /* __KERNEL__ */ 282#endif /* __KERNEL__ */
247 283
248#endif /* _LINUX_PM_H */ 284#endif /* _LINUX_PM_H */
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index 045d4761febc..9f0f9281f42a 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -24,7 +24,7 @@
24 24
25struct radix_tree_root { 25struct radix_tree_root {
26 unsigned int height; 26 unsigned int height;
27 unsigned int gfp_mask; 27 gfp_t gfp_mask;
28 struct radix_tree_node *rnode; 28 struct radix_tree_node *rnode;
29}; 29};
30 30
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index af00b10294cd..001ab82df051 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1972,7 +1972,7 @@ extern struct address_space_operations reiserfs_address_space_operations;
1972 1972
1973/* fix_nodes.c */ 1973/* fix_nodes.c */
1974#ifdef CONFIG_REISERFS_CHECK 1974#ifdef CONFIG_REISERFS_CHECK
1975void *reiserfs_kmalloc(size_t size, int flags, struct super_block *s); 1975void *reiserfs_kmalloc(size_t size, gfp_t flags, struct super_block *s);
1976void reiserfs_kfree(const void *vp, size_t size, struct super_block *s); 1976void reiserfs_kfree(const void *vp, size_t size, struct super_block *s);
1977#else 1977#else
1978static inline void *reiserfs_kmalloc(size_t size, int flags, 1978static inline void *reiserfs_kmalloc(size_t size, int flags,
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index e80fb7ee6efd..35b30e6c8cf8 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -95,8 +95,8 @@ int try_to_unmap(struct page *);
95/* 95/*
96 * Called from mm/filemap_xip.c to unmap empty zero page 96 * Called from mm/filemap_xip.c to unmap empty zero page
97 */ 97 */
98pte_t *page_check_address(struct page *, struct mm_struct *, unsigned long); 98pte_t *page_check_address(struct page *, struct mm_struct *,
99 99 unsigned long, spinlock_t **);
100 100
101/* 101/*
102 * Used by swapoff to help locate where page is expected in vma. 102 * Used by swapoff to help locate where page is expected in vma.
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h
index b52a2af25f1f..f30f805080ae 100644
--- a/include/linux/rwsem-spinlock.h
+++ b/include/linux/rwsem-spinlock.h
@@ -61,5 +61,10 @@ extern void FASTCALL(__up_read(struct rw_semaphore *sem));
61extern void FASTCALL(__up_write(struct rw_semaphore *sem)); 61extern void FASTCALL(__up_write(struct rw_semaphore *sem));
62extern void FASTCALL(__downgrade_write(struct rw_semaphore *sem)); 62extern void FASTCALL(__downgrade_write(struct rw_semaphore *sem));
63 63
64static inline int rwsem_is_locked(struct rw_semaphore *sem)
65{
66 return (sem->activity != 0);
67}
68
64#endif /* __KERNEL__ */ 69#endif /* __KERNEL__ */
65#endif /* _LINUX_RWSEM_SPINLOCK_H */ 70#endif /* _LINUX_RWSEM_SPINLOCK_H */
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 7f717e95ae37..66ff545552f7 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -1,14 +1,23 @@
1#ifndef _LINUX_SCATTERLIST_H 1#ifndef _LINUX_SCATTERLIST_H
2#define _LINUX_SCATTERLIST_H 2#define _LINUX_SCATTERLIST_H
3 3
4static inline void sg_init_one(struct scatterlist *sg, 4#include <asm/scatterlist.h>
5 u8 *buf, unsigned int buflen) 5#include <linux/mm.h>
6{ 6#include <linux/string.h>
7 memset(sg, 0, sizeof(*sg));
8 7
8static inline void sg_set_buf(struct scatterlist *sg, void *buf,
9 unsigned int buflen)
10{
9 sg->page = virt_to_page(buf); 11 sg->page = virt_to_page(buf);
10 sg->offset = offset_in_page(buf); 12 sg->offset = offset_in_page(buf);
11 sg->length = buflen; 13 sg->length = buflen;
12} 14}
13 15
16static inline void sg_init_one(struct scatterlist *sg, void *buf,
17 unsigned int buflen)
18{
19 memset(sg, 0, sizeof(*sg));
20 sg_set_buf(sg, buf, buflen);
21}
22
14#endif /* _LINUX_SCATTERLIST_H */ 23#endif /* _LINUX_SCATTERLIST_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 27519df0f987..1c30bc308ef1 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -249,6 +249,36 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
249extern void arch_unmap_area(struct mm_struct *, unsigned long); 249extern void arch_unmap_area(struct mm_struct *, unsigned long);
250extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); 250extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
251 251
252#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
253/*
254 * The mm counters are not protected by its page_table_lock,
255 * so must be incremented atomically.
256 */
257#ifdef ATOMIC64_INIT
258#define set_mm_counter(mm, member, value) atomic64_set(&(mm)->_##member, value)
259#define get_mm_counter(mm, member) ((unsigned long)atomic64_read(&(mm)->_##member))
260#define add_mm_counter(mm, member, value) atomic64_add(value, &(mm)->_##member)
261#define inc_mm_counter(mm, member) atomic64_inc(&(mm)->_##member)
262#define dec_mm_counter(mm, member) atomic64_dec(&(mm)->_##member)
263typedef atomic64_t mm_counter_t;
264#else /* !ATOMIC64_INIT */
265/*
266 * The counters wrap back to 0 at 2^32 * PAGE_SIZE,
267 * that is, at 16TB if using 4kB page size.
268 */
269#define set_mm_counter(mm, member, value) atomic_set(&(mm)->_##member, value)
270#define get_mm_counter(mm, member) ((unsigned long)atomic_read(&(mm)->_##member))
271#define add_mm_counter(mm, member, value) atomic_add(value, &(mm)->_##member)
272#define inc_mm_counter(mm, member) atomic_inc(&(mm)->_##member)
273#define dec_mm_counter(mm, member) atomic_dec(&(mm)->_##member)
274typedef atomic_t mm_counter_t;
275#endif /* !ATOMIC64_INIT */
276
277#else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
278/*
279 * The mm counters are protected by its page_table_lock,
280 * so can be incremented directly.
281 */
252#define set_mm_counter(mm, member, value) (mm)->_##member = (value) 282#define set_mm_counter(mm, member, value) (mm)->_##member = (value)
253#define get_mm_counter(mm, member) ((mm)->_##member) 283#define get_mm_counter(mm, member) ((mm)->_##member)
254#define add_mm_counter(mm, member, value) (mm)->_##member += (value) 284#define add_mm_counter(mm, member, value) (mm)->_##member += (value)
@@ -256,6 +286,20 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
256#define dec_mm_counter(mm, member) (mm)->_##member-- 286#define dec_mm_counter(mm, member) (mm)->_##member--
257typedef unsigned long mm_counter_t; 287typedef unsigned long mm_counter_t;
258 288
289#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
290
291#define get_mm_rss(mm) \
292 (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss))
293#define update_hiwater_rss(mm) do { \
294 unsigned long _rss = get_mm_rss(mm); \
295 if ((mm)->hiwater_rss < _rss) \
296 (mm)->hiwater_rss = _rss; \
297} while (0)
298#define update_hiwater_vm(mm) do { \
299 if ((mm)->hiwater_vm < (mm)->total_vm) \
300 (mm)->hiwater_vm = (mm)->total_vm; \
301} while (0)
302
259struct mm_struct { 303struct mm_struct {
260 struct vm_area_struct * mmap; /* list of VMAs */ 304 struct vm_area_struct * mmap; /* list of VMAs */
261 struct rb_root mm_rb; 305 struct rb_root mm_rb;
@@ -279,15 +323,20 @@ struct mm_struct {
279 * by mmlist_lock 323 * by mmlist_lock
280 */ 324 */
281 325
326 /* Special counters, in some configurations protected by the
327 * page_table_lock, in other configurations by being atomic.
328 */
329 mm_counter_t _file_rss;
330 mm_counter_t _anon_rss;
331
332 unsigned long hiwater_rss; /* High-watermark of RSS usage */
333 unsigned long hiwater_vm; /* High-water virtual memory usage */
334
335 unsigned long total_vm, locked_vm, shared_vm, exec_vm;
336 unsigned long stack_vm, reserved_vm, def_flags, nr_ptes;
282 unsigned long start_code, end_code, start_data, end_data; 337 unsigned long start_code, end_code, start_data, end_data;
283 unsigned long start_brk, brk, start_stack; 338 unsigned long start_brk, brk, start_stack;
284 unsigned long arg_start, arg_end, env_start, env_end; 339 unsigned long arg_start, arg_end, env_start, env_end;
285 unsigned long total_vm, locked_vm, shared_vm;
286 unsigned long exec_vm, stack_vm, reserved_vm, def_flags, nr_ptes;
287
288 /* Special counters protected by the page_table_lock */
289 mm_counter_t _rss;
290 mm_counter_t _anon_rss;
291 340
292 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ 341 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
293 342
@@ -308,11 +357,7 @@ struct mm_struct {
308 /* aio bits */ 357 /* aio bits */
309 rwlock_t ioctx_list_lock; 358 rwlock_t ioctx_list_lock;
310 struct kioctx *ioctx_list; 359 struct kioctx *ioctx_list;
311
312 struct kioctx default_kioctx; 360 struct kioctx default_kioctx;
313
314 unsigned long hiwater_rss; /* High-water RSS usage */
315 unsigned long hiwater_vm; /* High-water virtual memory usage */
316}; 361};
317 362
318struct sighand_struct { 363struct sighand_struct {
diff --git a/include/linux/sdladrv.h b/include/linux/sdladrv.h
index 78f634007fc6..c85e103d5e7b 100644
--- a/include/linux/sdladrv.h
+++ b/include/linux/sdladrv.h
@@ -52,12 +52,8 @@ typedef struct sdlahw
52 52
53extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len); 53extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len);
54extern int sdla_down (sdlahw_t* hw); 54extern int sdla_down (sdlahw_t* hw);
55extern int sdla_inten (sdlahw_t* hw);
56extern int sdla_intde (sdlahw_t* hw);
57extern int sdla_intack (sdlahw_t* hw);
58extern void S514_intack (sdlahw_t* hw, u32 int_status); 55extern void S514_intack (sdlahw_t* hw, u32 int_status);
59extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status); 56extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status);
60extern int sdla_intr (sdlahw_t* hw);
61extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); 57extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr);
62extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, 58extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf,
63 unsigned len); 59 unsigned len);
diff --git a/include/linux/security.h b/include/linux/security.h
index 627382e74057..dac956ed98f0 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1210,7 +1210,7 @@ struct security_operations {
1210 int (*socket_shutdown) (struct socket * sock, int how); 1210 int (*socket_shutdown) (struct socket * sock, int how);
1211 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); 1211 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb);
1212 int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); 1212 int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len);
1213 int (*sk_alloc_security) (struct sock *sk, int family, int priority); 1213 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority);
1214 void (*sk_free_security) (struct sock *sk); 1214 void (*sk_free_security) (struct sock *sk);
1215#endif /* CONFIG_SECURITY_NETWORK */ 1215#endif /* CONFIG_SECURITY_NETWORK */
1216}; 1216};
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 27db8da43aa4..2b0401b93f2b 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -39,7 +39,8 @@
39#define PORT_RSA 13 39#define PORT_RSA 13
40#define PORT_NS16550A 14 40#define PORT_NS16550A 14
41#define PORT_XSCALE 15 41#define PORT_XSCALE 15
42#define PORT_MAX_8250 15 /* max port ID */ 42#define PORT_IP3106 16
43#define PORT_MAX_8250 16 /* max port ID */
43 44
44/* 45/*
45 * ARM specific type numbers. These are not currently guaranteed 46 * ARM specific type numbers. These are not currently guaranteed
diff --git a/include/linux/serial_ip3106.h b/include/linux/serial_ip3106.h
new file mode 100644
index 000000000000..f500ac602c5c
--- /dev/null
+++ b/include/linux/serial_ip3106.h
@@ -0,0 +1,81 @@
1/*
2 * Embedded Alley Solutions, source@embeddedalley.com.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef _LINUX_SERIAL_IP3106_H
20#define _LINUX_SERIAL_IP3106_H
21
22#include <linux/serial_core.h>
23#include <linux/device.h>
24
25#define IP3106_NR_PORTS 2
26
27struct ip3106_port {
28 struct uart_port port;
29 struct timer_list timer;
30 unsigned int old_status;
31};
32
33/* register offsets */
34#define IP3106_LCR 0
35#define IP3106_MCR 0x004
36#define IP3106_BAUD 0x008
37#define IP3106_CFG 0x00c
38#define IP3106_FIFO 0x028
39#define IP3106_ISTAT 0xfe0
40#define IP3106_IEN 0xfe4
41#define IP3106_ICLR 0xfe8
42#define IP3106_ISET 0xfec
43#define IP3106_PD 0xff4
44#define IP3106_MID 0xffc
45
46#define IP3106_UART_LCR_TXBREAK (1<<30)
47#define IP3106_UART_LCR_PAREVN 0x10000000
48#define IP3106_UART_LCR_PAREN 0x08000000
49#define IP3106_UART_LCR_2STOPB 0x04000000
50#define IP3106_UART_LCR_8BIT 0x01000000
51#define IP3106_UART_LCR_TX_RST 0x00040000
52#define IP3106_UART_LCR_RX_RST 0x00020000
53#define IP3106_UART_LCR_RX_NEXT 0x00010000
54
55#define IP3106_UART_MCR_SCR 0xFF000000
56#define IP3106_UART_MCR_DCD 0x00800000
57#define IP3106_UART_MCR_CTS 0x00100000
58#define IP3106_UART_MCR_LOOP 0x00000010
59#define IP3106_UART_MCR_RTS 0x00000002
60#define IP3106_UART_MCR_DTR 0x00000001
61
62#define IP3106_UART_INT_TX 0x00000080
63#define IP3106_UART_INT_EMPTY 0x00000040
64#define IP3106_UART_INT_RCVTO 0x00000020
65#define IP3106_UART_INT_RX 0x00000010
66#define IP3106_UART_INT_RXOVRN 0x00000008
67#define IP3106_UART_INT_FRERR 0x00000004
68#define IP3106_UART_INT_BREAK 0x00000002
69#define IP3106_UART_INT_PARITY 0x00000001
70#define IP3106_UART_INT_ALLRX 0x0000003F
71#define IP3106_UART_INT_ALLTX 0x000000C0
72
73#define IP3106_UART_FIFO_TXFIFO 0x001F0000
74#define IP3106_UART_FIFO_TXFIFO_STA (0x1f<<16)
75#define IP3106_UART_FIFO_RXBRK 0x00008000
76#define IP3106_UART_FIFO_RXFE 0x00004000
77#define IP3106_UART_FIFO_RXPAR 0x00002000
78#define IP3106_UART_FIFO_RXFIFO 0x00001F00
79#define IP3106_UART_FIFO_RBRTHR 0x000000FF
80
81#endif
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 8f5d9e7f8734..4286d832166f 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -137,6 +137,8 @@ struct skb_shared_info {
137 unsigned int nr_frags; 137 unsigned int nr_frags;
138 unsigned short tso_size; 138 unsigned short tso_size;
139 unsigned short tso_segs; 139 unsigned short tso_segs;
140 unsigned short ufo_size;
141 unsigned int ip6_frag_id;
140 struct sk_buff *frag_list; 142 struct sk_buff *frag_list;
141 skb_frag_t frags[MAX_SKB_FRAGS]; 143 skb_frag_t frags[MAX_SKB_FRAGS];
142}; 144};
@@ -171,7 +173,6 @@ enum {
171 * struct sk_buff - socket buffer 173 * struct sk_buff - socket buffer
172 * @next: Next buffer in list 174 * @next: Next buffer in list
173 * @prev: Previous buffer in list 175 * @prev: Previous buffer in list
174 * @list: List we are on
175 * @sk: Socket we are owned by 176 * @sk: Socket we are owned by
176 * @tstamp: Time we arrived 177 * @tstamp: Time we arrived
177 * @dev: Device we arrived on/are leaving by 178 * @dev: Device we arrived on/are leaving by
@@ -190,6 +191,7 @@ enum {
190 * @cloned: Head may be cloned (check refcnt to be sure) 191 * @cloned: Head may be cloned (check refcnt to be sure)
191 * @nohdr: Payload reference only, must not modify header 192 * @nohdr: Payload reference only, must not modify header
192 * @pkt_type: Packet class 193 * @pkt_type: Packet class
194 * @fclone: skbuff clone status
193 * @ip_summed: Driver fed us an IP checksum 195 * @ip_summed: Driver fed us an IP checksum
194 * @priority: Packet queueing priority 196 * @priority: Packet queueing priority
195 * @users: User count - see {datagram,tcp}.c 197 * @users: User count - see {datagram,tcp}.c
@@ -202,6 +204,7 @@ enum {
202 * @destructor: Destruct function 204 * @destructor: Destruct function
203 * @nfmark: Can be used for communication between hooks 205 * @nfmark: Can be used for communication between hooks
204 * @nfct: Associated connection, if any 206 * @nfct: Associated connection, if any
207 * @ipvs_property: skbuff is owned by ipvs
205 * @nfctinfo: Relationship of this skb to the connection 208 * @nfctinfo: Relationship of this skb to the connection
206 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 209 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
207 * @tc_index: Traffic control index 210 * @tc_index: Traffic control index
@@ -340,6 +343,11 @@ extern void skb_over_panic(struct sk_buff *skb, int len,
340extern void skb_under_panic(struct sk_buff *skb, int len, 343extern void skb_under_panic(struct sk_buff *skb, int len,
341 void *here); 344 void *here);
342 345
346extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
347 int getfrag(void *from, char *to, int offset,
348 int len,int odd, struct sk_buff *skb),
349 void *from, int length);
350
343struct skb_seq_state 351struct skb_seq_state
344{ 352{
345 __u32 lower_offset; 353 __u32 lower_offset;
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 5fc04a16ecb0..09b9aa60063d 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -121,7 +121,7 @@ extern unsigned int ksize(const void *);
121extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); 121extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node);
122extern void *kmalloc_node(size_t size, gfp_t flags, int node); 122extern void *kmalloc_node(size_t size, gfp_t flags, int node);
123#else 123#else
124static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node) 124static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, gfp_t flags, int node)
125{ 125{
126 return kmem_cache_alloc(cachep, flags); 126 return kmem_cache_alloc(cachep, flags);
127} 127}
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 04ebc24db348..b68c11a2d6dd 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -66,7 +66,12 @@ struct rpc_cred_cache {
66 66
67struct rpc_auth { 67struct rpc_auth {
68 unsigned int au_cslack; /* call cred size estimate */ 68 unsigned int au_cslack; /* call cred size estimate */
69 unsigned int au_rslack; /* reply verf size guess */ 69 /* guess at number of u32's auth adds before
70 * reply data; normally the verifier size: */
71 unsigned int au_rslack;
72 /* for gss, used to calculate au_rslack: */
73 unsigned int au_verfsize;
74
70 unsigned int au_flags; /* various flags */ 75 unsigned int au_flags; /* various flags */
71 struct rpc_authops * au_ops; /* operations */ 76 struct rpc_authops * au_ops; /* operations */
72 rpc_authflavor_t au_flavor; /* pseudoflavor (note may 77 rpc_authflavor_t au_flavor; /* pseudoflavor (note may
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index eadb31e3c198..1a42d902bc11 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -32,6 +32,7 @@
32#define RPCDBG_AUTH 0x0010 32#define RPCDBG_AUTH 0x0010
33#define RPCDBG_PMAP 0x0020 33#define RPCDBG_PMAP 0x0020
34#define RPCDBG_SCHED 0x0040 34#define RPCDBG_SCHED 0x0040
35#define RPCDBG_TRANS 0x0080
35#define RPCDBG_SVCSOCK 0x0100 36#define RPCDBG_SVCSOCK 0x0100
36#define RPCDBG_SVCDSP 0x0200 37#define RPCDBG_SVCDSP 0x0200
37#define RPCDBG_MISC 0x0400 38#define RPCDBG_MISC 0x0400
@@ -94,6 +95,8 @@ enum {
94 CTL_NLMDEBUG, 95 CTL_NLMDEBUG,
95 CTL_SLOTTABLE_UDP, 96 CTL_SLOTTABLE_UDP,
96 CTL_SLOTTABLE_TCP, 97 CTL_SLOTTABLE_TCP,
98 CTL_MIN_RESVPORT,
99 CTL_MAX_RESVPORT,
97}; 100};
98 101
99#endif /* _LINUX_SUNRPC_DEBUG_H_ */ 102#endif /* _LINUX_SUNRPC_DEBUG_H_ */
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 689262f63059..9b8bcf125c18 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -40,14 +40,21 @@ int gss_import_sec_context(
40 struct gss_ctx **ctx_id); 40 struct gss_ctx **ctx_id);
41u32 gss_get_mic( 41u32 gss_get_mic(
42 struct gss_ctx *ctx_id, 42 struct gss_ctx *ctx_id,
43 u32 qop,
44 struct xdr_buf *message, 43 struct xdr_buf *message,
45 struct xdr_netobj *mic_token); 44 struct xdr_netobj *mic_token);
46u32 gss_verify_mic( 45u32 gss_verify_mic(
47 struct gss_ctx *ctx_id, 46 struct gss_ctx *ctx_id,
48 struct xdr_buf *message, 47 struct xdr_buf *message,
49 struct xdr_netobj *mic_token, 48 struct xdr_netobj *mic_token);
50 u32 *qstate); 49u32 gss_wrap(
50 struct gss_ctx *ctx_id,
51 int offset,
52 struct xdr_buf *outbuf,
53 struct page **inpages);
54u32 gss_unwrap(
55 struct gss_ctx *ctx_id,
56 int offset,
57 struct xdr_buf *inbuf);
51u32 gss_delete_sec_context( 58u32 gss_delete_sec_context(
52 struct gss_ctx **ctx_id); 59 struct gss_ctx **ctx_id);
53 60
@@ -56,7 +63,6 @@ char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service);
56 63
57struct pf_desc { 64struct pf_desc {
58 u32 pseudoflavor; 65 u32 pseudoflavor;
59 u32 qop;
60 u32 service; 66 u32 service;
61 char *name; 67 char *name;
62 char *auth_domain_name; 68 char *auth_domain_name;
@@ -85,14 +91,21 @@ struct gss_api_ops {
85 struct gss_ctx *ctx_id); 91 struct gss_ctx *ctx_id);
86 u32 (*gss_get_mic)( 92 u32 (*gss_get_mic)(
87 struct gss_ctx *ctx_id, 93 struct gss_ctx *ctx_id,
88 u32 qop,
89 struct xdr_buf *message, 94 struct xdr_buf *message,
90 struct xdr_netobj *mic_token); 95 struct xdr_netobj *mic_token);
91 u32 (*gss_verify_mic)( 96 u32 (*gss_verify_mic)(
92 struct gss_ctx *ctx_id, 97 struct gss_ctx *ctx_id,
93 struct xdr_buf *message, 98 struct xdr_buf *message,
94 struct xdr_netobj *mic_token, 99 struct xdr_netobj *mic_token);
95 u32 *qstate); 100 u32 (*gss_wrap)(
101 struct gss_ctx *ctx_id,
102 int offset,
103 struct xdr_buf *outbuf,
104 struct page **inpages);
105 u32 (*gss_unwrap)(
106 struct gss_ctx *ctx_id,
107 int offset,
108 struct xdr_buf *buf);
96 void (*gss_delete_sec_context)( 109 void (*gss_delete_sec_context)(
97 void *internal_ctx_id); 110 void *internal_ctx_id);
98}; 111};
diff --git a/include/linux/sunrpc/gss_err.h b/include/linux/sunrpc/gss_err.h
index 92608a2e574c..a6807867bd21 100644
--- a/include/linux/sunrpc/gss_err.h
+++ b/include/linux/sunrpc/gss_err.h
@@ -66,16 +66,6 @@ typedef unsigned int OM_uint32;
66 66
67 67
68/* 68/*
69 * Define the default Quality of Protection for per-message services. Note
70 * that an implementation that offers multiple levels of QOP may either reserve
71 * a value (for example zero, as assumed here) to mean "default protection", or
72 * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit
73 * QOP value. However a value of 0 should always be interpreted by a GSSAPI
74 * implementation as a request for the default protection level.
75 */
76#define GSS_C_QOP_DEFAULT 0
77
78/*
79 * Expiration time of 2^32-1 seconds means infinite lifetime for a 69 * Expiration time of 2^32-1 seconds means infinite lifetime for a
80 * credential or security context 70 * credential or security context
81 */ 71 */
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h
index ffe31d2eb9ec..2c3601d31045 100644
--- a/include/linux/sunrpc/gss_krb5.h
+++ b/include/linux/sunrpc/gss_krb5.h
@@ -116,18 +116,22 @@ enum seal_alg {
116 116
117s32 117s32
118make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, 118make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body,
119 struct xdr_netobj *cksum); 119 int body_offset, struct xdr_netobj *cksum);
120
121u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *,
122 struct xdr_netobj *);
123
124u32 gss_verify_mic_kerberos(struct gss_ctx *, struct xdr_buf *,
125 struct xdr_netobj *);
120 126
121u32 127u32
122krb5_make_token(struct krb5_ctx *context_handle, int qop_req, 128gss_wrap_kerberos(struct gss_ctx *ctx_id, int offset,
123 struct xdr_buf *input_message_buffer, 129 struct xdr_buf *outbuf, struct page **pages);
124 struct xdr_netobj *output_message_buffer, int toktype);
125 130
126u32 131u32
127krb5_read_token(struct krb5_ctx *context_handle, 132gss_unwrap_kerberos(struct gss_ctx *ctx_id, int offset,
128 struct xdr_netobj *input_token_buffer, 133 struct xdr_buf *buf);
129 struct xdr_buf *message_buffer, 134
130 int *qop_state, int toktype);
131 135
132u32 136u32
133krb5_encrypt(struct crypto_tfm * key, 137krb5_encrypt(struct crypto_tfm * key,
@@ -137,6 +141,13 @@ u32
137krb5_decrypt(struct crypto_tfm * key, 141krb5_decrypt(struct crypto_tfm * key,
138 void *iv, void *in, void *out, int length); 142 void *iv, void *in, void *out, int length);
139 143
144int
145gss_encrypt_xdr_buf(struct crypto_tfm *tfm, struct xdr_buf *outbuf, int offset,
146 struct page **pages);
147
148int
149gss_decrypt_xdr_buf(struct crypto_tfm *tfm, struct xdr_buf *inbuf, int offset);
150
140s32 151s32
141krb5_make_seq_num(struct crypto_tfm * key, 152krb5_make_seq_num(struct crypto_tfm * key,
142 int direction, 153 int direction,
diff --git a/include/linux/sunrpc/gss_spkm3.h b/include/linux/sunrpc/gss_spkm3.h
index b5c9968c3c17..0beb2cf00a84 100644
--- a/include/linux/sunrpc/gss_spkm3.h
+++ b/include/linux/sunrpc/gss_spkm3.h
@@ -41,9 +41,9 @@ struct spkm3_ctx {
41#define SPKM_WRAP_TOK 5 41#define SPKM_WRAP_TOK 5
42#define SPKM_DEL_TOK 6 42#define SPKM_DEL_TOK 6
43 43
44u32 spkm3_make_token(struct spkm3_ctx *ctx, int qop_req, struct xdr_buf * text, struct xdr_netobj * token, int toktype); 44u32 spkm3_make_token(struct spkm3_ctx *ctx, struct xdr_buf * text, struct xdr_netobj * token, int toktype);
45 45
46u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int *qop_state, int toktype); 46u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int toktype);
47 47
48#define CKSUMTYPE_RSA_MD5 0x0007 48#define CKSUMTYPE_RSA_MD5 0x0007
49 49
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h
index 15f115332389..f43f237360ae 100644
--- a/include/linux/sunrpc/msg_prot.h
+++ b/include/linux/sunrpc/msg_prot.h
@@ -76,5 +76,30 @@ enum rpc_auth_stat {
76 76
77#define RPC_MAXNETNAMELEN 256 77#define RPC_MAXNETNAMELEN 256
78 78
79/*
80 * From RFC 1831:
81 *
82 * "A record is composed of one or more record fragments. A record
83 * fragment is a four-byte header followed by 0 to (2**31) - 1 bytes of
84 * fragment data. The bytes encode an unsigned binary number; as with
85 * XDR integers, the byte order is from highest to lowest. The number
86 * encodes two values -- a boolean which indicates whether the fragment
87 * is the last fragment of the record (bit value 1 implies the fragment
88 * is the last fragment) and a 31-bit unsigned binary value which is the
89 * length in bytes of the fragment's data. The boolean value is the
90 * highest-order bit of the header; the length is the 31 low-order bits.
91 * (Note that this record specification is NOT in XDR standard form!)"
92 *
93 * The Linux RPC client always sends its requests in a single record
94 * fragment, limiting the maximum payload size for stream transports to
95 * 2GB.
96 */
97
98typedef u32 rpc_fraghdr;
99
100#define RPC_LAST_STREAM_FRAGMENT (1U << 31)
101#define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT)
102#define RPC_MAX_FRAGMENT_SIZE ((1U << 31) - 1)
103
79#endif /* __KERNEL__ */ 104#endif /* __KERNEL__ */
80#endif /* _LINUX_SUNRPC_MSGPROT_H_ */ 105#endif /* _LINUX_SUNRPC_MSGPROT_H_ */
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 23448d0fb5bc..5da968729cf8 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -161,14 +161,10 @@ typedef struct {
161 161
162typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); 162typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len);
163 163
164extern int csum_partial_copy_to_xdr(struct xdr_buf *, struct sk_buff *);
164extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, 165extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int,
165 skb_reader_t *, skb_read_actor_t); 166 skb_reader_t *, skb_read_actor_t);
166 167
167struct socket;
168struct sockaddr;
169extern int xdr_sendpages(struct socket *, struct sockaddr *, int,
170 struct xdr_buf *, unsigned int, int);
171
172extern int xdr_encode_word(struct xdr_buf *, int, u32); 168extern int xdr_encode_word(struct xdr_buf *, int, u32);
173extern int xdr_decode_word(struct xdr_buf *, int, u32 *); 169extern int xdr_decode_word(struct xdr_buf *, int, u32 *);
174 170
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index e618c1649814..3b8b6e823c70 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/linux/sunrpc/clnt_xprt.h 2 * linux/include/linux/sunrpc/xprt.h
3 * 3 *
4 * Declarations for the RPC transport interface. 4 * Declarations for the RPC transport interface.
5 * 5 *
@@ -15,20 +15,6 @@
15#include <linux/sunrpc/sched.h> 15#include <linux/sunrpc/sched.h>
16#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
17 17
18/*
19 * The transport code maintains an estimate on the maximum number of out-
20 * standing RPC requests, using a smoothed version of the congestion
21 * avoidance implemented in 44BSD. This is basically the Van Jacobson
22 * congestion algorithm: If a retransmit occurs, the congestion window is
23 * halved; otherwise, it is incremented by 1/cwnd when
24 *
25 * - a reply is received and
26 * - a full number of requests are outstanding and
27 * - the congestion window hasn't been updated recently.
28 *
29 * Upper procedures may check whether a request would block waiting for
30 * a free RPC slot by using the RPC_CONGESTED() macro.
31 */
32extern unsigned int xprt_udp_slot_table_entries; 18extern unsigned int xprt_udp_slot_table_entries;
33extern unsigned int xprt_tcp_slot_table_entries; 19extern unsigned int xprt_tcp_slot_table_entries;
34 20
@@ -36,34 +22,23 @@ extern unsigned int xprt_tcp_slot_table_entries;
36#define RPC_DEF_SLOT_TABLE (16U) 22#define RPC_DEF_SLOT_TABLE (16U)
37#define RPC_MAX_SLOT_TABLE (128U) 23#define RPC_MAX_SLOT_TABLE (128U)
38 24
39#define RPC_CWNDSHIFT (8U)
40#define RPC_CWNDSCALE (1U << RPC_CWNDSHIFT)
41#define RPC_INITCWND RPC_CWNDSCALE
42#define RPC_MAXCWND(xprt) ((xprt)->max_reqs << RPC_CWNDSHIFT)
43#define RPCXPRT_CONGESTED(xprt) ((xprt)->cong >= (xprt)->cwnd)
44
45/* Default timeout values */
46#define RPC_MAX_UDP_TIMEOUT (60*HZ)
47#define RPC_MAX_TCP_TIMEOUT (600*HZ)
48
49/* 25/*
50 * Wait duration for an RPC TCP connection to be established. Solaris 26 * RPC call and reply header size as number of 32bit words (verifier
51 * NFS over TCP uses 60 seconds, for example, which is in line with how 27 * size computed separately)
52 * long a server takes to reboot.
53 */ 28 */
54#define RPC_CONNECT_TIMEOUT (60*HZ) 29#define RPC_CALLHDRSIZE 6
30#define RPC_REPHDRSIZE 4
55 31
56/* 32/*
57 * Delay an arbitrary number of seconds before attempting to reconnect 33 * Parameters for choosing a free port
58 * after an error.
59 */ 34 */
60#define RPC_REESTABLISH_TIMEOUT (15*HZ) 35extern unsigned int xprt_min_resvport;
36extern unsigned int xprt_max_resvport;
61 37
62/* RPC call and reply header size as number of 32bit words (verifier 38#define RPC_MIN_RESVPORT (1U)
63 * size computed separately) 39#define RPC_MAX_RESVPORT (65535U)
64 */ 40#define RPC_DEF_MIN_RESVPORT (650U)
65#define RPC_CALLHDRSIZE 6 41#define RPC_DEF_MAX_RESVPORT (1023U)
66#define RPC_REPHDRSIZE 4
67 42
68/* 43/*
69 * This describes a timeout strategy 44 * This describes a timeout strategy
@@ -76,6 +51,9 @@ struct rpc_timeout {
76 unsigned char to_exponential; 51 unsigned char to_exponential;
77}; 52};
78 53
54struct rpc_task;
55struct rpc_xprt;
56
79/* 57/*
80 * This describes a complete RPC request 58 * This describes a complete RPC request
81 */ 59 */
@@ -95,7 +73,10 @@ struct rpc_rqst {
95 int rq_cong; /* has incremented xprt->cong */ 73 int rq_cong; /* has incremented xprt->cong */
96 int rq_received; /* receive completed */ 74 int rq_received; /* receive completed */
97 u32 rq_seqno; /* gss seq no. used on req. */ 75 u32 rq_seqno; /* gss seq no. used on req. */
98 76 int rq_enc_pages_num;
77 struct page **rq_enc_pages; /* scratch pages for use by
78 gss privacy code */
79 void (*rq_release_snd_buf)(struct rpc_rqst *); /* release rq_enc_pages */
99 struct list_head rq_list; 80 struct list_head rq_list;
100 81
101 struct xdr_buf rq_private_buf; /* The receive buffer 82 struct xdr_buf rq_private_buf; /* The receive buffer
@@ -121,12 +102,21 @@ struct rpc_rqst {
121#define rq_svec rq_snd_buf.head 102#define rq_svec rq_snd_buf.head
122#define rq_slen rq_snd_buf.len 103#define rq_slen rq_snd_buf.len
123 104
124#define XPRT_LAST_FRAG (1 << 0) 105struct rpc_xprt_ops {
125#define XPRT_COPY_RECM (1 << 1) 106 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize);
126#define XPRT_COPY_XID (1 << 2) 107 int (*reserve_xprt)(struct rpc_task *task);
127#define XPRT_COPY_DATA (1 << 3) 108 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
109 void (*connect)(struct rpc_task *task);
110 int (*send_request)(struct rpc_task *task);
111 void (*set_retrans_timeout)(struct rpc_task *task);
112 void (*timer)(struct rpc_task *task);
113 void (*release_request)(struct rpc_task *task);
114 void (*close)(struct rpc_xprt *xprt);
115 void (*destroy)(struct rpc_xprt *xprt);
116};
128 117
129struct rpc_xprt { 118struct rpc_xprt {
119 struct rpc_xprt_ops * ops; /* transport methods */
130 struct socket * sock; /* BSD socket layer */ 120 struct socket * sock; /* BSD socket layer */
131 struct sock * inet; /* INET layer */ 121 struct sock * inet; /* INET layer */
132 122
@@ -137,11 +127,13 @@ struct rpc_xprt {
137 unsigned long cong; /* current congestion */ 127 unsigned long cong; /* current congestion */
138 unsigned long cwnd; /* congestion window */ 128 unsigned long cwnd; /* congestion window */
139 129
140 unsigned int rcvsize, /* socket receive buffer size */ 130 size_t rcvsize, /* transport rcv buffer size */
141 sndsize; /* socket send buffer size */ 131 sndsize; /* transport send buffer size */
142 132
143 size_t max_payload; /* largest RPC payload size, 133 size_t max_payload; /* largest RPC payload size,
144 in bytes */ 134 in bytes */
135 unsigned int tsh_size; /* size of transport specific
136 header */
145 137
146 struct rpc_wait_queue sending; /* requests waiting to send */ 138 struct rpc_wait_queue sending; /* requests waiting to send */
147 struct rpc_wait_queue resend; /* requests waiting to resend */ 139 struct rpc_wait_queue resend; /* requests waiting to resend */
@@ -150,11 +142,9 @@ struct rpc_xprt {
150 struct list_head free; /* free slots */ 142 struct list_head free; /* free slots */
151 struct rpc_rqst * slot; /* slot table storage */ 143 struct rpc_rqst * slot; /* slot table storage */
152 unsigned int max_reqs; /* total slots */ 144 unsigned int max_reqs; /* total slots */
153 unsigned long sockstate; /* Socket state */ 145 unsigned long state; /* transport state */
154 unsigned char shutdown : 1, /* being shut down */ 146 unsigned char shutdown : 1, /* being shut down */
155 nocong : 1, /* no congestion control */ 147 resvport : 1; /* use a reserved port */
156 resvport : 1, /* use a reserved port */
157 stream : 1; /* TCP */
158 148
159 /* 149 /*
160 * XID 150 * XID
@@ -171,22 +161,27 @@ struct rpc_xprt {
171 unsigned long tcp_copied, /* copied to request */ 161 unsigned long tcp_copied, /* copied to request */
172 tcp_flags; 162 tcp_flags;
173 /* 163 /*
174 * Connection of sockets 164 * Connection of transports
175 */ 165 */
176 struct work_struct sock_connect; 166 unsigned long connect_timeout,
167 bind_timeout,
168 reestablish_timeout;
169 struct work_struct connect_worker;
177 unsigned short port; 170 unsigned short port;
171
178 /* 172 /*
179 * Disconnection of idle sockets 173 * Disconnection of idle transports
180 */ 174 */
181 struct work_struct task_cleanup; 175 struct work_struct task_cleanup;
182 struct timer_list timer; 176 struct timer_list timer;
183 unsigned long last_used; 177 unsigned long last_used,
178 idle_timeout;
184 179
185 /* 180 /*
186 * Send stuff 181 * Send stuff
187 */ 182 */
188 spinlock_t sock_lock; /* lock socket info */ 183 spinlock_t transport_lock; /* lock transport info */
189 spinlock_t xprt_lock; /* lock xprt info */ 184 spinlock_t reserve_lock; /* lock slot table */
190 struct rpc_task * snd_task; /* Task blocked in send */ 185 struct rpc_task * snd_task; /* Task blocked in send */
191 186
192 struct list_head recv; 187 struct list_head recv;
@@ -195,37 +190,111 @@ struct rpc_xprt {
195 void (*old_data_ready)(struct sock *, int); 190 void (*old_data_ready)(struct sock *, int);
196 void (*old_state_change)(struct sock *); 191 void (*old_state_change)(struct sock *);
197 void (*old_write_space)(struct sock *); 192 void (*old_write_space)(struct sock *);
198
199 wait_queue_head_t cong_wait;
200}; 193};
201 194
195#define XPRT_LAST_FRAG (1 << 0)
196#define XPRT_COPY_RECM (1 << 1)
197#define XPRT_COPY_XID (1 << 2)
198#define XPRT_COPY_DATA (1 << 3)
199
202#ifdef __KERNEL__ 200#ifdef __KERNEL__
203 201
204struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, 202/*
205 struct rpc_timeout *toparms); 203 * Transport operations used by ULPs
206int xprt_destroy(struct rpc_xprt *); 204 */
207void xprt_set_timeout(struct rpc_timeout *, unsigned int, 205struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, struct rpc_timeout *to);
208 unsigned long); 206void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long incr);
209 207
210void xprt_reserve(struct rpc_task *); 208/*
211int xprt_prepare_transmit(struct rpc_task *); 209 * Generic internal transport functions
212void xprt_transmit(struct rpc_task *); 210 */
213void xprt_receive(struct rpc_task *); 211void xprt_connect(struct rpc_task *task);
212void xprt_reserve(struct rpc_task *task);
213int xprt_reserve_xprt(struct rpc_task *task);
214int xprt_reserve_xprt_cong(struct rpc_task *task);
215int xprt_prepare_transmit(struct rpc_task *task);
216void xprt_transmit(struct rpc_task *task);
217void xprt_abort_transmit(struct rpc_task *task);
214int xprt_adjust_timeout(struct rpc_rqst *req); 218int xprt_adjust_timeout(struct rpc_rqst *req);
215void xprt_release(struct rpc_task *); 219void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
216void xprt_connect(struct rpc_task *); 220void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
217void xprt_sock_setbufsize(struct rpc_xprt *); 221void xprt_release(struct rpc_task *task);
218 222int xprt_destroy(struct rpc_xprt *xprt);
219#define XPRT_LOCKED 0 223
220#define XPRT_CONNECT 1 224static inline u32 *xprt_skip_transport_header(struct rpc_xprt *xprt, u32 *p)
221#define XPRT_CONNECTING 2 225{
222 226 return p + xprt->tsh_size;
223#define xprt_connected(xp) (test_bit(XPRT_CONNECT, &(xp)->sockstate)) 227}
224#define xprt_set_connected(xp) (set_bit(XPRT_CONNECT, &(xp)->sockstate)) 228
225#define xprt_test_and_set_connected(xp) (test_and_set_bit(XPRT_CONNECT, &(xp)->sockstate)) 229/*
226#define xprt_test_and_clear_connected(xp) \ 230 * Transport switch helper functions
227 (test_and_clear_bit(XPRT_CONNECT, &(xp)->sockstate)) 231 */
228#define xprt_clear_connected(xp) (clear_bit(XPRT_CONNECT, &(xp)->sockstate)) 232void xprt_set_retrans_timeout_def(struct rpc_task *task);
233void xprt_set_retrans_timeout_rtt(struct rpc_task *task);
234void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status);
235void xprt_wait_for_buffer_space(struct rpc_task *task);
236void xprt_write_space(struct rpc_xprt *xprt);
237void xprt_update_rtt(struct rpc_task *task);
238void xprt_adjust_cwnd(struct rpc_task *task, int result);
239struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, u32 xid);
240void xprt_complete_rqst(struct rpc_task *task, int copied);
241void xprt_release_rqst_cong(struct rpc_task *task);
242void xprt_disconnect(struct rpc_xprt *xprt);
243
244/*
245 * Socket transport setup operations
246 */
247int xs_setup_udp(struct rpc_xprt *xprt, struct rpc_timeout *to);
248int xs_setup_tcp(struct rpc_xprt *xprt, struct rpc_timeout *to);
249
250/*
251 * Reserved bit positions in xprt->state
252 */
253#define XPRT_LOCKED (0)
254#define XPRT_CONNECTED (1)
255#define XPRT_CONNECTING (2)
256
257static inline void xprt_set_connected(struct rpc_xprt *xprt)
258{
259 set_bit(XPRT_CONNECTED, &xprt->state);
260}
261
262static inline void xprt_clear_connected(struct rpc_xprt *xprt)
263{
264 clear_bit(XPRT_CONNECTED, &xprt->state);
265}
266
267static inline int xprt_connected(struct rpc_xprt *xprt)
268{
269 return test_bit(XPRT_CONNECTED, &xprt->state);
270}
271
272static inline int xprt_test_and_set_connected(struct rpc_xprt *xprt)
273{
274 return test_and_set_bit(XPRT_CONNECTED, &xprt->state);
275}
276
277static inline int xprt_test_and_clear_connected(struct rpc_xprt *xprt)
278{
279 return test_and_clear_bit(XPRT_CONNECTED, &xprt->state);
280}
281
282static inline void xprt_clear_connecting(struct rpc_xprt *xprt)
283{
284 smp_mb__before_clear_bit();
285 clear_bit(XPRT_CONNECTING, &xprt->state);
286 smp_mb__after_clear_bit();
287}
288
289static inline int xprt_connecting(struct rpc_xprt *xprt)
290{
291 return test_bit(XPRT_CONNECTING, &xprt->state);
292}
293
294static inline int xprt_test_and_set_connecting(struct rpc_xprt *xprt)
295{
296 return test_and_set_bit(XPRT_CONNECTING, &xprt->state);
297}
229 298
230#endif /* __KERNEL__*/ 299#endif /* __KERNEL__*/
231 300
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index ad15a54806d8..ba448c760168 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -71,7 +71,7 @@ void restore_processor_state(void);
71struct saved_context; 71struct saved_context;
72void __save_processor_state(struct saved_context *ctxt); 72void __save_processor_state(struct saved_context *ctxt);
73void __restore_processor_state(struct saved_context *ctxt); 73void __restore_processor_state(struct saved_context *ctxt);
74extern unsigned long get_usable_page(unsigned gfp_mask); 74extern unsigned long get_usable_page(gfp_t gfp_mask);
75extern void free_eaten_memory(void); 75extern void free_eaten_memory(void);
76 76
77#endif /* _LINUX_SWSUSP_H */ 77#endif /* _LINUX_SWSUSP_H */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index a7bf1a3b1496..20c975642cab 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -171,8 +171,8 @@ extern int rotate_reclaimable_page(struct page *page);
171extern void swap_setup(void); 171extern void swap_setup(void);
172 172
173/* linux/mm/vmscan.c */ 173/* linux/mm/vmscan.c */
174extern int try_to_free_pages(struct zone **, unsigned int); 174extern int try_to_free_pages(struct zone **, gfp_t);
175extern int zone_reclaim(struct zone *, unsigned int, unsigned int); 175extern int zone_reclaim(struct zone *, gfp_t, unsigned int);
176extern int shrink_all_memory(int); 176extern int shrink_all_memory(int);
177extern int vm_swappiness; 177extern int vm_swappiness;
178 178
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h
index 515046d1b2f4..fc5bb4e91a58 100644
--- a/include/linux/textsearch.h
+++ b/include/linux/textsearch.h
@@ -40,7 +40,7 @@ struct ts_state
40struct ts_ops 40struct ts_ops
41{ 41{
42 const char *name; 42 const char *name;
43 struct ts_config * (*init)(const void *, unsigned int, int); 43 struct ts_config * (*init)(const void *, unsigned int, gfp_t);
44 unsigned int (*find)(struct ts_config *, 44 unsigned int (*find)(struct ts_config *,
45 struct ts_state *); 45 struct ts_state *);
46 void (*destroy)(struct ts_config *); 46 void (*destroy)(struct ts_config *);
@@ -148,7 +148,7 @@ static inline unsigned int textsearch_get_pattern_len(struct ts_config *conf)
148extern int textsearch_register(struct ts_ops *); 148extern int textsearch_register(struct ts_ops *);
149extern int textsearch_unregister(struct ts_ops *); 149extern int textsearch_unregister(struct ts_ops *);
150extern struct ts_config *textsearch_prepare(const char *, const void *, 150extern struct ts_config *textsearch_prepare(const char *, const void *,
151 unsigned int, int, int); 151 unsigned int, gfp_t, int);
152extern void textsearch_destroy(struct ts_config *conf); 152extern void textsearch_destroy(struct ts_config *conf);
153extern unsigned int textsearch_find_continuous(struct ts_config *, 153extern unsigned int textsearch_find_continuous(struct ts_config *,
154 struct ts_state *, 154 struct ts_state *,
diff --git a/include/linux/types.h b/include/linux/types.h
index 0aee34f9da9f..21b9ce803644 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -151,7 +151,12 @@ typedef unsigned long sector_t;
151 */ 151 */
152 152
153#ifdef __CHECKER__ 153#ifdef __CHECKER__
154#define __bitwise __attribute__((bitwise)) 154#define __bitwise__ __attribute__((bitwise))
155#else
156#define __bitwise__
157#endif
158#ifdef __CHECK_ENDIAN__
159#define __bitwise __bitwise__
155#else 160#else
156#define __bitwise 161#define __bitwise
157#endif 162#endif
@@ -166,7 +171,7 @@ typedef __u64 __bitwise __be64;
166#endif 171#endif
167 172
168#ifdef __KERNEL__ 173#ifdef __KERNEL__
169typedef unsigned __nocast gfp_t; 174typedef unsigned __bitwise__ gfp_t;
170#endif 175#endif
171 176
172struct ustat { 177struct ustat {
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 4dbe580f9335..748d04385256 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -57,6 +57,7 @@ struct usb_host_endpoint {
57 struct usb_endpoint_descriptor desc; 57 struct usb_endpoint_descriptor desc;
58 struct list_head urb_list; 58 struct list_head urb_list;
59 void *hcpriv; 59 void *hcpriv;
60 struct kobject *kobj; /* For sysfs info */
60 61
61 unsigned char *extra; /* Extra descriptors */ 62 unsigned char *extra; /* Extra descriptors */
62 int extralen; 63 int extralen;
@@ -136,7 +137,8 @@ struct usb_interface {
136 * active alternate setting */ 137 * active alternate setting */
137 unsigned num_altsetting; /* number of alternate settings */ 138 unsigned num_altsetting; /* number of alternate settings */
138 139
139 int minor; /* minor number this interface is bound to */ 140 int minor; /* minor number this interface is
141 * bound to */
140 enum usb_interface_condition condition; /* state of binding */ 142 enum usb_interface_condition condition; /* state of binding */
141 struct device dev; /* interface specific device info */ 143 struct device dev; /* interface specific device info */
142 struct class_device *class_dev; 144 struct class_device *class_dev;
@@ -229,7 +231,7 @@ struct usb_interface_cache {
229struct usb_host_config { 231struct usb_host_config {
230 struct usb_config_descriptor desc; 232 struct usb_config_descriptor desc;
231 233
232 char *string; 234 char *string; /* iConfiguration string, if present */
233 /* the interfaces associated with this configuration, 235 /* the interfaces associated with this configuration,
234 * stored in no particular order */ 236 * stored in no particular order */
235 struct usb_interface *interface[USB_MAXINTERFACES]; 237 struct usb_interface *interface[USB_MAXINTERFACES];
@@ -248,7 +250,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,
248 __usb_get_extra_descriptor((ifpoint)->extra,(ifpoint)->extralen,\ 250 __usb_get_extra_descriptor((ifpoint)->extra,(ifpoint)->extralen,\
249 type,(void**)ptr) 251 type,(void**)ptr)
250 252
251/* -------------------------------------------------------------------------- */ 253/* ----------------------------------------------------------------------- */
252 254
253struct usb_operations; 255struct usb_operations;
254 256
@@ -268,7 +270,8 @@ struct usb_bus {
268 unsigned is_b_host:1; /* true during some HNP roleswitches */ 270 unsigned is_b_host:1; /* true during some HNP roleswitches */
269 unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ 271 unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */
270 272
271 int devnum_next; /* Next open device number in round-robin allocation */ 273 int devnum_next; /* Next open device number in
274 * round-robin allocation */
272 275
273 struct usb_devmap devmap; /* device address allocation map */ 276 struct usb_devmap devmap; /* device address allocation map */
274 struct usb_operations *op; /* Operations (specific to the HC) */ 277 struct usb_operations *op; /* Operations (specific to the HC) */
@@ -289,15 +292,16 @@ struct usb_bus {
289 struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ 292 struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */
290 293
291 struct class_device *class_dev; /* class device for this bus */ 294 struct class_device *class_dev; /* class device for this bus */
292 struct kref kref; /* handles reference counting this bus */ 295 struct kref kref; /* reference counting for this bus */
293 void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */ 296 void (*release)(struct usb_bus *bus);
297
294#if defined(CONFIG_USB_MON) 298#if defined(CONFIG_USB_MON)
295 struct mon_bus *mon_bus; /* non-null when associated */ 299 struct mon_bus *mon_bus; /* non-null when associated */
296 int monitored; /* non-zero when monitored */ 300 int monitored; /* non-zero when monitored */
297#endif 301#endif
298}; 302};
299 303
300/* -------------------------------------------------------------------------- */ 304/* ----------------------------------------------------------------------- */
301 305
302/* This is arbitrary. 306/* This is arbitrary.
303 * From USB 2.0 spec Table 11-13, offset 7, a hub can 307 * From USB 2.0 spec Table 11-13, offset 7, a hub can
@@ -326,7 +330,8 @@ struct usb_device {
326 330
327 struct semaphore serialize; 331 struct semaphore serialize;
328 332
329 unsigned int toggle[2]; /* one bit for each endpoint ([0] = IN, [1] = OUT) */ 333 unsigned int toggle[2]; /* one bit for each endpoint
334 * ([0] = IN, [1] = OUT) */
330 335
331 struct usb_device *parent; /* our hub, unless we're the root */ 336 struct usb_device *parent; /* our hub, unless we're the root */
332 struct usb_bus *bus; /* Bus we're part of */ 337 struct usb_bus *bus; /* Bus we're part of */
@@ -343,12 +348,14 @@ struct usb_device {
343 348
344 char **rawdescriptors; /* Raw descriptors for each config */ 349 char **rawdescriptors; /* Raw descriptors for each config */
345 350
346 int have_langid; /* whether string_langid is valid yet */ 351 int have_langid; /* whether string_langid is valid */
347 int string_langid; /* language ID for strings */ 352 int string_langid; /* language ID for strings */
348 353
349 char *product; 354 /* static strings from the device */
350 char *manufacturer; 355 char *product; /* iProduct string, if present */
351 char *serial; /* static strings from the device */ 356 char *manufacturer; /* iManufacturer string, if present */
357 char *serial; /* iSerialNumber string, if present */
358
352 struct list_head filelist; 359 struct list_head filelist;
353 struct class_device *class_dev; 360 struct class_device *class_dev;
354 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 361 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
@@ -440,22 +447,31 @@ extern struct usb_host_interface *usb_altnum_to_altsetting(
440 * USB 2.0 root hubs (EHCI host controllers) will get one path ID if they are 447 * USB 2.0 root hubs (EHCI host controllers) will get one path ID if they are
441 * high speed, and a different one if they are full or low speed. 448 * high speed, and a different one if they are full or low speed.
442 */ 449 */
443static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size) 450static inline int usb_make_path (struct usb_device *dev, char *buf,
451 size_t size)
444{ 452{
445 int actual; 453 int actual;
446 actual = snprintf (buf, size, "usb-%s-%s", dev->bus->bus_name, dev->devpath); 454 actual = snprintf (buf, size, "usb-%s-%s", dev->bus->bus_name,
455 dev->devpath);
447 return (actual >= (int)size) ? -1 : actual; 456 return (actual >= (int)size) ? -1 : actual;
448} 457}
449 458
450/*-------------------------------------------------------------------------*/ 459/*-------------------------------------------------------------------------*/
451 460
452#define USB_DEVICE_ID_MATCH_DEVICE (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT) 461#define USB_DEVICE_ID_MATCH_DEVICE \
453#define USB_DEVICE_ID_MATCH_DEV_RANGE (USB_DEVICE_ID_MATCH_DEV_LO | USB_DEVICE_ID_MATCH_DEV_HI) 462 (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT)
454#define USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION (USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_DEV_RANGE) 463#define USB_DEVICE_ID_MATCH_DEV_RANGE \
464 (USB_DEVICE_ID_MATCH_DEV_LO | USB_DEVICE_ID_MATCH_DEV_HI)
465#define USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION \
466 (USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_DEV_RANGE)
455#define USB_DEVICE_ID_MATCH_DEV_INFO \ 467#define USB_DEVICE_ID_MATCH_DEV_INFO \
456 (USB_DEVICE_ID_MATCH_DEV_CLASS | USB_DEVICE_ID_MATCH_DEV_SUBCLASS | USB_DEVICE_ID_MATCH_DEV_PROTOCOL) 468 (USB_DEVICE_ID_MATCH_DEV_CLASS | \
469 USB_DEVICE_ID_MATCH_DEV_SUBCLASS | \
470 USB_DEVICE_ID_MATCH_DEV_PROTOCOL)
457#define USB_DEVICE_ID_MATCH_INT_INFO \ 471#define USB_DEVICE_ID_MATCH_INT_INFO \
458 (USB_DEVICE_ID_MATCH_INT_CLASS | USB_DEVICE_ID_MATCH_INT_SUBCLASS | USB_DEVICE_ID_MATCH_INT_PROTOCOL) 472 (USB_DEVICE_ID_MATCH_INT_CLASS | \
473 USB_DEVICE_ID_MATCH_INT_SUBCLASS | \
474 USB_DEVICE_ID_MATCH_INT_PROTOCOL)
459 475
460/** 476/**
461 * USB_DEVICE - macro used to describe a specific usb device 477 * USB_DEVICE - macro used to describe a specific usb device
@@ -466,9 +482,11 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
466 * specific device. 482 * specific device.
467 */ 483 */
468#define USB_DEVICE(vend,prod) \ 484#define USB_DEVICE(vend,prod) \
469 .match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = (vend), .idProduct = (prod) 485 .match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = (vend), \
486 .idProduct = (prod)
470/** 487/**
471 * USB_DEVICE_VER - macro used to describe a specific usb device with a version range 488 * USB_DEVICE_VER - macro used to describe a specific usb device with a
489 * version range
472 * @vend: the 16 bit USB Vendor ID 490 * @vend: the 16 bit USB Vendor ID
473 * @prod: the 16 bit USB Product ID 491 * @prod: the 16 bit USB Product ID
474 * @lo: the bcdDevice_lo value 492 * @lo: the bcdDevice_lo value
@@ -478,7 +496,9 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
478 * specific device, with a version range. 496 * specific device, with a version range.
479 */ 497 */
480#define USB_DEVICE_VER(vend,prod,lo,hi) \ 498#define USB_DEVICE_VER(vend,prod,lo,hi) \
481 .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, .idVendor = (vend), .idProduct = (prod), .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) 499 .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, \
500 .idVendor = (vend), .idProduct = (prod), \
501 .bcdDevice_lo = (lo), .bcdDevice_hi = (hi)
482 502
483/** 503/**
484 * USB_DEVICE_INFO - macro used to describe a class of usb devices 504 * USB_DEVICE_INFO - macro used to describe a class of usb devices
@@ -490,7 +510,8 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
490 * specific class of devices. 510 * specific class of devices.
491 */ 511 */
492#define USB_DEVICE_INFO(cl,sc,pr) \ 512#define USB_DEVICE_INFO(cl,sc,pr) \
493 .match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, .bDeviceClass = (cl), .bDeviceSubClass = (sc), .bDeviceProtocol = (pr) 513 .match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, .bDeviceClass = (cl), \
514 .bDeviceSubClass = (sc), .bDeviceProtocol = (pr)
494 515
495/** 516/**
496 * USB_INTERFACE_INFO - macro used to describe a class of usb interfaces 517 * USB_INTERFACE_INFO - macro used to describe a class of usb interfaces
@@ -502,9 +523,10 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
502 * specific class of interfaces. 523 * specific class of interfaces.
503 */ 524 */
504#define USB_INTERFACE_INFO(cl,sc,pr) \ 525#define USB_INTERFACE_INFO(cl,sc,pr) \
505 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) 526 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \
527 .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr)
506 528
507/* -------------------------------------------------------------------------- */ 529/* ----------------------------------------------------------------------- */
508 530
509/** 531/**
510 * struct usb_driver - identifies USB driver to usbcore 532 * struct usb_driver - identifies USB driver to usbcore
@@ -557,7 +579,8 @@ struct usb_driver {
557 579
558 void (*disconnect) (struct usb_interface *intf); 580 void (*disconnect) (struct usb_interface *intf);
559 581
560 int (*ioctl) (struct usb_interface *intf, unsigned int code, void *buf); 582 int (*ioctl) (struct usb_interface *intf, unsigned int code,
583 void *buf);
561 584
562 int (*suspend) (struct usb_interface *intf, pm_message_t message); 585 int (*suspend) (struct usb_interface *intf, pm_message_t message);
563 int (*resume) (struct usb_interface *intf); 586 int (*resume) (struct usb_interface *intf);
@@ -572,10 +595,8 @@ extern struct bus_type usb_bus_type;
572 595
573/** 596/**
574 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number 597 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number
575 * @name: devfs name for this driver. Will also be used by the driver 598 * @name: the usb class device name for this driver. Will show up in sysfs.
576 * class code to create a usb class device.
577 * @fops: pointer to the struct file_operations of this driver. 599 * @fops: pointer to the struct file_operations of this driver.
578 * @mode: the mode for the devfs file to be created for this driver.
579 * @minor_base: the start of the minor range for this driver. 600 * @minor_base: the start of the minor range for this driver.
580 * 601 *
581 * This structure is used for the usb_register_dev() and 602 * This structure is used for the usb_register_dev() and
@@ -585,8 +606,7 @@ extern struct bus_type usb_bus_type;
585struct usb_class_driver { 606struct usb_class_driver {
586 char *name; 607 char *name;
587 struct file_operations *fops; 608 struct file_operations *fops;
588 mode_t mode; 609 int minor_base;
589 int minor_base;
590}; 610};
591 611
592/* 612/*
@@ -603,7 +623,7 @@ extern void usb_deregister_dev(struct usb_interface *intf,
603 623
604extern int usb_disabled(void); 624extern int usb_disabled(void);
605 625
606/* -------------------------------------------------------------------------- */ 626/* ----------------------------------------------------------------------- */
607 627
608/* 628/*
609 * URB support, for asynchronous request completions 629 * URB support, for asynchronous request completions
@@ -613,12 +633,14 @@ extern int usb_disabled(void);
613 * urb->transfer_flags: 633 * urb->transfer_flags:
614 */ 634 */
615#define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */ 635#define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */
616#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame ignored */ 636#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame
637 * ignored */
617#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ 638#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */
618#define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */ 639#define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */
619#define URB_NO_FSBR 0x0020 /* UHCI-specific */ 640#define URB_NO_FSBR 0x0020 /* UHCI-specific */
620#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUTs with short packet */ 641#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */
621#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt needed */ 642#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt
643 * needed */
622 644
623struct usb_iso_packet_descriptor { 645struct usb_iso_packet_descriptor {
624 unsigned int offset; 646 unsigned int offset;
@@ -806,7 +828,8 @@ struct urb
806 u8 reject; /* submissions will fail */ 828 u8 reject; /* submissions will fail */
807 829
808 /* public, documented fields in the urb that can be used by drivers */ 830 /* public, documented fields in the urb that can be used by drivers */
809 struct list_head urb_list; /* list head for use by the urb owner */ 831 struct list_head urb_list; /* list head for use by the urb's
832 * current owner */
810 struct usb_device *dev; /* (in) pointer to associated device */ 833 struct usb_device *dev; /* (in) pointer to associated device */
811 unsigned int pipe; /* (in) pipe information */ 834 unsigned int pipe; /* (in) pipe information */
812 int status; /* (return) non-ISO status */ 835 int status; /* (return) non-ISO status */
@@ -819,14 +842,16 @@ struct urb
819 dma_addr_t setup_dma; /* (in) dma addr for setup_packet */ 842 dma_addr_t setup_dma; /* (in) dma addr for setup_packet */
820 int start_frame; /* (modify) start frame (ISO) */ 843 int start_frame; /* (modify) start frame (ISO) */
821 int number_of_packets; /* (in) number of ISO packets */ 844 int number_of_packets; /* (in) number of ISO packets */
822 int interval; /* (modify) transfer interval (INT/ISO) */ 845 int interval; /* (modify) transfer interval
846 * (INT/ISO) */
823 int error_count; /* (return) number of ISO errors */ 847 int error_count; /* (return) number of ISO errors */
824 void *context; /* (in) context for completion */ 848 void *context; /* (in) context for completion */
825 usb_complete_t complete; /* (in) completion routine */ 849 usb_complete_t complete; /* (in) completion routine */
826 struct usb_iso_packet_descriptor iso_frame_desc[0]; /* (in) ISO ONLY */ 850 struct usb_iso_packet_descriptor iso_frame_desc[0];
851 /* (in) ISO ONLY */
827}; 852};
828 853
829/* -------------------------------------------------------------------------- */ 854/* ----------------------------------------------------------------------- */
830 855
831/** 856/**
832 * usb_fill_control_urb - initializes a control urb 857 * usb_fill_control_urb - initializes a control urb
@@ -933,17 +958,17 @@ static inline void usb_fill_int_urb (struct urb *urb,
933} 958}
934 959
935extern void usb_init_urb(struct urb *urb); 960extern void usb_init_urb(struct urb *urb);
936extern struct urb *usb_alloc_urb(int iso_packets, unsigned mem_flags); 961extern struct urb *usb_alloc_urb(int iso_packets, gfp_t mem_flags);
937extern void usb_free_urb(struct urb *urb); 962extern void usb_free_urb(struct urb *urb);
938#define usb_put_urb usb_free_urb 963#define usb_put_urb usb_free_urb
939extern struct urb *usb_get_urb(struct urb *urb); 964extern struct urb *usb_get_urb(struct urb *urb);
940extern int usb_submit_urb(struct urb *urb, unsigned mem_flags); 965extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags);
941extern int usb_unlink_urb(struct urb *urb); 966extern int usb_unlink_urb(struct urb *urb);
942extern void usb_kill_urb(struct urb *urb); 967extern void usb_kill_urb(struct urb *urb);
943 968
944#define HAVE_USB_BUFFERS 969#define HAVE_USB_BUFFERS
945void *usb_buffer_alloc (struct usb_device *dev, size_t size, 970void *usb_buffer_alloc (struct usb_device *dev, size_t size,
946 unsigned mem_flags, dma_addr_t *dma); 971 gfp_t mem_flags, dma_addr_t *dma);
947void usb_buffer_free (struct usb_device *dev, size_t size, 972void usb_buffer_free (struct usb_device *dev, size_t size,
948 void *addr, dma_addr_t dma); 973 void *addr, dma_addr_t dma);
949 974
@@ -974,11 +999,6 @@ extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
974 void *data, int len, int *actual_length, 999 void *data, int len, int *actual_length,
975 int timeout); 1000 int timeout);
976 1001
977/* selective suspend/resume */
978extern int usb_suspend_device(struct usb_device *dev, pm_message_t message);
979extern int usb_resume_device(struct usb_device *dev);
980
981
982/* wrappers around usb_control_msg() for the most common standard requests */ 1002/* wrappers around usb_control_msg() for the most common standard requests */
983extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype, 1003extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype,
984 unsigned char descindex, void *buf, int size); 1004 unsigned char descindex, void *buf, int size);
@@ -1050,13 +1070,13 @@ int usb_sg_init (
1050 struct scatterlist *sg, 1070 struct scatterlist *sg,
1051 int nents, 1071 int nents,
1052 size_t length, 1072 size_t length,
1053 unsigned mem_flags 1073 gfp_t mem_flags
1054); 1074);
1055void usb_sg_cancel (struct usb_sg_request *io); 1075void usb_sg_cancel (struct usb_sg_request *io);
1056void usb_sg_wait (struct usb_sg_request *io); 1076void usb_sg_wait (struct usb_sg_request *io);
1057 1077
1058 1078
1059/* -------------------------------------------------------------------------- */ 1079/* ----------------------------------------------------------------------- */
1060 1080
1061/* 1081/*
1062 * For various legacy reasons, Linux has a small cookie that's paired with 1082 * For various legacy reasons, Linux has a small cookie that's paired with
@@ -1097,23 +1117,34 @@ void usb_sg_wait (struct usb_sg_request *io);
1097/* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ 1117/* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */
1098#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) 1118#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1)
1099#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep))) 1119#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep)))
1100#define usb_settoggle(dev, ep, out, bit) ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | ((bit) << (ep))) 1120#define usb_settoggle(dev, ep, out, bit) \
1121 ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | \
1122 ((bit) << (ep)))
1101 1123
1102 1124
1103static inline unsigned int __create_pipe(struct usb_device *dev, unsigned int endpoint) 1125static inline unsigned int __create_pipe(struct usb_device *dev,
1126 unsigned int endpoint)
1104{ 1127{
1105 return (dev->devnum << 8) | (endpoint << 15); 1128 return (dev->devnum << 8) | (endpoint << 15);
1106} 1129}
1107 1130
1108/* Create various pipes... */ 1131/* Create various pipes... */
1109#define usb_sndctrlpipe(dev,endpoint) ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint)) 1132#define usb_sndctrlpipe(dev,endpoint) \
1110#define usb_rcvctrlpipe(dev,endpoint) ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) 1133 ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint))
1111#define usb_sndisocpipe(dev,endpoint) ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint)) 1134#define usb_rcvctrlpipe(dev,endpoint) \
1112#define usb_rcvisocpipe(dev,endpoint) ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) 1135 ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
1113#define usb_sndbulkpipe(dev,endpoint) ((PIPE_BULK << 30) | __create_pipe(dev,endpoint)) 1136#define usb_sndisocpipe(dev,endpoint) \
1114#define usb_rcvbulkpipe(dev,endpoint) ((PIPE_BULK << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) 1137 ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint))
1115#define usb_sndintpipe(dev,endpoint) ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint)) 1138#define usb_rcvisocpipe(dev,endpoint) \
1116#define usb_rcvintpipe(dev,endpoint) ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) 1139 ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
1140#define usb_sndbulkpipe(dev,endpoint) \
1141 ((PIPE_BULK << 30) | __create_pipe(dev,endpoint))
1142#define usb_rcvbulkpipe(dev,endpoint) \
1143 ((PIPE_BULK << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
1144#define usb_sndintpipe(dev,endpoint) \
1145 ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint))
1146#define usb_rcvintpipe(dev,endpoint) \
1147 ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
1117 1148
1118/*-------------------------------------------------------------------------*/ 1149/*-------------------------------------------------------------------------*/
1119 1150
@@ -1137,17 +1168,29 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
1137 return le16_to_cpu(ep->desc.wMaxPacketSize); 1168 return le16_to_cpu(ep->desc.wMaxPacketSize);
1138} 1169}
1139 1170
1140/* -------------------------------------------------------------------------- */ 1171/* ----------------------------------------------------------------------- */
1172
1173/* Events from the usb core */
1174#define USB_DEVICE_ADD 0x0001
1175#define USB_DEVICE_REMOVE 0x0002
1176#define USB_BUS_ADD 0x0003
1177#define USB_BUS_REMOVE 0x0004
1178extern void usb_register_notify(struct notifier_block *nb);
1179extern void usb_unregister_notify(struct notifier_block *nb);
1141 1180
1142#ifdef DEBUG 1181#ifdef DEBUG
1143#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg) 1182#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \
1183 __FILE__ , ## arg)
1144#else 1184#else
1145#define dbg(format, arg...) do {} while (0) 1185#define dbg(format, arg...) do {} while (0)
1146#endif 1186#endif
1147 1187
1148#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , __FILE__ , ## arg) 1188#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
1149#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , __FILE__ , ## arg) 1189 __FILE__ , ## arg)
1150#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , __FILE__ , ## arg) 1190#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , \
1191 __FILE__ , ## arg)
1192#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , \
1193 __FILE__ , ## arg)
1151 1194
1152 1195
1153#endif /* __KERNEL__ */ 1196#endif /* __KERNEL__ */
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
index 71e608607324..ff81117eb733 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb_gadget.h
@@ -107,18 +107,18 @@ struct usb_ep_ops {
107 int (*disable) (struct usb_ep *ep); 107 int (*disable) (struct usb_ep *ep);
108 108
109 struct usb_request *(*alloc_request) (struct usb_ep *ep, 109 struct usb_request *(*alloc_request) (struct usb_ep *ep,
110 unsigned gfp_flags); 110 gfp_t gfp_flags);
111 void (*free_request) (struct usb_ep *ep, struct usb_request *req); 111 void (*free_request) (struct usb_ep *ep, struct usb_request *req);
112 112
113 void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes, 113 void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes,
114 dma_addr_t *dma, unsigned gfp_flags); 114 dma_addr_t *dma, gfp_t gfp_flags);
115 void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma, 115 void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma,
116 unsigned bytes); 116 unsigned bytes);
117 // NOTE: on 2.6, drivers may also use dma_map() and 117 // NOTE: on 2.6, drivers may also use dma_map() and
118 // dma_sync_single_*() to directly manage dma overhead. 118 // dma_sync_single_*() to directly manage dma overhead.
119 119
120 int (*queue) (struct usb_ep *ep, struct usb_request *req, 120 int (*queue) (struct usb_ep *ep, struct usb_request *req,
121 unsigned gfp_flags); 121 gfp_t gfp_flags);
122 int (*dequeue) (struct usb_ep *ep, struct usb_request *req); 122 int (*dequeue) (struct usb_ep *ep, struct usb_request *req);
123 123
124 int (*set_halt) (struct usb_ep *ep, int value); 124 int (*set_halt) (struct usb_ep *ep, int value);
@@ -214,7 +214,7 @@ usb_ep_disable (struct usb_ep *ep)
214 * Returns the request, or null if one could not be allocated. 214 * Returns the request, or null if one could not be allocated.
215 */ 215 */
216static inline struct usb_request * 216static inline struct usb_request *
217usb_ep_alloc_request (struct usb_ep *ep, unsigned gfp_flags) 217usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags)
218{ 218{
219 return ep->ops->alloc_request (ep, gfp_flags); 219 return ep->ops->alloc_request (ep, gfp_flags);
220} 220}
@@ -254,7 +254,7 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req)
254 */ 254 */
255static inline void * 255static inline void *
256usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma, 256usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma,
257 unsigned gfp_flags) 257 gfp_t gfp_flags)
258{ 258{
259 return ep->ops->alloc_buffer (ep, len, dma, gfp_flags); 259 return ep->ops->alloc_buffer (ep, len, dma, gfp_flags);
260} 260}
@@ -330,7 +330,7 @@ usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len)
330 * reported when the usb peripheral is disconnected. 330 * reported when the usb peripheral is disconnected.
331 */ 331 */
332static inline int 332static inline int
333usb_ep_queue (struct usb_ep *ep, struct usb_request *req, unsigned gfp_flags) 333usb_ep_queue (struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags)
334{ 334{
335 return ep->ops->queue (ep, req, gfp_flags); 335 return ep->ops->queue (ep, req, gfp_flags);
336} 336}
diff --git a/include/linux/usb_otg.h b/include/linux/usb_otg.h
index c6683146e9b0..f827f6e203c2 100644
--- a/include/linux/usb_otg.h
+++ b/include/linux/usb_otg.h
@@ -63,6 +63,10 @@ struct otg_transceiver {
63 int (*set_power)(struct otg_transceiver *otg, 63 int (*set_power)(struct otg_transceiver *otg,
64 unsigned mA); 64 unsigned mA);
65 65
66 /* for non-OTG B devices: set transceiver into suspend mode */
67 int (*set_suspend)(struct otg_transceiver *otg,
68 int suspend);
69
66 /* for B devices only: start session with A-Host */ 70 /* for B devices only: start session with A-Host */
67 int (*start_srp)(struct otg_transceiver *otg); 71 int (*start_srp)(struct otg_transceiver *otg);
68 72
@@ -108,6 +112,15 @@ otg_set_power(struct otg_transceiver *otg, unsigned mA)
108} 112}
109 113
110static inline int 114static inline int
115otg_set_suspend(struct otg_transceiver *otg, int suspend)
116{
117 if (otg->set_suspend != NULL)
118 return otg->set_suspend(otg, suspend);
119 else
120 return 0;
121}
122
123static inline int
111otg_start_srp(struct otg_transceiver *otg) 124otg_start_srp(struct otg_transceiver *otg)
112{ 125{
113 return otg->start_srp(otg); 126 return otg->start_srp(otg);
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 9facf733800c..8859f0b41543 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -140,6 +140,12 @@ struct usbdevfs_urb32 {
140 compat_caddr_t usercontext; /* unused */ 140 compat_caddr_t usercontext; /* unused */
141 struct usbdevfs_iso_packet_desc iso_frame_desc[0]; 141 struct usbdevfs_iso_packet_desc iso_frame_desc[0];
142}; 142};
143
144struct usbdevfs_ioctl32 {
145 s32 ifno;
146 s32 ioctl_code;
147 compat_caddr_t data;
148};
143#endif 149#endif
144 150
145#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) 151#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
@@ -160,6 +166,7 @@ struct usbdevfs_urb32 {
160#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) 166#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
161#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) 167#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo)
162#define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl) 168#define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl)
169#define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32)
163#define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo) 170#define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo)
164#define USBDEVFS_RESET _IO('U', 20) 171#define USBDEVFS_RESET _IO('U', 20)
165#define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) 172#define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int)
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 3701a0673d2c..1d5577b2b752 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -32,10 +32,14 @@ struct vm_struct {
32 * Highlevel APIs for driver use 32 * Highlevel APIs for driver use
33 */ 33 */
34extern void *vmalloc(unsigned long size); 34extern void *vmalloc(unsigned long size);
35extern void *vmalloc_node(unsigned long size, int node);
35extern void *vmalloc_exec(unsigned long size); 36extern void *vmalloc_exec(unsigned long size);
36extern void *vmalloc_32(unsigned long size); 37extern void *vmalloc_32(unsigned long size);
37extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); 38extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
38extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, pgprot_t prot); 39extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask,
40 pgprot_t prot);
41extern void *__vmalloc_node(unsigned long size, gfp_t gfp_mask,
42 pgprot_t prot, int node);
39extern void vfree(void *addr); 43extern void vfree(void *addr);
40 44
41extern void *vmap(struct page **pages, unsigned int count, 45extern void *vmap(struct page **pages, unsigned int count,
@@ -48,6 +52,8 @@ extern void vunmap(void *addr);
48extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); 52extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
49extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, 53extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
50 unsigned long start, unsigned long end); 54 unsigned long start, unsigned long end);
55extern struct vm_struct *get_vm_area_node(unsigned long size,
56 unsigned long flags, int node);
51extern struct vm_struct *remove_vm_area(void *addr); 57extern struct vm_struct *remove_vm_area(void *addr);
52extern struct vm_struct *__remove_vm_area(void *addr); 58extern struct vm_struct *__remove_vm_area(void *addr);
53extern int map_vm_area(struct vm_struct *area, pgprot_t prot, 59extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h
index 167d956c492b..dae9860091dd 100644
--- a/include/linux/wanpipe.h
+++ b/include/linux/wanpipe.h
@@ -265,15 +265,6 @@ typedef struct {
265#include <linux/tty_driver.h> 265#include <linux/tty_driver.h>
266#include <linux/tty_flip.h> 266#include <linux/tty_flip.h>
267 267
268
269#define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0)
270#define is_alpha(ch) ((((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'z')||\
271 ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'Z'))?1:0)
272#define is_hex_digit(ch) ((((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')||\
273 ((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'f')||\
274 ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'F'))?1:0)
275
276
277/****** Data Structures *****************************************************/ 268/****** Data Structures *****************************************************/
278 269
279/* Adapter Data Space. 270/* Adapter Data Space.
diff --git a/include/linux/x1205.h b/include/linux/x1205.h
new file mode 100644
index 000000000000..64fd3af894a5
--- /dev/null
+++ b/include/linux/x1205.h
@@ -0,0 +1,31 @@
1/*
2 * x1205.h - defines for drivers/i2c/chips/x1205.c
3 * Copyright 2004 Karen Spearel
4 * Copyright 2005 Alessandro Zummo
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __LINUX_X1205_H__
13#define __LINUX_X1205_H__
14
15/* commands */
16
17#define X1205_CMD_GETDATETIME 0
18#define X1205_CMD_SETTIME 1
19#define X1205_CMD_SETDATETIME 2
20#define X1205_CMD_GETALARM 3
21#define X1205_CMD_SETALARM 4
22#define X1205_CMD_GETDTRIM 5
23#define X1205_CMD_SETDTRIM 6
24#define X1205_CMD_GETATRIM 7
25#define X1205_CMD_SETATRIM 8
26
27extern int x1205_do_command(unsigned int cmd, void *arg);
28extern int x1205_direct_attach(int adapter_id,
29 struct i2c_client_address_data *address_data);
30
31#endif /* __LINUX_X1205_H__ */
diff --git a/include/media/ovcamchip.h b/include/media/ovcamchip.h
index cb7c0aa96f22..8138983adced 100644
--- a/include/media/ovcamchip.h
+++ b/include/media/ovcamchip.h
@@ -17,20 +17,6 @@
17#include <linux/videodev.h> 17#include <linux/videodev.h>
18#include <linux/i2c.h> 18#include <linux/i2c.h>
19 19
20/* Remove these once they are officially defined */
21#ifndef I2C_DRIVERID_OVCAMCHIP
22 #define I2C_DRIVERID_OVCAMCHIP 0xf00f
23#endif
24#ifndef I2C_HW_SMBUS_OV511
25 #define I2C_HW_SMBUS_OV511 0xfe
26#endif
27#ifndef I2C_HW_SMBUS_OV518
28 #define I2C_HW_SMBUS_OV518 0xff
29#endif
30#ifndef I2C_HW_SMBUS_OVFX2
31 #define I2C_HW_SMBUS_OVFX2 0xfd
32#endif
33
34/* --------------------------------- */ 20/* --------------------------------- */
35/* ENUMERATIONS */ 21/* ENUMERATIONS */
36/* --------------------------------- */ 22/* --------------------------------- */
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 30bb4a893237..2250a18b0cbb 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -237,8 +237,7 @@ typedef struct ax25_cb {
237static __inline__ void ax25_cb_put(ax25_cb *ax25) 237static __inline__ void ax25_cb_put(ax25_cb *ax25)
238{ 238{
239 if (atomic_dec_and_test(&ax25->refcount)) { 239 if (atomic_dec_and_test(&ax25->refcount)) {
240 if (ax25->digipeat) 240 kfree(ax25->digipeat);
241 kfree(ax25->digipeat);
242 kfree(ax25); 241 kfree(ax25);
243 } 242 }
244} 243}
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 210458624840..e42d728b1620 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -171,4 +171,10 @@ static inline int skb_frags_no(struct sk_buff *skb)
171 171
172int bt_err(__u16 code); 172int bt_err(__u16 code);
173 173
174extern int hci_sock_init(void);
175extern int hci_sock_cleanup(void);
176
177extern int bt_sysfs_init(void);
178extern void bt_sysfs_cleanup(void);
179
174#endif /* __BLUETOOTH_H */ 180#endif /* __BLUETOOTH_H */
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index fbe557f7ea1d..e656be7c001a 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -275,9 +275,6 @@ static inline void rfcomm_session_hold(struct rfcomm_session *s)
275 atomic_inc(&s->refcnt); 275 atomic_inc(&s->refcnt);
276} 276}
277 277
278/* ---- RFCOMM chechsum ---- */
279extern u8 rfcomm_crc_table[];
280
281/* ---- RFCOMM sockets ---- */ 278/* ---- RFCOMM sockets ---- */
282struct sockaddr_rc { 279struct sockaddr_rc {
283 sa_family_t rc_family; 280 sa_family_t rc_family;
diff --git a/include/net/dst.h b/include/net/dst.h
index 4a056a682435..6c196a5baf24 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -94,7 +94,6 @@ struct dst_ops
94 struct dst_entry * (*negative_advice)(struct dst_entry *); 94 struct dst_entry * (*negative_advice)(struct dst_entry *);
95 void (*link_failure)(struct sk_buff *); 95 void (*link_failure)(struct sk_buff *);
96 void (*update_pmtu)(struct dst_entry *dst, u32 mtu); 96 void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
97 int (*get_mss)(struct dst_entry *dst, u32 mtu);
98 int entry_size; 97 int entry_size;
99 98
100 atomic_t entries; 99 atomic_t entries;
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index dc36b1be6745..5e38dca1d082 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -11,19 +11,26 @@
11 * 11 *
12 * Adaption to a generic IEEE 802.11 stack by James Ketrenos 12 * Adaption to a generic IEEE 802.11 stack by James Ketrenos
13 * <jketreno@linux.intel.com> 13 * <jketreno@linux.intel.com>
14 * Copyright (c) 2004, Intel Corporation 14 * Copyright (c) 2004-2005, Intel Corporation
15 * 15 *
16 * This program is free software; you can redistribute it and/or modify 16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as 17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation. See README and COPYING for 18 * published by the Free Software Foundation. See README and COPYING for
19 * more details. 19 * more details.
20 *
21 * API Version History
22 * 1.0.x -- Initial version
23 * 1.1.x -- Added radiotap, QoS, TIM, ieee80211_geo APIs,
24 * various structure changes, and crypto API init method
20 */ 25 */
21#ifndef IEEE80211_H 26#ifndef IEEE80211_H
22#define IEEE80211_H 27#define IEEE80211_H
23#include <linux/if_ether.h> /* ETH_ALEN */ 28#include <linux/if_ether.h> /* ETH_ALEN */
24#include <linux/kernel.h> /* ARRAY_SIZE */ 29#include <linux/kernel.h> /* ARRAY_SIZE */
25#include <linux/wireless.h> 30#include <linux/wireless.h>
26 31
32#define IEEE80211_VERSION "git-1.1.6"
33
27#define IEEE80211_DATA_LEN 2304 34#define IEEE80211_DATA_LEN 2304
28/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section 35/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
29 6.2.1.1.2. 36 6.2.1.1.2.
@@ -33,34 +40,13 @@
33 represents the 2304 bytes of real data, plus a possible 8 bytes of 40 represents the 2304 bytes of real data, plus a possible 8 bytes of
34 WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ 41 WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
35 42
36
37#define IEEE80211_HLEN 30
38#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
39
40struct ieee80211_hdr {
41 __le16 frame_ctl;
42 __le16 duration_id;
43 u8 addr1[ETH_ALEN];
44 u8 addr2[ETH_ALEN];
45 u8 addr3[ETH_ALEN];
46 __le16 seq_ctl;
47 u8 addr4[ETH_ALEN];
48} __attribute__ ((packed));
49
50struct ieee80211_hdr_3addr {
51 __le16 frame_ctl;
52 __le16 duration_id;
53 u8 addr1[ETH_ALEN];
54 u8 addr2[ETH_ALEN];
55 u8 addr3[ETH_ALEN];
56 __le16 seq_ctl;
57} __attribute__ ((packed));
58
59#define IEEE80211_1ADDR_LEN 10 43#define IEEE80211_1ADDR_LEN 10
60#define IEEE80211_2ADDR_LEN 16 44#define IEEE80211_2ADDR_LEN 16
61#define IEEE80211_3ADDR_LEN 24 45#define IEEE80211_3ADDR_LEN 24
62#define IEEE80211_4ADDR_LEN 30 46#define IEEE80211_4ADDR_LEN 30
63#define IEEE80211_FCS_LEN 4 47#define IEEE80211_FCS_LEN 4
48#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN)
49#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
64 50
65#define MIN_FRAG_THRESHOLD 256U 51#define MIN_FRAG_THRESHOLD 256U
66#define MAX_FRAG_THRESHOLD 2346U 52#define MAX_FRAG_THRESHOLD 2346U
@@ -113,11 +99,11 @@ struct ieee80211_hdr_3addr {
113#define IEEE80211_STYPE_CFACK 0x0050 99#define IEEE80211_STYPE_CFACK 0x0050
114#define IEEE80211_STYPE_CFPOLL 0x0060 100#define IEEE80211_STYPE_CFPOLL 0x0060
115#define IEEE80211_STYPE_CFACKPOLL 0x0070 101#define IEEE80211_STYPE_CFACKPOLL 0x0070
102#define IEEE80211_STYPE_QOS_DATA 0x0080
116 103
117#define IEEE80211_SCTL_FRAG 0x000F 104#define IEEE80211_SCTL_FRAG 0x000F
118#define IEEE80211_SCTL_SEQ 0xFFF0 105#define IEEE80211_SCTL_SEQ 0xFFF0
119 106
120
121/* debug macros */ 107/* debug macros */
122 108
123#ifdef CONFIG_IEEE80211_DEBUG 109#ifdef CONFIG_IEEE80211_DEBUG
@@ -128,8 +114,7 @@ do { if (ieee80211_debug_level & (level)) \
128 in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) 114 in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
129#else 115#else
130#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) 116#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
131#endif /* CONFIG_IEEE80211_DEBUG */ 117#endif /* CONFIG_IEEE80211_DEBUG */
132
133 118
134/* debug macros not dependent on CONFIG_IEEE80211_DEBUG */ 119/* debug macros not dependent on CONFIG_IEEE80211_DEBUG */
135 120
@@ -140,7 +125,6 @@ do { if (ieee80211_debug_level & (level)) \
140 * messages. It should never be used for passing essid to user space. */ 125 * messages. It should never be used for passing essid to user space. */
141const char *escape_essid(const char *essid, u8 essid_len); 126const char *escape_essid(const char *essid, u8 essid_len);
142 127
143
144/* 128/*
145 * To use the debug system: 129 * To use the debug system:
146 * 130 *
@@ -177,6 +161,7 @@ const char *escape_essid(const char *essid, u8 essid_len);
177 161
178#define IEEE80211_DL_TX (1<<8) 162#define IEEE80211_DL_TX (1<<8)
179#define IEEE80211_DL_RX (1<<9) 163#define IEEE80211_DL_RX (1<<9)
164#define IEEE80211_DL_QOS (1<<31)
180 165
181#define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a) 166#define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a)
182#define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a) 167#define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a)
@@ -190,9 +175,10 @@ const char *escape_essid(const char *essid, u8 essid_len);
190#define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a) 175#define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a)
191#define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a) 176#define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a)
192#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a) 177#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a)
178#define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a)
193#include <linux/netdevice.h> 179#include <linux/netdevice.h>
194#include <linux/wireless.h> 180#include <linux/wireless.h>
195#include <linux/if_arp.h> /* ARPHRD_ETHER */ 181#include <linux/if_arp.h> /* ARPHRD_ETHER */
196 182
197#ifndef WIRELESS_SPY 183#ifndef WIRELESS_SPY
198#define WIRELESS_SPY /* enable iwspy support */ 184#define WIRELESS_SPY /* enable iwspy support */
@@ -200,10 +186,10 @@ const char *escape_essid(const char *essid, u8 essid_len);
200#include <net/iw_handler.h> /* new driver API */ 186#include <net/iw_handler.h> /* new driver API */
201 187
202#ifndef ETH_P_PAE 188#ifndef ETH_P_PAE
203#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ 189#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
204#endif /* ETH_P_PAE */ 190#endif /* ETH_P_PAE */
205 191
206#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */ 192#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */
207 193
208#ifndef ETH_P_80211_RAW 194#ifndef ETH_P_80211_RAW
209#define ETH_P_80211_RAW (ETH_P_ECONET + 1) 195#define ETH_P_80211_RAW (ETH_P_ECONET + 1)
@@ -215,10 +201,10 @@ const char *escape_essid(const char *essid, u8 essid_len);
215 201
216struct ieee80211_snap_hdr { 202struct ieee80211_snap_hdr {
217 203
218 u8 dsap; /* always 0xAA */ 204 u8 dsap; /* always 0xAA */
219 u8 ssap; /* always 0xAA */ 205 u8 ssap; /* always 0xAA */
220 u8 ctrl; /* always 0x03 */ 206 u8 ctrl; /* always 0x03 */
221 u8 oui[P80211_OUI_LEN]; /* organizational universal id */ 207 u8 oui[P80211_OUI_LEN]; /* organizational universal id */
222 208
223} __attribute__ ((packed)); 209} __attribute__ ((packed));
224 210
@@ -246,8 +232,9 @@ struct ieee80211_snap_hdr {
246#define WLAN_CAPABILITY_PBCC (1<<6) 232#define WLAN_CAPABILITY_PBCC (1<<6)
247#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) 233#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
248#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) 234#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
235#define WLAN_CAPABILITY_QOS (1<<9)
249#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) 236#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
250#define WLAN_CAPABILITY_OSSS_OFDM (1<<13) 237#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
251 238
252/* Status codes */ 239/* Status codes */
253enum ieee80211_statuscode { 240enum ieee80211_statuscode {
@@ -312,14 +299,12 @@ enum ieee80211_reasoncode {
312 WLAN_REASON_CIPHER_SUITE_REJECTED = 24, 299 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
313}; 300};
314 301
315
316#define IEEE80211_STATMASK_SIGNAL (1<<0) 302#define IEEE80211_STATMASK_SIGNAL (1<<0)
317#define IEEE80211_STATMASK_RSSI (1<<1) 303#define IEEE80211_STATMASK_RSSI (1<<1)
318#define IEEE80211_STATMASK_NOISE (1<<2) 304#define IEEE80211_STATMASK_NOISE (1<<2)
319#define IEEE80211_STATMASK_RATE (1<<3) 305#define IEEE80211_STATMASK_RATE (1<<3)
320#define IEEE80211_STATMASK_WEMASK 0x7 306#define IEEE80211_STATMASK_WEMASK 0x7
321 307
322
323#define IEEE80211_CCK_MODULATION (1<<0) 308#define IEEE80211_CCK_MODULATION (1<<0)
324#define IEEE80211_OFDM_MODULATION (1<<1) 309#define IEEE80211_OFDM_MODULATION (1<<1)
325 310
@@ -377,9 +362,6 @@ enum ieee80211_reasoncode {
377#define IEEE80211_NUM_CCK_RATES 4 362#define IEEE80211_NUM_CCK_RATES 4
378#define IEEE80211_OFDM_SHIFT_MASK_A 4 363#define IEEE80211_OFDM_SHIFT_MASK_A 4
379 364
380
381
382
383/* NOTE: This data is for statistical purposes; not all hardware provides this 365/* NOTE: This data is for statistical purposes; not all hardware provides this
384 * information for frames received. Not setting these will not cause 366 * information for frames received. Not setting these will not cause
385 * any adverse affects. */ 367 * any adverse affects. */
@@ -388,7 +370,7 @@ struct ieee80211_rx_stats {
388 s8 rssi; 370 s8 rssi;
389 u8 signal; 371 u8 signal;
390 u8 noise; 372 u8 noise;
391 u16 rate; /* in 100 kbps */ 373 u16 rate; /* in 100 kbps */
392 u8 received_channel; 374 u8 received_channel;
393 u8 control; 375 u8 control;
394 u8 mask; 376 u8 mask;
@@ -439,38 +421,44 @@ struct ieee80211_device;
439 421
440#include "ieee80211_crypt.h" 422#include "ieee80211_crypt.h"
441 423
442#define SEC_KEY_1 (1<<0) 424#define SEC_KEY_1 (1<<0)
443#define SEC_KEY_2 (1<<1) 425#define SEC_KEY_2 (1<<1)
444#define SEC_KEY_3 (1<<2) 426#define SEC_KEY_3 (1<<2)
445#define SEC_KEY_4 (1<<3) 427#define SEC_KEY_4 (1<<3)
446#define SEC_ACTIVE_KEY (1<<4) 428#define SEC_ACTIVE_KEY (1<<4)
447#define SEC_AUTH_MODE (1<<5) 429#define SEC_AUTH_MODE (1<<5)
448#define SEC_UNICAST_GROUP (1<<6) 430#define SEC_UNICAST_GROUP (1<<6)
449#define SEC_LEVEL (1<<7) 431#define SEC_LEVEL (1<<7)
450#define SEC_ENABLED (1<<8) 432#define SEC_ENABLED (1<<8)
451 433#define SEC_ENCRYPT (1<<9)
452#define SEC_LEVEL_0 0 /* None */ 434
453#define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */ 435#define SEC_LEVEL_0 0 /* None */
454#define SEC_LEVEL_2 2 /* Level 1 + TKIP */ 436#define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */
455#define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */ 437#define SEC_LEVEL_2 2 /* Level 1 + TKIP */
456#define SEC_LEVEL_3 4 /* Level 2 + CCMP */ 438#define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */
457 439#define SEC_LEVEL_3 4 /* Level 2 + CCMP */
458#define WEP_KEYS 4 440
459#define WEP_KEY_LEN 13 441#define SEC_ALG_NONE 0
442#define SEC_ALG_WEP 1
443#define SEC_ALG_TKIP 2
444#define SEC_ALG_CCMP 3
445
446#define WEP_KEYS 4
447#define WEP_KEY_LEN 13
448#define SCM_KEY_LEN 32
449#define SCM_TEMPORAL_KEY_LENGTH 16
460 450
461struct ieee80211_security { 451struct ieee80211_security {
462 u16 active_key:2, 452 u16 active_key:2,
463 enabled:1, 453 enabled:1,
464 auth_mode:2, 454 auth_mode:2, auth_algo:4, unicast_uses_group:1, encrypt:1;
465 auth_algo:4, 455 u8 encode_alg[WEP_KEYS];
466 unicast_uses_group:1;
467 u8 key_sizes[WEP_KEYS]; 456 u8 key_sizes[WEP_KEYS];
468 u8 keys[WEP_KEYS][WEP_KEY_LEN]; 457 u8 keys[WEP_KEYS][SCM_KEY_LEN];
469 u8 level; 458 u8 level;
470 u16 flags; 459 u16 flags;
471} __attribute__ ((packed)); 460} __attribute__ ((packed));
472 461
473
474/* 462/*
475 463
476 802.11 data frame from AP 464 802.11 data frame from AP
@@ -494,7 +482,7 @@ enum ieee80211_mfie {
494 MFIE_TYPE_RATES = 1, 482 MFIE_TYPE_RATES = 1,
495 MFIE_TYPE_FH_SET = 2, 483 MFIE_TYPE_FH_SET = 2,
496 MFIE_TYPE_DS_SET = 3, 484 MFIE_TYPE_DS_SET = 3,
497 MFIE_TYPE_CF_SET = 4, 485 MFIE_TYPE_CF_SET = 4,
498 MFIE_TYPE_TIM = 5, 486 MFIE_TYPE_TIM = 5,
499 MFIE_TYPE_IBSS_SET = 6, 487 MFIE_TYPE_IBSS_SET = 6,
500 MFIE_TYPE_COUNTRY = 7, 488 MFIE_TYPE_COUNTRY = 7,
@@ -516,11 +504,75 @@ enum ieee80211_mfie {
516 MFIE_TYPE_RSN = 48, 504 MFIE_TYPE_RSN = 48,
517 MFIE_TYPE_RATES_EX = 50, 505 MFIE_TYPE_RATES_EX = 50,
518 MFIE_TYPE_GENERIC = 221, 506 MFIE_TYPE_GENERIC = 221,
507 MFIE_TYPE_QOS_PARAMETER = 222,
519}; 508};
520 509
521struct ieee80211_info_element_hdr { 510/* Minimal header; can be used for passing 802.11 frames with sufficient
522 u8 id; 511 * information to determine what type of underlying data type is actually
523 u8 len; 512 * stored in the data. */
513struct ieee80211_hdr {
514 __le16 frame_ctl;
515 __le16 duration_id;
516 u8 payload[0];
517} __attribute__ ((packed));
518
519struct ieee80211_hdr_1addr {
520 __le16 frame_ctl;
521 __le16 duration_id;
522 u8 addr1[ETH_ALEN];
523 u8 payload[0];
524} __attribute__ ((packed));
525
526struct ieee80211_hdr_2addr {
527 __le16 frame_ctl;
528 __le16 duration_id;
529 u8 addr1[ETH_ALEN];
530 u8 addr2[ETH_ALEN];
531 u8 payload[0];
532} __attribute__ ((packed));
533
534struct ieee80211_hdr_3addr {
535 __le16 frame_ctl;
536 __le16 duration_id;
537 u8 addr1[ETH_ALEN];
538 u8 addr2[ETH_ALEN];
539 u8 addr3[ETH_ALEN];
540 __le16 seq_ctl;
541 u8 payload[0];
542} __attribute__ ((packed));
543
544struct ieee80211_hdr_4addr {
545 __le16 frame_ctl;
546 __le16 duration_id;
547 u8 addr1[ETH_ALEN];
548 u8 addr2[ETH_ALEN];
549 u8 addr3[ETH_ALEN];
550 __le16 seq_ctl;
551 u8 addr4[ETH_ALEN];
552 u8 payload[0];
553} __attribute__ ((packed));
554
555struct ieee80211_hdr_3addrqos {
556 __le16 frame_ctl;
557 __le16 duration_id;
558 u8 addr1[ETH_ALEN];
559 u8 addr2[ETH_ALEN];
560 u8 addr3[ETH_ALEN];
561 __le16 seq_ctl;
562 u8 payload[0];
563 __le16 qos_ctl;
564} __attribute__ ((packed));
565
566struct ieee80211_hdr_4addrqos {
567 __le16 frame_ctl;
568 __le16 duration_id;
569 u8 addr1[ETH_ALEN];
570 u8 addr2[ETH_ALEN];
571 u8 addr3[ETH_ALEN];
572 __le16 seq_ctl;
573 u8 addr4[ETH_ALEN];
574 u8 payload[0];
575 __le16 qos_ctl;
524} __attribute__ ((packed)); 576} __attribute__ ((packed));
525 577
526struct ieee80211_info_element { 578struct ieee80211_info_element {
@@ -546,49 +598,77 @@ struct ieee80211_info_element {
546 u16 status; 598 u16 status;
547*/ 599*/
548 600
549struct ieee80211_authentication { 601struct ieee80211_auth {
550 struct ieee80211_hdr_3addr header; 602 struct ieee80211_hdr_3addr header;
551 __le16 algorithm; 603 __le16 algorithm;
552 __le16 transaction; 604 __le16 transaction;
553 __le16 status; 605 __le16 status;
554 struct ieee80211_info_element info_element; 606 /* challenge */
607 struct ieee80211_info_element info_element[0];
555} __attribute__ ((packed)); 608} __attribute__ ((packed));
556 609
610struct ieee80211_disassoc {
611 struct ieee80211_hdr_3addr header;
612 __le16 reason;
613} __attribute__ ((packed));
614
615/* Alias deauth for disassoc */
616#define ieee80211_deauth ieee80211_disassoc
617
618struct ieee80211_probe_request {
619 struct ieee80211_hdr_3addr header;
620 /* SSID, supported rates */
621 struct ieee80211_info_element info_element[0];
622} __attribute__ ((packed));
557 623
558struct ieee80211_probe_response { 624struct ieee80211_probe_response {
559 struct ieee80211_hdr_3addr header; 625 struct ieee80211_hdr_3addr header;
560 u32 time_stamp[2]; 626 u32 time_stamp[2];
561 __le16 beacon_interval; 627 __le16 beacon_interval;
562 __le16 capability; 628 __le16 capability;
563 struct ieee80211_info_element info_element; 629 /* SSID, supported rates, FH params, DS params,
630 * CF params, IBSS params, TIM (if beacon), RSN */
631 struct ieee80211_info_element info_element[0];
564} __attribute__ ((packed)); 632} __attribute__ ((packed));
565 633
566struct ieee80211_assoc_request_frame { 634/* Alias beacon for probe_response */
635#define ieee80211_beacon ieee80211_probe_response
636
637struct ieee80211_assoc_request {
638 struct ieee80211_hdr_3addr header;
639 __le16 capability;
640 __le16 listen_interval;
641 /* SSID, supported rates, RSN */
642 struct ieee80211_info_element info_element[0];
643} __attribute__ ((packed));
644
645struct ieee80211_reassoc_request {
646 struct ieee80211_hdr_3addr header;
567 __le16 capability; 647 __le16 capability;
568 __le16 listen_interval; 648 __le16 listen_interval;
569 u8 current_ap[ETH_ALEN]; 649 u8 current_ap[ETH_ALEN];
570 struct ieee80211_info_element info_element; 650 struct ieee80211_info_element info_element[0];
571} __attribute__ ((packed)); 651} __attribute__ ((packed));
572 652
573struct ieee80211_assoc_response_frame { 653struct ieee80211_assoc_response {
574 struct ieee80211_hdr_3addr header; 654 struct ieee80211_hdr_3addr header;
575 __le16 capability; 655 __le16 capability;
576 __le16 status; 656 __le16 status;
577 __le16 aid; 657 __le16 aid;
578 struct ieee80211_info_element info_element; /* supported rates */ 658 /* supported rates */
659 struct ieee80211_info_element info_element[0];
579} __attribute__ ((packed)); 660} __attribute__ ((packed));
580 661
581
582struct ieee80211_txb { 662struct ieee80211_txb {
583 u8 nr_frags; 663 u8 nr_frags;
584 u8 encrypted; 664 u8 encrypted;
585 u16 reserved; 665 u8 rts_included;
586 u16 frag_size; 666 u8 reserved;
587 u16 payload_size; 667 __le16 frag_size;
668 __le16 payload_size;
588 struct sk_buff *fragments[0]; 669 struct sk_buff *fragments[0];
589}; 670};
590 671
591
592/* SWEEP TABLE ENTRIES NUMBER */ 672/* SWEEP TABLE ENTRIES NUMBER */
593#define MAX_SWEEP_TAB_ENTRIES 42 673#define MAX_SWEEP_TAB_ENTRIES 42
594#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 674#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7
@@ -604,9 +684,68 @@ struct ieee80211_txb {
604 684
605#define MAX_WPA_IE_LEN 64 685#define MAX_WPA_IE_LEN 64
606 686
607#define NETWORK_EMPTY_ESSID (1<<0) 687#define NETWORK_EMPTY_ESSID (1<<0)
608#define NETWORK_HAS_OFDM (1<<1) 688#define NETWORK_HAS_OFDM (1<<1)
609#define NETWORK_HAS_CCK (1<<2) 689#define NETWORK_HAS_CCK (1<<2)
690
691/* QoS structure */
692#define NETWORK_HAS_QOS_PARAMETERS (1<<3)
693#define NETWORK_HAS_QOS_INFORMATION (1<<4)
694#define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | NETWORK_HAS_QOS_INFORMATION)
695
696#define QOS_QUEUE_NUM 4
697#define QOS_OUI_LEN 3
698#define QOS_OUI_TYPE 2
699#define QOS_ELEMENT_ID 221
700#define QOS_OUI_INFO_SUB_TYPE 0
701#define QOS_OUI_PARAM_SUB_TYPE 1
702#define QOS_VERSION_1 1
703#define QOS_AIFSN_MIN_VALUE 2
704
705struct ieee80211_qos_information_element {
706 u8 elementID;
707 u8 length;
708 u8 qui[QOS_OUI_LEN];
709 u8 qui_type;
710 u8 qui_subtype;
711 u8 version;
712 u8 ac_info;
713} __attribute__ ((packed));
714
715struct ieee80211_qos_ac_parameter {
716 u8 aci_aifsn;
717 u8 ecw_min_max;
718 __le16 tx_op_limit;
719} __attribute__ ((packed));
720
721struct ieee80211_qos_parameter_info {
722 struct ieee80211_qos_information_element info_element;
723 u8 reserved;
724 struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
725} __attribute__ ((packed));
726
727struct ieee80211_qos_parameters {
728 __le16 cw_min[QOS_QUEUE_NUM];
729 __le16 cw_max[QOS_QUEUE_NUM];
730 u8 aifs[QOS_QUEUE_NUM];
731 u8 flag[QOS_QUEUE_NUM];
732 __le16 tx_op_limit[QOS_QUEUE_NUM];
733} __attribute__ ((packed));
734
735struct ieee80211_qos_data {
736 struct ieee80211_qos_parameters parameters;
737 int active;
738 int supported;
739 u8 param_count;
740 u8 old_param_count;
741};
742
743struct ieee80211_tim_parameters {
744 u8 tim_count;
745 u8 tim_period;
746} __attribute__ ((packed));
747
748/*******************************************************/
610 749
611struct ieee80211_network { 750struct ieee80211_network {
612 /* These entries are used to identify a unique network */ 751 /* These entries are used to identify a unique network */
@@ -616,6 +755,8 @@ struct ieee80211_network {
616 u8 ssid[IW_ESSID_MAX_SIZE + 1]; 755 u8 ssid[IW_ESSID_MAX_SIZE + 1];
617 u8 ssid_len; 756 u8 ssid_len;
618 757
758 struct ieee80211_qos_data qos_data;
759
619 /* These are network statistics */ 760 /* These are network statistics */
620 struct ieee80211_rx_stats stats; 761 struct ieee80211_rx_stats stats;
621 u16 capability; 762 u16 capability;
@@ -631,10 +772,12 @@ struct ieee80211_network {
631 u16 beacon_interval; 772 u16 beacon_interval;
632 u16 listen_interval; 773 u16 listen_interval;
633 u16 atim_window; 774 u16 atim_window;
775 u8 erp_value;
634 u8 wpa_ie[MAX_WPA_IE_LEN]; 776 u8 wpa_ie[MAX_WPA_IE_LEN];
635 size_t wpa_ie_len; 777 size_t wpa_ie_len;
636 u8 rsn_ie[MAX_WPA_IE_LEN]; 778 u8 rsn_ie[MAX_WPA_IE_LEN];
637 size_t rsn_ie_len; 779 size_t rsn_ie_len;
780 struct ieee80211_tim_parameters tim;
638 struct list_head list; 781 struct list_head list;
639}; 782};
640 783
@@ -651,17 +794,52 @@ enum ieee80211_state {
651#define DEFAULT_MAX_SCAN_AGE (15 * HZ) 794#define DEFAULT_MAX_SCAN_AGE (15 * HZ)
652#define DEFAULT_FTS 2346 795#define DEFAULT_FTS 2346
653 796
654
655#define CFG_IEEE80211_RESERVE_FCS (1<<0) 797#define CFG_IEEE80211_RESERVE_FCS (1<<0)
656#define CFG_IEEE80211_COMPUTE_FCS (1<<1) 798#define CFG_IEEE80211_COMPUTE_FCS (1<<1)
799#define CFG_IEEE80211_RTS (1<<2)
800
801#define IEEE80211_24GHZ_MIN_CHANNEL 1
802#define IEEE80211_24GHZ_MAX_CHANNEL 14
803#define IEEE80211_24GHZ_CHANNELS 14
804
805#define IEEE80211_52GHZ_MIN_CHANNEL 36
806#define IEEE80211_52GHZ_MAX_CHANNEL 165
807#define IEEE80211_52GHZ_CHANNELS 32
808
809enum {
810 IEEE80211_CH_PASSIVE_ONLY = (1 << 0),
811 IEEE80211_CH_B_ONLY = (1 << 2),
812 IEEE80211_CH_NO_IBSS = (1 << 3),
813 IEEE80211_CH_UNIFORM_SPREADING = (1 << 4),
814 IEEE80211_CH_RADAR_DETECT = (1 << 5),
815 IEEE80211_CH_INVALID = (1 << 6),
816};
817
818struct ieee80211_channel {
819 u32 freq;
820 u8 channel;
821 u8 flags;
822 u8 max_power;
823};
824
825struct ieee80211_geo {
826 u8 name[4];
827 u8 bg_channels;
828 u8 a_channels;
829 struct ieee80211_channel bg[IEEE80211_24GHZ_CHANNELS];
830 struct ieee80211_channel a[IEEE80211_52GHZ_CHANNELS];
831};
657 832
658struct ieee80211_device { 833struct ieee80211_device {
659 struct net_device *dev; 834 struct net_device *dev;
835 struct ieee80211_security sec;
660 836
661 /* Bookkeeping structures */ 837 /* Bookkeeping structures */
662 struct net_device_stats stats; 838 struct net_device_stats stats;
663 struct ieee80211_stats ieee_stats; 839 struct ieee80211_stats ieee_stats;
664 840
841 struct ieee80211_geo geo;
842
665 /* Probe / Beacon management */ 843 /* Probe / Beacon management */
666 struct list_head network_free_list; 844 struct list_head network_free_list;
667 struct list_head network_list; 845 struct list_head network_list;
@@ -669,62 +847,102 @@ struct ieee80211_device {
669 int scans; 847 int scans;
670 int scan_age; 848 int scan_age;
671 849
672 int iw_mode; /* operating mode (IW_MODE_*) */ 850 int iw_mode; /* operating mode (IW_MODE_*) */
851 struct iw_spy_data spy_data; /* iwspy support */
673 852
674 spinlock_t lock; 853 spinlock_t lock;
675 854
676 int tx_headroom; /* Set to size of any additional room needed at front 855 int tx_headroom; /* Set to size of any additional room needed at front
677 * of allocated Tx SKBs */ 856 * of allocated Tx SKBs */
678 u32 config; 857 u32 config;
679 858
680 /* WEP and other encryption related settings at the device level */ 859 /* WEP and other encryption related settings at the device level */
681 int open_wep; /* Set to 1 to allow unencrypted frames */ 860 int open_wep; /* Set to 1 to allow unencrypted frames */
682 861
683 int reset_on_keychange; /* Set to 1 if the HW needs to be reset on 862 int reset_on_keychange; /* Set to 1 if the HW needs to be reset on
684 * WEP key changes */ 863 * WEP key changes */
685 864
686 /* If the host performs {en,de}cryption, then set to 1 */ 865 /* If the host performs {en,de}cryption, then set to 1 */
687 int host_encrypt; 866 int host_encrypt;
867 int host_encrypt_msdu;
688 int host_decrypt; 868 int host_decrypt;
689 int ieee802_1x; /* is IEEE 802.1X used */ 869 /* host performs multicast decryption */
870 int host_mc_decrypt;
871
872 int host_open_frag;
873 int host_build_iv;
874 int ieee802_1x; /* is IEEE 802.1X used */
690 875
691 /* WPA data */ 876 /* WPA data */
692 int wpa_enabled; 877 int wpa_enabled;
693 int drop_unencrypted; 878 int drop_unencrypted;
694 int tkip_countermeasures;
695 int privacy_invoked; 879 int privacy_invoked;
696 size_t wpa_ie_len; 880 size_t wpa_ie_len;
697 u8 *wpa_ie; 881 u8 *wpa_ie;
698 882
699 struct list_head crypt_deinit_list; 883 struct list_head crypt_deinit_list;
700 struct ieee80211_crypt_data *crypt[WEP_KEYS]; 884 struct ieee80211_crypt_data *crypt[WEP_KEYS];
701 int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ 885 int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */
702 struct timer_list crypt_deinit_timer; 886 struct timer_list crypt_deinit_timer;
887 int crypt_quiesced;
703 888
704 int bcrx_sta_key; /* use individual keys to override default keys even 889 int bcrx_sta_key; /* use individual keys to override default keys even
705 * with RX of broad/multicast frames */ 890 * with RX of broad/multicast frames */
706 891
707 /* Fragmentation structures */ 892 /* Fragmentation structures */
708 struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN]; 893 struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN];
709 unsigned int frag_next_idx; 894 unsigned int frag_next_idx;
710 u16 fts; /* Fragmentation Threshold */ 895 u16 fts; /* Fragmentation Threshold */
896 u16 rts; /* RTS threshold */
711 897
712 /* Association info */ 898 /* Association info */
713 u8 bssid[ETH_ALEN]; 899 u8 bssid[ETH_ALEN];
714 900
715 enum ieee80211_state state; 901 enum ieee80211_state state;
716 902
717 int mode; /* A, B, G */ 903 int mode; /* A, B, G */
718 int modulation; /* CCK, OFDM */ 904 int modulation; /* CCK, OFDM */
719 int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */ 905 int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */
720 int abg_ture; /* ABG flag */ 906 int abg_true; /* ABG flag */
907
908 int perfect_rssi;
909 int worst_rssi;
721 910
722 /* Callback functions */ 911 /* Callback functions */
723 void (*set_security)(struct net_device *dev, 912 void (*set_security) (struct net_device * dev,
724 struct ieee80211_security *sec); 913 struct ieee80211_security * sec);
725 int (*hard_start_xmit)(struct ieee80211_txb *txb, 914 int (*hard_start_xmit) (struct ieee80211_txb * txb,
726 struct net_device *dev); 915 struct net_device * dev, int pri);
727 int (*reset_port)(struct net_device *dev); 916 int (*reset_port) (struct net_device * dev);
917 int (*is_queue_full) (struct net_device * dev, int pri);
918
919 int (*handle_management) (struct net_device * dev,
920 struct ieee80211_network * network, u16 type);
921
922 /* Typical STA methods */
923 int (*handle_auth) (struct net_device * dev,
924 struct ieee80211_auth * auth);
925 int (*handle_deauth) (struct net_device * dev,
926 struct ieee80211_auth * auth);
927 int (*handle_disassoc) (struct net_device * dev,
928 struct ieee80211_disassoc * assoc);
929 int (*handle_beacon) (struct net_device * dev,
930 struct ieee80211_beacon * beacon,
931 struct ieee80211_network * network);
932 int (*handle_probe_response) (struct net_device * dev,
933 struct ieee80211_probe_response * resp,
934 struct ieee80211_network * network);
935 int (*handle_probe_request) (struct net_device * dev,
936 struct ieee80211_probe_request * req,
937 struct ieee80211_rx_stats * stats);
938 int (*handle_assoc_response) (struct net_device * dev,
939 struct ieee80211_assoc_response * resp,
940 struct ieee80211_network * network);
941
942 /* Typical AP methods */
943 int (*handle_assoc_request) (struct net_device * dev);
944 int (*handle_reassoc_request) (struct net_device * dev,
945 struct ieee80211_reassoc_request * req);
728 946
729 /* This must be the last item so that it points to the data 947 /* This must be the last item so that it points to the data
730 * allocated beyond this structure by alloc_ieee80211 */ 948 * allocated beyond this structure by alloc_ieee80211 */
@@ -736,12 +954,12 @@ struct ieee80211_device {
736#define IEEE_G (1<<2) 954#define IEEE_G (1<<2)
737#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) 955#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G)
738 956
739extern inline void *ieee80211_priv(struct net_device *dev) 957static inline void *ieee80211_priv(struct net_device *dev)
740{ 958{
741 return ((struct ieee80211_device *)netdev_priv(dev))->priv; 959 return ((struct ieee80211_device *)netdev_priv(dev))->priv;
742} 960}
743 961
744extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) 962static inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
745{ 963{
746 /* Single white space is for Linksys APs */ 964 /* Single white space is for Linksys APs */
747 if (essid_len == 1 && essid[0] == ' ') 965 if (essid_len == 1 && essid[0] == ' ')
@@ -757,7 +975,8 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
757 return 1; 975 return 1;
758} 976}
759 977
760extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode) 978static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee,
979 int mode)
761{ 980{
762 /* 981 /*
763 * It is possible for both access points and our device to support 982 * It is possible for both access points and our device to support
@@ -783,14 +1002,17 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mod
783 return 0; 1002 return 0;
784} 1003}
785 1004
786extern inline int ieee80211_get_hdrlen(u16 fc) 1005static inline int ieee80211_get_hdrlen(u16 fc)
787{ 1006{
788 int hdrlen = IEEE80211_3ADDR_LEN; 1007 int hdrlen = IEEE80211_3ADDR_LEN;
1008 u16 stype = WLAN_FC_GET_STYPE(fc);
789 1009
790 switch (WLAN_FC_GET_TYPE(fc)) { 1010 switch (WLAN_FC_GET_TYPE(fc)) {
791 case IEEE80211_FTYPE_DATA: 1011 case IEEE80211_FTYPE_DATA:
792 if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) 1012 if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))
793 hdrlen = IEEE80211_4ADDR_LEN; 1013 hdrlen = IEEE80211_4ADDR_LEN;
1014 if (stype & IEEE80211_STYPE_QOS_DATA)
1015 hdrlen += 2;
794 break; 1016 break;
795 case IEEE80211_FTYPE_CTL: 1017 case IEEE80211_FTYPE_CTL:
796 switch (WLAN_FC_GET_STYPE(fc)) { 1018 switch (WLAN_FC_GET_STYPE(fc)) {
@@ -808,7 +1030,48 @@ extern inline int ieee80211_get_hdrlen(u16 fc)
808 return hdrlen; 1030 return hdrlen;
809} 1031}
810 1032
1033static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
1034{
1035 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) {
1036 case IEEE80211_1ADDR_LEN:
1037 return ((struct ieee80211_hdr_1addr *)hdr)->payload;
1038 case IEEE80211_2ADDR_LEN:
1039 return ((struct ieee80211_hdr_2addr *)hdr)->payload;
1040 case IEEE80211_3ADDR_LEN:
1041 return ((struct ieee80211_hdr_3addr *)hdr)->payload;
1042 case IEEE80211_4ADDR_LEN:
1043 return ((struct ieee80211_hdr_4addr *)hdr)->payload;
1044 }
1045
1046}
1047
1048static inline int ieee80211_is_ofdm_rate(u8 rate)
1049{
1050 switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
1051 case IEEE80211_OFDM_RATE_6MB:
1052 case IEEE80211_OFDM_RATE_9MB:
1053 case IEEE80211_OFDM_RATE_12MB:
1054 case IEEE80211_OFDM_RATE_18MB:
1055 case IEEE80211_OFDM_RATE_24MB:
1056 case IEEE80211_OFDM_RATE_36MB:
1057 case IEEE80211_OFDM_RATE_48MB:
1058 case IEEE80211_OFDM_RATE_54MB:
1059 return 1;
1060 }
1061 return 0;
1062}
811 1063
1064static inline int ieee80211_is_cck_rate(u8 rate)
1065{
1066 switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
1067 case IEEE80211_CCK_RATE_1MB:
1068 case IEEE80211_CCK_RATE_2MB:
1069 case IEEE80211_CCK_RATE_5MB:
1070 case IEEE80211_CCK_RATE_11MB:
1071 return 1;
1072 }
1073 return 0;
1074}
812 1075
813/* ieee80211.c */ 1076/* ieee80211.c */
814extern void free_ieee80211(struct net_device *dev); 1077extern void free_ieee80211(struct net_device *dev);
@@ -817,18 +1080,30 @@ extern struct net_device *alloc_ieee80211(int sizeof_priv);
817extern int ieee80211_set_encryption(struct ieee80211_device *ieee); 1080extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
818 1081
819/* ieee80211_tx.c */ 1082/* ieee80211_tx.c */
820extern int ieee80211_xmit(struct sk_buff *skb, 1083extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev);
821 struct net_device *dev);
822extern void ieee80211_txb_free(struct ieee80211_txb *); 1084extern void ieee80211_txb_free(struct ieee80211_txb *);
823 1085extern int ieee80211_tx_frame(struct ieee80211_device *ieee,
1086 struct ieee80211_hdr *frame, int len);
824 1087
825/* ieee80211_rx.c */ 1088/* ieee80211_rx.c */
826extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, 1089extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
827 struct ieee80211_rx_stats *rx_stats); 1090 struct ieee80211_rx_stats *rx_stats);
828extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, 1091extern void ieee80211_rx_mgt(struct ieee80211_device *ieee,
829 struct ieee80211_hdr *header, 1092 struct ieee80211_hdr_4addr *header,
830 struct ieee80211_rx_stats *stats); 1093 struct ieee80211_rx_stats *stats);
831 1094
1095/* ieee80211_geo.c */
1096extern const struct ieee80211_geo *ieee80211_get_geo(struct ieee80211_device
1097 *ieee);
1098extern int ieee80211_set_geo(struct ieee80211_device *ieee,
1099 const struct ieee80211_geo *geo);
1100
1101extern int ieee80211_is_valid_channel(struct ieee80211_device *ieee,
1102 u8 channel);
1103extern int ieee80211_channel_to_index(struct ieee80211_device *ieee,
1104 u8 channel);
1105extern u8 ieee80211_freq_to_channel(struct ieee80211_device *ieee, u32 freq);
1106
832/* ieee80211_wx.c */ 1107/* ieee80211_wx.c */
833extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, 1108extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
834 struct iw_request_info *info, 1109 struct iw_request_info *info,
@@ -839,17 +1114,21 @@ extern int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
839extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee, 1114extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
840 struct iw_request_info *info, 1115 struct iw_request_info *info,
841 union iwreq_data *wrqu, char *key); 1116 union iwreq_data *wrqu, char *key);
842 1117extern int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
843 1118 struct iw_request_info *info,
844extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee) 1119 union iwreq_data *wrqu, char *extra);
1120extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee,
1121 struct iw_request_info *info,
1122 union iwreq_data *wrqu, char *extra);
1123
1124static inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
845{ 1125{
846 ieee->scans++; 1126 ieee->scans++;
847} 1127}
848 1128
849extern inline int ieee80211_get_scans(struct ieee80211_device *ieee) 1129static inline int ieee80211_get_scans(struct ieee80211_device *ieee)
850{ 1130{
851 return ieee->scans; 1131 return ieee->scans;
852} 1132}
853 1133
854 1134#endif /* IEEE80211_H */
855#endif /* IEEE80211_H */
diff --git a/include/net/ieee80211_crypt.h b/include/net/ieee80211_crypt.h
index b58a3bcc0dc0..0a1c2d82ca4b 100644
--- a/include/net/ieee80211_crypt.h
+++ b/include/net/ieee80211_crypt.h
@@ -25,16 +25,22 @@
25 25
26#include <linux/skbuff.h> 26#include <linux/skbuff.h>
27 27
28enum {
29 IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0),
30};
31
28struct ieee80211_crypto_ops { 32struct ieee80211_crypto_ops {
29 const char *name; 33 const char *name;
30 34
31 /* init new crypto context (e.g., allocate private data space, 35 /* init new crypto context (e.g., allocate private data space,
32 * select IV, etc.); returns NULL on failure or pointer to allocated 36 * select IV, etc.); returns NULL on failure or pointer to allocated
33 * private data on success */ 37 * private data on success */
34 void * (*init)(int keyidx); 38 void *(*init) (int keyidx);
35 39
36 /* deinitialize crypto context and free allocated private data */ 40 /* deinitialize crypto context and free allocated private data */
37 void (*deinit)(void *priv); 41 void (*deinit) (void *priv);
42
43 int (*build_iv) (struct sk_buff * skb, int hdr_len, void *priv);
38 44
39 /* encrypt/decrypt return < 0 on error or >= 0 on success. The return 45 /* encrypt/decrypt return < 0 on error or >= 0 on success. The return
40 * value from decrypt_mpdu is passed as the keyidx value for 46 * value from decrypt_mpdu is passed as the keyidx value for
@@ -42,34 +48,39 @@ struct ieee80211_crypto_ops {
42 * encryption; if not, error will be returned; these functions are 48 * encryption; if not, error will be returned; these functions are
43 * called for all MPDUs (i.e., fragments). 49 * called for all MPDUs (i.e., fragments).
44 */ 50 */
45 int (*encrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); 51 int (*encrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv);
46 int (*decrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); 52 int (*decrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv);
47 53
48 /* These functions are called for full MSDUs, i.e. full frames. 54 /* These functions are called for full MSDUs, i.e. full frames.
49 * These can be NULL if full MSDU operations are not needed. */ 55 * These can be NULL if full MSDU operations are not needed. */
50 int (*encrypt_msdu)(struct sk_buff *skb, int hdr_len, void *priv); 56 int (*encrypt_msdu) (struct sk_buff * skb, int hdr_len, void *priv);
51 int (*decrypt_msdu)(struct sk_buff *skb, int keyidx, int hdr_len, 57 int (*decrypt_msdu) (struct sk_buff * skb, int keyidx, int hdr_len,
52 void *priv); 58 void *priv);
53 59
54 int (*set_key)(void *key, int len, u8 *seq, void *priv); 60 int (*set_key) (void *key, int len, u8 * seq, void *priv);
55 int (*get_key)(void *key, int len, u8 *seq, void *priv); 61 int (*get_key) (void *key, int len, u8 * seq, void *priv);
56 62
57 /* procfs handler for printing out key information and possible 63 /* procfs handler for printing out key information and possible
58 * statistics */ 64 * statistics */
59 char * (*print_stats)(char *p, void *priv); 65 char *(*print_stats) (char *p, void *priv);
66
67 /* Crypto specific flag get/set for configuration settings */
68 unsigned long (*get_flags) (void *priv);
69 unsigned long (*set_flags) (unsigned long flags, void *priv);
60 70
61 /* maximum number of bytes added by encryption; encrypt buf is 71 /* maximum number of bytes added by encryption; encrypt buf is
62 * allocated with extra_prefix_len bytes, copy of in_buf, and 72 * allocated with extra_prefix_len bytes, copy of in_buf, and
63 * extra_postfix_len; encrypt need not use all this space, but 73 * extra_postfix_len; encrypt need not use all this space, but
64 * the result must start at the beginning of the buffer and correct 74 * the result must start at the beginning of the buffer and correct
65 * length must be returned */ 75 * length must be returned */
66 int extra_prefix_len, extra_postfix_len; 76 int extra_mpdu_prefix_len, extra_mpdu_postfix_len;
77 int extra_msdu_prefix_len, extra_msdu_postfix_len;
67 78
68 struct module *owner; 79 struct module *owner;
69}; 80};
70 81
71struct ieee80211_crypt_data { 82struct ieee80211_crypt_data {
72 struct list_head list; /* delayed deletion list */ 83 struct list_head list; /* delayed deletion list */
73 struct ieee80211_crypto_ops *ops; 84 struct ieee80211_crypto_ops *ops;
74 void *priv; 85 void *priv;
75 atomic_t refcnt; 86 atomic_t refcnt;
@@ -77,10 +88,11 @@ struct ieee80211_crypt_data {
77 88
78int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops); 89int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops);
79int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops); 90int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops);
80struct ieee80211_crypto_ops * ieee80211_get_crypto_ops(const char *name); 91struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name);
81void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int); 92void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int);
82void ieee80211_crypt_deinit_handler(unsigned long); 93void ieee80211_crypt_deinit_handler(unsigned long);
83void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, 94void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee,
84 struct ieee80211_crypt_data **crypt); 95 struct ieee80211_crypt_data **crypt);
96void ieee80211_crypt_quiescing(struct ieee80211_device *ieee);
85 97
86#endif 98#endif
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
new file mode 100644
index 000000000000..429b73892a5f
--- /dev/null
+++ b/include/net/ieee80211_radiotap.h
@@ -0,0 +1,231 @@
1/* $FreeBSD: src/sys/net80211/ieee80211_radiotap.h,v 1.5 2005/01/22 20:12:05 sam Exp $ */
2/* $NetBSD: ieee80211_radiotap.h,v 1.11 2005/06/22 06:16:02 dyoung Exp $ */
3
4/*-
5 * Copyright (c) 2003, 2004 David Young. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of David Young may not be used to endorse or promote
16 * products derived from this software without specific prior
17 * written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY
20 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID
23 * YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
25 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
30 * OF SUCH DAMAGE.
31 */
32
33/*
34 * Modifications to fit into the linux IEEE 802.11 stack,
35 * Mike Kershaw (dragorn@kismetwireless.net)
36 */
37
38#ifndef IEEE80211RADIOTAP_H
39#define IEEE80211RADIOTAP_H
40
41#include <linux/if_ether.h>
42#include <linux/kernel.h>
43
44/* Radiotap header version (from official NetBSD feed) */
45#define IEEE80211RADIOTAP_VERSION "1.5"
46/* Base version of the radiotap packet header data */
47#define PKTHDR_RADIOTAP_VERSION 0
48
49/* A generic radio capture format is desirable. There is one for
50 * Linux, but it is neither rigidly defined (there were not even
51 * units given for some fields) nor easily extensible.
52 *
53 * I suggest the following extensible radio capture format. It is
54 * based on a bitmap indicating which fields are present.
55 *
56 * I am trying to describe precisely what the application programmer
57 * should expect in the following, and for that reason I tell the
58 * units and origin of each measurement (where it applies), or else I
59 * use sufficiently weaselly language ("is a monotonically nondecreasing
60 * function of...") that I cannot set false expectations for lawyerly
61 * readers.
62 */
63
64/* XXX tcpdump/libpcap do not tolerate variable-length headers,
65 * yet, so we pad every radiotap header to 64 bytes. Ugh.
66 */
67#define IEEE80211_RADIOTAP_HDRLEN 64
68
69/* The radio capture header precedes the 802.11 header. */
70struct ieee80211_radiotap_header {
71 u8 it_version; /* Version 0. Only increases
72 * for drastic changes,
73 * introduction of compatible
74 * new fields does not count.
75 */
76 u8 it_pad;
77 u16 it_len; /* length of the whole
78 * header in bytes, including
79 * it_version, it_pad,
80 * it_len, and data fields.
81 */
82 u32 it_present; /* A bitmap telling which
83 * fields are present. Set bit 31
84 * (0x80000000) to extend the
85 * bitmap by another 32 bits.
86 * Additional extensions are made
87 * by setting bit 31.
88 */
89};
90
91/* Name Data type Units
92 * ---- --------- -----
93 *
94 * IEEE80211_RADIOTAP_TSFT u64 microseconds
95 *
96 * Value in microseconds of the MAC's 64-bit 802.11 Time
97 * Synchronization Function timer when the first bit of the
98 * MPDU arrived at the MAC. For received frames, only.
99 *
100 * IEEE80211_RADIOTAP_CHANNEL 2 x u16 MHz, bitmap
101 *
102 * Tx/Rx frequency in MHz, followed by flags (see below).
103 *
104 * IEEE80211_RADIOTAP_FHSS u16 see below
105 *
106 * For frequency-hopping radios, the hop set (first byte)
107 * and pattern (second byte).
108 *
109 * IEEE80211_RADIOTAP_RATE u8 500kb/s
110 *
111 * Tx/Rx data rate
112 *
113 * IEEE80211_RADIOTAP_DBM_ANTSIGNAL int8_t decibels from
114 * one milliwatt (dBm)
115 *
116 * RF signal power at the antenna, decibel difference from
117 * one milliwatt.
118 *
119 * IEEE80211_RADIOTAP_DBM_ANTNOISE int8_t decibels from
120 * one milliwatt (dBm)
121 *
122 * RF noise power at the antenna, decibel difference from one
123 * milliwatt.
124 *
125 * IEEE80211_RADIOTAP_DB_ANTSIGNAL u8 decibel (dB)
126 *
127 * RF signal power at the antenna, decibel difference from an
128 * arbitrary, fixed reference.
129 *
130 * IEEE80211_RADIOTAP_DB_ANTNOISE u8 decibel (dB)
131 *
132 * RF noise power at the antenna, decibel difference from an
133 * arbitrary, fixed reference point.
134 *
135 * IEEE80211_RADIOTAP_LOCK_QUALITY u16 unitless
136 *
137 * Quality of Barker code lock. Unitless. Monotonically
138 * nondecreasing with "better" lock strength. Called "Signal
139 * Quality" in datasheets. (Is there a standard way to measure
140 * this?)
141 *
142 * IEEE80211_RADIOTAP_TX_ATTENUATION u16 unitless
143 *
144 * Transmit power expressed as unitless distance from max
145 * power set at factory calibration. 0 is max power.
146 * Monotonically nondecreasing with lower power levels.
147 *
148 * IEEE80211_RADIOTAP_DB_TX_ATTENUATION u16 decibels (dB)
149 *
150 * Transmit power expressed as decibel distance from max power
151 * set at factory calibration. 0 is max power. Monotonically
152 * nondecreasing with lower power levels.
153 *
154 * IEEE80211_RADIOTAP_DBM_TX_POWER int8_t decibels from
155 * one milliwatt (dBm)
156 *
157 * Transmit power expressed as dBm (decibels from a 1 milliwatt
158 * reference). This is the absolute power level measured at
159 * the antenna port.
160 *
161 * IEEE80211_RADIOTAP_FLAGS u8 bitmap
162 *
163 * Properties of transmitted and received frames. See flags
164 * defined below.
165 *
166 * IEEE80211_RADIOTAP_ANTENNA u8 antenna index
167 *
168 * Unitless indication of the Rx/Tx antenna for this packet.
169 * The first antenna is antenna 0.
170 *
171 * IEEE80211_RADIOTAP_FCS u32 data
172 *
173 * FCS from frame in network byte order.
174 */
175enum ieee80211_radiotap_type {
176 IEEE80211_RADIOTAP_TSFT = 0,
177 IEEE80211_RADIOTAP_FLAGS = 1,
178 IEEE80211_RADIOTAP_RATE = 2,
179 IEEE80211_RADIOTAP_CHANNEL = 3,
180 IEEE80211_RADIOTAP_FHSS = 4,
181 IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5,
182 IEEE80211_RADIOTAP_DBM_ANTNOISE = 6,
183 IEEE80211_RADIOTAP_LOCK_QUALITY = 7,
184 IEEE80211_RADIOTAP_TX_ATTENUATION = 8,
185 IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9,
186 IEEE80211_RADIOTAP_DBM_TX_POWER = 10,
187 IEEE80211_RADIOTAP_ANTENNA = 11,
188 IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12,
189 IEEE80211_RADIOTAP_DB_ANTNOISE = 13,
190 IEEE80211_RADIOTAP_EXT = 31,
191};
192
193/* Channel flags. */
194#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */
195#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */
196#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */
197#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */
198#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */
199#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */
200#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
201#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
202
203/* For IEEE80211_RADIOTAP_FLAGS */
204#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received
205 * during CFP
206 */
207#define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received
208 * with short
209 * preamble
210 */
211#define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received
212 * with WEP encryption
213 */
214#define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received
215 * with fragmentation
216 */
217#define IEEE80211_RADIOTAP_F_FCS 0x10 /* frame includes FCS */
218#define IEEE80211_RADIOTAP_F_DATAPAD 0x20 /* frame has padding between
219 * 802.11 header and payload
220 * (to 32-bit boundary)
221 */
222
223/* Ugly macro to convert literal channel numbers into their mhz equivalents
224 * There are certianly some conditions that will break this (like feeding it '30')
225 * but they shouldn't arise since nothing talks on channel 30. */
226#define ieee80211chan2mhz(x) \
227 (((x) <= 14) ? \
228 (((x) == 14) ? 2484 : ((x) * 5) + 2407) : \
229 ((x) + 1000) * 5)
230
231#endif /* IEEE80211_RADIOTAP_H */
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h
index f45c37d89cf7..c7a959428b4f 100644
--- a/include/net/llc_pdu.h
+++ b/include/net/llc_pdu.h
@@ -254,8 +254,10 @@ static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa)
254{ 254{
255 if (skb->protocol == ntohs(ETH_P_802_2)) 255 if (skb->protocol == ntohs(ETH_P_802_2))
256 memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); 256 memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN);
257 else if (skb->protocol == ntohs(ETH_P_TR_802_2)) 257 else if (skb->protocol == ntohs(ETH_P_TR_802_2)) {
258 memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN); 258 memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN);
259 *sa &= 0x7F;
260 }
259} 261}
260 262
261/** 263/**
diff --git a/include/net/netrom.h b/include/net/netrom.h
index a6bf6e0f606a..a5ee53bce62f 100644
--- a/include/net/netrom.h
+++ b/include/net/netrom.h
@@ -136,8 +136,7 @@ static __inline__ void nr_node_put(struct nr_node *nr_node)
136static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh) 136static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh)
137{ 137{
138 if (atomic_dec_and_test(&nr_neigh->refcount)) { 138 if (atomic_dec_and_test(&nr_neigh->refcount)) {
139 if (nr_neigh->digipeat != NULL) 139 kfree(nr_neigh->digipeat);
140 kfree(nr_neigh->digipeat);
141 kfree(nr_neigh); 140 kfree(nr_neigh);
142 } 141 }
143} 142}
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 1c5f19f995ad..f1c3bc54526a 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -171,10 +171,10 @@ struct sctp_sndrcvinfo {
171 */ 171 */
172 172
173enum sctp_sinfo_flags { 173enum sctp_sinfo_flags {
174 MSG_UNORDERED = 1, /* Send/receive message unordered. */ 174 SCTP_UNORDERED = 1, /* Send/receive message unordered. */
175 MSG_ADDR_OVER = 2, /* Override the primary destination. */ 175 SCTP_ADDR_OVER = 2, /* Override the primary destination. */
176 MSG_ABORT=4, /* Send an ABORT message to the peer. */ 176 SCTP_ABORT=4, /* Send an ABORT message to the peer. */
177 /* MSG_EOF is already defined per socket.h */ 177 SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */
178}; 178};
179 179
180 180
diff --git a/include/net/sock.h b/include/net/sock.h
index ecb75526cba0..e0498bd36004 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -207,7 +207,7 @@ struct sock {
207 struct sk_buff_head sk_write_queue; 207 struct sk_buff_head sk_write_queue;
208 int sk_wmem_queued; 208 int sk_wmem_queued;
209 int sk_forward_alloc; 209 int sk_forward_alloc;
210 unsigned int sk_allocation; 210 gfp_t sk_allocation;
211 int sk_sndbuf; 211 int sk_sndbuf;
212 int sk_route_caps; 212 int sk_route_caps;
213 unsigned long sk_flags; 213 unsigned long sk_flags;
diff --git a/include/net/syncppp.h b/include/net/syncppp.h
index 614cb6ba564e..877efa434700 100644
--- a/include/net/syncppp.h
+++ b/include/net/syncppp.h
@@ -86,7 +86,6 @@ static inline struct sppp *sppp_of(struct net_device *dev)
86 86
87void sppp_attach (struct ppp_device *pd); 87void sppp_attach (struct ppp_device *pd);
88void sppp_detach (struct net_device *dev); 88void sppp_detach (struct net_device *dev);
89void sppp_input (struct net_device *dev, struct sk_buff *m);
90int sppp_do_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd); 89int sppp_do_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd);
91struct sk_buff *sppp_dequeue (struct net_device *dev); 90struct sk_buff *sppp_dequeue (struct net_device *dev);
92int sppp_isempty (struct net_device *dev); 91int sppp_isempty (struct net_device *dev);
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h
index 5308683c8c41..0a9fcd59eb43 100644
--- a/include/rdma/ib_cm.h
+++ b/include/rdma/ib_cm.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2004 Intel Corporation. All rights reserved. 2 * Copyright (c) 2004, 2005 Intel Corporation. All rights reserved.
3 * Copyright (c) 2004 Topspin Corporation. All rights reserved. 3 * Copyright (c) 2004 Topspin Corporation. All rights reserved.
4 * Copyright (c) 2004 Voltaire Corporation. All rights reserved. 4 * Copyright (c) 2004 Voltaire Corporation. All rights reserved.
5 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. 5 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
@@ -109,7 +109,6 @@ struct ib_cm_id;
109 109
110struct ib_cm_req_event_param { 110struct ib_cm_req_event_param {
111 struct ib_cm_id *listen_id; 111 struct ib_cm_id *listen_id;
112 struct ib_device *device;
113 u8 port; 112 u8 port;
114 113
115 struct ib_sa_path_rec *primary_path; 114 struct ib_sa_path_rec *primary_path;
@@ -220,7 +219,6 @@ struct ib_cm_apr_event_param {
220 219
221struct ib_cm_sidr_req_event_param { 220struct ib_cm_sidr_req_event_param {
222 struct ib_cm_id *listen_id; 221 struct ib_cm_id *listen_id;
223 struct ib_device *device;
224 u8 port; 222 u8 port;
225 u16 pkey; 223 u16 pkey;
226}; 224};
@@ -284,6 +282,7 @@ typedef int (*ib_cm_handler)(struct ib_cm_id *cm_id,
284struct ib_cm_id { 282struct ib_cm_id {
285 ib_cm_handler cm_handler; 283 ib_cm_handler cm_handler;
286 void *context; 284 void *context;
285 struct ib_device *device;
287 __be64 service_id; 286 __be64 service_id;
288 __be64 service_mask; 287 __be64 service_mask;
289 enum ib_cm_state state; /* internal CM/debug use */ 288 enum ib_cm_state state; /* internal CM/debug use */
@@ -295,6 +294,8 @@ struct ib_cm_id {
295 294
296/** 295/**
297 * ib_create_cm_id - Allocate a communication identifier. 296 * ib_create_cm_id - Allocate a communication identifier.
297 * @device: Device associated with the cm_id. All related communication will
298 * be associated with the specified device.
298 * @cm_handler: Callback invoked to notify the user of CM events. 299 * @cm_handler: Callback invoked to notify the user of CM events.
299 * @context: User specified context associated with the communication 300 * @context: User specified context associated with the communication
300 * identifier. 301 * identifier.
@@ -302,7 +303,8 @@ struct ib_cm_id {
302 * Communication identifiers are used to track connection states, service 303 * Communication identifiers are used to track connection states, service
303 * ID resolution requests, and listen requests. 304 * ID resolution requests, and listen requests.
304 */ 305 */
305struct ib_cm_id *ib_create_cm_id(ib_cm_handler cm_handler, 306struct ib_cm_id *ib_create_cm_id(struct ib_device *device,
307 ib_cm_handler cm_handler,
306 void *context); 308 void *context);
307 309
308/** 310/**
diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h
index 4172e6841e3d..2c133506742b 100644
--- a/include/rdma/ib_mad.h
+++ b/include/rdma/ib_mad.h
@@ -109,10 +109,14 @@
109#define IB_QP_SET_QKEY 0x80000000 109#define IB_QP_SET_QKEY 0x80000000
110 110
111enum { 111enum {
112 IB_MGMT_MAD_HDR = 24,
112 IB_MGMT_MAD_DATA = 232, 113 IB_MGMT_MAD_DATA = 232,
114 IB_MGMT_RMPP_HDR = 36,
113 IB_MGMT_RMPP_DATA = 220, 115 IB_MGMT_RMPP_DATA = 220,
116 IB_MGMT_VENDOR_HDR = 40,
114 IB_MGMT_VENDOR_DATA = 216, 117 IB_MGMT_VENDOR_DATA = 216,
115 IB_MGMT_SA_DATA = 200 118 IB_MGMT_SA_HDR = 56,
119 IB_MGMT_SA_DATA = 200,
116}; 120};
117 121
118struct ib_mad_hdr { 122struct ib_mad_hdr {
@@ -203,26 +207,25 @@ struct ib_class_port_info
203 207
204/** 208/**
205 * ib_mad_send_buf - MAD data buffer and work request for sends. 209 * ib_mad_send_buf - MAD data buffer and work request for sends.
206 * @mad: References an allocated MAD data buffer. The size of the data 210 * @next: A pointer used to chain together MADs for posting.
207 * buffer is specified in the @send_wr.length field. 211 * @mad: References an allocated MAD data buffer.
208 * @mapping: DMA mapping information.
209 * @mad_agent: MAD agent that allocated the buffer. 212 * @mad_agent: MAD agent that allocated the buffer.
213 * @ah: The address handle to use when sending the MAD.
210 * @context: User-controlled context fields. 214 * @context: User-controlled context fields.
211 * @send_wr: An initialized work request structure used when sending the MAD. 215 * @timeout_ms: Time to wait for a response.
212 * The wr_id field of the work request is initialized to reference this 216 * @retries: Number of times to retry a request for a response.
213 * data structure.
214 * @sge: A scatter-gather list referenced by the work request.
215 * 217 *
216 * Users are responsible for initializing the MAD buffer itself, with the 218 * Users are responsible for initializing the MAD buffer itself, with the
217 * exception of specifying the payload length field in any RMPP MAD. 219 * exception of specifying the payload length field in any RMPP MAD.
218 */ 220 */
219struct ib_mad_send_buf { 221struct ib_mad_send_buf {
220 struct ib_mad *mad; 222 struct ib_mad_send_buf *next;
221 DECLARE_PCI_UNMAP_ADDR(mapping) 223 void *mad;
222 struct ib_mad_agent *mad_agent; 224 struct ib_mad_agent *mad_agent;
225 struct ib_ah *ah;
223 void *context[2]; 226 void *context[2];
224 struct ib_send_wr send_wr; 227 int timeout_ms;
225 struct ib_sge sge; 228 int retries;
226}; 229};
227 230
228/** 231/**
@@ -287,7 +290,7 @@ typedef void (*ib_mad_send_handler)(struct ib_mad_agent *mad_agent,
287 * or @mad_send_wc. 290 * or @mad_send_wc.
288 */ 291 */
289typedef void (*ib_mad_snoop_handler)(struct ib_mad_agent *mad_agent, 292typedef void (*ib_mad_snoop_handler)(struct ib_mad_agent *mad_agent,
290 struct ib_send_wr *send_wr, 293 struct ib_mad_send_buf *send_buf,
291 struct ib_mad_send_wc *mad_send_wc); 294 struct ib_mad_send_wc *mad_send_wc);
292 295
293/** 296/**
@@ -334,13 +337,13 @@ struct ib_mad_agent {
334 337
335/** 338/**
336 * ib_mad_send_wc - MAD send completion information. 339 * ib_mad_send_wc - MAD send completion information.
337 * @wr_id: Work request identifier associated with the send MAD request. 340 * @send_buf: Send MAD data buffer associated with the send MAD request.
338 * @status: Completion status. 341 * @status: Completion status.
339 * @vendor_err: Optional vendor error information returned with a failed 342 * @vendor_err: Optional vendor error information returned with a failed
340 * request. 343 * request.
341 */ 344 */
342struct ib_mad_send_wc { 345struct ib_mad_send_wc {
343 u64 wr_id; 346 struct ib_mad_send_buf *send_buf;
344 enum ib_wc_status status; 347 enum ib_wc_status status;
345 u32 vendor_err; 348 u32 vendor_err;
346}; 349};
@@ -366,7 +369,7 @@ struct ib_mad_recv_buf {
366 * @rmpp_list: Specifies a list of RMPP reassembled received MAD buffers. 369 * @rmpp_list: Specifies a list of RMPP reassembled received MAD buffers.
367 * @mad_len: The length of the received MAD, without duplicated headers. 370 * @mad_len: The length of the received MAD, without duplicated headers.
368 * 371 *
369 * For received response, the wr_id field of the wc is set to the wr_id 372 * For received response, the wr_id contains a pointer to the ib_mad_send_buf
370 * for the corresponding send request. 373 * for the corresponding send request.
371 */ 374 */
372struct ib_mad_recv_wc { 375struct ib_mad_recv_wc {
@@ -463,9 +466,9 @@ int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent);
463/** 466/**
464 * ib_post_send_mad - Posts MAD(s) to the send queue of the QP associated 467 * ib_post_send_mad - Posts MAD(s) to the send queue of the QP associated
465 * with the registered client. 468 * with the registered client.
466 * @mad_agent: Specifies the associated registration to post the send to. 469 * @send_buf: Specifies the information needed to send the MAD(s).
467 * @send_wr: Specifies the information needed to send the MAD(s). 470 * @bad_send_buf: Specifies the MAD on which an error was encountered. This
468 * @bad_send_wr: Specifies the MAD on which an error was encountered. 471 * parameter is optional if only a single MAD is posted.
469 * 472 *
470 * Sent MADs are not guaranteed to complete in the order that they were posted. 473 * Sent MADs are not guaranteed to complete in the order that they were posted.
471 * 474 *
@@ -479,9 +482,8 @@ int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent);
479 * defined data being transferred. The paylen_newwin field should be 482 * defined data being transferred. The paylen_newwin field should be
480 * specified in network-byte order. 483 * specified in network-byte order.
481 */ 484 */
482int ib_post_send_mad(struct ib_mad_agent *mad_agent, 485int ib_post_send_mad(struct ib_mad_send_buf *send_buf,
483 struct ib_send_wr *send_wr, 486 struct ib_mad_send_buf **bad_send_buf);
484 struct ib_send_wr **bad_send_wr);
485 487
486/** 488/**
487 * ib_coalesce_recv_mad - Coalesces received MAD data into a single buffer. 489 * ib_coalesce_recv_mad - Coalesces received MAD data into a single buffer.
@@ -507,23 +509,25 @@ void ib_free_recv_mad(struct ib_mad_recv_wc *mad_recv_wc);
507/** 509/**
508 * ib_cancel_mad - Cancels an outstanding send MAD operation. 510 * ib_cancel_mad - Cancels an outstanding send MAD operation.
509 * @mad_agent: Specifies the registration associated with sent MAD. 511 * @mad_agent: Specifies the registration associated with sent MAD.
510 * @wr_id: Indicates the work request identifier of the MAD to cancel. 512 * @send_buf: Indicates the MAD to cancel.
511 * 513 *
512 * MADs will be returned to the user through the corresponding 514 * MADs will be returned to the user through the corresponding
513 * ib_mad_send_handler. 515 * ib_mad_send_handler.
514 */ 516 */
515void ib_cancel_mad(struct ib_mad_agent *mad_agent, u64 wr_id); 517void ib_cancel_mad(struct ib_mad_agent *mad_agent,
518 struct ib_mad_send_buf *send_buf);
516 519
517/** 520/**
518 * ib_modify_mad - Modifies an outstanding send MAD operation. 521 * ib_modify_mad - Modifies an outstanding send MAD operation.
519 * @mad_agent: Specifies the registration associated with sent MAD. 522 * @mad_agent: Specifies the registration associated with sent MAD.
520 * @wr_id: Indicates the work request identifier of the MAD to modify. 523 * @send_buf: Indicates the MAD to modify.
521 * @timeout_ms: New timeout value for sent MAD. 524 * @timeout_ms: New timeout value for sent MAD.
522 * 525 *
523 * This call will reset the timeout value for a sent MAD to the specified 526 * This call will reset the timeout value for a sent MAD to the specified
524 * value. 527 * value.
525 */ 528 */
526int ib_modify_mad(struct ib_mad_agent *mad_agent, u64 wr_id, u32 timeout_ms); 529int ib_modify_mad(struct ib_mad_agent *mad_agent,
530 struct ib_mad_send_buf *send_buf, u32 timeout_ms);
527 531
528/** 532/**
529 * ib_redirect_mad_qp - Registers a QP for MAD services. 533 * ib_redirect_mad_qp - Registers a QP for MAD services.
@@ -572,7 +576,6 @@ int ib_process_mad_wc(struct ib_mad_agent *mad_agent,
572 * @remote_qpn: Specifies the QPN of the receiving node. 576 * @remote_qpn: Specifies the QPN of the receiving node.
573 * @pkey_index: Specifies which PKey the MAD will be sent using. This field 577 * @pkey_index: Specifies which PKey the MAD will be sent using. This field
574 * is valid only if the remote_qpn is QP 1. 578 * is valid only if the remote_qpn is QP 1.
575 * @ah: References the address handle used to transfer to the remote node.
576 * @rmpp_active: Indicates if the send will enable RMPP. 579 * @rmpp_active: Indicates if the send will enable RMPP.
577 * @hdr_len: Indicates the size of the data header of the MAD. This length 580 * @hdr_len: Indicates the size of the data header of the MAD. This length
578 * should include the common MAD header, RMPP header, plus any class 581 * should include the common MAD header, RMPP header, plus any class
@@ -582,11 +585,10 @@ int ib_process_mad_wc(struct ib_mad_agent *mad_agent,
582 * additional padding that may be necessary. 585 * additional padding that may be necessary.
583 * @gfp_mask: GFP mask used for the memory allocation. 586 * @gfp_mask: GFP mask used for the memory allocation.
584 * 587 *
585 * This is a helper routine that may be used to allocate a MAD. Users are 588 * This routine allocates a MAD for sending. The returned MAD send buffer
586 * not required to allocate outbound MADs using this call. The returned 589 * will reference a data buffer usable for sending a MAD, along
587 * MAD send buffer will reference a data buffer usable for sending a MAD, along
588 * with an initialized work request structure. Users may modify the returned 590 * with an initialized work request structure. Users may modify the returned
589 * MAD data buffer or work request before posting the send. 591 * MAD data buffer before posting the send.
590 * 592 *
591 * The returned data buffer will be cleared. Users are responsible for 593 * The returned data buffer will be cleared. Users are responsible for
592 * initializing the common MAD and any class specific headers. If @rmpp_active 594 * initializing the common MAD and any class specific headers. If @rmpp_active
@@ -594,7 +596,7 @@ int ib_process_mad_wc(struct ib_mad_agent *mad_agent,
594 */ 596 */
595struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent, 597struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent,
596 u32 remote_qpn, u16 pkey_index, 598 u32 remote_qpn, u16 pkey_index,
597 struct ib_ah *ah, int rmpp_active, 599 int rmpp_active,
598 int hdr_len, int data_len, 600 int hdr_len, int data_len,
599 gfp_t gfp_mask); 601 gfp_t gfp_mask);
600 602
diff --git a/include/rdma/ib_user_cm.h b/include/rdma/ib_user_cm.h
index e4d1654276ad..3037588b8464 100644
--- a/include/rdma/ib_user_cm.h
+++ b/include/rdma/ib_user_cm.h
@@ -38,7 +38,7 @@
38 38
39#include <linux/types.h> 39#include <linux/types.h>
40 40
41#define IB_USER_CM_ABI_VERSION 2 41#define IB_USER_CM_ABI_VERSION 3
42 42
43enum { 43enum {
44 IB_USER_CM_CMD_CREATE_ID, 44 IB_USER_CM_CMD_CREATE_ID,
@@ -299,8 +299,6 @@ struct ib_ucm_event_get {
299}; 299};
300 300
301struct ib_ucm_req_event_resp { 301struct ib_ucm_req_event_resp {
302 /* device */
303 /* port */
304 struct ib_ucm_path_rec primary_path; 302 struct ib_ucm_path_rec primary_path;
305 struct ib_ucm_path_rec alternate_path; 303 struct ib_ucm_path_rec alternate_path;
306 __be64 remote_ca_guid; 304 __be64 remote_ca_guid;
@@ -316,6 +314,7 @@ struct ib_ucm_req_event_resp {
316 __u8 retry_count; 314 __u8 retry_count;
317 __u8 rnr_retry_count; 315 __u8 rnr_retry_count;
318 __u8 srq; 316 __u8 srq;
317 __u8 port;
319}; 318};
320 319
321struct ib_ucm_rep_event_resp { 320struct ib_ucm_rep_event_resp {
@@ -353,10 +352,9 @@ struct ib_ucm_apr_event_resp {
353}; 352};
354 353
355struct ib_ucm_sidr_req_event_resp { 354struct ib_ucm_sidr_req_event_resp {
356 /* device */
357 /* port */
358 __u16 pkey; 355 __u16 pkey;
359 __u8 reserved[2]; 356 __u8 port;
357 __u8 reserved;
360}; 358};
361 359
362struct ib_ucm_sidr_rep_event_resp { 360struct ib_ucm_sidr_rep_event_resp {
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h
index fd85725391a4..072f3a2edace 100644
--- a/include/rdma/ib_user_verbs.h
+++ b/include/rdma/ib_user_verbs.h
@@ -1,6 +1,7 @@
1/* 1/*
2 * Copyright (c) 2005 Topspin Communications. All rights reserved. 2 * Copyright (c) 2005 Topspin Communications. All rights reserved.
3 * Copyright (c) 2005 Cisco Systems. All rights reserved. 3 * Copyright (c) 2005 Cisco Systems. All rights reserved.
4 * Copyright (c) 2005 PathScale, Inc. All rights reserved.
4 * 5 *
5 * This software is available to you under a choice of one of two 6 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU 7 * licenses. You may choose to be licensed under the terms of the GNU
@@ -42,15 +43,12 @@
42 * Increment this value if any changes that break userspace ABI 43 * Increment this value if any changes that break userspace ABI
43 * compatibility are made. 44 * compatibility are made.
44 */ 45 */
45#define IB_USER_VERBS_ABI_VERSION 2 46#define IB_USER_VERBS_ABI_VERSION 3
46 47
47enum { 48enum {
48 IB_USER_VERBS_CMD_QUERY_PARAMS,
49 IB_USER_VERBS_CMD_GET_CONTEXT, 49 IB_USER_VERBS_CMD_GET_CONTEXT,
50 IB_USER_VERBS_CMD_QUERY_DEVICE, 50 IB_USER_VERBS_CMD_QUERY_DEVICE,
51 IB_USER_VERBS_CMD_QUERY_PORT, 51 IB_USER_VERBS_CMD_QUERY_PORT,
52 IB_USER_VERBS_CMD_QUERY_GID,
53 IB_USER_VERBS_CMD_QUERY_PKEY,
54 IB_USER_VERBS_CMD_ALLOC_PD, 52 IB_USER_VERBS_CMD_ALLOC_PD,
55 IB_USER_VERBS_CMD_DEALLOC_PD, 53 IB_USER_VERBS_CMD_DEALLOC_PD,
56 IB_USER_VERBS_CMD_CREATE_AH, 54 IB_USER_VERBS_CMD_CREATE_AH,
@@ -65,6 +63,7 @@ enum {
65 IB_USER_VERBS_CMD_ALLOC_MW, 63 IB_USER_VERBS_CMD_ALLOC_MW,
66 IB_USER_VERBS_CMD_BIND_MW, 64 IB_USER_VERBS_CMD_BIND_MW,
67 IB_USER_VERBS_CMD_DEALLOC_MW, 65 IB_USER_VERBS_CMD_DEALLOC_MW,
66 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
68 IB_USER_VERBS_CMD_CREATE_CQ, 67 IB_USER_VERBS_CMD_CREATE_CQ,
69 IB_USER_VERBS_CMD_RESIZE_CQ, 68 IB_USER_VERBS_CMD_RESIZE_CQ,
70 IB_USER_VERBS_CMD_DESTROY_CQ, 69 IB_USER_VERBS_CMD_DESTROY_CQ,
@@ -90,8 +89,11 @@ enum {
90 * Make sure that all structs defined in this file remain laid out so 89 * Make sure that all structs defined in this file remain laid out so
91 * that they pack the same way on 32-bit and 64-bit architectures (to 90 * that they pack the same way on 32-bit and 64-bit architectures (to
92 * avoid incompatibility between 32-bit userspace and 64-bit kernels). 91 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
93 * In particular do not use pointer types -- pass pointers in __u64 92 * Specifically:
94 * instead. 93 * - Do not use pointer types -- pass pointers in __u64 instead.
94 * - Make sure that any structure larger than 4 bytes is padded to a
95 * multiple of 8 bytes. Otherwise the structure size will be
96 * different between 32-bit and 64-bit architectures.
95 */ 97 */
96 98
97struct ib_uverbs_async_event_desc { 99struct ib_uverbs_async_event_desc {
@@ -118,27 +120,14 @@ struct ib_uverbs_cmd_hdr {
118 __u16 out_words; 120 __u16 out_words;
119}; 121};
120 122
121/*
122 * No driver_data for "query params" command, since this is intended
123 * to be a core function with no possible device dependence.
124 */
125struct ib_uverbs_query_params {
126 __u64 response;
127};
128
129struct ib_uverbs_query_params_resp {
130 __u32 num_cq_events;
131};
132
133struct ib_uverbs_get_context { 123struct ib_uverbs_get_context {
134 __u64 response; 124 __u64 response;
135 __u64 cq_fd_tab;
136 __u64 driver_data[0]; 125 __u64 driver_data[0];
137}; 126};
138 127
139struct ib_uverbs_get_context_resp { 128struct ib_uverbs_get_context_resp {
140 __u32 async_fd; 129 __u32 async_fd;
141 __u32 reserved; 130 __u32 num_comp_vectors;
142}; 131};
143 132
144struct ib_uverbs_query_device { 133struct ib_uverbs_query_device {
@@ -220,31 +209,6 @@ struct ib_uverbs_query_port_resp {
220 __u8 reserved[3]; 209 __u8 reserved[3];
221}; 210};
222 211
223struct ib_uverbs_query_gid {
224 __u64 response;
225 __u8 port_num;
226 __u8 index;
227 __u8 reserved[6];
228 __u64 driver_data[0];
229};
230
231struct ib_uverbs_query_gid_resp {
232 __u8 gid[16];
233};
234
235struct ib_uverbs_query_pkey {
236 __u64 response;
237 __u8 port_num;
238 __u8 index;
239 __u8 reserved[6];
240 __u64 driver_data[0];
241};
242
243struct ib_uverbs_query_pkey_resp {
244 __u16 pkey;
245 __u16 reserved;
246};
247
248struct ib_uverbs_alloc_pd { 212struct ib_uverbs_alloc_pd {
249 __u64 response; 213 __u64 response;
250 __u64 driver_data[0]; 214 __u64 driver_data[0];
@@ -278,11 +242,21 @@ struct ib_uverbs_dereg_mr {
278 __u32 mr_handle; 242 __u32 mr_handle;
279}; 243};
280 244
245struct ib_uverbs_create_comp_channel {
246 __u64 response;
247};
248
249struct ib_uverbs_create_comp_channel_resp {
250 __u32 fd;
251};
252
281struct ib_uverbs_create_cq { 253struct ib_uverbs_create_cq {
282 __u64 response; 254 __u64 response;
283 __u64 user_handle; 255 __u64 user_handle;
284 __u32 cqe; 256 __u32 cqe;
285 __u32 event_handler; 257 __u32 comp_vector;
258 __s32 comp_channel;
259 __u32 reserved;
286 __u64 driver_data[0]; 260 __u64 driver_data[0];
287}; 261};
288 262
@@ -291,6 +265,41 @@ struct ib_uverbs_create_cq_resp {
291 __u32 cqe; 265 __u32 cqe;
292}; 266};
293 267
268struct ib_uverbs_poll_cq {
269 __u64 response;
270 __u32 cq_handle;
271 __u32 ne;
272};
273
274struct ib_uverbs_wc {
275 __u64 wr_id;
276 __u32 status;
277 __u32 opcode;
278 __u32 vendor_err;
279 __u32 byte_len;
280 __u32 imm_data;
281 __u32 qp_num;
282 __u32 src_qp;
283 __u32 wc_flags;
284 __u16 pkey_index;
285 __u16 slid;
286 __u8 sl;
287 __u8 dlid_path_bits;
288 __u8 port_num;
289 __u8 reserved;
290};
291
292struct ib_uverbs_poll_cq_resp {
293 __u32 count;
294 __u32 reserved;
295 struct ib_uverbs_wc wc[0];
296};
297
298struct ib_uverbs_req_notify_cq {
299 __u32 cq_handle;
300 __u32 solicited_only;
301};
302
294struct ib_uverbs_destroy_cq { 303struct ib_uverbs_destroy_cq {
295 __u64 response; 304 __u64 response;
296 __u32 cq_handle; 305 __u32 cq_handle;
@@ -388,6 +397,127 @@ struct ib_uverbs_destroy_qp_resp {
388 __u32 events_reported; 397 __u32 events_reported;
389}; 398};
390 399
400/*
401 * The ib_uverbs_sge structure isn't used anywhere, since we assume
402 * the ib_sge structure is packed the same way on 32-bit and 64-bit
403 * architectures in both kernel and user space. It's just here to
404 * document the ABI.
405 */
406struct ib_uverbs_sge {
407 __u64 addr;
408 __u32 length;
409 __u32 lkey;
410};
411
412struct ib_uverbs_send_wr {
413 __u64 wr_id;
414 __u32 num_sge;
415 __u32 opcode;
416 __u32 send_flags;
417 __u32 imm_data;
418 union {
419 struct {
420 __u64 remote_addr;
421 __u32 rkey;
422 __u32 reserved;
423 } rdma;
424 struct {
425 __u64 remote_addr;
426 __u64 compare_add;
427 __u64 swap;
428 __u32 rkey;
429 __u32 reserved;
430 } atomic;
431 struct {
432 __u32 ah;
433 __u32 remote_qpn;
434 __u32 remote_qkey;
435 __u32 reserved;
436 } ud;
437 } wr;
438};
439
440struct ib_uverbs_post_send {
441 __u64 response;
442 __u32 qp_handle;
443 __u32 wr_count;
444 __u32 sge_count;
445 __u32 wqe_size;
446 struct ib_uverbs_send_wr send_wr[0];
447};
448
449struct ib_uverbs_post_send_resp {
450 __u32 bad_wr;
451};
452
453struct ib_uverbs_recv_wr {
454 __u64 wr_id;
455 __u32 num_sge;
456 __u32 reserved;
457};
458
459struct ib_uverbs_post_recv {
460 __u64 response;
461 __u32 qp_handle;
462 __u32 wr_count;
463 __u32 sge_count;
464 __u32 wqe_size;
465 struct ib_uverbs_recv_wr recv_wr[0];
466};
467
468struct ib_uverbs_post_recv_resp {
469 __u32 bad_wr;
470};
471
472struct ib_uverbs_post_srq_recv {
473 __u64 response;
474 __u32 srq_handle;
475 __u32 wr_count;
476 __u32 sge_count;
477 __u32 wqe_size;
478 struct ib_uverbs_recv_wr recv[0];
479};
480
481struct ib_uverbs_post_srq_recv_resp {
482 __u32 bad_wr;
483};
484
485struct ib_uverbs_global_route {
486 __u8 dgid[16];
487 __u32 flow_label;
488 __u8 sgid_index;
489 __u8 hop_limit;
490 __u8 traffic_class;
491 __u8 reserved;
492};
493
494struct ib_uverbs_ah_attr {
495 struct ib_uverbs_global_route grh;
496 __u16 dlid;
497 __u8 sl;
498 __u8 src_path_bits;
499 __u8 static_rate;
500 __u8 is_global;
501 __u8 port_num;
502 __u8 reserved;
503};
504
505struct ib_uverbs_create_ah {
506 __u64 response;
507 __u64 user_handle;
508 __u32 pd_handle;
509 __u32 reserved;
510 struct ib_uverbs_ah_attr attr;
511};
512
513struct ib_uverbs_create_ah_resp {
514 __u32 ah_handle;
515};
516
517struct ib_uverbs_destroy_ah {
518 __u32 ah_handle;
519};
520
391struct ib_uverbs_attach_mcast { 521struct ib_uverbs_attach_mcast {
392 __u8 gid[16]; 522 __u8 gid[16];
393 __u32 qp_handle; 523 __u32 qp_handle;
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index e6f4c9e55df7..f72d46d54e0a 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -595,11 +595,8 @@ struct ib_send_wr {
595 } atomic; 595 } atomic;
596 struct { 596 struct {
597 struct ib_ah *ah; 597 struct ib_ah *ah;
598 struct ib_mad_hdr *mad_hdr;
599 u32 remote_qpn; 598 u32 remote_qpn;
600 u32 remote_qkey; 599 u32 remote_qkey;
601 int timeout_ms; /* valid for MADs only */
602 int retries; /* valid for MADs only */
603 u16 pkey_index; /* valid for GSI only */ 600 u16 pkey_index; /* valid for GSI only */
604 u8 port_num; /* valid for DR SMPs on switch only */ 601 u8 port_num; /* valid for DR SMPs on switch only */
605 } ud; 602 } ud;
@@ -951,6 +948,9 @@ struct ib_device {
951 IB_DEV_UNREGISTERED 948 IB_DEV_UNREGISTERED
952 } reg_state; 949 } reg_state;
953 950
951 u64 uverbs_cmd_mask;
952 int uverbs_abi_ver;
953
954 u8 node_type; 954 u8 node_type;
955 u8 phys_port_cnt; 955 u8 phys_port_cnt;
956}; 956};
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index b361172b576c..6cb1e2788d8b 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -116,6 +116,9 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
116/* values for service action in */ 116/* values for service action in */
117#define SAI_READ_CAPACITY_16 0x10 117#define SAI_READ_CAPACITY_16 0x10
118 118
119/* Values for T10/04-262r7 */
120#define ATA_16 0x85 /* 16-byte pass-thru */
121#define ATA_12 0xa1 /* 12-byte pass-thru */
119 122
120/* 123/*
121 * SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft 124 * SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index bed4b7c9be99..e6b61fab66dd 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -146,7 +146,7 @@ struct scsi_cmnd {
146#define SCSI_STATE_MLQUEUE 0x100b 146#define SCSI_STATE_MLQUEUE 0x100b
147 147
148 148
149extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, int); 149extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t);
150extern void scsi_put_command(struct scsi_cmnd *); 150extern void scsi_put_command(struct scsi_cmnd *);
151extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); 151extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int);
152extern void scsi_finish_command(struct scsi_cmnd *cmd); 152extern void scsi_finish_command(struct scsi_cmnd *cmd);
diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h
index 6a140020d7cb..2539debb7993 100644
--- a/include/scsi/scsi_request.h
+++ b/include/scsi/scsi_request.h
@@ -45,7 +45,7 @@ struct scsi_request {
45 level driver) of this request */ 45 level driver) of this request */
46}; 46};
47 47
48extern struct scsi_request *scsi_allocate_request(struct scsi_device *, int); 48extern struct scsi_request *scsi_allocate_request(struct scsi_device *, gfp_t);
49extern void scsi_release_request(struct scsi_request *); 49extern void scsi_release_request(struct scsi_request *);
50extern void scsi_wait_req(struct scsi_request *, const void *cmnd, 50extern void scsi_wait_req(struct scsi_request *, const void *cmnd,
51 void *buffer, unsigned bufflen, 51 void *buffer, unsigned bufflen,
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h
index 3a2fd2cc9f19..83489c3abbaf 100644
--- a/include/sound/memalloc.h
+++ b/include/sound/memalloc.h
@@ -111,7 +111,7 @@ size_t snd_dma_get_reserved_buf(struct snd_dma_buffer *dmab, unsigned int id);
111int snd_dma_reserve_buf(struct snd_dma_buffer *dmab, unsigned int id); 111int snd_dma_reserve_buf(struct snd_dma_buffer *dmab, unsigned int id);
112 112
113/* basic memory allocation functions */ 113/* basic memory allocation functions */
114void *snd_malloc_pages(size_t size, unsigned int gfp_flags); 114void *snd_malloc_pages(size_t size, gfp_t gfp_flags);
115void snd_free_pages(void *ptr, size_t size); 115void snd_free_pages(void *ptr, size_t size);
116 116
117#endif /* __SOUND_MEMALLOC_H */ 117#endif /* __SOUND_MEMALLOC_H */