aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acmacros.h23
-rw-r--r--include/acpi/acoutput.h4
-rw-r--r--include/acpi/acpi_numa.h3
-rw-r--r--include/acpi/acpiosxf.h3
-rw-r--r--include/acpi/acpixf.h2
-rw-r--r--include/acpi/acutils.h2
-rw-r--r--include/acpi/platform/acenv.h2
-rw-r--r--include/acpi/platform/aclinux.h3
-rw-r--r--include/asm-alpha/a.out.h2
-rw-r--r--include/asm-alpha/fb.h13
-rw-r--r--include/asm-alpha/io.h13
-rw-r--r--include/asm-alpha/page.h3
-rw-r--r--include/asm-alpha/pci.h29
-rw-r--r--include/asm-alpha/pgtable.h6
-rw-r--r--include/asm-alpha/system.h10
-rw-r--r--include/asm-alpha/termios.h4
-rw-r--r--include/asm-arm/Kbuild2
-rw-r--r--include/asm-arm/a.out.h1
-rw-r--r--include/asm-arm/arch-at91/at91_dbgu.h13
-rw-r--r--include/asm-arm/arch-at91/at91_shdwc.h4
-rw-r--r--include/asm-arm/arch-at91/at91_wdt.h2
-rw-r--r--include/asm-arm/arch-at91/at91x40.h55
-rw-r--r--include/asm-arm/arch-at91/board.h1
-rw-r--r--include/asm-arm/arch-at91/cpu.h5
-rw-r--r--include/asm-arm/arch-at91/hardware.h17
-rw-r--r--include/asm-arm/arch-at91/timex.h5
-rw-r--r--include/asm-arm/arch-at91/uncompress.h4
-rw-r--r--include/asm-arm/arch-davinci/clock.h22
-rw-r--r--include/asm-arm/arch-davinci/gpio.h156
-rw-r--r--include/asm-arm/arch-davinci/hardware.h38
-rw-r--r--include/asm-arm/arch-davinci/mux.h55
-rw-r--r--include/asm-arm/arch-imx/gpio.h102
-rw-r--r--include/asm-arm/arch-imx/imx-regs.h2
-rw-r--r--include/asm-arm/arch-iop13xx/adma.h544
-rw-r--r--include/asm-arm/arch-iop13xx/iop13xx.h38
-rw-r--r--include/asm-arm/arch-iop32x/adma.h5
-rw-r--r--include/asm-arm/arch-iop33x/adma.h5
-rw-r--r--include/asm-arm/arch-ixp4xx/ixdp425.h4
-rw-r--r--include/asm-arm/arch-ixp4xx/udc.h22
-rw-r--r--include/asm-arm/arch-ixp4xx/uncompress.h5
-rw-r--r--include/asm-arm/arch-ks8695/gpio.h79
-rw-r--r--include/asm-arm/arch-pxa/dma.h22
-rw-r--r--include/asm-arm/arch-pxa/entry-macro.S30
-rw-r--r--include/asm-arm/arch-pxa/gpio.h3
-rw-r--r--include/asm-arm/arch-pxa/hardware.h36
-rw-r--r--include/asm-arm/arch-pxa/irqs.h26
-rw-r--r--include/asm-arm/arch-pxa/pm.h1
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h22
-rw-r--r--include/asm-arm/arch-pxa/udc.h33
-rw-r--r--include/asm-arm/arch-s3c2410/anubis-cpld.h4
-rw-r--r--include/asm-arm/arch-s3c2410/anubis-map.h10
-rw-r--r--include/asm-arm/arch-s3c2410/osiris-cpld.h19
-rw-r--r--include/asm-arm/arch-s3c2410/osiris-map.h19
-rw-r--r--include/asm-arm/elf.h23
-rw-r--r--include/asm-arm/fb.h19
-rw-r--r--include/asm-arm/hardware/iop3xx-adma.h892
-rw-r--r--include/asm-arm/hardware/iop3xx.h68
-rw-r--r--include/asm-arm/hardware/iop_adma.h118
-rw-r--r--include/asm-arm/hwcap.h28
-rw-r--r--include/asm-arm/linkage.h4
-rw-r--r--include/asm-arm/pci.h9
-rw-r--r--include/asm-arm/pgtable.h12
-rw-r--r--include/asm-arm/ptrace.h19
-rw-r--r--include/asm-arm/system.h10
-rw-r--r--include/asm-arm/unistd.h1
-rw-r--r--include/asm-arm26/a.out.h1
-rw-r--r--include/asm-arm26/dma-mapping.h2
-rw-r--r--include/asm-arm26/fb.h12
-rw-r--r--include/asm-arm26/ioctls.h4
-rw-r--r--include/asm-arm26/pgtable.h4
-rw-r--r--include/asm-arm26/system.h10
-rw-r--r--include/asm-arm26/termbits.h17
-rw-r--r--include/asm-arm26/termios.h6
-rw-r--r--include/asm-avr32/a.out.h1
-rw-r--r--include/asm-avr32/arch-at32ap/board.h15
-rw-r--r--include/asm-avr32/arch-at32ap/gpio.h2
-rw-r--r--include/asm-avr32/arch-at32ap/sm.h27
-rw-r--r--include/asm-avr32/atomic.h4
-rw-r--r--include/asm-avr32/cache.h9
-rw-r--r--include/asm-avr32/fb.h21
-rw-r--r--include/asm-avr32/pgtable.h28
-rw-r--r--include/asm-avr32/termbits.h11
-rw-r--r--include/asm-avr32/unaligned.h15
-rw-r--r--include/asm-blackfin/Kbuild2
-rw-r--r--include/asm-blackfin/bfin-global.h12
-rw-r--r--include/asm-blackfin/blackfin.h39
-rw-r--r--include/asm-blackfin/cplbinit.h133
-rw-r--r--include/asm-blackfin/dma-mapping.h2
-rw-r--r--include/asm-blackfin/fb.h12
-rw-r--r--include/asm-blackfin/fixed_code.h20
-rw-r--r--include/asm-blackfin/gpio.h59
-rw-r--r--include/asm-blackfin/hardirq.h4
-rw-r--r--include/asm-blackfin/io.h6
-rw-r--r--include/asm-blackfin/kgdb.h183
-rw-r--r--include/asm-blackfin/mach-bf533/anomaly.h84
-rw-r--r--include/asm-blackfin/mach-bf533/bfin_serial_5xx.h2
-rw-r--r--include/asm-blackfin/mach-bf533/dma.h3
-rw-r--r--include/asm-blackfin/mach-bf533/portmux.h65
-rw-r--r--include/asm-blackfin/mach-bf537/anomaly.h21
-rw-r--r--include/asm-blackfin/mach-bf537/dma.h3
-rw-r--r--include/asm-blackfin/mach-bf537/portmux.h109
-rw-r--r--include/asm-blackfin/mach-bf548/anomaly.h74
-rw-r--r--include/asm-blackfin/mach-bf548/bf548.h271
-rw-r--r--include/asm-blackfin/mach-bf548/bfin_serial_5xx.h193
-rw-r--r--include/asm-blackfin/mach-bf548/blackfin.h168
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF54x_base.h72
-rw-r--r--include/asm-blackfin/mach-bf548/defBF542.h281
-rw-r--r--include/asm-blackfin/mach-bf548/defBF544.h60
-rw-r--r--include/asm-blackfin/mach-bf548/defBF548.h341
-rw-r--r--include/asm-blackfin/mach-bf548/defBF549.h763
-rw-r--r--include/asm-blackfin/mach-bf548/defBF54x_base.h1366
-rw-r--r--include/asm-blackfin/mach-bf548/dma.h73
-rw-r--r--include/asm-blackfin/mach-bf548/gpio.h216
-rw-r--r--include/asm-blackfin/mach-bf548/irq.h467
-rw-r--r--include/asm-blackfin/mach-bf548/mem_init.h189
-rw-r--r--include/asm-blackfin/mach-bf548/mem_map.h97
-rw-r--r--include/asm-blackfin/mach-bf548/portmux.h270
-rw-r--r--include/asm-blackfin/mach-bf561/bfin_serial_5xx.h2
-rw-r--r--include/asm-blackfin/mach-bf561/cdefBF561.h9
-rw-r--r--include/asm-blackfin/mach-bf561/dma.h3
-rw-r--r--include/asm-blackfin/mach-bf561/portmux.h87
-rw-r--r--include/asm-blackfin/mach-common/cdef_LPBlackfin.h8
-rw-r--r--include/asm-blackfin/mach-common/def_LPBlackfin.h22
-rw-r--r--include/asm-blackfin/macros.h95
-rw-r--r--include/asm-blackfin/mman.h2
-rw-r--r--include/asm-blackfin/page.h4
-rw-r--r--include/asm-blackfin/portmux.h1133
-rw-r--r--include/asm-blackfin/processor.h4
-rw-r--r--include/asm-blackfin/termbits.h11
-rw-r--r--include/asm-blackfin/trace.h52
-rw-r--r--include/asm-blackfin/unistd.h3
-rw-r--r--include/asm-cris/a.out.h1
-rw-r--r--include/asm-cris/fb.h12
-rw-r--r--include/asm-cris/ioctls.h4
-rw-r--r--include/asm-cris/page.h3
-rw-r--r--include/asm-cris/pci.h36
-rw-r--r--include/asm-cris/pgtable.h30
-rw-r--r--include/asm-cris/termbits.h12
-rw-r--r--include/asm-cris/termios.h6
-rw-r--r--include/asm-frv/fb.h12
-rw-r--r--include/asm-frv/mem-layout.h1
-rw-r--r--include/asm-frv/pci.h7
-rw-r--r--include/asm-frv/pgtable.h16
-rw-r--r--include/asm-frv/system.h1
-rw-r--r--include/asm-frv/termbits.h11
-rw-r--r--include/asm-frv/uaccess.h2
-rw-r--r--include/asm-frv/unistd.h6
-rw-r--r--include/asm-generic/bitops/sched.h21
-rw-r--r--include/asm-generic/bug.h2
-rw-r--r--include/asm-generic/dma-mapping-broken.h82
-rw-r--r--include/asm-generic/fcntl.h3
-rw-r--r--include/asm-generic/percpu.h8
-rw-r--r--include/asm-generic/pgtable.h61
-rw-r--r--include/asm-generic/unaligned.h16
-rw-r--r--include/asm-generic/vmlinux.lds.h14
-rw-r--r--include/asm-h8300/a.out.h1
-rw-r--r--include/asm-h8300/dma-mapping.h1
-rw-r--r--include/asm-h8300/fb.h12
-rw-r--r--include/asm-h8300/ioctls.h4
-rw-r--r--include/asm-h8300/page.h3
-rw-r--r--include/asm-h8300/pci.h4
-rw-r--r--include/asm-h8300/termbits.h16
-rw-r--r--include/asm-h8300/termios.h6
-rw-r--r--include/asm-h8300/thread_info.h2
-rw-r--r--include/asm-i386/a.out.h1
-rw-r--r--include/asm-i386/boot.h6
-rw-r--r--include/asm-i386/bootparam.h85
-rw-r--r--include/asm-i386/cmpxchg.h14
-rw-r--r--include/asm-i386/cpufeature.h26
-rw-r--r--include/asm-i386/dma-mapping.h6
-rw-r--r--include/asm-i386/e820.h22
-rw-r--r--include/asm-i386/fb.h17
-rw-r--r--include/asm-i386/fixmap.h2
-rw-r--r--include/asm-i386/geode.h159
-rw-r--r--include/asm-i386/hpet.h126
-rw-r--r--include/asm-i386/i8253.h16
-rw-r--r--include/asm-i386/ide.h4
-rw-r--r--include/asm-i386/io.h1
-rw-r--r--include/asm-i386/irq.h1
-rw-r--r--include/asm-i386/kprobes.h1
-rw-r--r--include/asm-i386/mach-default/do_timer.h2
-rw-r--r--include/asm-i386/mach-default/io_ports.h5
-rw-r--r--include/asm-i386/mach-default/irq_vectors_limits.h2
-rw-r--r--include/asm-i386/mach-default/mach_reboot.h25
-rw-r--r--include/asm-i386/mach-es7000/mach_apic.h4
-rw-r--r--include/asm-i386/mach-es7000/mach_mpparse.h6
-rw-r--r--include/asm-i386/mach-voyager/do_timer.h2
-rw-r--r--include/asm-i386/mc146818rtc.h5
-rw-r--r--include/asm-i386/mmu_context.h2
-rw-r--r--include/asm-i386/page.h4
-rw-r--r--include/asm-i386/paravirt.h24
-rw-r--r--include/asm-i386/pci.h42
-rw-r--r--include/asm-i386/percpu.h5
-rw-r--r--include/asm-i386/pgalloc.h6
-rw-r--r--include/asm-i386/pgtable-2level.h8
-rw-r--r--include/asm-i386/pgtable-3level.h17
-rw-r--r--include/asm-i386/pgtable.h58
-rw-r--r--include/asm-i386/processor.h6
-rw-r--r--include/asm-i386/required-features.h41
-rw-r--r--include/asm-i386/resume-trace.h13
-rw-r--r--include/asm-i386/setup.h14
-rw-r--r--include/asm-i386/smp.h5
-rw-r--r--include/asm-i386/string.h243
-rw-r--r--include/asm-i386/system.h9
-rw-r--r--include/asm-i386/thread_info.h5
-rw-r--r--include/asm-i386/timer.h34
-rw-r--r--include/asm-i386/tlbflush.h6
-rw-r--r--include/asm-i386/topology.h2
-rw-r--r--include/asm-i386/tsc.h1
-rw-r--r--include/asm-i386/uaccess.h2
-rw-r--r--include/asm-i386/unistd.h3
-rw-r--r--include/asm-i386/vmi_time.h2
-rw-r--r--include/asm-i386/xen/hypercall.h413
-rw-r--r--include/asm-i386/xen/hypervisor.h73
-rw-r--r--include/asm-i386/xen/interface.h188
-rw-r--r--include/asm-ia64/compat.h2
-rw-r--r--include/asm-ia64/fb.h23
-rw-r--r--include/asm-ia64/hw_irq.h18
-rw-r--r--include/asm-ia64/ioctls.h4
-rw-r--r--include/asm-ia64/iosapic.h6
-rw-r--r--include/asm-ia64/irq.h9
-rw-r--r--include/asm-ia64/kprobes.h2
-rw-r--r--include/asm-ia64/mca.h1
-rw-r--r--include/asm-ia64/page.h13
-rw-r--r--include/asm-ia64/pci.h22
-rw-r--r--include/asm-ia64/percpu.h10
-rw-r--r--include/asm-ia64/pgtable.h47
-rw-r--r--include/asm-ia64/processor.h4
-rw-r--r--include/asm-ia64/rwsem.h4
-rw-r--r--include/asm-ia64/sn/sn_sal.h24
-rw-r--r--include/asm-ia64/system.h1
-rw-r--r--include/asm-ia64/termbits.h16
-rw-r--r--include/asm-ia64/termios.h6
-rw-r--r--include/asm-ia64/unistd.h2
-rw-r--r--include/asm-ia64/ustack.h1
-rw-r--r--include/asm-m32r/a.out.h1
-rw-r--r--include/asm-m32r/dma-mapping.h6
-rw-r--r--include/asm-m32r/fb.h19
-rw-r--r--include/asm-m32r/ioctls.h4
-rw-r--r--include/asm-m32r/page.h3
-rw-r--r--include/asm-m32r/pgtable.h40
-rw-r--r--include/asm-m32r/system.h10
-rw-r--r--include/asm-m32r/termbits.h16
-rw-r--r--include/asm-m32r/termios.h6
-rw-r--r--include/asm-m68k/a.out.h1
-rw-r--r--include/asm-m68k/atari_SLM.h28
-rw-r--r--include/asm-m68k/atari_acsi.h37
-rw-r--r--include/asm-m68k/fb.h34
-rw-r--r--include/asm-m68k/io.h75
-rw-r--r--include/asm-m68k/motorola_pgtable.h6
-rw-r--r--include/asm-m68k/pci.h4
-rw-r--r--include/asm-m68k/raw_io.h8
-rw-r--r--include/asm-m68k/sun3_pgtable.h6
-rw-r--r--include/asm-m68k/termbits.h11
-rw-r--r--include/asm-m68knommu/fb.h12
-rw-r--r--include/asm-m68knommu/irq.h75
-rw-r--r--include/asm-m68knommu/irqnode.h36
-rw-r--r--include/asm-m68knommu/m68360.h8
-rw-r--r--include/asm-m68knommu/page.h3
-rw-r--r--include/asm-m68knommu/pci.h10
-rw-r--r--include/asm-m68knommu/pgtable.h1
-rw-r--r--include/asm-m68knommu/traps.h4
-rw-r--r--include/asm-m68knommu/uaccess.h11
-rw-r--r--include/asm-mips/a.out.h1
-rw-r--r--include/asm-mips/addrspace.h28
-rw-r--r--include/asm-mips/asmmacro.h15
-rw-r--r--include/asm-mips/atomic.h33
-rw-r--r--include/asm-mips/barrier.h9
-rw-r--r--include/asm-mips/bitops.h63
-rw-r--r--include/asm-mips/bootinfo.h36
-rw-r--r--include/asm-mips/cacheops.h4
-rw-r--r--include/asm-mips/compat-signal.h62
-rw-r--r--include/asm-mips/compat.h5
-rw-r--r--include/asm-mips/cpu-features.h4
-rw-r--r--include/asm-mips/cpu.h21
-rw-r--r--include/asm-mips/dec/serial.h36
-rw-r--r--include/asm-mips/div64.h9
-rw-r--r--include/asm-mips/ds1216.h31
-rw-r--r--include/asm-mips/fb.h19
-rw-r--r--include/asm-mips/futex.h8
-rw-r--r--include/asm-mips/gfx.h55
-rw-r--r--include/asm-mips/gpio.h6
-rw-r--r--include/asm-mips/io.h11
-rw-r--r--include/asm-mips/irq.h11
-rw-r--r--include/asm-mips/lasat/ds1603.h18
-rw-r--r--include/asm-mips/lasat/eeprom.h17
-rw-r--r--include/asm-mips/lasat/head.h22
-rw-r--r--include/asm-mips/lasat/lasat.h253
-rw-r--r--include/asm-mips/lasat/lasatint.h12
-rw-r--r--include/asm-mips/lasat/picvue.h15
-rw-r--r--include/asm-mips/lasat/serial.h13
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_gpio.h20
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_ide.h28
-rw-r--r--include/asm-mips/mach-au1x00/gpio.h69
-rw-r--r--include/asm-mips/mach-au1x00/ioremap.h11
-rw-r--r--include/asm-mips/mach-cobalt/cobalt.h5
-rw-r--r--include/asm-mips/mach-cobalt/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-ev64120/mach-gt64120.h62
-rw-r--r--include/asm-mips/mach-excite/cpu-feature-overrides.h3
-rw-r--r--include/asm-mips/mach-generic/gpio.h15
-rw-r--r--include/asm-mips/mach-generic/ioremap.h11
-rw-r--r--include/asm-mips/mach-generic/spaces.h64
-rw-r--r--include/asm-mips/mach-ip22/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-ip22/spaces.h33
-rw-r--r--include/asm-mips/mach-ip27/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-ip27/spaces.h9
-rw-r--r--include/asm-mips/mach-ip32/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-ip32/dma-coherence.h6
-rw-r--r--include/asm-mips/mach-ip32/spaces.h36
-rw-r--r--include/asm-mips/mach-jmr3927/ioremap.h38
-rw-r--r--include/asm-mips/mach-lasat/mach-gt64120.h27
-rw-r--r--include/asm-mips/mach-lemote/dma-coherence.h42
-rw-r--r--include/asm-mips/mach-lemote/mc146818rtc.h36
-rw-r--r--include/asm-mips/mach-mips/kernel-entry-init.h52
-rw-r--r--include/asm-mips/mach-mipssim/cpu-feature-overrides.h (renamed from include/asm-mips/mach-sim/cpu-feature-overrides.h)0
-rw-r--r--include/asm-mips/mach-ocelot3/cpu-feature-overrides.h48
-rw-r--r--include/asm-mips/mach-qemu/cpu-feature-overrides.h3
-rw-r--r--include/asm-mips/mach-rm/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-sibyte/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-tx49xx/ioremap.h43
-rw-r--r--include/asm-mips/mach-yosemite/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mips-boards/atlasint.h6
-rw-r--r--include/asm-mips/mips-boards/bonito64.h7
-rw-r--r--include/asm-mips/mips-boards/generic.h22
-rw-r--r--include/asm-mips/mips-boards/maltaint.h6
-rw-r--r--include/asm-mips/mips-boards/msc01_pci.h1
-rw-r--r--include/asm-mips/mips-boards/prom.h1
-rw-r--r--include/asm-mips/mips-boards/seadint.h7
-rw-r--r--include/asm-mips/mips-boards/simint.h4
-rw-r--r--include/asm-mips/mipsregs.h61
-rw-r--r--include/asm-mips/module.h11
-rw-r--r--include/asm-mips/nile4.h310
-rw-r--r--include/asm-mips/page.h21
-rw-r--r--include/asm-mips/pci.h20
-rw-r--r--include/asm-mips/pgtable.h34
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h151
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_int.h43
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_pci.h205
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_prom.h176
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_regops.h236
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_regs.h667
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h141
-rw-r--r--include/asm-mips/processor.h92
-rw-r--r--include/asm-mips/ptrace.h2
-rw-r--r--include/asm-mips/rtc.h73
-rw-r--r--include/asm-mips/serial.h155
-rw-r--r--include/asm-mips/sibyte/bcm1480_regs.h30
-rw-r--r--include/asm-mips/sibyte/sb1250_regs.h76
-rw-r--r--include/asm-mips/sibyte/sb1250_uart.h7
-rw-r--r--include/asm-mips/smp.h7
-rw-r--r--include/asm-mips/sni.h3
-rw-r--r--include/asm-mips/spinlock.h18
-rw-r--r--include/asm-mips/stackframe.h52
-rw-r--r--include/asm-mips/system.h34
-rw-r--r--include/asm-mips/termbits.h11
-rw-r--r--include/asm-mips/tlbdebug.h4
-rw-r--r--include/asm-mips/tx4938/rbtx4938.h6
-rw-r--r--include/asm-mips/tx4938/spi.h56
-rw-r--r--include/asm-mips/unistd.h41
-rw-r--r--include/asm-mips/vr41xx/giu.h9
-rw-r--r--include/asm-mips/vr41xx/siu.h2
-rw-r--r--include/asm-mips/war.h31
-rw-r--r--include/asm-mips/watch.h35
-rw-r--r--include/asm-parisc/a.out.h1
-rw-r--r--include/asm-parisc/compat.h2
-rw-r--r--include/asm-parisc/fb.h19
-rw-r--r--include/asm-parisc/fcntl.h29
-rw-r--r--include/asm-parisc/hardware.h5
-rw-r--r--include/asm-parisc/linkage.h5
-rw-r--r--include/asm-parisc/pci.h7
-rw-r--r--include/asm-parisc/pgtable.h20
-rw-r--r--include/asm-parisc/processor.h8
-rw-r--r--include/asm-parisc/system.h12
-rw-r--r--include/asm-parisc/termbits.h11
-rw-r--r--include/asm-parisc/unistd.h13
-rw-r--r--include/asm-powerpc/a.out.h3
-rw-r--r--include/asm-powerpc/cache.h4
-rw-r--r--include/asm-powerpc/compat.h2
-rw-r--r--include/asm-powerpc/cputable.h111
-rw-r--r--include/asm-powerpc/dma-mapping.h1
-rw-r--r--include/asm-powerpc/fb.h21
-rw-r--r--include/asm-powerpc/floppy.h6
-rw-r--r--include/asm-powerpc/hvcall.h1
-rw-r--r--include/asm-powerpc/io.h26
-rw-r--r--include/asm-powerpc/irq.h14
-rw-r--r--include/asm-powerpc/kprobes.h6
-rw-r--r--include/asm-powerpc/lppaca.h2
-rw-r--r--include/asm-powerpc/lv1call.h3
-rw-r--r--include/asm-powerpc/machdep.h2
-rw-r--r--include/asm-powerpc/mmu-8xx.h147
-rw-r--r--include/asm-powerpc/mmu-fsl-booke.h88
-rw-r--r--include/asm-powerpc/mmu-hash32.h91
-rw-r--r--include/asm-powerpc/mmu-hash64.h9
-rw-r--r--include/asm-powerpc/mmu.h13
-rw-r--r--include/asm-powerpc/mmu_context.h202
-rw-r--r--include/asm-powerpc/mpc86xx.h6
-rw-r--r--include/asm-powerpc/mpc8xx.h4
-rw-r--r--include/asm-powerpc/of_device.h22
-rw-r--r--include/asm-powerpc/of_platform.h38
-rw-r--r--include/asm-powerpc/oprofile_impl.h10
-rw-r--r--include/asm-powerpc/pci-bridge.h148
-rw-r--r--include/asm-powerpc/pci.h31
-rw-r--r--include/asm-powerpc/percpu.h7
-rw-r--r--include/asm-powerpc/pgalloc-64.h3
-rw-r--r--include/asm-powerpc/pgtable-ppc32.h79
-rw-r--r--include/asm-powerpc/pgtable-ppc64.h103
-rw-r--r--include/asm-powerpc/pgtable.h28
-rw-r--r--include/asm-powerpc/pmi.h8
-rw-r--r--include/asm-powerpc/ppc-pci.h9
-rw-r--r--include/asm-powerpc/processor.h8
-rw-r--r--include/asm-powerpc/prom.h56
-rw-r--r--include/asm-powerpc/ps3.h182
-rw-r--r--include/asm-powerpc/ps3av.h48
-rw-r--r--include/asm-powerpc/ps3fb.h12
-rw-r--r--include/asm-powerpc/ps3stor.h71
-rw-r--r--include/asm-powerpc/ptrace.h22
-rw-r--r--include/asm-powerpc/reg.h2
-rw-r--r--include/asm-powerpc/spu.h76
-rw-r--r--include/asm-powerpc/spu_csa.h8
-rw-r--r--include/asm-powerpc/syscalls.h7
-rw-r--r--include/asm-powerpc/systbl.h2
-rw-r--r--include/asm-powerpc/system.h14
-rw-r--r--include/asm-powerpc/termbits.h4
-rw-r--r--include/asm-powerpc/thread_info.h12
-rw-r--r--include/asm-powerpc/time.h4
-rw-r--r--include/asm-powerpc/tlb.h9
-rw-r--r--include/asm-powerpc/tlbflush.h5
-rw-r--r--include/asm-powerpc/unistd.h4
-rw-r--r--include/asm-ppc/pci.h8
-rw-r--r--include/asm-ppc/pgtable.h29
-rw-r--r--include/asm-ppc/system.h10
-rw-r--r--include/asm-s390/a.out.h1
-rw-r--r--include/asm-s390/atomic.h4
-rw-r--r--include/asm-s390/cmb.h1
-rw-r--r--include/asm-s390/compat.h2
-rw-r--r--include/asm-s390/dma-mapping.h12
-rw-r--r--include/asm-s390/fb.h12
-rw-r--r--include/asm-s390/kprobes.h2
-rw-r--r--include/asm-s390/page.h3
-rw-r--r--include/asm-s390/percpu.h7
-rw-r--r--include/asm-s390/pgtable.h63
-rw-r--r--include/asm-s390/processor.h9
-rw-r--r--include/asm-s390/ptrace.h9
-rw-r--r--include/asm-s390/sclp.h47
-rw-r--r--include/asm-s390/sfp-machine.h6
-rw-r--r--include/asm-s390/sfp-util.h11
-rw-r--r--include/asm-s390/system.h10
-rw-r--r--include/asm-s390/termbits.h11
-rw-r--r--include/asm-sh/a.out.h1
-rw-r--r--include/asm-sh/bugs.h4
-rw-r--r--include/asm-sh/cache.h4
-rw-r--r--include/asm-sh/clock.h1
-rw-r--r--include/asm-sh/cpu-sh2/cache.h20
-rw-r--r--include/asm-sh/cpu-sh3/timer.h4
-rw-r--r--include/asm-sh/cpu-sh4/freq.h2
-rw-r--r--include/asm-sh/cpu-sh4/timer.h57
-rw-r--r--include/asm-sh/fb.h19
-rw-r--r--include/asm-sh/futex-irq.h111
-rw-r--r--include/asm-sh/futex.h79
-rw-r--r--include/asm-sh/hd64461.h397
-rw-r--r--include/asm-sh/hw_irq.h113
-rw-r--r--include/asm-sh/irq.h40
-rw-r--r--include/asm-sh/machvec.h4
-rw-r--r--include/asm-sh/machvec_init.h53
-rw-r--r--include/asm-sh/mmzone.h46
-rw-r--r--include/asm-sh/page.h10
-rw-r--r--include/asm-sh/parport.h16
-rw-r--r--include/asm-sh/pci.h9
-rw-r--r--include/asm-sh/pgtable.h12
-rw-r--r--include/asm-sh/processor.h8
-rw-r--r--include/asm-sh/rwsem.h6
-rw-r--r--include/asm-sh/saturn/io.h19
-rw-r--r--include/asm-sh/saturn/smpc.h34
-rw-r--r--include/asm-sh/se73180.h11
-rw-r--r--include/asm-sh/se7722.h40
-rw-r--r--include/asm-sh/sections.h2
-rw-r--r--include/asm-sh/setup.h1
-rw-r--r--include/asm-sh/sh03/io.h4
-rw-r--r--include/asm-sh/smp.h2
-rw-r--r--include/asm-sh/snapgear.h4
-rw-r--r--include/asm-sh/sparsemem.h16
-rw-r--r--include/asm-sh/system.h26
-rw-r--r--include/asm-sh/termbits.h11
-rw-r--r--include/asm-sh/topology.h30
-rw-r--r--include/asm-sh/uaccess.h40
-rw-r--r--include/asm-sh/ubc.h9
-rw-r--r--include/asm-sh/unistd.h3
-rw-r--r--include/asm-sh64/a.out.h1
-rw-r--r--include/asm-sh64/fb.h19
-rw-r--r--include/asm-sh64/pci.h9
-rw-r--r--include/asm-sh64/pgtable.h7
-rw-r--r--include/asm-sh64/unistd.h3
-rw-r--r--include/asm-sparc/a.out.h1
-rw-r--r--include/asm-sparc/device.h14
-rw-r--r--include/asm-sparc/fb.h21
-rw-r--r--include/asm-sparc/irq.h168
-rw-r--r--include/asm-sparc/of_device.h49
-rw-r--r--include/asm-sparc/of_platform.h32
-rw-r--r--include/asm-sparc/oplib.h26
-rw-r--r--include/asm-sparc/pci.h6
-rw-r--r--include/asm-sparc/pgtable.h16
-rw-r--r--include/asm-sparc/prom.h66
-rw-r--r--include/asm-sparc/system.h10
-rw-r--r--include/asm-sparc/unistd.h6
-rw-r--r--include/asm-sparc64/a.out.h2
-rw-r--r--include/asm-sparc64/bugs.h5
-rw-r--r--include/asm-sparc64/compat.h2
-rw-r--r--include/asm-sparc64/cpudata.h7
-rw-r--r--include/asm-sparc64/delay.h32
-rw-r--r--include/asm-sparc64/dma-mapping.h125
-rw-r--r--include/asm-sparc64/fb.h27
-rw-r--r--include/asm-sparc64/hvtramp.h37
-rw-r--r--include/asm-sparc64/hypervisor.h15
-rw-r--r--include/asm-sparc64/io.h5
-rw-r--r--include/asm-sparc64/irq.h3
-rw-r--r--include/asm-sparc64/kprobes.h1
-rw-r--r--include/asm-sparc64/ldc.h138
-rw-r--r--include/asm-sparc64/mdesc.h91
-rw-r--r--include/asm-sparc64/mmu_context.h3
-rw-r--r--include/asm-sparc64/of_device.h50
-rw-r--r--include/asm-sparc64/of_platform.h33
-rw-r--r--include/asm-sparc64/oplib.h28
-rw-r--r--include/asm-sparc64/parport.h232
-rw-r--r--include/asm-sparc64/pci.h47
-rw-r--r--include/asm-sparc64/percpu.h7
-rw-r--r--include/asm-sparc64/pgtable.h18
-rw-r--r--include/asm-sparc64/prom.h66
-rw-r--r--include/asm-sparc64/smp.h13
-rw-r--r--include/asm-sparc64/system.h16
-rw-r--r--include/asm-sparc64/tlb.h1
-rw-r--r--include/asm-sparc64/topology.h13
-rw-r--r--include/asm-sparc64/unistd.h6
-rw-r--r--include/asm-sparc64/vio.h406
-rw-r--r--include/asm-um/a.out.h3
-rw-r--r--include/asm-um/bug.h2
-rw-r--r--include/asm-um/common.lds.S2
-rw-r--r--include/asm-um/paravirt.h6
-rw-r--r--include/asm-um/pgtable.h18
-rw-r--r--include/asm-um/thread_info.h15
-rw-r--r--include/asm-v850/fb.h12
-rw-r--r--include/asm-v850/ioctls.h4
-rw-r--r--include/asm-v850/pci.h4
-rw-r--r--include/asm-v850/rte_cb.h1
-rw-r--r--include/asm-v850/termbits.h16
-rw-r--r--include/asm-v850/termios.h6
-rw-r--r--include/asm-x86_64/a.out.h3
-rw-r--r--include/asm-x86_64/acpi.h11
-rw-r--r--include/asm-x86_64/alternative.h68
-rw-r--r--include/asm-x86_64/apic.h6
-rw-r--r--include/asm-x86_64/auxvec.h2
-rw-r--r--include/asm-x86_64/boot.h16
-rw-r--r--include/asm-x86_64/bootparam.h1
-rw-r--r--include/asm-x86_64/calgary.h9
-rw-r--r--include/asm-x86_64/compat.h2
-rw-r--r--include/asm-x86_64/cpufeature.h115
-rw-r--r--include/asm-x86_64/dmi.h5
-rw-r--r--include/asm-x86_64/e820.h4
-rw-r--r--include/asm-x86_64/elf.h13
-rw-r--r--include/asm-x86_64/fb.h19
-rw-r--r--include/asm-x86_64/fixmap.h10
-rw-r--r--include/asm-x86_64/hpet.h62
-rw-r--r--include/asm-x86_64/hw_irq.h20
-rw-r--r--include/asm-x86_64/i8253.h6
-rw-r--r--include/asm-x86_64/io.h1
-rw-r--r--include/asm-x86_64/iommu.h29
-rw-r--r--include/asm-x86_64/kprobes.h1
-rw-r--r--include/asm-x86_64/mce.h2
-rw-r--r--include/asm-x86_64/mmu.h1
-rw-r--r--include/asm-x86_64/page.h3
-rw-r--r--include/asm-x86_64/pci.h63
-rw-r--r--include/asm-x86_64/percpu.h7
-rw-r--r--include/asm-x86_64/pgalloc.h73
-rw-r--r--include/asm-x86_64/pgtable.h29
-rw-r--r--include/asm-x86_64/processor.h4
-rw-r--r--include/asm-x86_64/proto.h18
-rw-r--r--include/asm-x86_64/ptrace.h1
-rw-r--r--include/asm-x86_64/required-features.h46
-rw-r--r--include/asm-x86_64/resume-trace.h13
-rw-r--r--include/asm-x86_64/segment.h8
-rw-r--r--include/asm-x86_64/string.h5
-rw-r--r--include/asm-x86_64/system.h11
-rw-r--r--include/asm-x86_64/thread_info.h2
-rw-r--r--include/asm-x86_64/timex.h1
-rw-r--r--include/asm-x86_64/tlbflush.h6
-rw-r--r--include/asm-x86_64/topology.h2
-rw-r--r--include/asm-x86_64/unistd.h6
-rw-r--r--include/asm-x86_64/vgtod.h29
-rw-r--r--include/asm-x86_64/vsyscall.h3
-rw-r--r--include/asm-xtensa/a.out.h1
-rw-r--r--include/asm-xtensa/bitops.h69
-rw-r--r--include/asm-xtensa/byteorder.h3
-rw-r--r--include/asm-xtensa/coprocessor.h8
-rw-r--r--include/asm-xtensa/div64.h15
-rw-r--r--include/asm-xtensa/elf.h3
-rw-r--r--include/asm-xtensa/fb.h12
-rw-r--r--include/asm-xtensa/fcntl.h100
-rw-r--r--include/asm-xtensa/mmu_context.h1
-rw-r--r--include/asm-xtensa/page.h2
-rw-r--r--include/asm-xtensa/param.h4
-rw-r--r--include/asm-xtensa/pci.h7
-rw-r--r--include/asm-xtensa/pgtable.h15
-rw-r--r--include/asm-xtensa/ptrace.h8
-rw-r--r--include/asm-xtensa/shmparam.h2
-rw-r--r--include/asm-xtensa/sigcontext.h24
-rw-r--r--include/asm-xtensa/termbits.h11
-rw-r--r--include/asm-xtensa/thread_info.h2
-rw-r--r--include/asm-xtensa/unistd.h4
-rw-r--r--include/linux/Kbuild4
-rw-r--r--include/linux/acpi.h7
-rw-r--r--include/linux/aer.h10
-rw-r--r--include/linux/aio.h2
-rw-r--r--include/linux/async_tx.h150
-rw-r--r--include/linux/ata.h42
-rw-r--r--include/linux/attribute_container.h1
-rw-r--r--include/linux/audit.h11
-rw-r--r--include/linux/backing-dev.h1
-rw-r--r--include/linux/binfmts.h19
-rw-r--r--include/linux/blkdev.h33
-rw-r--r--include/linux/bsg.h69
-rw-r--r--include/linux/buffer_head.h2
-rw-r--r--include/linux/bug.h7
-rw-r--r--include/linux/capability.h1
-rw-r--r--include/linux/cdrom.h4
-rw-r--r--include/linux/clockchips.h5
-rw-r--r--include/linux/clocksource.h6
-rw-r--r--include/linux/cobalt-nvram.h109
-rw-r--r--include/linux/coda_linux.h4
-rw-r--r--include/linux/coda_proc.h76
-rw-r--r--include/linux/coda_psdev.h15
-rw-r--r--include/linux/compiler-gcc4.h18
-rw-r--r--include/linux/compiler.h9
-rw-r--r--include/linux/configfs.h34
-rw-r--r--include/linux/console.h3
-rw-r--r--include/linux/console_struct.h5
-rw-r--r--include/linux/consolemap.h5
-rw-r--r--include/linux/cpu.h1
-rw-r--r--include/linux/crc7.h14
-rw-r--r--include/linux/crypto.h20
-rw-r--r--include/linux/dcookies.h1
-rw-r--r--include/linux/debugfs.h9
-rw-r--r--include/linux/device.h15
-rw-r--r--include/linux/dlm.h14
-rw-r--r--include/linux/dlm_device.h22
-rw-r--r--include/linux/dlm_netlink.h56
-rw-r--r--include/linux/dma-mapping.h4
-rw-r--r--include/linux/dmaengine.h293
-rw-r--r--include/linux/dmi.h8
-rw-r--r--include/linux/ds17287rtc.h1
-rw-r--r--include/linux/edac.h29
-rw-r--r--include/linux/edd.h4
-rw-r--r--include/linux/eeprom_93cx6.h72
-rw-r--r--include/linux/efs_fs.h1
-rw-r--r--include/linux/elf-em.h3
-rw-r--r--include/linux/elfnote.h22
-rw-r--r--include/linux/etherdevice.h9
-rw-r--r--include/linux/ethtool.h1
-rw-r--r--include/linux/eventfd.h3
-rw-r--r--include/linux/exportfs.h126
-rw-r--r--include/linux/ext2_fs_sb.h2
-rw-r--r--include/linux/ext3_fs_sb.h2
-rw-r--r--include/linux/ext4_fs.h104
-rw-r--r--include/linux/ext4_fs_extents.h43
-rw-r--r--include/linux/ext4_fs_i.h5
-rw-r--r--include/linux/ext4_fs_sb.h5
-rw-r--r--include/linux/falloc.h6
-rw-r--r--include/linux/fb.h3
-rw-r--r--include/linux/file.h1
-rw-r--r--include/linux/firewire-cdev.h297
-rw-r--r--include/linux/freezer.h23
-rw-r--r--include/linux/fs.h201
-rw-r--r--include/linux/fsl_devices.h8
-rw-r--r--include/linux/fuse.h2
-rw-r--r--include/linux/futex.h9
-rw-r--r--include/linux/genetlink.h13
-rw-r--r--include/linux/gfp.h19
-rw-r--r--include/linux/gfs2_ondisk.h142
-rw-r--r--include/linux/gpio_mouse.h61
-rw-r--r--include/linux/hardirq.h13
-rw-r--r--include/linux/hid.h56
-rw-r--r--include/linux/highmem.h36
-rw-r--r--include/linux/hrtimer.h5
-rw-r--r--include/linux/hugetlb.h6
-rw-r--r--include/linux/i2c-id.h7
-rw-r--r--include/linux/i2c-isa.h36
-rw-r--r--include/linux/i2c.h20
-rw-r--r--include/linux/i2o.h8
-rw-r--r--include/linux/ide.h50
-rw-r--r--include/linux/idr.h32
-rw-r--r--include/linux/ieee80211.h11
-rw-r--r--include/linux/if_link.h47
-rw-r--r--include/linux/if_macvlan.h9
-rw-r--r--include/linux/if_ppp.h16
-rw-r--r--include/linux/if_pppol2tp.h69
-rw-r--r--include/linux/if_pppox.h16
-rw-r--r--include/linux/if_tun.h2
-rw-r--r--include/linux/if_vlan.h19
-rw-r--r--include/linux/inetdevice.h104
-rw-r--r--include/linux/init.h12
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/input.h166
-rw-r--r--include/linux/io.h29
-rw-r--r--include/linux/ioprio.h14
-rw-r--r--include/linux/ip_mp_alg.h22
-rw-r--r--include/linux/ipc.h12
-rw-r--r--include/linux/ipv6.h10
-rw-r--r--include/linux/irda.h29
-rw-r--r--include/linux/irq.h1
-rw-r--r--include/linux/jbd2.h6
-rw-r--r--include/linux/kallsyms.h7
-rw-r--r--include/linux/kernel.h21
-rw-r--r--include/linux/kernelcapi.h2
-rw-r--r--include/linux/kmod.h52
-rw-r--r--include/linux/kobject.h34
-rw-r--r--include/linux/kprobes.h6
-rw-r--r--include/linux/ktime.h22
-rw-r--r--include/linux/leds.h1
-rw-r--r--include/linux/lguest.h85
-rw-r--r--include/linux/lguest_bus.h48
-rw-r--r--include/linux/lguest_launcher.h73
-rw-r--r--include/linux/libata.h88
-rw-r--r--include/linux/limits.h2
-rw-r--r--include/linux/linux_logo.h8
-rw-r--r--include/linux/lockd/bind.h9
-rw-r--r--include/linux/lockd/lockd.h1
-rw-r--r--include/linux/lockdep.h71
-rw-r--r--include/linux/lzo.h44
-rw-r--r--include/linux/magic.h1
-rw-r--r--include/linux/major.h2
-rw-r--r--include/linux/mempolicy.h6
-rw-r--r--include/linux/mlx4/cmd.h1
-rw-r--r--include/linux/mlx4/device.h15
-rw-r--r--include/linux/mlx4/qp.h7
-rw-r--r--include/linux/mm.h152
-rw-r--r--include/linux/mmzone.h33
-rw-r--r--include/linux/mnt_namespace.h2
-rw-r--r--include/linux/module.h1
-rw-r--r--include/linux/msdos_fs.h2
-rw-r--r--include/linux/mtd/super.h30
-rw-r--r--include/linux/mv643xx.h4
-rw-r--r--include/linux/namei.h4
-rw-r--r--include/linux/ncp_fs.h2
-rw-r--r--include/linux/netdevice.h141
-rw-r--r--include/linux/netfilter.h3
-rw-r--r--include/linux/netfilter/nf_conntrack_pptp.h2
-rw-r--r--include/linux/netfilter/x_tables.h36
-rw-r--r--include/linux/netfilter/xt_connlimit.h17
-rw-r--r--include/linux/netfilter/xt_u32.h40
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h20
-rw-r--r--include/linux/netfilter_ipv4/ipt_CLUSTERIP.h4
-rw-r--r--include/linux/netfilter_ipv4/ipt_iprange.h2
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h10
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/nfs4.h1
-rw-r--r--include/linux/nfs4_mount.h3
-rw-r--r--include/linux/nfs_fs.h32
-rw-r--r--include/linux/nfs_fs_sb.h8
-rw-r--r--include/linux/nfs_mount.h3
-rw-r--r--include/linux/nfs_page.h25
-rw-r--r--include/linux/nfs_xdr.h37
-rw-r--r--include/linux/nfsd/export.h30
-rw-r--r--include/linux/nfsd/interface.h13
-rw-r--r--include/linux/nfsd/nfsd.h9
-rw-r--r--include/linux/nfsd/state.h3
-rw-r--r--include/linux/nfsd/xdr4.h7
-rw-r--r--include/linux/notifier.h9
-rw-r--r--include/linux/nsproxy.h3
-rw-r--r--include/linux/of.h61
-rw-r--r--include/linux/of_device.h26
-rw-r--r--include/linux/of_platform.h57
-rw-r--r--include/linux/oprofile.h35
-rw-r--r--include/linux/page-flags.h50
-rw-r--r--include/linux/pata_platform.h5
-rw-r--r--include/linux/pci.h31
-rw-r--r--include/linux/pci_ids.h85
-rw-r--r--include/linux/pda_power.h31
-rw-r--r--include/linux/percpu.h2
-rw-r--r--include/linux/percpu_counter.h18
-rw-r--r--include/linux/pid_namespace.h2
-rw-r--r--include/linux/pipe_fs_i.h147
-rw-r--r--include/linux/pkt_cls.h17
-rw-r--r--include/linux/pkt_sched.h9
-rw-r--r--include/linux/pm.h79
-rw-r--r--include/linux/power_supply.h180
-rw-r--r--include/linux/prctl.h4
-rw-r--r--include/linux/prefetch.h2
-rw-r--r--include/linux/proc_fs.h13
-rw-r--r--include/linux/ptrace.h2
-rw-r--r--include/linux/raid/bitmap.h6
-rw-r--r--include/linux/raid/md_k.h2
-rw-r--r--include/linux/raid/raid5.h97
-rw-r--r--include/linux/raid/xor.h5
-rw-r--r--include/linux/reboot.h5
-rw-r--r--include/linux/resume-trace.h19
-rw-r--r--include/linux/rfkill.h2
-rw-r--r--include/linux/rtc/m48t59.h57
-rw-r--r--include/linux/rtnetlink.h20
-rw-r--r--include/linux/sched.h293
-rw-r--r--include/linux/screen_info.h9
-rw-r--r--include/linux/scx200_gpio.h2
-rw-r--r--include/linux/seccomp.h19
-rw-r--r--include/linux/security.h17
-rw-r--r--include/linux/seq_file.h11
-rw-r--r--include/linux/serial.h6
-rw-r--r--include/linux/serial_8250.h6
-rw-r--r--include/linux/serial_core.h8
-rw-r--r--include/linux/serio.h2
-rw-r--r--include/linux/signal.h1
-rw-r--r--include/linux/skbuff.h71
-rw-r--r--include/linux/slab.h157
-rw-r--r--include/linux/slab_def.h38
-rw-r--r--include/linux/slob_def.h36
-rw-r--r--include/linux/slub_def.h49
-rw-r--r--include/linux/sm501-regs.h8
-rw-r--r--include/linux/smp.h13
-rw-r--r--include/linux/smp_lock.h1
-rw-r--r--include/linux/socket.h4
-rw-r--r--include/linux/sonypi.h2
-rw-r--r--include/linux/spi/ads7846.h14
-rw-r--r--include/linux/spi/spi.h21
-rw-r--r--include/linux/spi/spi_bitbang.h1
-rw-r--r--include/linux/spi/tle62x0.h24
-rw-r--r--include/linux/spinlock.h7
-rw-r--r--include/linux/spinlock_types.h4
-rw-r--r--include/linux/spinlock_types_up.h9
-rw-r--r--include/linux/splice.h73
-rw-r--r--include/linux/stacktrace.h2
-rw-r--r--include/linux/string.h4
-rw-r--r--include/linux/sunrpc/auth.h48
-rw-r--r--include/linux/sunrpc/auth_gss.h6
-rw-r--r--include/linux/sunrpc/clnt.h33
-rw-r--r--include/linux/sunrpc/gss_api.h3
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h2
-rw-r--r--include/linux/sunrpc/sched.h6
-rw-r--r--include/linux/sunrpc/svc.h4
-rw-r--r--include/linux/sunrpc/svcauth.h1
-rw-r--r--include/linux/sunrpc/svcauth_gss.h1
-rw-r--r--include/linux/sunrpc/svcsock.h1
-rw-r--r--include/linux/sunrpc/xdr.h16
-rw-r--r--include/linux/sunrpc/xprt.h16
-rw-r--r--include/linux/suspend.h52
-rw-r--r--include/linux/swap.h3
-rw-r--r--include/linux/syscalls.h5
-rw-r--r--include/linux/sysdev.h3
-rw-r--r--include/linux/sysfs.h43
-rw-r--r--include/linux/taskstats.h5
-rw-r--r--include/linux/time.h8
-rw-r--r--include/linux/timer.h16
-rw-r--r--include/linux/timex.h60
-rw-r--r--include/linux/topology.h14
-rw-r--r--include/linux/tty.h39
-rw-r--r--include/linux/udp.h6
-rw-r--r--include/linux/uio.h9
-rw-r--r--include/linux/uio_driver.h91
-rw-r--r--include/linux/usb.h85
-rw-r--r--include/linux/usb/Kbuild1
-rw-r--r--include/linux/usb/gadgetfs.h (renamed from include/linux/usb_gadgetfs.h)24
-rw-r--r--include/linux/usb/quirks.h3
-rw-r--r--include/linux/usb/serial.h7
-rw-r--r--include/linux/usb_gadget.h48
-rw-r--r--include/linux/user_namespace.h61
-rw-r--r--include/linux/utsname.h16
-rw-r--r--include/linux/videodev2.h8
-rw-r--r--include/linux/vmalloc.h14
-rw-r--r--include/linux/vmstat.h5
-rw-r--r--include/linux/vt_kern.h2
-rw-r--r--include/linux/wait.h16
-rw-r--r--include/linux/workqueue.h15
-rw-r--r--include/media/saa7146.h6
-rw-r--r--include/media/tuner.h71
-rw-r--r--include/mtd/ubi-header.h101
-rw-r--r--include/net/9p/9p.h417
-rw-r--r--include/net/9p/client.h80
-rw-r--r--include/net/9p/conn.h57
-rw-r--r--include/net/9p/transport.h49
-rw-r--r--include/net/act_api.h32
-rw-r--r--include/net/addrconf.h2
-rw-r--r--include/net/af_unix.h11
-rw-r--r--include/net/ax88796.h27
-rw-r--r--include/net/bluetooth/hci.h18
-rw-r--r--include/net/bluetooth/hci_core.h5
-rw-r--r--include/net/bluetooth/rfcomm.h1
-rw-r--r--include/net/cfg80211.h38
-rw-r--r--include/net/cipso_ipv4.h20
-rw-r--r--include/net/dn.h1
-rw-r--r--include/net/dst.h1
-rw-r--r--include/net/fib_rules.h2
-rw-r--r--include/net/flow.h4
-rw-r--r--include/net/genetlink.h24
-rw-r--r--include/net/inet_timewait_sock.h3
-rw-r--r--include/net/ip.h1
-rw-r--r--include/net/ip_fib.h18
-rw-r--r--include/net/ip_mp_alg.h96
-rw-r--r--include/net/ipv6.h4
-rw-r--r--include/net/irda/irda.h3
-rw-r--r--include/net/irda/irlap.h19
-rw-r--r--include/net/iucv/af_iucv.h1
-rw-r--r--include/net/mac80211.h22
-rw-r--r--include/net/mip6.h4
-rw-r--r--include/net/netfilter/ipv4/nf_conntrack_ipv4.h25
-rw-r--r--include/net/netfilter/ipv6/nf_conntrack_ipv6.h2
-rw-r--r--include/net/netfilter/nf_conntrack.h70
-rw-r--r--include/net/netfilter/nf_conntrack_core.h11
-rw-r--r--include/net/netfilter/nf_conntrack_ecache.h17
-rw-r--r--include/net/netfilter/nf_conntrack_expect.h42
-rw-r--r--include/net/netfilter/nf_conntrack_extend.h85
-rw-r--r--include/net/netfilter/nf_conntrack_helper.h16
-rw-r--r--include/net/netfilter/nf_conntrack_l3proto.h10
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h78
-rw-r--r--include/net/netfilter/nf_nat.h28
-rw-r--r--include/net/netfilter/nf_nat_core.h1
-rw-r--r--include/net/netlabel.h72
-rw-r--r--include/net/netlink.h96
-rw-r--r--include/net/pkt_cls.h10
-rw-r--r--include/net/pkt_sched.h4
-rw-r--r--include/net/rawv6.h9
-rw-r--r--include/net/route.h3
-rw-r--r--include/net/rtnetlink.h58
-rw-r--r--include/net/sch_generic.h2
-rw-r--r--include/net/scm.h2
-rw-r--r--include/net/sctp/sctp.h7
-rw-r--r--include/net/sctp/structs.h7
-rw-r--r--include/net/tcp.h6
-rw-r--r--include/net/tipc/tipc_port.h6
-rw-r--r--include/net/udp.h9
-rw-r--r--include/net/udplite.h2
-rw-r--r--include/net/xfrm.h28
-rw-r--r--include/pcmcia/ciscode.h2
-rw-r--r--include/rdma/ib_cm.h1
-rw-r--r--include/rdma/ib_mad.h3
-rw-r--r--include/scsi/iscsi_if.h34
-rw-r--r--include/scsi/libiscsi.h67
-rw-r--r--include/scsi/scsi_cmnd.h20
-rw-r--r--include/scsi/scsi_device.h2
-rw-r--r--include/scsi/scsi_host.h10
-rw-r--r--include/scsi/scsi_transport_fc.h186
-rw-r--r--include/scsi/scsi_transport_iscsi.h16
-rw-r--r--include/sound/ak4xxx-adda.h1
-rw-r--r--include/sound/cs46xx.h4
-rw-r--r--include/sound/cs46xx_dsp_spos.h2
-rw-r--r--include/sound/emu10k1.h16
-rw-r--r--include/sound/sb.h1
-rw-r--r--include/sound/version.h2
-rw-r--r--include/sound/wavefront_fx.h9
-rw-r--r--include/video/tgafb.h1
-rw-r--r--include/xen/events.h48
-rw-r--r--include/xen/features.h23
-rw-r--r--include/xen/grant_table.h107
-rw-r--r--include/xen/hvc-console.h6
-rw-r--r--include/xen/interface/elfnote.h133
-rw-r--r--include/xen/interface/event_channel.h195
-rw-r--r--include/xen/interface/features.h43
-rw-r--r--include/xen/interface/grant_table.h375
-rw-r--r--include/xen/interface/io/blkif.h94
-rw-r--r--include/xen/interface/io/console.h23
-rw-r--r--include/xen/interface/io/netif.h158
-rw-r--r--include/xen/interface/io/ring.h260
-rw-r--r--include/xen/interface/io/xenbus.h44
-rw-r--r--include/xen/interface/io/xs_wire.h87
-rw-r--r--include/xen/interface/memory.h145
-rw-r--r--include/xen/interface/physdev.h145
-rw-r--r--include/xen/interface/sched.h77
-rw-r--r--include/xen/interface/vcpu.h167
-rw-r--r--include/xen/interface/version.h60
-rw-r--r--include/xen/interface/xen.h447
-rw-r--r--include/xen/page.h179
-rw-r--r--include/xen/xenbus.h234
966 files changed, 24881 insertions, 11374 deletions
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index e64a748bdd2e..45662f6dbdb6 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -486,6 +486,8 @@
486#define ACPI_FUNCTION_NAME(name) 486#define ACPI_FUNCTION_NAME(name)
487#endif 487#endif
488 488
489#ifdef DEBUG_FUNC_TRACE
490
489#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ 491#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
490 acpi_ut_trace(ACPI_DEBUG_PARAMETERS) 492 acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
491#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ 493#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \
@@ -563,6 +565,27 @@
563 565
564#endif /* ACPI_SIMPLE_RETURN_MACROS */ 566#endif /* ACPI_SIMPLE_RETURN_MACROS */
565 567
568#else /* !DEBUG_FUNC_TRACE */
569
570#define ACPI_FUNCTION_TRACE(a)
571#define ACPI_FUNCTION_TRACE_PTR(a,b)
572#define ACPI_FUNCTION_TRACE_U32(a,b)
573#define ACPI_FUNCTION_TRACE_STR(a,b)
574#define ACPI_FUNCTION_EXIT
575#define ACPI_FUNCTION_STATUS_EXIT(s)
576#define ACPI_FUNCTION_VALUE_EXIT(s)
577#define ACPI_FUNCTION_TRACE(a)
578#define ACPI_FUNCTION_ENTRY()
579
580#define return_VOID return
581#define return_ACPI_STATUS(s) return(s)
582#define return_VALUE(s) return(s)
583#define return_UINT8(s) return(s)
584#define return_UINT32(s) return(s)
585#define return_PTR(s) return(s)
586
587#endif /* DEBUG_FUNC_TRACE */
588
566/* Conditional execution */ 589/* Conditional execution */
567 590
568#define ACPI_DEBUG_EXEC(a) a 591#define ACPI_DEBUG_EXEC(a) a
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 7812267b577f..c090a8b0bc99 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -178,8 +178,8 @@
178 178
179/* Defaults for debug_level, debug and normal */ 179/* Defaults for debug_level, debug and normal */
180 180
181#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) 181#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR)
182#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) 182#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR)
183#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) 183#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
184 184
185#endif /* __ACOUTPUT_H__ */ 185#endif /* __ACOUTPUT_H__ */
diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h
index b62cd36ff324..62c5ee4311da 100644
--- a/include/acpi/acpi_numa.h
+++ b/include/acpi/acpi_numa.h
@@ -13,7 +13,8 @@
13 13
14extern int pxm_to_node(int); 14extern int pxm_to_node(int);
15extern int node_to_pxm(int); 15extern int node_to_pxm(int);
16extern int __cpuinit acpi_map_pxm_to_node(int); 16extern void __acpi_map_pxm_to_node(int, int);
17extern int acpi_map_pxm_to_node(int);
17extern void __cpuinit acpi_unmap_pxm_to_node(int); 18extern void __cpuinit acpi_unmap_pxm_to_node(int);
18 19
19#endif /* CONFIG_ACPI_NUMA */ 20#endif /* CONFIG_ACPI_NUMA */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 5e07db0d46e9..ca882b8e7d10 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -78,7 +78,7 @@ struct acpi_signal_fatal_info {
78/* 78/*
79 * OSL Initialization and shutdown primitives 79 * OSL Initialization and shutdown primitives
80 */ 80 */
81acpi_status acpi_os_initialize(void); 81acpi_status __initdata acpi_os_initialize(void);
82 82
83acpi_status acpi_os_terminate(void); 83acpi_status acpi_os_terminate(void);
84 84
@@ -236,6 +236,7 @@ acpi_os_derive_pci_id(acpi_handle rhandle,
236 * Miscellaneous 236 * Miscellaneous
237 */ 237 */
238acpi_status acpi_os_validate_interface(char *interface); 238acpi_status acpi_os_validate_interface(char *interface);
239acpi_status acpi_osi_invalidate(char* interface);
239 240
240acpi_status 241acpi_status
241acpi_os_validate_address(u8 space_id, 242acpi_os_validate_address(u8 space_id,
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index e08f7df85a4f..b5cca5daa348 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -55,7 +55,7 @@ acpi_status
55acpi_initialize_tables(struct acpi_table_desc *initial_storage, 55acpi_initialize_tables(struct acpi_table_desc *initial_storage,
56 u32 initial_table_count, u8 allow_resize); 56 u32 initial_table_count, u8 allow_resize);
57 57
58acpi_status acpi_initialize_subsystem(void); 58acpi_status __init acpi_initialize_subsystem(void);
59 59
60acpi_status acpi_enable_subsystem(u32 flags); 60acpi_status acpi_enable_subsystem(u32 flags);
61 61
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index 15a838862cd4..a87ef1c8d46b 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -390,6 +390,8 @@ void acpi_ut_delete_object_desc(union acpi_operand_object *object);
390 390
391u8 acpi_ut_valid_internal_object(void *object); 391u8 acpi_ut_valid_internal_object(void *object);
392 392
393union acpi_operand_object *acpi_ut_create_package_object(u32 count);
394
393union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size); 395union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size);
394 396
395union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size); 397union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size);
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index dab2ec59a3b0..c785485e62a6 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -136,7 +136,7 @@
136 136
137/*! [Begin] no source code translation */ 137/*! [Begin] no source code translation */
138 138
139#if defined(__linux__) 139#if defined(_LINUX) || defined(__linux__)
140#include "aclinux.h" 140#include "aclinux.h"
141 141
142#elif defined(_AED_EFI) 142#elif defined(_AED_EFI)
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index a568717f98c6..6ed15a0978eb 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -91,7 +91,10 @@
91#define ACPI_USE_NATIVE_DIVIDE 91#define ACPI_USE_NATIVE_DIVIDE
92#endif 92#endif
93 93
94#ifndef __cdecl
94#define __cdecl 95#define __cdecl
96#endif
97
95#define ACPI_FLUSH_CPU_CACHE() 98#define ACPI_FLUSH_CPU_CACHE()
96#endif /* __KERNEL__ */ 99#endif /* __KERNEL__ */
97 100
diff --git a/include/asm-alpha/a.out.h b/include/asm-alpha/a.out.h
index d97daf42753d..e43cf61649a9 100644
--- a/include/asm-alpha/a.out.h
+++ b/include/asm-alpha/a.out.h
@@ -101,6 +101,8 @@ struct exec
101#define STACK_TOP \ 101#define STACK_TOP \
102 (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL) 102 (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
103 103
104#define STACK_TOP_MAX 0x00120000000UL
105
104#endif 106#endif
105 107
106#endif /* __A_OUT_GNU_H__ */ 108#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-alpha/fb.h b/include/asm-alpha/fb.h
new file mode 100644
index 000000000000..fa9bbb96b2b3
--- /dev/null
+++ b/include/asm-alpha/fb.h
@@ -0,0 +1,13 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/device.h>
4
5/* Caching is off in the I/O space quadrant by design. */
6#define fb_pgprotect(...) do {} while (0)
7
8static inline int fb_is_primary_device(struct fb_info *info)
9{
10 return 0;
11}
12
13#endif /* _ASM_FB_H_ */
diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h
index 21a86f1a05b3..ab5b60dcef19 100644
--- a/include/asm-alpha/io.h
+++ b/include/asm-alpha/io.h
@@ -4,6 +4,7 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/mm.h>
7#include <asm/compiler.h> 8#include <asm/compiler.h>
8#include <asm/system.h> 9#include <asm/system.h>
9#include <asm/pgtable.h> 10#include <asm/pgtable.h>
@@ -90,6 +91,11 @@ static inline void * phys_to_virt(unsigned long address)
90 91
91#define page_to_phys(page) page_to_pa(page) 92#define page_to_phys(page) page_to_pa(page)
92 93
94static inline dma_addr_t __deprecated isa_page_to_bus(struct page *page)
95{
96 return page_to_phys(page);
97}
98
93/* This depends on working iommu. */ 99/* This depends on working iommu. */
94#define BIO_VMERGE_BOUNDARY (alpha_mv.mv_pci_tbi ? PAGE_SIZE : 0) 100#define BIO_VMERGE_BOUNDARY (alpha_mv.mv_pci_tbi ? PAGE_SIZE : 0)
95 101
@@ -102,12 +108,12 @@ static inline void * phys_to_virt(unsigned long address)
102 * 108 *
103 * Note that this only works for a limited range of kernel addresses, 109 * Note that this only works for a limited range of kernel addresses,
104 * and very well may not span all memory. Consider this interface 110 * and very well may not span all memory. Consider this interface
105 * deprecated in favour of the mapping functions in <asm/pci.h>. 111 * deprecated in favour of the DMA-mapping API.
106 */ 112 */
107extern unsigned long __direct_map_base; 113extern unsigned long __direct_map_base;
108extern unsigned long __direct_map_size; 114extern unsigned long __direct_map_size;
109 115
110static inline unsigned long virt_to_bus(void *address) 116static inline unsigned long __deprecated virt_to_bus(void *address)
111{ 117{
112 unsigned long phys = virt_to_phys(address); 118 unsigned long phys = virt_to_phys(address);
113 unsigned long bus = phys + __direct_map_base; 119 unsigned long bus = phys + __direct_map_base;
@@ -115,7 +121,7 @@ static inline unsigned long virt_to_bus(void *address)
115} 121}
116#define isa_virt_to_bus virt_to_bus 122#define isa_virt_to_bus virt_to_bus
117 123
118static inline void *bus_to_virt(unsigned long address) 124static inline void * __deprecated bus_to_virt(unsigned long address)
119{ 125{
120 void *virt; 126 void *virt;
121 127
@@ -126,6 +132,7 @@ static inline void *bus_to_virt(unsigned long address)
126 virt = phys_to_virt(address); 132 virt = phys_to_virt(address);
127 return (long)address <= 0 ? NULL : virt; 133 return (long)address <= 0 ? NULL : virt;
128} 134}
135#define isa_bus_to_virt bus_to_virt
129 136
130/* 137/*
131 * There are different chipsets to interface the Alpha CPUs to the world. 138 * There are different chipsets to interface the Alpha CPUs to the world.
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h
index d2bed3cb33ff..bae7f05716d4 100644
--- a/include/asm-alpha/page.h
+++ b/include/asm-alpha/page.h
@@ -17,7 +17,8 @@
17extern void clear_page(void *page); 17extern void clear_page(void *page);
18#define clear_user_page(page, vaddr, pg) clear_page(page) 18#define clear_user_page(page, vaddr, pg) clear_page(page)
19 19
20#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vmaddr) 20#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
21 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vmaddr)
21#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 22#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
22 23
23extern void copy_page(void * _to, void * _from); 24extern void copy_page(void * _to, void * _from);
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h
index 85aa1127c903..30ee7669b19f 100644
--- a/include/asm-alpha/pci.h
+++ b/include/asm-alpha/pci.h
@@ -199,30 +199,6 @@ pci_dma_sync_sg_for_device(struct pci_dev *dev, struct scatterlist *sg,
199 199
200extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask); 200extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask);
201 201
202/* True if the machine supports DAC addressing, and DEV can
203 make use of it given MASK. */
204extern int pci_dac_dma_supported(struct pci_dev *hwdev, u64 mask);
205
206/* Convert to/from DAC dma address and struct page. */
207extern dma64_addr_t pci_dac_page_to_dma(struct pci_dev *, struct page *,
208 unsigned long, int);
209extern struct page *pci_dac_dma_to_page(struct pci_dev *, dma64_addr_t);
210extern unsigned long pci_dac_dma_to_offset(struct pci_dev *, dma64_addr_t);
211
212static inline void
213pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, dma64_addr_t dma_addr,
214 size_t len, int direction)
215{
216 /* Nothing to do. */
217}
218
219static inline void
220pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr,
221 size_t len, int direction)
222{
223 /* Nothing to do. */
224}
225
226#ifdef CONFIG_PCI 202#ifdef CONFIG_PCI
227static inline void pci_dma_burst_advice(struct pci_dev *pdev, 203static inline void pci_dma_burst_advice(struct pci_dev *pdev,
228 enum pci_dma_burst_strategy *strat, 204 enum pci_dma_burst_strategy *strat,
@@ -275,11 +251,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
275 return hose->need_domain_info; 251 return hose->need_domain_info;
276} 252}
277 253
278static inline void
279pcibios_add_platform_entries(struct pci_dev *dev)
280{
281}
282
283struct pci_dev *alpha_gendev_to_pci(struct device *dev); 254struct pci_dev *alpha_gendev_to_pci(struct device *dev);
284 255
285#endif /* __KERNEL__ */ 256#endif /* __KERNEL__ */
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h
index 616d20662ff3..99037b032357 100644
--- a/include/asm-alpha/pgtable.h
+++ b/include/asm-alpha/pgtable.h
@@ -264,21 +264,15 @@ extern inline void pgd_clear(pgd_t * pgdp) { pgd_val(*pgdp) = 0; }
264 * The following only work if pte_present() is true. 264 * The following only work if pte_present() is true.
265 * Undefined behaviour if not.. 265 * Undefined behaviour if not..
266 */ 266 */
267extern inline int pte_read(pte_t pte) { return !(pte_val(pte) & _PAGE_FOR); }
268extern inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_FOW); } 267extern inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_FOW); }
269extern inline int pte_exec(pte_t pte) { return !(pte_val(pte) & _PAGE_FOE); }
270extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } 268extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
271extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 269extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
272extern inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 270extern inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
273 271
274extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOW; return pte; } 272extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOW; return pte; }
275extern inline pte_t pte_rdprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOR; return pte; }
276extern inline pte_t pte_exprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOE; return pte; }
277extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~(__DIRTY_BITS); return pte; } 273extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~(__DIRTY_BITS); return pte; }
278extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~(__ACCESS_BITS); return pte; } 274extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~(__ACCESS_BITS); return pte; }
279extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) &= ~_PAGE_FOW; return pte; } 275extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) &= ~_PAGE_FOW; return pte; }
280extern inline pte_t pte_mkread(pte_t pte) { pte_val(pte) &= ~_PAGE_FOR; return pte; }
281extern inline pte_t pte_mkexec(pte_t pte) { pte_val(pte) &= ~_PAGE_FOE; return pte; }
282extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= __DIRTY_BITS; return pte; } 276extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= __DIRTY_BITS; return pte; }
283extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= __ACCESS_BITS; return pte; } 277extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= __ACCESS_BITS; return pte; }
284 278
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
index cf1021a97b2e..620c4d86cbf4 100644
--- a/include/asm-alpha/system.h
+++ b/include/asm-alpha/system.h
@@ -139,16 +139,6 @@ extern void halt(void) __attribute__((noreturn));
139struct task_struct; 139struct task_struct;
140extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); 140extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*);
141 141
142/*
143 * On SMP systems, when the scheduler does migration-cost autodetection,
144 * it needs a way to flush as much of the CPU's caches as possible.
145 *
146 * TODO: fill this in!
147 */
148static inline void sched_cacheflush(void)
149{
150}
151
152#define imb() \ 142#define imb() \
153__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") 143__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory")
154 144
diff --git a/include/asm-alpha/termios.h b/include/asm-alpha/termios.h
index 39e492c3bfa3..fa13716a11c3 100644
--- a/include/asm-alpha/termios.h
+++ b/include/asm-alpha/termios.h
@@ -81,7 +81,7 @@ struct termio {
81 81
82#define user_termio_to_kernel_termios(a_termios, u_termio) \ 82#define user_termio_to_kernel_termios(a_termios, u_termio) \
83({ \ 83({ \
84 struct termios *k_termios = (a_termios); \ 84 struct ktermios *k_termios = (a_termios); \
85 struct termio k_termio; \ 85 struct termio k_termio; \
86 int canon, ret; \ 86 int canon, ret; \
87 \ 87 \
@@ -113,7 +113,7 @@ struct termio {
113 */ 113 */
114#define kernel_termios_to_user_termio(u_termio, a_termios) \ 114#define kernel_termios_to_user_termio(u_termio, a_termios) \
115({ \ 115({ \
116 struct termios *k_termios = (a_termios); \ 116 struct ktermios *k_termios = (a_termios); \
117 struct termio k_termio; \ 117 struct termio k_termio; \
118 int canon; \ 118 int canon; \
119 \ 119 \
diff --git a/include/asm-arm/Kbuild b/include/asm-arm/Kbuild
index c68e1680da01..73237bd130a2 100644
--- a/include/asm-arm/Kbuild
+++ b/include/asm-arm/Kbuild
@@ -1 +1,3 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2
3unifdef-y += hwcap.h
diff --git a/include/asm-arm/a.out.h b/include/asm-arm/a.out.h
index 3e5fe64c4394..d7165e86df25 100644
--- a/include/asm-arm/a.out.h
+++ b/include/asm-arm/a.out.h
@@ -30,6 +30,7 @@ struct exec
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \ 31#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \
32 TASK_SIZE : TASK_SIZE_26) 32 TASK_SIZE : TASK_SIZE_26)
33#define STACK_TOP_MAX TASK_SIZE
33#endif 34#endif
34 35
35#ifndef LIBRARY_START_TEXT 36#ifndef LIBRARY_START_TEXT
diff --git a/include/asm-arm/arch-at91/at91_dbgu.h b/include/asm-arm/arch-at91/at91_dbgu.h
index b0369e176f7b..8019ffd0ad3b 100644
--- a/include/asm-arm/arch-at91/at91_dbgu.h
+++ b/include/asm-arm/arch-at91/at91_dbgu.h
@@ -16,6 +16,7 @@
16#ifndef AT91_DBGU_H 16#ifndef AT91_DBGU_H
17#define AT91_DBGU_H 17#define AT91_DBGU_H
18 18
19#ifdef AT91_DBGU
19#define AT91_DBGU_CR (AT91_DBGU + 0x00) /* Control Register */ 20#define AT91_DBGU_CR (AT91_DBGU + 0x00) /* Control Register */
20#define AT91_DBGU_MR (AT91_DBGU + 0x04) /* Mode Register */ 21#define AT91_DBGU_MR (AT91_DBGU + 0x04) /* Mode Register */
21#define AT91_DBGU_IER (AT91_DBGU + 0x08) /* Interrupt Enable Register */ 22#define AT91_DBGU_IER (AT91_DBGU + 0x08) /* Interrupt Enable Register */
@@ -30,6 +31,15 @@
30 31
31#define AT91_DBGU_CIDR (AT91_DBGU + 0x40) /* Chip ID Register */ 32#define AT91_DBGU_CIDR (AT91_DBGU + 0x40) /* Chip ID Register */
32#define AT91_DBGU_EXID (AT91_DBGU + 0x44) /* Chip ID Extension Register */ 33#define AT91_DBGU_EXID (AT91_DBGU + 0x44) /* Chip ID Extension Register */
34#define AT91_DBGU_FNR (AT91_DBGU + 0x48) /* Force NTRST Register [SAM9 only] */
35#define AT91_DBGU_FNTRST (1 << 0) /* Force NTRST */
36
37#endif /* AT91_DBGU */
38
39/*
40 * Some AT91 parts that don't have full DEBUG units still support the ID
41 * and extensions register.
42 */
33#define AT91_CIDR_VERSION (0x1f << 0) /* Version of the Device */ 43#define AT91_CIDR_VERSION (0x1f << 0) /* Version of the Device */
34#define AT91_CIDR_EPROC (7 << 5) /* Embedded Processor */ 44#define AT91_CIDR_EPROC (7 << 5) /* Embedded Processor */
35#define AT91_CIDR_NVPSIZ (0xf << 8) /* Nonvolatile Program Memory Size */ 45#define AT91_CIDR_NVPSIZ (0xf << 8) /* Nonvolatile Program Memory Size */
@@ -53,7 +63,4 @@
53#define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */ 63#define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */
54#define AT91_CIDR_EXT (1 << 31) /* Extension Flag */ 64#define AT91_CIDR_EXT (1 << 31) /* Extension Flag */
55 65
56#define AT91_DBGU_FNR (AT91_DBGU + 0x48) /* Force NTRST Register [SAM9 only] */
57#define AT91_DBGU_FNTRST (1 << 0) /* Force NTRST */
58
59#endif 66#endif
diff --git a/include/asm-arm/arch-at91/at91_shdwc.h b/include/asm-arm/arch-at91/at91_shdwc.h
index 795fcc266228..01b433de2272 100644
--- a/include/asm-arm/arch-at91/at91_shdwc.h
+++ b/include/asm-arm/arch-at91/at91_shdwc.h
@@ -14,8 +14,8 @@
14#define AT91_SHDWC_H 14#define AT91_SHDWC_H
15 15
16#define AT91_SHDW_CR (AT91_SHDWC + 0x00) /* Shut Down Control Register */ 16#define AT91_SHDW_CR (AT91_SHDWC + 0x00) /* Shut Down Control Register */
17#define AT91_SHDW_SHDW (1 << 0) /* Processor Reset */ 17#define AT91_SHDW_SHDW (1 << 0) /* Shut Down command */
18#define AT91_SHDW_KEY (0xff << 24) /* KEY Password */ 18#define AT91_SHDW_KEY (0xa5 << 24) /* KEY Password */
19 19
20#define AT91_SHDW_MR (AT91_SHDWC + 0x04) /* Shut Down Mode Register */ 20#define AT91_SHDW_MR (AT91_SHDWC + 0x04) /* Shut Down Mode Register */
21#define AT91_SHDW_WKMODE0 (3 << 0) /* Wake-up 0 Mode Selection */ 21#define AT91_SHDW_WKMODE0 (3 << 0) /* Wake-up 0 Mode Selection */
diff --git a/include/asm-arm/arch-at91/at91_wdt.h b/include/asm-arm/arch-at91/at91_wdt.h
index 7251a344c740..1014e9bf181f 100644
--- a/include/asm-arm/arch-at91/at91_wdt.h
+++ b/include/asm-arm/arch-at91/at91_wdt.h
@@ -15,7 +15,7 @@
15 15
16#define AT91_WDT_CR (AT91_WDT + 0x00) /* Watchdog Control Register */ 16#define AT91_WDT_CR (AT91_WDT + 0x00) /* Watchdog Control Register */
17#define AT91_WDT_WDRSTT (1 << 0) /* Restart */ 17#define AT91_WDT_WDRSTT (1 << 0) /* Restart */
18#define AT91_WDT_KEY (0xff << 24) /* KEY Password */ 18#define AT91_WDT_KEY (0xa5 << 24) /* KEY Password */
19 19
20#define AT91_WDT_MR (AT91_WDT + 0x04) /* Watchdog Mode Register */ 20#define AT91_WDT_MR (AT91_WDT + 0x04) /* Watchdog Mode Register */
21#define AT91_WDT_WDV (0xfff << 0) /* Counter Value */ 21#define AT91_WDT_WDV (0xfff << 0) /* Counter Value */
diff --git a/include/asm-arm/arch-at91/at91x40.h b/include/asm-arm/arch-at91/at91x40.h
new file mode 100644
index 000000000000..612203e0177f
--- /dev/null
+++ b/include/asm-arm/arch-at91/at91x40.h
@@ -0,0 +1,55 @@
1/*
2 * include/asm-arm/arch-at91/at91x40.h
3 *
4 * (C) Copyright 2007, Greg Ungerer <gerg@snapgear.com>
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 AT91X40_H
13#define AT91X40_H
14
15/*
16 * IRQ list.
17 */
18#define AT91_ID_FIQ 0 /* FIQ */
19#define AT91_ID_SYS 1 /* System Peripheral */
20#define AT91X40_ID_USART0 2 /* USART port 0 */
21#define AT91X40_ID_USART1 3 /* USART port 1 */
22#define AT91X40_ID_TC0 4 /* Timer/Counter 0 */
23#define AT91X40_ID_TC1 5 /* Timer/Counter 1*/
24#define AT91X40_ID_TC2 6 /* Timer/Counter 2*/
25#define AT91X40_ID_WD 7 /* Watchdog? */
26#define AT91X40_ID_PIOA 8 /* Parallel IO Controller A */
27
28#define AT91X40_ID_IRQ0 16 /* External IRQ 0 */
29#define AT91X40_ID_IRQ1 17 /* External IRQ 1 */
30#define AT91X40_ID_IRQ2 18 /* External IRQ 2 */
31
32/*
33 * System Peripherals (offset from AT91_BASE_SYS)
34 */
35#define AT91_BASE_SYS 0xffc00000
36
37#define AT91_EBI (0xffe00000 - AT91_BASE_SYS) /* External Bus Interface */
38#define AT91_SF (0xfff00000 - AT91_BASE_SYS) /* Special Function */
39#define AT91_USART1 (0xfffcc000 - AT91_BASE_SYS) /* USART 1 */
40#define AT91_USART0 (0xfffd0000 - AT91_BASE_SYS) /* USART 0 */
41#define AT91_TC (0xfffe0000 - AT91_BASE_SYS) /* Timer Counter */
42#define AT91_PIOA (0xffff0000 - AT91_BASE_SYS) /* PIO Controller A */
43#define AT91_PS (0xffff4000 - AT91_BASE_SYS) /* Power Save */
44#define AT91_WD (0xffff8000 - AT91_BASE_SYS) /* Watchdog Timer */
45#define AT91_AIC (0xfffff000 - AT91_BASE_SYS) /* Advanced Interrupt Controller */
46
47/*
48 * The AT91x40 series doesn't have a debug unit like the other AT91 parts.
49 * But it does have a chip identify register and extension ID, so define at
50 * least these here.
51 */
52#define AT91_DBGU_CIDR (AT91_SF + 0) /* CIDR in PS segment */
53#define AT91_DBGU_EXID (AT91_SF + 4) /* EXID in PS segment */
54
55#endif /* AT91X40_H */
diff --git a/include/asm-arm/arch-at91/board.h b/include/asm-arm/arch-at91/board.h
index 0ce6ee98ed0b..d96b10fd449f 100644
--- a/include/asm-arm/arch-at91/board.h
+++ b/include/asm-arm/arch-at91/board.h
@@ -64,6 +64,7 @@ extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
64 64
65 /* Ethernet (EMAC & MACB) */ 65 /* Ethernet (EMAC & MACB) */
66struct at91_eth_data { 66struct at91_eth_data {
67 u32 phy_mask;
67 u8 phy_irq_pin; /* PHY IRQ */ 68 u8 phy_irq_pin; /* PHY IRQ */
68 u8 is_rmii; /* using RMII interface? */ 69 u8 is_rmii; /* using RMII interface? */
69}; 70};
diff --git a/include/asm-arm/arch-at91/cpu.h b/include/asm-arm/arch-at91/cpu.h
index ef93c30a9c5f..080cbb401a87 100644
--- a/include/asm-arm/arch-at91/cpu.h
+++ b/include/asm-arm/arch-at91/cpu.h
@@ -28,6 +28,11 @@
28 28
29#define ARCH_ID_AT91SAM9RL64 0x019b03a0 29#define ARCH_ID_AT91SAM9RL64 0x019b03a0
30 30
31#define ARCH_ID_AT91M40800 0x14080044
32#define ARCH_ID_AT91R40807 0x44080746
33#define ARCH_ID_AT91M40807 0x14080745
34#define ARCH_ID_AT91R40008 0x44000840
35
31static inline unsigned long at91_cpu_identify(void) 36static inline unsigned long at91_cpu_identify(void)
32{ 37{
33 return (at91_sys_read(AT91_DBGU_CIDR) & ~AT91_CIDR_VERSION); 38 return (at91_sys_read(AT91_DBGU_CIDR) & ~AT91_CIDR_VERSION);
diff --git a/include/asm-arm/arch-at91/hardware.h b/include/asm-arm/arch-at91/hardware.h
index 46835e945aea..8f1cdd38a969 100644
--- a/include/asm-arm/arch-at91/hardware.h
+++ b/include/asm-arm/arch-at91/hardware.h
@@ -26,18 +26,29 @@
26#include <asm/arch/at91sam9263.h> 26#include <asm/arch/at91sam9263.h>
27#elif defined(CONFIG_ARCH_AT91SAM9RL) 27#elif defined(CONFIG_ARCH_AT91SAM9RL)
28#include <asm/arch/at91sam9rl.h> 28#include <asm/arch/at91sam9rl.h>
29#elif defined(CONFIG_ARCH_AT91X40)
30#include <asm/arch/at91x40.h>
29#else 31#else
30#error "Unsupported AT91 processor" 32#error "Unsupported AT91 processor"
31#endif 33#endif
32 34
33 35
36#ifdef CONFIG_MMU
34/* 37/*
35 * Remap the peripherals from address 0xFFF78000 .. 0xFFFFFFFF 38 * Remap the peripherals from address 0xFFF78000 .. 0xFFFFFFFF
36 * to 0xFEF78000 .. 0xFF000000. (544Kb) 39 * to 0xFEF78000 .. 0xFF000000. (544Kb)
37 */ 40 */
38#define AT91_IO_PHYS_BASE 0xFFF78000 41#define AT91_IO_PHYS_BASE 0xFFF78000
39#define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1)
40#define AT91_IO_VIRT_BASE (0xFF000000 - AT91_IO_SIZE) 42#define AT91_IO_VIRT_BASE (0xFF000000 - AT91_IO_SIZE)
43#else
44/*
45 * Identity mapping for the non MMU case.
46 */
47#define AT91_IO_PHYS_BASE AT91_BASE_SYS
48#define AT91_IO_VIRT_BASE AT91_IO_PHYS_BASE
49#endif
50
51#define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1)
41 52
42 /* Convert a physical IO address to virtual IO address */ 53 /* Convert a physical IO address to virtual IO address */
43#define AT91_IO_P2V(x) ((x) - AT91_IO_PHYS_BASE + AT91_IO_VIRT_BASE) 54#define AT91_IO_P2V(x) ((x) - AT91_IO_PHYS_BASE + AT91_IO_VIRT_BASE)
@@ -66,7 +77,11 @@
66#define AT91_CHIPSELECT_7 0x80000000 77#define AT91_CHIPSELECT_7 0x80000000
67 78
68/* SDRAM */ 79/* SDRAM */
80#ifdef CONFIG_DRAM_BASE
81#define AT91_SDRAM_BASE CONFIG_DRAM_BASE
82#else
69#define AT91_SDRAM_BASE AT91_CHIPSELECT_1 83#define AT91_SDRAM_BASE AT91_CHIPSELECT_1
84#endif
70 85
71/* Clocks */ 86/* Clocks */
72#define AT91_SLOW_CLOCK 32768 /* slow clock */ 87#define AT91_SLOW_CLOCK 32768 /* slow clock */
diff --git a/include/asm-arm/arch-at91/timex.h b/include/asm-arm/arch-at91/timex.h
index 2df1ee12dfb7..a310698fb4da 100644
--- a/include/asm-arm/arch-at91/timex.h
+++ b/include/asm-arm/arch-at91/timex.h
@@ -42,6 +42,11 @@
42#define AT91SAM9_MASTER_CLOCK 100000000 42#define AT91SAM9_MASTER_CLOCK 100000000
43#define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) 43#define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16)
44 44
45#elif defined(CONFIG_ARCH_AT91X40)
46
47#define AT91X40_MASTER_CLOCK 40000000
48#define CLOCK_TICK_RATE (AT91X40_MASTER_CLOCK)
49
45#endif 50#endif
46 51
47#endif 52#endif
diff --git a/include/asm-arm/arch-at91/uncompress.h b/include/asm-arm/arch-at91/uncompress.h
index 30ac587b3b41..272a7e0dc6cf 100644
--- a/include/asm-arm/arch-at91/uncompress.h
+++ b/include/asm-arm/arch-at91/uncompress.h
@@ -33,20 +33,24 @@
33 */ 33 */
34static void putc(int c) 34static void putc(int c)
35{ 35{
36#ifdef AT91_DBGU
36 void __iomem *sys = (void __iomem *) AT91_BASE_SYS; /* physical address */ 37 void __iomem *sys = (void __iomem *) AT91_BASE_SYS; /* physical address */
37 38
38 while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXRDY)) 39 while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXRDY))
39 barrier(); 40 barrier();
40 __raw_writel(c, sys + AT91_DBGU_THR); 41 __raw_writel(c, sys + AT91_DBGU_THR);
42#endif
41} 43}
42 44
43static inline void flush(void) 45static inline void flush(void)
44{ 46{
47#ifdef AT91_DBGU
45 void __iomem *sys = (void __iomem *) AT91_BASE_SYS; /* physical address */ 48 void __iomem *sys = (void __iomem *) AT91_BASE_SYS; /* physical address */
46 49
47 /* wait for transmission to complete */ 50 /* wait for transmission to complete */
48 while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXEMPTY)) 51 while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXEMPTY))
49 barrier(); 52 barrier();
53#endif
50} 54}
51 55
52#define arch_decomp_setup() 56#define arch_decomp_setup()
diff --git a/include/asm-arm/arch-davinci/clock.h b/include/asm-arm/arch-davinci/clock.h
new file mode 100644
index 000000000000..cc168b7a14f2
--- /dev/null
+++ b/include/asm-arm/arch-davinci/clock.h
@@ -0,0 +1,22 @@
1/*
2 * include/asm-arm/arch-davinci/clock.h
3 *
4 * Clock control driver for DaVinci - header file
5 *
6 * Authors: Vladimir Barinov <source@mvista.com>
7 *
8 * 2007 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#ifndef __ASM_ARCH_DAVINCI_CLOCK_H
14#define __ASM_ARCH_DAVINCI_CLOCK_H
15
16struct clk;
17
18extern int clk_register(struct clk *clk);
19extern void clk_unregister(struct clk *clk);
20extern int davinci_clk_init(void);
21
22#endif
diff --git a/include/asm-arm/arch-davinci/gpio.h b/include/asm-arm/arch-davinci/gpio.h
new file mode 100644
index 000000000000..ea24a0e0bfd6
--- /dev/null
+++ b/include/asm-arm/arch-davinci/gpio.h
@@ -0,0 +1,156 @@
1/*
2 * TI DaVinci GPIO Support
3 *
4 * Copyright (c) 2006 David Brownell
5 * Copyright (c) 2007, MontaVista Software, Inc. <source@mvista.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef __DAVINCI_GPIO_H
14#define __DAVINCI_GPIO_H
15
16/*
17 * basic gpio routines
18 *
19 * board-specific init should be done by arch/.../.../board-XXX.c (maybe
20 * initializing banks together) rather than boot loaders; kexec() won't
21 * go through boot loaders.
22 *
23 * the gpio clock will be turned on when gpios are used, and you may also
24 * need to pay attention to PINMUX0 and PINMUX1 to be sure those pins are
25 * used as gpios, not with other peripherals.
26 *
27 * GPIOs are numbered 0..(DAVINCI_N_GPIO-1). For documentation, and maybe
28 * for later updates, code should write GPIO(N) or:
29 * - GPIOV18(N) for 1.8V pins, N in 0..53; same as GPIO(0)..GPIO(53)
30 * - GPIOV33(N) for 3.3V pins, N in 0..17; same as GPIO(54)..GPIO(70)
31 *
32 * For GPIO IRQs use gpio_to_irq(GPIO(N)) or gpio_to_irq(GPIOV33(N)) etc
33 * for now, that's != GPIO(N)
34 */
35#define GPIO(X) (X) /* 0 <= X <= 70 */
36#define GPIOV18(X) (X) /* 1.8V i/o; 0 <= X <= 53 */
37#define GPIOV33(X) ((X)+54) /* 3.3V i/o; 0 <= X <= 17 */
38
39struct gpio_controller {
40 u32 dir;
41 u32 out_data;
42 u32 set_data;
43 u32 clr_data;
44 u32 in_data;
45 u32 set_rising;
46 u32 clr_rising;
47 u32 set_falling;
48 u32 clr_falling;
49 u32 intstat;
50};
51
52/* The __gpio_to_controller() and __gpio_mask() functions inline to constants
53 * with constant parameters; or in outlined code they execute at runtime.
54 *
55 * You'd access the controller directly when reading or writing more than
56 * one gpio value at a time, and to support wired logic where the value
57 * being driven by the cpu need not match the value read back.
58 *
59 * These are NOT part of the cross-platform GPIO interface
60 */
61static inline struct gpio_controller *__iomem
62__gpio_to_controller(unsigned gpio)
63{
64 void *__iomem ptr;
65
66 if (gpio < 32)
67 ptr = (void *__iomem)IO_ADDRESS(DAVINCI_GPIO_BASE + 0x10);
68 else if (gpio < 64)
69 ptr = (void *__iomem)IO_ADDRESS(DAVINCI_GPIO_BASE + 0x38);
70 else if (gpio < DAVINCI_N_GPIO)
71 ptr = (void *__iomem)IO_ADDRESS(DAVINCI_GPIO_BASE + 0x60);
72 else
73 ptr = NULL;
74 return ptr;
75}
76
77static inline u32 __gpio_mask(unsigned gpio)
78{
79 return 1 << (gpio % 32);
80}
81
82/* The get/set/clear functions will inline when called with constant
83 * parameters, for low-overhead bitbanging. Illegal constant parameters
84 * cause link-time errors.
85 *
86 * Otherwise, calls with variable parameters use outlined functions.
87 */
88extern int __error_inval_gpio(void);
89
90extern void __gpio_set(unsigned gpio, int value);
91extern int __gpio_get(unsigned gpio);
92
93static inline void gpio_set_value(unsigned gpio, int value)
94{
95 if (__builtin_constant_p(value)) {
96 struct gpio_controller *__iomem g;
97 u32 mask;
98
99 if (gpio >= DAVINCI_N_GPIO)
100 __error_inval_gpio();
101
102 g = __gpio_to_controller(gpio);
103 mask = __gpio_mask(gpio);
104 if (value)
105 __raw_writel(mask, &g->set_data);
106 else
107 __raw_writel(mask, &g->clr_data);
108 return;
109 }
110
111 __gpio_set(gpio, value);
112}
113
114/* Returns zero or nonzero; works for gpios configured as inputs OR
115 * as outputs.
116 *
117 * NOTE: changes in reported values are synchronized to the GPIO clock.
118 * This is most easily seen after calling gpio_set_value() and then immediatly
119 * gpio_get_value(), where the gpio_get_value() would return the old value
120 * until the GPIO clock ticks and the new value gets latched.
121 */
122
123static inline int gpio_get_value(unsigned gpio)
124{
125 struct gpio_controller *__iomem g;
126
127 if (!__builtin_constant_p(gpio))
128 return __gpio_get(gpio);
129
130 if (gpio >= DAVINCI_N_GPIO)
131 return __error_inval_gpio();
132
133 g = __gpio_to_controller(gpio);
134 return !!(__gpio_mask(gpio) & __raw_readl(&g->in_data));
135}
136
137/* powerup default direction is IN */
138extern int gpio_direction_input(unsigned gpio);
139extern int gpio_direction_output(unsigned gpio, int value);
140
141#include <asm-generic/gpio.h> /* cansleep wrappers */
142
143extern int gpio_request(unsigned gpio, const char *tag);
144extern void gpio_free(unsigned gpio);
145
146static inline int gpio_to_irq(unsigned gpio)
147{
148 return DAVINCI_N_AINTC_IRQ + gpio;
149}
150
151static inline int irq_to_gpio(unsigned irq)
152{
153 return irq - DAVINCI_N_AINTC_IRQ;
154}
155
156#endif /* __DAVINCI_GPIO_H */
diff --git a/include/asm-arm/arch-davinci/hardware.h b/include/asm-arm/arch-davinci/hardware.h
index 60362d80229e..a2e8969afaca 100644
--- a/include/asm-arm/arch-davinci/hardware.h
+++ b/include/asm-arm/arch-davinci/hardware.h
@@ -11,4 +11,42 @@
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/*
15 * Base register addresses
16 */
17#define DAVINCI_DMA_3PCC_BASE (0x01C00000)
18#define DAVINCI_DMA_3PTC0_BASE (0x01C10000)
19#define DAVINCI_DMA_3PTC1_BASE (0x01C10400)
20#define DAVINCI_I2C_BASE (0x01C21000)
21#define DAVINCI_PWM0_BASE (0x01C22000)
22#define DAVINCI_PWM1_BASE (0x01C22400)
23#define DAVINCI_PWM2_BASE (0x01C22800)
24#define DAVINCI_SYSTEM_MODULE_BASE (0x01C40000)
25#define DAVINCI_PLL_CNTRL0_BASE (0x01C40800)
26#define DAVINCI_PLL_CNTRL1_BASE (0x01C40C00)
27#define DAVINCI_PWR_SLEEP_CNTRL_BASE (0x01C41000)
28#define DAVINCI_SYSTEM_DFT_BASE (0x01C42000)
29#define DAVINCI_IEEE1394_BASE (0x01C60000)
30#define DAVINCI_USB_OTG_BASE (0x01C64000)
31#define DAVINCI_CFC_ATA_BASE (0x01C66000)
32#define DAVINCI_SPI_BASE (0x01C66800)
33#define DAVINCI_GPIO_BASE (0x01C67000)
34#define DAVINCI_UHPI_BASE (0x01C67800)
35#define DAVINCI_VPSS_REGS_BASE (0x01C70000)
36#define DAVINCI_EMAC_CNTRL_REGS_BASE (0x01C80000)
37#define DAVINCI_EMAC_WRAPPER_CNTRL_REGS_BASE (0x01C81000)
38#define DAVINCI_EMAC_WRAPPER_RAM_BASE (0x01C82000)
39#define DAVINCI_MDIO_CNTRL_REGS_BASE (0x01C84000)
40#define DAVINCI_IMCOP_BASE (0x01CC0000)
41#define DAVINCI_ASYNC_EMIF_CNTRL_BASE (0x01E00000)
42#define DAVINCI_VLYNQ_BASE (0x01E01000)
43#define DAVINCI_MCBSP_BASE (0x01E02000)
44#define DAVINCI_MMC_SD_BASE (0x01E10000)
45#define DAVINCI_MS_BASE (0x01E20000)
46#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE (0x02000000)
47#define DAVINCI_ASYNC_EMIF_DATA_CE1_BASE (0x04000000)
48#define DAVINCI_ASYNC_EMIF_DATA_CE2_BASE (0x06000000)
49#define DAVINCI_ASYNC_EMIF_DATA_CE3_BASE (0x08000000)
50#define DAVINCI_VLYNQ_REMOTE_BASE (0x0C000000)
51
14#endif /* __ASM_ARCH_HARDWARE_H */ 52#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-davinci/mux.h b/include/asm-arm/arch-davinci/mux.h
new file mode 100644
index 000000000000..c24b6782804d
--- /dev/null
+++ b/include/asm-arm/arch-davinci/mux.h
@@ -0,0 +1,55 @@
1/*
2 * DaVinci pin multiplexing defines
3 *
4 * Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com>
5 *
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#ifndef __ASM_ARCH_MUX_H
12#define __ASM_ARCH_MUX_H
13
14#define DAVINCI_MUX_AEAW0 0
15#define DAVINCI_MUX_AEAW1 1
16#define DAVINCI_MUX_AEAW2 2
17#define DAVINCI_MUX_AEAW3 3
18#define DAVINCI_MUX_AEAW4 4
19#define DAVINCI_MUX_AECS4 10
20#define DAVINCI_MUX_AECS5 11
21#define DAVINCI_MUX_VLYNQWD0 12
22#define DAVINCI_MUX_VLYNQWD1 13
23#define DAVINCI_MUX_VLSCREN 14
24#define DAVINCI_MUX_VLYNQEN 15
25#define DAVINCI_MUX_HDIREN 16
26#define DAVINCI_MUX_ATAEN 17
27#define DAVINCI_MUX_RGB666 22
28#define DAVINCI_MUX_RGB888 23
29#define DAVINCI_MUX_LOEEN 24
30#define DAVINCI_MUX_LFLDEN 25
31#define DAVINCI_MUX_CWEN 26
32#define DAVINCI_MUX_CFLDEN 27
33#define DAVINCI_MUX_HPIEN 29
34#define DAVINCI_MUX_1394EN 30
35#define DAVINCI_MUX_EMACEN 31
36
37#define DAVINCI_MUX_LEVEL2 32
38#define DAVINCI_MUX_UART0 (DAVINCI_MUX_LEVEL2 + 0)
39#define DAVINCI_MUX_UART1 (DAVINCI_MUX_LEVEL2 + 1)
40#define DAVINCI_MUX_UART2 (DAVINCI_MUX_LEVEL2 + 2)
41#define DAVINCI_MUX_U2FLO (DAVINCI_MUX_LEVEL2 + 3)
42#define DAVINCI_MUX_PWM0 (DAVINCI_MUX_LEVEL2 + 4)
43#define DAVINCI_MUX_PWM1 (DAVINCI_MUX_LEVEL2 + 5)
44#define DAVINCI_MUX_PWM2 (DAVINCI_MUX_LEVEL2 + 6)
45#define DAVINCI_MUX_I2C (DAVINCI_MUX_LEVEL2 + 7)
46#define DAVINCI_MUX_SPI (DAVINCI_MUX_LEVEL2 + 8)
47#define DAVINCI_MUX_MSTK (DAVINCI_MUX_LEVEL2 + 9)
48#define DAVINCI_MUX_ASP (DAVINCI_MUX_LEVEL2 + 10)
49#define DAVINCI_MUX_CLK0 (DAVINCI_MUX_LEVEL2 + 16)
50#define DAVINCI_MUX_CLK1 (DAVINCI_MUX_LEVEL2 + 17)
51#define DAVINCI_MUX_TIMIN (DAVINCI_MUX_LEVEL2 + 18)
52
53extern void davinci_mux_peripheral(unsigned int mux, unsigned int enable);
54
55#endif /* __ASM_ARCH_MUX_H */
diff --git a/include/asm-arm/arch-imx/gpio.h b/include/asm-arm/arch-imx/gpio.h
new file mode 100644
index 000000000000..486023263f32
--- /dev/null
+++ b/include/asm-arm/arch-imx/gpio.h
@@ -0,0 +1,102 @@
1#ifndef _IMX_GPIO_H
2
3#include <asm/arch/imx-regs.h>
4
5#define IMX_GPIO_ALLOC_MODE_NORMAL 0
6#define IMX_GPIO_ALLOC_MODE_NO_ALLOC 1
7#define IMX_GPIO_ALLOC_MODE_TRY_ALLOC 2
8#define IMX_GPIO_ALLOC_MODE_ALLOC_ONLY 4
9#define IMX_GPIO_ALLOC_MODE_RELEASE 8
10
11extern int imx_gpio_request(unsigned gpio, const char *label);
12
13extern void imx_gpio_free(unsigned gpio);
14
15extern int imx_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
16 int alloc_mode, const char *label);
17
18extern int imx_gpio_direction_input(unsigned gpio);
19
20extern int imx_gpio_direction_output(unsigned gpio, int value);
21
22extern void __imx_gpio_set_value(unsigned gpio, int value);
23
24static inline int imx_gpio_get_value(unsigned gpio)
25{
26 return SSR(gpio >> GPIO_PORT_SHIFT) & (1 << (gpio & GPIO_PIN_MASK));
27}
28
29static inline void imx_gpio_set_value_inline(unsigned gpio, int value)
30{
31 unsigned long flags;
32
33 raw_local_irq_save(flags);
34 if(value)
35 DR(gpio >> GPIO_PORT_SHIFT) |= (1 << (gpio & GPIO_PIN_MASK));
36 else
37 DR(gpio >> GPIO_PORT_SHIFT) &= ~(1 << (gpio & GPIO_PIN_MASK));
38 raw_local_irq_restore(flags);
39}
40
41static inline void imx_gpio_set_value(unsigned gpio, int value)
42{
43 if(__builtin_constant_p(gpio))
44 imx_gpio_set_value_inline(gpio, value);
45 else
46 __imx_gpio_set_value(gpio, value);
47}
48
49extern int imx_gpio_to_irq(unsigned gpio);
50
51extern int imx_irq_to_gpio(unsigned irq);
52
53/*-------------------------------------------------------------------------*/
54
55/* Wrappers for "new style" GPIO calls. These calls i.MX specific versions
56 * to allow future extension of GPIO logic.
57 */
58
59static inline int gpio_request(unsigned gpio, const char *label)
60{
61 return imx_gpio_request(gpio, label);
62}
63
64static inline void gpio_free(unsigned gpio)
65{
66 imx_gpio_free(gpio);
67}
68
69static inline int gpio_direction_input(unsigned gpio)
70{
71 return imx_gpio_direction_input(gpio);
72}
73
74static inline int gpio_direction_output(unsigned gpio, int value)
75{
76 return imx_gpio_direction_output(gpio, value);
77}
78
79static inline int gpio_get_value(unsigned gpio)
80{
81 return imx_gpio_get_value(gpio);
82}
83
84static inline void gpio_set_value(unsigned gpio, int value)
85{
86 imx_gpio_set_value(gpio, value);
87}
88
89#include <asm-generic/gpio.h> /* cansleep wrappers */
90
91static inline int gpio_to_irq(unsigned gpio)
92{
93 return imx_gpio_to_irq(gpio);
94}
95
96static inline int irq_to_gpio(unsigned irq)
97{
98 return imx_irq_to_gpio(irq);
99}
100
101
102#endif
diff --git a/include/asm-arm/arch-imx/imx-regs.h b/include/asm-arm/arch-imx/imx-regs.h
index 30de404c61f5..fb9de2733879 100644
--- a/include/asm-arm/arch-imx/imx-regs.h
+++ b/include/asm-arm/arch-imx/imx-regs.h
@@ -77,6 +77,8 @@
77#define SWR(x) __REG2(IMX_GPIO_BASE + 0x3c, ((x) & 3) << 8) 77#define SWR(x) __REG2(IMX_GPIO_BASE + 0x3c, ((x) & 3) << 8)
78#define PUEN(x) __REG2(IMX_GPIO_BASE + 0x40, ((x) & 3) << 8) 78#define PUEN(x) __REG2(IMX_GPIO_BASE + 0x40, ((x) & 3) << 8)
79 79
80#define GPIO_PORT_MAX 3
81
80#define GPIO_PIN_MASK 0x1f 82#define GPIO_PIN_MASK 0x1f
81#define GPIO_PORT_MASK (0x3 << 5) 83#define GPIO_PORT_MASK (0x3 << 5)
82 84
diff --git a/include/asm-arm/arch-iop13xx/adma.h b/include/asm-arm/arch-iop13xx/adma.h
new file mode 100644
index 000000000000..04006c1c5fd7
--- /dev/null
+++ b/include/asm-arm/arch-iop13xx/adma.h
@@ -0,0 +1,544 @@
1/*
2 * Copyright(c) 2006, Intel Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as 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 for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16 *
17 */
18#ifndef _ADMA_H
19#define _ADMA_H
20#include <linux/types.h>
21#include <linux/io.h>
22#include <asm/hardware.h>
23#include <asm/hardware/iop_adma.h>
24
25#define ADMA_ACCR(chan) (chan->mmr_base + 0x0)
26#define ADMA_ACSR(chan) (chan->mmr_base + 0x4)
27#define ADMA_ADAR(chan) (chan->mmr_base + 0x8)
28#define ADMA_IIPCR(chan) (chan->mmr_base + 0x18)
29#define ADMA_IIPAR(chan) (chan->mmr_base + 0x1c)
30#define ADMA_IIPUAR(chan) (chan->mmr_base + 0x20)
31#define ADMA_ANDAR(chan) (chan->mmr_base + 0x24)
32#define ADMA_ADCR(chan) (chan->mmr_base + 0x28)
33#define ADMA_CARMD(chan) (chan->mmr_base + 0x2c)
34#define ADMA_ABCR(chan) (chan->mmr_base + 0x30)
35#define ADMA_DLADR(chan) (chan->mmr_base + 0x34)
36#define ADMA_DUADR(chan) (chan->mmr_base + 0x38)
37#define ADMA_SLAR(src, chan) (chan->mmr_base + (0x3c + (src << 3)))
38#define ADMA_SUAR(src, chan) (chan->mmr_base + (0x40 + (src << 3)))
39
40struct iop13xx_adma_src {
41 u32 src_addr;
42 union {
43 u32 upper_src_addr;
44 struct {
45 unsigned int pq_upper_src_addr:24;
46 unsigned int pq_dmlt:8;
47 };
48 };
49};
50
51struct iop13xx_adma_desc_ctrl {
52 unsigned int int_en:1;
53 unsigned int xfer_dir:2;
54 unsigned int src_select:4;
55 unsigned int zero_result:1;
56 unsigned int block_fill_en:1;
57 unsigned int crc_gen_en:1;
58 unsigned int crc_xfer_dis:1;
59 unsigned int crc_seed_fetch_dis:1;
60 unsigned int status_write_back_en:1;
61 unsigned int endian_swap_en:1;
62 unsigned int reserved0:2;
63 unsigned int pq_update_xfer_en:1;
64 unsigned int dual_xor_en:1;
65 unsigned int pq_xfer_en:1;
66 unsigned int p_xfer_dis:1;
67 unsigned int reserved1:10;
68 unsigned int relax_order_en:1;
69 unsigned int no_snoop_en:1;
70};
71
72struct iop13xx_adma_byte_count {
73 unsigned int byte_count:24;
74 unsigned int host_if:3;
75 unsigned int reserved:2;
76 unsigned int zero_result_err_q:1;
77 unsigned int zero_result_err:1;
78 unsigned int tx_complete:1;
79};
80
81struct iop13xx_adma_desc_hw {
82 u32 next_desc;
83 union {
84 u32 desc_ctrl;
85 struct iop13xx_adma_desc_ctrl desc_ctrl_field;
86 };
87 union {
88 u32 crc_addr;
89 u32 block_fill_data;
90 u32 q_dest_addr;
91 };
92 union {
93 u32 byte_count;
94 struct iop13xx_adma_byte_count byte_count_field;
95 };
96 union {
97 u32 dest_addr;
98 u32 p_dest_addr;
99 };
100 union {
101 u32 upper_dest_addr;
102 u32 pq_upper_dest_addr;
103 };
104 struct iop13xx_adma_src src[1];
105};
106
107struct iop13xx_adma_desc_dual_xor {
108 u32 next_desc;
109 u32 desc_ctrl;
110 u32 reserved;
111 u32 byte_count;
112 u32 h_dest_addr;
113 u32 h_upper_dest_addr;
114 u32 src0_addr;
115 u32 upper_src0_addr;
116 u32 src1_addr;
117 u32 upper_src1_addr;
118 u32 h_src_addr;
119 u32 h_upper_src_addr;
120 u32 d_src_addr;
121 u32 d_upper_src_addr;
122 u32 d_dest_addr;
123 u32 d_upper_dest_addr;
124};
125
126struct iop13xx_adma_desc_pq_update {
127 u32 next_desc;
128 u32 desc_ctrl;
129 u32 reserved;
130 u32 byte_count;
131 u32 p_dest_addr;
132 u32 p_upper_dest_addr;
133 u32 src0_addr;
134 u32 upper_src0_addr;
135 u32 src1_addr;
136 u32 upper_src1_addr;
137 u32 p_src_addr;
138 u32 p_upper_src_addr;
139 u32 q_src_addr;
140 struct {
141 unsigned int q_upper_src_addr:24;
142 unsigned int q_dmlt:8;
143 };
144 u32 q_dest_addr;
145 u32 q_upper_dest_addr;
146};
147
148static inline int iop_adma_get_max_xor(void)
149{
150 return 16;
151}
152
153static inline u32 iop_chan_get_current_descriptor(struct iop_adma_chan *chan)
154{
155 return __raw_readl(ADMA_ADAR(chan));
156}
157
158static inline void iop_chan_set_next_descriptor(struct iop_adma_chan *chan,
159 u32 next_desc_addr)
160{
161 __raw_writel(next_desc_addr, ADMA_ANDAR(chan));
162}
163
164#define ADMA_STATUS_BUSY (1 << 13)
165
166static inline char iop_chan_is_busy(struct iop_adma_chan *chan)
167{
168 if (__raw_readl(ADMA_ACSR(chan)) &
169 ADMA_STATUS_BUSY)
170 return 1;
171 else
172 return 0;
173}
174
175static inline int
176iop_chan_get_desc_align(struct iop_adma_chan *chan, int num_slots)
177{
178 return 1;
179}
180#define iop_desc_is_aligned(x, y) 1
181
182static inline int
183iop_chan_memcpy_slot_count(size_t len, int *slots_per_op)
184{
185 *slots_per_op = 1;
186 return 1;
187}
188
189#define iop_chan_interrupt_slot_count(s, c) iop_chan_memcpy_slot_count(0, s)
190
191static inline int
192iop_chan_memset_slot_count(size_t len, int *slots_per_op)
193{
194 *slots_per_op = 1;
195 return 1;
196}
197
198static inline int
199iop_chan_xor_slot_count(size_t len, int src_cnt, int *slots_per_op)
200{
201 int num_slots;
202 /* slots_to_find = 1 for basic descriptor + 1 per 4 sources above 1
203 * (1 source => 8 bytes) (1 slot => 32 bytes)
204 */
205 num_slots = 1 + (((src_cnt - 1) << 3) >> 5);
206 if (((src_cnt - 1) << 3) & 0x1f)
207 num_slots++;
208
209 *slots_per_op = num_slots;
210
211 return num_slots;
212}
213
214#define ADMA_MAX_BYTE_COUNT (16 * 1024 * 1024)
215#define IOP_ADMA_MAX_BYTE_COUNT ADMA_MAX_BYTE_COUNT
216#define IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT ADMA_MAX_BYTE_COUNT
217#define IOP_ADMA_XOR_MAX_BYTE_COUNT ADMA_MAX_BYTE_COUNT
218#define iop_chan_zero_sum_slot_count(l, s, o) iop_chan_xor_slot_count(l, s, o)
219
220static inline u32 iop_desc_get_dest_addr(struct iop_adma_desc_slot *desc,
221 struct iop_adma_chan *chan)
222{
223 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
224 return hw_desc->dest_addr;
225}
226
227static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc,
228 struct iop_adma_chan *chan)
229{
230 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
231 return hw_desc->byte_count_field.byte_count;
232}
233
234static inline u32 iop_desc_get_src_addr(struct iop_adma_desc_slot *desc,
235 struct iop_adma_chan *chan,
236 int src_idx)
237{
238 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
239 return hw_desc->src[src_idx].src_addr;
240}
241
242static inline u32 iop_desc_get_src_count(struct iop_adma_desc_slot *desc,
243 struct iop_adma_chan *chan)
244{
245 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
246 return hw_desc->desc_ctrl_field.src_select + 1;
247}
248
249static inline void
250iop_desc_init_memcpy(struct iop_adma_desc_slot *desc, int int_en)
251{
252 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
253 union {
254 u32 value;
255 struct iop13xx_adma_desc_ctrl field;
256 } u_desc_ctrl;
257
258 u_desc_ctrl.value = 0;
259 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
260 u_desc_ctrl.field.int_en = int_en;
261 hw_desc->desc_ctrl = u_desc_ctrl.value;
262 hw_desc->crc_addr = 0;
263}
264
265static inline void
266iop_desc_init_memset(struct iop_adma_desc_slot *desc, int int_en)
267{
268 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
269 union {
270 u32 value;
271 struct iop13xx_adma_desc_ctrl field;
272 } u_desc_ctrl;
273
274 u_desc_ctrl.value = 0;
275 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
276 u_desc_ctrl.field.block_fill_en = 1;
277 u_desc_ctrl.field.int_en = int_en;
278 hw_desc->desc_ctrl = u_desc_ctrl.value;
279 hw_desc->crc_addr = 0;
280}
281
282/* to do: support buffers larger than ADMA_MAX_BYTE_COUNT */
283static inline void
284iop_desc_init_xor(struct iop_adma_desc_slot *desc, int src_cnt, int int_en)
285{
286 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
287 union {
288 u32 value;
289 struct iop13xx_adma_desc_ctrl field;
290 } u_desc_ctrl;
291
292 u_desc_ctrl.value = 0;
293 u_desc_ctrl.field.src_select = src_cnt - 1;
294 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
295 u_desc_ctrl.field.int_en = int_en;
296 hw_desc->desc_ctrl = u_desc_ctrl.value;
297 hw_desc->crc_addr = 0;
298
299}
300#define iop_desc_init_null_xor(d, s, i) iop_desc_init_xor(d, s, i)
301
302/* to do: support buffers larger than ADMA_MAX_BYTE_COUNT */
303static inline int
304iop_desc_init_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt, int int_en)
305{
306 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
307 union {
308 u32 value;
309 struct iop13xx_adma_desc_ctrl field;
310 } u_desc_ctrl;
311
312 u_desc_ctrl.value = 0;
313 u_desc_ctrl.field.src_select = src_cnt - 1;
314 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
315 u_desc_ctrl.field.zero_result = 1;
316 u_desc_ctrl.field.status_write_back_en = 1;
317 u_desc_ctrl.field.int_en = int_en;
318 hw_desc->desc_ctrl = u_desc_ctrl.value;
319 hw_desc->crc_addr = 0;
320
321 return 1;
322}
323
324static inline void iop_desc_set_byte_count(struct iop_adma_desc_slot *desc,
325 struct iop_adma_chan *chan,
326 u32 byte_count)
327{
328 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
329 hw_desc->byte_count = byte_count;
330}
331
332static inline void
333iop_desc_set_zero_sum_byte_count(struct iop_adma_desc_slot *desc, u32 len)
334{
335 int slots_per_op = desc->slots_per_op;
336 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc, *iter;
337 int i = 0;
338
339 if (len <= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT) {
340 hw_desc->byte_count = len;
341 } else {
342 do {
343 iter = iop_hw_desc_slot_idx(hw_desc, i);
344 iter->byte_count = IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
345 len -= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
346 i += slots_per_op;
347 } while (len > IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT);
348
349 if (len) {
350 iter = iop_hw_desc_slot_idx(hw_desc, i);
351 iter->byte_count = len;
352 }
353 }
354}
355
356
357static inline void iop_desc_set_dest_addr(struct iop_adma_desc_slot *desc,
358 struct iop_adma_chan *chan,
359 dma_addr_t addr)
360{
361 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
362 hw_desc->dest_addr = addr;
363 hw_desc->upper_dest_addr = 0;
364}
365
366static inline void iop_desc_set_memcpy_src_addr(struct iop_adma_desc_slot *desc,
367 dma_addr_t addr)
368{
369 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
370 hw_desc->src[0].src_addr = addr;
371 hw_desc->src[0].upper_src_addr = 0;
372}
373
374static inline void iop_desc_set_xor_src_addr(struct iop_adma_desc_slot *desc,
375 int src_idx, dma_addr_t addr)
376{
377 int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
378 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc, *iter;
379 int i = 0;
380
381 do {
382 iter = iop_hw_desc_slot_idx(hw_desc, i);
383 iter->src[src_idx].src_addr = addr;
384 iter->src[src_idx].upper_src_addr = 0;
385 slot_cnt -= slots_per_op;
386 if (slot_cnt) {
387 i += slots_per_op;
388 addr += IOP_ADMA_XOR_MAX_BYTE_COUNT;
389 }
390 } while (slot_cnt);
391}
392
393static inline void
394iop_desc_init_interrupt(struct iop_adma_desc_slot *desc,
395 struct iop_adma_chan *chan)
396{
397 iop_desc_init_memcpy(desc, 1);
398 iop_desc_set_byte_count(desc, chan, 0);
399 iop_desc_set_dest_addr(desc, chan, 0);
400 iop_desc_set_memcpy_src_addr(desc, 0);
401}
402
403#define iop_desc_set_zero_sum_src_addr iop_desc_set_xor_src_addr
404
405static inline void iop_desc_set_next_desc(struct iop_adma_desc_slot *desc,
406 u32 next_desc_addr)
407{
408 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
409 BUG_ON(hw_desc->next_desc);
410 hw_desc->next_desc = next_desc_addr;
411}
412
413static inline u32 iop_desc_get_next_desc(struct iop_adma_desc_slot *desc)
414{
415 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
416 return hw_desc->next_desc;
417}
418
419static inline void iop_desc_clear_next_desc(struct iop_adma_desc_slot *desc)
420{
421 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
422 hw_desc->next_desc = 0;
423}
424
425static inline void iop_desc_set_block_fill_val(struct iop_adma_desc_slot *desc,
426 u32 val)
427{
428 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
429 hw_desc->block_fill_data = val;
430}
431
432static inline int iop_desc_get_zero_result(struct iop_adma_desc_slot *desc)
433{
434 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
435 struct iop13xx_adma_desc_ctrl desc_ctrl = hw_desc->desc_ctrl_field;
436 struct iop13xx_adma_byte_count byte_count = hw_desc->byte_count_field;
437
438 BUG_ON(!(byte_count.tx_complete && desc_ctrl.zero_result));
439
440 if (desc_ctrl.pq_xfer_en)
441 return byte_count.zero_result_err_q;
442 else
443 return byte_count.zero_result_err;
444}
445
446static inline void iop_chan_append(struct iop_adma_chan *chan)
447{
448 u32 adma_accr;
449
450 adma_accr = __raw_readl(ADMA_ACCR(chan));
451 adma_accr |= 0x2;
452 __raw_writel(adma_accr, ADMA_ACCR(chan));
453}
454
455static inline void iop_chan_idle(int busy, struct iop_adma_chan *chan)
456{
457 do { } while (0);
458}
459
460static inline u32 iop_chan_get_status(struct iop_adma_chan *chan)
461{
462 return __raw_readl(ADMA_ACSR(chan));
463}
464
465static inline void iop_chan_disable(struct iop_adma_chan *chan)
466{
467 u32 adma_chan_ctrl = __raw_readl(ADMA_ACCR(chan));
468 adma_chan_ctrl &= ~0x1;
469 __raw_writel(adma_chan_ctrl, ADMA_ACCR(chan));
470}
471
472static inline void iop_chan_enable(struct iop_adma_chan *chan)
473{
474 u32 adma_chan_ctrl;
475
476 adma_chan_ctrl = __raw_readl(ADMA_ACCR(chan));
477 adma_chan_ctrl |= 0x1;
478 __raw_writel(adma_chan_ctrl, ADMA_ACCR(chan));
479}
480
481static inline void iop_adma_device_clear_eot_status(struct iop_adma_chan *chan)
482{
483 u32 status = __raw_readl(ADMA_ACSR(chan));
484 status &= (1 << 12);
485 __raw_writel(status, ADMA_ACSR(chan));
486}
487
488static inline void iop_adma_device_clear_eoc_status(struct iop_adma_chan *chan)
489{
490 u32 status = __raw_readl(ADMA_ACSR(chan));
491 status &= (1 << 11);
492 __raw_writel(status, ADMA_ACSR(chan));
493}
494
495static inline void iop_adma_device_clear_err_status(struct iop_adma_chan *chan)
496{
497 u32 status = __raw_readl(ADMA_ACSR(chan));
498 status &= (1 << 9) | (1 << 5) | (1 << 4) | (1 << 3);
499 __raw_writel(status, ADMA_ACSR(chan));
500}
501
502static inline int
503iop_is_err_int_parity(unsigned long status, struct iop_adma_chan *chan)
504{
505 return test_bit(9, &status);
506}
507
508static inline int
509iop_is_err_mcu_abort(unsigned long status, struct iop_adma_chan *chan)
510{
511 return test_bit(5, &status);
512}
513
514static inline int
515iop_is_err_int_tabort(unsigned long status, struct iop_adma_chan *chan)
516{
517 return test_bit(4, &status);
518}
519
520static inline int
521iop_is_err_int_mabort(unsigned long status, struct iop_adma_chan *chan)
522{
523 return test_bit(3, &status);
524}
525
526static inline int
527iop_is_err_pci_tabort(unsigned long status, struct iop_adma_chan *chan)
528{
529 return 0;
530}
531
532static inline int
533iop_is_err_pci_mabort(unsigned long status, struct iop_adma_chan *chan)
534{
535 return 0;
536}
537
538static inline int
539iop_is_err_split_tx(unsigned long status, struct iop_adma_chan *chan)
540{
541 return 0;
542}
543
544#endif /* _ADMA_H */
diff --git a/include/asm-arm/arch-iop13xx/iop13xx.h b/include/asm-arm/arch-iop13xx/iop13xx.h
index e6736c3d1f7f..d4e4f828577c 100644
--- a/include/asm-arm/arch-iop13xx/iop13xx.h
+++ b/include/asm-arm/arch-iop13xx/iop13xx.h
@@ -166,12 +166,22 @@ static inline int iop13xx_cpu_id(void)
166#define IOP13XX_INIT_I2C_1 (1 << 1) 166#define IOP13XX_INIT_I2C_1 (1 << 1)
167#define IOP13XX_INIT_I2C_2 (1 << 2) 167#define IOP13XX_INIT_I2C_2 (1 << 2)
168 168
169#define IQ81340_NUM_UART 2 169/* ADMA selection flags */
170#define IQ81340_NUM_I2C 3 170/* INIT_ADMA_DEFAULT = Rely on CONFIG_IOP13XX_ADMA* */
171#define IQ81340_NUM_PHYS_MAP_FLASH 1 171#define IOP13XX_INIT_ADMA_DEFAULT (0)
172#define IQ81340_MAX_PLAT_DEVICES (IQ81340_NUM_UART +\ 172#define IOP13XX_INIT_ADMA_0 (1 << 0)
173 IQ81340_NUM_I2C +\ 173#define IOP13XX_INIT_ADMA_1 (1 << 1)
174 IQ81340_NUM_PHYS_MAP_FLASH) 174#define IOP13XX_INIT_ADMA_2 (1 << 2)
175
176/* Platform devices */
177#define IQ81340_NUM_UART 2
178#define IQ81340_NUM_I2C 3
179#define IQ81340_NUM_PHYS_MAP_FLASH 1
180#define IQ81340_NUM_ADMA 3
181#define IQ81340_MAX_PLAT_DEVICES (IQ81340_NUM_UART + \
182 IQ81340_NUM_I2C + \
183 IQ81340_NUM_PHYS_MAP_FLASH + \
184 IQ81340_NUM_ADMA)
175 185
176/*========================== PMMR offsets for key registers ============*/ 186/*========================== PMMR offsets for key registers ============*/
177#define IOP13XX_ATU0_PMMR_OFFSET 0x00048000 187#define IOP13XX_ATU0_PMMR_OFFSET 0x00048000
@@ -444,22 +454,6 @@ static inline int iop13xx_cpu_id(void)
444/*==============================ADMA UNITS===============================*/ 454/*==============================ADMA UNITS===============================*/
445#define IOP13XX_ADMA_PHYS_BASE(chan) IOP13XX_REG_ADDR32_PHYS((chan << 9)) 455#define IOP13XX_ADMA_PHYS_BASE(chan) IOP13XX_REG_ADDR32_PHYS((chan << 9))
446#define IOP13XX_ADMA_UPPER_PA(chan) (IOP13XX_ADMA_PHYS_BASE(chan) + 0xc0) 456#define IOP13XX_ADMA_UPPER_PA(chan) (IOP13XX_ADMA_PHYS_BASE(chan) + 0xc0)
447#define IOP13XX_ADMA_OFFSET(chan, ofs) IOP13XX_REG_ADDR32((chan << 9) + (ofs))
448
449#define IOP13XX_ADMA_ACCR(chan) IOP13XX_ADMA_OFFSET(chan, 0x0)
450#define IOP13XX_ADMA_ACSR(chan) IOP13XX_ADMA_OFFSET(chan, 0x4)
451#define IOP13XX_ADMA_ADAR(chan) IOP13XX_ADMA_OFFSET(chan, 0x8)
452#define IOP13XX_ADMA_IIPCR(chan) IOP13XX_ADMA_OFFSET(chan, 0x18)
453#define IOP13XX_ADMA_IIPAR(chan) IOP13XX_ADMA_OFFSET(chan, 0x1c)
454#define IOP13XX_ADMA_IIPUAR(chan) IOP13XX_ADMA_OFFSET(chan, 0x20)
455#define IOP13XX_ADMA_ANDAR(chan) IOP13XX_ADMA_OFFSET(chan, 0x24)
456#define IOP13XX_ADMA_ADCR(chan) IOP13XX_ADMA_OFFSET(chan, 0x28)
457#define IOP13XX_ADMA_CARMD(chan) IOP13XX_ADMA_OFFSET(chan, 0x2c)
458#define IOP13XX_ADMA_ABCR(chan) IOP13XX_ADMA_OFFSET(chan, 0x30)
459#define IOP13XX_ADMA_DLADR(chan) IOP13XX_ADMA_OFFSET(chan, 0x34)
460#define IOP13XX_ADMA_DUADR(chan) IOP13XX_ADMA_OFFSET(chan, 0x38)
461#define IOP13XX_ADMA_SLAR(src, chan) IOP13XX_ADMA_OFFSET(chan, 0x3c + (src <<3))
462#define IOP13XX_ADMA_SUAR(src, chan) IOP13XX_ADMA_OFFSET(chan, 0x40 + (src <<3))
463 457
464/*==============================XSI BRIDGE===============================*/ 458/*==============================XSI BRIDGE===============================*/
465#define IOP13XX_XBG_BECSR IOP13XX_REG_ADDR32(0x178c) 459#define IOP13XX_XBG_BECSR IOP13XX_REG_ADDR32(0x178c)
diff --git a/include/asm-arm/arch-iop32x/adma.h b/include/asm-arm/arch-iop32x/adma.h
new file mode 100644
index 000000000000..5ed92037dd10
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/adma.h
@@ -0,0 +1,5 @@
1#ifndef IOP32X_ADMA_H
2#define IOP32X_ADMA_H
3#include <asm/hardware/iop3xx-adma.h>
4#endif
5
diff --git a/include/asm-arm/arch-iop33x/adma.h b/include/asm-arm/arch-iop33x/adma.h
new file mode 100644
index 000000000000..4b92f795f90e
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/adma.h
@@ -0,0 +1,5 @@
1#ifndef IOP33X_ADMA_H
2#define IOP33X_ADMA_H
3#include <asm/hardware/iop3xx-adma.h>
4#endif
5
diff --git a/include/asm-arm/arch-ixp4xx/ixdp425.h b/include/asm-arm/arch-ixp4xx/ixdp425.h
index 3d3820d7ba09..e0791af3bfea 100644
--- a/include/asm-arm/arch-ixp4xx/ixdp425.h
+++ b/include/asm-arm/arch-ixp4xx/ixdp425.h
@@ -32,4 +32,8 @@
32#define IXDP425_PCI_INTC_PIN 9 32#define IXDP425_PCI_INTC_PIN 9
33#define IXDP425_PCI_INTD_PIN 8 33#define IXDP425_PCI_INTD_PIN 8
34 34
35/* NAND Flash pins */
36#define IXDP425_NAND_NCE_PIN 12
35 37
38#define IXDP425_NAND_CMD_BYTE 0x01
39#define IXDP425_NAND_ADDR_BYTE 0x02
diff --git a/include/asm-arm/arch-ixp4xx/udc.h b/include/asm-arm/arch-ixp4xx/udc.h
index 79b850a3be47..dbdec36ff0d1 100644
--- a/include/asm-arm/arch-ixp4xx/udc.h
+++ b/include/asm-arm/arch-ixp4xx/udc.h
@@ -6,25 +6,3 @@
6 6
7extern void ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info); 7extern void ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info);
8 8
9static inline int udc_gpio_to_irq(unsigned gpio)
10{
11 return 0;
12}
13
14static inline void udc_gpio_init_vbus(unsigned gpio)
15{
16}
17
18static inline void udc_gpio_init_pullup(unsigned gpio)
19{
20}
21
22static inline int udc_gpio_get(unsigned gpio)
23{
24 return 0;
25}
26
27static inline void udc_gpio_set(unsigned gpio, int is_on)
28{
29}
30
diff --git a/include/asm-arm/arch-ixp4xx/uncompress.h b/include/asm-arm/arch-ixp4xx/uncompress.h
index 09ae6c91be60..f7a35b78823f 100644
--- a/include/asm-arm/arch-ixp4xx/uncompress.h
+++ b/include/asm-arm/arch-ixp4xx/uncompress.h
@@ -38,9 +38,10 @@ static void flush(void)
38static __inline__ void __arch_decomp_setup(unsigned long arch_id) 38static __inline__ void __arch_decomp_setup(unsigned long arch_id)
39{ 39{
40 /* 40 /*
41 * Coyote and gtwx5715 only have UART2 connected 41 * Some boards are using UART2 as console
42 */ 42 */
43 if (machine_is_adi_coyote() || machine_is_gtwx5715()) 43 if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
44 machine_is_gateway7001() || machine_is_wg302v2())
44 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; 45 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
45 else 46 else
46 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; 47 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
diff --git a/include/asm-arm/arch-ks8695/gpio.h b/include/asm-arm/arch-ks8695/gpio.h
new file mode 100644
index 000000000000..65ceea28607b
--- /dev/null
+++ b/include/asm-arm/arch-ks8695/gpio.h
@@ -0,0 +1,79 @@
1/*
2 * include/asm-arm/arch-ks8695/gpio.h
3 *
4 * Copyright (C) 2006 Andrew Victor
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_GPIO_H_
12#define __ASM_ARCH_GPIO_H_
13
14#define KS8695_GPIO_0 0
15#define KS8695_GPIO_1 1
16#define KS8695_GPIO_2 2
17#define KS8695_GPIO_3 3
18#define KS8695_GPIO_4 4
19#define KS8695_GPIO_5 5
20#define KS8695_GPIO_6 6
21#define KS8695_GPIO_7 7
22#define KS8695_GPIO_8 8
23#define KS8695_GPIO_9 9
24#define KS8695_GPIO_10 10
25#define KS8695_GPIO_11 11
26#define KS8695_GPIO_12 12
27#define KS8695_GPIO_13 13
28#define KS8695_GPIO_14 14
29#define KS8695_GPIO_15 15
30
31
32/*
33 * Configure GPIO pin as external interrupt source.
34 */
35int __init_or_module ks8695_gpio_interrupt(unsigned int pin, unsigned int type);
36
37/*
38 * Configure the GPIO line as an input.
39 */
40int __init_or_module gpio_direction_input(unsigned int pin);
41
42/*
43 * Configure the GPIO line as an output, with default state.
44 */
45int __init_or_module gpio_direction_output(unsigned int pin, unsigned int state);
46
47/*
48 * Set the state of an output GPIO line.
49 */
50void gpio_set_value(unsigned int pin, unsigned int state);
51
52/*
53 * Read the state of a GPIO line.
54 */
55int gpio_get_value(unsigned int pin);
56
57/*
58 * Map GPIO line to IRQ number.
59 */
60int gpio_to_irq(unsigned int pin);
61
62/*
63 * Map IRQ number to GPIO line.
64 */
65int irq_to_gpio(unsigned int irq);
66
67
68#include <asm-generic/gpio.h>
69
70static inline int gpio_request(unsigned int pin, const char *label)
71{
72 return 0;
73}
74
75static inline void gpio_free(unsigned int pin)
76{
77}
78
79#endif
diff --git a/include/asm-arm/arch-pxa/dma.h b/include/asm-arm/arch-pxa/dma.h
index bed042d71d68..3280ee2ddfa5 100644
--- a/include/asm-arm/arch-pxa/dma.h
+++ b/include/asm-arm/arch-pxa/dma.h
@@ -30,30 +30,12 @@ typedef enum {
30 DMA_PRIO_LOW = 2 30 DMA_PRIO_LOW = 2
31} pxa_dma_prio; 31} pxa_dma_prio;
32 32
33#if defined(CONFIG_PXA27x)
34
35#define PXA_DMA_CHANNELS 32
36
37#define pxa_for_each_dma_prio(ch, prio) \
38for ( \
39 ch = prio * 4; \
40 ch != (4 << prio) + 16; \
41 ch = (ch + 1 == (4 << prio)) ? (prio * 4 + 16) : (ch + 1) \
42)
43
44#elif defined(CONFIG_PXA25x)
45
46#define PXA_DMA_CHANNELS 16
47
48#define pxa_for_each_dma_prio(ch, prio) \
49 for (ch = prio * 4; ch != (4 << prio); ch++)
50
51#endif
52
53/* 33/*
54 * DMA registration 34 * DMA registration
55 */ 35 */
56 36
37int __init pxa_init_dma(int num_ch);
38
57int pxa_request_dma (char *name, 39int pxa_request_dma (char *name,
58 pxa_dma_prio prio, 40 pxa_dma_prio prio,
59 void (*irq_handler)(int, void *), 41 void (*irq_handler)(int, void *),
diff --git a/include/asm-arm/arch-pxa/entry-macro.S b/include/asm-arm/arch-pxa/entry-macro.S
index 1d5fbb9b379a..b7e730851461 100644
--- a/include/asm-arm/arch-pxa/entry-macro.S
+++ b/include/asm-arm/arch-pxa/entry-macro.S
@@ -20,20 +20,38 @@
20 .endm 20 .endm
21 21
22 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 22 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
23#ifdef CONFIG_PXA27x 23 mrc p15, 0, \tmp, c0, c0, 0 @ CPUID
24 mrc p6, 0, \irqstat, c0, c0, 0 @ ICIP 24 mov \tmp, \tmp, lsr #13
25 mrc p6, 0, \irqnr, c1, c0, 0 @ ICMR 25 and \tmp, \tmp, #0x7 @ Core G
26#else 26 cmp \tmp, #1
27 bhi 1004f
28
27 mov \base, #io_p2v(0x40000000) @ IIR Ctl = 0x40d00000 29 mov \base, #io_p2v(0x40000000) @ IIR Ctl = 0x40d00000
28 add \base, \base, #0x00d00000 30 add \base, \base, #0x00d00000
29 ldr \irqstat, [\base, #0] @ ICIP 31 ldr \irqstat, [\base, #0] @ ICIP
30 ldr \irqnr, [\base, #4] @ ICMR 32 ldr \irqnr, [\base, #4] @ ICMR
31#endif 33 b 1002f
34
351004:
36 mrc p6, 0, \irqstat, c6, c0, 0 @ ICIP2
37 mrc p6, 0, \irqnr, c7, c0, 0 @ ICMR2
38 ands \irqstat, \irqstat, \irqnr
39 beq 1003f
40 rsb \irqstat, \irqnr, #0
41 and \irqstat, \irqstat, \irqnr
42 clz \irqnr, \irqstat
43 rsb \irqnr, \irqnr, #31
44 add \irqnr, \irqnr, #32
45 b 1001f
461003:
47 mrc p6, 0, \irqstat, c0, c0, 0 @ ICIP
48 mrc p6, 0, \irqnr, c1, c0, 0 @ ICMR
491002:
32 ands \irqnr, \irqstat, \irqnr 50 ands \irqnr, \irqstat, \irqnr
33 beq 1001f 51 beq 1001f
34 rsb \irqstat, \irqnr, #0 52 rsb \irqstat, \irqnr, #0
35 and \irqstat, \irqstat, \irqnr 53 and \irqstat, \irqstat, \irqnr
36 clz \irqnr, \irqstat 54 clz \irqnr, \irqstat
37 rsb \irqnr, \irqnr, #(31 - PXA_IRQ_SKIP) 55 rsb \irqnr, \irqnr, #31
381001: 561001:
39 .endm 57 .endm
diff --git a/include/asm-arm/arch-pxa/gpio.h b/include/asm-arm/arch-pxa/gpio.h
index aeba24347f8e..9e99241f3edf 100644
--- a/include/asm-arm/arch-pxa/gpio.h
+++ b/include/asm-arm/arch-pxa/gpio.h
@@ -45,7 +45,8 @@ static inline int gpio_direction_input(unsigned gpio)
45 45
46static inline int gpio_direction_output(unsigned gpio, int value) 46static inline int gpio_direction_output(unsigned gpio, int value)
47{ 47{
48 return pxa_gpio_mode(gpio | GPIO_OUT | (value ? 0 : GPIO_DFLT_LOW)); 48 return pxa_gpio_mode(gpio | GPIO_OUT |
49 (value ? GPIO_DFLT_HIGH : GPIO_DFLT_LOW));
49} 50}
50 51
51static inline int __gpio_get_value(unsigned gpio) 52static inline int __gpio_get_value(unsigned gpio)
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h
index e2bdc2fbede1..386121746417 100644
--- a/include/asm-arm/arch-pxa/hardware.h
+++ b/include/asm-arm/arch-pxa/hardware.h
@@ -62,6 +62,42 @@
62 62
63#ifndef __ASSEMBLY__ 63#ifndef __ASSEMBLY__
64 64
65#define __cpu_is_pxa21x(id) \
66 ({ \
67 unsigned int _id = (id) >> 4 & 0xf3f; \
68 _id == 0x212; \
69 })
70
71#define __cpu_is_pxa25x(id) \
72 ({ \
73 unsigned int _id = (id) >> 4 & 0xfff; \
74 _id == 0x2d0 || _id == 0x290; \
75 })
76
77#define __cpu_is_pxa27x(id) \
78 ({ \
79 unsigned int _id = (id) >> 4 & 0xfff; \
80 _id == 0x411; \
81 })
82
83#define cpu_is_pxa21x() \
84 ({ \
85 unsigned int id = read_cpuid(CPUID_ID); \
86 __cpu_is_pxa21x(id); \
87 })
88
89#define cpu_is_pxa25x() \
90 ({ \
91 unsigned int id = read_cpuid(CPUID_ID); \
92 __cpu_is_pxa25x(id); \
93 })
94
95#define cpu_is_pxa27x() \
96 ({ \
97 unsigned int id = read_cpuid(CPUID_ID); \
98 __cpu_is_pxa27x(id); \
99 })
100
65/* 101/*
66 * Handy routine to set GPIO alternate functions 102 * Handy routine to set GPIO alternate functions
67 */ 103 */
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h
index 67ed43674c63..a07fe0f928cd 100644
--- a/include/asm-arm/arch-pxa/irqs.h
+++ b/include/asm-arm/arch-pxa/irqs.h
@@ -11,14 +11,9 @@
11 */ 11 */
12 12
13 13
14#ifdef CONFIG_PXA27x 14#define PXA_IRQ(x) (x)
15#define PXA_IRQ_SKIP 0
16#else
17#define PXA_IRQ_SKIP 7
18#endif
19
20#define PXA_IRQ(x) ((x) - PXA_IRQ_SKIP)
21 15
16#ifdef CONFIG_PXA27x
22#define IRQ_SSP3 PXA_IRQ(0) /* SSP3 service request */ 17#define IRQ_SSP3 PXA_IRQ(0) /* SSP3 service request */
23#define IRQ_MSL PXA_IRQ(1) /* MSL Interface interrupt */ 18#define IRQ_MSL PXA_IRQ(1) /* MSL Interface interrupt */
24#define IRQ_USBH2 PXA_IRQ(2) /* USB Host interrupt 1 (OHCI) */ 19#define IRQ_USBH2 PXA_IRQ(2) /* USB Host interrupt 1 (OHCI) */
@@ -26,6 +21,8 @@
26#define IRQ_KEYPAD PXA_IRQ(4) /* Key pad controller */ 21#define IRQ_KEYPAD PXA_IRQ(4) /* Key pad controller */
27#define IRQ_MEMSTK PXA_IRQ(5) /* Memory Stick interrupt */ 22#define IRQ_MEMSTK PXA_IRQ(5) /* Memory Stick interrupt */
28#define IRQ_PWRI2C PXA_IRQ(6) /* Power I2C interrupt */ 23#define IRQ_PWRI2C PXA_IRQ(6) /* Power I2C interrupt */
24#endif
25
29#define IRQ_HWUART PXA_IRQ(7) /* HWUART Transmit/Receive/Error (PXA26x) */ 26#define IRQ_HWUART PXA_IRQ(7) /* HWUART Transmit/Receive/Error (PXA26x) */
30#define IRQ_OST_4_11 PXA_IRQ(7) /* OS timer 4-11 matches (PXA27x) */ 27#define IRQ_OST_4_11 PXA_IRQ(7) /* OS timer 4-11 matches (PXA27x) */
31#define IRQ_GPIO0 PXA_IRQ(8) /* GPIO0 Edge Detect */ 28#define IRQ_GPIO0 PXA_IRQ(8) /* GPIO0 Edge Detect */
@@ -58,18 +55,15 @@
58#ifdef CONFIG_PXA27x 55#ifdef CONFIG_PXA27x
59#define IRQ_TPM PXA_IRQ(32) /* TPM interrupt */ 56#define IRQ_TPM PXA_IRQ(32) /* TPM interrupt */
60#define IRQ_CAMERA PXA_IRQ(33) /* Camera Interface */ 57#define IRQ_CAMERA PXA_IRQ(33) /* Camera Interface */
61
62#define PXA_INTERNAL_IRQS 34
63#else
64#define PXA_INTERNAL_IRQS 32
65#endif 58#endif
66 59
67#define GPIO_2_x_TO_IRQ(x) \ 60#define PXA_GPIO_IRQ_BASE (64)
68 PXA_IRQ((x) - 2 + PXA_INTERNAL_IRQS) 61#define PXA_GPIO_IRQ_NUM (128)
62
63#define GPIO_2_x_TO_IRQ(x) (PXA_GPIO_IRQ_BASE + (x))
69#define IRQ_GPIO(x) (((x) < 2) ? (IRQ_GPIO0 + (x)) : GPIO_2_x_TO_IRQ(x)) 64#define IRQ_GPIO(x) (((x) < 2) ? (IRQ_GPIO0 + (x)) : GPIO_2_x_TO_IRQ(x))
70 65
71#define IRQ_TO_GPIO_2_x(i) \ 66#define IRQ_TO_GPIO_2_x(i) ((i) - PXA_GPIO_IRQ_BASE)
72 ((i) - IRQ_GPIO(2) + 2)
73#define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i)) 67#define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i))
74 68
75#if defined(CONFIG_PXA25x) 69#if defined(CONFIG_PXA25x)
@@ -84,7 +78,7 @@
84 * these. If you need more, increase IRQ_BOARD_END, but keep it 78 * these. If you need more, increase IRQ_BOARD_END, but keep it
85 * within sensible limits. 79 * within sensible limits.
86 */ 80 */
87#define IRQ_BOARD_START (IRQ_GPIO(PXA_LAST_GPIO) + 1) 81#define IRQ_BOARD_START (PXA_GPIO_IRQ_BASE + PXA_GPIO_IRQ_NUM)
88#define IRQ_BOARD_END (IRQ_BOARD_START + 16) 82#define IRQ_BOARD_END (IRQ_BOARD_START + 16)
89 83
90#define IRQ_SA1111_START (IRQ_BOARD_END) 84#define IRQ_SA1111_START (IRQ_BOARD_END)
diff --git a/include/asm-arm/arch-pxa/pm.h b/include/asm-arm/arch-pxa/pm.h
index 7a8a1cdf430d..52243a62c4e7 100644
--- a/include/asm-arm/arch-pxa/pm.h
+++ b/include/asm-arm/arch-pxa/pm.h
@@ -9,4 +9,3 @@
9 9
10extern int pxa_pm_prepare(suspend_state_t state); 10extern int pxa_pm_prepare(suspend_state_t state);
11extern int pxa_pm_enter(suspend_state_t state); 11extern int pxa_pm_enter(suspend_state_t state);
12extern int pxa_pm_finish(suspend_state_t state);
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index dbcc9298b0c8..e68b593d69da 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1765,29 +1765,9 @@
1765#define SSACD_P(x) (*(((x) == 1) ? &SSACD_P1 : ((x) == 2) ? &SSACD_P2 : ((x) == 3) ? &SSACD_P3 : NULL)) 1765#define SSACD_P(x) (*(((x) == 1) ? &SSACD_P1 : ((x) == 2) ? &SSACD_P2 : ((x) == 3) ? &SSACD_P3 : NULL))
1766 1766
1767/* 1767/*
1768 * MultiMediaCard (MMC) controller 1768 * MultiMediaCard (MMC) controller - see drivers/mmc/host/pxamci.h
1769 */ 1769 */
1770 1770
1771#define MMC_STRPCL __REG(0x41100000) /* Control to start and stop MMC clock */
1772#define MMC_STAT __REG(0x41100004) /* MMC Status Register (read only) */
1773#define MMC_CLKRT __REG(0x41100008) /* MMC clock rate */
1774#define MMC_SPI __REG(0x4110000c) /* SPI mode control bits */
1775#define MMC_CMDAT __REG(0x41100010) /* Command/response/data sequence control */
1776#define MMC_RESTO __REG(0x41100014) /* Expected response time out */
1777#define MMC_RDTO __REG(0x41100018) /* Expected data read time out */
1778#define MMC_BLKLEN __REG(0x4110001c) /* Block length of data transaction */
1779#define MMC_NOB __REG(0x41100020) /* Number of blocks, for block mode */
1780#define MMC_PRTBUF __REG(0x41100024) /* Partial MMC_TXFIFO FIFO written */
1781#define MMC_I_MASK __REG(0x41100028) /* Interrupt Mask */
1782#define MMC_I_REG __REG(0x4110002c) /* Interrupt Register (read only) */
1783#define MMC_CMD __REG(0x41100030) /* Index of current command */
1784#define MMC_ARGH __REG(0x41100034) /* MSW part of the current command argument */
1785#define MMC_ARGL __REG(0x41100038) /* LSW part of the current command argument */
1786#define MMC_RES __REG(0x4110003c) /* Response FIFO (read only) */
1787#define MMC_RXFIFO __REG(0x41100040) /* Receive FIFO (read only) */
1788#define MMC_TXFIFO __REG(0x41100044) /* Transmit FIFO (write only) */
1789
1790
1791/* 1771/*
1792 * Core Clock 1772 * Core Clock
1793 */ 1773 */
diff --git a/include/asm-arm/arch-pxa/udc.h b/include/asm-arm/arch-pxa/udc.h
index 8bc6f9c3e3ea..27aa3a91012f 100644
--- a/include/asm-arm/arch-pxa/udc.h
+++ b/include/asm-arm/arch-pxa/udc.h
@@ -1,41 +1,8 @@
1/* 1/*
2 * linux/include/asm-arm/arch-pxa/udc.h 2 * linux/include/asm-arm/arch-pxa/udc.h
3 * 3 *
4 * This supports machine-specific differences in how the PXA2xx
5 * USB Device Controller (UDC) is wired.
6 *
7 */ 4 */
8#include <asm/mach/udc_pxa2xx.h> 5#include <asm/mach/udc_pxa2xx.h>
9 6
10extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info); 7extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info);
11 8
12static inline int udc_gpio_to_irq(unsigned gpio)
13{
14 return IRQ_GPIO(gpio & GPIO_MD_MASK_NR);
15}
16
17static inline void udc_gpio_init_vbus(unsigned gpio)
18{
19 pxa_gpio_mode((gpio & GPIO_MD_MASK_NR) | GPIO_IN);
20}
21
22static inline void udc_gpio_init_pullup(unsigned gpio)
23{
24 pxa_gpio_mode((gpio & GPIO_MD_MASK_NR) | GPIO_OUT | GPIO_DFLT_LOW);
25}
26
27static inline int udc_gpio_get(unsigned gpio)
28{
29 return (GPLR(gpio) & GPIO_bit(gpio)) != 0;
30}
31
32static inline void udc_gpio_set(unsigned gpio, int is_on)
33{
34 int mask = GPIO_bit(gpio);
35
36 if (is_on)
37 GPSR(gpio) = mask;
38 else
39 GPCR(gpio) = mask;
40}
41
diff --git a/include/asm-arm/arch-s3c2410/anubis-cpld.h b/include/asm-arm/arch-s3c2410/anubis-cpld.h
index dcebf6d61903..168b93fee529 100644
--- a/include/asm-arm/arch-s3c2410/anubis-cpld.h
+++ b/include/asm-arm/arch-s3c2410/anubis-cpld.h
@@ -18,4 +18,8 @@
18 18
19#define ANUBIS_CTRL1_NANDSEL (0x3) 19#define ANUBIS_CTRL1_NANDSEL (0x3)
20 20
21/* IDREG - revision */
22
23#define ANUBIS_IDREG_REVMASK (0x7)
24
21#endif /* __ASM_ARCH_ANUBISCPLD_H */ 25#endif /* __ASM_ARCH_ANUBISCPLD_H */
diff --git a/include/asm-arm/arch-s3c2410/anubis-map.h b/include/asm-arm/arch-s3c2410/anubis-map.h
index ab076de4a0d0..830d114261da 100644
--- a/include/asm-arm/arch-s3c2410/anubis-map.h
+++ b/include/asm-arm/arch-s3c2410/anubis-map.h
@@ -27,14 +27,8 @@
27#define ANUBIS_VA_CTRL1 ANUBIS_IOADDR(0x00000000) /* 0x01800000 */ 27#define ANUBIS_VA_CTRL1 ANUBIS_IOADDR(0x00000000) /* 0x01800000 */
28#define ANUBIS_PA_CTRL1 (ANUBIS_PA_CPLD) 28#define ANUBIS_PA_CTRL1 (ANUBIS_PA_CPLD)
29 29
30#define ANUBIS_VA_CTRL2 ANUBIS_IOADDR(0x00100000) /* 0x01900000 */ 30#define ANUBIS_VA_IDREG ANUBIS_IOADDR(0x00300000) /* 0x01B00000 */
31#define ANUBIS_PA_CTRL2 (ANUBIS_PA_CPLD) 31#define ANUBIS_PA_IDREG (ANUBIS_PA_CPLD + (3<<23))
32
33#define ANUBIS_VA_CTRL3 ANUBIS_IOADDR(0x00200000) /* 0x01A00000 */
34#define ANUBIS_PA_CTRL3 (ANUBIS_PA_CPLD)
35
36#define ANUBIS_VA_CTRL4 ANUBIS_IOADDR(0x00300000) /* 0x01B00000 */
37#define ANUBIS_PA_CTRL4 (ANUBIS_PA_CPLD)
38 32
39#define ANUBIS_IDEPRI ANUBIS_IOADDR(0x01000000) 33#define ANUBIS_IDEPRI ANUBIS_IOADDR(0x01000000)
40#define ANUBIS_IDEPRIAUX ANUBIS_IOADDR(0x01100000) 34#define ANUBIS_IDEPRIAUX ANUBIS_IOADDR(0x01100000)
diff --git a/include/asm-arm/arch-s3c2410/osiris-cpld.h b/include/asm-arm/arch-s3c2410/osiris-cpld.h
index 3b6498468d62..229ab2351db6 100644
--- a/include/asm-arm/arch-s3c2410/osiris-cpld.h
+++ b/include/asm-arm/arch-s3c2410/osiris-cpld.h
@@ -1,6 +1,6 @@
1/* linux/include/asm-arm/arch-s3c2410/osiris-cpld.h 1/* linux/include/asm-arm/arch-s3c2410/osiris-cpld.h
2 * 2 *
3 * Copyright (c) 2005 Simtec Electronics 3 * Copyright 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/ 4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
@@ -14,12 +14,17 @@
14#ifndef __ASM_ARCH_OSIRISCPLD_H 14#ifndef __ASM_ARCH_OSIRISCPLD_H
15#define __ASM_ARCH_OSIRISCPLD_H 15#define __ASM_ARCH_OSIRISCPLD_H
16 16
17/* CTRL1 - NAND WP control */ 17/* CTRL0 - NAND WP control */
18 18
19#define OSIRIS_CTRL1_NANDSEL (0x3) 19#define OSIRIS_CTRL0_NANDSEL (0x3)
20#define OSIRIS_CTRL1_BOOT_INT (1<<3) 20#define OSIRIS_CTRL0_BOOT_INT (1<<3)
21#define OSIRIS_CTRL1_PCMCIA (1<<4) 21#define OSIRIS_CTRL0_PCMCIA (1<<4)
22#define OSIRIS_CTRL1_PCMCIA_nWAIT (1<<6) 22#define OSIRIS_CTRL0_FIX8 (1<<5)
23#define OSIRIS_CTRL1_PCMCIA_nIOIS16 (1<<7) 23#define OSIRIS_CTRL0_PCMCIA_nWAIT (1<<6)
24#define OSIRIS_CTRL0_PCMCIA_nIOIS16 (1<<7)
25
26#define OSIRIS_CTRL1_FIX8 (1<<0)
27
28#define OSIRIS_ID_REVMASK (0x7)
24 29
25#endif /* __ASM_ARCH_OSIRISCPLD_H */ 30#endif /* __ASM_ARCH_OSIRISCPLD_H */
diff --git a/include/asm-arm/arch-s3c2410/osiris-map.h b/include/asm-arm/arch-s3c2410/osiris-map.h
index a14164dfa525..b5c74d2b9aaa 100644
--- a/include/asm-arm/arch-s3c2410/osiris-map.h
+++ b/include/asm-arm/arch-s3c2410/osiris-map.h
@@ -24,16 +24,19 @@
24 24
25/* we put the CPLD registers next, to get them out of the way */ 25/* we put the CPLD registers next, to get them out of the way */
26 26
27#define OSIRIS_VA_CTRL1 OSIRIS_IOADDR(0x00000000) 27#define OSIRIS_VA_CTRL0 OSIRIS_IOADDR(0x00000000)
28#define OSIRIS_PA_CTRL1 (OSIRIS_PA_CPLD) 28#define OSIRIS_PA_CTRL0 (OSIRIS_PA_CPLD)
29 29
30#define OSIRIS_VA_CTRL2 OSIRIS_IOADDR(0x00100000) 30#define OSIRIS_VA_CTRL1 OSIRIS_IOADDR(0x00100000)
31#define OSIRIS_PA_CTRL2 (OSIRIS_PA_CPLD + (1<<23)) 31#define OSIRIS_PA_CTRL1 (OSIRIS_PA_CPLD + (1<<23))
32 32
33#define OSIRIS_VA_CTRL3 OSIRIS_IOADDR(0x00200000) 33#define OSIRIS_VA_CTRL2 OSIRIS_IOADDR(0x00200000)
34#define OSIRIS_PA_CTRL3 (OSIRIS_PA_CPLD + (2<<23)) 34#define OSIRIS_PA_CTRL2 (OSIRIS_PA_CPLD + (2<<23))
35 35
36#define OSIRIS_VA_CTRL4 OSIRIS_IOADDR(0x00300000) 36#define OSIRIS_VA_CTRL3 OSIRIS_IOADDR(0x00300000)
37#define OSIRIS_PA_CTRL4 (OSIRIS_PA_CPLD + (3<<23)) 37#define OSIRIS_PA_CTRL3 (OSIRIS_PA_CPLD + (2<<23))
38
39#define OSIRIS_VA_IDREG OSIRIS_IOADDR(0x00700000)
40#define OSIRIS_PA_IDREG (OSIRIS_PA_CPLD + (7<<23))
38 41
39#endif /* __ASM_ARCH_OSIRISMAP_H */ 42#endif /* __ASM_ARCH_OSIRISMAP_H */
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h
index 3679a8a8922e..d7a777f05088 100644
--- a/include/asm-arm/elf.h
+++ b/include/asm-arm/elf.h
@@ -7,6 +7,7 @@
7 */ 7 */
8#include <asm/ptrace.h> 8#include <asm/ptrace.h>
9#include <asm/user.h> 9#include <asm/user.h>
10#include <asm/hwcap.h>
10 11
11typedef unsigned long elf_greg_t; 12typedef unsigned long elf_greg_t;
12typedef unsigned long elf_freg_t[3]; 13typedef unsigned long elf_freg_t[3];
@@ -39,31 +40,9 @@ typedef struct user_fp elf_fpregset_t;
39#endif 40#endif
40#define ELF_ARCH EM_ARM 41#define ELF_ARCH EM_ARM
41 42
42/*
43 * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
44 */
45#define HWCAP_SWP 1
46#define HWCAP_HALF 2
47#define HWCAP_THUMB 4
48#define HWCAP_26BIT 8 /* Play it safe */
49#define HWCAP_FAST_MULT 16
50#define HWCAP_FPA 32
51#define HWCAP_VFP 64
52#define HWCAP_EDSP 128
53#define HWCAP_JAVA 256
54#define HWCAP_IWMMXT 512
55#define HWCAP_CRUNCH 1024
56
57#ifdef __KERNEL__ 43#ifdef __KERNEL__
58#ifndef __ASSEMBLY__ 44#ifndef __ASSEMBLY__
59/* 45/*
60 * This yields a mask that user programs can use to figure out what
61 * instruction set this cpu supports.
62 */
63#define ELF_HWCAP (elf_hwcap)
64extern unsigned int elf_hwcap;
65
66/*
67 * This yields a string that ld.so will use to load implementation 46 * This yields a string that ld.so will use to load implementation
68 * specific libraries for optimization. This is more specific in 47 * specific libraries for optimization. This is more specific in
69 * intent than poking at uname or /proc/cpuinfo. 48 * intent than poking at uname or /proc/cpuinfo.
diff --git a/include/asm-arm/fb.h b/include/asm-arm/fb.h
new file mode 100644
index 000000000000..d92e99cd8c8a
--- /dev/null
+++ b/include/asm-arm/fb.h
@@ -0,0 +1,19 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7
8static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
9 unsigned long off)
10{
11 vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
12}
13
14static inline int fb_is_primary_device(struct fb_info *info)
15{
16 return 0;
17}
18
19#endif /* _ASM_FB_H_ */
diff --git a/include/asm-arm/hardware/iop3xx-adma.h b/include/asm-arm/hardware/iop3xx-adma.h
new file mode 100644
index 000000000000..10834b54f681
--- /dev/null
+++ b/include/asm-arm/hardware/iop3xx-adma.h
@@ -0,0 +1,892 @@
1/*
2 * Copyright © 2006, Intel Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as 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 for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16 *
17 */
18#ifndef _ADMA_H
19#define _ADMA_H
20#include <linux/types.h>
21#include <linux/io.h>
22#include <asm/hardware.h>
23#include <asm/hardware/iop_adma.h>
24
25/* Memory copy units */
26#define DMA_CCR(chan) (chan->mmr_base + 0x0)
27#define DMA_CSR(chan) (chan->mmr_base + 0x4)
28#define DMA_DAR(chan) (chan->mmr_base + 0xc)
29#define DMA_NDAR(chan) (chan->mmr_base + 0x10)
30#define DMA_PADR(chan) (chan->mmr_base + 0x14)
31#define DMA_PUADR(chan) (chan->mmr_base + 0x18)
32#define DMA_LADR(chan) (chan->mmr_base + 0x1c)
33#define DMA_BCR(chan) (chan->mmr_base + 0x20)
34#define DMA_DCR(chan) (chan->mmr_base + 0x24)
35
36/* Application accelerator unit */
37#define AAU_ACR(chan) (chan->mmr_base + 0x0)
38#define AAU_ASR(chan) (chan->mmr_base + 0x4)
39#define AAU_ADAR(chan) (chan->mmr_base + 0x8)
40#define AAU_ANDAR(chan) (chan->mmr_base + 0xc)
41#define AAU_SAR(src, chan) (chan->mmr_base + (0x10 + ((src) << 2)))
42#define AAU_DAR(chan) (chan->mmr_base + 0x20)
43#define AAU_ABCR(chan) (chan->mmr_base + 0x24)
44#define AAU_ADCR(chan) (chan->mmr_base + 0x28)
45#define AAU_SAR_EDCR(src_edc) (chan->mmr_base + (0x02c + ((src_edc-4) << 2)))
46#define AAU_EDCR0_IDX 8
47#define AAU_EDCR1_IDX 17
48#define AAU_EDCR2_IDX 26
49
50#define DMA0_ID 0
51#define DMA1_ID 1
52#define AAU_ID 2
53
54struct iop3xx_aau_desc_ctrl {
55 unsigned int int_en:1;
56 unsigned int blk1_cmd_ctrl:3;
57 unsigned int blk2_cmd_ctrl:3;
58 unsigned int blk3_cmd_ctrl:3;
59 unsigned int blk4_cmd_ctrl:3;
60 unsigned int blk5_cmd_ctrl:3;
61 unsigned int blk6_cmd_ctrl:3;
62 unsigned int blk7_cmd_ctrl:3;
63 unsigned int blk8_cmd_ctrl:3;
64 unsigned int blk_ctrl:2;
65 unsigned int dual_xor_en:1;
66 unsigned int tx_complete:1;
67 unsigned int zero_result_err:1;
68 unsigned int zero_result_en:1;
69 unsigned int dest_write_en:1;
70};
71
72struct iop3xx_aau_e_desc_ctrl {
73 unsigned int reserved:1;
74 unsigned int blk1_cmd_ctrl:3;
75 unsigned int blk2_cmd_ctrl:3;
76 unsigned int blk3_cmd_ctrl:3;
77 unsigned int blk4_cmd_ctrl:3;
78 unsigned int blk5_cmd_ctrl:3;
79 unsigned int blk6_cmd_ctrl:3;
80 unsigned int blk7_cmd_ctrl:3;
81 unsigned int blk8_cmd_ctrl:3;
82 unsigned int reserved2:7;
83};
84
85struct iop3xx_dma_desc_ctrl {
86 unsigned int pci_transaction:4;
87 unsigned int int_en:1;
88 unsigned int dac_cycle_en:1;
89 unsigned int mem_to_mem_en:1;
90 unsigned int crc_data_tx_en:1;
91 unsigned int crc_gen_en:1;
92 unsigned int crc_seed_dis:1;
93 unsigned int reserved:21;
94 unsigned int crc_tx_complete:1;
95};
96
97struct iop3xx_desc_dma {
98 u32 next_desc;
99 union {
100 u32 pci_src_addr;
101 u32 pci_dest_addr;
102 u32 src_addr;
103 };
104 union {
105 u32 upper_pci_src_addr;
106 u32 upper_pci_dest_addr;
107 };
108 union {
109 u32 local_pci_src_addr;
110 u32 local_pci_dest_addr;
111 u32 dest_addr;
112 };
113 u32 byte_count;
114 union {
115 u32 desc_ctrl;
116 struct iop3xx_dma_desc_ctrl desc_ctrl_field;
117 };
118 u32 crc_addr;
119};
120
121struct iop3xx_desc_aau {
122 u32 next_desc;
123 u32 src[4];
124 u32 dest_addr;
125 u32 byte_count;
126 union {
127 u32 desc_ctrl;
128 struct iop3xx_aau_desc_ctrl desc_ctrl_field;
129 };
130 union {
131 u32 src_addr;
132 u32 e_desc_ctrl;
133 struct iop3xx_aau_e_desc_ctrl e_desc_ctrl_field;
134 } src_edc[31];
135};
136
137struct iop3xx_aau_gfmr {
138 unsigned int gfmr1:8;
139 unsigned int gfmr2:8;
140 unsigned int gfmr3:8;
141 unsigned int gfmr4:8;
142};
143
144struct iop3xx_desc_pq_xor {
145 u32 next_desc;
146 u32 src[3];
147 union {
148 u32 data_mult1;
149 struct iop3xx_aau_gfmr data_mult1_field;
150 };
151 u32 dest_addr;
152 u32 byte_count;
153 union {
154 u32 desc_ctrl;
155 struct iop3xx_aau_desc_ctrl desc_ctrl_field;
156 };
157 union {
158 u32 src_addr;
159 u32 e_desc_ctrl;
160 struct iop3xx_aau_e_desc_ctrl e_desc_ctrl_field;
161 u32 data_multiplier;
162 struct iop3xx_aau_gfmr data_mult_field;
163 u32 reserved;
164 } src_edc_gfmr[19];
165};
166
167struct iop3xx_desc_dual_xor {
168 u32 next_desc;
169 u32 src0_addr;
170 u32 src1_addr;
171 u32 h_src_addr;
172 u32 d_src_addr;
173 u32 h_dest_addr;
174 u32 byte_count;
175 union {
176 u32 desc_ctrl;
177 struct iop3xx_aau_desc_ctrl desc_ctrl_field;
178 };
179 u32 d_dest_addr;
180};
181
182union iop3xx_desc {
183 struct iop3xx_desc_aau *aau;
184 struct iop3xx_desc_dma *dma;
185 struct iop3xx_desc_pq_xor *pq_xor;
186 struct iop3xx_desc_dual_xor *dual_xor;
187 void *ptr;
188};
189
190static inline int iop_adma_get_max_xor(void)
191{
192 return 32;
193}
194
195static inline u32 iop_chan_get_current_descriptor(struct iop_adma_chan *chan)
196{
197 int id = chan->device->id;
198
199 switch (id) {
200 case DMA0_ID:
201 case DMA1_ID:
202 return __raw_readl(DMA_DAR(chan));
203 case AAU_ID:
204 return __raw_readl(AAU_ADAR(chan));
205 default:
206 BUG();
207 }
208 return 0;
209}
210
211static inline void iop_chan_set_next_descriptor(struct iop_adma_chan *chan,
212 u32 next_desc_addr)
213{
214 int id = chan->device->id;
215
216 switch (id) {
217 case DMA0_ID:
218 case DMA1_ID:
219 __raw_writel(next_desc_addr, DMA_NDAR(chan));
220 break;
221 case AAU_ID:
222 __raw_writel(next_desc_addr, AAU_ANDAR(chan));
223 break;
224 }
225
226}
227
228#define IOP_ADMA_STATUS_BUSY (1 << 10)
229#define IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT (1024)
230#define IOP_ADMA_XOR_MAX_BYTE_COUNT (16 * 1024 * 1024)
231#define IOP_ADMA_MAX_BYTE_COUNT (16 * 1024 * 1024)
232
233static inline int iop_chan_is_busy(struct iop_adma_chan *chan)
234{
235 u32 status = __raw_readl(DMA_CSR(chan));
236 return (status & IOP_ADMA_STATUS_BUSY) ? 1 : 0;
237}
238
239static inline int iop_desc_is_aligned(struct iop_adma_desc_slot *desc,
240 int num_slots)
241{
242 /* num_slots will only ever be 1, 2, 4, or 8 */
243 return (desc->idx & (num_slots - 1)) ? 0 : 1;
244}
245
246/* to do: support large (i.e. > hw max) buffer sizes */
247static inline int iop_chan_memcpy_slot_count(size_t len, int *slots_per_op)
248{
249 *slots_per_op = 1;
250 return 1;
251}
252
253/* to do: support large (i.e. > hw max) buffer sizes */
254static inline int iop_chan_memset_slot_count(size_t len, int *slots_per_op)
255{
256 *slots_per_op = 1;
257 return 1;
258}
259
260static inline int iop3xx_aau_xor_slot_count(size_t len, int src_cnt,
261 int *slots_per_op)
262{
263 const static int slot_count_table[] = { 0,
264 1, 1, 1, 1, /* 01 - 04 */
265 2, 2, 2, 2, /* 05 - 08 */
266 4, 4, 4, 4, /* 09 - 12 */
267 4, 4, 4, 4, /* 13 - 16 */
268 8, 8, 8, 8, /* 17 - 20 */
269 8, 8, 8, 8, /* 21 - 24 */
270 8, 8, 8, 8, /* 25 - 28 */
271 8, 8, 8, 8, /* 29 - 32 */
272 };
273 *slots_per_op = slot_count_table[src_cnt];
274 return *slots_per_op;
275}
276
277static inline int
278iop_chan_interrupt_slot_count(int *slots_per_op, struct iop_adma_chan *chan)
279{
280 switch (chan->device->id) {
281 case DMA0_ID:
282 case DMA1_ID:
283 return iop_chan_memcpy_slot_count(0, slots_per_op);
284 case AAU_ID:
285 return iop3xx_aau_xor_slot_count(0, 2, slots_per_op);
286 default:
287 BUG();
288 }
289 return 0;
290}
291
292static inline int iop_chan_xor_slot_count(size_t len, int src_cnt,
293 int *slots_per_op)
294{
295 int slot_cnt = iop3xx_aau_xor_slot_count(len, src_cnt, slots_per_op);
296
297 if (len <= IOP_ADMA_XOR_MAX_BYTE_COUNT)
298 return slot_cnt;
299
300 len -= IOP_ADMA_XOR_MAX_BYTE_COUNT;
301 while (len > IOP_ADMA_XOR_MAX_BYTE_COUNT) {
302 len -= IOP_ADMA_XOR_MAX_BYTE_COUNT;
303 slot_cnt += *slots_per_op;
304 }
305
306 if (len)
307 slot_cnt += *slots_per_op;
308
309 return slot_cnt;
310}
311
312/* zero sum on iop3xx is limited to 1k at a time so it requires multiple
313 * descriptors
314 */
315static inline int iop_chan_zero_sum_slot_count(size_t len, int src_cnt,
316 int *slots_per_op)
317{
318 int slot_cnt = iop3xx_aau_xor_slot_count(len, src_cnt, slots_per_op);
319
320 if (len <= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT)
321 return slot_cnt;
322
323 len -= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
324 while (len > IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT) {
325 len -= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
326 slot_cnt += *slots_per_op;
327 }
328
329 if (len)
330 slot_cnt += *slots_per_op;
331
332 return slot_cnt;
333}
334
335static inline u32 iop_desc_get_dest_addr(struct iop_adma_desc_slot *desc,
336 struct iop_adma_chan *chan)
337{
338 union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
339
340 switch (chan->device->id) {
341 case DMA0_ID:
342 case DMA1_ID:
343 return hw_desc.dma->dest_addr;
344 case AAU_ID:
345 return hw_desc.aau->dest_addr;
346 default:
347 BUG();
348 }
349 return 0;
350}
351
352static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc,
353 struct iop_adma_chan *chan)
354{
355 union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
356
357 switch (chan->device->id) {
358 case DMA0_ID:
359 case DMA1_ID:
360 return hw_desc.dma->byte_count;
361 case AAU_ID:
362 return hw_desc.aau->byte_count;
363 default:
364 BUG();
365 }
366 return 0;
367}
368
369/* translate the src_idx to a descriptor word index */
370static inline int __desc_idx(int src_idx)
371{
372 const static int desc_idx_table[] = { 0, 0, 0, 0,
373 0, 1, 2, 3,
374 5, 6, 7, 8,
375 9, 10, 11, 12,
376 14, 15, 16, 17,
377 18, 19, 20, 21,
378 23, 24, 25, 26,
379 27, 28, 29, 30,
380 };
381
382 return desc_idx_table[src_idx];
383}
384
385static inline u32 iop_desc_get_src_addr(struct iop_adma_desc_slot *desc,
386 struct iop_adma_chan *chan,
387 int src_idx)
388{
389 union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
390
391 switch (chan->device->id) {
392 case DMA0_ID:
393 case DMA1_ID:
394 return hw_desc.dma->src_addr;
395 case AAU_ID:
396 break;
397 default:
398 BUG();
399 }
400
401 if (src_idx < 4)
402 return hw_desc.aau->src[src_idx];
403 else
404 return hw_desc.aau->src_edc[__desc_idx(src_idx)].src_addr;
405}
406
407static inline void iop3xx_aau_desc_set_src_addr(struct iop3xx_desc_aau *hw_desc,
408 int src_idx, dma_addr_t addr)
409{
410 if (src_idx < 4)
411 hw_desc->src[src_idx] = addr;
412 else
413 hw_desc->src_edc[__desc_idx(src_idx)].src_addr = addr;
414}
415
416static inline void
417iop_desc_init_memcpy(struct iop_adma_desc_slot *desc, int int_en)
418{
419 struct iop3xx_desc_dma *hw_desc = desc->hw_desc;
420 union {
421 u32 value;
422 struct iop3xx_dma_desc_ctrl field;
423 } u_desc_ctrl;
424
425 u_desc_ctrl.value = 0;
426 u_desc_ctrl.field.mem_to_mem_en = 1;
427 u_desc_ctrl.field.pci_transaction = 0xe; /* memory read block */
428 u_desc_ctrl.field.int_en = int_en;
429 hw_desc->desc_ctrl = u_desc_ctrl.value;
430 hw_desc->upper_pci_src_addr = 0;
431 hw_desc->crc_addr = 0;
432}
433
434static inline void
435iop_desc_init_memset(struct iop_adma_desc_slot *desc, int int_en)
436{
437 struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
438 union {
439 u32 value;
440 struct iop3xx_aau_desc_ctrl field;
441 } u_desc_ctrl;
442
443 u_desc_ctrl.value = 0;
444 u_desc_ctrl.field.blk1_cmd_ctrl = 0x2; /* memory block fill */
445 u_desc_ctrl.field.dest_write_en = 1;
446 u_desc_ctrl.field.int_en = int_en;
447 hw_desc->desc_ctrl = u_desc_ctrl.value;
448}
449
450static inline u32
451iop3xx_desc_init_xor(struct iop3xx_desc_aau *hw_desc, int src_cnt, int int_en)
452{
453 int i, shift;
454 u32 edcr;
455 union {
456 u32 value;
457 struct iop3xx_aau_desc_ctrl field;
458 } u_desc_ctrl;
459
460 u_desc_ctrl.value = 0;
461 switch (src_cnt) {
462 case 25 ... 32:
463 u_desc_ctrl.field.blk_ctrl = 0x3; /* use EDCR[2:0] */
464 edcr = 0;
465 shift = 1;
466 for (i = 24; i < src_cnt; i++) {
467 edcr |= (1 << shift);
468 shift += 3;
469 }
470 hw_desc->src_edc[AAU_EDCR2_IDX].e_desc_ctrl = edcr;
471 src_cnt = 24;
472 /* fall through */
473 case 17 ... 24:
474 if (!u_desc_ctrl.field.blk_ctrl) {
475 hw_desc->src_edc[AAU_EDCR2_IDX].e_desc_ctrl = 0;
476 u_desc_ctrl.field.blk_ctrl = 0x3; /* use EDCR[2:0] */
477 }
478 edcr = 0;
479 shift = 1;
480 for (i = 16; i < src_cnt; i++) {
481 edcr |= (1 << shift);
482 shift += 3;
483 }
484 hw_desc->src_edc[AAU_EDCR1_IDX].e_desc_ctrl = edcr;
485 src_cnt = 16;
486 /* fall through */
487 case 9 ... 16:
488 if (!u_desc_ctrl.field.blk_ctrl)
489 u_desc_ctrl.field.blk_ctrl = 0x2; /* use EDCR0 */
490 edcr = 0;
491 shift = 1;
492 for (i = 8; i < src_cnt; i++) {
493 edcr |= (1 << shift);
494 shift += 3;
495 }
496 hw_desc->src_edc[AAU_EDCR0_IDX].e_desc_ctrl = edcr;
497 src_cnt = 8;
498 /* fall through */
499 case 2 ... 8:
500 shift = 1;
501 for (i = 0; i < src_cnt; i++) {
502 u_desc_ctrl.value |= (1 << shift);
503 shift += 3;
504 }
505
506 if (!u_desc_ctrl.field.blk_ctrl && src_cnt > 4)
507 u_desc_ctrl.field.blk_ctrl = 0x1; /* use mini-desc */
508 }
509
510 u_desc_ctrl.field.dest_write_en = 1;
511 u_desc_ctrl.field.blk1_cmd_ctrl = 0x7; /* direct fill */
512 u_desc_ctrl.field.int_en = int_en;
513 hw_desc->desc_ctrl = u_desc_ctrl.value;
514
515 return u_desc_ctrl.value;
516}
517
518static inline void
519iop_desc_init_xor(struct iop_adma_desc_slot *desc, int src_cnt, int int_en)
520{
521 iop3xx_desc_init_xor(desc->hw_desc, src_cnt, int_en);
522}
523
524/* return the number of operations */
525static inline int
526iop_desc_init_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt, int int_en)
527{
528 int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
529 struct iop3xx_desc_aau *hw_desc, *prev_hw_desc, *iter;
530 union {
531 u32 value;
532 struct iop3xx_aau_desc_ctrl field;
533 } u_desc_ctrl;
534 int i, j;
535
536 hw_desc = desc->hw_desc;
537
538 for (i = 0, j = 0; (slot_cnt -= slots_per_op) >= 0;
539 i += slots_per_op, j++) {
540 iter = iop_hw_desc_slot_idx(hw_desc, i);
541 u_desc_ctrl.value = iop3xx_desc_init_xor(iter, src_cnt, int_en);
542 u_desc_ctrl.field.dest_write_en = 0;
543 u_desc_ctrl.field.zero_result_en = 1;
544 u_desc_ctrl.field.int_en = int_en;
545 iter->desc_ctrl = u_desc_ctrl.value;
546
547 /* for the subsequent descriptors preserve the store queue
548 * and chain them together
549 */
550 if (i) {
551 prev_hw_desc =
552 iop_hw_desc_slot_idx(hw_desc, i - slots_per_op);
553 prev_hw_desc->next_desc =
554 (u32) (desc->async_tx.phys + (i << 5));
555 }
556 }
557
558 return j;
559}
560
561static inline void
562iop_desc_init_null_xor(struct iop_adma_desc_slot *desc, int src_cnt, int int_en)
563{
564 struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
565 union {
566 u32 value;
567 struct iop3xx_aau_desc_ctrl field;
568 } u_desc_ctrl;
569
570 u_desc_ctrl.value = 0;
571 switch (src_cnt) {
572 case 25 ... 32:
573 u_desc_ctrl.field.blk_ctrl = 0x3; /* use EDCR[2:0] */
574 hw_desc->src_edc[AAU_EDCR2_IDX].e_desc_ctrl = 0;
575 /* fall through */
576 case 17 ... 24:
577 if (!u_desc_ctrl.field.blk_ctrl) {
578 hw_desc->src_edc[AAU_EDCR2_IDX].e_desc_ctrl = 0;
579 u_desc_ctrl.field.blk_ctrl = 0x3; /* use EDCR[2:0] */
580 }
581 hw_desc->src_edc[AAU_EDCR1_IDX].e_desc_ctrl = 0;
582 /* fall through */
583 case 9 ... 16:
584 if (!u_desc_ctrl.field.blk_ctrl)
585 u_desc_ctrl.field.blk_ctrl = 0x2; /* use EDCR0 */
586 hw_desc->src_edc[AAU_EDCR0_IDX].e_desc_ctrl = 0;
587 /* fall through */
588 case 1 ... 8:
589 if (!u_desc_ctrl.field.blk_ctrl && src_cnt > 4)
590 u_desc_ctrl.field.blk_ctrl = 0x1; /* use mini-desc */
591 }
592
593 u_desc_ctrl.field.dest_write_en = 0;
594 u_desc_ctrl.field.int_en = int_en;
595 hw_desc->desc_ctrl = u_desc_ctrl.value;
596}
597
598static inline void iop_desc_set_byte_count(struct iop_adma_desc_slot *desc,
599 struct iop_adma_chan *chan,
600 u32 byte_count)
601{
602 union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
603
604 switch (chan->device->id) {
605 case DMA0_ID:
606 case DMA1_ID:
607 hw_desc.dma->byte_count = byte_count;
608 break;
609 case AAU_ID:
610 hw_desc.aau->byte_count = byte_count;
611 break;
612 default:
613 BUG();
614 }
615}
616
617static inline void
618iop_desc_init_interrupt(struct iop_adma_desc_slot *desc,
619 struct iop_adma_chan *chan)
620{
621 union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
622
623 switch (chan->device->id) {
624 case DMA0_ID:
625 case DMA1_ID:
626 iop_desc_init_memcpy(desc, 1);
627 hw_desc.dma->byte_count = 0;
628 hw_desc.dma->dest_addr = 0;
629 hw_desc.dma->src_addr = 0;
630 break;
631 case AAU_ID:
632 iop_desc_init_null_xor(desc, 2, 1);
633 hw_desc.aau->byte_count = 0;
634 hw_desc.aau->dest_addr = 0;
635 hw_desc.aau->src[0] = 0;
636 hw_desc.aau->src[1] = 0;
637 break;
638 default:
639 BUG();
640 }
641}
642
643static inline void
644iop_desc_set_zero_sum_byte_count(struct iop_adma_desc_slot *desc, u32 len)
645{
646 int slots_per_op = desc->slots_per_op;
647 struct iop3xx_desc_aau *hw_desc = desc->hw_desc, *iter;
648 int i = 0;
649
650 if (len <= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT) {
651 hw_desc->byte_count = len;
652 } else {
653 do {
654 iter = iop_hw_desc_slot_idx(hw_desc, i);
655 iter->byte_count = IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
656 len -= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
657 i += slots_per_op;
658 } while (len > IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT);
659
660 if (len) {
661 iter = iop_hw_desc_slot_idx(hw_desc, i);
662 iter->byte_count = len;
663 }
664 }
665}
666
667static inline void iop_desc_set_dest_addr(struct iop_adma_desc_slot *desc,
668 struct iop_adma_chan *chan,
669 dma_addr_t addr)
670{
671 union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
672
673 switch (chan->device->id) {
674 case DMA0_ID:
675 case DMA1_ID:
676 hw_desc.dma->dest_addr = addr;
677 break;
678 case AAU_ID:
679 hw_desc.aau->dest_addr = addr;
680 break;
681 default:
682 BUG();
683 }
684}
685
686static inline void iop_desc_set_memcpy_src_addr(struct iop_adma_desc_slot *desc,
687 dma_addr_t addr)
688{
689 struct iop3xx_desc_dma *hw_desc = desc->hw_desc;
690 hw_desc->src_addr = addr;
691}
692
693static inline void
694iop_desc_set_zero_sum_src_addr(struct iop_adma_desc_slot *desc, int src_idx,
695 dma_addr_t addr)
696{
697
698 struct iop3xx_desc_aau *hw_desc = desc->hw_desc, *iter;
699 int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
700 int i;
701
702 for (i = 0; (slot_cnt -= slots_per_op) >= 0;
703 i += slots_per_op, addr += IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT) {
704 iter = iop_hw_desc_slot_idx(hw_desc, i);
705 iop3xx_aau_desc_set_src_addr(iter, src_idx, addr);
706 }
707}
708
709static inline void iop_desc_set_xor_src_addr(struct iop_adma_desc_slot *desc,
710 int src_idx, dma_addr_t addr)
711{
712
713 struct iop3xx_desc_aau *hw_desc = desc->hw_desc, *iter;
714 int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
715 int i;
716
717 for (i = 0; (slot_cnt -= slots_per_op) >= 0;
718 i += slots_per_op, addr += IOP_ADMA_XOR_MAX_BYTE_COUNT) {
719 iter = iop_hw_desc_slot_idx(hw_desc, i);
720 iop3xx_aau_desc_set_src_addr(iter, src_idx, addr);
721 }
722}
723
724static inline void iop_desc_set_next_desc(struct iop_adma_desc_slot *desc,
725 u32 next_desc_addr)
726{
727 /* hw_desc->next_desc is the same location for all channels */
728 union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
729 BUG_ON(hw_desc.dma->next_desc);
730 hw_desc.dma->next_desc = next_desc_addr;
731}
732
733static inline u32 iop_desc_get_next_desc(struct iop_adma_desc_slot *desc)
734{
735 /* hw_desc->next_desc is the same location for all channels */
736 union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
737 return hw_desc.dma->next_desc;
738}
739
740static inline void iop_desc_clear_next_desc(struct iop_adma_desc_slot *desc)
741{
742 /* hw_desc->next_desc is the same location for all channels */
743 union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
744 hw_desc.dma->next_desc = 0;
745}
746
747static inline void iop_desc_set_block_fill_val(struct iop_adma_desc_slot *desc,
748 u32 val)
749{
750 struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
751 hw_desc->src[0] = val;
752}
753
754static inline int iop_desc_get_zero_result(struct iop_adma_desc_slot *desc)
755{
756 struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
757 struct iop3xx_aau_desc_ctrl desc_ctrl = hw_desc->desc_ctrl_field;
758
759 BUG_ON(!(desc_ctrl.tx_complete && desc_ctrl.zero_result_en));
760 return desc_ctrl.zero_result_err;
761}
762
763static inline void iop_chan_append(struct iop_adma_chan *chan)
764{
765 u32 dma_chan_ctrl;
766 /* workaround dropped interrupts on 3xx */
767 mod_timer(&chan->cleanup_watchdog, jiffies + msecs_to_jiffies(3));
768
769 dma_chan_ctrl = __raw_readl(DMA_CCR(chan));
770 dma_chan_ctrl |= 0x2;
771 __raw_writel(dma_chan_ctrl, DMA_CCR(chan));
772}
773
774static inline void iop_chan_idle(int busy, struct iop_adma_chan *chan)
775{
776 if (!busy)
777 del_timer(&chan->cleanup_watchdog);
778}
779
780static inline u32 iop_chan_get_status(struct iop_adma_chan *chan)
781{
782 return __raw_readl(DMA_CSR(chan));
783}
784
785static inline void iop_chan_disable(struct iop_adma_chan *chan)
786{
787 u32 dma_chan_ctrl = __raw_readl(DMA_CCR(chan));
788 dma_chan_ctrl &= ~1;
789 __raw_writel(dma_chan_ctrl, DMA_CCR(chan));
790}
791
792static inline void iop_chan_enable(struct iop_adma_chan *chan)
793{
794 u32 dma_chan_ctrl = __raw_readl(DMA_CCR(chan));
795
796 dma_chan_ctrl |= 1;
797 __raw_writel(dma_chan_ctrl, DMA_CCR(chan));
798}
799
800static inline void iop_adma_device_clear_eot_status(struct iop_adma_chan *chan)
801{
802 u32 status = __raw_readl(DMA_CSR(chan));
803 status &= (1 << 9);
804 __raw_writel(status, DMA_CSR(chan));
805}
806
807static inline void iop_adma_device_clear_eoc_status(struct iop_adma_chan *chan)
808{
809 u32 status = __raw_readl(DMA_CSR(chan));
810 status &= (1 << 8);
811 __raw_writel(status, DMA_CSR(chan));
812}
813
814static inline void iop_adma_device_clear_err_status(struct iop_adma_chan *chan)
815{
816 u32 status = __raw_readl(DMA_CSR(chan));
817
818 switch (chan->device->id) {
819 case DMA0_ID:
820 case DMA1_ID:
821 status &= (1 << 5) | (1 << 3) | (1 << 2) | (1 << 1);
822 break;
823 case AAU_ID:
824 status &= (1 << 5);
825 break;
826 default:
827 BUG();
828 }
829
830 __raw_writel(status, DMA_CSR(chan));
831}
832
833static inline int
834iop_is_err_int_parity(unsigned long status, struct iop_adma_chan *chan)
835{
836 return 0;
837}
838
839static inline int
840iop_is_err_mcu_abort(unsigned long status, struct iop_adma_chan *chan)
841{
842 return 0;
843}
844
845static inline int
846iop_is_err_int_tabort(unsigned long status, struct iop_adma_chan *chan)
847{
848 return 0;
849}
850
851static inline int
852iop_is_err_int_mabort(unsigned long status, struct iop_adma_chan *chan)
853{
854 return test_bit(5, &status);
855}
856
857static inline int
858iop_is_err_pci_tabort(unsigned long status, struct iop_adma_chan *chan)
859{
860 switch (chan->device->id) {
861 case DMA0_ID:
862 case DMA1_ID:
863 return test_bit(2, &status);
864 default:
865 return 0;
866 }
867}
868
869static inline int
870iop_is_err_pci_mabort(unsigned long status, struct iop_adma_chan *chan)
871{
872 switch (chan->device->id) {
873 case DMA0_ID:
874 case DMA1_ID:
875 return test_bit(3, &status);
876 default:
877 return 0;
878 }
879}
880
881static inline int
882iop_is_err_split_tx(unsigned long status, struct iop_adma_chan *chan)
883{
884 switch (chan->device->id) {
885 case DMA0_ID:
886 case DMA1_ID:
887 return test_bit(1, &status);
888 default:
889 return 0;
890 }
891}
892#endif /* _ADMA_H */
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h
index 63feceb7ede5..81ca5d3e2bff 100644
--- a/include/asm-arm/hardware/iop3xx.h
+++ b/include/asm-arm/hardware/iop3xx.h
@@ -144,24 +144,9 @@ extern int init_atu;
144#define IOP3XX_IAR (volatile u32 *)IOP3XX_REG_ADDR(0x0380) 144#define IOP3XX_IAR (volatile u32 *)IOP3XX_REG_ADDR(0x0380)
145 145
146/* DMA Controller */ 146/* DMA Controller */
147#define IOP3XX_DMA0_CCR (volatile u32 *)IOP3XX_REG_ADDR(0x0400) 147#define IOP3XX_DMA_PHYS_BASE(chan) (IOP3XX_PERIPHERAL_PHYS_BASE + \
148#define IOP3XX_DMA0_CSR (volatile u32 *)IOP3XX_REG_ADDR(0x0404) 148 (0x400 + (chan << 6)))
149#define IOP3XX_DMA0_DAR (volatile u32 *)IOP3XX_REG_ADDR(0x040c) 149#define IOP3XX_DMA_UPPER_PA(chan) (IOP3XX_DMA_PHYS_BASE(chan) + 0x27)
150#define IOP3XX_DMA0_NDAR (volatile u32 *)IOP3XX_REG_ADDR(0x0410)
151#define IOP3XX_DMA0_PADR (volatile u32 *)IOP3XX_REG_ADDR(0x0414)
152#define IOP3XX_DMA0_PUADR (volatile u32 *)IOP3XX_REG_ADDR(0x0418)
153#define IOP3XX_DMA0_LADR (volatile u32 *)IOP3XX_REG_ADDR(0x041c)
154#define IOP3XX_DMA0_BCR (volatile u32 *)IOP3XX_REG_ADDR(0x0420)
155#define IOP3XX_DMA0_DCR (volatile u32 *)IOP3XX_REG_ADDR(0x0424)
156#define IOP3XX_DMA1_CCR (volatile u32 *)IOP3XX_REG_ADDR(0x0440)
157#define IOP3XX_DMA1_CSR (volatile u32 *)IOP3XX_REG_ADDR(0x0444)
158#define IOP3XX_DMA1_DAR (volatile u32 *)IOP3XX_REG_ADDR(0x044c)
159#define IOP3XX_DMA1_NDAR (volatile u32 *)IOP3XX_REG_ADDR(0x0450)
160#define IOP3XX_DMA1_PADR (volatile u32 *)IOP3XX_REG_ADDR(0x0454)
161#define IOP3XX_DMA1_PUADR (volatile u32 *)IOP3XX_REG_ADDR(0x0458)
162#define IOP3XX_DMA1_LADR (volatile u32 *)IOP3XX_REG_ADDR(0x045c)
163#define IOP3XX_DMA1_BCR (volatile u32 *)IOP3XX_REG_ADDR(0x0460)
164#define IOP3XX_DMA1_DCR (volatile u32 *)IOP3XX_REG_ADDR(0x0464)
165 150
166/* Peripheral bus interface */ 151/* Peripheral bus interface */
167#define IOP3XX_PBCR (volatile u32 *)IOP3XX_REG_ADDR(0x0680) 152#define IOP3XX_PBCR (volatile u32 *)IOP3XX_REG_ADDR(0x0680)
@@ -210,48 +195,8 @@ extern int init_atu;
210#define IOP_TMR_RATIO_1_1 0x00 195#define IOP_TMR_RATIO_1_1 0x00
211 196
212/* Application accelerator unit */ 197/* Application accelerator unit */
213#define IOP3XX_AAU_ACR (volatile u32 *)IOP3XX_REG_ADDR(0x0800) 198#define IOP3XX_AAU_PHYS_BASE (IOP3XX_PERIPHERAL_PHYS_BASE + 0x800)
214#define IOP3XX_AAU_ASR (volatile u32 *)IOP3XX_REG_ADDR(0x0804) 199#define IOP3XX_AAU_UPPER_PA (IOP3XX_AAU_PHYS_BASE + 0xa7)
215#define IOP3XX_AAU_ADAR (volatile u32 *)IOP3XX_REG_ADDR(0x0808)
216#define IOP3XX_AAU_ANDAR (volatile u32 *)IOP3XX_REG_ADDR(0x080c)
217#define IOP3XX_AAU_SAR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0810)
218#define IOP3XX_AAU_SAR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0814)
219#define IOP3XX_AAU_SAR3 (volatile u32 *)IOP3XX_REG_ADDR(0x0818)
220#define IOP3XX_AAU_SAR4 (volatile u32 *)IOP3XX_REG_ADDR(0x081c)
221#define IOP3XX_AAU_DAR (volatile u32 *)IOP3XX_REG_ADDR(0x0820)
222#define IOP3XX_AAU_ABCR (volatile u32 *)IOP3XX_REG_ADDR(0x0824)
223#define IOP3XX_AAU_ADCR (volatile u32 *)IOP3XX_REG_ADDR(0x0828)
224#define IOP3XX_AAU_SAR5 (volatile u32 *)IOP3XX_REG_ADDR(0x082c)
225#define IOP3XX_AAU_SAR6 (volatile u32 *)IOP3XX_REG_ADDR(0x0830)
226#define IOP3XX_AAU_SAR7 (volatile u32 *)IOP3XX_REG_ADDR(0x0834)
227#define IOP3XX_AAU_SAR8 (volatile u32 *)IOP3XX_REG_ADDR(0x0838)
228#define IOP3XX_AAU_EDCR0 (volatile u32 *)IOP3XX_REG_ADDR(0x083c)
229#define IOP3XX_AAU_SAR9 (volatile u32 *)IOP3XX_REG_ADDR(0x0840)
230#define IOP3XX_AAU_SAR10 (volatile u32 *)IOP3XX_REG_ADDR(0x0844)
231#define IOP3XX_AAU_SAR11 (volatile u32 *)IOP3XX_REG_ADDR(0x0848)
232#define IOP3XX_AAU_SAR12 (volatile u32 *)IOP3XX_REG_ADDR(0x084c)
233#define IOP3XX_AAU_SAR13 (volatile u32 *)IOP3XX_REG_ADDR(0x0850)
234#define IOP3XX_AAU_SAR14 (volatile u32 *)IOP3XX_REG_ADDR(0x0854)
235#define IOP3XX_AAU_SAR15 (volatile u32 *)IOP3XX_REG_ADDR(0x0858)
236#define IOP3XX_AAU_SAR16 (volatile u32 *)IOP3XX_REG_ADDR(0x085c)
237#define IOP3XX_AAU_EDCR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0860)
238#define IOP3XX_AAU_SAR17 (volatile u32 *)IOP3XX_REG_ADDR(0x0864)
239#define IOP3XX_AAU_SAR18 (volatile u32 *)IOP3XX_REG_ADDR(0x0868)
240#define IOP3XX_AAU_SAR19 (volatile u32 *)IOP3XX_REG_ADDR(0x086c)
241#define IOP3XX_AAU_SAR20 (volatile u32 *)IOP3XX_REG_ADDR(0x0870)
242#define IOP3XX_AAU_SAR21 (volatile u32 *)IOP3XX_REG_ADDR(0x0874)
243#define IOP3XX_AAU_SAR22 (volatile u32 *)IOP3XX_REG_ADDR(0x0878)
244#define IOP3XX_AAU_SAR23 (volatile u32 *)IOP3XX_REG_ADDR(0x087c)
245#define IOP3XX_AAU_SAR24 (volatile u32 *)IOP3XX_REG_ADDR(0x0880)
246#define IOP3XX_AAU_EDCR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0884)
247#define IOP3XX_AAU_SAR25 (volatile u32 *)IOP3XX_REG_ADDR(0x0888)
248#define IOP3XX_AAU_SAR26 (volatile u32 *)IOP3XX_REG_ADDR(0x088c)
249#define IOP3XX_AAU_SAR27 (volatile u32 *)IOP3XX_REG_ADDR(0x0890)
250#define IOP3XX_AAU_SAR28 (volatile u32 *)IOP3XX_REG_ADDR(0x0894)
251#define IOP3XX_AAU_SAR29 (volatile u32 *)IOP3XX_REG_ADDR(0x0898)
252#define IOP3XX_AAU_SAR30 (volatile u32 *)IOP3XX_REG_ADDR(0x089c)
253#define IOP3XX_AAU_SAR31 (volatile u32 *)IOP3XX_REG_ADDR(0x08a0)
254#define IOP3XX_AAU_SAR32 (volatile u32 *)IOP3XX_REG_ADDR(0x08a4)
255 200
256/* I2C bus interface unit */ 201/* I2C bus interface unit */
257#define IOP3XX_ICR0 (volatile u32 *)IOP3XX_REG_ADDR(0x1680) 202#define IOP3XX_ICR0 (volatile u32 *)IOP3XX_REG_ADDR(0x1680)
@@ -329,6 +274,9 @@ static inline void write_tisr(u32 val)
329 asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (val)); 274 asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (val));
330} 275}
331 276
277extern struct platform_device iop3xx_dma_0_channel;
278extern struct platform_device iop3xx_dma_1_channel;
279extern struct platform_device iop3xx_aau_channel;
332extern struct platform_device iop3xx_i2c0_device; 280extern struct platform_device iop3xx_i2c0_device;
333extern struct platform_device iop3xx_i2c1_device; 281extern struct platform_device iop3xx_i2c1_device;
334 282
diff --git a/include/asm-arm/hardware/iop_adma.h b/include/asm-arm/hardware/iop_adma.h
new file mode 100644
index 000000000000..ca8e71f44346
--- /dev/null
+++ b/include/asm-arm/hardware/iop_adma.h
@@ -0,0 +1,118 @@
1/*
2 * Copyright © 2006, Intel Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as 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 for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16 *
17 */
18#ifndef IOP_ADMA_H
19#define IOP_ADMA_H
20#include <linux/types.h>
21#include <linux/dmaengine.h>
22#include <linux/interrupt.h>
23
24#define IOP_ADMA_SLOT_SIZE 32
25#define IOP_ADMA_THRESHOLD 4
26
27/**
28 * struct iop_adma_device - internal representation of an ADMA device
29 * @pdev: Platform device
30 * @id: HW ADMA Device selector
31 * @dma_desc_pool: base of DMA descriptor region (DMA address)
32 * @dma_desc_pool_virt: base of DMA descriptor region (CPU address)
33 * @common: embedded struct dma_device
34 */
35struct iop_adma_device {
36 struct platform_device *pdev;
37 int id;
38 dma_addr_t dma_desc_pool;
39 void *dma_desc_pool_virt;
40 struct dma_device common;
41};
42
43/**
44 * struct iop_adma_chan - internal representation of an ADMA device
45 * @pending: allows batching of hardware operations
46 * @completed_cookie: identifier for the most recently completed operation
47 * @lock: serializes enqueue/dequeue operations to the slot pool
48 * @mmr_base: memory mapped register base
49 * @chain: device chain view of the descriptors
50 * @device: parent device
51 * @common: common dmaengine channel object members
52 * @last_used: place holder for allocation to continue from where it left off
53 * @all_slots: complete domain of slots usable by the channel
54 * @cleanup_watchdog: workaround missed interrupts on iop3xx
55 * @slots_allocated: records the actual size of the descriptor slot pool
56 * @irq_tasklet: bottom half where iop_adma_slot_cleanup runs
57 */
58struct iop_adma_chan {
59 int pending;
60 dma_cookie_t completed_cookie;
61 spinlock_t lock; /* protects the descriptor slot pool */
62 void __iomem *mmr_base;
63 struct list_head chain;
64 struct iop_adma_device *device;
65 struct dma_chan common;
66 struct iop_adma_desc_slot *last_used;
67 struct list_head all_slots;
68 struct timer_list cleanup_watchdog;
69 int slots_allocated;
70 struct tasklet_struct irq_tasklet;
71};
72
73/**
74 * struct iop_adma_desc_slot - IOP-ADMA software descriptor
75 * @slot_node: node on the iop_adma_chan.all_slots list
76 * @chain_node: node on the op_adma_chan.chain list
77 * @hw_desc: virtual address of the hardware descriptor chain
78 * @phys: hardware address of the hardware descriptor chain
79 * @group_head: first operation in a transaction
80 * @slot_cnt: total slots used in an transaction (group of operations)
81 * @slots_per_op: number of slots per operation
82 * @idx: pool index
83 * @unmap_src_cnt: number of xor sources
84 * @unmap_len: transaction bytecount
85 * @async_tx: support for the async_tx api
86 * @group_list: list of slots that make up a multi-descriptor transaction
87 * for example transfer lengths larger than the supported hw max
88 * @xor_check_result: result of zero sum
89 * @crc32_result: result crc calculation
90 */
91struct iop_adma_desc_slot {
92 struct list_head slot_node;
93 struct list_head chain_node;
94 void *hw_desc;
95 struct iop_adma_desc_slot *group_head;
96 u16 slot_cnt;
97 u16 slots_per_op;
98 u16 idx;
99 u16 unmap_src_cnt;
100 size_t unmap_len;
101 struct dma_async_tx_descriptor async_tx;
102 union {
103 u32 *xor_check_result;
104 u32 *crc32_result;
105 };
106};
107
108struct iop_adma_platform_data {
109 int hw_id;
110 dma_cap_mask_t cap_mask;
111 size_t pool_size;
112};
113
114#define to_iop_sw_desc(addr_hw_desc) \
115 container_of(addr_hw_desc, struct iop_adma_desc_slot, hw_desc)
116#define iop_hw_desc_slot_idx(hw_desc, idx) \
117 ( (void *) (((unsigned long) hw_desc) + ((idx) << 5)) )
118#endif
diff --git a/include/asm-arm/hwcap.h b/include/asm-arm/hwcap.h
new file mode 100644
index 000000000000..01a1391d3014
--- /dev/null
+++ b/include/asm-arm/hwcap.h
@@ -0,0 +1,28 @@
1#ifndef __ASMARM_HWCAP_H
2#define __ASMARM_HWCAP_H
3
4/*
5 * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
6 */
7#define HWCAP_SWP 1
8#define HWCAP_HALF 2
9#define HWCAP_THUMB 4
10#define HWCAP_26BIT 8 /* Play it safe */
11#define HWCAP_FAST_MULT 16
12#define HWCAP_FPA 32
13#define HWCAP_VFP 64
14#define HWCAP_EDSP 128
15#define HWCAP_JAVA 256
16#define HWCAP_IWMMXT 512
17#define HWCAP_CRUNCH 1024
18
19#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
20/*
21 * This yields a mask that user programs can use to figure out what
22 * instruction set this cpu supports.
23 */
24#define ELF_HWCAP (elf_hwcap)
25extern unsigned int elf_hwcap;
26#endif
27
28#endif
diff --git a/include/asm-arm/linkage.h b/include/asm-arm/linkage.h
index dbe4b4e31a5b..5a25632b1bc0 100644
--- a/include/asm-arm/linkage.h
+++ b/include/asm-arm/linkage.h
@@ -4,4 +4,8 @@
4#define __ALIGN .align 0 4#define __ALIGN .align 0
5#define __ALIGN_STR ".align 0" 5#define __ALIGN_STR ".align 0"
6 6
7#define ENDPROC(name) \
8 .type name, %function; \
9 END(name)
10
7#endif 11#endif
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
index f21abd4ddac6..ed3f898191f4 100644
--- a/include/asm-arm/pci.h
+++ b/include/asm-arm/pci.h
@@ -26,11 +26,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
26#define PCI_DMA_BUS_IS_PHYS (0) 26#define PCI_DMA_BUS_IS_PHYS (0)
27 27
28/* 28/*
29 * We don't support DAC DMA cycles.
30 */
31#define pci_dac_dma_supported(pci_dev, mask) (0)
32
33/*
34 * Whether pci_unmap_{single,page} is a nop depends upon the 29 * Whether pci_unmap_{single,page} is a nop depends upon the
35 * configuration. 30 * configuration.
36 */ 31 */
@@ -76,10 +71,6 @@ pcibios_select_root(struct pci_dev *pdev, struct resource *res)
76 return root; 71 return root;
77} 72}
78 73
79static inline void pcibios_add_platform_entries(struct pci_dev *dev)
80{
81}
82
83#endif /* __KERNEL__ */ 74#endif /* __KERNEL__ */
84 75
85#endif 76#endif
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index 21dec9f258d8..d2e8171d1d4e 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -83,14 +83,14 @@
83 * means that a write to a clean page will cause a permission fault, and 83 * means that a write to a clean page will cause a permission fault, and
84 * the Linux MM layer will mark the page dirty via handle_pte_fault(). 84 * the Linux MM layer will mark the page dirty via handle_pte_fault().
85 * For the hardware to notice the permission change, the TLB entry must 85 * For the hardware to notice the permission change, the TLB entry must
86 * be flushed, and ptep_establish() does that for us. 86 * be flushed, and ptep_set_access_flags() does that for us.
87 * 87 *
88 * The "accessed" or "young" bit is emulated by a similar method; we only 88 * The "accessed" or "young" bit is emulated by a similar method; we only
89 * allow accesses to the page if the "young" bit is set. Accesses to the 89 * allow accesses to the page if the "young" bit is set. Accesses to the
90 * page will cause a fault, and handle_pte_fault() will set the young bit 90 * page will cause a fault, and handle_pte_fault() will set the young bit
91 * for us as long as the page is marked present in the corresponding Linux 91 * for us as long as the page is marked present in the corresponding Linux
92 * PTE entry. Again, ptep_establish() will ensure that the TLB is up to 92 * PTE entry. Again, ptep_set_access_flags() will ensure that the TLB is
93 * date. 93 * up to date.
94 * 94 *
95 * However, when the "young" bit is cleared, we deny access to the page 95 * However, when the "young" bit is cleared, we deny access to the page
96 * by clearing the hardware PTE. Currently Linux does not flush the TLB 96 * by clearing the hardware PTE. Currently Linux does not flush the TLB
@@ -257,9 +257,7 @@ extern struct page *empty_zero_page;
257 * Undefined behaviour if not.. 257 * Undefined behaviour if not..
258 */ 258 */
259#define pte_present(pte) (pte_val(pte) & L_PTE_PRESENT) 259#define pte_present(pte) (pte_val(pte) & L_PTE_PRESENT)
260#define pte_read(pte) (pte_val(pte) & L_PTE_USER)
261#define pte_write(pte) (pte_val(pte) & L_PTE_WRITE) 260#define pte_write(pte) (pte_val(pte) & L_PTE_WRITE)
262#define pte_exec(pte) (pte_val(pte) & L_PTE_EXEC)
263#define pte_dirty(pte) (pte_val(pte) & L_PTE_DIRTY) 261#define pte_dirty(pte) (pte_val(pte) & L_PTE_DIRTY)
264#define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG) 262#define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG)
265 263
@@ -275,12 +273,8 @@ extern struct page *empty_zero_page;
275#define PTE_BIT_FUNC(fn,op) \ 273#define PTE_BIT_FUNC(fn,op) \
276static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } 274static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
277 275
278/*PTE_BIT_FUNC(rdprotect, &= ~L_PTE_USER);*/
279/*PTE_BIT_FUNC(mkread, |= L_PTE_USER);*/
280PTE_BIT_FUNC(wrprotect, &= ~L_PTE_WRITE); 276PTE_BIT_FUNC(wrprotect, &= ~L_PTE_WRITE);
281PTE_BIT_FUNC(mkwrite, |= L_PTE_WRITE); 277PTE_BIT_FUNC(mkwrite, |= L_PTE_WRITE);
282PTE_BIT_FUNC(exprotect, &= ~L_PTE_EXEC);
283PTE_BIT_FUNC(mkexec, |= L_PTE_EXEC);
284PTE_BIT_FUNC(mkclean, &= ~L_PTE_DIRTY); 278PTE_BIT_FUNC(mkclean, &= ~L_PTE_DIRTY);
285PTE_BIT_FUNC(mkdirty, |= L_PTE_DIRTY); 279PTE_BIT_FUNC(mkdirty, |= L_PTE_DIRTY);
286PTE_BIT_FUNC(mkold, &= ~L_PTE_YOUNG); 280PTE_BIT_FUNC(mkold, &= ~L_PTE_YOUNG);
diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
index 2d0dad8c10ac..7aaa206cb54e 100644
--- a/include/asm-arm/ptrace.h
+++ b/include/asm-arm/ptrace.h
@@ -10,6 +10,8 @@
10#ifndef __ASM_ARM_PTRACE_H 10#ifndef __ASM_ARM_PTRACE_H
11#define __ASM_ARM_PTRACE_H 11#define __ASM_ARM_PTRACE_H
12 12
13#include <asm/hwcap.h>
14
13#define PTRACE_GETREGS 12 15#define PTRACE_GETREGS 12
14#define PTRACE_SETREGS 13 16#define PTRACE_SETREGS 13
15#define PTRACE_GETFPREGS 14 17#define PTRACE_GETFPREGS 14
@@ -45,6 +47,7 @@
45#define PSR_T_BIT 0x00000020 47#define PSR_T_BIT 0x00000020
46#define PSR_F_BIT 0x00000040 48#define PSR_F_BIT 0x00000040
47#define PSR_I_BIT 0x00000080 49#define PSR_I_BIT 0x00000080
50#define PSR_A_BIT 0x00000100
48#define PSR_J_BIT 0x01000000 51#define PSR_J_BIT 0x01000000
49#define PSR_Q_BIT 0x08000000 52#define PSR_Q_BIT 0x08000000
50#define PSR_V_BIT 0x10000000 53#define PSR_V_BIT 0x10000000
@@ -103,6 +106,10 @@ struct pt_regs {
103#define thumb_mode(regs) (0) 106#define thumb_mode(regs) (0)
104#endif 107#endif
105 108
109#define isa_mode(regs) \
110 ((((regs)->ARM_cpsr & PSR_J_BIT) >> 23) | \
111 (((regs)->ARM_cpsr & PSR_T_BIT) >> 5))
112
106#define processor_mode(regs) \ 113#define processor_mode(regs) \
107 ((regs)->ARM_cpsr & MODE_MASK) 114 ((regs)->ARM_cpsr & MODE_MASK)
108 115
@@ -112,22 +119,22 @@ struct pt_regs {
112#define fast_interrupts_enabled(regs) \ 119#define fast_interrupts_enabled(regs) \
113 (!((regs)->ARM_cpsr & PSR_F_BIT)) 120 (!((regs)->ARM_cpsr & PSR_F_BIT))
114 121
115#define condition_codes(regs) \
116 ((regs)->ARM_cpsr & (PSR_V_BIT|PSR_C_BIT|PSR_Z_BIT|PSR_N_BIT))
117
118/* Are the current registers suitable for user mode? 122/* Are the current registers suitable for user mode?
119 * (used to maintain security in signal handlers) 123 * (used to maintain security in signal handlers)
120 */ 124 */
121static inline int valid_user_regs(struct pt_regs *regs) 125static inline int valid_user_regs(struct pt_regs *regs)
122{ 126{
123 if (user_mode(regs) && 127 if (user_mode(regs) && (regs->ARM_cpsr & PSR_I_BIT) == 0) {
124 (regs->ARM_cpsr & (PSR_F_BIT|PSR_I_BIT)) == 0) 128 regs->ARM_cpsr &= ~(PSR_F_BIT | PSR_A_BIT);
125 return 1; 129 return 1;
130 }
126 131
127 /* 132 /*
128 * Force CPSR to something logical... 133 * Force CPSR to something logical...
129 */ 134 */
130 regs->ARM_cpsr &= PSR_f | PSR_s | PSR_x | PSR_T_BIT | MODE32_BIT; 135 regs->ARM_cpsr &= PSR_f | PSR_s | (PSR_x & ~PSR_A_BIT) | PSR_T_BIT | MODE32_BIT;
136 if (!(elf_hwcap & HWCAP_26BIT))
137 regs->ARM_cpsr |= USR_MODE;
131 138
132 return 0; 139 return 0;
133} 140}
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 6f8e6a69dc5f..94ea8c6dc1a4 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -254,16 +254,6 @@ do { \
254 last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \ 254 last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \
255} while (0) 255} while (0)
256 256
257/*
258 * On SMP systems, when the scheduler does migration-cost autodetection,
259 * it needs a way to flush as much of the CPU's caches as possible.
260 *
261 * TODO: fill this in!
262 */
263static inline void sched_cacheflush(void)
264{
265}
266
267#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110) 257#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
268/* 258/*
269 * On the StrongARM, "swp" is terminally broken since it bypasses the 259 * On the StrongARM, "swp" is terminally broken since it bypasses the
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index 250d7f145aca..bfdbebebdc1b 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -367,6 +367,7 @@
367#define __NR_get_robust_list (__NR_SYSCALL_BASE+339) 367#define __NR_get_robust_list (__NR_SYSCALL_BASE+339)
368#define __NR_splice (__NR_SYSCALL_BASE+340) 368#define __NR_splice (__NR_SYSCALL_BASE+340)
369#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE+341) 369#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE+341)
370#define __NR_sync_file_range2 __NR_arm_sync_file_range
370#define __NR_tee (__NR_SYSCALL_BASE+342) 371#define __NR_tee (__NR_SYSCALL_BASE+342)
371#define __NR_vmsplice (__NR_SYSCALL_BASE+343) 372#define __NR_vmsplice (__NR_SYSCALL_BASE+343)
372#define __NR_move_pages (__NR_SYSCALL_BASE+344) 373#define __NR_move_pages (__NR_SYSCALL_BASE+344)
diff --git a/include/asm-arm26/a.out.h b/include/asm-arm26/a.out.h
index 9b2702c42c87..7167f54ae3fc 100644
--- a/include/asm-arm26/a.out.h
+++ b/include/asm-arm26/a.out.h
@@ -29,6 +29,7 @@ struct exec
29 29
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31#define STACK_TOP TASK_SIZE 31#define STACK_TOP TASK_SIZE
32#define STACK_TOP_MAX STACK_TOP
32#endif 33#endif
33 34
34#ifndef LIBRARY_START_TEXT 35#ifndef LIBRARY_START_TEXT
diff --git a/include/asm-arm26/dma-mapping.h b/include/asm-arm26/dma-mapping.h
deleted file mode 100644
index a95eae0aeb77..000000000000
--- a/include/asm-arm26/dma-mapping.h
+++ /dev/null
@@ -1,2 +0,0 @@
1#include <asm-generic/dma-mapping-broken.h>
2
diff --git a/include/asm-arm26/fb.h b/include/asm-arm26/fb.h
new file mode 100644
index 000000000000..c7df38030992
--- /dev/null
+++ b/include/asm-arm26/fb.h
@@ -0,0 +1,12 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/include/asm-arm26/ioctls.h b/include/asm-arm26/ioctls.h
index ba9c7d81d24e..8a3296200be1 100644
--- a/include/asm-arm26/ioctls.h
+++ b/include/asm-arm26/ioctls.h
@@ -47,6 +47,10 @@
47#define TIOCSBRK 0x5427 /* BSD compatibility */ 47#define TIOCSBRK 0x5427 /* BSD compatibility */
48#define TIOCCBRK 0x5428 /* BSD compatibility */ 48#define TIOCCBRK 0x5428 /* BSD compatibility */
49#define TIOCGSID 0x5429 /* Return the session ID of FD */ 49#define TIOCGSID 0x5429 /* Return the session ID of FD */
50#define TCGETS2 _IOR('T',0x2A, struct termios2)
51#define TCSETS2 _IOW('T',0x2B, struct termios2)
52#define TCSETSW2 _IOW('T',0x2C, struct termios2)
53#define TCSETSF2 _IOW('T',0x2D, struct termios2)
50#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
51#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
52 56
diff --git a/include/asm-arm26/pgtable.h b/include/asm-arm26/pgtable.h
index 2b20e9f08857..55a1a697d12b 100644
--- a/include/asm-arm26/pgtable.h
+++ b/include/asm-arm26/pgtable.h
@@ -218,9 +218,7 @@ extern struct page *empty_zero_page;
218 * The following only work if pte_present() is true. 218 * The following only work if pte_present() is true.
219 * Undefined behaviour if not.. 219 * Undefined behaviour if not..
220 */ 220 */
221#define pte_read(pte) (!(pte_val(pte) & _PAGE_NOT_USER))
222#define pte_write(pte) (!(pte_val(pte) & _PAGE_READONLY)) 221#define pte_write(pte) (!(pte_val(pte) & _PAGE_READONLY))
223#define pte_exec(pte) (!(pte_val(pte) & _PAGE_NOT_USER))
224#define pte_dirty(pte) (!(pte_val(pte) & _PAGE_CLEAN)) 222#define pte_dirty(pte) (!(pte_val(pte) & _PAGE_CLEAN))
225#define pte_young(pte) (!(pte_val(pte) & _PAGE_OLD)) 223#define pte_young(pte) (!(pte_val(pte) & _PAGE_OLD))
226//ONLY when !pte_present() I think. nicked from arm32 (FIXME!) 224//ONLY when !pte_present() I think. nicked from arm32 (FIXME!)
@@ -231,8 +229,6 @@ static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
231 229
232PTE_BIT_FUNC(wrprotect, |= _PAGE_READONLY); 230PTE_BIT_FUNC(wrprotect, |= _PAGE_READONLY);
233PTE_BIT_FUNC(mkwrite, &= ~_PAGE_READONLY); 231PTE_BIT_FUNC(mkwrite, &= ~_PAGE_READONLY);
234PTE_BIT_FUNC(exprotect, |= _PAGE_NOT_USER);
235PTE_BIT_FUNC(mkexec, &= ~_PAGE_NOT_USER);
236PTE_BIT_FUNC(mkclean, |= _PAGE_CLEAN); 232PTE_BIT_FUNC(mkclean, |= _PAGE_CLEAN);
237PTE_BIT_FUNC(mkdirty, &= ~_PAGE_CLEAN); 233PTE_BIT_FUNC(mkdirty, &= ~_PAGE_CLEAN);
238PTE_BIT_FUNC(mkold, |= _PAGE_OLD); 234PTE_BIT_FUNC(mkold, |= _PAGE_OLD);
diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h
index 4703593b3bb5..e09da5ff1f54 100644
--- a/include/asm-arm26/system.h
+++ b/include/asm-arm26/system.h
@@ -110,16 +110,6 @@ do { \
110} while (0) 110} while (0)
111 111
112/* 112/*
113 * On SMP systems, when the scheduler does migration-cost autodetection,
114 * it needs a way to flush as much of the CPU's caches as possible.
115 *
116 * TODO: fill this in!
117 */
118static inline void sched_cacheflush(void)
119{
120}
121
122/*
123 * Save the current interrupt enable state & disable IRQs 113 * Save the current interrupt enable state & disable IRQs
124 */ 114 */
125#define local_irq_save(x) \ 115#define local_irq_save(x) \
diff --git a/include/asm-arm26/termbits.h b/include/asm-arm26/termbits.h
index a3f4fe1742d0..48d2f5c7bcb8 100644
--- a/include/asm-arm26/termbits.h
+++ b/include/asm-arm26/termbits.h
@@ -15,7 +15,7 @@ struct termios {
15 cc_t c_cc[NCCS]; /* control characters */ 15 cc_t c_cc[NCCS]; /* control characters */
16}; 16};
17 17
18struct ktermios { 18struct termios2 {
19 tcflag_t c_iflag; /* input mode flags */ 19 tcflag_t c_iflag; /* input mode flags */
20 tcflag_t c_oflag; /* output mode flags */ 20 tcflag_t c_oflag; /* output mode flags */
21 tcflag_t c_cflag; /* control mode flags */ 21 tcflag_t c_cflag; /* control mode flags */
@@ -26,6 +26,16 @@ struct ktermios {
26 speed_t c_ospeed; /* output speed */ 26 speed_t c_ospeed; /* output speed */
27}; 27};
28 28
29struct ktermios {
30 tcflag_t c_iflag; /* input mode flags */
31 tcflag_t c_oflag; /* output mode flags */
32 tcflag_t c_cflag; /* control mode flags */
33 tcflag_t c_lflag; /* local mode flags */
34 cc_t c_line; /* line discipline */
35 cc_t c_cc[NCCS]; /* control characters */
36 speed_t c_ispeed; /* input speed */
37 speed_t c_ospeed; /* output speed */
38};
29 39
30/* c_cc characters */ 40/* c_cc characters */
31#define VINTR 0 41#define VINTR 0
@@ -128,6 +138,7 @@ struct ktermios {
128#define HUPCL 0002000 138#define HUPCL 0002000
129#define CLOCAL 0004000 139#define CLOCAL 0004000
130#define CBAUDEX 0010000 140#define CBAUDEX 0010000
141#define BOTHER 0010000
131#define B57600 0010001 142#define B57600 0010001
132#define B115200 0010002 143#define B115200 0010002
133#define B230400 0010003 144#define B230400 0010003
@@ -143,10 +154,12 @@ struct ktermios {
143#define B3000000 0010015 154#define B3000000 0010015
144#define B3500000 0010016 155#define B3500000 0010016
145#define B4000000 0010017 156#define B4000000 0010017
146#define CIBAUD 002003600000 /* input baud rate (not used) */ 157#define CIBAUD 002003600000 /* input baud rate */
147#define CMSPAR 010000000000 /* mark or space (stick) parity */ 158#define CMSPAR 010000000000 /* mark or space (stick) parity */
148#define CRTSCTS 020000000000 /* flow control */ 159#define CRTSCTS 020000000000 /* flow control */
149 160
161#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
162
150/* c_lflag bits */ 163/* c_lflag bits */
151#define ISIG 0000001 164#define ISIG 0000001
152#define ICANON 0000002 165#define ICANON 0000002
diff --git a/include/asm-arm26/termios.h b/include/asm-arm26/termios.h
index 329c324c4040..293e3f1bc3f2 100644
--- a/include/asm-arm26/termios.h
+++ b/include/asm-arm26/termios.h
@@ -82,8 +82,10 @@ struct termio {
82 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 82 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
83}) 83})
84 84
85#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) 85#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
86#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) 86#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
87#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
88#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
87 89
88#endif /* __KERNEL__ */ 90#endif /* __KERNEL__ */
89 91
diff --git a/include/asm-avr32/a.out.h b/include/asm-avr32/a.out.h
index 50bf6e31a143..9f398ab28ed0 100644
--- a/include/asm-avr32/a.out.h
+++ b/include/asm-avr32/a.out.h
@@ -20,6 +20,7 @@ struct exec
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#define STACK_TOP TASK_SIZE 22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
23 24
24#endif 25#endif
25 26
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h
index 9fd2e32f84b8..0215965dc586 100644
--- a/include/asm-avr32/arch-at32ap/board.h
+++ b/include/asm-avr32/arch-at32ap/board.h
@@ -21,6 +21,7 @@ void at32_map_usart(unsigned int hw_id, unsigned int line);
21struct platform_device *at32_add_device_usart(unsigned int id); 21struct platform_device *at32_add_device_usart(unsigned int id);
22 22
23struct eth_platform_data { 23struct eth_platform_data {
24 u32 phy_mask;
24 u8 is_rmii; 25 u8 is_rmii;
25}; 26};
26struct platform_device * 27struct platform_device *
@@ -35,4 +36,18 @@ struct platform_device *
35at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, 36at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,
36 unsigned long fbmem_start, unsigned long fbmem_len); 37 unsigned long fbmem_start, unsigned long fbmem_len);
37 38
39/* depending on what's hooked up, not all SSC pins will be used */
40#define ATMEL_SSC_TK 0x01
41#define ATMEL_SSC_TF 0x02
42#define ATMEL_SSC_TD 0x04
43#define ATMEL_SSC_TX (ATMEL_SSC_TK | ATMEL_SSC_TF | ATMEL_SSC_TD)
44
45#define ATMEL_SSC_RK 0x10
46#define ATMEL_SSC_RF 0x20
47#define ATMEL_SSC_RD 0x40
48#define ATMEL_SSC_RX (ATMEL_SSC_RK | ATMEL_SSC_RF | ATMEL_SSC_RD)
49
50struct platform_device *
51at32_add_device_ssc(unsigned int id, unsigned int flags);
52
38#endif /* __ASM_ARCH_BOARD_H */ 53#endif /* __ASM_ARCH_BOARD_H */
diff --git a/include/asm-avr32/arch-at32ap/gpio.h b/include/asm-avr32/arch-at32ap/gpio.h
index 80a21aa9ae77..af7f9535bab3 100644
--- a/include/asm-avr32/arch-at32ap/gpio.h
+++ b/include/asm-avr32/arch-at32ap/gpio.h
@@ -14,6 +14,8 @@ int gpio_direction_output(unsigned int gpio, int value);
14int gpio_get_value(unsigned int gpio); 14int gpio_get_value(unsigned int gpio);
15void gpio_set_value(unsigned int gpio, int value); 15void gpio_set_value(unsigned int gpio, int value);
16 16
17#include <asm-generic/gpio.h> /* cansleep wrappers */
18
17static inline int gpio_to_irq(unsigned int gpio) 19static inline int gpio_to_irq(unsigned int gpio)
18{ 20{
19 return gpio + GPIO_IRQ_BASE; 21 return gpio + GPIO_IRQ_BASE;
diff --git a/include/asm-avr32/arch-at32ap/sm.h b/include/asm-avr32/arch-at32ap/sm.h
deleted file mode 100644
index 265a9ead20bf..000000000000
--- a/include/asm-avr32/arch-at32ap/sm.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * AT32 System Manager interface.
3 *
4 * Copyright (C) 2006 Atmel Corporation
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_AVR32_AT32_SM_H__
11#define __ASM_AVR32_AT32_SM_H__
12
13struct irq_chip;
14struct platform_device;
15
16struct at32_sm {
17 spinlock_t lock;
18 void __iomem *regs;
19 struct irq_chip *eim_chip;
20 unsigned int eim_first_irq;
21 struct platform_device *pdev;
22};
23
24extern struct platform_device at32_sm_device;
25extern struct at32_sm system_manager;
26
27#endif /* __ASM_AVR32_AT32_SM_H__ */
diff --git a/include/asm-avr32/atomic.h b/include/asm-avr32/atomic.h
index b9c2548a52f3..7ef3862a73d0 100644
--- a/include/asm-avr32/atomic.h
+++ b/include/asm-avr32/atomic.h
@@ -101,7 +101,7 @@ static inline int atomic_sub_unless(atomic_t *v, int a, int u)
101 " mov %1, 1\n" 101 " mov %1, 1\n"
102 "1:" 102 "1:"
103 : "=&r"(tmp), "=&r"(result), "=o"(v->counter) 103 : "=&r"(tmp), "=&r"(result), "=o"(v->counter)
104 : "m"(v->counter), "rKs21"(a), "rKs21"(u) 104 : "m"(v->counter), "rKs21"(a), "rKs21"(u), "1"(result)
105 : "cc", "memory"); 105 : "cc", "memory");
106 106
107 return result; 107 return result;
@@ -137,7 +137,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
137 " mov %1, 1\n" 137 " mov %1, 1\n"
138 "1:" 138 "1:"
139 : "=&r"(tmp), "=&r"(result), "=o"(v->counter) 139 : "=&r"(tmp), "=&r"(result), "=o"(v->counter)
140 : "m"(v->counter), "r"(a), "ir"(u) 140 : "m"(v->counter), "r"(a), "ir"(u), "1"(result)
141 : "cc", "memory"); 141 : "cc", "memory");
142 } 142 }
143 143
diff --git a/include/asm-avr32/cache.h b/include/asm-avr32/cache.h
index dabb955f3c00..d3cf35ab11ab 100644
--- a/include/asm-avr32/cache.h
+++ b/include/asm-avr32/cache.h
@@ -4,6 +4,15 @@
4#define L1_CACHE_SHIFT 5 4#define L1_CACHE_SHIFT 5
5#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 5#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
6 6
7/*
8 * Memory returned by kmalloc() may be used for DMA, so we must make
9 * sure that all such allocations are cache aligned. Otherwise,
10 * unrelated code may cause parts of the buffer to be read into the
11 * cache before the transfer is done, causing old data to be seen by
12 * the CPU.
13 */
14#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
15
7#ifndef __ASSEMBLER__ 16#ifndef __ASSEMBLER__
8struct cache_info { 17struct cache_info {
9 unsigned int ways; 18 unsigned int ways;
diff --git a/include/asm-avr32/fb.h b/include/asm-avr32/fb.h
new file mode 100644
index 000000000000..41baf84ad402
--- /dev/null
+++ b/include/asm-avr32/fb.h
@@ -0,0 +1,21 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7
8static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
9 unsigned long off)
10{
11 vma->vm_page_prot = __pgprot((pgprot_val(vma->vm_page_prot)
12 & ~_PAGE_CACHABLE)
13 | (_PAGE_BUFFER | _PAGE_DIRTY));
14}
15
16static inline int fb_is_primary_device(struct fb_info *info)
17{
18 return 0;
19}
20
21#endif /* _ASM_FB_H_ */
diff --git a/include/asm-avr32/pgtable.h b/include/asm-avr32/pgtable.h
index f6cc2b0f75c3..c07bdd10b891 100644
--- a/include/asm-avr32/pgtable.h
+++ b/include/asm-avr32/pgtable.h
@@ -201,18 +201,10 @@ extern struct page *empty_zero_page;
201 * The following only work if pte_present() is true. 201 * The following only work if pte_present() is true.
202 * Undefined behaviour if not.. 202 * Undefined behaviour if not..
203 */ 203 */
204static inline int pte_read(pte_t pte)
205{
206 return pte_val(pte) & _PAGE_USER;
207}
208static inline int pte_write(pte_t pte) 204static inline int pte_write(pte_t pte)
209{ 205{
210 return pte_val(pte) & _PAGE_RW; 206 return pte_val(pte) & _PAGE_RW;
211} 207}
212static inline int pte_exec(pte_t pte)
213{
214 return pte_val(pte) & _PAGE_EXECUTE;
215}
216static inline int pte_dirty(pte_t pte) 208static inline int pte_dirty(pte_t pte)
217{ 209{
218 return pte_val(pte) & _PAGE_DIRTY; 210 return pte_val(pte) & _PAGE_DIRTY;
@@ -231,21 +223,11 @@ static inline int pte_file(pte_t pte)
231} 223}
232 224
233/* Mutator functions for PTE bits */ 225/* Mutator functions for PTE bits */
234static inline pte_t pte_rdprotect(pte_t pte)
235{
236 set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER));
237 return pte;
238}
239static inline pte_t pte_wrprotect(pte_t pte) 226static inline pte_t pte_wrprotect(pte_t pte)
240{ 227{
241 set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); 228 set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW));
242 return pte; 229 return pte;
243} 230}
244static inline pte_t pte_exprotect(pte_t pte)
245{
246 set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_EXECUTE));
247 return pte;
248}
249static inline pte_t pte_mkclean(pte_t pte) 231static inline pte_t pte_mkclean(pte_t pte)
250{ 232{
251 set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); 233 set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY));
@@ -256,21 +238,11 @@ static inline pte_t pte_mkold(pte_t pte)
256 set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); 238 set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED));
257 return pte; 239 return pte;
258} 240}
259static inline pte_t pte_mkread(pte_t pte)
260{
261 set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER));
262 return pte;
263}
264static inline pte_t pte_mkwrite(pte_t pte) 241static inline pte_t pte_mkwrite(pte_t pte)
265{ 242{
266 set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); 243 set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW));
267 return pte; 244 return pte;
268} 245}
269static inline pte_t pte_mkexec(pte_t pte)
270{
271 set_pte(&pte, __pte(pte_val(pte) | _PAGE_EXECUTE));
272 return pte;
273}
274static inline pte_t pte_mkdirty(pte_t pte) 246static inline pte_t pte_mkdirty(pte_t pte)
275{ 247{
276 set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); 248 set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY));
diff --git a/include/asm-avr32/termbits.h b/include/asm-avr32/termbits.h
index c215fafdae4d..db2daab31fdb 100644
--- a/include/asm-avr32/termbits.h
+++ b/include/asm-avr32/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct termios2 {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20struct ktermios { 31struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */ 32 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */ 33 tcflag_t c_oflag; /* output mode flags */
diff --git a/include/asm-avr32/unaligned.h b/include/asm-avr32/unaligned.h
index 3042723fcbfd..36f5fd430543 100644
--- a/include/asm-avr32/unaligned.h
+++ b/include/asm-avr32/unaligned.h
@@ -7,19 +7,10 @@
7 * words, but halfwords must be halfword-aligned, and doublewords must 7 * words, but halfwords must be halfword-aligned, and doublewords must
8 * be word-aligned. 8 * be word-aligned.
9 * 9 *
10 * TODO: Make all this CPU-specific and optimize. 10 * However, swapped word loads must be word-aligned so we can't
11 * optimize word loads in general.
11 */ 12 */
12 13
13#include <linux/string.h> 14#include <asm-generic/unaligned.h>
14
15/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
16
17#define get_unaligned(ptr) \
18 ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
19
20#define put_unaligned(val, ptr) \
21 ({ __typeof__(*(ptr)) __tmp = (val); \
22 memmove((ptr), &__tmp, sizeof(*(ptr))); \
23 (void)0; })
24 15
25#endif /* __ASM_AVR32_UNALIGNED_H */ 16#endif /* __ASM_AVR32_UNALIGNED_H */
diff --git a/include/asm-blackfin/Kbuild b/include/asm-blackfin/Kbuild
index c68e1680da01..71f8fe783258 100644
--- a/include/asm-blackfin/Kbuild
+++ b/include/asm-blackfin/Kbuild
@@ -1 +1,3 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2
3header-y += fixed_code.h
diff --git a/include/asm-blackfin/bfin-global.h b/include/asm-blackfin/bfin-global.h
index 57f37ccdcdf1..c4d6cbbf96d4 100644
--- a/include/asm-blackfin/bfin-global.h
+++ b/include/asm-blackfin/bfin-global.h
@@ -67,6 +67,18 @@ extern void evt14_softirq(void);
67extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs); 67extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
68extern void bfin_gpio_interrupt_setup(int irq, int irq_pfx, int type); 68extern void bfin_gpio_interrupt_setup(int irq, int irq_pfx, int type);
69 69
70extern asmlinkage void finish_atomic_sections (struct pt_regs *regs);
71extern char fixed_code_start;
72extern char fixed_code_end;
73extern int atomic_xchg32(void);
74extern int atomic_cas32(void);
75extern int atomic_add32(void);
76extern int atomic_sub32(void);
77extern int atomic_ior32(void);
78extern int atomic_and32(void);
79extern int atomic_xor32(void);
80extern void sigreturn_stub(void);
81
70extern void *l1_data_A_sram_alloc(size_t); 82extern void *l1_data_A_sram_alloc(size_t);
71extern void *l1_data_B_sram_alloc(size_t); 83extern void *l1_data_B_sram_alloc(size_t);
72extern void *l1_inst_sram_alloc(size_t); 84extern void *l1_inst_sram_alloc(size_t);
diff --git a/include/asm-blackfin/blackfin.h b/include/asm-blackfin/blackfin.h
index 14e58de73973..25b934b7f829 100644
--- a/include/asm-blackfin/blackfin.h
+++ b/include/asm-blackfin/blackfin.h
@@ -6,7 +6,11 @@
6#ifndef _BLACKFIN_H_ 6#ifndef _BLACKFIN_H_
7#define _BLACKFIN_H_ 7#define _BLACKFIN_H_
8 8
9#include <asm/macros.h> 9#define LO(con32) ((con32) & 0xFFFF)
10#define lo(con32) ((con32) & 0xFFFF)
11#define HI(con32) (((con32) >> 16) & 0xFFFF)
12#define hi(con32) (((con32) >> 16) & 0xFFFF)
13
10#include <asm/mach/blackfin.h> 14#include <asm/mach/blackfin.h>
11#include <asm/bfin-global.h> 15#include <asm/bfin-global.h>
12 16
@@ -35,7 +39,9 @@ static inline void SSYNC (void)
35#elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244) 39#elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
36static inline void SSYNC (void) 40static inline void SSYNC (void)
37{ 41{
38 __builtin_bfin_ssync(); 42 __asm__ __volatile__ ("nop; nop; nop;\n\t"
43 "ssync;\n\t"
44 ::);
39} 45}
40#elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244) 46#elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
41static inline void SSYNC (void) 47static inline void SSYNC (void)
@@ -67,7 +73,9 @@ static inline void CSYNC (void)
67#elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244) 73#elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
68static inline void CSYNC (void) 74static inline void CSYNC (void)
69{ 75{
70 __builtin_bfin_csync(); 76 __asm__ __volatile__ ("nop; nop; nop;\n\t"
77 "ssync;\n\t"
78 ::);
71} 79}
72#elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244) 80#elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
73static inline void CSYNC (void) 81static inline void CSYNC (void)
@@ -76,6 +84,31 @@ static inline void CSYNC (void)
76} 84}
77#endif 85#endif
78 86
87#else /* __ASSEMBLY__ */
88
89/* SSYNC & CSYNC implementations for assembly files */
90
91#define ssync(x) SSYNC(x)
92#define csync(x) CSYNC(x)
93
94#if defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
95#define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch;
96#define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch;
97
98#elif defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
99#define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch;
100#define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch;
101
102#elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
103#define SSYNC(scratch) nop; nop; nop; SSYNC;
104#define CSYNC(scratch) nop; nop; nop; CSYNC;
105
106#elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
107#define SSYNC(scratch) SSYNC;
108#define CSYNC(scratch) CSYNC;
109
110#endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */
111
79#endif /* __ASSEMBLY__ */ 112#endif /* __ASSEMBLY__ */
80 113
81#endif /* _BLACKFIN_H_ */ 114#endif /* _BLACKFIN_H_ */
diff --git a/include/asm-blackfin/cplbinit.h b/include/asm-blackfin/cplbinit.h
index 3bad2d1e6a8c..bec6ecdf1bdb 100644
--- a/include/asm-blackfin/cplbinit.h
+++ b/include/asm-blackfin/cplbinit.h
@@ -57,8 +57,8 @@ struct cplb_tab {
57 u16 size; 57 u16 size;
58}; 58};
59 59
60u_long icplb_table[MAX_CPLBS+1]; 60extern u_long icplb_table[MAX_CPLBS+1];
61u_long dcplb_table[MAX_CPLBS+1]; 61extern u_long dcplb_table[MAX_CPLBS+1];
62 62
63/* Till here we are discussing about the static memory management model. 63/* Till here we are discussing about the static memory management model.
64 * However, the operating envoronments commonly define more CPLB 64 * However, the operating envoronments commonly define more CPLB
@@ -70,134 +70,27 @@ u_long dcplb_table[MAX_CPLBS+1];
70 */ 70 */
71 71
72#ifdef CONFIG_CPLB_SWITCH_TAB_L1 72#ifdef CONFIG_CPLB_SWITCH_TAB_L1
73u_long ipdt_table[MAX_SWITCH_I_CPLBS+1]__attribute__((l1_data)); 73extern u_long ipdt_table[MAX_SWITCH_I_CPLBS+1]__attribute__((l1_data));
74u_long dpdt_table[MAX_SWITCH_D_CPLBS+1]__attribute__((l1_data)); 74extern u_long dpdt_table[MAX_SWITCH_D_CPLBS+1]__attribute__((l1_data));
75 75
76#ifdef CONFIG_CPLB_INFO 76#ifdef CONFIG_CPLB_INFO
77u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS]__attribute__((l1_data)); 77extern u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS]__attribute__((l1_data));
78u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS]__attribute__((l1_data)); 78extern u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS]__attribute__((l1_data));
79#endif /* CONFIG_CPLB_INFO */ 79#endif /* CONFIG_CPLB_INFO */
80 80
81#else 81#else
82 82
83u_long ipdt_table[MAX_SWITCH_I_CPLBS+1]; 83extern u_long ipdt_table[MAX_SWITCH_I_CPLBS+1];
84u_long dpdt_table[MAX_SWITCH_D_CPLBS+1]; 84extern u_long dpdt_table[MAX_SWITCH_D_CPLBS+1];
85 85
86#ifdef CONFIG_CPLB_INFO 86#ifdef CONFIG_CPLB_INFO
87u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS]; 87extern u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS];
88u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS]; 88extern u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS];
89#endif /* CONFIG_CPLB_INFO */ 89#endif /* CONFIG_CPLB_INFO */
90 90
91#endif /*CONFIG_CPLB_SWITCH_TAB_L1*/ 91#endif /*CONFIG_CPLB_SWITCH_TAB_L1*/
92 92
93struct s_cplb { 93extern unsigned long reserved_mem_dcache_on;
94 struct cplb_tab init_i; 94extern unsigned long reserved_mem_icache_on;
95 struct cplb_tab init_d;
96 struct cplb_tab switch_i;
97 struct cplb_tab switch_d;
98};
99 95
100#if defined(CONFIG_BLKFIN_DCACHE) || defined(CONFIG_BLKFIN_CACHE) 96extern void generate_cpl_tables(void);
101static struct cplb_desc cplb_data[] = {
102 {
103 .start = 0,
104 .end = SIZE_4K,
105 .psize = SIZE_4K,
106 .attr = INITIAL_T | SWITCH_T | I_CPLB | D_CPLB,
107 .i_conf = SDRAM_OOPS,
108 .d_conf = SDRAM_OOPS,
109#if defined(CONFIG_DEBUG_HUNT_FOR_ZERO)
110 .valid = 1,
111#else
112 .valid = 0,
113#endif
114 .name = "ZERO Pointer Saveguard",
115 },
116 {
117 .start = L1_CODE_START,
118 .end = L1_CODE_START + L1_CODE_LENGTH,
119 .psize = SIZE_4M,
120 .attr = INITIAL_T | SWITCH_T | I_CPLB,
121 .i_conf = L1_IMEMORY,
122 .d_conf = 0,
123 .valid = 1,
124 .name = "L1 I-Memory",
125 },
126 {
127 .start = L1_DATA_A_START,
128 .end = L1_DATA_B_START + L1_DATA_B_LENGTH,
129 .psize = SIZE_4M,
130 .attr = INITIAL_T | SWITCH_T | D_CPLB,
131 .i_conf = 0,
132 .d_conf = L1_DMEMORY,
133#if ((L1_DATA_A_LENGTH > 0) || (L1_DATA_B_LENGTH > 0))
134 .valid = 1,
135#else
136 .valid = 0,
137#endif
138 .name = "L1 D-Memory",
139 },
140 {
141 .start = 0,
142 .end = 0, /* dynamic */
143 .psize = 0,
144 .attr = INITIAL_T | SWITCH_T | I_CPLB | D_CPLB,
145 .i_conf = SDRAM_IGENERIC,
146 .d_conf = SDRAM_DGENERIC,
147 .valid = 1,
148 .name = "SDRAM Kernel",
149 },
150 {
151 .start = 0, /* dynamic */
152 .end = 0, /* dynamic */
153 .psize = 0,
154 .attr = INITIAL_T | SWITCH_T | D_CPLB,
155 .i_conf = SDRAM_IGENERIC,
156 .d_conf = SDRAM_DNON_CHBL,
157 .valid = 1,
158 .name = "SDRAM RAM MTD",
159 },
160 {
161 .start = 0, /* dynamic */
162 .end = 0, /* dynamic */
163 .psize = SIZE_1M,
164 .attr = INITIAL_T | SWITCH_T | D_CPLB,
165 .d_conf = SDRAM_DNON_CHBL,
166 .valid = 1,//(DMA_UNCACHED_REGION > 0),
167 .name = "SDRAM Uncached DMA ZONE",
168 },
169 {
170 .start = 0, /* dynamic */
171 .end = 0, /* dynamic */
172 .psize = 0,
173 .attr = SWITCH_T | D_CPLB,
174 .i_conf = 0, /* dynamic */
175 .d_conf = 0, /* dynamic */
176 .valid = 1,
177 .name = "SDRAM Reserved Memory",
178 },
179 {
180 .start = ASYNC_BANK0_BASE,
181 .end = ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE,
182 .psize = 0,
183 .attr = SWITCH_T | D_CPLB,
184 .d_conf = SDRAM_EBIU,
185 .valid = 1,
186 .name = "ASYNC Memory",
187 },
188 {
189#if defined(CONFIG_BF561)
190 .start = L2_SRAM,
191 .end = L2_SRAM_END,
192 .psize = SIZE_1M,
193 .attr = SWITCH_T | D_CPLB,
194 .i_conf = L2_MEMORY,
195 .d_conf = L2_MEMORY,
196 .valid = 1,
197#else
198 .valid = 0,
199#endif
200 .name = "L2 Memory",
201 }
202};
203#endif
diff --git a/include/asm-blackfin/dma-mapping.h b/include/asm-blackfin/dma-mapping.h
index 7a77d7fe3a33..282fabccf6a6 100644
--- a/include/asm-blackfin/dma-mapping.h
+++ b/include/asm-blackfin/dma-mapping.h
@@ -15,6 +15,8 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
15#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 15#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
16#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 16#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
17 17
18#define dma_mapping_error
19
18/* 20/*
19 * Map a single buffer of the indicated size for DMA in streaming mode. 21 * Map a single buffer of the indicated size for DMA in streaming mode.
20 * The 32-bit bus address to use is returned. 22 * The 32-bit bus address to use is returned.
diff --git a/include/asm-blackfin/fb.h b/include/asm-blackfin/fb.h
new file mode 100644
index 000000000000..c7df38030992
--- /dev/null
+++ b/include/asm-blackfin/fb.h
@@ -0,0 +1,12 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/include/asm-blackfin/fixed_code.h b/include/asm-blackfin/fixed_code.h
new file mode 100644
index 000000000000..e6df84ee1557
--- /dev/null
+++ b/include/asm-blackfin/fixed_code.h
@@ -0,0 +1,20 @@
1/* This file defines the fixed addresses where userspace programs can find
2 atomic code sequences. */
3
4#define FIXED_CODE_START 0x400
5
6#define SIGRETURN_STUB 0x400
7
8#define ATOMIC_SEQS_START 0x410
9
10#define ATOMIC_XCHG32 0x410
11#define ATOMIC_CAS32 0x420
12#define ATOMIC_ADD32 0x430
13#define ATOMIC_SUB32 0x440
14#define ATOMIC_IOR32 0x450
15#define ATOMIC_AND32 0x460
16#define ATOMIC_XOR32 0x470
17
18#define ATOMIC_SEQS_END 0x480
19
20#define FIXED_CODE_END 0x480
diff --git a/include/asm-blackfin/gpio.h b/include/asm-blackfin/gpio.h
index aa0d5503e232..7480cfa7e2d6 100644
--- a/include/asm-blackfin/gpio.h
+++ b/include/asm-blackfin/gpio.h
@@ -204,8 +204,62 @@
204 204
205#endif 205#endif
206 206
207#ifdef BF548_FAMILY
208#include <asm-blackfin/mach-bf548/gpio.h>
209#endif
210
207#ifdef BF561_FAMILY 211#ifdef BF561_FAMILY
208#define MAX_BLACKFIN_GPIOS 48 212#define MAX_BLACKFIN_GPIOS 48
213
214#define GPIO_PF0 0
215#define GPIO_PF1 1
216#define GPIO_PF2 2
217#define GPIO_PF3 3
218#define GPIO_PF4 4
219#define GPIO_PF5 5
220#define GPIO_PF6 6
221#define GPIO_PF7 7
222#define GPIO_PF8 8
223#define GPIO_PF9 9
224#define GPIO_PF10 10
225#define GPIO_PF11 11
226#define GPIO_PF12 12
227#define GPIO_PF13 13
228#define GPIO_PF14 14
229#define GPIO_PF15 15
230#define GPIO_PF16 16
231#define GPIO_PF17 17
232#define GPIO_PF18 18
233#define GPIO_PF19 19
234#define GPIO_PF20 20
235#define GPIO_PF21 21
236#define GPIO_PF22 22
237#define GPIO_PF23 23
238#define GPIO_PF24 24
239#define GPIO_PF25 25
240#define GPIO_PF26 26
241#define GPIO_PF27 27
242#define GPIO_PF28 28
243#define GPIO_PF29 29
244#define GPIO_PF30 30
245#define GPIO_PF31 31
246#define GPIO_PF32 32
247#define GPIO_PF33 33
248#define GPIO_PF34 34
249#define GPIO_PF35 35
250#define GPIO_PF36 36
251#define GPIO_PF37 37
252#define GPIO_PF38 38
253#define GPIO_PF39 39
254#define GPIO_PF40 40
255#define GPIO_PF41 41
256#define GPIO_PF42 42
257#define GPIO_PF43 43
258#define GPIO_PF44 44
259#define GPIO_PF45 45
260#define GPIO_PF46 46
261#define GPIO_PF47 47
262
209#define PORT_FIO0 GPIO_0 263#define PORT_FIO0 GPIO_0
210#define PORT_FIO1 GPIO_16 264#define PORT_FIO1 GPIO_16
211#define PORT_FIO2 GPIO_32 265#define PORT_FIO2 GPIO_32
@@ -230,6 +284,7 @@
230* MODIFICATION HISTORY : 284* MODIFICATION HISTORY :
231**************************************************************/ 285**************************************************************/
232 286
287#ifndef BF548_FAMILY
233void set_gpio_dir(unsigned short, unsigned short); 288void set_gpio_dir(unsigned short, unsigned short);
234void set_gpio_inen(unsigned short, unsigned short); 289void set_gpio_inen(unsigned short, unsigned short);
235void set_gpio_polar(unsigned short, unsigned short); 290void set_gpio_polar(unsigned short, unsigned short);
@@ -299,6 +354,7 @@ struct gpio_port_t {
299 unsigned short dummy16; 354 unsigned short dummy16;
300 unsigned short inen; 355 unsigned short inen;
301}; 356};
357#endif
302 358
303#ifdef CONFIG_PM 359#ifdef CONFIG_PM
304#define PM_WAKE_RISING 0x1 360#define PM_WAKE_RISING 0x1
@@ -332,6 +388,7 @@ struct gpio_port_s {
332 unsigned short inen; 388 unsigned short inen;
333 389
334 unsigned short fer; 390 unsigned short fer;
391 unsigned short reserved;
335}; 392};
336#endif /*CONFIG_PM*/ 393#endif /*CONFIG_PM*/
337 394
@@ -356,8 +413,10 @@ void gpio_free(unsigned short);
356void gpio_set_value(unsigned short gpio, unsigned short arg); 413void gpio_set_value(unsigned short gpio, unsigned short arg);
357unsigned short gpio_get_value(unsigned short gpio); 414unsigned short gpio_get_value(unsigned short gpio);
358 415
416#ifndef BF548_FAMILY
359#define gpio_get_value(gpio) get_gpio_data(gpio) 417#define gpio_get_value(gpio) get_gpio_data(gpio)
360#define gpio_set_value(gpio, value) set_gpio_data(gpio, value) 418#define gpio_set_value(gpio, value) set_gpio_data(gpio, value)
419#endif
361 420
362void gpio_direction_input(unsigned short gpio); 421void gpio_direction_input(unsigned short gpio);
363void gpio_direction_output(unsigned short gpio); 422void gpio_direction_output(unsigned short gpio);
diff --git a/include/asm-blackfin/hardirq.h b/include/asm-blackfin/hardirq.h
index 0cab0d35badc..b6b19f1b9dab 100644
--- a/include/asm-blackfin/hardirq.h
+++ b/include/asm-blackfin/hardirq.h
@@ -28,7 +28,11 @@ typedef struct {
28 * SOFTIRQ_MASK: 0x00ff0000 28 * SOFTIRQ_MASK: 0x00ff0000
29 */ 29 */
30 30
31#if NR_IRQS > 256
32#define HARDIRQ_BITS 9
33#else
31#define HARDIRQ_BITS 8 34#define HARDIRQ_BITS 8
35#endif
32 36
33#ifdef NR_IRQS 37#ifdef NR_IRQS
34# if (1 << HARDIRQ_BITS) < NR_IRQS 38# if (1 << HARDIRQ_BITS) < NR_IRQS
diff --git a/include/asm-blackfin/io.h b/include/asm-blackfin/io.h
index eac8bcaf64c2..142cb333db29 100644
--- a/include/asm-blackfin/io.h
+++ b/include/asm-blackfin/io.h
@@ -20,7 +20,7 @@
20 */ 20 */
21#ifndef __ASSEMBLY__ 21#ifndef __ASSEMBLY__
22 22
23static inline unsigned char readb(void __iomem *addr) 23static inline unsigned char readb(const volatile void __iomem *addr)
24{ 24{
25 unsigned int val; 25 unsigned int val;
26 int tmp; 26 int tmp;
@@ -35,7 +35,7 @@ static inline unsigned char readb(void __iomem *addr)
35 return (unsigned char) val; 35 return (unsigned char) val;
36} 36}
37 37
38static inline unsigned short readw(void __iomem *addr) 38static inline unsigned short readw(const volatile void __iomem *addr)
39{ 39{
40 unsigned int val; 40 unsigned int val;
41 int tmp; 41 int tmp;
@@ -50,7 +50,7 @@ static inline unsigned short readw(void __iomem *addr)
50 return (unsigned short) val; 50 return (unsigned short) val;
51} 51}
52 52
53static inline unsigned int readl(void __iomem *addr) 53static inline unsigned int readl(const volatile void __iomem *addr)
54{ 54{
55 unsigned int val; 55 unsigned int val;
56 int tmp; 56 int tmp;
diff --git a/include/asm-blackfin/kgdb.h b/include/asm-blackfin/kgdb.h
new file mode 100644
index 000000000000..532bd9052004
--- /dev/null
+++ b/include/asm-blackfin/kgdb.h
@@ -0,0 +1,183 @@
1/*
2 * File: include/asm-blackfin/kgdb.h
3 * Based on:
4 * Author: Sonic Zhang
5 *
6 * Created:
7 * Description:
8 *
9 * Rev: $Id: kgdb_bfin_linux-2.6.x.patch 4934 2007-02-13 09:32:11Z sonicz $
10 *
11 * Modified:
12 * Copyright 2005-2006 Analog Devices Inc.
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (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, see the file COPYING, or write
28 * to the Free Software Foundation, Inc.,
29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 */
31
32#ifndef __ASM_BLACKFIN_KGDB_H__
33#define __ASM_BLACKFIN_KGDB_H__
34
35#include <linux/ptrace.h>
36
37/* gdb locks */
38#define KGDB_MAX_NO_CPUS 8
39
40/************************************************************************/
41/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
42/* at least NUMREGBYTES*2 are needed for register packets */
43/* Longer buffer is needed to list all threads */
44#define BUFMAX 2048
45
46/*
47 * Note that this register image is different from
48 * the register image that Linux produces at interrupt time.
49 *
50 * Linux's register image is defined by struct pt_regs in ptrace.h.
51 */
52enum regnames {
53 /* Core Registers */
54 BFIN_R0 = 0,
55 BFIN_R1,
56 BFIN_R2,
57 BFIN_R3,
58 BFIN_R4,
59 BFIN_R5,
60 BFIN_R6,
61 BFIN_R7,
62 BFIN_P0,
63 BFIN_P1,
64 BFIN_P2,
65 BFIN_P3,
66 BFIN_P4,
67 BFIN_P5,
68 BFIN_SP,
69 BFIN_FP,
70 BFIN_I0,
71 BFIN_I1,
72 BFIN_I2,
73 BFIN_I3,
74 BFIN_M0,
75 BFIN_M1,
76 BFIN_M2,
77 BFIN_M3,
78 BFIN_B0,
79 BFIN_B1,
80 BFIN_B2,
81 BFIN_B3,
82 BFIN_L0,
83 BFIN_L1,
84 BFIN_L2,
85 BFIN_L3,
86 BFIN_A0_DOT_X,
87 BFIN_A0_DOT_W,
88 BFIN_A1_DOT_X,
89 BFIN_A1_DOT_W,
90 BFIN_ASTAT,
91 BFIN_RETS,
92 BFIN_LC0,
93 BFIN_LT0,
94 BFIN_LB0,
95 BFIN_LC1,
96 BFIN_LT1,
97 BFIN_LB1,
98 BFIN_CYCLES,
99 BFIN_CYCLES2,
100 BFIN_USP,
101 BFIN_SEQSTAT,
102 BFIN_SYSCFG,
103 BFIN_RETI,
104 BFIN_RETX,
105 BFIN_RETN,
106 BFIN_RETE,
107
108 /* Pseudo Registers */
109 BFIN_PC,
110 BFIN_CC,
111 BFIN_EXTRA1, /* Address of .text section. */
112 BFIN_EXTRA2, /* Address of .data section. */
113 BFIN_EXTRA3, /* Address of .bss section. */
114 BFIN_FDPIC_EXEC,
115 BFIN_FDPIC_INTERP,
116
117 /* MMRs */
118 BFIN_IPEND,
119
120 /* LAST ENTRY SHOULD NOT BE CHANGED. */
121 BFIN_NUM_REGS /* The number of all registers. */
122};
123
124/* Number of bytes of registers. */
125#define NUMREGBYTES BFIN_NUM_REGS*4
126
127#define BREAKPOINT() asm(" EXCPT 2;");
128#define BREAK_INSTR_SIZE 2
129#define HW_BREAKPOINT_NUM 6
130
131/* Instruction watchpoint address control register bits mask */
132#define WPPWR 0x1
133#define WPIREN01 0x2
134#define WPIRINV01 0x4
135#define WPIAEN0 0x8
136#define WPIAEN1 0x10
137#define WPICNTEN0 0x20
138#define WPICNTEN1 0x40
139#define EMUSW0 0x80
140#define EMUSW1 0x100
141#define WPIREN23 0x200
142#define WPIRINV23 0x400
143#define WPIAEN2 0x800
144#define WPIAEN3 0x1000
145#define WPICNTEN2 0x2000
146#define WPICNTEN3 0x4000
147#define EMUSW2 0x8000
148#define EMUSW3 0x10000
149#define WPIREN45 0x20000
150#define WPIRINV45 0x40000
151#define WPIAEN4 0x80000
152#define WPIAEN5 0x100000
153#define WPICNTEN4 0x200000
154#define WPICNTEN5 0x400000
155#define EMUSW4 0x800000
156#define EMUSW5 0x1000000
157#define WPAND 0x2000000
158
159/* Data watchpoint address control register bits mask */
160#define WPDREN01 0x1
161#define WPDRINV01 0x2
162#define WPDAEN0 0x4
163#define WPDAEN1 0x8
164#define WPDCNTEN0 0x10
165#define WPDCNTEN1 0x20
166#define WPDSRC0 0xc0
167#define WPDACC0 0x300
168#define WPDSRC1 0xc00
169#define WPDACC1 0x3000
170
171/* Watchpoint status register bits mask */
172#define STATIA0 0x1
173#define STATIA1 0x2
174#define STATIA2 0x4
175#define STATIA3 0x8
176#define STATIA4 0x10
177#define STATIA5 0x20
178#define STATDA0 0x40
179#define STATDA1 0x80
180
181extern void kgdb_print(const char *fmt, ...);
182
183#endif
diff --git a/include/asm-blackfin/mach-bf533/anomaly.h b/include/asm-blackfin/mach-bf533/anomaly.h
index a84d3909345e..7302f290b93d 100644
--- a/include/asm-blackfin/mach-bf533/anomaly.h
+++ b/include/asm-blackfin/mach-bf533/anomaly.h
@@ -43,7 +43,8 @@
43#endif 43#endif
44 44
45/* Issues that are common to 0.5, 0.4, and 0.3 silicon */ 45/* Issues that are common to 0.5, 0.4, and 0.3 silicon */
46#if (defined(CONFIG_BF_REV_0_5) || defined(CONFIG_BF_REV_0_4) || defined(CONFIG_BF_REV_0_3)) 46#if (defined(CONFIG_BF_REV_0_5) || defined(CONFIG_BF_REV_0_4) \
47 || defined(CONFIG_BF_REV_0_3))
47#define ANOMALY_05000074 /* A multi issue instruction with dsp32shiftimm in 48#define ANOMALY_05000074 /* A multi issue instruction with dsp32shiftimm in
48 slot1 and store of a P register in slot 2 is not 49 slot1 and store of a P register in slot 2 is not
49 supported */ 50 supported */
@@ -76,11 +77,16 @@
76 control */ 77 control */
77#define ANOMALY_05000283 /* A system MMR write is stalled indefinitely when 78#define ANOMALY_05000283 /* A system MMR write is stalled indefinitely when
78 killed in a particular stage*/ 79 killed in a particular stage*/
80#define ANOMALY_05000311 /* Erroneous flag pin operations under specific
81 sequences */
79#define ANOMALY_05000312 /* Errors when SSYNC, CSYNC, or loads to LT, LB and LC 82#define ANOMALY_05000312 /* Errors when SSYNC, CSYNC, or loads to LT, LB and LC
80 registers are interrupted */ 83 registers are interrupted */
81#define ANOMALY_05000311 /* Erroneous flag pin operations under specific sequences*/ 84#define ANOMALY_05000313 /* PPI Is Level-Sensitive on First Transfer */
82 85#define ANOMALY_05000315 /* Killed System MMR Write Completes Erroneously On
83#endif 86 * Next System MMR Access */
87#define ANOMALY_05000319 /* Internal Voltage Regulator Values of 1.05V, 1.10V
88 * and 1.15V Not Allowed for LQFP Packages */
89#endif /* Issues that are common to 0.5, 0.4, and 0.3 silicon */
84 90
85/* These issues only occur on 0.3 or 0.4 BF533 */ 91/* These issues only occur on 0.3 or 0.4 BF533 */
86#if (defined(CONFIG_BF_REV_0_4) || defined(CONFIG_BF_REV_0_3)) 92#if (defined(CONFIG_BF_REV_0_4) || defined(CONFIG_BF_REV_0_3))
@@ -134,14 +140,14 @@
134 internal voltage regulator (VDDint) to increase. */ 140 internal voltage regulator (VDDint) to increase. */
135#define ANOMALY_05000270 /* High I/O activity causes the output voltage of the 141#define ANOMALY_05000270 /* High I/O activity causes the output voltage of the
136 internal voltage regulator (VDDint) to decrease */ 142 internal voltage regulator (VDDint) to decrease */
137#endif 143#endif /* issues only occur on 0.3 or 0.4 BF533 */
138 144
139/* These issues are only on 0.4 silicon */ 145/* These issues are only on 0.4 silicon */
140#if (defined(CONFIG_BF_REV_0_4)) 146#if (defined(CONFIG_BF_REV_0_4))
141#define ANOMALY_05000234 /* Incorrect Revision Number in DSPID Register */ 147#define ANOMALY_05000234 /* Incorrect Revision Number in DSPID Register */
142#define ANOMALY_05000250 /* Incorrect Bit-Shift of Data Word in Multichannel 148#define ANOMALY_05000250 /* Incorrect Bit-Shift of Data Word in Multichannel
143 (TDM) */ 149 (TDM) */
144#endif 150#endif /* issues are only on 0.4 silicon */
145 151
146/* These issues are only on 0.3 silicon */ 152/* These issues are only on 0.3 silicon */
147#if defined(CONFIG_BF_REV_0_3) 153#if defined(CONFIG_BF_REV_0_3)
@@ -170,6 +176,72 @@
170#define ANOMALY_05000233 /* PPI_FS3 is not driven in 2 or 3 internal Frame 176#define ANOMALY_05000233 /* PPI_FS3 is not driven in 2 or 3 internal Frame
171 Sync Transmit Mode */ 177 Sync Transmit Mode */
172#define ANOMALY_05000271 /* Spontaneous reset of Internal Voltage Regulator */ 178#define ANOMALY_05000271 /* Spontaneous reset of Internal Voltage Regulator */
179#endif /* only on 0.3 silicon */
180
181#if defined(CONFIG_BF_REV_0_2)
182#define ANOMALY_05000067 /* Watchpoints (Hardware Breakpoints) are not
183 * supported */
184#define ANOMALY_05000109 /* Reserved bits in SYSCFG register not set at
185 * power on */
186#define ANOMALY_05000116 /* Trace Buffers may record discontinuities into
187 * emulation mode and/or exception, NMI, reset
188 * handlers */
189#define ANOMALY_05000123 /* DTEST_COMMAND initiated memory access may be
190 * incorrect if data cache or DMA is active */
191#define ANOMALY_05000124 /* DMA Lock-up at CCLK to SCLK ratios of 4:1, 2:1,
192 * or 1:1 */
193#define ANOMALY_05000125 /* Erroneous exception when enabling cache */
194#define ANOMALY_05000126 /* SPI clock polarity and phase bits incorrect
195 * during booting */
196#define ANOMALY_05000137 /* DMEM_CONTROL is not set on Reset */
197#define ANOMALY_05000138 /* SPI boot will not complete if there is a zero fill
198 * block in the loader file */
199#define ANOMALY_05000140 /* Allowing the SPORT RX FIFO to fill will cause an
200 * overflow */
201#define ANOMALY_05000141 /* An Infinite Stall occurs with a particular sequence
202 * of consecutive dual dag events */
203#define ANOMALY_05000142 /* Interrupts may be lost when a programmable input
204 * flag is configured to be edge sensitive */
205#define ANOMALY_05000143 /* A read from external memory may return a wrong
206 * value with data cache enabled */
207#define ANOMALY_05000144 /* DMA and TESTSET conflict when both are accessing
208 * external memory */
209#define ANOMALY_05000145 /* In PWM_OUT mode, you must enable the PPI block to
210 * generate a waveform from PPI_CLK */
211#define ANOMALY_05000146 /* MDMA may lose the first few words of a descriptor
212 * chain */
213#define ANOMALY_05000147 /* The source MDMA descriptor may stop with a DMA
214 * Error */
215#define ANOMALY_05000148 /* When booting from a 16-bit asynchronous memory
216 * device, the upper 8-bits of each word must be
217 * 0x00 */
218#define ANOMALY_05000153 /* Frame Delay in SPORT Multichannel Mode */
219#define ANOMALY_05000154 /* SPORT TFS signal is active in Multi-channel mode
220 * outside of valid channels */
221#define ANOMALY_05000155 /* Timer1 can not be used for PWMOUT mode when a
222 * certain PPI mode is in use */
223#define ANOMALY_05000157 /* A killed 32-bit System MMR write will lead to
224 * the next system MMR access thinking it should be
225 * 32-bit. */
226#define ANOMALY_05000163 /* SPORT transmit data is not gated by external frame
227 * sync in certain conditions */
228#define ANOMALY_05000168 /* SDRAM auto-refresh and subsequent Power Ups */
229#define ANOMALY_05000169 /* DATA CPLB page miss can result in lost
230 * write-through cache data writes */
231#define ANOMALY_05000173 /* DMA vs Core accesses to external memory */
232#define ANOMALY_05000174 /* Cache Fill Buffer Data lost */
233#define ANOMALY_05000175 /* Overlapping Sequencer and Memory Stalls */
234#define ANOMALY_05000176 /* Multiplication of (-1) by (-1) followed by an
235 * accumulator saturation */
236#define ANOMALY_05000181 /* Disabling the PPI resets the PPI configuration
237 * registers */
238#define ANOMALY_05000185 /* PPI TX Mode with 2 External Frame Syncs */
239#define ANOMALY_05000191 /* PPI does not invert the Driving PPICLK edge in
240 * Transmit Modes */
241#define ANOMALY_05000192 /* In PPI Transmit Modes with External Frame Syncs
242 * POLC */
243#define ANOMALY_05000206 /* Internal Voltage Regulator may not start up */
244
173#endif 245#endif
174 246
175#endif /* _MACH_ANOMALY_H_ */ 247#endif /* _MACH_ANOMALY_H_ */
diff --git a/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
index 23bf76aa3451..e043cafa3c42 100644
--- a/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
+++ b/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
@@ -78,6 +78,7 @@ struct bfin_serial_res {
78}; 78};
79 79
80struct bfin_serial_res bfin_serial_resource[] = { 80struct bfin_serial_res bfin_serial_resource[] = {
81 {
81 0xFFC00400, 82 0xFFC00400,
82 IRQ_UART_RX, 83 IRQ_UART_RX,
83#ifdef CONFIG_SERIAL_BFIN_DMA 84#ifdef CONFIG_SERIAL_BFIN_DMA
@@ -88,6 +89,7 @@ struct bfin_serial_res bfin_serial_resource[] = {
88 CONFIG_UART0_CTS_PIN, 89 CONFIG_UART0_CTS_PIN,
89 CONFIG_UART0_RTS_PIN, 90 CONFIG_UART0_RTS_PIN,
90#endif 91#endif
92 }
91}; 93};
92 94
93 95
diff --git a/include/asm-blackfin/mach-bf533/dma.h b/include/asm-blackfin/mach-bf533/dma.h
index bd9d5e94307d..16c672c01d80 100644
--- a/include/asm-blackfin/mach-bf533/dma.h
+++ b/include/asm-blackfin/mach-bf533/dma.h
@@ -51,4 +51,7 @@
51#define CH_MEM_STREAM1_DEST 10 /* TX */ 51#define CH_MEM_STREAM1_DEST 10 /* TX */
52#define CH_MEM_STREAM1_SRC 11 /* RX */ 52#define CH_MEM_STREAM1_SRC 11 /* RX */
53 53
54extern int channel2irq(unsigned int channel);
55extern struct dma_register *base_addr[];
56
54#endif 57#endif
diff --git a/include/asm-blackfin/mach-bf533/portmux.h b/include/asm-blackfin/mach-bf533/portmux.h
new file mode 100644
index 000000000000..b88d7a03ee3e
--- /dev/null
+++ b/include/asm-blackfin/mach-bf533/portmux.h
@@ -0,0 +1,65 @@
1#ifndef _MACH_PORTMUX_H_
2#define _MACH_PORTMUX_H_
3
4#define P_PPI0_CLK (P_DONTCARE)
5#define P_PPI0_FS1 (P_DONTCARE)
6#define P_PPI0_FS2 (P_DONTCARE)
7#define P_PPI0_FS3 (P_DEFINED | P_IDENT(GPIO_PF3))
8#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PF4))
9#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PF5))
10#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PF6))
11#define P_PPI0_D12 (P_DEFINED | P_IDENT(GPIO_PF7))
12#define P_PPI0_D11 (P_DEFINED | P_IDENT(GPIO_PF8))
13#define P_PPI0_D10 (P_DEFINED | P_IDENT(GPIO_PF9))
14#define P_PPI0_D9 (P_DEFINED | P_IDENT(GPIO_PF10))
15#define P_PPI0_D8 (P_DEFINED | P_IDENT(GPIO_PF11))
16#define P_PPI0_D0 (P_DONTCARE)
17#define P_PPI0_D1 (P_DONTCARE)
18#define P_PPI0_D2 (P_DONTCARE)
19#define P_PPI0_D3 (P_DONTCARE)
20#define P_PPI0_D4 (P_DEFINED | P_IDENT(GPIO_PF15))
21#define P_PPI0_D5 (P_DEFINED | P_IDENT(GPIO_PF14))
22#define P_PPI0_D6 (P_DEFINED | P_IDENT(GPIO_PF13))
23#define P_PPI0_D7 (P_DEFINED | P_IDENT(GPIO_PF12))
24
25#define P_SPORT1_TSCLK (P_DONTCARE)
26#define P_SPORT1_RSCLK (P_DONTCARE)
27#define P_SPORT0_TSCLK (P_DONTCARE)
28#define P_SPORT0_RSCLK (P_DONTCARE)
29#define P_UART0_RX (P_DONTCARE)
30#define P_UART0_TX (P_DONTCARE)
31#define P_SPORT1_DRSEC (P_DONTCARE)
32#define P_SPORT1_RFS (P_DONTCARE)
33#define P_SPORT1_DTPRI (P_DONTCARE)
34#define P_SPORT1_DTSEC (P_DONTCARE)
35#define P_SPORT1_TFS (P_DONTCARE)
36#define P_SPORT1_DRPRI (P_DONTCARE)
37#define P_SPORT0_DRSEC (P_DONTCARE)
38#define P_SPORT0_RFS (P_DONTCARE)
39#define P_SPORT0_DTPRI (P_DONTCARE)
40#define P_SPORT0_DTSEC (P_DONTCARE)
41#define P_SPORT0_TFS (P_DONTCARE)
42#define P_SPORT0_DRPRI (P_DONTCARE)
43
44#define P_SPI0_MOSI (P_DONTCARE)
45#define P_SPI0_MIS0 (P_DONTCARE)
46#define P_SPI0_SCK (P_DONTCARE)
47#define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(GPIO_PF7))
48#define P_SPI0_SSEL6 (P_DEFINED | P_IDENT(GPIO_PF6))
49#define P_SPI0_SSEL5 (P_DEFINED | P_IDENT(GPIO_PF5))
50#define P_SPI0_SSEL4 (P_DEFINED | P_IDENT(GPIO_PF4))
51#define P_SPI0_SSEL3 (P_DEFINED | P_IDENT(GPIO_PF3))
52#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF2))
53#define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF1))
54#define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF0))
55
56#define P_TMR2 (P_DONTCARE)
57#define P_TMR1 (P_DONTCARE)
58#define P_TMR0 (P_DONTCARE)
59#define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF1))
60
61
62
63
64
65#endif /* _MACH_PORTMUX_H_ */
diff --git a/include/asm-blackfin/mach-bf537/anomaly.h b/include/asm-blackfin/mach-bf537/anomaly.h
index 7f040f5ba018..4453e614c3b1 100644
--- a/include/asm-blackfin/mach-bf537/anomaly.h
+++ b/include/asm-blackfin/mach-bf537/anomaly.h
@@ -73,8 +73,13 @@
73 control */ 73 control */
74#define ANOMALY_05000283 /* A system MMR write is stalled indefinitely when 74#define ANOMALY_05000283 /* A system MMR write is stalled indefinitely when
75 killed in a particular stage*/ 75 killed in a particular stage*/
76#define ANOMALY_05000310 /* False hardware errors caused by fetches at the
77 * boundary of reserved memory */
76#define ANOMALY_05000312 /* Errors when SSYNC, CSYNC, or loads to LT, LB and LC 78#define ANOMALY_05000312 /* Errors when SSYNC, CSYNC, or loads to LT, LB and LC
77 registers are interrupted */ 79 registers are interrupted */
80#define ANOMALY_05000313 /* PPI is level sensitive on first transfer */
81#define ANOMALY_05000322 /* EMAC RMII mode at 10-Base-T speed: RX frames not
82 * received properly */
78#endif 83#endif
79 84
80#if defined(CONFIG_BF_REV_0_2) 85#if defined(CONFIG_BF_REV_0_2)
@@ -114,7 +119,21 @@
114 DMA system instability */ 119 DMA system instability */
115#define ANOMALY_05000280 /* SPI Master boot mode does not work well with 120#define ANOMALY_05000280 /* SPI Master boot mode does not work well with
116 Atmel Dataflash devices */ 121 Atmel Dataflash devices */
117 122#define ANOMALY_05000281 /* False Hardware Error Exception when ISR context
123 * is not restored */
124#define ANOMALY_05000282 /* Memory DMA corruption with 32-bit data and traffic
125 * control */
126#define ANOMALY_05000283 /* System MMR Write Is Stalled Indefinitely When
127 * Killed in a Particular Stage */
128#define ANOMALY_05000285 /* New Feature: EMAC TX DMA Word Alignment
129 * (Not Available On Older Silicon) */
130#define ANOMALY_05000288 /* SPORTs may receive bad data if FIFOs fill up */
131#define ANOMALY_05000315 /* Killed System MMR Write Completes Erroneously
132 * On Next System MMR Access */
133#define ANOMALY_05000316 /* EMAC RMII mode: collisions occur in Full Duplex
134 * mode */
135#define ANOMALY_05000321 /* EMAC RMII mode: TX frames in half duplex fail with
136 * status No Carrier */
118#endif /* CONFIG_BF_REV_0_2 */ 137#endif /* CONFIG_BF_REV_0_2 */
119 138
120#endif /* _MACH_ANOMALY_H_ */ 139#endif /* _MACH_ANOMALY_H_ */
diff --git a/include/asm-blackfin/mach-bf537/dma.h b/include/asm-blackfin/mach-bf537/dma.h
index 7a964040870a..021991984e6e 100644
--- a/include/asm-blackfin/mach-bf537/dma.h
+++ b/include/asm-blackfin/mach-bf537/dma.h
@@ -52,4 +52,7 @@
52#define CH_MEM_STREAM1_DEST 14 /* TX */ 52#define CH_MEM_STREAM1_DEST 14 /* TX */
53#define CH_MEM_STREAM1_SRC 15 /* RX */ 53#define CH_MEM_STREAM1_SRC 15 /* RX */
54 54
55extern int channel2irq(unsigned int channel);
56extern struct dma_register *base_addr[];
57
55#endif 58#endif
diff --git a/include/asm-blackfin/mach-bf537/portmux.h b/include/asm-blackfin/mach-bf537/portmux.h
new file mode 100644
index 000000000000..23e13c5abc4d
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/portmux.h
@@ -0,0 +1,109 @@
1#ifndef _MACH_PORTMUX_H_
2#define _MACH_PORTMUX_H_
3
4#define P_UART0_TX (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(0))
5#define P_UART0_RX (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(0))
6#define P_UART1_TX (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(0))
7#define P_UART1_RX (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(0))
8#define P_TMR5 (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(0))
9#define P_TMR4 (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(0))
10#define P_TMR3 (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(0))
11#define P_TMR2 (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(0))
12#define P_TMR1 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(0))
13#define P_TMR0 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(0))
14#define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(0))
15#define P_SPI0_MOSI (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(0))
16#define P_SPI0_MISO (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(0))
17#define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(0))
18#define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(0))
19#define P_PPI0_CLK (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(0))
20#define P_DMAR0 (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(1))
21#define P_DMAR1 (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(1))
22#define P_TMR7 (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(1))
23#define P_TMR6 (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(1))
24#define P_SPI0_SSEL6 (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(1))
25#define P_SPI0_SSEL5 (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(1))
26#define P_SPI0_SSEL4 (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(1))
27#define P_PPI0_FS3 (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(1))
28#define P_PPI0_FS2 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(1))
29#define P_PPI0_FS1 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1))
30#define P_TACLK0 (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1))
31#define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1))
32
33#define P_PPI0_D0 (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0))
34#define P_PPI0_D1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
35#define P_PPI0_D2 (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(0))
36#define P_PPI0_D3 (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(0))
37#define P_PPI0_D4 (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(0))
38#define P_PPI0_D5 (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(0))
39#define P_PPI0_D6 (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(0))
40#define P_PPI0_D7 (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(0))
41#define P_PPI0_D8 (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(0))
42#define P_PPI0_D9 (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(0))
43#define P_PPI0_D10 (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(0))
44#define P_PPI0_D11 (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(0))
45#define P_PPI0_D12 (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(0))
46#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(0))
47#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(0))
48#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(0))
49#define P_SPORT1_DRSEC (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(1))
50#define P_SPORT1_DTSEC (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(1))
51#define P_SPORT1_RSCLK (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(1))
52#define P_SPORT1_RFS (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(1))
53#define P_SPORT1_DRPRI (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(1))
54#define P_SPORT1_TSCLK (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(1))
55#define P_SPORT1_TFS (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(1))
56#define P_SPORT1_DTPRI (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(1))
57
58#define P_MII0_ETxD0 (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(0))
59#define P_MII0_ETxD1 (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(0))
60#define P_MII0_ETxD2 (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(0))
61#define P_MII0_ETxD3 (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(0))
62#define P_MII0_ETxEN (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(0))
63#define P_MII0_TxCLK (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(0))
64#define P_MII0_PHYINT (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(0))
65#define P_MII0_COL (P_DEFINED | P_IDENT(GPIO_PH7) | P_FUNCT(0))
66#define P_MII0_ERxD0 (P_DEFINED | P_IDENT(GPIO_PH8) | P_FUNCT(0))
67#define P_MII0_ERxD1 (P_DEFINED | P_IDENT(GPIO_PH9) | P_FUNCT(0))
68#define P_MII0_ERxD2 (P_DEFINED | P_IDENT(GPIO_PH10) | P_FUNCT(0))
69#define P_MII0_ERxD3 (P_DEFINED | P_IDENT(GPIO_PH11) | P_FUNCT(0))
70#define P_MII0_ERxDV (P_DEFINED | P_IDENT(GPIO_PH12) | P_FUNCT(0))
71#define P_MII0_ERxCLK (P_DEFINED | P_IDENT(GPIO_PH13) | P_FUNCT(0))
72#define P_MII0_ERxER (P_DEFINED | P_IDENT(GPIO_PH14) | P_FUNCT(0))
73#define P_MII0_CRS (P_DEFINED | P_IDENT(GPIO_PH15) | P_FUNCT(0))
74#define P_RMII0_REF_CLK (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(1))
75#define P_RMII0_MDINT (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(1))
76#define P_RMII0_CRS_DV (P_DEFINED | P_IDENT(GPIO_PH15) | P_FUNCT(1))
77
78#define PORT_PJ0 (GPIO_PH15 + 1)
79#define PORT_PJ1 (GPIO_PH15 + 2)
80#define PORT_PJ2 (GPIO_PH15 + 3)
81#define PORT_PJ3 (GPIO_PH15 + 4)
82#define PORT_PJ4 (GPIO_PH15 + 5)
83#define PORT_PJ5 (GPIO_PH15 + 6)
84#define PORT_PJ6 (GPIO_PH15 + 7)
85#define PORT_PJ7 (GPIO_PH15 + 8)
86#define PORT_PJ8 (GPIO_PH15 + 9)
87#define PORT_PJ9 (GPIO_PH15 + 10)
88#define PORT_PJ10 (GPIO_PH15 + 11)
89#define PORT_PJ11 (GPIO_PH15 + 12)
90
91#define P_MDC (P_DEFINED | P_IDENT(PORT_PJ0) | P_FUNCT(0))
92#define P_MDIO (P_DEFINED | P_IDENT(PORT_PJ1) | P_FUNCT(0))
93#define P_TWI0_SCL (P_DEFINED | P_IDENT(PORT_PJ2) | P_FUNCT(0))
94#define P_TWI0_SDA (P_DEFINED | P_IDENT(PORT_PJ3) | P_FUNCT(0))
95#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(PORT_PJ4) | P_FUNCT(0))
96#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(0))
97#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(PORT_PJ6) | P_FUNCT(0))
98#define P_SPORT0_RFS (P_DEFINED | P_IDENT(PORT_PJ7) | P_FUNCT(0))
99#define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(PORT_PJ8) | P_FUNCT(0))
100#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(PORT_PJ9) | P_FUNCT(0))
101#define P_SPORT0_TFS (P_DEFINED | P_IDENT(PORT_PJ10) | P_FUNCT(0))
102#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1))
103#define P_CAN0_RX (P_DEFINED | P_IDENT(PORT_PJ4) | P_FUNCT(1))
104#define P_CAN0_TX (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(1))
105#define P_SPI0_SSEL3 (P_DEFINED | P_IDENT(PORT_PJ10) | P_FUNCT(1))
106#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1))
107#define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(2))
108
109#endif /* _MACH_PORTMUX_H_ */
diff --git a/include/asm-blackfin/mach-bf548/anomaly.h b/include/asm-blackfin/mach-bf548/anomaly.h
new file mode 100644
index 000000000000..aca1d4ba145c
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/anomaly.h
@@ -0,0 +1,74 @@
1
2/*
3 * File: include/asm-blackfin/mach-bf548/anomaly.h
4 * Based on:
5 * Author:
6 *
7 * Created:
8 * Description:
9 *
10 * Rev:
11 *
12 * Modified:
13 *
14 *
15 * Bugs: Enter bugs at http://blackfin.uclinux.org/
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2, or (at your option)
20 * 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; see the file COPYING.
29 * If not, write to the Free Software Foundation,
30 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 */
32
33#ifndef _MACH_ANOMALY_H_
34#define _MACH_ANOMALY_H_
35#define ANOMALY_05000074 /* A multi issue instruction with dsp32shiftimm in
36 slot1 and store of a P register in slot 2 is not
37 supported */
38#define ANOMALY_05000119 /* DMA_RUN bit is not valid after a Peripheral Receive
39 Channel DMA stops */
40#define ANOMALY_05000122 /* Rx.H can not be used to access 16-bit System MMR
41 registers. */
42#define ANOMALY_05000245 /* Spurious Hardware Error from an Access in the
43 Shadow of a Conditional Branch */
44#define ANOMALY_05000255 /* Entering Hibernate Mode with RTC Seconds event
45 interrupt not functional */
46#define ANOMALY_05000265 /* Sensitivity to noise with slow input edge rates on
47 SPORT external receive and transmit clocks. */
48#define ANOMALY_05000272 /* Certain data cache write through modes fail for
49 VDDint <=0.9V */
50#define ANOMALY_05000281 /* False Hardware Error Exception when ISR context is
51 not restored */
52#define ANOMALY_05000310 /* False Hardware Errors Caused by Fetches at the
53 Boundary of Reserved Memory */
54#define ANOMALY_05000312 /* Errors When SSYNC, CSYNC, or Loads to LT, LB and
55 LC Registers Are Interrupted */
56#define ANOMALY_05000324 /* TWI Slave Boot Mode Is Not Functional */
57#define ANOMALY_05000325 /* External FIFO Boot Mode Is Not Functional */
58#define ANOMALY_05000327 /* Data Lost When Core and DMA Accesses Are Made to
59 the USB FIFO Simultaneously */
60#define ANOMALY_05000328 /* Incorrect Access of OTP_STATUS During otp_write()
61 function */
62#define ANOMALY_05000329 /* Synchronous Burst Flash Boot Mode Is Not Functional
63 */
64#define ANOMALY_05000330 /* Host DMA Boot Mode Is Not Functional */
65#define ANOMALY_05000334 /* Inadequate Timing Margins on DDR DQS to DQ and DQM
66 Skew */
67#define ANOMALY_05000335 /* Inadequate Rotary Debounce Logic Duration */
68#define ANOMALY_05000336 /* Phantom Interrupt Occurs After First Configuration
69 of Host DMA Port */
70#define ANOMALY_05000337 /* Disallowed Configuration Prevents Subsequent
71 Allowed Configuration on Host DMA Port */
72#define ANOMALY_05000338 /* Slave-Mode SPI0 MISO Failure With CPHA = 0 */
73
74#endif /* _MACH_ANOMALY_H_ */
diff --git a/include/asm-blackfin/mach-bf548/bf548.h b/include/asm-blackfin/mach-bf548/bf548.h
new file mode 100644
index 000000000000..9498313a2cb7
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/bf548.h
@@ -0,0 +1,271 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/bf548.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: System MMR register and memory map for ADSP-BF548
8 *
9 * Modified:
10 * Copyright 2004-2007 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#ifndef __MACH_BF548_H__
31#define __MACH_BF548_H__
32
33#define SUPPORTED_REVID 0
34
35#define OFFSET_(x) ((x) & 0x0000FFFF)
36
37/*some misc defines*/
38#define IMASK_IVG15 0x8000
39#define IMASK_IVG14 0x4000
40#define IMASK_IVG13 0x2000
41#define IMASK_IVG12 0x1000
42
43#define IMASK_IVG11 0x0800
44#define IMASK_IVG10 0x0400
45#define IMASK_IVG9 0x0200
46#define IMASK_IVG8 0x0100
47
48#define IMASK_IVG7 0x0080
49#define IMASK_IVGTMR 0x0040
50#define IMASK_IVGHW 0x0020
51
52/***************************/
53
54
55#define BLKFIN_DSUBBANKS 4
56#define BLKFIN_DWAYS 2
57#define BLKFIN_DLINES 64
58#define BLKFIN_ISUBBANKS 4
59#define BLKFIN_IWAYS 4
60#define BLKFIN_ILINES 32
61
62#define WAY0_L 0x1
63#define WAY1_L 0x2
64#define WAY01_L 0x3
65#define WAY2_L 0x4
66#define WAY02_L 0x5
67#define WAY12_L 0x6
68#define WAY012_L 0x7
69
70#define WAY3_L 0x8
71#define WAY03_L 0x9
72#define WAY13_L 0xA
73#define WAY013_L 0xB
74
75#define WAY32_L 0xC
76#define WAY320_L 0xD
77#define WAY321_L 0xE
78#define WAYALL_L 0xF
79
80#define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
81
82/********************************* EBIU Settings ************************************/
83#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
84#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
85
86#ifdef CONFIG_C_AMBEN_ALL
87#define V_AMBEN AMBEN_ALL
88#endif
89#ifdef CONFIG_C_AMBEN
90#define V_AMBEN 0x0
91#endif
92#ifdef CONFIG_C_AMBEN_B0
93#define V_AMBEN AMBEN_B0
94#endif
95#ifdef CONFIG_C_AMBEN_B0_B1
96#define V_AMBEN AMBEN_B0_B1
97#endif
98#ifdef CONFIG_C_AMBEN_B0_B1_B2
99#define V_AMBEN AMBEN_B0_B1_B2
100#endif
101#ifdef CONFIG_C_AMCKEN
102#define V_AMCKEN AMCKEN
103#else
104#define V_AMCKEN 0x0
105#endif
106
107#define AMGCTLVAL (V_AMBEN | V_AMCKEN)
108
109#define MAX_VC 650000000
110#define MIN_VC 50000000
111
112/********************************PLL Settings **************************************/
113#ifdef CONFIG_BFIN_KERNEL_CLOCK
114#if (CONFIG_VCO_MULT < 0)
115#error "VCO Multiplier is less than 0. Please select a different value"
116#endif
117
118#if (CONFIG_VCO_MULT == 0)
119#error "VCO Multiplier should be greater than 0. Please select a different value"
120#endif
121
122#if (CONFIG_VCO_MULT > 64)
123#error "VCO Multiplier is more than 64. Please select a different value"
124#endif
125
126#ifndef CONFIG_CLKIN_HALF
127#define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
128#else
129#define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)/2)
130#endif
131
132#ifndef CONFIG_PLL_BYPASS
133#define CONFIG_CCLK_HZ (CONFIG_VCO_HZ/CONFIG_CCLK_DIV)
134#define CONFIG_SCLK_HZ (CONFIG_VCO_HZ/CONFIG_SCLK_DIV)
135#else
136#define CONFIG_CCLK_HZ CONFIG_CLKIN_HZ
137#define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
138#endif
139
140#if (CONFIG_SCLK_DIV < 1)
141#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
142#endif
143
144#if (CONFIG_SCLK_DIV > 15)
145#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
146#endif
147
148#if (CONFIG_CCLK_DIV != 1)
149#if (CONFIG_CCLK_DIV != 2)
150#if (CONFIG_CCLK_DIV != 4)
151#if (CONFIG_CCLK_DIV != 8)
152#error "CCLK DIV can be 1,2,4 or 8 only. Please select a proper value"
153#endif
154#endif
155#endif
156#endif
157
158#if (CONFIG_VCO_HZ > MAX_VC)
159#error "VCO selected is more than maximum value. Please change the VCO multipler"
160#endif
161
162#if (CONFIG_SCLK_HZ > 133000000)
163#error "Sclk value selected is more than maximum. Please select a proper value for SCLK multiplier"
164#endif
165
166#if (CONFIG_SCLK_HZ < 27000000)
167#error "Sclk value selected is less than minimum. Please select a proper value for SCLK multiplier"
168#endif
169
170#if (CONFIG_SCLK_HZ >= CONFIG_CCLK_HZ)
171#if (CONFIG_SCLK_HZ != CONFIG_CLKIN_HZ)
172#if (CONFIG_CCLK_HZ != CONFIG_CLKIN_HZ)
173#error "Please select sclk less than cclk"
174#endif
175#endif
176#endif
177
178#if (CONFIG_CCLK_DIV == 1)
179#define CONFIG_CCLK_ACT_DIV CCLK_DIV1
180#endif
181#if (CONFIG_CCLK_DIV == 2)
182#define CONFIG_CCLK_ACT_DIV CCLK_DIV2
183#endif
184#if (CONFIG_CCLK_DIV == 4)
185#define CONFIG_CCLK_ACT_DIV CCLK_DIV4
186#endif
187#if (CONFIG_CCLK_DIV == 8)
188#define CONFIG_CCLK_ACT_DIV CCLK_DIV8
189#endif
190#ifndef CONFIG_CCLK_ACT_DIV
191#define CONFIG_CCLK_ACT_DIV CONFIG_CCLK_DIV_not_defined_properly
192#endif
193
194#endif /* CONFIG_BFIN_KERNEL_CLOCK */
195
196#ifdef CONFIG_BF542
197#define CPU "BF542"
198#define CPUID 0x027c8000
199#endif
200#ifdef CONFIG_BF544
201#define CPU "BF544"
202#define CPUID 0x027c8000
203#endif
204#ifdef CONFIG_BF548
205#define CPU "BF548"
206#define CPUID 0x027c6000
207#endif
208#ifdef CONFIG_BF549
209#define CPU "BF549"
210#endif
211#ifndef CPU
212#define CPU "UNKNOWN"
213#define CPUID 0x0
214#endif
215
216#if (CONFIG_MEM_SIZE % 4)
217#error "SDRAM mem size must be multible of 4MB"
218#endif
219
220#define SDRAM_IGENERIC (CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID | CPLB_PORTPRIO)
221#define SDRAM_IKERNEL (SDRAM_IGENERIC | CPLB_LOCK)
222#define L1_IMEMORY ( CPLB_USER_RD | CPLB_VALID | CPLB_LOCK)
223#define SDRAM_INON_CHBL ( CPLB_USER_RD | CPLB_VALID)
224
225/*Use the menuconfig cache policy here - CONFIG_BLKFIN_WT/CONFIG_BLKFIN_WB*/
226
227#define ANOMALY_05000158_WORKAROUND 0x200
228#ifdef CONFIG_BLKFIN_WB /*Write Back Policy */
229#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_DIRTY \
230 | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
231#else /*Write Through */
232#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW \
233 | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY )
234#endif
235
236
237#define L1_DMEMORY (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY )
238#define SDRAM_DNON_CHBL (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY )
239#define SDRAM_EBIU (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY )
240#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY )
241
242#define SIZE_1K 0x00000400 /* 1K */
243#define SIZE_4K 0x00001000 /* 4K */
244#define SIZE_1M 0x00100000 /* 1M */
245#define SIZE_4M 0x00400000 /* 4M */
246
247#define MAX_CPLBS (16 * 2)
248
249/*
250* Number of required data CPLB switchtable entries
251* MEMSIZE / 4 (we mostly install 4M page size CPLBs
252* approx 16 for smaller 1MB page size CPLBs for allignment purposes
253* 1 for L1 Data Memory
254* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
255* 1 for ASYNC Memory
256*/
257
258
259#define MAX_SWITCH_D_CPLBS (((CONFIG_MEM_SIZE / 4) + 16 + 1 + 1 + 1) * 2)
260
261/*
262* Number of required instruction CPLB switchtable entries
263* MEMSIZE / 4 (we mostly install 4M page size CPLBs
264* approx 12 for smaller 1MB page size CPLBs for allignment purposes
265* 1 for L1 Instruction Memory
266* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
267*/
268
269#define MAX_SWITCH_I_CPLBS (((CONFIG_MEM_SIZE / 4) + 12 + 1 + 1) * 2)
270
271#endif /* __MACH_BF48_H__ */
diff --git a/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h
new file mode 100644
index 000000000000..2f4afc90db11
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h
@@ -0,0 +1,193 @@
1#include <linux/serial.h>
2#include <asm/dma.h>
3
4#define NR_PORTS 4
5
6#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
7#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
8#define OFFSET_GCTL 0x08 /* Global Control Register */
9#define OFFSET_LCR 0x0C /* Line Control Register */
10#define OFFSET_MCR 0x10 /* Modem Control Register */
11#define OFFSET_LSR 0x14 /* Line Status Register */
12#define OFFSET_MSR 0x18 /* Modem Status Register */
13#define OFFSET_SCR 0x1C /* SCR Scratch Register */
14#define OFFSET_IER_SET 0x20 /* Set Interrupt Enable Register */
15#define OFFSET_IER_CLEAR 0x24 /* Clear Interrupt Enable Register */
16#define OFFSET_THR 0x28 /* Transmit Holding register */
17#define OFFSET_RBR 0x2C /* Receive Buffer register */
18
19#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
20#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
21#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
22#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER_SET))
23#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
24#define UART_GET_LSR(uart) bfin_read16(((uart)->port.membase + OFFSET_LSR))
25#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
26
27#define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v)
28#define UART_PUT_DLL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLL),v)
29#define UART_SET_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER_SET),v)
30#define UART_CLEAR_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER_CLEAR),v)
31#define UART_PUT_DLH(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLH),v)
32#define UART_PUT_LSR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LSR),v)
33#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
34#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
35
36#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
37# define CONFIG_SERIAL_BFIN_CTSRTS
38
39# ifndef CONFIG_UART0_CTS_PIN
40# define CONFIG_UART0_CTS_PIN -1
41# endif
42
43# ifndef CONFIG_UART0_RTS_PIN
44# define CONFIG_UART0_RTS_PIN -1
45# endif
46
47# ifndef CONFIG_UART1_CTS_PIN
48# define CONFIG_UART1_CTS_PIN -1
49# endif
50
51# ifndef CONFIG_UART1_RTS_PIN
52# define CONFIG_UART1_RTS_PIN -1
53# endif
54#endif
55/*
56 * The pin configuration is different from schematic
57 */
58struct bfin_serial_port {
59 struct uart_port port;
60 unsigned int old_status;
61#ifdef CONFIG_SERIAL_BFIN_DMA
62 int tx_done;
63 int tx_count;
64 struct circ_buf rx_dma_buf;
65 struct timer_list rx_dma_timer;
66 int rx_dma_nrows;
67 unsigned int tx_dma_channel;
68 unsigned int rx_dma_channel;
69 struct work_struct tx_dma_workqueue;
70#else
71 struct work_struct cts_workqueue;
72#endif
73#ifdef CONFIG_SERIAL_BFIN_CTSRTS
74 int cts_pin;
75 int rts_pin;
76#endif
77};
78
79struct bfin_serial_port bfin_serial_ports[NR_PORTS];
80struct bfin_serial_res {
81 unsigned long uart_base_addr;
82 int uart_irq;
83#ifdef CONFIG_SERIAL_BFIN_DMA
84 unsigned int uart_tx_dma_channel;
85 unsigned int uart_rx_dma_channel;
86#endif
87#ifdef CONFIG_SERIAL_BFIN_CTSRTS
88 int uart_cts_pin;
89 int uart_rts_pin;
90#endif
91};
92
93struct bfin_serial_res bfin_serial_resource[] = {
94#ifdef CONFIG_SERIAL_BFIN_UART0
95 {
96 0xFFC00400,
97 IRQ_UART0_RX,
98#ifdef CONFIG_SERIAL_BFIN_DMA
99 CH_UART0_TX,
100 CH_UART0_RX,
101#endif
102#ifdef CONFIG_BFIN_UART0_CTSRTS
103 CONFIG_UART0_CTS_PIN,
104 CONFIG_UART0_RTS_PIN,
105#endif
106 },
107#endif
108#ifdef CONFIG_SERIAL_BFIN_UART1
109 {
110 0xFFC02000,
111 IRQ_UART1_RX,
112#ifdef CONFIG_SERIAL_BFIN_DMA
113 CH_UART1_TX,
114 CH_UART1_RX,
115#endif
116 },
117#endif
118#ifdef CONFIG_SERIAL_BFIN_UART2
119 {
120 0xFFC02100,
121 IRQ_UART2_RX,
122#ifdef CONFIG_SERIAL_BFIN_DMA
123 CH_UART2_TX,
124 CH_UART2_RX,
125#endif
126#ifdef CONFIG_BFIN_UART2_CTSRTS
127 CONFIG_UART2_CTS_PIN,
128 CONFIG_UART2_RTS_PIN,
129#endif
130 },
131#endif
132#ifdef CONFIG_SERIAL_BFIN_UART3
133 {
134 0xFFC03100,
135 IRQ_UART3_RX,
136#ifdef CONFIG_SERIAL_BFIN_DMA
137 CH_UART3_TX,
138 CH_UART3_RX,
139#endif
140 },
141#endif
142};
143
144int nr_ports = ARRAY_SIZE(bfin_serial_resource);
145
146static void bfin_serial_hw_init(struct bfin_serial_port *uart)
147{
148#ifdef CONFIG_SERIAL_BFIN_UART0
149 /* Enable UART0 RX and TX on pin 7 & 8 of PORT E */
150 bfin_write_PORTE_FER(0x180 | bfin_read_PORTE_FER());
151 bfin_write_PORTE_MUX(0x3C000 | bfin_read_PORTE_MUX());
152#endif
153
154#ifdef CONFIG_SERIAL_BFIN_UART1
155 /* Enable UART1 RX and TX on pin 0 & 1 of PORT H */
156 bfin_write_PORTH_FER(0x3 | bfin_read_PORTH_FER());
157 bfin_write_PORTH_MUX(~0xF & bfin_read_PORTH_MUX());
158#ifdef CONFIG_BFIN_UART1_CTSRTS
159 /* Enable UART1 RTS and CTS on pin 9 & 10 of PORT E */
160 bfin_write_PORTE_FER(0x600 | bfin_read_PORTE_FER());
161 bfin_write_PORTE_MUX(~0x3C0000 & bfin_read_PORTE_MUX());
162#endif
163#endif
164
165#ifdef CONFIG_SERIAL_BFIN_UART2
166 /* Enable UART2 RX and TX on pin 4 & 5 of PORT B */
167 bfin_write_PORTB_FER(0x30 | bfin_read_PORTB_FER());
168 bfin_write_PORTB_MUX(~0xF00 & bfin_read_PORTB_MUX());
169#endif
170
171#ifdef CONFIG_SERIAL_BFIN_UART3
172 /* Enable UART3 RX and TX on pin 6 & 7 of PORT B */
173 bfin_write_PORTB_FER(0xC0 | bfin_read_PORTB_FER());
174 bfin_write_PORTB_MUX(~0xF000 | bfin_read_PORTB_MUX());
175#ifdef CONFIG_BFIN_UART3_CTSRTS
176 /* Enable UART3 RTS and CTS on pin 2 & 3 of PORT B */
177 bfin_write_PORTB_FER(0xC | bfin_read_PORTB_FER());
178 bfin_write_PORTB_MUX(~0xF0 | bfin_read_PORTB_MUX());
179#endif
180#endif
181 SSYNC();
182#ifdef CONFIG_SERIAL_BFIN_CTSRTS
183 if (uart->cts_pin >= 0) {
184 gpio_request(uart->cts_pin, NULL);
185 gpio_direction_input(uart->cts_pin);
186 }
187
188 if (uart->rts_pin >= 0) {
189 gpio_request(uart->rts_pin, NULL);
190 gpio_direction_output(uart->rts_pin);
191 }
192#endif
193}
diff --git a/include/asm-blackfin/mach-bf548/blackfin.h b/include/asm-blackfin/mach-bf548/blackfin.h
new file mode 100644
index 000000000000..791218fe7d94
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/blackfin.h
@@ -0,0 +1,168 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/blackfin.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * 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; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _MACH_BLACKFIN_H_
33#define _MACH_BLACKFIN_H_
34
35#define BF548_FAMILY
36
37#include "bf548.h"
38#include "mem_map.h"
39#include "anomaly.h"
40
41#ifdef CONFIG_BF542
42#include "defBF542.h"
43#endif
44
45#ifdef CONFIG_BF544
46#include "defBF544.h"
47#endif
48
49#ifdef CONFIG_BF548
50#include "defBF548.h"
51#endif
52
53#ifdef CONFIG_BF549
54#include "defBF549.h"
55#endif
56
57#if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
58#ifdef CONFIG_BF542
59#include "cdefBF542.h"
60#endif
61
62#ifdef CONFIG_BF544
63#include "cdefBF544.h"
64#endif
65#ifdef CONFIG_BF548
66#include "cdefBF548.h"
67#endif
68#ifdef CONFIG_BF549
69#include "cdefBF549.h"
70#endif
71
72/* UART 1*/
73#define bfin_read_UART_THR() bfin_read_UART1_THR()
74#define bfin_write_UART_THR(val) bfin_write_UART1_THR(val)
75#define bfin_read_UART_RBR() bfin_read_UART1_RBR()
76#define bfin_write_UART_RBR(val) bfin_write_UART1_RBR(val)
77#define bfin_read_UART_DLL() bfin_read_UART1_DLL()
78#define bfin_write_UART_DLL(val) bfin_write_UART1_DLL(val)
79#define bfin_read_UART_IER() bfin_read_UART1_IER()
80#define bfin_write_UART_IER(val) bfin_write_UART1_IER(val)
81#define bfin_read_UART_DLH() bfin_read_UART1_DLH()
82#define bfin_write_UART_DLH(val) bfin_write_UART1_DLH(val)
83#define bfin_read_UART_IIR() bfin_read_UART1_IIR()
84#define bfin_write_UART_IIR(val) bfin_write_UART1_IIR(val)
85#define bfin_read_UART_LCR() bfin_read_UART1_LCR()
86#define bfin_write_UART_LCR(val) bfin_write_UART1_LCR(val)
87#define bfin_read_UART_MCR() bfin_read_UART1_MCR()
88#define bfin_write_UART_MCR(val) bfin_write_UART1_MCR(val)
89#define bfin_read_UART_LSR() bfin_read_UART1_LSR()
90#define bfin_write_UART_LSR(val) bfin_write_UART1_LSR(val)
91#define bfin_read_UART_SCR() bfin_read_UART1_SCR()
92#define bfin_write_UART_SCR(val) bfin_write_UART1_SCR(val)
93#define bfin_read_UART_GCTL() bfin_read_UART1_GCTL()
94#define bfin_write_UART_GCTL(val) bfin_write_UART1_GCTL(val)
95
96#endif
97
98/* MAP used DEFINES from BF533 to BF54x - so we don't need to change
99 * them in the driver, kernel, etc. */
100
101/* UART_IIR Register */
102#define STATUS(x) ((x << 1) & 0x06)
103#define STATUS_P1 0x02
104#define STATUS_P0 0x01
105
106/* UART 0*/
107
108/* DMA Channnel */
109#define bfin_read_CH_UART_RX() bfin_read_CH_UART1_RX()
110#define bfin_write_CH_UART_RX(val) bfin_write_CH_UART1_RX(val)
111#define bfin_read_CH_UART_TX() bfin_read_CH_UART1_TX()
112#define bfin_write_CH_UART_TX(val) bfin_write_CH_UART1_TX(val)
113#define CH_UART_RX CH_UART1_RX
114#define CH_UART_TX CH_UART1_TX
115
116/* System Interrupt Controller */
117#define bfin_read_IRQ_UART_RX() bfin_read_IRQ_UART1_RX()
118#define bfin_write_IRQ_UART_RX(val) bfin_write_IRQ_UART1_RX(val)
119#define bfin_read_IRQ_UART_TX() bfin_read_IRQ_UART1_TX()
120#define bfin_write_IRQ_UART_TX(val) bfin_write_IRQ_UART1_TX(val)
121#define bfin_read_IRQ_UART_ERROR() bfin_read_IRQ_UART1_ERROR()
122#define bfin_write_IRQ_UART_ERROR(val) bfin_write_IRQ_UART1_ERROR(val)
123#define IRQ_UART_RX IRQ_UART1_RX
124#define IRQ_UART_TX IRQ_UART1_TX
125#define IRQ_UART_ERROR IRQ_UART1_ERROR
126
127/* MMR Registers*/
128#define bfin_read_UART_THR() bfin_read_UART1_THR()
129#define bfin_write_UART_THR(val) bfin_write_UART1_THR(val)
130#define bfin_read_UART_RBR() bfin_read_UART1_RBR()
131#define bfin_write_UART_RBR(val) bfin_write_UART1_RBR(val)
132#define bfin_read_UART_DLL() bfin_read_UART1_DLL()
133#define bfin_write_UART_DLL(val) bfin_write_UART1_DLL(val)
134#define bfin_read_UART_IER() bfin_read_UART1_IER()
135#define bfin_write_UART_IER(val) bfin_write_UART1_IER(val)
136#define bfin_read_UART_DLH() bfin_read_UART1_DLH()
137#define bfin_write_UART_DLH(val) bfin_write_UART1_DLH(val)
138#define bfin_read_UART_IIR() bfin_read_UART1_IIR()
139#define bfin_write_UART_IIR(val) bfin_write_UART1_IIR(val)
140#define bfin_read_UART_LCR() bfin_read_UART1_LCR()
141#define bfin_write_UART_LCR(val) bfin_write_UART1_LCR(val)
142#define bfin_read_UART_MCR() bfin_read_UART1_MCR()
143#define bfin_write_UART_MCR(val) bfin_write_UART1_MCR(val)
144#define bfin_read_UART_LSR() bfin_read_UART1_LSR()
145#define bfin_write_UART_LSR(val) bfin_write_UART1_LSR(val)
146#define bfin_read_UART_SCR() bfin_read_UART1_SCR()
147#define bfin_write_UART_SCR(val) bfin_write_UART1_SCR(val)
148#define bfin_read_UART_GCTL() bfin_read_UART1_GCTL()
149#define bfin_write_UART_GCTL(val) bfin_write_UART1_GCTL(val)
150#define UART_THR UART1_THR
151#define UART_RBR UART1_RBR
152#define UART_DLL UART1_DLL
153#define UART_IER UART1_IER
154#define UART_DLH UART1_DLH
155#define UART_IIR UART1_IIR
156#define UART_LCR UART1_LCR
157#define UART_MCR UART1_MCR
158#define UART_LSR UART1_LSR
159#define UART_SCR UART1_SCR
160#define UART_GCTL UART1_GCTL
161
162/* PLL_DIV Masks */
163#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
164#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
165#define CCLK_DIV4 CSEL_DIV4 /* CCLK = VCO / 4 */
166#define CCLK_DIV8 CSEL_DIV8 /* CCLK = VCO / 8 */
167
168#endif
diff --git a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
index 6bbcefeb3627..98d35a929116 100644
--- a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
+++ b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
@@ -31,7 +31,8 @@
31#ifndef _CDEF_BF54X_H 31#ifndef _CDEF_BF54X_H
32#define _CDEF_BF54X_H 32#define _CDEF_BF54X_H
33 33
34#include <defBF54x_base.h> 34#include "defBF54x_base.h"
35#include <asm/system.h>
35 36
36/* ************************************************************** */ 37/* ************************************************************** */
37/* SYSTEM & MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF54x */ 38/* SYSTEM & MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF54x */
@@ -44,7 +45,30 @@
44#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV) 45#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
45#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val) 46#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val)
46#define bfin_read_VR_CTL() bfin_read16(VR_CTL) 47#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
47#define bfin_write_VR_CTL(val) bfin_write16(VR_CTL, val) 48/* Writing to VR_CTL initiates a PLL relock sequence. */
49static __inline__ void bfin_write_VR_CTL(unsigned int val)
50{
51 unsigned long flags, iwr0, iwr1, iwr2;
52
53 /* Enable the PLL Wakeup bit in SIC IWR */
54 iwr0 = bfin_read32(SIC_IWR0);
55 iwr1 = bfin_read32(SIC_IWR1);
56 iwr2 = bfin_read32(SIC_IWR2);
57 /* Only allow PPL Wakeup) */
58 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
59 bfin_write32(SIC_IWR1, 0);
60 bfin_write32(SIC_IWR2, 0);
61
62 bfin_write16(VR_CTL, val);
63 __builtin_bfin_ssync();
64
65 local_irq_save(flags);
66 asm("IDLE;");
67 local_irq_restore(flags);
68 bfin_write32(SIC_IWR0, iwr0);
69 bfin_write32(SIC_IWR1, iwr1);
70 bfin_write32(SIC_IWR2, iwr2);
71}
48#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT) 72#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
49#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val) 73#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val)
50#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT) 74#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
@@ -70,12 +94,18 @@
70#define bfin_write_SIC_IMASK1(val) bfin_write32(SIC_IMASK1, val) 94#define bfin_write_SIC_IMASK1(val) bfin_write32(SIC_IMASK1, val)
71#define bfin_read_SIC_IMASK2() bfin_read32(SIC_IMASK2) 95#define bfin_read_SIC_IMASK2() bfin_read32(SIC_IMASK2)
72#define bfin_write_SIC_IMASK2(val) bfin_write32(SIC_IMASK2, val) 96#define bfin_write_SIC_IMASK2(val) bfin_write32(SIC_IMASK2, val)
97#define bfin_read_SIC_IMASK(x) bfin_read32(SIC_IMASK0 + (x << 2))
98#define bfin_write_SIC_IMASK(x, val) bfin_write32((SIC_IMASK0 + (x << 2)), val)
99
73#define bfin_read_SIC_ISR0() bfin_read32(SIC_ISR0) 100#define bfin_read_SIC_ISR0() bfin_read32(SIC_ISR0)
74#define bfin_write_SIC_ISR0(val) bfin_write32(SIC_ISR0, val) 101#define bfin_write_SIC_ISR0(val) bfin_write32(SIC_ISR0, val)
75#define bfin_read_SIC_ISR1() bfin_read32(SIC_ISR1) 102#define bfin_read_SIC_ISR1() bfin_read32(SIC_ISR1)
76#define bfin_write_SIC_ISR1(val) bfin_write32(SIC_ISR1, val) 103#define bfin_write_SIC_ISR1(val) bfin_write32(SIC_ISR1, val)
77#define bfin_read_SIC_ISR2() bfin_read32(SIC_ISR2) 104#define bfin_read_SIC_ISR2() bfin_read32(SIC_ISR2)
78#define bfin_write_SIC_ISR2(val) bfin_write32(SIC_ISR2, val) 105#define bfin_write_SIC_ISR2(val) bfin_write32(SIC_ISR2, val)
106#define bfin_read_SIC_ISR(x) bfin_read32(SIC_ISR0 + (x << 2))
107#define bfin_write_SIC_ISR(x, val) bfin_write32((SIC_ISR0 + (x << 2)), val)
108
79#define bfin_read_SIC_IWR0() bfin_read32(SIC_IWR0) 109#define bfin_read_SIC_IWR0() bfin_read32(SIC_IWR0)
80#define bfin_write_SIC_IWR0(val) bfin_write32(SIC_IWR0, val) 110#define bfin_write_SIC_IWR0(val) bfin_write32(SIC_IWR0, val)
81#define bfin_read_SIC_IWR1() bfin_read32(SIC_IWR1) 111#define bfin_read_SIC_IWR1() bfin_read32(SIC_IWR1)
@@ -710,21 +740,21 @@
710#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_read32(MDMA_D0_NEXT_DESC_PTR) 740#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_read32(MDMA_D0_NEXT_DESC_PTR)
711#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA_D0_NEXT_DESC_PTR) 741#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA_D0_NEXT_DESC_PTR)
712#define bfin_read_MDMA_D0_START_ADDR() bfin_read32(MDMA_D0_START_ADDR) 742#define bfin_read_MDMA_D0_START_ADDR() bfin_read32(MDMA_D0_START_ADDR)
713#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write32(MDMA_D0_START_ADDR) 743#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write32(MDMA_D0_START_ADDR, val)
714#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG) 744#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG)
715#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG, val) 745#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG, val)
716#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT) 746#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT)
717#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT, val) 747#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT, val)
718#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY) 748#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY)
719#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY) 749#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY, val)
720#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT) 750#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT)
721#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT, val) 751#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT, val)
722#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY) 752#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY)
723#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY) 753#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY, val)
724#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_read32(MDMA_D0_CURR_DESC_PTR) 754#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_read32(MDMA_D0_CURR_DESC_PTR)
725#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_write32(MDMA_D0_CURR_DESC_PTR) 755#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_write32(MDMA_D0_CURR_DESC_PTR, val)
726#define bfin_read_MDMA_D0_CURR_ADDR() bfin_read32(MDMA_D0_CURR_ADDR) 756#define bfin_read_MDMA_D0_CURR_ADDR() bfin_read32(MDMA_D0_CURR_ADDR)
727#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_write32(MDMA_D0_CURR_ADDR) 757#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_write32(MDMA_D0_CURR_ADDR, val)
728#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS) 758#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
729#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS, val) 759#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS, val)
730#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP) 760#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
@@ -734,23 +764,23 @@
734#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT) 764#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
735#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT, val) 765#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT, val)
736#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_read32(MDMA_S0_NEXT_DESC_PTR) 766#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_read32(MDMA_S0_NEXT_DESC_PTR)
737#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA_S0_NEXT_DESC_PTR) 767#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA_S0_NEXT_DESC_PTR, val)
738#define bfin_read_MDMA_S0_START_ADDR() bfin_read32(MDMA_S0_START_ADDR) 768#define bfin_read_MDMA_S0_START_ADDR() bfin_read32(MDMA_S0_START_ADDR)
739#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write32(MDMA_S0_START_ADDR) 769#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write32(MDMA_S0_START_ADDR, val)
740#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG) 770#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG)
741#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG, val) 771#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG, val)
742#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT) 772#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT)
743#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT, val) 773#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT, val)
744#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY) 774#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY)
745#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY) 775#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY, val)
746#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT) 776#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT)
747#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT, val) 777#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT, val)
748#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY) 778#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY)
749#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY) 779#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY, val)
750#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_read32(MDMA_S0_CURR_DESC_PTR) 780#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_read32(MDMA_S0_CURR_DESC_PTR)
751#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_write32(MDMA_S0_CURR_DESC_PTR) 781#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_write32(MDMA_S0_CURR_DESC_PTR, val)
752#define bfin_read_MDMA_S0_CURR_ADDR() bfin_read32(MDMA_S0_CURR_ADDR) 782#define bfin_read_MDMA_S0_CURR_ADDR() bfin_read32(MDMA_S0_CURR_ADDR)
753#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_write32(MDMA_S0_CURR_ADDR) 783#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_write32(MDMA_S0_CURR_ADDR, val)
754#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS) 784#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
755#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS, val) 785#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS, val)
756#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP) 786#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
@@ -763,9 +793,9 @@
763/* MDMA Stream 1 Registers */ 793/* MDMA Stream 1 Registers */
764 794
765#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_read32(MDMA_D1_NEXT_DESC_PTR) 795#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_read32(MDMA_D1_NEXT_DESC_PTR)
766#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA_D1_NEXT_DESC_PTR) 796#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA_D1_NEXT_DESC_PTR, val)
767#define bfin_read_MDMA_D1_START_ADDR() bfin_read32(MDMA_D1_START_ADDR) 797#define bfin_read_MDMA_D1_START_ADDR() bfin_read32(MDMA_D1_START_ADDR)
768#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write32(MDMA_D1_START_ADDR) 798#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write32(MDMA_D1_START_ADDR, val)
769#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG) 799#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG)
770#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG, val) 800#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG, val)
771#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT) 801#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT)
@@ -777,9 +807,9 @@
777#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY) 807#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY)
778#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY) 808#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY)
779#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_read32(MDMA_D1_CURR_DESC_PTR) 809#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_read32(MDMA_D1_CURR_DESC_PTR)
780#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_write32(MDMA_D1_CURR_DESC_PTR) 810#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_write32(MDMA_D1_CURR_DESC_PTR, val)
781#define bfin_read_MDMA_D1_CURR_ADDR() bfin_read32(MDMA_D1_CURR_ADDR) 811#define bfin_read_MDMA_D1_CURR_ADDR() bfin_read32(MDMA_D1_CURR_ADDR)
782#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_write32(MDMA_D1_CURR_ADDR) 812#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_write32(MDMA_D1_CURR_ADDR, val)
783#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS) 813#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
784#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS, val) 814#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS, val)
785#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP) 815#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
@@ -789,9 +819,9 @@
789#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT) 819#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
790#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT, val) 820#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT, val)
791#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_read32(MDMA_S1_NEXT_DESC_PTR) 821#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_read32(MDMA_S1_NEXT_DESC_PTR)
792#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA_S1_NEXT_DESC_PTR) 822#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA_S1_NEXT_DESC_PTR, val)
793#define bfin_read_MDMA_S1_START_ADDR() bfin_read32(MDMA_S1_START_ADDR) 823#define bfin_read_MDMA_S1_START_ADDR() bfin_read32(MDMA_S1_START_ADDR)
794#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write32(MDMA_S1_START_ADDR) 824#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write32(MDMA_S1_START_ADDR, val)
795#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG) 825#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG)
796#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG, val) 826#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG, val)
797#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT) 827#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT)
@@ -803,9 +833,9 @@
803#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY) 833#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY)
804#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY) 834#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY)
805#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_read32(MDMA_S1_CURR_DESC_PTR) 835#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_read32(MDMA_S1_CURR_DESC_PTR)
806#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_write32(MDMA_S1_CURR_DESC_PTR) 836#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_write32(MDMA_S1_CURR_DESC_PTR, val)
807#define bfin_read_MDMA_S1_CURR_ADDR() bfin_read32(MDMA_S1_CURR_ADDR) 837#define bfin_read_MDMA_S1_CURR_ADDR() bfin_read32(MDMA_S1_CURR_ADDR)
808#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_write32(MDMA_S1_CURR_ADDR) 838#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_write32(MDMA_S1_CURR_ADDR, val)
809#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS) 839#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
810#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS, val) 840#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS, val)
811#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP) 841#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
diff --git a/include/asm-blackfin/mach-bf548/defBF542.h b/include/asm-blackfin/mach-bf548/defBF542.h
index ac968fca5cc5..32d07130200c 100644
--- a/include/asm-blackfin/mach-bf548/defBF542.h
+++ b/include/asm-blackfin/mach-bf548/defBF542.h
@@ -362,7 +362,6 @@
362/* Bit masks for KPAD_CTL */ 362/* Bit masks for KPAD_CTL */
363 363
364#define KPAD_EN 0x1 /* Keypad Enable */ 364#define KPAD_EN 0x1 /* Keypad Enable */
365#define nKPAD_EN 0x0
366#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */ 365#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */
367#define KPAD_ROWEN 0x1c00 /* Row Enable Width */ 366#define KPAD_ROWEN 0x1c00 /* Row Enable Width */
368#define KPAD_COLEN 0xe000 /* Column Enable Width */ 367#define KPAD_COLEN 0xe000 /* Column Enable Width */
@@ -384,29 +383,21 @@
384/* Bit masks for KPAD_STAT */ 383/* Bit masks for KPAD_STAT */
385 384
386#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */ 385#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */
387#define nKPAD_IRQ 0x0
388#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */ 386#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */
389#define KPAD_PRESSED 0x8 /* Key press current status */ 387#define KPAD_PRESSED 0x8 /* Key press current status */
390#define nKPAD_PRESSED 0x0
391 388
392/* Bit masks for KPAD_SOFTEVAL */ 389/* Bit masks for KPAD_SOFTEVAL */
393 390
394#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */ 391#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */
395#define nKPAD_SOFTEVAL_E 0x0
396 392
397/* Bit masks for SDH_COMMAND */ 393/* Bit masks for SDH_COMMAND */
398 394
399#define CMD_IDX 0x3f /* Command Index */ 395#define CMD_IDX 0x3f /* Command Index */
400#define CMD_RSP 0x40 /* Response */ 396#define CMD_RSP 0x40 /* Response */
401#define nCMD_RSP 0x0
402#define CMD_L_RSP 0x80 /* Long Response */ 397#define CMD_L_RSP 0x80 /* Long Response */
403#define nCMD_L_RSP 0x0
404#define CMD_INT_E 0x100 /* Command Interrupt */ 398#define CMD_INT_E 0x100 /* Command Interrupt */
405#define nCMD_INT_E 0x0
406#define CMD_PEND_E 0x200 /* Command Pending */ 399#define CMD_PEND_E 0x200 /* Command Pending */
407#define nCMD_PEND_E 0x0
408#define CMD_E 0x400 /* Command Enable */ 400#define CMD_E 0x400 /* Command Enable */
409#define nCMD_E 0x0
410 401
411/* Bit masks for SDH_PWR_CTL */ 402/* Bit masks for SDH_PWR_CTL */
412 403
@@ -415,21 +406,15 @@
415#define TBD 0x3c /* TBD */ 406#define TBD 0x3c /* TBD */
416#endif 407#endif
417#define SD_CMD_OD 0x40 /* Open Drain Output */ 408#define SD_CMD_OD 0x40 /* Open Drain Output */
418#define nSD_CMD_OD 0x0
419#define ROD_CTL 0x80 /* Rod Control */ 409#define ROD_CTL 0x80 /* Rod Control */
420#define nROD_CTL 0x0
421 410
422/* Bit masks for SDH_CLK_CTL */ 411/* Bit masks for SDH_CLK_CTL */
423 412
424#define CLKDIV 0xff /* MC_CLK Divisor */ 413#define CLKDIV 0xff /* MC_CLK Divisor */
425#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */ 414#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
426#define nCLK_E 0x0
427#define PWR_SV_E 0x200 /* Power Save Enable */ 415#define PWR_SV_E 0x200 /* Power Save Enable */
428#define nPWR_SV_E 0x0
429#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */ 416#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
430#define nCLKDIV_BYPASS 0x0
431#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */ 417#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
432#define nWIDE_BUS 0x0
433 418
434/* Bit masks for SDH_RESP_CMD */ 419/* Bit masks for SDH_RESP_CMD */
435 420
@@ -438,133 +423,74 @@
438/* Bit masks for SDH_DATA_CTL */ 423/* Bit masks for SDH_DATA_CTL */
439 424
440#define DTX_E 0x1 /* Data Transfer Enable */ 425#define DTX_E 0x1 /* Data Transfer Enable */
441#define nDTX_E 0x0
442#define DTX_DIR 0x2 /* Data Transfer Direction */ 426#define DTX_DIR 0x2 /* Data Transfer Direction */
443#define nDTX_DIR 0x0
444#define DTX_MODE 0x4 /* Data Transfer Mode */ 427#define DTX_MODE 0x4 /* Data Transfer Mode */
445#define nDTX_MODE 0x0
446#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */ 428#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
447#define nDTX_DMA_E 0x0
448#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */ 429#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
449 430
450/* Bit masks for SDH_STATUS */ 431/* Bit masks for SDH_STATUS */
451 432
452#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */ 433#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
453#define nCMD_CRC_FAIL 0x0
454#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */ 434#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
455#define nDAT_CRC_FAIL 0x0
456#define CMD_TIMEOUT 0x4 /* CMD Time Out */ 435#define CMD_TIMEOUT 0x4 /* CMD Time Out */
457#define nCMD_TIMEOUT 0x0
458#define DAT_TIMEOUT 0x8 /* Data Time Out */ 436#define DAT_TIMEOUT 0x8 /* Data Time Out */
459#define nDAT_TIMEOUT 0x0
460#define TX_UNDERRUN 0x10 /* Transmit Underrun */ 437#define TX_UNDERRUN 0x10 /* Transmit Underrun */
461#define nTX_UNDERRUN 0x0
462#define RX_OVERRUN 0x20 /* Receive Overrun */ 438#define RX_OVERRUN 0x20 /* Receive Overrun */
463#define nRX_OVERRUN 0x0
464#define CMD_RESP_END 0x40 /* CMD Response End */ 439#define CMD_RESP_END 0x40 /* CMD Response End */
465#define nCMD_RESP_END 0x0
466#define CMD_SENT 0x80 /* CMD Sent */ 440#define CMD_SENT 0x80 /* CMD Sent */
467#define nCMD_SENT 0x0
468#define DAT_END 0x100 /* Data End */ 441#define DAT_END 0x100 /* Data End */
469#define nDAT_END 0x0
470#define START_BIT_ERR 0x200 /* Start Bit Error */ 442#define START_BIT_ERR 0x200 /* Start Bit Error */
471#define nSTART_BIT_ERR 0x0
472#define DAT_BLK_END 0x400 /* Data Block End */ 443#define DAT_BLK_END 0x400 /* Data Block End */
473#define nDAT_BLK_END 0x0
474#define CMD_ACT 0x800 /* CMD Active */ 444#define CMD_ACT 0x800 /* CMD Active */
475#define nCMD_ACT 0x0
476#define TX_ACT 0x1000 /* Transmit Active */ 445#define TX_ACT 0x1000 /* Transmit Active */
477#define nTX_ACT 0x0
478#define RX_ACT 0x2000 /* Receive Active */ 446#define RX_ACT 0x2000 /* Receive Active */
479#define nRX_ACT 0x0
480#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */ 447#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
481#define nTX_FIFO_STAT 0x0
482#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */ 448#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
483#define nRX_FIFO_STAT 0x0
484#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */ 449#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
485#define nTX_FIFO_FULL 0x0
486#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */ 450#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
487#define nRX_FIFO_FULL 0x0
488#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */ 451#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
489#define nTX_FIFO_ZERO 0x0
490#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */ 452#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
491#define nRX_DAT_ZERO 0x0
492#define TX_DAT_RDY 0x100000 /* Transmit Data Available */ 453#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
493#define nTX_DAT_RDY 0x0
494#define RX_FIFO_RDY 0x200000 /* Receive Data Available */ 454#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
495#define nRX_FIFO_RDY 0x0
496 455
497/* Bit masks for SDH_STATUS_CLR */ 456/* Bit masks for SDH_STATUS_CLR */
498 457
499#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */ 458#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
500#define nCMD_CRC_FAIL_STAT 0x0
501#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */ 459#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
502#define nDAT_CRC_FAIL_STAT 0x0
503#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */ 460#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
504#define nCMD_TIMEOUT_STAT 0x0
505#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */ 461#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
506#define nDAT_TIMEOUT_STAT 0x0
507#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */ 462#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
508#define nTX_UNDERRUN_STAT 0x0
509#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */ 463#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
510#define nRX_OVERRUN_STAT 0x0
511#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */ 464#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
512#define nCMD_RESP_END_STAT 0x0
513#define CMD_SENT_STAT 0x80 /* CMD Sent Status */ 465#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
514#define nCMD_SENT_STAT 0x0
515#define DAT_END_STAT 0x100 /* Data End Status */ 466#define DAT_END_STAT 0x100 /* Data End Status */
516#define nDAT_END_STAT 0x0
517#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */ 467#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
518#define nSTART_BIT_ERR_STAT 0x0
519#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */ 468#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
520#define nDAT_BLK_END_STAT 0x0
521 469
522/* Bit masks for SDH_MASK0 */ 470/* Bit masks for SDH_MASK0 */
523 471
524#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */ 472#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
525#define nCMD_CRC_FAIL_MASK 0x0
526#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */ 473#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
527#define nDAT_CRC_FAIL_MASK 0x0
528#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */ 474#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
529#define nCMD_TIMEOUT_MASK 0x0
530#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */ 475#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
531#define nDAT_TIMEOUT_MASK 0x0
532#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */ 476#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
533#define nTX_UNDERRUN_MASK 0x0
534#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */ 477#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
535#define nRX_OVERRUN_MASK 0x0
536#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */ 478#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
537#define nCMD_RESP_END_MASK 0x0
538#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */ 479#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
539#define nCMD_SENT_MASK 0x0
540#define DAT_END_MASK 0x100 /* Data End Mask */ 480#define DAT_END_MASK 0x100 /* Data End Mask */
541#define nDAT_END_MASK 0x0
542#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */ 481#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
543#define nSTART_BIT_ERR_MASK 0x0
544#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */ 482#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
545#define nDAT_BLK_END_MASK 0x0
546#define CMD_ACT_MASK 0x800 /* CMD Active Mask */ 483#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
547#define nCMD_ACT_MASK 0x0
548#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */ 484#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
549#define nTX_ACT_MASK 0x0
550#define RX_ACT_MASK 0x2000 /* Receive Active Mask */ 485#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
551#define nRX_ACT_MASK 0x0
552#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */ 486#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
553#define nTX_FIFO_STAT_MASK 0x0
554#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */ 487#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
555#define nRX_FIFO_STAT_MASK 0x0
556#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */ 488#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
557#define nTX_FIFO_FULL_MASK 0x0
558#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */ 489#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
559#define nRX_FIFO_FULL_MASK 0x0
560#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */ 490#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
561#define nTX_FIFO_ZERO_MASK 0x0
562#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */ 491#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
563#define nRX_DAT_ZERO_MASK 0x0
564#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */ 492#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
565#define nTX_DAT_RDY_MASK 0x0
566#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */ 493#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
567#define nRX_FIFO_RDY_MASK 0x0
568 494
569/* Bit masks for SDH_FIFO_CNT */ 495/* Bit masks for SDH_FIFO_CNT */
570 496
@@ -573,73 +499,47 @@
573/* Bit masks for SDH_E_STATUS */ 499/* Bit masks for SDH_E_STATUS */
574 500
575#define SDIO_INT_DET 0x2 /* SDIO Int Detected */ 501#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
576#define nSDIO_INT_DET 0x0
577#define SD_CARD_DET 0x10 /* SD Card Detect */ 502#define SD_CARD_DET 0x10 /* SD Card Detect */
578#define nSD_CARD_DET 0x0
579 503
580/* Bit masks for SDH_E_MASK */ 504/* Bit masks for SDH_E_MASK */
581 505
582#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */ 506#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
583#define nSDIO_MSK 0x0
584#define SCD_MSK 0x40 /* Mask Card Detect */ 507#define SCD_MSK 0x40 /* Mask Card Detect */
585#define nSCD_MSK 0x0
586 508
587/* Bit masks for SDH_CFG */ 509/* Bit masks for SDH_CFG */
588 510
589#define CLKS_EN 0x1 /* Clocks Enable */ 511#define CLKS_EN 0x1 /* Clocks Enable */
590#define nCLKS_EN 0x0
591#define SD4E 0x4 /* SDIO 4-Bit Enable */ 512#define SD4E 0x4 /* SDIO 4-Bit Enable */
592#define nSD4E 0x0
593#define MWE 0x8 /* Moving Window Enable */ 513#define MWE 0x8 /* Moving Window Enable */
594#define nMWE 0x0
595#define SD_RST 0x10 /* SDMMC Reset */ 514#define SD_RST 0x10 /* SDMMC Reset */
596#define nSD_RST 0x0
597#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */ 515#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
598#define nPUP_SDDAT 0x0
599#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */ 516#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
600#define nPUP_SDDAT3 0x0
601#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */ 517#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
602#define nPD_SDDAT3 0x0
603 518
604/* Bit masks for SDH_RD_WAIT_EN */ 519/* Bit masks for SDH_RD_WAIT_EN */
605 520
606#define RWR 0x1 /* Read Wait Request */ 521#define RWR 0x1 /* Read Wait Request */
607#define nRWR 0x0
608 522
609/* Bit masks for ATAPI_CONTROL */ 523/* Bit masks for ATAPI_CONTROL */
610 524
611#define PIO_START 0x1 /* Start PIO/Reg Op */ 525#define PIO_START 0x1 /* Start PIO/Reg Op */
612#define nPIO_START 0x0
613#define MULTI_START 0x2 /* Start Multi-DMA Op */ 526#define MULTI_START 0x2 /* Start Multi-DMA Op */
614#define nMULTI_START 0x0
615#define ULTRA_START 0x4 /* Start Ultra-DMA Op */ 527#define ULTRA_START 0x4 /* Start Ultra-DMA Op */
616#define nULTRA_START 0x0
617#define XFER_DIR 0x8 /* Transfer Direction */ 528#define XFER_DIR 0x8 /* Transfer Direction */
618#define nXFER_DIR 0x0
619#define IORDY_EN 0x10 /* IORDY Enable */ 529#define IORDY_EN 0x10 /* IORDY Enable */
620#define nIORDY_EN 0x0
621#define FIFO_FLUSH 0x20 /* Flush FIFOs */ 530#define FIFO_FLUSH 0x20 /* Flush FIFOs */
622#define nFIFO_FLUSH 0x0
623#define SOFT_RST 0x40 /* Soft Reset */ 531#define SOFT_RST 0x40 /* Soft Reset */
624#define nSOFT_RST 0x0
625#define DEV_RST 0x80 /* Device Reset */ 532#define DEV_RST 0x80 /* Device Reset */
626#define nDEV_RST 0x0
627#define TFRCNT_RST 0x100 /* Trans Count Reset */ 533#define TFRCNT_RST 0x100 /* Trans Count Reset */
628#define nTFRCNT_RST 0x0
629#define END_ON_TERM 0x200 /* End/Terminate Select */ 534#define END_ON_TERM 0x200 /* End/Terminate Select */
630#define nEND_ON_TERM 0x0
631#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */ 535#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */
632#define nPIO_USE_DMA 0x0
633#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */ 536#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */
634 537
635/* Bit masks for ATAPI_STATUS */ 538/* Bit masks for ATAPI_STATUS */
636 539
637#define PIO_XFER_ON 0x1 /* PIO transfer in progress */ 540#define PIO_XFER_ON 0x1 /* PIO transfer in progress */
638#define nPIO_XFER_ON 0x0
639#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */ 541#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */
640#define nMULTI_XFER_ON 0x0
641#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */ 542#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */
642#define nULTRA_XFER_ON 0x0
643#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */ 543#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */
644 544
645/* Bit masks for ATAPI_DEV_ADDR */ 545/* Bit masks for ATAPI_DEV_ADDR */
@@ -649,66 +549,39 @@
649/* Bit masks for ATAPI_INT_MASK */ 549/* Bit masks for ATAPI_INT_MASK */
650 550
651#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */ 551#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */
652#define nATAPI_DEV_INT_MASK 0x0
653#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */ 552#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */
654#define nPIO_DONE_MASK 0x0
655#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */ 553#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */
656#define nMULTI_DONE_MASK 0x0
657#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */ 554#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */
658#define nUDMAIN_DONE_MASK 0x0
659#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */ 555#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */
660#define nUDMAOUT_DONE_MASK 0x0
661#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */ 556#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */
662#define nHOST_TERM_XFER_MASK 0x0
663#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */ 557#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */
664#define nMULTI_TERM_MASK 0x0
665#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */ 558#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */
666#define nUDMAIN_TERM_MASK 0x0
667#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */ 559#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */
668#define nUDMAOUT_TERM_MASK 0x0
669 560
670/* Bit masks for ATAPI_INT_STATUS */ 561/* Bit masks for ATAPI_INT_STATUS */
671 562
672#define ATAPI_DEV_INT 0x1 /* Device interrupt status */ 563#define ATAPI_DEV_INT 0x1 /* Device interrupt status */
673#define nATAPI_DEV_INT 0x0
674#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */ 564#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */
675#define nPIO_DONE_INT 0x0
676#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */ 565#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */
677#define nMULTI_DONE_INT 0x0
678#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */ 566#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */
679#define nUDMAIN_DONE_INT 0x0
680#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */ 567#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */
681#define nUDMAOUT_DONE_INT 0x0
682#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */ 568#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */
683#define nHOST_TERM_XFER_INT 0x0
684#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */ 569#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */
685#define nMULTI_TERM_INT 0x0
686#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */ 570#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */
687#define nUDMAIN_TERM_INT 0x0
688#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */ 571#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */
689#define nUDMAOUT_TERM_INT 0x0
690 572
691/* Bit masks for ATAPI_LINE_STATUS */ 573/* Bit masks for ATAPI_LINE_STATUS */
692 574
693#define ATAPI_INTR 0x1 /* Device interrupt to host line status */ 575#define ATAPI_INTR 0x1 /* Device interrupt to host line status */
694#define nATAPI_INTR 0x0
695#define ATAPI_DASP 0x2 /* Device dasp to host line status */ 576#define ATAPI_DASP 0x2 /* Device dasp to host line status */
696#define nATAPI_DASP 0x0
697#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */ 577#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */
698#define nATAPI_CS0N 0x0
699#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */ 578#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */
700#define nATAPI_CS1N 0x0
701#define ATAPI_ADDR 0x70 /* ATAPI address line status */ 579#define ATAPI_ADDR 0x70 /* ATAPI address line status */
702#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */ 580#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */
703#define nATAPI_DMAREQ 0x0
704#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */ 581#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */
705#define nATAPI_DMAACKN 0x0
706#define ATAPI_DIOWN 0x200 /* ATAPI write line status */ 582#define ATAPI_DIOWN 0x200 /* ATAPI write line status */
707#define nATAPI_DIOWN 0x0
708#define ATAPI_DIORN 0x400 /* ATAPI read line status */ 583#define ATAPI_DIORN 0x400 /* ATAPI read line status */
709#define nATAPI_DIORN 0x0
710#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */ 584#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */
711#define nATAPI_IORDY 0x0
712 585
713/* Bit masks for ATAPI_SM_STATE */ 586/* Bit masks for ATAPI_SM_STATE */
714 587
@@ -720,7 +593,6 @@
720/* Bit masks for ATAPI_TERMINATE */ 593/* Bit masks for ATAPI_TERMINATE */
721 594
722#define ATAPI_HOST_TERM 0x1 /* Host terminationation */ 595#define ATAPI_HOST_TERM 0x1 /* Host terminationation */
723#define nATAPI_HOST_TERM 0x0
724 596
725/* Bit masks for ATAPI_REG_TIM_0 */ 597/* Bit masks for ATAPI_REG_TIM_0 */
726 598
@@ -779,131 +651,77 @@
779/* Bit masks for USB_POWER */ 651/* Bit masks for USB_POWER */
780 652
781#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */ 653#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
782#define nENABLE_SUSPENDM 0x0
783#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */ 654#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
784#define nSUSPEND_MODE 0x0
785#define RESUME_MODE 0x4 /* DMA Mode */ 655#define RESUME_MODE 0x4 /* DMA Mode */
786#define nRESUME_MODE 0x0
787#define RESET 0x8 /* Reset indicator */ 656#define RESET 0x8 /* Reset indicator */
788#define nRESET 0x0
789#define HS_MODE 0x10 /* High Speed mode indicator */ 657#define HS_MODE 0x10 /* High Speed mode indicator */
790#define nHS_MODE 0x0
791#define HS_ENABLE 0x20 /* high Speed Enable */ 658#define HS_ENABLE 0x20 /* high Speed Enable */
792#define nHS_ENABLE 0x0
793#define SOFT_CONN 0x40 /* Soft connect */ 659#define SOFT_CONN 0x40 /* Soft connect */
794#define nSOFT_CONN 0x0
795#define ISO_UPDATE 0x80 /* Isochronous update */ 660#define ISO_UPDATE 0x80 /* Isochronous update */
796#define nISO_UPDATE 0x0
797 661
798/* Bit masks for USB_INTRTX */ 662/* Bit masks for USB_INTRTX */
799 663
800#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */ 664#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
801#define nEP0_TX 0x0
802#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */ 665#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
803#define nEP1_TX 0x0
804#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */ 666#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
805#define nEP2_TX 0x0
806#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */ 667#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
807#define nEP3_TX 0x0
808#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */ 668#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
809#define nEP4_TX 0x0
810#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */ 669#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
811#define nEP5_TX 0x0
812#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */ 670#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
813#define nEP6_TX 0x0
814#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */ 671#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
815#define nEP7_TX 0x0
816 672
817/* Bit masks for USB_INTRRX */ 673/* Bit masks for USB_INTRRX */
818 674
819#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */ 675#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
820#define nEP1_RX 0x0
821#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */ 676#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
822#define nEP2_RX 0x0
823#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */ 677#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
824#define nEP3_RX 0x0
825#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */ 678#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
826#define nEP4_RX 0x0
827#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */ 679#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
828#define nEP5_RX 0x0
829#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */ 680#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
830#define nEP6_RX 0x0
831#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */ 681#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
832#define nEP7_RX 0x0
833 682
834/* Bit masks for USB_INTRTXE */ 683/* Bit masks for USB_INTRTXE */
835 684
836#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */ 685#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
837#define nEP0_TX_E 0x0
838#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */ 686#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
839#define nEP1_TX_E 0x0
840#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */ 687#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
841#define nEP2_TX_E 0x0
842#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */ 688#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
843#define nEP3_TX_E 0x0
844#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */ 689#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
845#define nEP4_TX_E 0x0
846#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */ 690#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
847#define nEP5_TX_E 0x0
848#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */ 691#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
849#define nEP6_TX_E 0x0
850#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */ 692#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
851#define nEP7_TX_E 0x0
852 693
853/* Bit masks for USB_INTRRXE */ 694/* Bit masks for USB_INTRRXE */
854 695
855#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */ 696#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
856#define nEP1_RX_E 0x0
857#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */ 697#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
858#define nEP2_RX_E 0x0
859#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */ 698#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
860#define nEP3_RX_E 0x0
861#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */ 699#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
862#define nEP4_RX_E 0x0
863#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */ 700#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
864#define nEP5_RX_E 0x0
865#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */ 701#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
866#define nEP6_RX_E 0x0
867#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */ 702#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
868#define nEP7_RX_E 0x0
869 703
870/* Bit masks for USB_INTRUSB */ 704/* Bit masks for USB_INTRUSB */
871 705
872#define SUSPEND_B 0x1 /* Suspend indicator */ 706#define SUSPEND_B 0x1 /* Suspend indicator */
873#define nSUSPEND_B 0x0
874#define RESUME_B 0x2 /* Resume indicator */ 707#define RESUME_B 0x2 /* Resume indicator */
875#define nRESUME_B 0x0
876#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */ 708#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
877#define nRESET_OR_BABLE_B 0x0
878#define SOF_B 0x8 /* Start of frame */ 709#define SOF_B 0x8 /* Start of frame */
879#define nSOF_B 0x0
880#define CONN_B 0x10 /* Connection indicator */ 710#define CONN_B 0x10 /* Connection indicator */
881#define nCONN_B 0x0
882#define DISCON_B 0x20 /* Disconnect indicator */ 711#define DISCON_B 0x20 /* Disconnect indicator */
883#define nDISCON_B 0x0
884#define SESSION_REQ_B 0x40 /* Session Request */ 712#define SESSION_REQ_B 0x40 /* Session Request */
885#define nSESSION_REQ_B 0x0
886#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */ 713#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
887#define nVBUS_ERROR_B 0x0
888 714
889/* Bit masks for USB_INTRUSBE */ 715/* Bit masks for USB_INTRUSBE */
890 716
891#define SUSPEND_BE 0x1 /* Suspend indicator int enable */ 717#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
892#define nSUSPEND_BE 0x0
893#define RESUME_BE 0x2 /* Resume indicator int enable */ 718#define RESUME_BE 0x2 /* Resume indicator int enable */
894#define nRESUME_BE 0x0
895#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */ 719#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
896#define nRESET_OR_BABLE_BE 0x0
897#define SOF_BE 0x8 /* Start of frame int enable */ 720#define SOF_BE 0x8 /* Start of frame int enable */
898#define nSOF_BE 0x0
899#define CONN_BE 0x10 /* Connection indicator int enable */ 721#define CONN_BE 0x10 /* Connection indicator int enable */
900#define nCONN_BE 0x0
901#define DISCON_BE 0x20 /* Disconnect indicator int enable */ 722#define DISCON_BE 0x20 /* Disconnect indicator int enable */
902#define nDISCON_BE 0x0
903#define SESSION_REQ_BE 0x40 /* Session Request int enable */ 723#define SESSION_REQ_BE 0x40 /* Session Request int enable */
904#define nSESSION_REQ_BE 0x0
905#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */ 724#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
906#define nVBUS_ERROR_BE 0x0
907 725
908/* Bit masks for USB_FRAME */ 726/* Bit masks for USB_FRAME */
909 727
@@ -916,117 +734,67 @@
916/* Bit masks for USB_GLOBAL_CTL */ 734/* Bit masks for USB_GLOBAL_CTL */
917 735
918#define GLOBAL_ENA 0x1 /* enables USB module */ 736#define GLOBAL_ENA 0x1 /* enables USB module */
919#define nGLOBAL_ENA 0x0
920#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */ 737#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
921#define nEP1_TX_ENA 0x0
922#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */ 738#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
923#define nEP2_TX_ENA 0x0
924#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */ 739#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
925#define nEP3_TX_ENA 0x0
926#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */ 740#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
927#define nEP4_TX_ENA 0x0
928#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */ 741#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
929#define nEP5_TX_ENA 0x0
930#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */ 742#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
931#define nEP6_TX_ENA 0x0
932#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */ 743#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
933#define nEP7_TX_ENA 0x0
934#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */ 744#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
935#define nEP1_RX_ENA 0x0
936#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */ 745#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
937#define nEP2_RX_ENA 0x0
938#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */ 746#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
939#define nEP3_RX_ENA 0x0
940#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */ 747#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
941#define nEP4_RX_ENA 0x0
942#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */ 748#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
943#define nEP5_RX_ENA 0x0
944#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */ 749#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
945#define nEP6_RX_ENA 0x0
946#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */ 750#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
947#define nEP7_RX_ENA 0x0
948 751
949/* Bit masks for USB_OTG_DEV_CTL */ 752/* Bit masks for USB_OTG_DEV_CTL */
950 753
951#define SESSION 0x1 /* session indicator */ 754#define SESSION 0x1 /* session indicator */
952#define nSESSION 0x0
953#define HOST_REQ 0x2 /* Host negotiation request */ 755#define HOST_REQ 0x2 /* Host negotiation request */
954#define nHOST_REQ 0x0
955#define HOST_MODE 0x4 /* indicates USBDRC is a host */ 756#define HOST_MODE 0x4 /* indicates USBDRC is a host */
956#define nHOST_MODE 0x0
957#define VBUS0 0x8 /* Vbus level indicator[0] */ 757#define VBUS0 0x8 /* Vbus level indicator[0] */
958#define nVBUS0 0x0
959#define VBUS1 0x10 /* Vbus level indicator[1] */ 758#define VBUS1 0x10 /* Vbus level indicator[1] */
960#define nVBUS1 0x0
961#define LSDEV 0x20 /* Low-speed indicator */ 759#define LSDEV 0x20 /* Low-speed indicator */
962#define nLSDEV 0x0
963#define FSDEV 0x40 /* Full or High-speed indicator */ 760#define FSDEV 0x40 /* Full or High-speed indicator */
964#define nFSDEV 0x0
965#define B_DEVICE 0x80 /* A' or 'B' device indicator */ 761#define B_DEVICE 0x80 /* A' or 'B' device indicator */
966#define nB_DEVICE 0x0
967 762
968/* Bit masks for USB_OTG_VBUS_IRQ */ 763/* Bit masks for USB_OTG_VBUS_IRQ */
969 764
970#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */ 765#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
971#define nDRIVE_VBUS_ON 0x0
972#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */ 766#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
973#define nDRIVE_VBUS_OFF 0x0
974#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */ 767#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
975#define nCHRG_VBUS_START 0x0
976#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */ 768#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
977#define nCHRG_VBUS_END 0x0
978#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */ 769#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
979#define nDISCHRG_VBUS_START 0x0
980#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */ 770#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
981#define nDISCHRG_VBUS_END 0x0
982 771
983/* Bit masks for USB_OTG_VBUS_MASK */ 772/* Bit masks for USB_OTG_VBUS_MASK */
984 773
985#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */ 774#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
986#define nDRIVE_VBUS_ON_ENA 0x0
987#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */ 775#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
988#define nDRIVE_VBUS_OFF_ENA 0x0
989#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */ 776#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
990#define nCHRG_VBUS_START_ENA 0x0
991#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */ 777#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
992#define nCHRG_VBUS_END_ENA 0x0
993#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */ 778#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
994#define nDISCHRG_VBUS_START_ENA 0x0
995#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */ 779#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
996#define nDISCHRG_VBUS_END_ENA 0x0
997 780
998/* Bit masks for USB_CSR0 */ 781/* Bit masks for USB_CSR0 */
999 782
1000#define RXPKTRDY 0x1 /* data packet receive indicator */ 783#define RXPKTRDY 0x1 /* data packet receive indicator */
1001#define nRXPKTRDY 0x0
1002#define TXPKTRDY 0x2 /* data packet in FIFO indicator */ 784#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
1003#define nTXPKTRDY 0x0
1004#define STALL_SENT 0x4 /* STALL handshake sent */ 785#define STALL_SENT 0x4 /* STALL handshake sent */
1005#define nSTALL_SENT 0x0
1006#define DATAEND 0x8 /* Data end indicator */ 786#define DATAEND 0x8 /* Data end indicator */
1007#define nDATAEND 0x0
1008#define SETUPEND 0x10 /* Setup end */ 787#define SETUPEND 0x10 /* Setup end */
1009#define nSETUPEND 0x0
1010#define SENDSTALL 0x20 /* Send STALL handshake */ 788#define SENDSTALL 0x20 /* Send STALL handshake */
1011#define nSENDSTALL 0x0
1012#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */ 789#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
1013#define nSERVICED_RXPKTRDY 0x0
1014#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */ 790#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
1015#define nSERVICED_SETUPEND 0x0
1016#define FLUSHFIFO 0x100 /* flush endpoint FIFO */ 791#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
1017#define nFLUSHFIFO 0x0
1018#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */ 792#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
1019#define nSTALL_RECEIVED_H 0x0
1020#define SETUPPKT_H 0x8 /* send Setup token host mode */ 793#define SETUPPKT_H 0x8 /* send Setup token host mode */
1021#define nSETUPPKT_H 0x0
1022#define ERROR_H 0x10 /* timeout error indicator host mode */ 794#define ERROR_H 0x10 /* timeout error indicator host mode */
1023#define nERROR_H 0x0
1024#define REQPKT_H 0x20 /* Request an IN transaction host mode */ 795#define REQPKT_H 0x20 /* Request an IN transaction host mode */
1025#define nREQPKT_H 0x0
1026#define STATUSPKT_H 0x40 /* Status stage transaction host mode */ 796#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
1027#define nSTATUSPKT_H 0x0
1028#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */ 797#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
1029#define nNAK_TIMEOUT_H 0x0
1030 798
1031/* Bit masks for USB_COUNT0 */ 799/* Bit masks for USB_COUNT0 */
1032 800
@@ -1047,37 +815,21 @@
1047/* Bit masks for USB_TXCSR */ 815/* Bit masks for USB_TXCSR */
1048 816
1049#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */ 817#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
1050#define nTXPKTRDY_T 0x0
1051#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */ 818#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
1052#define nFIFO_NOT_EMPTY_T 0x0
1053#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */ 819#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
1054#define nUNDERRUN_T 0x0
1055#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */ 820#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
1056#define nFLUSHFIFO_T 0x0
1057#define STALL_SEND_T 0x10 /* issue a Stall handshake */ 821#define STALL_SEND_T 0x10 /* issue a Stall handshake */
1058#define nSTALL_SEND_T 0x0
1059#define STALL_SENT_T 0x20 /* Stall handshake transmitted */ 822#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
1060#define nSTALL_SENT_T 0x0
1061#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */ 823#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
1062#define nCLEAR_DATATOGGLE_T 0x0
1063#define INCOMPTX_T 0x80 /* indicates that a large packet is split */ 824#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
1064#define nINCOMPTX_T 0x0
1065#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */ 825#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
1066#define nDMAREQMODE_T 0x0
1067#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */ 826#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
1068#define nFORCE_DATATOGGLE_T 0x0
1069#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */ 827#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
1070#define nDMAREQ_ENA_T 0x0
1071#define ISO_T 0x4000 /* enable Isochronous transfers */ 828#define ISO_T 0x4000 /* enable Isochronous transfers */
1072#define nISO_T 0x0
1073#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */ 829#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
1074#define nAUTOSET_T 0x0
1075#define ERROR_TH 0x4 /* error condition host mode */ 830#define ERROR_TH 0x4 /* error condition host mode */
1076#define nERROR_TH 0x0
1077#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */ 831#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
1078#define nSTALL_RECEIVED_TH 0x0
1079#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */ 832#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
1080#define nNAK_TIMEOUT_TH 0x0
1081 833
1082/* Bit masks for USB_TXCOUNT */ 834/* Bit masks for USB_TXCOUNT */
1083 835
@@ -1086,45 +838,25 @@
1086/* Bit masks for USB_RXCSR */ 838/* Bit masks for USB_RXCSR */
1087 839
1088#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */ 840#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
1089#define nRXPKTRDY_R 0x0
1090#define FIFO_FULL_R 0x2 /* FIFO not empty */ 841#define FIFO_FULL_R 0x2 /* FIFO not empty */
1091#define nFIFO_FULL_R 0x0
1092#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */ 842#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
1093#define nOVERRUN_R 0x0
1094#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */ 843#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
1095#define nDATAERROR_R 0x0
1096#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */ 844#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
1097#define nFLUSHFIFO_R 0x0
1098#define STALL_SEND_R 0x20 /* issue a Stall handshake */ 845#define STALL_SEND_R 0x20 /* issue a Stall handshake */
1099#define nSTALL_SEND_R 0x0
1100#define STALL_SENT_R 0x40 /* Stall handshake transmitted */ 846#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
1101#define nSTALL_SENT_R 0x0
1102#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */ 847#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
1103#define nCLEAR_DATATOGGLE_R 0x0
1104#define INCOMPRX_R 0x100 /* indicates that a large packet is split */ 848#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
1105#define nINCOMPRX_R 0x0
1106#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */ 849#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
1107#define nDMAREQMODE_R 0x0
1108#define DISNYET_R 0x1000 /* disable Nyet handshakes */ 850#define DISNYET_R 0x1000 /* disable Nyet handshakes */
1109#define nDISNYET_R 0x0
1110#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */ 851#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
1111#define nDMAREQ_ENA_R 0x0
1112#define ISO_R 0x4000 /* enable Isochronous transfers */ 852#define ISO_R 0x4000 /* enable Isochronous transfers */
1113#define nISO_R 0x0
1114#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */ 853#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
1115#define nAUTOCLEAR_R 0x0
1116#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */ 854#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
1117#define nERROR_RH 0x0
1118#define REQPKT_RH 0x20 /* request an IN transaction host mode */ 855#define REQPKT_RH 0x20 /* request an IN transaction host mode */
1119#define nREQPKT_RH 0x0
1120#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */ 856#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
1121#define nSTALL_RECEIVED_RH 0x0
1122#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */ 857#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
1123#define nINCOMPRX_RH 0x0
1124#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */ 858#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
1125#define nDMAREQMODE_RH 0x0
1126#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */ 859#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
1127#define nAUTOREQ_RH 0x0
1128 860
1129/* Bit masks for USB_RXCOUNT */ 861/* Bit masks for USB_RXCOUNT */
1130 862
@@ -1151,35 +883,22 @@
1151/* Bit masks for USB_DMA_INTERRUPT */ 883/* Bit masks for USB_DMA_INTERRUPT */
1152 884
1153#define DMA0_INT 0x1 /* DMA0 pending interrupt */ 885#define DMA0_INT 0x1 /* DMA0 pending interrupt */
1154#define nDMA0_INT 0x0
1155#define DMA1_INT 0x2 /* DMA1 pending interrupt */ 886#define DMA1_INT 0x2 /* DMA1 pending interrupt */
1156#define nDMA1_INT 0x0
1157#define DMA2_INT 0x4 /* DMA2 pending interrupt */ 887#define DMA2_INT 0x4 /* DMA2 pending interrupt */
1158#define nDMA2_INT 0x0
1159#define DMA3_INT 0x8 /* DMA3 pending interrupt */ 888#define DMA3_INT 0x8 /* DMA3 pending interrupt */
1160#define nDMA3_INT 0x0
1161#define DMA4_INT 0x10 /* DMA4 pending interrupt */ 889#define DMA4_INT 0x10 /* DMA4 pending interrupt */
1162#define nDMA4_INT 0x0
1163#define DMA5_INT 0x20 /* DMA5 pending interrupt */ 890#define DMA5_INT 0x20 /* DMA5 pending interrupt */
1164#define nDMA5_INT 0x0
1165#define DMA6_INT 0x40 /* DMA6 pending interrupt */ 891#define DMA6_INT 0x40 /* DMA6 pending interrupt */
1166#define nDMA6_INT 0x0
1167#define DMA7_INT 0x80 /* DMA7 pending interrupt */ 892#define DMA7_INT 0x80 /* DMA7 pending interrupt */
1168#define nDMA7_INT 0x0
1169 893
1170/* Bit masks for USB_DMAxCONTROL */ 894/* Bit masks for USB_DMAxCONTROL */
1171 895
1172#define DMA_ENA 0x1 /* DMA enable */ 896#define DMA_ENA 0x1 /* DMA enable */
1173#define nDMA_ENA 0x0
1174#define DIRECTION 0x2 /* direction of DMA transfer */ 897#define DIRECTION 0x2 /* direction of DMA transfer */
1175#define nDIRECTION 0x0
1176#define MODE 0x4 /* DMA Bus error */ 898#define MODE 0x4 /* DMA Bus error */
1177#define nMODE 0x0
1178#define INT_ENA 0x8 /* Interrupt enable */ 899#define INT_ENA 0x8 /* Interrupt enable */
1179#define nINT_ENA 0x0
1180#define EPNUM 0xf0 /* EP number */ 900#define EPNUM 0xf0 /* EP number */
1181#define BUSERROR 0x100 /* DMA Bus error */ 901#define BUSERROR 0x100 /* DMA Bus error */
1182#define nBUSERROR 0x0
1183 902
1184/* Bit masks for USB_DMAxADDRHIGH */ 903/* Bit masks for USB_DMAxADDRHIGH */
1185 904
diff --git a/include/asm-blackfin/mach-bf548/defBF544.h b/include/asm-blackfin/mach-bf548/defBF544.h
index 8fc77ea12aa9..dd955dcd39b8 100644
--- a/include/asm-blackfin/mach-bf548/defBF544.h
+++ b/include/asm-blackfin/mach-bf548/defBF544.h
@@ -538,21 +538,13 @@
538/* Bit masks for PIXC_CTL */ 538/* Bit masks for PIXC_CTL */
539 539
540#define PIXC_EN 0x1 /* Pixel Compositor Enable */ 540#define PIXC_EN 0x1 /* Pixel Compositor Enable */
541#define nPIXC_EN 0x0
542#define OVR_A_EN 0x2 /* Overlay A Enable */ 541#define OVR_A_EN 0x2 /* Overlay A Enable */
543#define nOVR_A_EN 0x0
544#define OVR_B_EN 0x4 /* Overlay B Enable */ 542#define OVR_B_EN 0x4 /* Overlay B Enable */
545#define nOVR_B_EN 0x0
546#define IMG_FORM 0x8 /* Image Data Format */ 543#define IMG_FORM 0x8 /* Image Data Format */
547#define nIMG_FORM 0x0
548#define OVR_FORM 0x10 /* Overlay Data Format */ 544#define OVR_FORM 0x10 /* Overlay Data Format */
549#define nOVR_FORM 0x0
550#define OUT_FORM 0x20 /* Output Data Format */ 545#define OUT_FORM 0x20 /* Output Data Format */
551#define nOUT_FORM 0x0
552#define UDS_MOD 0x40 /* Resampling Mode */ 546#define UDS_MOD 0x40 /* Resampling Mode */
553#define nUDS_MOD 0x0
554#define TC_EN 0x80 /* Transparent Color Enable */ 547#define TC_EN 0x80 /* Transparent Color Enable */
555#define nTC_EN 0x0
556#define IMG_STAT 0x300 /* Image FIFO Status */ 548#define IMG_STAT 0x300 /* Image FIFO Status */
557#define OVR_STAT 0xc00 /* Overlay FIFO Status */ 549#define OVR_STAT 0xc00 /* Overlay FIFO Status */
558#define WM_LVL 0x3000 /* FIFO Watermark Level */ 550#define WM_LVL 0x3000 /* FIFO Watermark Level */
@@ -600,13 +592,9 @@
600/* Bit masks for PIXC_INTRSTAT */ 592/* Bit masks for PIXC_INTRSTAT */
601 593
602#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */ 594#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */
603#define nOVR_INT_EN 0x0
604#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */ 595#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */
605#define nFRM_INT_EN 0x0
606#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */ 596#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */
607#define nOVR_INT_STAT 0x0
608#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */ 597#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */
609#define nFRM_INT_STAT 0x0
610 598
611/* Bit masks for PIXC_RYCON */ 599/* Bit masks for PIXC_RYCON */
612 600
@@ -614,7 +602,6 @@
614#define A12 0xffc00 /* A12 in the Coefficient Matrix */ 602#define A12 0xffc00 /* A12 in the Coefficient Matrix */
615#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */ 603#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */
616#define RY_MULT4 0x40000000 /* Multiply Row by 4 */ 604#define RY_MULT4 0x40000000 /* Multiply Row by 4 */
617#define nRY_MULT4 0x0
618 605
619/* Bit masks for PIXC_GUCON */ 606/* Bit masks for PIXC_GUCON */
620 607
@@ -622,7 +609,6 @@
622#define A22 0xffc00 /* A22 in the Coefficient Matrix */ 609#define A22 0xffc00 /* A22 in the Coefficient Matrix */
623#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */ 610#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */
624#define GU_MULT4 0x40000000 /* Multiply Row by 4 */ 611#define GU_MULT4 0x40000000 /* Multiply Row by 4 */
625#define nGU_MULT4 0x0
626 612
627/* Bit masks for PIXC_BVCON */ 613/* Bit masks for PIXC_BVCON */
628 614
@@ -630,7 +616,6 @@
630#define A32 0xffc00 /* A32 in the Coefficient Matrix */ 616#define A32 0xffc00 /* A32 in the Coefficient Matrix */
631#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */ 617#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */
632#define BV_MULT4 0x40000000 /* Multiply Row by 4 */ 618#define BV_MULT4 0x40000000 /* Multiply Row by 4 */
633#define nBV_MULT4 0x0
634 619
635/* Bit masks for PIXC_CCBIAS */ 620/* Bit masks for PIXC_CCBIAS */
636 621
@@ -647,48 +632,28 @@
647/* Bit masks for HOST_CONTROL */ 632/* Bit masks for HOST_CONTROL */
648 633
649#define HOST_EN 0x1 /* Host Enable */ 634#define HOST_EN 0x1 /* Host Enable */
650#define nHOST_EN 0x0
651#define HOST_END 0x2 /* Host Endianess */ 635#define HOST_END 0x2 /* Host Endianess */
652#define nHOST_END 0x0
653#define DATA_SIZE 0x4 /* Data Size */ 636#define DATA_SIZE 0x4 /* Data Size */
654#define nDATA_SIZE 0x0
655#define HOST_RST 0x8 /* Host Reset */ 637#define HOST_RST 0x8 /* Host Reset */
656#define nHOST_RST 0x0
657#define HRDY_OVR 0x20 /* Host Ready Override */ 638#define HRDY_OVR 0x20 /* Host Ready Override */
658#define nHRDY_OVR 0x0
659#define INT_MODE 0x40 /* Interrupt Mode */ 639#define INT_MODE 0x40 /* Interrupt Mode */
660#define nINT_MODE 0x0
661#define BT_EN 0x80 /* Bus Timeout Enable */ 640#define BT_EN 0x80 /* Bus Timeout Enable */
662#define nBT_EN 0x0
663#define EHW 0x100 /* Enable Host Write */ 641#define EHW 0x100 /* Enable Host Write */
664#define nEHW 0x0
665#define EHR 0x200 /* Enable Host Read */ 642#define EHR 0x200 /* Enable Host Read */
666#define nEHR 0x0
667#define BDR 0x400 /* Burst DMA Requests */ 643#define BDR 0x400 /* Burst DMA Requests */
668#define nBDR 0x0
669 644
670/* Bit masks for HOST_STATUS */ 645/* Bit masks for HOST_STATUS */
671 646
672#define READY 0x1 /* DMA Ready */ 647#define READY 0x1 /* DMA Ready */
673#define nREADY 0x0
674#define FIFOFULL 0x2 /* FIFO Full */ 648#define FIFOFULL 0x2 /* FIFO Full */
675#define nFIFOFULL 0x0
676#define FIFOEMPTY 0x4 /* FIFO Empty */ 649#define FIFOEMPTY 0x4 /* FIFO Empty */
677#define nFIFOEMPTY 0x0
678#define COMPLETE 0x8 /* DMA Complete */ 650#define COMPLETE 0x8 /* DMA Complete */
679#define nCOMPLETE 0x0
680#define HSHK 0x10 /* Host Handshake */ 651#define HSHK 0x10 /* Host Handshake */
681#define nHSHK 0x0
682#define TIMEOUT 0x20 /* Host Timeout */ 652#define TIMEOUT 0x20 /* Host Timeout */
683#define nTIMEOUT 0x0
684#define HIRQ 0x40 /* Host Interrupt Request */ 653#define HIRQ 0x40 /* Host Interrupt Request */
685#define nHIRQ 0x0
686#define ALLOW_CNFG 0x80 /* Allow New Configuration */ 654#define ALLOW_CNFG 0x80 /* Allow New Configuration */
687#define nALLOW_CNFG 0x0
688#define DMA_DIR 0x100 /* DMA Direction */ 655#define DMA_DIR 0x100 /* DMA Direction */
689#define nDMA_DIR 0x0
690#define BTE 0x200 /* Bus Timeout Enabled */ 656#define BTE 0x200 /* Bus Timeout Enabled */
691#define nBTE 0x0
692 657
693/* Bit masks for HOST_TIMEOUT */ 658/* Bit masks for HOST_TIMEOUT */
694 659
@@ -697,67 +662,42 @@
697/* Bit masks for TIMER_ENABLE1 */ 662/* Bit masks for TIMER_ENABLE1 */
698 663
699#define TIMEN8 0x1 /* Timer 8 Enable */ 664#define TIMEN8 0x1 /* Timer 8 Enable */
700#define nTIMEN8 0x0
701#define TIMEN9 0x2 /* Timer 9 Enable */ 665#define TIMEN9 0x2 /* Timer 9 Enable */
702#define nTIMEN9 0x0
703#define TIMEN10 0x4 /* Timer 10 Enable */ 666#define TIMEN10 0x4 /* Timer 10 Enable */
704#define nTIMEN10 0x0
705 667
706/* Bit masks for TIMER_DISABLE1 */ 668/* Bit masks for TIMER_DISABLE1 */
707 669
708#define TIMDIS8 0x1 /* Timer 8 Disable */ 670#define TIMDIS8 0x1 /* Timer 8 Disable */
709#define nTIMDIS8 0x0
710#define TIMDIS9 0x2 /* Timer 9 Disable */ 671#define TIMDIS9 0x2 /* Timer 9 Disable */
711#define nTIMDIS9 0x0
712#define TIMDIS10 0x4 /* Timer 10 Disable */ 672#define TIMDIS10 0x4 /* Timer 10 Disable */
713#define nTIMDIS10 0x0
714 673
715/* Bit masks for TIMER_STATUS1 */ 674/* Bit masks for TIMER_STATUS1 */
716 675
717#define TIMIL8 0x1 /* Timer 8 Interrupt */ 676#define TIMIL8 0x1 /* Timer 8 Interrupt */
718#define nTIMIL8 0x0
719#define TIMIL9 0x2 /* Timer 9 Interrupt */ 677#define TIMIL9 0x2 /* Timer 9 Interrupt */
720#define nTIMIL9 0x0
721#define TIMIL10 0x4 /* Timer 10 Interrupt */ 678#define TIMIL10 0x4 /* Timer 10 Interrupt */
722#define nTIMIL10 0x0
723#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */ 679#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */
724#define nTOVF_ERR8 0x0
725#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */ 680#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */
726#define nTOVF_ERR9 0x0
727#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */ 681#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */
728#define nTOVF_ERR10 0x0
729#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */ 682#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */
730#define nTRUN8 0x0
731#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */ 683#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */
732#define nTRUN9 0x0
733#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */ 684#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */
734#define nTRUN10 0x0
735 685
736/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */ 686/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */
737 687
738/* Bit masks for HMDMAx_CONTROL */ 688/* Bit masks for HMDMAx_CONTROL */
739 689
740#define HMDMAEN 0x1 /* Handshake MDMA Enable */ 690#define HMDMAEN 0x1 /* Handshake MDMA Enable */
741#define nHMDMAEN 0x0
742#define REP 0x2 /* Handshake MDMA Request Polarity */ 691#define REP 0x2 /* Handshake MDMA Request Polarity */
743#define nREP 0x0
744#define UTE 0x8 /* Urgency Threshold Enable */ 692#define UTE 0x8 /* Urgency Threshold Enable */
745#define nUTE 0x0
746#define OIE 0x10 /* Overflow Interrupt Enable */ 693#define OIE 0x10 /* Overflow Interrupt Enable */
747#define nOIE 0x0
748#define BDIE 0x20 /* Block Done Interrupt Enable */ 694#define BDIE 0x20 /* Block Done Interrupt Enable */
749#define nBDIE 0x0
750#define MBDI 0x40 /* Mask Block Done Interrupt */ 695#define MBDI 0x40 /* Mask Block Done Interrupt */
751#define nMBDI 0x0
752#define DRQ 0x300 /* Handshake MDMA Request Type */ 696#define DRQ 0x300 /* Handshake MDMA Request Type */
753#define RBC 0x1000 /* Force Reload of BCOUNT */ 697#define RBC 0x1000 /* Force Reload of BCOUNT */
754#define nRBC 0x0
755#define PS 0x2000 /* Pin Status */ 698#define PS 0x2000 /* Pin Status */
756#define nPS 0x0
757#define OI 0x4000 /* Overflow Interrupt Generated */ 699#define OI 0x4000 /* Overflow Interrupt Generated */
758#define nOI 0x0
759#define BDI 0x8000 /* Block Done Interrupt Generated */ 700#define BDI 0x8000 /* Block Done Interrupt Generated */
760#define nBDI 0x0
761 701
762/* ******************************************* */ 702/* ******************************************* */
763/* MULTI BIT MACRO ENUMERATIONS */ 703/* MULTI BIT MACRO ENUMERATIONS */
diff --git a/include/asm-blackfin/mach-bf548/defBF548.h b/include/asm-blackfin/mach-bf548/defBF548.h
index d9e3062a9117..8d4214e0807c 100644
--- a/include/asm-blackfin/mach-bf548/defBF548.h
+++ b/include/asm-blackfin/mach-bf548/defBF548.h
@@ -899,21 +899,13 @@
899/* Bit masks for PIXC_CTL */ 899/* Bit masks for PIXC_CTL */
900 900
901#define PIXC_EN 0x1 /* Pixel Compositor Enable */ 901#define PIXC_EN 0x1 /* Pixel Compositor Enable */
902#define nPIXC_EN 0x0
903#define OVR_A_EN 0x2 /* Overlay A Enable */ 902#define OVR_A_EN 0x2 /* Overlay A Enable */
904#define nOVR_A_EN 0x0
905#define OVR_B_EN 0x4 /* Overlay B Enable */ 903#define OVR_B_EN 0x4 /* Overlay B Enable */
906#define nOVR_B_EN 0x0
907#define IMG_FORM 0x8 /* Image Data Format */ 904#define IMG_FORM 0x8 /* Image Data Format */
908#define nIMG_FORM 0x0
909#define OVR_FORM 0x10 /* Overlay Data Format */ 905#define OVR_FORM 0x10 /* Overlay Data Format */
910#define nOVR_FORM 0x0
911#define OUT_FORM 0x20 /* Output Data Format */ 906#define OUT_FORM 0x20 /* Output Data Format */
912#define nOUT_FORM 0x0
913#define UDS_MOD 0x40 /* Resampling Mode */ 907#define UDS_MOD 0x40 /* Resampling Mode */
914#define nUDS_MOD 0x0
915#define TC_EN 0x80 /* Transparent Color Enable */ 908#define TC_EN 0x80 /* Transparent Color Enable */
916#define nTC_EN 0x0
917#define IMG_STAT 0x300 /* Image FIFO Status */ 909#define IMG_STAT 0x300 /* Image FIFO Status */
918#define OVR_STAT 0xc00 /* Overlay FIFO Status */ 910#define OVR_STAT 0xc00 /* Overlay FIFO Status */
919#define WM_LVL 0x3000 /* FIFO Watermark Level */ 911#define WM_LVL 0x3000 /* FIFO Watermark Level */
@@ -961,13 +953,9 @@
961/* Bit masks for PIXC_INTRSTAT */ 953/* Bit masks for PIXC_INTRSTAT */
962 954
963#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */ 955#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */
964#define nOVR_INT_EN 0x0
965#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */ 956#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */
966#define nFRM_INT_EN 0x0
967#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */ 957#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */
968#define nOVR_INT_STAT 0x0
969#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */ 958#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */
970#define nFRM_INT_STAT 0x0
971 959
972/* Bit masks for PIXC_RYCON */ 960/* Bit masks for PIXC_RYCON */
973 961
@@ -975,7 +963,6 @@
975#define A12 0xffc00 /* A12 in the Coefficient Matrix */ 963#define A12 0xffc00 /* A12 in the Coefficient Matrix */
976#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */ 964#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */
977#define RY_MULT4 0x40000000 /* Multiply Row by 4 */ 965#define RY_MULT4 0x40000000 /* Multiply Row by 4 */
978#define nRY_MULT4 0x0
979 966
980/* Bit masks for PIXC_GUCON */ 967/* Bit masks for PIXC_GUCON */
981 968
@@ -983,7 +970,6 @@
983#define A22 0xffc00 /* A22 in the Coefficient Matrix */ 970#define A22 0xffc00 /* A22 in the Coefficient Matrix */
984#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */ 971#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */
985#define GU_MULT4 0x40000000 /* Multiply Row by 4 */ 972#define GU_MULT4 0x40000000 /* Multiply Row by 4 */
986#define nGU_MULT4 0x0
987 973
988/* Bit masks for PIXC_BVCON */ 974/* Bit masks for PIXC_BVCON */
989 975
@@ -991,7 +977,6 @@
991#define A32 0xffc00 /* A32 in the Coefficient Matrix */ 977#define A32 0xffc00 /* A32 in the Coefficient Matrix */
992#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */ 978#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */
993#define BV_MULT4 0x40000000 /* Multiply Row by 4 */ 979#define BV_MULT4 0x40000000 /* Multiply Row by 4 */
994#define nBV_MULT4 0x0
995 980
996/* Bit masks for PIXC_CCBIAS */ 981/* Bit masks for PIXC_CCBIAS */
997 982
@@ -1008,48 +993,28 @@
1008/* Bit masks for HOST_CONTROL */ 993/* Bit masks for HOST_CONTROL */
1009 994
1010#define HOST_EN 0x1 /* Host Enable */ 995#define HOST_EN 0x1 /* Host Enable */
1011#define nHOST_EN 0x0
1012#define HOST_END 0x2 /* Host Endianess */ 996#define HOST_END 0x2 /* Host Endianess */
1013#define nHOST_END 0x0
1014#define DATA_SIZE 0x4 /* Data Size */ 997#define DATA_SIZE 0x4 /* Data Size */
1015#define nDATA_SIZE 0x0
1016#define HOST_RST 0x8 /* Host Reset */ 998#define HOST_RST 0x8 /* Host Reset */
1017#define nHOST_RST 0x0
1018#define HRDY_OVR 0x20 /* Host Ready Override */ 999#define HRDY_OVR 0x20 /* Host Ready Override */
1019#define nHRDY_OVR 0x0
1020#define INT_MODE 0x40 /* Interrupt Mode */ 1000#define INT_MODE 0x40 /* Interrupt Mode */
1021#define nINT_MODE 0x0
1022#define BT_EN 0x80 /* Bus Timeout Enable */ 1001#define BT_EN 0x80 /* Bus Timeout Enable */
1023#define nBT_EN 0x0
1024#define EHW 0x100 /* Enable Host Write */ 1002#define EHW 0x100 /* Enable Host Write */
1025#define nEHW 0x0
1026#define EHR 0x200 /* Enable Host Read */ 1003#define EHR 0x200 /* Enable Host Read */
1027#define nEHR 0x0
1028#define BDR 0x400 /* Burst DMA Requests */ 1004#define BDR 0x400 /* Burst DMA Requests */
1029#define nBDR 0x0
1030 1005
1031/* Bit masks for HOST_STATUS */ 1006/* Bit masks for HOST_STATUS */
1032 1007
1033#define READY 0x1 /* DMA Ready */ 1008#define READY 0x1 /* DMA Ready */
1034#define nREADY 0x0
1035#define FIFOFULL 0x2 /* FIFO Full */ 1009#define FIFOFULL 0x2 /* FIFO Full */
1036#define nFIFOFULL 0x0
1037#define FIFOEMPTY 0x4 /* FIFO Empty */ 1010#define FIFOEMPTY 0x4 /* FIFO Empty */
1038#define nFIFOEMPTY 0x0
1039#define COMPLETE 0x8 /* DMA Complete */ 1011#define COMPLETE 0x8 /* DMA Complete */
1040#define nCOMPLETE 0x0
1041#define HSHK 0x10 /* Host Handshake */ 1012#define HSHK 0x10 /* Host Handshake */
1042#define nHSHK 0x0
1043#define TIMEOUT 0x20 /* Host Timeout */ 1013#define TIMEOUT 0x20 /* Host Timeout */
1044#define nTIMEOUT 0x0
1045#define HIRQ 0x40 /* Host Interrupt Request */ 1014#define HIRQ 0x40 /* Host Interrupt Request */
1046#define nHIRQ 0x0
1047#define ALLOW_CNFG 0x80 /* Allow New Configuration */ 1015#define ALLOW_CNFG 0x80 /* Allow New Configuration */
1048#define nALLOW_CNFG 0x0
1049#define DMA_DIR 0x100 /* DMA Direction */ 1016#define DMA_DIR 0x100 /* DMA Direction */
1050#define nDMA_DIR 0x0
1051#define BTE 0x200 /* Bus Timeout Enabled */ 1017#define BTE 0x200 /* Bus Timeout Enabled */
1052#define nBTE 0x0
1053 1018
1054/* Bit masks for HOST_TIMEOUT */ 1019/* Bit masks for HOST_TIMEOUT */
1055 1020
@@ -1058,7 +1023,6 @@
1058/* Bit masks for KPAD_CTL */ 1023/* Bit masks for KPAD_CTL */
1059 1024
1060#define KPAD_EN 0x1 /* Keypad Enable */ 1025#define KPAD_EN 0x1 /* Keypad Enable */
1061#define nKPAD_EN 0x0
1062#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */ 1026#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */
1063#define KPAD_ROWEN 0x1c00 /* Row Enable Width */ 1027#define KPAD_ROWEN 0x1c00 /* Row Enable Width */
1064#define KPAD_COLEN 0xe000 /* Column Enable Width */ 1028#define KPAD_COLEN 0xe000 /* Column Enable Width */
@@ -1080,29 +1044,21 @@
1080/* Bit masks for KPAD_STAT */ 1044/* Bit masks for KPAD_STAT */
1081 1045
1082#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */ 1046#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */
1083#define nKPAD_IRQ 0x0
1084#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */ 1047#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */
1085#define KPAD_PRESSED 0x8 /* Key press current status */ 1048#define KPAD_PRESSED 0x8 /* Key press current status */
1086#define nKPAD_PRESSED 0x0
1087 1049
1088/* Bit masks for KPAD_SOFTEVAL */ 1050/* Bit masks for KPAD_SOFTEVAL */
1089 1051
1090#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */ 1052#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */
1091#define nKPAD_SOFTEVAL_E 0x0
1092 1053
1093/* Bit masks for SDH_COMMAND */ 1054/* Bit masks for SDH_COMMAND */
1094 1055
1095#define CMD_IDX 0x3f /* Command Index */ 1056#define CMD_IDX 0x3f /* Command Index */
1096#define CMD_RSP 0x40 /* Response */ 1057#define CMD_RSP 0x40 /* Response */
1097#define nCMD_RSP 0x0
1098#define CMD_L_RSP 0x80 /* Long Response */ 1058#define CMD_L_RSP 0x80 /* Long Response */
1099#define nCMD_L_RSP 0x0
1100#define CMD_INT_E 0x100 /* Command Interrupt */ 1059#define CMD_INT_E 0x100 /* Command Interrupt */
1101#define nCMD_INT_E 0x0
1102#define CMD_PEND_E 0x200 /* Command Pending */ 1060#define CMD_PEND_E 0x200 /* Command Pending */
1103#define nCMD_PEND_E 0x0
1104#define CMD_E 0x400 /* Command Enable */ 1061#define CMD_E 0x400 /* Command Enable */
1105#define nCMD_E 0x0
1106 1062
1107/* Bit masks for SDH_PWR_CTL */ 1063/* Bit masks for SDH_PWR_CTL */
1108 1064
@@ -1111,21 +1067,15 @@
1111#define TBD 0x3c /* TBD */ 1067#define TBD 0x3c /* TBD */
1112#endif 1068#endif
1113#define SD_CMD_OD 0x40 /* Open Drain Output */ 1069#define SD_CMD_OD 0x40 /* Open Drain Output */
1114#define nSD_CMD_OD 0x0
1115#define ROD_CTL 0x80 /* Rod Control */ 1070#define ROD_CTL 0x80 /* Rod Control */
1116#define nROD_CTL 0x0
1117 1071
1118/* Bit masks for SDH_CLK_CTL */ 1072/* Bit masks for SDH_CLK_CTL */
1119 1073
1120#define CLKDIV 0xff /* MC_CLK Divisor */ 1074#define CLKDIV 0xff /* MC_CLK Divisor */
1121#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */ 1075#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
1122#define nCLK_E 0x0
1123#define PWR_SV_E 0x200 /* Power Save Enable */ 1076#define PWR_SV_E 0x200 /* Power Save Enable */
1124#define nPWR_SV_E 0x0
1125#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */ 1077#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
1126#define nCLKDIV_BYPASS 0x0
1127#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */ 1078#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
1128#define nWIDE_BUS 0x0
1129 1079
1130/* Bit masks for SDH_RESP_CMD */ 1080/* Bit masks for SDH_RESP_CMD */
1131 1081
@@ -1134,133 +1084,74 @@
1134/* Bit masks for SDH_DATA_CTL */ 1084/* Bit masks for SDH_DATA_CTL */
1135 1085
1136#define DTX_E 0x1 /* Data Transfer Enable */ 1086#define DTX_E 0x1 /* Data Transfer Enable */
1137#define nDTX_E 0x0
1138#define DTX_DIR 0x2 /* Data Transfer Direction */ 1087#define DTX_DIR 0x2 /* Data Transfer Direction */
1139#define nDTX_DIR 0x0
1140#define DTX_MODE 0x4 /* Data Transfer Mode */ 1088#define DTX_MODE 0x4 /* Data Transfer Mode */
1141#define nDTX_MODE 0x0
1142#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */ 1089#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
1143#define nDTX_DMA_E 0x0
1144#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */ 1090#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
1145 1091
1146/* Bit masks for SDH_STATUS */ 1092/* Bit masks for SDH_STATUS */
1147 1093
1148#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */ 1094#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
1149#define nCMD_CRC_FAIL 0x0
1150#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */ 1095#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
1151#define nDAT_CRC_FAIL 0x0
1152#define CMD_TIMEOUT 0x4 /* CMD Time Out */ 1096#define CMD_TIMEOUT 0x4 /* CMD Time Out */
1153#define nCMD_TIMEOUT 0x0
1154#define DAT_TIMEOUT 0x8 /* Data Time Out */ 1097#define DAT_TIMEOUT 0x8 /* Data Time Out */
1155#define nDAT_TIMEOUT 0x0
1156#define TX_UNDERRUN 0x10 /* Transmit Underrun */ 1098#define TX_UNDERRUN 0x10 /* Transmit Underrun */
1157#define nTX_UNDERRUN 0x0
1158#define RX_OVERRUN 0x20 /* Receive Overrun */ 1099#define RX_OVERRUN 0x20 /* Receive Overrun */
1159#define nRX_OVERRUN 0x0
1160#define CMD_RESP_END 0x40 /* CMD Response End */ 1100#define CMD_RESP_END 0x40 /* CMD Response End */
1161#define nCMD_RESP_END 0x0
1162#define CMD_SENT 0x80 /* CMD Sent */ 1101#define CMD_SENT 0x80 /* CMD Sent */
1163#define nCMD_SENT 0x0
1164#define DAT_END 0x100 /* Data End */ 1102#define DAT_END 0x100 /* Data End */
1165#define nDAT_END 0x0
1166#define START_BIT_ERR 0x200 /* Start Bit Error */ 1103#define START_BIT_ERR 0x200 /* Start Bit Error */
1167#define nSTART_BIT_ERR 0x0
1168#define DAT_BLK_END 0x400 /* Data Block End */ 1104#define DAT_BLK_END 0x400 /* Data Block End */
1169#define nDAT_BLK_END 0x0
1170#define CMD_ACT 0x800 /* CMD Active */ 1105#define CMD_ACT 0x800 /* CMD Active */
1171#define nCMD_ACT 0x0
1172#define TX_ACT 0x1000 /* Transmit Active */ 1106#define TX_ACT 0x1000 /* Transmit Active */
1173#define nTX_ACT 0x0
1174#define RX_ACT 0x2000 /* Receive Active */ 1107#define RX_ACT 0x2000 /* Receive Active */
1175#define nRX_ACT 0x0
1176#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */ 1108#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
1177#define nTX_FIFO_STAT 0x0
1178#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */ 1109#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
1179#define nRX_FIFO_STAT 0x0
1180#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */ 1110#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
1181#define nTX_FIFO_FULL 0x0
1182#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */ 1111#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
1183#define nRX_FIFO_FULL 0x0
1184#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */ 1112#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
1185#define nTX_FIFO_ZERO 0x0
1186#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */ 1113#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
1187#define nRX_DAT_ZERO 0x0
1188#define TX_DAT_RDY 0x100000 /* Transmit Data Available */ 1114#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
1189#define nTX_DAT_RDY 0x0
1190#define RX_FIFO_RDY 0x200000 /* Receive Data Available */ 1115#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
1191#define nRX_FIFO_RDY 0x0
1192 1116
1193/* Bit masks for SDH_STATUS_CLR */ 1117/* Bit masks for SDH_STATUS_CLR */
1194 1118
1195#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */ 1119#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
1196#define nCMD_CRC_FAIL_STAT 0x0
1197#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */ 1120#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
1198#define nDAT_CRC_FAIL_STAT 0x0
1199#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */ 1121#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
1200#define nCMD_TIMEOUT_STAT 0x0
1201#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */ 1122#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
1202#define nDAT_TIMEOUT_STAT 0x0
1203#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */ 1123#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
1204#define nTX_UNDERRUN_STAT 0x0
1205#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */ 1124#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
1206#define nRX_OVERRUN_STAT 0x0
1207#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */ 1125#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
1208#define nCMD_RESP_END_STAT 0x0
1209#define CMD_SENT_STAT 0x80 /* CMD Sent Status */ 1126#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
1210#define nCMD_SENT_STAT 0x0
1211#define DAT_END_STAT 0x100 /* Data End Status */ 1127#define DAT_END_STAT 0x100 /* Data End Status */
1212#define nDAT_END_STAT 0x0
1213#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */ 1128#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
1214#define nSTART_BIT_ERR_STAT 0x0
1215#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */ 1129#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
1216#define nDAT_BLK_END_STAT 0x0
1217 1130
1218/* Bit masks for SDH_MASK0 */ 1131/* Bit masks for SDH_MASK0 */
1219 1132
1220#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */ 1133#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
1221#define nCMD_CRC_FAIL_MASK 0x0
1222#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */ 1134#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
1223#define nDAT_CRC_FAIL_MASK 0x0
1224#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */ 1135#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
1225#define nCMD_TIMEOUT_MASK 0x0
1226#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */ 1136#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
1227#define nDAT_TIMEOUT_MASK 0x0
1228#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */ 1137#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
1229#define nTX_UNDERRUN_MASK 0x0
1230#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */ 1138#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
1231#define nRX_OVERRUN_MASK 0x0
1232#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */ 1139#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
1233#define nCMD_RESP_END_MASK 0x0
1234#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */ 1140#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
1235#define nCMD_SENT_MASK 0x0
1236#define DAT_END_MASK 0x100 /* Data End Mask */ 1141#define DAT_END_MASK 0x100 /* Data End Mask */
1237#define nDAT_END_MASK 0x0
1238#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */ 1142#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
1239#define nSTART_BIT_ERR_MASK 0x0
1240#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */ 1143#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
1241#define nDAT_BLK_END_MASK 0x0
1242#define CMD_ACT_MASK 0x800 /* CMD Active Mask */ 1144#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
1243#define nCMD_ACT_MASK 0x0
1244#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */ 1145#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
1245#define nTX_ACT_MASK 0x0
1246#define RX_ACT_MASK 0x2000 /* Receive Active Mask */ 1146#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
1247#define nRX_ACT_MASK 0x0
1248#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */ 1147#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
1249#define nTX_FIFO_STAT_MASK 0x0
1250#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */ 1148#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
1251#define nRX_FIFO_STAT_MASK 0x0
1252#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */ 1149#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
1253#define nTX_FIFO_FULL_MASK 0x0
1254#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */ 1150#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
1255#define nRX_FIFO_FULL_MASK 0x0
1256#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */ 1151#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
1257#define nTX_FIFO_ZERO_MASK 0x0
1258#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */ 1152#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
1259#define nRX_DAT_ZERO_MASK 0x0
1260#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */ 1153#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
1261#define nTX_DAT_RDY_MASK 0x0
1262#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */ 1154#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
1263#define nRX_FIFO_RDY_MASK 0x0
1264 1155
1265/* Bit masks for SDH_FIFO_CNT */ 1156/* Bit masks for SDH_FIFO_CNT */
1266 1157
@@ -1269,73 +1160,47 @@
1269/* Bit masks for SDH_E_STATUS */ 1160/* Bit masks for SDH_E_STATUS */
1270 1161
1271#define SDIO_INT_DET 0x2 /* SDIO Int Detected */ 1162#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
1272#define nSDIO_INT_DET 0x0
1273#define SD_CARD_DET 0x10 /* SD Card Detect */ 1163#define SD_CARD_DET 0x10 /* SD Card Detect */
1274#define nSD_CARD_DET 0x0
1275 1164
1276/* Bit masks for SDH_E_MASK */ 1165/* Bit masks for SDH_E_MASK */
1277 1166
1278#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */ 1167#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
1279#define nSDIO_MSK 0x0
1280#define SCD_MSK 0x40 /* Mask Card Detect */ 1168#define SCD_MSK 0x40 /* Mask Card Detect */
1281#define nSCD_MSK 0x0
1282 1169
1283/* Bit masks for SDH_CFG */ 1170/* Bit masks for SDH_CFG */
1284 1171
1285#define CLKS_EN 0x1 /* Clocks Enable */ 1172#define CLKS_EN 0x1 /* Clocks Enable */
1286#define nCLKS_EN 0x0
1287#define SD4E 0x4 /* SDIO 4-Bit Enable */ 1173#define SD4E 0x4 /* SDIO 4-Bit Enable */
1288#define nSD4E 0x0
1289#define MWE 0x8 /* Moving Window Enable */ 1174#define MWE 0x8 /* Moving Window Enable */
1290#define nMWE 0x0
1291#define SD_RST 0x10 /* SDMMC Reset */ 1175#define SD_RST 0x10 /* SDMMC Reset */
1292#define nSD_RST 0x0
1293#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */ 1176#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
1294#define nPUP_SDDAT 0x0
1295#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */ 1177#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
1296#define nPUP_SDDAT3 0x0
1297#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */ 1178#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
1298#define nPD_SDDAT3 0x0
1299 1179
1300/* Bit masks for SDH_RD_WAIT_EN */ 1180/* Bit masks for SDH_RD_WAIT_EN */
1301 1181
1302#define RWR 0x1 /* Read Wait Request */ 1182#define RWR 0x1 /* Read Wait Request */
1303#define nRWR 0x0
1304 1183
1305/* Bit masks for ATAPI_CONTROL */ 1184/* Bit masks for ATAPI_CONTROL */
1306 1185
1307#define PIO_START 0x1 /* Start PIO/Reg Op */ 1186#define PIO_START 0x1 /* Start PIO/Reg Op */
1308#define nPIO_START 0x0
1309#define MULTI_START 0x2 /* Start Multi-DMA Op */ 1187#define MULTI_START 0x2 /* Start Multi-DMA Op */
1310#define nMULTI_START 0x0
1311#define ULTRA_START 0x4 /* Start Ultra-DMA Op */ 1188#define ULTRA_START 0x4 /* Start Ultra-DMA Op */
1312#define nULTRA_START 0x0
1313#define XFER_DIR 0x8 /* Transfer Direction */ 1189#define XFER_DIR 0x8 /* Transfer Direction */
1314#define nXFER_DIR 0x0
1315#define IORDY_EN 0x10 /* IORDY Enable */ 1190#define IORDY_EN 0x10 /* IORDY Enable */
1316#define nIORDY_EN 0x0
1317#define FIFO_FLUSH 0x20 /* Flush FIFOs */ 1191#define FIFO_FLUSH 0x20 /* Flush FIFOs */
1318#define nFIFO_FLUSH 0x0
1319#define SOFT_RST 0x40 /* Soft Reset */ 1192#define SOFT_RST 0x40 /* Soft Reset */
1320#define nSOFT_RST 0x0
1321#define DEV_RST 0x80 /* Device Reset */ 1193#define DEV_RST 0x80 /* Device Reset */
1322#define nDEV_RST 0x0
1323#define TFRCNT_RST 0x100 /* Trans Count Reset */ 1194#define TFRCNT_RST 0x100 /* Trans Count Reset */
1324#define nTFRCNT_RST 0x0
1325#define END_ON_TERM 0x200 /* End/Terminate Select */ 1195#define END_ON_TERM 0x200 /* End/Terminate Select */
1326#define nEND_ON_TERM 0x0
1327#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */ 1196#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */
1328#define nPIO_USE_DMA 0x0
1329#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */ 1197#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */
1330 1198
1331/* Bit masks for ATAPI_STATUS */ 1199/* Bit masks for ATAPI_STATUS */
1332 1200
1333#define PIO_XFER_ON 0x1 /* PIO transfer in progress */ 1201#define PIO_XFER_ON 0x1 /* PIO transfer in progress */
1334#define nPIO_XFER_ON 0x0
1335#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */ 1202#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */
1336#define nMULTI_XFER_ON 0x0
1337#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */ 1203#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */
1338#define nULTRA_XFER_ON 0x0
1339#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */ 1204#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */
1340 1205
1341/* Bit masks for ATAPI_DEV_ADDR */ 1206/* Bit masks for ATAPI_DEV_ADDR */
@@ -1345,66 +1210,39 @@
1345/* Bit masks for ATAPI_INT_MASK */ 1210/* Bit masks for ATAPI_INT_MASK */
1346 1211
1347#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */ 1212#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */
1348#define nATAPI_DEV_INT_MASK 0x0
1349#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */ 1213#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */
1350#define nPIO_DONE_MASK 0x0
1351#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */ 1214#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */
1352#define nMULTI_DONE_MASK 0x0
1353#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */ 1215#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */
1354#define nUDMAIN_DONE_MASK 0x0
1355#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */ 1216#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */
1356#define nUDMAOUT_DONE_MASK 0x0
1357#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */ 1217#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */
1358#define nHOST_TERM_XFER_MASK 0x0
1359#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */ 1218#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */
1360#define nMULTI_TERM_MASK 0x0
1361#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */ 1219#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */
1362#define nUDMAIN_TERM_MASK 0x0
1363#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */ 1220#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */
1364#define nUDMAOUT_TERM_MASK 0x0
1365 1221
1366/* Bit masks for ATAPI_INT_STATUS */ 1222/* Bit masks for ATAPI_INT_STATUS */
1367 1223
1368#define ATAPI_DEV_INT 0x1 /* Device interrupt status */ 1224#define ATAPI_DEV_INT 0x1 /* Device interrupt status */
1369#define nATAPI_DEV_INT 0x0
1370#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */ 1225#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */
1371#define nPIO_DONE_INT 0x0
1372#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */ 1226#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */
1373#define nMULTI_DONE_INT 0x0
1374#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */ 1227#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */
1375#define nUDMAIN_DONE_INT 0x0
1376#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */ 1228#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */
1377#define nUDMAOUT_DONE_INT 0x0
1378#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */ 1229#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */
1379#define nHOST_TERM_XFER_INT 0x0
1380#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */ 1230#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */
1381#define nMULTI_TERM_INT 0x0
1382#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */ 1231#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */
1383#define nUDMAIN_TERM_INT 0x0
1384#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */ 1232#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */
1385#define nUDMAOUT_TERM_INT 0x0
1386 1233
1387/* Bit masks for ATAPI_LINE_STATUS */ 1234/* Bit masks for ATAPI_LINE_STATUS */
1388 1235
1389#define ATAPI_INTR 0x1 /* Device interrupt to host line status */ 1236#define ATAPI_INTR 0x1 /* Device interrupt to host line status */
1390#define nATAPI_INTR 0x0
1391#define ATAPI_DASP 0x2 /* Device dasp to host line status */ 1237#define ATAPI_DASP 0x2 /* Device dasp to host line status */
1392#define nATAPI_DASP 0x0
1393#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */ 1238#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */
1394#define nATAPI_CS0N 0x0
1395#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */ 1239#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */
1396#define nATAPI_CS1N 0x0
1397#define ATAPI_ADDR 0x70 /* ATAPI address line status */ 1240#define ATAPI_ADDR 0x70 /* ATAPI address line status */
1398#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */ 1241#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */
1399#define nATAPI_DMAREQ 0x0
1400#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */ 1242#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */
1401#define nATAPI_DMAACKN 0x0
1402#define ATAPI_DIOWN 0x200 /* ATAPI write line status */ 1243#define ATAPI_DIOWN 0x200 /* ATAPI write line status */
1403#define nATAPI_DIOWN 0x0
1404#define ATAPI_DIORN 0x400 /* ATAPI read line status */ 1244#define ATAPI_DIORN 0x400 /* ATAPI read line status */
1405#define nATAPI_DIORN 0x0
1406#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */ 1245#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */
1407#define nATAPI_IORDY 0x0
1408 1246
1409/* Bit masks for ATAPI_SM_STATE */ 1247/* Bit masks for ATAPI_SM_STATE */
1410 1248
@@ -1416,7 +1254,6 @@
1416/* Bit masks for ATAPI_TERMINATE */ 1254/* Bit masks for ATAPI_TERMINATE */
1417 1255
1418#define ATAPI_HOST_TERM 0x1 /* Host terminationation */ 1256#define ATAPI_HOST_TERM 0x1 /* Host terminationation */
1419#define nATAPI_HOST_TERM 0x0
1420 1257
1421/* Bit masks for ATAPI_REG_TIM_0 */ 1258/* Bit masks for ATAPI_REG_TIM_0 */
1422 1259
@@ -1471,41 +1308,26 @@
1471/* Bit masks for TIMER_ENABLE1 */ 1308/* Bit masks for TIMER_ENABLE1 */
1472 1309
1473#define TIMEN8 0x1 /* Timer 8 Enable */ 1310#define TIMEN8 0x1 /* Timer 8 Enable */
1474#define nTIMEN8 0x0
1475#define TIMEN9 0x2 /* Timer 9 Enable */ 1311#define TIMEN9 0x2 /* Timer 9 Enable */
1476#define nTIMEN9 0x0
1477#define TIMEN10 0x4 /* Timer 10 Enable */ 1312#define TIMEN10 0x4 /* Timer 10 Enable */
1478#define nTIMEN10 0x0
1479 1313
1480/* Bit masks for TIMER_DISABLE1 */ 1314/* Bit masks for TIMER_DISABLE1 */
1481 1315
1482#define TIMDIS8 0x1 /* Timer 8 Disable */ 1316#define TIMDIS8 0x1 /* Timer 8 Disable */
1483#define nTIMDIS8 0x0
1484#define TIMDIS9 0x2 /* Timer 9 Disable */ 1317#define TIMDIS9 0x2 /* Timer 9 Disable */
1485#define nTIMDIS9 0x0
1486#define TIMDIS10 0x4 /* Timer 10 Disable */ 1318#define TIMDIS10 0x4 /* Timer 10 Disable */
1487#define nTIMDIS10 0x0
1488 1319
1489/* Bit masks for TIMER_STATUS1 */ 1320/* Bit masks for TIMER_STATUS1 */
1490 1321
1491#define TIMIL8 0x1 /* Timer 8 Interrupt */ 1322#define TIMIL8 0x1 /* Timer 8 Interrupt */
1492#define nTIMIL8 0x0
1493#define TIMIL9 0x2 /* Timer 9 Interrupt */ 1323#define TIMIL9 0x2 /* Timer 9 Interrupt */
1494#define nTIMIL9 0x0
1495#define TIMIL10 0x4 /* Timer 10 Interrupt */ 1324#define TIMIL10 0x4 /* Timer 10 Interrupt */
1496#define nTIMIL10 0x0
1497#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */ 1325#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */
1498#define nTOVF_ERR8 0x0
1499#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */ 1326#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */
1500#define nTOVF_ERR9 0x0
1501#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */ 1327#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */
1502#define nTOVF_ERR10 0x0
1503#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */ 1328#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */
1504#define nTRUN8 0x0
1505#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */ 1329#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */
1506#define nTRUN9 0x0
1507#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */ 1330#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */
1508#define nTRUN10 0x0
1509 1331
1510/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */ 1332/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */
1511 1333
@@ -1516,131 +1338,77 @@
1516/* Bit masks for USB_POWER */ 1338/* Bit masks for USB_POWER */
1517 1339
1518#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */ 1340#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
1519#define nENABLE_SUSPENDM 0x0
1520#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */ 1341#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
1521#define nSUSPEND_MODE 0x0
1522#define RESUME_MODE 0x4 /* DMA Mode */ 1342#define RESUME_MODE 0x4 /* DMA Mode */
1523#define nRESUME_MODE 0x0
1524#define RESET 0x8 /* Reset indicator */ 1343#define RESET 0x8 /* Reset indicator */
1525#define nRESET 0x0
1526#define HS_MODE 0x10 /* High Speed mode indicator */ 1344#define HS_MODE 0x10 /* High Speed mode indicator */
1527#define nHS_MODE 0x0
1528#define HS_ENABLE 0x20 /* high Speed Enable */ 1345#define HS_ENABLE 0x20 /* high Speed Enable */
1529#define nHS_ENABLE 0x0
1530#define SOFT_CONN 0x40 /* Soft connect */ 1346#define SOFT_CONN 0x40 /* Soft connect */
1531#define nSOFT_CONN 0x0
1532#define ISO_UPDATE 0x80 /* Isochronous update */ 1347#define ISO_UPDATE 0x80 /* Isochronous update */
1533#define nISO_UPDATE 0x0
1534 1348
1535/* Bit masks for USB_INTRTX */ 1349/* Bit masks for USB_INTRTX */
1536 1350
1537#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */ 1351#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
1538#define nEP0_TX 0x0
1539#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */ 1352#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
1540#define nEP1_TX 0x0
1541#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */ 1353#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
1542#define nEP2_TX 0x0
1543#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */ 1354#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
1544#define nEP3_TX 0x0
1545#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */ 1355#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
1546#define nEP4_TX 0x0
1547#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */ 1356#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
1548#define nEP5_TX 0x0
1549#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */ 1357#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
1550#define nEP6_TX 0x0
1551#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */ 1358#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
1552#define nEP7_TX 0x0
1553 1359
1554/* Bit masks for USB_INTRRX */ 1360/* Bit masks for USB_INTRRX */
1555 1361
1556#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */ 1362#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
1557#define nEP1_RX 0x0
1558#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */ 1363#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
1559#define nEP2_RX 0x0
1560#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */ 1364#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
1561#define nEP3_RX 0x0
1562#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */ 1365#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
1563#define nEP4_RX 0x0
1564#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */ 1366#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
1565#define nEP5_RX 0x0
1566#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */ 1367#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
1567#define nEP6_RX 0x0
1568#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */ 1368#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
1569#define nEP7_RX 0x0
1570 1369
1571/* Bit masks for USB_INTRTXE */ 1370/* Bit masks for USB_INTRTXE */
1572 1371
1573#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */ 1372#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
1574#define nEP0_TX_E 0x0
1575#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */ 1373#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
1576#define nEP1_TX_E 0x0
1577#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */ 1374#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
1578#define nEP2_TX_E 0x0
1579#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */ 1375#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
1580#define nEP3_TX_E 0x0
1581#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */ 1376#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
1582#define nEP4_TX_E 0x0
1583#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */ 1377#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
1584#define nEP5_TX_E 0x0
1585#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */ 1378#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
1586#define nEP6_TX_E 0x0
1587#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */ 1379#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
1588#define nEP7_TX_E 0x0
1589 1380
1590/* Bit masks for USB_INTRRXE */ 1381/* Bit masks for USB_INTRRXE */
1591 1382
1592#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */ 1383#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
1593#define nEP1_RX_E 0x0
1594#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */ 1384#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
1595#define nEP2_RX_E 0x0
1596#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */ 1385#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
1597#define nEP3_RX_E 0x0
1598#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */ 1386#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
1599#define nEP4_RX_E 0x0
1600#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */ 1387#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
1601#define nEP5_RX_E 0x0
1602#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */ 1388#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
1603#define nEP6_RX_E 0x0
1604#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */ 1389#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
1605#define nEP7_RX_E 0x0
1606 1390
1607/* Bit masks for USB_INTRUSB */ 1391/* Bit masks for USB_INTRUSB */
1608 1392
1609#define SUSPEND_B 0x1 /* Suspend indicator */ 1393#define SUSPEND_B 0x1 /* Suspend indicator */
1610#define nSUSPEND_B 0x0
1611#define RESUME_B 0x2 /* Resume indicator */ 1394#define RESUME_B 0x2 /* Resume indicator */
1612#define nRESUME_B 0x0
1613#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */ 1395#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
1614#define nRESET_OR_BABLE_B 0x0
1615#define SOF_B 0x8 /* Start of frame */ 1396#define SOF_B 0x8 /* Start of frame */
1616#define nSOF_B 0x0
1617#define CONN_B 0x10 /* Connection indicator */ 1397#define CONN_B 0x10 /* Connection indicator */
1618#define nCONN_B 0x0
1619#define DISCON_B 0x20 /* Disconnect indicator */ 1398#define DISCON_B 0x20 /* Disconnect indicator */
1620#define nDISCON_B 0x0
1621#define SESSION_REQ_B 0x40 /* Session Request */ 1399#define SESSION_REQ_B 0x40 /* Session Request */
1622#define nSESSION_REQ_B 0x0
1623#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */ 1400#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
1624#define nVBUS_ERROR_B 0x0
1625 1401
1626/* Bit masks for USB_INTRUSBE */ 1402/* Bit masks for USB_INTRUSBE */
1627 1403
1628#define SUSPEND_BE 0x1 /* Suspend indicator int enable */ 1404#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
1629#define nSUSPEND_BE 0x0
1630#define RESUME_BE 0x2 /* Resume indicator int enable */ 1405#define RESUME_BE 0x2 /* Resume indicator int enable */
1631#define nRESUME_BE 0x0
1632#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */ 1406#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
1633#define nRESET_OR_BABLE_BE 0x0
1634#define SOF_BE 0x8 /* Start of frame int enable */ 1407#define SOF_BE 0x8 /* Start of frame int enable */
1635#define nSOF_BE 0x0
1636#define CONN_BE 0x10 /* Connection indicator int enable */ 1408#define CONN_BE 0x10 /* Connection indicator int enable */
1637#define nCONN_BE 0x0
1638#define DISCON_BE 0x20 /* Disconnect indicator int enable */ 1409#define DISCON_BE 0x20 /* Disconnect indicator int enable */
1639#define nDISCON_BE 0x0
1640#define SESSION_REQ_BE 0x40 /* Session Request int enable */ 1410#define SESSION_REQ_BE 0x40 /* Session Request int enable */
1641#define nSESSION_REQ_BE 0x0
1642#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */ 1411#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
1643#define nVBUS_ERROR_BE 0x0
1644 1412
1645/* Bit masks for USB_FRAME */ 1413/* Bit masks for USB_FRAME */
1646 1414
@@ -1653,117 +1421,67 @@
1653/* Bit masks for USB_GLOBAL_CTL */ 1421/* Bit masks for USB_GLOBAL_CTL */
1654 1422
1655#define GLOBAL_ENA 0x1 /* enables USB module */ 1423#define GLOBAL_ENA 0x1 /* enables USB module */
1656#define nGLOBAL_ENA 0x0
1657#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */ 1424#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
1658#define nEP1_TX_ENA 0x0
1659#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */ 1425#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
1660#define nEP2_TX_ENA 0x0
1661#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */ 1426#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
1662#define nEP3_TX_ENA 0x0
1663#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */ 1427#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
1664#define nEP4_TX_ENA 0x0
1665#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */ 1428#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
1666#define nEP5_TX_ENA 0x0
1667#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */ 1429#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
1668#define nEP6_TX_ENA 0x0
1669#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */ 1430#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
1670#define nEP7_TX_ENA 0x0
1671#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */ 1431#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
1672#define nEP1_RX_ENA 0x0
1673#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */ 1432#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
1674#define nEP2_RX_ENA 0x0
1675#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */ 1433#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
1676#define nEP3_RX_ENA 0x0
1677#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */ 1434#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
1678#define nEP4_RX_ENA 0x0
1679#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */ 1435#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
1680#define nEP5_RX_ENA 0x0
1681#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */ 1436#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
1682#define nEP6_RX_ENA 0x0
1683#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */ 1437#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
1684#define nEP7_RX_ENA 0x0
1685 1438
1686/* Bit masks for USB_OTG_DEV_CTL */ 1439/* Bit masks for USB_OTG_DEV_CTL */
1687 1440
1688#define SESSION 0x1 /* session indicator */ 1441#define SESSION 0x1 /* session indicator */
1689#define nSESSION 0x0
1690#define HOST_REQ 0x2 /* Host negotiation request */ 1442#define HOST_REQ 0x2 /* Host negotiation request */
1691#define nHOST_REQ 0x0
1692#define HOST_MODE 0x4 /* indicates USBDRC is a host */ 1443#define HOST_MODE 0x4 /* indicates USBDRC is a host */
1693#define nHOST_MODE 0x0
1694#define VBUS0 0x8 /* Vbus level indicator[0] */ 1444#define VBUS0 0x8 /* Vbus level indicator[0] */
1695#define nVBUS0 0x0
1696#define VBUS1 0x10 /* Vbus level indicator[1] */ 1445#define VBUS1 0x10 /* Vbus level indicator[1] */
1697#define nVBUS1 0x0
1698#define LSDEV 0x20 /* Low-speed indicator */ 1446#define LSDEV 0x20 /* Low-speed indicator */
1699#define nLSDEV 0x0
1700#define FSDEV 0x40 /* Full or High-speed indicator */ 1447#define FSDEV 0x40 /* Full or High-speed indicator */
1701#define nFSDEV 0x0
1702#define B_DEVICE 0x80 /* A' or 'B' device indicator */ 1448#define B_DEVICE 0x80 /* A' or 'B' device indicator */
1703#define nB_DEVICE 0x0
1704 1449
1705/* Bit masks for USB_OTG_VBUS_IRQ */ 1450/* Bit masks for USB_OTG_VBUS_IRQ */
1706 1451
1707#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */ 1452#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
1708#define nDRIVE_VBUS_ON 0x0
1709#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */ 1453#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
1710#define nDRIVE_VBUS_OFF 0x0
1711#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */ 1454#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
1712#define nCHRG_VBUS_START 0x0
1713#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */ 1455#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
1714#define nCHRG_VBUS_END 0x0
1715#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */ 1456#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
1716#define nDISCHRG_VBUS_START 0x0
1717#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */ 1457#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
1718#define nDISCHRG_VBUS_END 0x0
1719 1458
1720/* Bit masks for USB_OTG_VBUS_MASK */ 1459/* Bit masks for USB_OTG_VBUS_MASK */
1721 1460
1722#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */ 1461#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
1723#define nDRIVE_VBUS_ON_ENA 0x0
1724#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */ 1462#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
1725#define nDRIVE_VBUS_OFF_ENA 0x0
1726#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */ 1463#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
1727#define nCHRG_VBUS_START_ENA 0x0
1728#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */ 1464#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
1729#define nCHRG_VBUS_END_ENA 0x0
1730#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */ 1465#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
1731#define nDISCHRG_VBUS_START_ENA 0x0
1732#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */ 1466#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
1733#define nDISCHRG_VBUS_END_ENA 0x0
1734 1467
1735/* Bit masks for USB_CSR0 */ 1468/* Bit masks for USB_CSR0 */
1736 1469
1737#define RXPKTRDY 0x1 /* data packet receive indicator */ 1470#define RXPKTRDY 0x1 /* data packet receive indicator */
1738#define nRXPKTRDY 0x0
1739#define TXPKTRDY 0x2 /* data packet in FIFO indicator */ 1471#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
1740#define nTXPKTRDY 0x0
1741#define STALL_SENT 0x4 /* STALL handshake sent */ 1472#define STALL_SENT 0x4 /* STALL handshake sent */
1742#define nSTALL_SENT 0x0
1743#define DATAEND 0x8 /* Data end indicator */ 1473#define DATAEND 0x8 /* Data end indicator */
1744#define nDATAEND 0x0
1745#define SETUPEND 0x10 /* Setup end */ 1474#define SETUPEND 0x10 /* Setup end */
1746#define nSETUPEND 0x0
1747#define SENDSTALL 0x20 /* Send STALL handshake */ 1475#define SENDSTALL 0x20 /* Send STALL handshake */
1748#define nSENDSTALL 0x0
1749#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */ 1476#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
1750#define nSERVICED_RXPKTRDY 0x0
1751#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */ 1477#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
1752#define nSERVICED_SETUPEND 0x0
1753#define FLUSHFIFO 0x100 /* flush endpoint FIFO */ 1478#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
1754#define nFLUSHFIFO 0x0
1755#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */ 1479#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
1756#define nSTALL_RECEIVED_H 0x0
1757#define SETUPPKT_H 0x8 /* send Setup token host mode */ 1480#define SETUPPKT_H 0x8 /* send Setup token host mode */
1758#define nSETUPPKT_H 0x0
1759#define ERROR_H 0x10 /* timeout error indicator host mode */ 1481#define ERROR_H 0x10 /* timeout error indicator host mode */
1760#define nERROR_H 0x0
1761#define REQPKT_H 0x20 /* Request an IN transaction host mode */ 1482#define REQPKT_H 0x20 /* Request an IN transaction host mode */
1762#define nREQPKT_H 0x0
1763#define STATUSPKT_H 0x40 /* Status stage transaction host mode */ 1483#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
1764#define nSTATUSPKT_H 0x0
1765#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */ 1484#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
1766#define nNAK_TIMEOUT_H 0x0
1767 1485
1768/* Bit masks for USB_COUNT0 */ 1486/* Bit masks for USB_COUNT0 */
1769 1487
@@ -1784,37 +1502,21 @@
1784/* Bit masks for USB_TXCSR */ 1502/* Bit masks for USB_TXCSR */
1785 1503
1786#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */ 1504#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
1787#define nTXPKTRDY_T 0x0
1788#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */ 1505#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
1789#define nFIFO_NOT_EMPTY_T 0x0
1790#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */ 1506#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
1791#define nUNDERRUN_T 0x0
1792#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */ 1507#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
1793#define nFLUSHFIFO_T 0x0
1794#define STALL_SEND_T 0x10 /* issue a Stall handshake */ 1508#define STALL_SEND_T 0x10 /* issue a Stall handshake */
1795#define nSTALL_SEND_T 0x0
1796#define STALL_SENT_T 0x20 /* Stall handshake transmitted */ 1509#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
1797#define nSTALL_SENT_T 0x0
1798#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */ 1510#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
1799#define nCLEAR_DATATOGGLE_T 0x0
1800#define INCOMPTX_T 0x80 /* indicates that a large packet is split */ 1511#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
1801#define nINCOMPTX_T 0x0
1802#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */ 1512#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
1803#define nDMAREQMODE_T 0x0
1804#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */ 1513#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
1805#define nFORCE_DATATOGGLE_T 0x0
1806#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */ 1514#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
1807#define nDMAREQ_ENA_T 0x0
1808#define ISO_T 0x4000 /* enable Isochronous transfers */ 1515#define ISO_T 0x4000 /* enable Isochronous transfers */
1809#define nISO_T 0x0
1810#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */ 1516#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
1811#define nAUTOSET_T 0x0
1812#define ERROR_TH 0x4 /* error condition host mode */ 1517#define ERROR_TH 0x4 /* error condition host mode */
1813#define nERROR_TH 0x0
1814#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */ 1518#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
1815#define nSTALL_RECEIVED_TH 0x0
1816#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */ 1519#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
1817#define nNAK_TIMEOUT_TH 0x0
1818 1520
1819/* Bit masks for USB_TXCOUNT */ 1521/* Bit masks for USB_TXCOUNT */
1820 1522
@@ -1823,45 +1525,25 @@
1823/* Bit masks for USB_RXCSR */ 1525/* Bit masks for USB_RXCSR */
1824 1526
1825#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */ 1527#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
1826#define nRXPKTRDY_R 0x0
1827#define FIFO_FULL_R 0x2 /* FIFO not empty */ 1528#define FIFO_FULL_R 0x2 /* FIFO not empty */
1828#define nFIFO_FULL_R 0x0
1829#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */ 1529#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
1830#define nOVERRUN_R 0x0
1831#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */ 1530#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
1832#define nDATAERROR_R 0x0
1833#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */ 1531#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
1834#define nFLUSHFIFO_R 0x0
1835#define STALL_SEND_R 0x20 /* issue a Stall handshake */ 1532#define STALL_SEND_R 0x20 /* issue a Stall handshake */
1836#define nSTALL_SEND_R 0x0
1837#define STALL_SENT_R 0x40 /* Stall handshake transmitted */ 1533#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
1838#define nSTALL_SENT_R 0x0
1839#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */ 1534#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
1840#define nCLEAR_DATATOGGLE_R 0x0
1841#define INCOMPRX_R 0x100 /* indicates that a large packet is split */ 1535#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
1842#define nINCOMPRX_R 0x0
1843#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */ 1536#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
1844#define nDMAREQMODE_R 0x0
1845#define DISNYET_R 0x1000 /* disable Nyet handshakes */ 1537#define DISNYET_R 0x1000 /* disable Nyet handshakes */
1846#define nDISNYET_R 0x0
1847#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */ 1538#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
1848#define nDMAREQ_ENA_R 0x0
1849#define ISO_R 0x4000 /* enable Isochronous transfers */ 1539#define ISO_R 0x4000 /* enable Isochronous transfers */
1850#define nISO_R 0x0
1851#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */ 1540#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
1852#define nAUTOCLEAR_R 0x0
1853#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */ 1541#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
1854#define nERROR_RH 0x0
1855#define REQPKT_RH 0x20 /* request an IN transaction host mode */ 1542#define REQPKT_RH 0x20 /* request an IN transaction host mode */
1856#define nREQPKT_RH 0x0
1857#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */ 1543#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
1858#define nSTALL_RECEIVED_RH 0x0
1859#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */ 1544#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
1860#define nINCOMPRX_RH 0x0
1861#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */ 1545#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
1862#define nDMAREQMODE_RH 0x0
1863#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */ 1546#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
1864#define nAUTOREQ_RH 0x0
1865 1547
1866/* Bit masks for USB_RXCOUNT */ 1548/* Bit masks for USB_RXCOUNT */
1867 1549
@@ -1888,35 +1570,22 @@
1888/* Bit masks for USB_DMA_INTERRUPT */ 1570/* Bit masks for USB_DMA_INTERRUPT */
1889 1571
1890#define DMA0_INT 0x1 /* DMA0 pending interrupt */ 1572#define DMA0_INT 0x1 /* DMA0 pending interrupt */
1891#define nDMA0_INT 0x0
1892#define DMA1_INT 0x2 /* DMA1 pending interrupt */ 1573#define DMA1_INT 0x2 /* DMA1 pending interrupt */
1893#define nDMA1_INT 0x0
1894#define DMA2_INT 0x4 /* DMA2 pending interrupt */ 1574#define DMA2_INT 0x4 /* DMA2 pending interrupt */
1895#define nDMA2_INT 0x0
1896#define DMA3_INT 0x8 /* DMA3 pending interrupt */ 1575#define DMA3_INT 0x8 /* DMA3 pending interrupt */
1897#define nDMA3_INT 0x0
1898#define DMA4_INT 0x10 /* DMA4 pending interrupt */ 1576#define DMA4_INT 0x10 /* DMA4 pending interrupt */
1899#define nDMA4_INT 0x0
1900#define DMA5_INT 0x20 /* DMA5 pending interrupt */ 1577#define DMA5_INT 0x20 /* DMA5 pending interrupt */
1901#define nDMA5_INT 0x0
1902#define DMA6_INT 0x40 /* DMA6 pending interrupt */ 1578#define DMA6_INT 0x40 /* DMA6 pending interrupt */
1903#define nDMA6_INT 0x0
1904#define DMA7_INT 0x80 /* DMA7 pending interrupt */ 1579#define DMA7_INT 0x80 /* DMA7 pending interrupt */
1905#define nDMA7_INT 0x0
1906 1580
1907/* Bit masks for USB_DMAxCONTROL */ 1581/* Bit masks for USB_DMAxCONTROL */
1908 1582
1909#define DMA_ENA 0x1 /* DMA enable */ 1583#define DMA_ENA 0x1 /* DMA enable */
1910#define nDMA_ENA 0x0
1911#define DIRECTION 0x2 /* direction of DMA transfer */ 1584#define DIRECTION 0x2 /* direction of DMA transfer */
1912#define nDIRECTION 0x0
1913#define MODE 0x4 /* DMA Bus error */ 1585#define MODE 0x4 /* DMA Bus error */
1914#define nMODE 0x0
1915#define INT_ENA 0x8 /* Interrupt enable */ 1586#define INT_ENA 0x8 /* Interrupt enable */
1916#define nINT_ENA 0x0
1917#define EPNUM 0xf0 /* EP number */ 1587#define EPNUM 0xf0 /* EP number */
1918#define BUSERROR 0x100 /* DMA Bus error */ 1588#define BUSERROR 0x100 /* DMA Bus error */
1919#define nBUSERROR 0x0
1920 1589
1921/* Bit masks for USB_DMAxADDRHIGH */ 1590/* Bit masks for USB_DMAxADDRHIGH */
1922 1591
@@ -1937,26 +1606,16 @@
1937/* Bit masks for HMDMAx_CONTROL */ 1606/* Bit masks for HMDMAx_CONTROL */
1938 1607
1939#define HMDMAEN 0x1 /* Handshake MDMA Enable */ 1608#define HMDMAEN 0x1 /* Handshake MDMA Enable */
1940#define nHMDMAEN 0x0
1941#define REP 0x2 /* Handshake MDMA Request Polarity */ 1609#define REP 0x2 /* Handshake MDMA Request Polarity */
1942#define nREP 0x0
1943#define UTE 0x8 /* Urgency Threshold Enable */ 1610#define UTE 0x8 /* Urgency Threshold Enable */
1944#define nUTE 0x0
1945#define OIE 0x10 /* Overflow Interrupt Enable */ 1611#define OIE 0x10 /* Overflow Interrupt Enable */
1946#define nOIE 0x0
1947#define BDIE 0x20 /* Block Done Interrupt Enable */ 1612#define BDIE 0x20 /* Block Done Interrupt Enable */
1948#define nBDIE 0x0
1949#define MBDI 0x40 /* Mask Block Done Interrupt */ 1613#define MBDI 0x40 /* Mask Block Done Interrupt */
1950#define nMBDI 0x0
1951#define DRQ 0x300 /* Handshake MDMA Request Type */ 1614#define DRQ 0x300 /* Handshake MDMA Request Type */
1952#define RBC 0x1000 /* Force Reload of BCOUNT */ 1615#define RBC 0x1000 /* Force Reload of BCOUNT */
1953#define nRBC 0x0
1954#define PS 0x2000 /* Pin Status */ 1616#define PS 0x2000 /* Pin Status */
1955#define nPS 0x0
1956#define OI 0x4000 /* Overflow Interrupt Generated */ 1617#define OI 0x4000 /* Overflow Interrupt Generated */
1957#define nOI 0x0
1958#define BDI 0x8000 /* Block Done Interrupt Generated */ 1618#define BDI 0x8000 /* Block Done Interrupt Generated */
1959#define nBDI 0x0
1960 1619
1961/* ******************************************* */ 1620/* ******************************************* */
1962/* MULTI BIT MACRO ENUMERATIONS */ 1621/* MULTI BIT MACRO ENUMERATIONS */
diff --git a/include/asm-blackfin/mach-bf548/defBF549.h b/include/asm-blackfin/mach-bf548/defBF549.h
index b1cc1c073b41..c2f4734da48d 100644
--- a/include/asm-blackfin/mach-bf548/defBF549.h
+++ b/include/asm-blackfin/mach-bf548/defBF549.h
@@ -1070,21 +1070,13 @@
1070/* Bit masks for PIXC_CTL */ 1070/* Bit masks for PIXC_CTL */
1071 1071
1072#define PIXC_EN 0x1 /* Pixel Compositor Enable */ 1072#define PIXC_EN 0x1 /* Pixel Compositor Enable */
1073#define nPIXC_EN 0x0
1074#define OVR_A_EN 0x2 /* Overlay A Enable */ 1073#define OVR_A_EN 0x2 /* Overlay A Enable */
1075#define nOVR_A_EN 0x0
1076#define OVR_B_EN 0x4 /* Overlay B Enable */ 1074#define OVR_B_EN 0x4 /* Overlay B Enable */
1077#define nOVR_B_EN 0x0
1078#define IMG_FORM 0x8 /* Image Data Format */ 1075#define IMG_FORM 0x8 /* Image Data Format */
1079#define nIMG_FORM 0x0
1080#define OVR_FORM 0x10 /* Overlay Data Format */ 1076#define OVR_FORM 0x10 /* Overlay Data Format */
1081#define nOVR_FORM 0x0
1082#define OUT_FORM 0x20 /* Output Data Format */ 1077#define OUT_FORM 0x20 /* Output Data Format */
1083#define nOUT_FORM 0x0
1084#define UDS_MOD 0x40 /* Resampling Mode */ 1078#define UDS_MOD 0x40 /* Resampling Mode */
1085#define nUDS_MOD 0x0
1086#define TC_EN 0x80 /* Transparent Color Enable */ 1079#define TC_EN 0x80 /* Transparent Color Enable */
1087#define nTC_EN 0x0
1088#define IMG_STAT 0x300 /* Image FIFO Status */ 1080#define IMG_STAT 0x300 /* Image FIFO Status */
1089#define OVR_STAT 0xc00 /* Overlay FIFO Status */ 1081#define OVR_STAT 0xc00 /* Overlay FIFO Status */
1090#define WM_LVL 0x3000 /* FIFO Watermark Level */ 1082#define WM_LVL 0x3000 /* FIFO Watermark Level */
@@ -1132,13 +1124,9 @@
1132/* Bit masks for PIXC_INTRSTAT */ 1124/* Bit masks for PIXC_INTRSTAT */
1133 1125
1134#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */ 1126#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */
1135#define nOVR_INT_EN 0x0
1136#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */ 1127#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */
1137#define nFRM_INT_EN 0x0
1138#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */ 1128#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */
1139#define nOVR_INT_STAT 0x0
1140#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */ 1129#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */
1141#define nFRM_INT_STAT 0x0
1142 1130
1143/* Bit masks for PIXC_RYCON */ 1131/* Bit masks for PIXC_RYCON */
1144 1132
@@ -1146,7 +1134,6 @@
1146#define A12 0xffc00 /* A12 in the Coefficient Matrix */ 1134#define A12 0xffc00 /* A12 in the Coefficient Matrix */
1147#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */ 1135#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */
1148#define RY_MULT4 0x40000000 /* Multiply Row by 4 */ 1136#define RY_MULT4 0x40000000 /* Multiply Row by 4 */
1149#define nRY_MULT4 0x0
1150 1137
1151/* Bit masks for PIXC_GUCON */ 1138/* Bit masks for PIXC_GUCON */
1152 1139
@@ -1154,7 +1141,6 @@
1154#define A22 0xffc00 /* A22 in the Coefficient Matrix */ 1141#define A22 0xffc00 /* A22 in the Coefficient Matrix */
1155#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */ 1142#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */
1156#define GU_MULT4 0x40000000 /* Multiply Row by 4 */ 1143#define GU_MULT4 0x40000000 /* Multiply Row by 4 */
1157#define nGU_MULT4 0x0
1158 1144
1159/* Bit masks for PIXC_BVCON */ 1145/* Bit masks for PIXC_BVCON */
1160 1146
@@ -1162,7 +1148,6 @@
1162#define A32 0xffc00 /* A32 in the Coefficient Matrix */ 1148#define A32 0xffc00 /* A32 in the Coefficient Matrix */
1163#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */ 1149#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */
1164#define BV_MULT4 0x40000000 /* Multiply Row by 4 */ 1150#define BV_MULT4 0x40000000 /* Multiply Row by 4 */
1165#define nBV_MULT4 0x0
1166 1151
1167/* Bit masks for PIXC_CCBIAS */ 1152/* Bit masks for PIXC_CCBIAS */
1168 1153
@@ -1179,48 +1164,28 @@
1179/* Bit masks for HOST_CONTROL */ 1164/* Bit masks for HOST_CONTROL */
1180 1165
1181#define HOST_EN 0x1 /* Host Enable */ 1166#define HOST_EN 0x1 /* Host Enable */
1182#define nHOST_EN 0x0
1183#define HOST_END 0x2 /* Host Endianess */ 1167#define HOST_END 0x2 /* Host Endianess */
1184#define nHOST_END 0x0
1185#define DATA_SIZE 0x4 /* Data Size */ 1168#define DATA_SIZE 0x4 /* Data Size */
1186#define nDATA_SIZE 0x0
1187#define HOST_RST 0x8 /* Host Reset */ 1169#define HOST_RST 0x8 /* Host Reset */
1188#define nHOST_RST 0x0
1189#define HRDY_OVR 0x20 /* Host Ready Override */ 1170#define HRDY_OVR 0x20 /* Host Ready Override */
1190#define nHRDY_OVR 0x0
1191#define INT_MODE 0x40 /* Interrupt Mode */ 1171#define INT_MODE 0x40 /* Interrupt Mode */
1192#define nINT_MODE 0x0
1193#define BT_EN 0x80 /* Bus Timeout Enable */ 1172#define BT_EN 0x80 /* Bus Timeout Enable */
1194#define nBT_EN 0x0
1195#define EHW 0x100 /* Enable Host Write */ 1173#define EHW 0x100 /* Enable Host Write */
1196#define nEHW 0x0
1197#define EHR 0x200 /* Enable Host Read */ 1174#define EHR 0x200 /* Enable Host Read */
1198#define nEHR 0x0
1199#define BDR 0x400 /* Burst DMA Requests */ 1175#define BDR 0x400 /* Burst DMA Requests */
1200#define nBDR 0x0
1201 1176
1202/* Bit masks for HOST_STATUS */ 1177/* Bit masks for HOST_STATUS */
1203 1178
1204#define READY 0x1 /* DMA Ready */ 1179#define READY 0x1 /* DMA Ready */
1205#define nREADY 0x0
1206#define FIFOFULL 0x2 /* FIFO Full */ 1180#define FIFOFULL 0x2 /* FIFO Full */
1207#define nFIFOFULL 0x0
1208#define FIFOEMPTY 0x4 /* FIFO Empty */ 1181#define FIFOEMPTY 0x4 /* FIFO Empty */
1209#define nFIFOEMPTY 0x0 1182#define DMA_COMPLETE 0x8 /* DMA Complete */
1210#define COMPLETE 0x8 /* DMA Complete */
1211#define nCOMPLETE 0x0
1212#define HSHK 0x10 /* Host Handshake */ 1183#define HSHK 0x10 /* Host Handshake */
1213#define nHSHK 0x0
1214#define TIMEOUT 0x20 /* Host Timeout */ 1184#define TIMEOUT 0x20 /* Host Timeout */
1215#define nTIMEOUT 0x0
1216#define HIRQ 0x40 /* Host Interrupt Request */ 1185#define HIRQ 0x40 /* Host Interrupt Request */
1217#define nHIRQ 0x0
1218#define ALLOW_CNFG 0x80 /* Allow New Configuration */ 1186#define ALLOW_CNFG 0x80 /* Allow New Configuration */
1219#define nALLOW_CNFG 0x0
1220#define DMA_DIR 0x100 /* DMA Direction */ 1187#define DMA_DIR 0x100 /* DMA Direction */
1221#define nDMA_DIR 0x0
1222#define BTE 0x200 /* Bus Timeout Enabled */ 1188#define BTE 0x200 /* Bus Timeout Enabled */
1223#define nBTE 0x0
1224 1189
1225/* Bit masks for HOST_TIMEOUT */ 1190/* Bit masks for HOST_TIMEOUT */
1226 1191
@@ -1229,71 +1194,41 @@
1229/* Bit masks for MXVR_CONFIG */ 1194/* Bit masks for MXVR_CONFIG */
1230 1195
1231#define MXVREN 0x1 /* MXVR Enable */ 1196#define MXVREN 0x1 /* MXVR Enable */
1232#define nMXVREN 0x0
1233#define MMSM 0x2 /* MXVR Master/Slave Mode Select */ 1197#define MMSM 0x2 /* MXVR Master/Slave Mode Select */
1234#define nMMSM 0x0
1235#define ACTIVE 0x4 /* Active Mode */ 1198#define ACTIVE 0x4 /* Active Mode */
1236#define nACTIVE 0x0
1237#define SDELAY 0x8 /* Synchronous Data Delay */ 1199#define SDELAY 0x8 /* Synchronous Data Delay */
1238#define nSDELAY 0x0
1239#define NCMRXEN 0x10 /* Normal Control Message Receive Enable */ 1200#define NCMRXEN 0x10 /* Normal Control Message Receive Enable */
1240#define nNCMRXEN 0x0
1241#define RWRRXEN 0x20 /* Remote Write Receive Enable */ 1201#define RWRRXEN 0x20 /* Remote Write Receive Enable */
1242#define nRWRRXEN 0x0
1243#define MTXEN 0x40 /* MXVR Transmit Data Enable */ 1202#define MTXEN 0x40 /* MXVR Transmit Data Enable */
1244#define nMTXEN 0x0
1245#define MTXONB 0x80 /* MXVR Phy Transmitter On */ 1203#define MTXONB 0x80 /* MXVR Phy Transmitter On */
1246#define nMTXONB 0x0
1247#define EPARITY 0x100 /* Even Parity Select */ 1204#define EPARITY 0x100 /* Even Parity Select */
1248#define nEPARITY 0x0
1249#define MSB 0x1e00 /* Master Synchronous Boundary */ 1205#define MSB 0x1e00 /* Master Synchronous Boundary */
1250#define APRXEN 0x2000 /* Asynchronous Packet Receive Enable */ 1206#define APRXEN 0x2000 /* Asynchronous Packet Receive Enable */
1251#define nAPRXEN 0x0
1252#define WAKEUP 0x4000 /* Wake-Up */ 1207#define WAKEUP 0x4000 /* Wake-Up */
1253#define nWAKEUP 0x0
1254#define LMECH 0x8000 /* Lock Mechanism Select */ 1208#define LMECH 0x8000 /* Lock Mechanism Select */
1255#define nLMECH 0x0
1256 1209
1257/* Bit masks for MXVR_STATE_0 */ 1210/* Bit masks for MXVR_STATE_0 */
1258 1211
1259#define NACT 0x1 /* Network Activity */ 1212#define NACT 0x1 /* Network Activity */
1260#define nNACT 0x0
1261#define SBLOCK 0x2 /* Super Block Lock */ 1213#define SBLOCK 0x2 /* Super Block Lock */
1262#define nSBLOCK 0x0
1263#define FMPLLST 0xc /* Frequency Multiply PLL SM State */ 1214#define FMPLLST 0xc /* Frequency Multiply PLL SM State */
1264#define CDRPLLST 0xe0 /* Clock/Data Recovery PLL SM State */ 1215#define CDRPLLST 0xe0 /* Clock/Data Recovery PLL SM State */
1265#define APBSY 0x100 /* Asynchronous Packet Transmit Buffer Busy */ 1216#define APBSY 0x100 /* Asynchronous Packet Transmit Buffer Busy */
1266#define nAPBSY 0x0
1267#define APARB 0x200 /* Asynchronous Packet Arbitrating */ 1217#define APARB 0x200 /* Asynchronous Packet Arbitrating */
1268#define nAPARB 0x0
1269#define APTX 0x400 /* Asynchronous Packet Transmitting */ 1218#define APTX 0x400 /* Asynchronous Packet Transmitting */
1270#define nAPTX 0x0
1271#define APRX 0x800 /* Receiving Asynchronous Packet */ 1219#define APRX 0x800 /* Receiving Asynchronous Packet */
1272#define nAPRX 0x0
1273#define CMBSY 0x1000 /* Control Message Transmit Buffer Busy */ 1220#define CMBSY 0x1000 /* Control Message Transmit Buffer Busy */
1274#define nCMBSY 0x0
1275#define CMARB 0x2000 /* Control Message Arbitrating */ 1221#define CMARB 0x2000 /* Control Message Arbitrating */
1276#define nCMARB 0x0
1277#define CMTX 0x4000 /* Control Message Transmitting */ 1222#define CMTX 0x4000 /* Control Message Transmitting */
1278#define nCMTX 0x0
1279#define CMRX 0x8000 /* Receiving Control Message */ 1223#define CMRX 0x8000 /* Receiving Control Message */
1280#define nCMRX 0x0
1281#define MRXONB 0x10000 /* MRXONB Pin State */ 1224#define MRXONB 0x10000 /* MRXONB Pin State */
1282#define nMRXONB 0x0
1283#define RGSIP 0x20000 /* Remote Get Source In Progress */ 1225#define RGSIP 0x20000 /* Remote Get Source In Progress */
1284#define nRGSIP 0x0
1285#define DALIP 0x40000 /* Resource Deallocate In Progress */ 1226#define DALIP 0x40000 /* Resource Deallocate In Progress */
1286#define nDALIP 0x0
1287#define ALIP 0x80000 /* Resource Allocate In Progress */ 1227#define ALIP 0x80000 /* Resource Allocate In Progress */
1288#define nALIP 0x0
1289#define RRDIP 0x100000 /* Remote Read In Progress */ 1228#define RRDIP 0x100000 /* Remote Read In Progress */
1290#define nRRDIP 0x0
1291#define RWRIP 0x200000 /* Remote Write In Progress */ 1229#define RWRIP 0x200000 /* Remote Write In Progress */
1292#define nRWRIP 0x0
1293#define FLOCK 0x400000 /* Frame Lock */ 1230#define FLOCK 0x400000 /* Frame Lock */
1294#define nFLOCK 0x0
1295#define BLOCK 0x800000 /* Block Lock */ 1231#define BLOCK 0x800000 /* Block Lock */
1296#define nBLOCK 0x0
1297#define RSB 0xf000000 /* Received Synchronous Boundary */ 1232#define RSB 0xf000000 /* Received Synchronous Boundary */
1298#define DERRNUM 0xf0000000 /* DMA Error Channel Number */ 1233#define DERRNUM 0xf0000000 /* DMA Error Channel Number */
1299 1234
@@ -1302,535 +1237,343 @@
1302#define SRXNUMB 0xf /* Synchronous Receive FIFO Number of Bytes */ 1237#define SRXNUMB 0xf /* Synchronous Receive FIFO Number of Bytes */
1303#define STXNUMB 0xf0 /* Synchronous Transmit FIFO Number of Bytes */ 1238#define STXNUMB 0xf0 /* Synchronous Transmit FIFO Number of Bytes */
1304#define APCONT 0x100 /* Asynchronous Packet Continuation */ 1239#define APCONT 0x100 /* Asynchronous Packet Continuation */
1305#define nAPCONT 0x0
1306#define OBERRNUM 0xe00 /* DMA Out of Bounds Error Channel Number */ 1240#define OBERRNUM 0xe00 /* DMA Out of Bounds Error Channel Number */
1307#define DMAACTIVE0 0x10000 /* DMA0 Active */ 1241#define DMAACTIVE0 0x10000 /* DMA0 Active */
1308#define nDMAACTIVE0 0x0
1309#define DMAACTIVE1 0x20000 /* DMA1 Active */ 1242#define DMAACTIVE1 0x20000 /* DMA1 Active */
1310#define nDMAACTIVE1 0x0
1311#define DMAACTIVE2 0x40000 /* DMA2 Active */ 1243#define DMAACTIVE2 0x40000 /* DMA2 Active */
1312#define nDMAACTIVE2 0x0
1313#define DMAACTIVE3 0x80000 /* DMA3 Active */ 1244#define DMAACTIVE3 0x80000 /* DMA3 Active */
1314#define nDMAACTIVE3 0x0
1315#define DMAACTIVE4 0x100000 /* DMA4 Active */ 1245#define DMAACTIVE4 0x100000 /* DMA4 Active */
1316#define nDMAACTIVE4 0x0
1317#define DMAACTIVE5 0x200000 /* DMA5 Active */ 1246#define DMAACTIVE5 0x200000 /* DMA5 Active */
1318#define nDMAACTIVE5 0x0
1319#define DMAACTIVE6 0x400000 /* DMA6 Active */ 1247#define DMAACTIVE6 0x400000 /* DMA6 Active */
1320#define nDMAACTIVE6 0x0
1321#define DMAACTIVE7 0x800000 /* DMA7 Active */ 1248#define DMAACTIVE7 0x800000 /* DMA7 Active */
1322#define nDMAACTIVE7 0x0
1323#define DMAPMEN0 0x1000000 /* DMA0 Pattern Matching Enabled */ 1249#define DMAPMEN0 0x1000000 /* DMA0 Pattern Matching Enabled */
1324#define nDMAPMEN0 0x0
1325#define DMAPMEN1 0x2000000 /* DMA1 Pattern Matching Enabled */ 1250#define DMAPMEN1 0x2000000 /* DMA1 Pattern Matching Enabled */
1326#define nDMAPMEN1 0x0
1327#define DMAPMEN2 0x4000000 /* DMA2 Pattern Matching Enabled */ 1251#define DMAPMEN2 0x4000000 /* DMA2 Pattern Matching Enabled */
1328#define nDMAPMEN2 0x0
1329#define DMAPMEN3 0x8000000 /* DMA3 Pattern Matching Enabled */ 1252#define DMAPMEN3 0x8000000 /* DMA3 Pattern Matching Enabled */
1330#define nDMAPMEN3 0x0
1331#define DMAPMEN4 0x10000000 /* DMA4 Pattern Matching Enabled */ 1253#define DMAPMEN4 0x10000000 /* DMA4 Pattern Matching Enabled */
1332#define nDMAPMEN4 0x0
1333#define DMAPMEN5 0x20000000 /* DMA5 Pattern Matching Enabled */ 1254#define DMAPMEN5 0x20000000 /* DMA5 Pattern Matching Enabled */
1334#define nDMAPMEN5 0x0
1335#define DMAPMEN6 0x40000000 /* DMA6 Pattern Matching Enabled */ 1255#define DMAPMEN6 0x40000000 /* DMA6 Pattern Matching Enabled */
1336#define nDMAPMEN6 0x0
1337#define DMAPMEN7 0x80000000 /* DMA7 Pattern Matching Enabled */ 1256#define DMAPMEN7 0x80000000 /* DMA7 Pattern Matching Enabled */
1338#define nDMAPMEN7 0x0
1339 1257
1340/* Bit masks for MXVR_INT_STAT_0 */ 1258/* Bit masks for MXVR_INT_STAT_0 */
1341 1259
1342#define NI2A 0x1 /* Network Inactive to Active */ 1260#define NI2A 0x1 /* Network Inactive to Active */
1343#define nNI2A 0x0
1344#define NA2I 0x2 /* Network Active to Inactive */ 1261#define NA2I 0x2 /* Network Active to Inactive */
1345#define nNA2I 0x0
1346#define SBU2L 0x4 /* Super Block Unlock to Lock */ 1262#define SBU2L 0x4 /* Super Block Unlock to Lock */
1347#define nSBU2L 0x0
1348#define SBL2U 0x8 /* Super Block Lock to Unlock */ 1263#define SBL2U 0x8 /* Super Block Lock to Unlock */
1349#define nSBL2U 0x0
1350#define PRU 0x10 /* Position Register Updated */ 1264#define PRU 0x10 /* Position Register Updated */
1351#define nPRU 0x0
1352#define MPRU 0x20 /* Maximum Position Register Updated */ 1265#define MPRU 0x20 /* Maximum Position Register Updated */
1353#define nMPRU 0x0
1354#define DRU 0x40 /* Delay Register Updated */ 1266#define DRU 0x40 /* Delay Register Updated */
1355#define nDRU 0x0
1356#define MDRU 0x80 /* Maximum Delay Register Updated */ 1267#define MDRU 0x80 /* Maximum Delay Register Updated */
1357#define nMDRU 0x0
1358#define SBU 0x100 /* Synchronous Boundary Updated */ 1268#define SBU 0x100 /* Synchronous Boundary Updated */
1359#define nSBU 0x0
1360#define ATU 0x200 /* Allocation Table Updated */ 1269#define ATU 0x200 /* Allocation Table Updated */
1361#define nATU 0x0
1362#define FCZ0 0x400 /* Frame Counter 0 Zero */ 1270#define FCZ0 0x400 /* Frame Counter 0 Zero */
1363#define nFCZ0 0x0
1364#define FCZ1 0x800 /* Frame Counter 1 Zero */ 1271#define FCZ1 0x800 /* Frame Counter 1 Zero */
1365#define nFCZ1 0x0
1366#define PERR 0x1000 /* Parity Error */ 1272#define PERR 0x1000 /* Parity Error */
1367#define nPERR 0x0
1368#define MH2L 0x2000 /* MRXONB High to Low */ 1273#define MH2L 0x2000 /* MRXONB High to Low */
1369#define nMH2L 0x0
1370#define ML2H 0x4000 /* MRXONB Low to High */ 1274#define ML2H 0x4000 /* MRXONB Low to High */
1371#define nML2H 0x0
1372#define WUP 0x8000 /* Wake-Up Preamble Received */ 1275#define WUP 0x8000 /* Wake-Up Preamble Received */
1373#define nWUP 0x0
1374#define FU2L 0x10000 /* Frame Unlock to Lock */ 1276#define FU2L 0x10000 /* Frame Unlock to Lock */
1375#define nFU2L 0x0
1376#define FL2U 0x20000 /* Frame Lock to Unlock */ 1277#define FL2U 0x20000 /* Frame Lock to Unlock */
1377#define nFL2U 0x0
1378#define BU2L 0x40000 /* Block Unlock to Lock */ 1278#define BU2L 0x40000 /* Block Unlock to Lock */
1379#define nBU2L 0x0
1380#define BL2U 0x80000 /* Block Lock to Unlock */ 1279#define BL2U 0x80000 /* Block Lock to Unlock */
1381#define nBL2U 0x0
1382#define OBERR 0x100000 /* DMA Out of Bounds Error */ 1280#define OBERR 0x100000 /* DMA Out of Bounds Error */
1383#define nOBERR 0x0
1384#define PFL 0x200000 /* PLL Frequency Locked */ 1281#define PFL 0x200000 /* PLL Frequency Locked */
1385#define nPFL 0x0
1386#define SCZ 0x400000 /* System Clock Counter Zero */ 1282#define SCZ 0x400000 /* System Clock Counter Zero */
1387#define nSCZ 0x0
1388#define FERR 0x800000 /* FIFO Error */ 1283#define FERR 0x800000 /* FIFO Error */
1389#define nFERR 0x0
1390#define CMR 0x1000000 /* Control Message Received */ 1284#define CMR 0x1000000 /* Control Message Received */
1391#define nCMR 0x0
1392#define CMROF 0x2000000 /* Control Message Receive Buffer Overflow */ 1285#define CMROF 0x2000000 /* Control Message Receive Buffer Overflow */
1393#define nCMROF 0x0
1394#define CMTS 0x4000000 /* Control Message Transmit Buffer Successfully Sent */ 1286#define CMTS 0x4000000 /* Control Message Transmit Buffer Successfully Sent */
1395#define nCMTS 0x0
1396#define CMTC 0x8000000 /* Control Message Transmit Buffer Successfully Cancelled */ 1287#define CMTC 0x8000000 /* Control Message Transmit Buffer Successfully Cancelled */
1397#define nCMTC 0x0
1398#define RWRC 0x10000000 /* Remote Write Control Message Completed */ 1288#define RWRC 0x10000000 /* Remote Write Control Message Completed */
1399#define nRWRC 0x0
1400#define BCZ 0x20000000 /* Block Counter Zero */ 1289#define BCZ 0x20000000 /* Block Counter Zero */
1401#define nBCZ 0x0
1402#define BMERR 0x40000000 /* Biphase Mark Coding Error */ 1290#define BMERR 0x40000000 /* Biphase Mark Coding Error */
1403#define nBMERR 0x0
1404#define DERR 0x80000000 /* DMA Error */ 1291#define DERR 0x80000000 /* DMA Error */
1405#define nDERR 0x0
1406 1292
1407/* Bit masks for MXVR_INT_STAT_1 */ 1293/* Bit masks for MXVR_INT_STAT_1 */
1408 1294
1409#define HDONE0 0x1 /* DMA0 Half Done */ 1295#define HDONE0 0x1 /* DMA0 Half Done */
1410#define nHDONE0 0x0
1411#define DONE0 0x2 /* DMA0 Done */ 1296#define DONE0 0x2 /* DMA0 Done */
1412#define nDONE0 0x0
1413#define APR 0x4 /* Asynchronous Packet Received */ 1297#define APR 0x4 /* Asynchronous Packet Received */
1414#define nAPR 0x0
1415#define APROF 0x8 /* Asynchronous Packet Receive Buffer Overflow */ 1298#define APROF 0x8 /* Asynchronous Packet Receive Buffer Overflow */
1416#define nAPROF 0x0
1417#define HDONE1 0x10 /* DMA1 Half Done */ 1299#define HDONE1 0x10 /* DMA1 Half Done */
1418#define nHDONE1 0x0
1419#define DONE1 0x20 /* DMA1 Done */ 1300#define DONE1 0x20 /* DMA1 Done */
1420#define nDONE1 0x0
1421#define APTS 0x40 /* Asynchronous Packet Transmit Buffer Successfully Sent */ 1301#define APTS 0x40 /* Asynchronous Packet Transmit Buffer Successfully Sent */
1422#define nAPTS 0x0
1423#define APTC 0x80 /* Asynchronous Packet Transmit Buffer Successfully Cancelled */ 1302#define APTC 0x80 /* Asynchronous Packet Transmit Buffer Successfully Cancelled */
1424#define nAPTC 0x0
1425#define HDONE2 0x100 /* DMA2 Half Done */ 1303#define HDONE2 0x100 /* DMA2 Half Done */
1426#define nHDONE2 0x0
1427#define DONE2 0x200 /* DMA2 Done */ 1304#define DONE2 0x200 /* DMA2 Done */
1428#define nDONE2 0x0
1429#define APRCE 0x400 /* Asynchronous Packet Receive CRC Error */ 1305#define APRCE 0x400 /* Asynchronous Packet Receive CRC Error */
1430#define nAPRCE 0x0
1431#define APRPE 0x800 /* Asynchronous Packet Receive Packet Error */ 1306#define APRPE 0x800 /* Asynchronous Packet Receive Packet Error */
1432#define nAPRPE 0x0
1433#define HDONE3 0x1000 /* DMA3 Half Done */ 1307#define HDONE3 0x1000 /* DMA3 Half Done */
1434#define nHDONE3 0x0
1435#define DONE3 0x2000 /* DMA3 Done */ 1308#define DONE3 0x2000 /* DMA3 Done */
1436#define nDONE3 0x0
1437#define HDONE4 0x10000 /* DMA4 Half Done */ 1309#define HDONE4 0x10000 /* DMA4 Half Done */
1438#define nHDONE4 0x0
1439#define DONE4 0x20000 /* DMA4 Done */ 1310#define DONE4 0x20000 /* DMA4 Done */
1440#define nDONE4 0x0
1441#define HDONE5 0x100000 /* DMA5 Half Done */ 1311#define HDONE5 0x100000 /* DMA5 Half Done */
1442#define nHDONE5 0x0
1443#define DONE5 0x200000 /* DMA5 Done */ 1312#define DONE5 0x200000 /* DMA5 Done */
1444#define nDONE5 0x0
1445#define HDONE6 0x1000000 /* DMA6 Half Done */ 1313#define HDONE6 0x1000000 /* DMA6 Half Done */
1446#define nHDONE6 0x0
1447#define DONE6 0x2000000 /* DMA6 Done */ 1314#define DONE6 0x2000000 /* DMA6 Done */
1448#define nDONE6 0x0
1449#define HDONE7 0x10000000 /* DMA7 Half Done */ 1315#define HDONE7 0x10000000 /* DMA7 Half Done */
1450#define nHDONE7 0x0
1451#define DONE7 0x20000000 /* DMA7 Done */ 1316#define DONE7 0x20000000 /* DMA7 Done */
1452#define nDONE7 0x0
1453 1317
1454/* Bit masks for MXVR_INT_EN_0 */ 1318/* Bit masks for MXVR_INT_EN_0 */
1455 1319
1456#define NI2AEN 0x1 /* Network Inactive to Active Interrupt Enable */ 1320#define NI2AEN 0x1 /* Network Inactive to Active Interrupt Enable */
1457#define nNI2AEN 0x0
1458#define NA2IEN 0x2 /* Network Active to Inactive Interrupt Enable */ 1321#define NA2IEN 0x2 /* Network Active to Inactive Interrupt Enable */
1459#define nNA2IEN 0x0
1460#define SBU2LEN 0x4 /* Super Block Unlock to Lock Interrupt Enable */ 1322#define SBU2LEN 0x4 /* Super Block Unlock to Lock Interrupt Enable */
1461#define nSBU2LEN 0x0
1462#define SBL2UEN 0x8 /* Super Block Lock to Unlock Interrupt Enable */ 1323#define SBL2UEN 0x8 /* Super Block Lock to Unlock Interrupt Enable */
1463#define nSBL2UEN 0x0
1464#define PRUEN 0x10 /* Position Register Updated Interrupt Enable */ 1324#define PRUEN 0x10 /* Position Register Updated Interrupt Enable */
1465#define nPRUEN 0x0
1466#define MPRUEN 0x20 /* Maximum Position Register Updated Interrupt Enable */ 1325#define MPRUEN 0x20 /* Maximum Position Register Updated Interrupt Enable */
1467#define nMPRUEN 0x0
1468#define DRUEN 0x40 /* Delay Register Updated Interrupt Enable */ 1326#define DRUEN 0x40 /* Delay Register Updated Interrupt Enable */
1469#define nDRUEN 0x0
1470#define MDRUEN 0x80 /* Maximum Delay Register Updated Interrupt Enable */ 1327#define MDRUEN 0x80 /* Maximum Delay Register Updated Interrupt Enable */
1471#define nMDRUEN 0x0
1472#define SBUEN 0x100 /* Synchronous Boundary Updated Interrupt Enable */ 1328#define SBUEN 0x100 /* Synchronous Boundary Updated Interrupt Enable */
1473#define nSBUEN 0x0
1474#define ATUEN 0x200 /* Allocation Table Updated Interrupt Enable */ 1329#define ATUEN 0x200 /* Allocation Table Updated Interrupt Enable */
1475#define nATUEN 0x0
1476#define FCZ0EN 0x400 /* Frame Counter 0 Zero Interrupt Enable */ 1330#define FCZ0EN 0x400 /* Frame Counter 0 Zero Interrupt Enable */
1477#define nFCZ0EN 0x0
1478#define FCZ1EN 0x800 /* Frame Counter 1 Zero Interrupt Enable */ 1331#define FCZ1EN 0x800 /* Frame Counter 1 Zero Interrupt Enable */
1479#define nFCZ1EN 0x0
1480#define PERREN 0x1000 /* Parity Error Interrupt Enable */ 1332#define PERREN 0x1000 /* Parity Error Interrupt Enable */
1481#define nPERREN 0x0
1482#define MH2LEN 0x2000 /* MRXONB High to Low Interrupt Enable */ 1333#define MH2LEN 0x2000 /* MRXONB High to Low Interrupt Enable */
1483#define nMH2LEN 0x0
1484#define ML2HEN 0x4000 /* MRXONB Low to High Interrupt Enable */ 1334#define ML2HEN 0x4000 /* MRXONB Low to High Interrupt Enable */
1485#define nML2HEN 0x0
1486#define WUPEN 0x8000 /* Wake-Up Preamble Received Interrupt Enable */ 1335#define WUPEN 0x8000 /* Wake-Up Preamble Received Interrupt Enable */
1487#define nWUPEN 0x0
1488#define FU2LEN 0x10000 /* Frame Unlock to Lock Interrupt Enable */ 1336#define FU2LEN 0x10000 /* Frame Unlock to Lock Interrupt Enable */
1489#define nFU2LEN 0x0
1490#define FL2UEN 0x20000 /* Frame Lock to Unlock Interrupt Enable */ 1337#define FL2UEN 0x20000 /* Frame Lock to Unlock Interrupt Enable */
1491#define nFL2UEN 0x0
1492#define BU2LEN 0x40000 /* Block Unlock to Lock Interrupt Enable */ 1338#define BU2LEN 0x40000 /* Block Unlock to Lock Interrupt Enable */
1493#define nBU2LEN 0x0
1494#define BL2UEN 0x80000 /* Block Lock to Unlock Interrupt Enable */ 1339#define BL2UEN 0x80000 /* Block Lock to Unlock Interrupt Enable */
1495#define nBL2UEN 0x0
1496#define OBERREN 0x100000 /* DMA Out of Bounds Error Interrupt Enable */ 1340#define OBERREN 0x100000 /* DMA Out of Bounds Error Interrupt Enable */
1497#define nOBERREN 0x0
1498#define PFLEN 0x200000 /* PLL Frequency Locked Interrupt Enable */ 1341#define PFLEN 0x200000 /* PLL Frequency Locked Interrupt Enable */
1499#define nPFLEN 0x0
1500#define SCZEN 0x400000 /* System Clock Counter Zero Interrupt Enable */ 1342#define SCZEN 0x400000 /* System Clock Counter Zero Interrupt Enable */
1501#define nSCZEN 0x0
1502#define FERREN 0x800000 /* FIFO Error Interrupt Enable */ 1343#define FERREN 0x800000 /* FIFO Error Interrupt Enable */
1503#define nFERREN 0x0
1504#define CMREN 0x1000000 /* Control Message Received Interrupt Enable */ 1344#define CMREN 0x1000000 /* Control Message Received Interrupt Enable */
1505#define nCMREN 0x0
1506#define CMROFEN 0x2000000 /* Control Message Receive Buffer Overflow Interrupt Enable */ 1345#define CMROFEN 0x2000000 /* Control Message Receive Buffer Overflow Interrupt Enable */
1507#define nCMROFEN 0x0
1508#define CMTSEN 0x4000000 /* Control Message Transmit Buffer Successfully Sent Interrupt Enable */ 1346#define CMTSEN 0x4000000 /* Control Message Transmit Buffer Successfully Sent Interrupt Enable */
1509#define nCMTSEN 0x0
1510#define CMTCEN 0x8000000 /* Control Message Transmit Buffer Successfully Cancelled Interrupt Enable */ 1347#define CMTCEN 0x8000000 /* Control Message Transmit Buffer Successfully Cancelled Interrupt Enable */
1511#define nCMTCEN 0x0
1512#define RWRCEN 0x10000000 /* Remote Write Control Message Completed Interrupt Enable */ 1348#define RWRCEN 0x10000000 /* Remote Write Control Message Completed Interrupt Enable */
1513#define nRWRCEN 0x0
1514#define BCZEN 0x20000000 /* Block Counter Zero Interrupt Enable */ 1349#define BCZEN 0x20000000 /* Block Counter Zero Interrupt Enable */
1515#define nBCZEN 0x0
1516#define BMERREN 0x40000000 /* Biphase Mark Coding Error Interrupt Enable */ 1350#define BMERREN 0x40000000 /* Biphase Mark Coding Error Interrupt Enable */
1517#define nBMERREN 0x0
1518#define DERREN 0x80000000 /* DMA Error Interrupt Enable */ 1351#define DERREN 0x80000000 /* DMA Error Interrupt Enable */
1519#define nDERREN 0x0
1520 1352
1521/* Bit masks for MXVR_INT_EN_1 */ 1353/* Bit masks for MXVR_INT_EN_1 */
1522 1354
1523#define HDONEEN0 0x1 /* DMA0 Half Done Interrupt Enable */ 1355#define HDONEEN0 0x1 /* DMA0 Half Done Interrupt Enable */
1524#define nHDONEEN0 0x0
1525#define DONEEN0 0x2 /* DMA0 Done Interrupt Enable */ 1356#define DONEEN0 0x2 /* DMA0 Done Interrupt Enable */
1526#define nDONEEN0 0x0
1527#define APREN 0x4 /* Asynchronous Packet Received Interrupt Enable */ 1357#define APREN 0x4 /* Asynchronous Packet Received Interrupt Enable */
1528#define nAPREN 0x0
1529#define APROFEN 0x8 /* Asynchronous Packet Receive Buffer Overflow Interrupt Enable */ 1358#define APROFEN 0x8 /* Asynchronous Packet Receive Buffer Overflow Interrupt Enable */
1530#define nAPROFEN 0x0
1531#define HDONEEN1 0x10 /* DMA1 Half Done Interrupt Enable */ 1359#define HDONEEN1 0x10 /* DMA1 Half Done Interrupt Enable */
1532#define nHDONEEN1 0x0
1533#define DONEEN1 0x20 /* DMA1 Done Interrupt Enable */ 1360#define DONEEN1 0x20 /* DMA1 Done Interrupt Enable */
1534#define nDONEEN1 0x0
1535#define APTSEN 0x40 /* Asynchronous Packet Transmit Buffer Successfully Sent Interrupt Enable */ 1361#define APTSEN 0x40 /* Asynchronous Packet Transmit Buffer Successfully Sent Interrupt Enable */
1536#define nAPTSEN 0x0
1537#define APTCEN 0x80 /* Asynchronous Packet Transmit Buffer Successfully Cancelled Interrupt Enable */ 1362#define APTCEN 0x80 /* Asynchronous Packet Transmit Buffer Successfully Cancelled Interrupt Enable */
1538#define nAPTCEN 0x0
1539#define HDONEEN2 0x100 /* DMA2 Half Done Interrupt Enable */ 1363#define HDONEEN2 0x100 /* DMA2 Half Done Interrupt Enable */
1540#define nHDONEEN2 0x0
1541#define DONEEN2 0x200 /* DMA2 Done Interrupt Enable */ 1364#define DONEEN2 0x200 /* DMA2 Done Interrupt Enable */
1542#define nDONEEN2 0x0
1543#define APRCEEN 0x400 /* Asynchronous Packet Receive CRC Error Interrupt Enable */ 1365#define APRCEEN 0x400 /* Asynchronous Packet Receive CRC Error Interrupt Enable */
1544#define nAPRCEEN 0x0
1545#define APRPEEN 0x800 /* Asynchronous Packet Receive Packet Error Interrupt Enable */ 1366#define APRPEEN 0x800 /* Asynchronous Packet Receive Packet Error Interrupt Enable */
1546#define nAPRPEEN 0x0
1547#define HDONEEN3 0x1000 /* DMA3 Half Done Interrupt Enable */ 1367#define HDONEEN3 0x1000 /* DMA3 Half Done Interrupt Enable */
1548#define nHDONEEN3 0x0
1549#define DONEEN3 0x2000 /* DMA3 Done Interrupt Enable */ 1368#define DONEEN3 0x2000 /* DMA3 Done Interrupt Enable */
1550#define nDONEEN3 0x0
1551#define HDONEEN4 0x10000 /* DMA4 Half Done Interrupt Enable */ 1369#define HDONEEN4 0x10000 /* DMA4 Half Done Interrupt Enable */
1552#define nHDONEEN4 0x0
1553#define DONEEN4 0x20000 /* DMA4 Done Interrupt Enable */ 1370#define DONEEN4 0x20000 /* DMA4 Done Interrupt Enable */
1554#define nDONEEN4 0x0
1555#define HDONEEN5 0x100000 /* DMA5 Half Done Interrupt Enable */ 1371#define HDONEEN5 0x100000 /* DMA5 Half Done Interrupt Enable */
1556#define nHDONEEN5 0x0
1557#define DONEEN5 0x200000 /* DMA5 Done Interrupt Enable */ 1372#define DONEEN5 0x200000 /* DMA5 Done Interrupt Enable */
1558#define nDONEEN5 0x0
1559#define HDONEEN6 0x1000000 /* DMA6 Half Done Interrupt Enable */ 1373#define HDONEEN6 0x1000000 /* DMA6 Half Done Interrupt Enable */
1560#define nHDONEEN6 0x0
1561#define DONEEN6 0x2000000 /* DMA6 Done Interrupt Enable */ 1374#define DONEEN6 0x2000000 /* DMA6 Done Interrupt Enable */
1562#define nDONEEN6 0x0
1563#define HDONEEN7 0x10000000 /* DMA7 Half Done Interrupt Enable */ 1375#define HDONEEN7 0x10000000 /* DMA7 Half Done Interrupt Enable */
1564#define nHDONEEN7 0x0
1565#define DONEEN7 0x20000000 /* DMA7 Done Interrupt Enable */ 1376#define DONEEN7 0x20000000 /* DMA7 Done Interrupt Enable */
1566#define nDONEEN7 0x0
1567 1377
1568/* Bit masks for MXVR_POSITION */ 1378/* Bit masks for MXVR_POSITION */
1569 1379
1570#define POSITION 0x3f /* Node Position */ 1380#define POSITION 0x3f /* Node Position */
1571#define PVALID 0x8000 /* Node Position Valid */ 1381#define PVALID 0x8000 /* Node Position Valid */
1572#define nPVALID 0x0
1573 1382
1574/* Bit masks for MXVR_MAX_POSITION */ 1383/* Bit masks for MXVR_MAX_POSITION */
1575 1384
1576#define MPOSITION 0x3f /* Maximum Node Position */ 1385#define MPOSITION 0x3f /* Maximum Node Position */
1577#define MPVALID 0x8000 /* Maximum Node Position Valid */ 1386#define MPVALID 0x8000 /* Maximum Node Position Valid */
1578#define nMPVALID 0x0
1579 1387
1580/* Bit masks for MXVR_DELAY */ 1388/* Bit masks for MXVR_DELAY */
1581 1389
1582#define DELAY 0x3f /* Node Frame Delay */ 1390#define DELAY 0x3f /* Node Frame Delay */
1583#define DVALID 0x8000 /* Node Frame Delay Valid */ 1391#define DVALID 0x8000 /* Node Frame Delay Valid */
1584#define nDVALID 0x0
1585 1392
1586/* Bit masks for MXVR_MAX_DELAY */ 1393/* Bit masks for MXVR_MAX_DELAY */
1587 1394
1588#define MDELAY 0x3f /* Maximum Node Frame Delay */ 1395#define MDELAY 0x3f /* Maximum Node Frame Delay */
1589#define MDVALID 0x8000 /* Maximum Node Frame Delay Valid */ 1396#define MDVALID 0x8000 /* Maximum Node Frame Delay Valid */
1590#define nMDVALID 0x0
1591 1397
1592/* Bit masks for MXVR_LADDR */ 1398/* Bit masks for MXVR_LADDR */
1593 1399
1594#define LADDR 0xffff /* Logical Address */ 1400#define LADDR 0xffff /* Logical Address */
1595#define LVALID 0x80000000 /* Logical Address Valid */ 1401#define LVALID 0x80000000 /* Logical Address Valid */
1596#define nLVALID 0x0
1597 1402
1598/* Bit masks for MXVR_GADDR */ 1403/* Bit masks for MXVR_GADDR */
1599 1404
1600#define GADDRL 0xff /* Group Address Lower Byte */ 1405#define GADDRL 0xff /* Group Address Lower Byte */
1601#define GVALID 0x8000 /* Group Address Valid */ 1406#define GVALID 0x8000 /* Group Address Valid */
1602#define nGVALID 0x0
1603 1407
1604/* Bit masks for MXVR_AADDR */ 1408/* Bit masks for MXVR_AADDR */
1605 1409
1606#define AADDR 0xffff /* Alternate Address */ 1410#define AADDR 0xffff /* Alternate Address */
1607#define AVALID 0x80000000 /* Alternate Address Valid */ 1411#define AVALID 0x80000000 /* Alternate Address Valid */
1608#define nAVALID 0x0
1609 1412
1610/* Bit masks for MXVR_ALLOC_0 */ 1413/* Bit masks for MXVR_ALLOC_0 */
1611 1414
1612#define CL0 0x7f /* Channel 0 Connection Label */ 1415#define CL0 0x7f /* Channel 0 Connection Label */
1613#define CIU0 0x80 /* Channel 0 In Use */ 1416#define CIU0 0x80 /* Channel 0 In Use */
1614#define nCIU0 0x0
1615#define CL1 0x7f00 /* Channel 0 Connection Label */ 1417#define CL1 0x7f00 /* Channel 0 Connection Label */
1616#define CIU1 0x8000 /* Channel 0 In Use */ 1418#define CIU1 0x8000 /* Channel 0 In Use */
1617#define nCIU1 0x0
1618#define CL2 0x7f0000 /* Channel 0 Connection Label */ 1419#define CL2 0x7f0000 /* Channel 0 Connection Label */
1619#define CIU2 0x800000 /* Channel 0 In Use */ 1420#define CIU2 0x800000 /* Channel 0 In Use */
1620#define nCIU2 0x0
1621#define CL3 0x7f000000 /* Channel 0 Connection Label */ 1421#define CL3 0x7f000000 /* Channel 0 Connection Label */
1622#define CIU3 0x80000000 /* Channel 0 In Use */ 1422#define CIU3 0x80000000 /* Channel 0 In Use */
1623#define nCIU3 0x0
1624 1423
1625/* Bit masks for MXVR_ALLOC_1 */ 1424/* Bit masks for MXVR_ALLOC_1 */
1626 1425
1627#define CL4 0x7f /* Channel 4 Connection Label */ 1426#define CL4 0x7f /* Channel 4 Connection Label */
1628#define CIU4 0x80 /* Channel 4 In Use */ 1427#define CIU4 0x80 /* Channel 4 In Use */
1629#define nCIU4 0x0
1630#define CL5 0x7f00 /* Channel 5 Connection Label */ 1428#define CL5 0x7f00 /* Channel 5 Connection Label */
1631#define CIU5 0x8000 /* Channel 5 In Use */ 1429#define CIU5 0x8000 /* Channel 5 In Use */
1632#define nCIU5 0x0
1633#define CL6 0x7f0000 /* Channel 6 Connection Label */ 1430#define CL6 0x7f0000 /* Channel 6 Connection Label */
1634#define CIU6 0x800000 /* Channel 6 In Use */ 1431#define CIU6 0x800000 /* Channel 6 In Use */
1635#define nCIU6 0x0
1636#define CL7 0x7f000000 /* Channel 7 Connection Label */ 1432#define CL7 0x7f000000 /* Channel 7 Connection Label */
1637#define CIU7 0x80000000 /* Channel 7 In Use */ 1433#define CIU7 0x80000000 /* Channel 7 In Use */
1638#define nCIU7 0x0
1639 1434
1640/* Bit masks for MXVR_ALLOC_2 */ 1435/* Bit masks for MXVR_ALLOC_2 */
1641 1436
1642#define CL8 0x7f /* Channel 8 Connection Label */ 1437#define CL8 0x7f /* Channel 8 Connection Label */
1643#define CIU8 0x80 /* Channel 8 In Use */ 1438#define CIU8 0x80 /* Channel 8 In Use */
1644#define nCIU8 0x0
1645#define CL9 0x7f00 /* Channel 9 Connection Label */ 1439#define CL9 0x7f00 /* Channel 9 Connection Label */
1646#define CIU9 0x8000 /* Channel 9 In Use */ 1440#define CIU9 0x8000 /* Channel 9 In Use */
1647#define nCIU9 0x0
1648#define CL10 0x7f0000 /* Channel 10 Connection Label */ 1441#define CL10 0x7f0000 /* Channel 10 Connection Label */
1649#define CIU10 0x800000 /* Channel 10 In Use */ 1442#define CIU10 0x800000 /* Channel 10 In Use */
1650#define nCIU10 0x0
1651#define CL11 0x7f000000 /* Channel 11 Connection Label */ 1443#define CL11 0x7f000000 /* Channel 11 Connection Label */
1652#define CIU11 0x80000000 /* Channel 11 In Use */ 1444#define CIU11 0x80000000 /* Channel 11 In Use */
1653#define nCIU11 0x0
1654 1445
1655/* Bit masks for MXVR_ALLOC_3 */ 1446/* Bit masks for MXVR_ALLOC_3 */
1656 1447
1657#define CL12 0x7f /* Channel 12 Connection Label */ 1448#define CL12 0x7f /* Channel 12 Connection Label */
1658#define CIU12 0x80 /* Channel 12 In Use */ 1449#define CIU12 0x80 /* Channel 12 In Use */
1659#define nCIU12 0x0
1660#define CL13 0x7f00 /* Channel 13 Connection Label */ 1450#define CL13 0x7f00 /* Channel 13 Connection Label */
1661#define CIU13 0x8000 /* Channel 13 In Use */ 1451#define CIU13 0x8000 /* Channel 13 In Use */
1662#define nCIU13 0x0
1663#define CL14 0x7f0000 /* Channel 14 Connection Label */ 1452#define CL14 0x7f0000 /* Channel 14 Connection Label */
1664#define CIU14 0x800000 /* Channel 14 In Use */ 1453#define CIU14 0x800000 /* Channel 14 In Use */
1665#define nCIU14 0x0
1666#define CL15 0x7f000000 /* Channel 15 Connection Label */ 1454#define CL15 0x7f000000 /* Channel 15 Connection Label */
1667#define CIU15 0x80000000 /* Channel 15 In Use */ 1455#define CIU15 0x80000000 /* Channel 15 In Use */
1668#define nCIU15 0x0
1669 1456
1670/* Bit masks for MXVR_ALLOC_4 */ 1457/* Bit masks for MXVR_ALLOC_4 */
1671 1458
1672#define CL16 0x7f /* Channel 16 Connection Label */ 1459#define CL16 0x7f /* Channel 16 Connection Label */
1673#define CIU16 0x80 /* Channel 16 In Use */ 1460#define CIU16 0x80 /* Channel 16 In Use */
1674#define nCIU16 0x0
1675#define CL17 0x7f00 /* Channel 17 Connection Label */ 1461#define CL17 0x7f00 /* Channel 17 Connection Label */
1676#define CIU17 0x8000 /* Channel 17 In Use */ 1462#define CIU17 0x8000 /* Channel 17 In Use */
1677#define nCIU17 0x0
1678#define CL18 0x7f0000 /* Channel 18 Connection Label */ 1463#define CL18 0x7f0000 /* Channel 18 Connection Label */
1679#define CIU18 0x800000 /* Channel 18 In Use */ 1464#define CIU18 0x800000 /* Channel 18 In Use */
1680#define nCIU18 0x0
1681#define CL19 0x7f000000 /* Channel 19 Connection Label */ 1465#define CL19 0x7f000000 /* Channel 19 Connection Label */
1682#define CIU19 0x80000000 /* Channel 19 In Use */ 1466#define CIU19 0x80000000 /* Channel 19 In Use */
1683#define nCIU19 0x0
1684 1467
1685/* Bit masks for MXVR_ALLOC_5 */ 1468/* Bit masks for MXVR_ALLOC_5 */
1686 1469
1687#define CL20 0x7f /* Channel 20 Connection Label */ 1470#define CL20 0x7f /* Channel 20 Connection Label */
1688#define CIU20 0x80 /* Channel 20 In Use */ 1471#define CIU20 0x80 /* Channel 20 In Use */
1689#define nCIU20 0x0
1690#define CL21 0x7f00 /* Channel 21 Connection Label */ 1472#define CL21 0x7f00 /* Channel 21 Connection Label */
1691#define CIU21 0x8000 /* Channel 21 In Use */ 1473#define CIU21 0x8000 /* Channel 21 In Use */
1692#define nCIU21 0x0
1693#define CL22 0x7f0000 /* Channel 22 Connection Label */ 1474#define CL22 0x7f0000 /* Channel 22 Connection Label */
1694#define CIU22 0x800000 /* Channel 22 In Use */ 1475#define CIU22 0x800000 /* Channel 22 In Use */
1695#define nCIU22 0x0
1696#define CL23 0x7f000000 /* Channel 23 Connection Label */ 1476#define CL23 0x7f000000 /* Channel 23 Connection Label */
1697#define CIU23 0x80000000 /* Channel 23 In Use */ 1477#define CIU23 0x80000000 /* Channel 23 In Use */
1698#define nCIU23 0x0
1699 1478
1700/* Bit masks for MXVR_ALLOC_6 */ 1479/* Bit masks for MXVR_ALLOC_6 */
1701 1480
1702#define CL24 0x7f /* Channel 24 Connection Label */ 1481#define CL24 0x7f /* Channel 24 Connection Label */
1703#define CIU24 0x80 /* Channel 24 In Use */ 1482#define CIU24 0x80 /* Channel 24 In Use */
1704#define nCIU24 0x0
1705#define CL25 0x7f00 /* Channel 25 Connection Label */ 1483#define CL25 0x7f00 /* Channel 25 Connection Label */
1706#define CIU25 0x8000 /* Channel 25 In Use */ 1484#define CIU25 0x8000 /* Channel 25 In Use */
1707#define nCIU25 0x0
1708#define CL26 0x7f0000 /* Channel 26 Connection Label */ 1485#define CL26 0x7f0000 /* Channel 26 Connection Label */
1709#define CIU26 0x800000 /* Channel 26 In Use */ 1486#define CIU26 0x800000 /* Channel 26 In Use */
1710#define nCIU26 0x0
1711#define CL27 0x7f000000 /* Channel 27 Connection Label */ 1487#define CL27 0x7f000000 /* Channel 27 Connection Label */
1712#define CIU27 0x80000000 /* Channel 27 In Use */ 1488#define CIU27 0x80000000 /* Channel 27 In Use */
1713#define nCIU27 0x0
1714 1489
1715/* Bit masks for MXVR_ALLOC_7 */ 1490/* Bit masks for MXVR_ALLOC_7 */
1716 1491
1717#define CL28 0x7f /* Channel 28 Connection Label */ 1492#define CL28 0x7f /* Channel 28 Connection Label */
1718#define CIU28 0x80 /* Channel 28 In Use */ 1493#define CIU28 0x80 /* Channel 28 In Use */
1719#define nCIU28 0x0
1720#define CL29 0x7f00 /* Channel 29 Connection Label */ 1494#define CL29 0x7f00 /* Channel 29 Connection Label */
1721#define CIU29 0x8000 /* Channel 29 In Use */ 1495#define CIU29 0x8000 /* Channel 29 In Use */
1722#define nCIU29 0x0
1723#define CL30 0x7f0000 /* Channel 30 Connection Label */ 1496#define CL30 0x7f0000 /* Channel 30 Connection Label */
1724#define CIU30 0x800000 /* Channel 30 In Use */ 1497#define CIU30 0x800000 /* Channel 30 In Use */
1725#define nCIU30 0x0
1726#define CL31 0x7f000000 /* Channel 31 Connection Label */ 1498#define CL31 0x7f000000 /* Channel 31 Connection Label */
1727#define CIU31 0x80000000 /* Channel 31 In Use */ 1499#define CIU31 0x80000000 /* Channel 31 In Use */
1728#define nCIU31 0x0
1729 1500
1730/* Bit masks for MXVR_ALLOC_8 */ 1501/* Bit masks for MXVR_ALLOC_8 */
1731 1502
1732#define CL32 0x7f /* Channel 32 Connection Label */ 1503#define CL32 0x7f /* Channel 32 Connection Label */
1733#define CIU32 0x80 /* Channel 32 In Use */ 1504#define CIU32 0x80 /* Channel 32 In Use */
1734#define nCIU32 0x0
1735#define CL33 0x7f00 /* Channel 33 Connection Label */ 1505#define CL33 0x7f00 /* Channel 33 Connection Label */
1736#define CIU33 0x8000 /* Channel 33 In Use */ 1506#define CIU33 0x8000 /* Channel 33 In Use */
1737#define nCIU33 0x0
1738#define CL34 0x7f0000 /* Channel 34 Connection Label */ 1507#define CL34 0x7f0000 /* Channel 34 Connection Label */
1739#define CIU34 0x800000 /* Channel 34 In Use */ 1508#define CIU34 0x800000 /* Channel 34 In Use */
1740#define nCIU34 0x0
1741#define CL35 0x7f000000 /* Channel 35 Connection Label */ 1509#define CL35 0x7f000000 /* Channel 35 Connection Label */
1742#define CIU35 0x80000000 /* Channel 35 In Use */ 1510#define CIU35 0x80000000 /* Channel 35 In Use */
1743#define nCIU35 0x0
1744 1511
1745/* Bit masks for MXVR_ALLOC_9 */ 1512/* Bit masks for MXVR_ALLOC_9 */
1746 1513
1747#define CL36 0x7f /* Channel 36 Connection Label */ 1514#define CL36 0x7f /* Channel 36 Connection Label */
1748#define CIU36 0x80 /* Channel 36 In Use */ 1515#define CIU36 0x80 /* Channel 36 In Use */
1749#define nCIU36 0x0
1750#define CL37 0x7f00 /* Channel 37 Connection Label */ 1516#define CL37 0x7f00 /* Channel 37 Connection Label */
1751#define CIU37 0x8000 /* Channel 37 In Use */ 1517#define CIU37 0x8000 /* Channel 37 In Use */
1752#define nCIU37 0x0
1753#define CL38 0x7f0000 /* Channel 38 Connection Label */ 1518#define CL38 0x7f0000 /* Channel 38 Connection Label */
1754#define CIU38 0x800000 /* Channel 38 In Use */ 1519#define CIU38 0x800000 /* Channel 38 In Use */
1755#define nCIU38 0x0
1756#define CL39 0x7f000000 /* Channel 39 Connection Label */ 1520#define CL39 0x7f000000 /* Channel 39 Connection Label */
1757#define CIU39 0x80000000 /* Channel 39 In Use */ 1521#define CIU39 0x80000000 /* Channel 39 In Use */
1758#define nCIU39 0x0
1759 1522
1760/* Bit masks for MXVR_ALLOC_10 */ 1523/* Bit masks for MXVR_ALLOC_10 */
1761 1524
1762#define CL40 0x7f /* Channel 40 Connection Label */ 1525#define CL40 0x7f /* Channel 40 Connection Label */
1763#define CIU40 0x80 /* Channel 40 In Use */ 1526#define CIU40 0x80 /* Channel 40 In Use */
1764#define nCIU40 0x0
1765#define CL41 0x7f00 /* Channel 41 Connection Label */ 1527#define CL41 0x7f00 /* Channel 41 Connection Label */
1766#define CIU41 0x8000 /* Channel 41 In Use */ 1528#define CIU41 0x8000 /* Channel 41 In Use */
1767#define nCIU41 0x0
1768#define CL42 0x7f0000 /* Channel 42 Connection Label */ 1529#define CL42 0x7f0000 /* Channel 42 Connection Label */
1769#define CIU42 0x800000 /* Channel 42 In Use */ 1530#define CIU42 0x800000 /* Channel 42 In Use */
1770#define nCIU42 0x0
1771#define CL43 0x7f000000 /* Channel 43 Connection Label */ 1531#define CL43 0x7f000000 /* Channel 43 Connection Label */
1772#define CIU43 0x80000000 /* Channel 43 In Use */ 1532#define CIU43 0x80000000 /* Channel 43 In Use */
1773#define nCIU43 0x0
1774 1533
1775/* Bit masks for MXVR_ALLOC_11 */ 1534/* Bit masks for MXVR_ALLOC_11 */
1776 1535
1777#define CL44 0x7f /* Channel 44 Connection Label */ 1536#define CL44 0x7f /* Channel 44 Connection Label */
1778#define CIU44 0x80 /* Channel 44 In Use */ 1537#define CIU44 0x80 /* Channel 44 In Use */
1779#define nCIU44 0x0
1780#define CL45 0x7f00 /* Channel 45 Connection Label */ 1538#define CL45 0x7f00 /* Channel 45 Connection Label */
1781#define CIU45 0x8000 /* Channel 45 In Use */ 1539#define CIU45 0x8000 /* Channel 45 In Use */
1782#define nCIU45 0x0
1783#define CL46 0x7f0000 /* Channel 46 Connection Label */ 1540#define CL46 0x7f0000 /* Channel 46 Connection Label */
1784#define CIU46 0x800000 /* Channel 46 In Use */ 1541#define CIU46 0x800000 /* Channel 46 In Use */
1785#define nCIU46 0x0
1786#define CL47 0x7f000000 /* Channel 47 Connection Label */ 1542#define CL47 0x7f000000 /* Channel 47 Connection Label */
1787#define CIU47 0x80000000 /* Channel 47 In Use */ 1543#define CIU47 0x80000000 /* Channel 47 In Use */
1788#define nCIU47 0x0
1789 1544
1790/* Bit masks for MXVR_ALLOC_12 */ 1545/* Bit masks for MXVR_ALLOC_12 */
1791 1546
1792#define CL48 0x7f /* Channel 48 Connection Label */ 1547#define CL48 0x7f /* Channel 48 Connection Label */
1793#define CIU48 0x80 /* Channel 48 In Use */ 1548#define CIU48 0x80 /* Channel 48 In Use */
1794#define nCIU48 0x0
1795#define CL49 0x7f00 /* Channel 49 Connection Label */ 1549#define CL49 0x7f00 /* Channel 49 Connection Label */
1796#define CIU49 0x8000 /* Channel 49 In Use */ 1550#define CIU49 0x8000 /* Channel 49 In Use */
1797#define nCIU49 0x0
1798#define CL50 0x7f0000 /* Channel 50 Connection Label */ 1551#define CL50 0x7f0000 /* Channel 50 Connection Label */
1799#define CIU50 0x800000 /* Channel 50 In Use */ 1552#define CIU50 0x800000 /* Channel 50 In Use */
1800#define nCIU50 0x0
1801#define CL51 0x7f000000 /* Channel 51 Connection Label */ 1553#define CL51 0x7f000000 /* Channel 51 Connection Label */
1802#define CIU51 0x80000000 /* Channel 51 In Use */ 1554#define CIU51 0x80000000 /* Channel 51 In Use */
1803#define nCIU51 0x0
1804 1555
1805/* Bit masks for MXVR_ALLOC_13 */ 1556/* Bit masks for MXVR_ALLOC_13 */
1806 1557
1807#define CL52 0x7f /* Channel 52 Connection Label */ 1558#define CL52 0x7f /* Channel 52 Connection Label */
1808#define CIU52 0x80 /* Channel 52 In Use */ 1559#define CIU52 0x80 /* Channel 52 In Use */
1809#define nCIU52 0x0
1810#define CL53 0x7f00 /* Channel 53 Connection Label */ 1560#define CL53 0x7f00 /* Channel 53 Connection Label */
1811#define CIU53 0x8000 /* Channel 53 In Use */ 1561#define CIU53 0x8000 /* Channel 53 In Use */
1812#define nCIU53 0x0
1813#define CL54 0x7f0000 /* Channel 54 Connection Label */ 1562#define CL54 0x7f0000 /* Channel 54 Connection Label */
1814#define CIU54 0x800000 /* Channel 54 In Use */ 1563#define CIU54 0x800000 /* Channel 54 In Use */
1815#define nCIU54 0x0
1816#define CL55 0x7f000000 /* Channel 55 Connection Label */ 1564#define CL55 0x7f000000 /* Channel 55 Connection Label */
1817#define CIU55 0x80000000 /* Channel 55 In Use */ 1565#define CIU55 0x80000000 /* Channel 55 In Use */
1818#define nCIU55 0x0
1819 1566
1820/* Bit masks for MXVR_ALLOC_14 */ 1567/* Bit masks for MXVR_ALLOC_14 */
1821 1568
1822#define CL56 0x7f /* Channel 56 Connection Label */ 1569#define CL56 0x7f /* Channel 56 Connection Label */
1823#define CIU56 0x80 /* Channel 56 In Use */ 1570#define CIU56 0x80 /* Channel 56 In Use */
1824#define nCIU56 0x0
1825#define CL57 0x7f00 /* Channel 57 Connection Label */ 1571#define CL57 0x7f00 /* Channel 57 Connection Label */
1826#define CIU57 0x8000 /* Channel 57 In Use */ 1572#define CIU57 0x8000 /* Channel 57 In Use */
1827#define nCIU57 0x0
1828#define CL58 0x7f0000 /* Channel 58 Connection Label */ 1573#define CL58 0x7f0000 /* Channel 58 Connection Label */
1829#define CIU58 0x800000 /* Channel 58 In Use */ 1574#define CIU58 0x800000 /* Channel 58 In Use */
1830#define nCIU58 0x0
1831#define CL59 0x7f000000 /* Channel 59 Connection Label */ 1575#define CL59 0x7f000000 /* Channel 59 Connection Label */
1832#define CIU59 0x80000000 /* Channel 59 In Use */ 1576#define CIU59 0x80000000 /* Channel 59 In Use */
1833#define nCIU59 0x0
1834 1577
1835/* MXVR_SYNC_LCHAN_0 Masks */ 1578/* MXVR_SYNC_LCHAN_0 Masks */
1836 1579
@@ -1926,19 +1669,13 @@
1926/* Bit masks for MXVR_DMAx_CONFIG */ 1669/* Bit masks for MXVR_DMAx_CONFIG */
1927 1670
1928#define MDMAEN 0x1 /* DMA Channel Enable */ 1671#define MDMAEN 0x1 /* DMA Channel Enable */
1929#define nMDMAEN 0x0
1930#define DD 0x2 /* DMA Channel Direction */ 1672#define DD 0x2 /* DMA Channel Direction */
1931#define nDD 0x0
1932#define BY4SWAPEN 0x20 /* DMA Channel Four Byte Swap Enable */ 1673#define BY4SWAPEN 0x20 /* DMA Channel Four Byte Swap Enable */
1933#define nBY4SWAPEN 0x0
1934#define LCHAN 0x3c0 /* DMA Channel Logical Channel */ 1674#define LCHAN 0x3c0 /* DMA Channel Logical Channel */
1935#define BITSWAPEN 0x400 /* DMA Channel Bit Swap Enable */ 1675#define BITSWAPEN 0x400 /* DMA Channel Bit Swap Enable */
1936#define nBITSWAPEN 0x0
1937#define BY2SWAPEN 0x800 /* DMA Channel Two Byte Swap Enable */ 1676#define BY2SWAPEN 0x800 /* DMA Channel Two Byte Swap Enable */
1938#define nBY2SWAPEN 0x0
1939#define MFLOW 0x7000 /* DMA Channel Operation Flow */ 1677#define MFLOW 0x7000 /* DMA Channel Operation Flow */
1940#define FIXEDPM 0x80000 /* DMA Channel Fixed Pattern Matching Select */ 1678#define FIXEDPM 0x80000 /* DMA Channel Fixed Pattern Matching Select */
1941#define nFIXEDPM 0x0
1942#define STARTPAT 0x300000 /* DMA Channel Start Pattern Select */ 1679#define STARTPAT 0x300000 /* DMA Channel Start Pattern Select */
1943#define STOPPAT 0xc00000 /* DMA Channel Stop Pattern Select */ 1680#define STOPPAT 0xc00000 /* DMA Channel Stop Pattern Select */
1944#define COUNTPOS 0x1c000000 /* DMA Channel Count Position */ 1681#define COUNTPOS 0x1c000000 /* DMA Channel Count Position */
@@ -1946,94 +1683,71 @@
1946/* Bit masks for MXVR_AP_CTL */ 1683/* Bit masks for MXVR_AP_CTL */
1947 1684
1948#define STARTAP 0x1 /* Start Asynchronous Packet Transmission */ 1685#define STARTAP 0x1 /* Start Asynchronous Packet Transmission */
1949#define nSTARTAP 0x0
1950#define CANCELAP 0x2 /* Cancel Asynchronous Packet Transmission */ 1686#define CANCELAP 0x2 /* Cancel Asynchronous Packet Transmission */
1951#define nCANCELAP 0x0
1952#define RESETAP 0x4 /* Reset Asynchronous Packet Arbitration */ 1687#define RESETAP 0x4 /* Reset Asynchronous Packet Arbitration */
1953#define nRESETAP 0x0
1954#define APRBE0 0x4000 /* Asynchronous Packet Receive Buffer Entry 0 */ 1688#define APRBE0 0x4000 /* Asynchronous Packet Receive Buffer Entry 0 */
1955#define nAPRBE0 0x0
1956#define APRBE1 0x8000 /* Asynchronous Packet Receive Buffer Entry 1 */ 1689#define APRBE1 0x8000 /* Asynchronous Packet Receive Buffer Entry 1 */
1957#define nAPRBE1 0x0
1958 1690
1959/* Bit masks for MXVR_APRB_START_ADDR */ 1691/* Bit masks for MXVR_APRB_START_ADDR */
1960 1692
1961#define MXVR_APRB_START_ADDR 0x1fffffe /* Asynchronous Packet Receive Buffer Start Address */ 1693#define MXVR_APRB_START_ADDR_MASK 0x1fffffe /* Asynchronous Packet Receive Buffer Start Address */
1962 1694
1963/* Bit masks for MXVR_APRB_CURR_ADDR */ 1695/* Bit masks for MXVR_APRB_CURR_ADDR */
1964 1696
1965#define MXVR_APRB_CURR_ADDR 0xffffffff /* Asynchronous Packet Receive Buffer Current Address */ 1697#define MXVR_APRB_CURR_ADDR_MASK 0xffffffff /* Asynchronous Packet Receive Buffer Current Address */
1966 1698
1967/* Bit masks for MXVR_APTB_START_ADDR */ 1699/* Bit masks for MXVR_APTB_START_ADDR */
1968 1700
1969#define MXVR_APTB_START_ADDR 0x1fffffe /* Asynchronous Packet Transmit Buffer Start Address */ 1701#define MXVR_APTB_START_ADDR_MASK 0x1fffffe /* Asynchronous Packet Transmit Buffer Start Address */
1970 1702
1971/* Bit masks for MXVR_APTB_CURR_ADDR */ 1703/* Bit masks for MXVR_APTB_CURR_ADDR */
1972 1704
1973#define MXVR_APTB_CURR_ADDR 0xffffffff /* Asynchronous Packet Transmit Buffer Current Address */ 1705#define MXVR_APTB_CURR_ADDR_MASK 0xffffffff /* Asynchronous Packet Transmit Buffer Current Address */
1974 1706
1975/* Bit masks for MXVR_CM_CTL */ 1707/* Bit masks for MXVR_CM_CTL */
1976 1708
1977#define STARTCM 0x1 /* Start Control Message Transmission */ 1709#define STARTCM 0x1 /* Start Control Message Transmission */
1978#define nSTARTCM 0x0
1979#define CANCELCM 0x2 /* Cancel Control Message Transmission */ 1710#define CANCELCM 0x2 /* Cancel Control Message Transmission */
1980#define nCANCELCM 0x0
1981#define CMRBE0 0x10000 /* Control Message Receive Buffer Entry 0 */ 1711#define CMRBE0 0x10000 /* Control Message Receive Buffer Entry 0 */
1982#define nCMRBE0 0x0
1983#define CMRBE1 0x20000 /* Control Message Receive Buffer Entry 1 */ 1712#define CMRBE1 0x20000 /* Control Message Receive Buffer Entry 1 */
1984#define nCMRBE1 0x0
1985#define CMRBE2 0x40000 /* Control Message Receive Buffer Entry 2 */ 1713#define CMRBE2 0x40000 /* Control Message Receive Buffer Entry 2 */
1986#define nCMRBE2 0x0
1987#define CMRBE3 0x80000 /* Control Message Receive Buffer Entry 3 */ 1714#define CMRBE3 0x80000 /* Control Message Receive Buffer Entry 3 */
1988#define nCMRBE3 0x0
1989#define CMRBE4 0x100000 /* Control Message Receive Buffer Entry 4 */ 1715#define CMRBE4 0x100000 /* Control Message Receive Buffer Entry 4 */
1990#define nCMRBE4 0x0
1991#define CMRBE5 0x200000 /* Control Message Receive Buffer Entry 5 */ 1716#define CMRBE5 0x200000 /* Control Message Receive Buffer Entry 5 */
1992#define nCMRBE5 0x0
1993#define CMRBE6 0x400000 /* Control Message Receive Buffer Entry 6 */ 1717#define CMRBE6 0x400000 /* Control Message Receive Buffer Entry 6 */
1994#define nCMRBE6 0x0
1995#define CMRBE7 0x800000 /* Control Message Receive Buffer Entry 7 */ 1718#define CMRBE7 0x800000 /* Control Message Receive Buffer Entry 7 */
1996#define nCMRBE7 0x0
1997#define CMRBE8 0x1000000 /* Control Message Receive Buffer Entry 8 */ 1719#define CMRBE8 0x1000000 /* Control Message Receive Buffer Entry 8 */
1998#define nCMRBE8 0x0
1999#define CMRBE9 0x2000000 /* Control Message Receive Buffer Entry 9 */ 1720#define CMRBE9 0x2000000 /* Control Message Receive Buffer Entry 9 */
2000#define nCMRBE9 0x0
2001#define CMRBE10 0x4000000 /* Control Message Receive Buffer Entry 10 */ 1721#define CMRBE10 0x4000000 /* Control Message Receive Buffer Entry 10 */
2002#define nCMRBE10 0x0
2003#define CMRBE11 0x8000000 /* Control Message Receive Buffer Entry 11 */ 1722#define CMRBE11 0x8000000 /* Control Message Receive Buffer Entry 11 */
2004#define nCMRBE11 0x0
2005#define CMRBE12 0x10000000 /* Control Message Receive Buffer Entry 12 */ 1723#define CMRBE12 0x10000000 /* Control Message Receive Buffer Entry 12 */
2006#define nCMRBE12 0x0
2007#define CMRBE13 0x20000000 /* Control Message Receive Buffer Entry 13 */ 1724#define CMRBE13 0x20000000 /* Control Message Receive Buffer Entry 13 */
2008#define nCMRBE13 0x0
2009#define CMRBE14 0x40000000 /* Control Message Receive Buffer Entry 14 */ 1725#define CMRBE14 0x40000000 /* Control Message Receive Buffer Entry 14 */
2010#define nCMRBE14 0x0
2011#define CMRBE15 0x80000000 /* Control Message Receive Buffer Entry 15 */ 1726#define CMRBE15 0x80000000 /* Control Message Receive Buffer Entry 15 */
2012#define nCMRBE15 0x0
2013 1727
2014/* Bit masks for MXVR_CMRB_START_ADDR */ 1728/* Bit masks for MXVR_CMRB_START_ADDR */
2015 1729
2016#define MXVR_CMRB_START_ADDR 0x1fffffe /* Control Message Receive Buffer Start Address */ 1730#define MXVR_CMRB_START_ADDR_MASK 0x1fffffe /* Control Message Receive Buffer Start Address */
2017 1731
2018/* Bit masks for MXVR_CMRB_CURR_ADDR */ 1732/* Bit masks for MXVR_CMRB_CURR_ADDR */
2019 1733
2020#define MXVR_CMRB_CURR_ADDR 0xffffffff /* Control Message Receive Buffer Current Address */ 1734#define MXVR_CMRB_CURR_ADDR_MASK 0xffffffff /* Control Message Receive Buffer Current Address */
2021 1735
2022/* Bit masks for MXVR_CMTB_START_ADDR */ 1736/* Bit masks for MXVR_CMTB_START_ADDR */
2023 1737
2024#define MXVR_CMTB_START_ADDR 0x1fffffe /* Control Message Transmit Buffer Start Address */ 1738#define MXVR_CMTB_START_ADDR_MASK 0x1fffffe /* Control Message Transmit Buffer Start Address */
2025 1739
2026/* Bit masks for MXVR_CMTB_CURR_ADDR */ 1740/* Bit masks for MXVR_CMTB_CURR_ADDR */
2027 1741
2028#define MXVR_CMTB_CURR_ADDR 0xffffffff /* Control Message Transmit Buffer Current Address */ 1742#define MXVR_CMTB_CURR_ADDR_MASK 0xffffffff /* Control Message Transmit Buffer Current Address */
2029 1743
2030/* Bit masks for MXVR_RRDB_START_ADDR */ 1744/* Bit masks for MXVR_RRDB_START_ADDR */
2031 1745
2032#define MXVR_RRDB_START_ADDR 0x1fffffe /* Remote Read Buffer Start Address */ 1746#define MXVR_RRDB_START_ADDR_MASK 0x1fffffe /* Remote Read Buffer Start Address */
2033 1747
2034/* Bit masks for MXVR_RRDB_CURR_ADDR */ 1748/* Bit masks for MXVR_RRDB_CURR_ADDR */
2035 1749
2036#define MXVR_RRDB_CURR_ADDR 0xffffffff /* Remote Read Buffer Current Address */ 1750#define MXVR_RRDB_CURR_ADDR_MASK 0xffffffff /* Remote Read Buffer Current Address */
2037 1751
2038/* Bit masks for MXVR_PAT_DATAx */ 1752/* Bit masks for MXVR_PAT_DATAx */
2039 1753
@@ -2045,136 +1759,72 @@
2045/* Bit masks for MXVR_PAT_EN_0 */ 1759/* Bit masks for MXVR_PAT_EN_0 */
2046 1760
2047#define MATCH_EN_0_0 0x1 /* Pattern Match Enable Byte 0 Bit 0 */ 1761#define MATCH_EN_0_0 0x1 /* Pattern Match Enable Byte 0 Bit 0 */
2048#define nMATCH_EN_0_0 0x0
2049#define MATCH_EN_0_1 0x2 /* Pattern Match Enable Byte 0 Bit 1 */ 1762#define MATCH_EN_0_1 0x2 /* Pattern Match Enable Byte 0 Bit 1 */
2050#define nMATCH_EN_0_1 0x0
2051#define MATCH_EN_0_2 0x4 /* Pattern Match Enable Byte 0 Bit 2 */ 1763#define MATCH_EN_0_2 0x4 /* Pattern Match Enable Byte 0 Bit 2 */
2052#define nMATCH_EN_0_2 0x0
2053#define MATCH_EN_0_3 0x8 /* Pattern Match Enable Byte 0 Bit 3 */ 1764#define MATCH_EN_0_3 0x8 /* Pattern Match Enable Byte 0 Bit 3 */
2054#define nMATCH_EN_0_3 0x0
2055#define MATCH_EN_0_4 0x10 /* Pattern Match Enable Byte 0 Bit 4 */ 1765#define MATCH_EN_0_4 0x10 /* Pattern Match Enable Byte 0 Bit 4 */
2056#define nMATCH_EN_0_4 0x0
2057#define MATCH_EN_0_5 0x20 /* Pattern Match Enable Byte 0 Bit 5 */ 1766#define MATCH_EN_0_5 0x20 /* Pattern Match Enable Byte 0 Bit 5 */
2058#define nMATCH_EN_0_5 0x0
2059#define MATCH_EN_0_6 0x40 /* Pattern Match Enable Byte 0 Bit 6 */ 1767#define MATCH_EN_0_6 0x40 /* Pattern Match Enable Byte 0 Bit 6 */
2060#define nMATCH_EN_0_6 0x0
2061#define MATCH_EN_0_7 0x80 /* Pattern Match Enable Byte 0 Bit 7 */ 1768#define MATCH_EN_0_7 0x80 /* Pattern Match Enable Byte 0 Bit 7 */
2062#define nMATCH_EN_0_7 0x0
2063#define MATCH_EN_1_0 0x100 /* Pattern Match Enable Byte 1 Bit 0 */ 1769#define MATCH_EN_1_0 0x100 /* Pattern Match Enable Byte 1 Bit 0 */
2064#define nMATCH_EN_1_0 0x0
2065#define MATCH_EN_1_1 0x200 /* Pattern Match Enable Byte 1 Bit 1 */ 1770#define MATCH_EN_1_1 0x200 /* Pattern Match Enable Byte 1 Bit 1 */
2066#define nMATCH_EN_1_1 0x0
2067#define MATCH_EN_1_2 0x400 /* Pattern Match Enable Byte 1 Bit 2 */ 1771#define MATCH_EN_1_2 0x400 /* Pattern Match Enable Byte 1 Bit 2 */
2068#define nMATCH_EN_1_2 0x0
2069#define MATCH_EN_1_3 0x800 /* Pattern Match Enable Byte 1 Bit 3 */ 1772#define MATCH_EN_1_3 0x800 /* Pattern Match Enable Byte 1 Bit 3 */
2070#define nMATCH_EN_1_3 0x0
2071#define MATCH_EN_1_4 0x1000 /* Pattern Match Enable Byte 1 Bit 4 */ 1773#define MATCH_EN_1_4 0x1000 /* Pattern Match Enable Byte 1 Bit 4 */
2072#define nMATCH_EN_1_4 0x0
2073#define MATCH_EN_1_5 0x2000 /* Pattern Match Enable Byte 1 Bit 5 */ 1774#define MATCH_EN_1_5 0x2000 /* Pattern Match Enable Byte 1 Bit 5 */
2074#define nMATCH_EN_1_5 0x0
2075#define MATCH_EN_1_6 0x4000 /* Pattern Match Enable Byte 1 Bit 6 */ 1775#define MATCH_EN_1_6 0x4000 /* Pattern Match Enable Byte 1 Bit 6 */
2076#define nMATCH_EN_1_6 0x0
2077#define MATCH_EN_1_7 0x8000 /* Pattern Match Enable Byte 1 Bit 7 */ 1776#define MATCH_EN_1_7 0x8000 /* Pattern Match Enable Byte 1 Bit 7 */
2078#define nMATCH_EN_1_7 0x0
2079#define MATCH_EN_2_0 0x10000 /* Pattern Match Enable Byte 2 Bit 0 */ 1777#define MATCH_EN_2_0 0x10000 /* Pattern Match Enable Byte 2 Bit 0 */
2080#define nMATCH_EN_2_0 0x0
2081#define MATCH_EN_2_1 0x20000 /* Pattern Match Enable Byte 2 Bit 1 */ 1778#define MATCH_EN_2_1 0x20000 /* Pattern Match Enable Byte 2 Bit 1 */
2082#define nMATCH_EN_2_1 0x0
2083#define MATCH_EN_2_2 0x40000 /* Pattern Match Enable Byte 2 Bit 2 */ 1779#define MATCH_EN_2_2 0x40000 /* Pattern Match Enable Byte 2 Bit 2 */
2084#define nMATCH_EN_2_2 0x0
2085#define MATCH_EN_2_3 0x80000 /* Pattern Match Enable Byte 2 Bit 3 */ 1780#define MATCH_EN_2_3 0x80000 /* Pattern Match Enable Byte 2 Bit 3 */
2086#define nMATCH_EN_2_3 0x0
2087#define MATCH_EN_2_4 0x100000 /* Pattern Match Enable Byte 2 Bit 4 */ 1781#define MATCH_EN_2_4 0x100000 /* Pattern Match Enable Byte 2 Bit 4 */
2088#define nMATCH_EN_2_4 0x0
2089#define MATCH_EN_2_5 0x200000 /* Pattern Match Enable Byte 2 Bit 5 */ 1782#define MATCH_EN_2_5 0x200000 /* Pattern Match Enable Byte 2 Bit 5 */
2090#define nMATCH_EN_2_5 0x0
2091#define MATCH_EN_2_6 0x400000 /* Pattern Match Enable Byte 2 Bit 6 */ 1783#define MATCH_EN_2_6 0x400000 /* Pattern Match Enable Byte 2 Bit 6 */
2092#define nMATCH_EN_2_6 0x0
2093#define MATCH_EN_2_7 0x800000 /* Pattern Match Enable Byte 2 Bit 7 */ 1784#define MATCH_EN_2_7 0x800000 /* Pattern Match Enable Byte 2 Bit 7 */
2094#define nMATCH_EN_2_7 0x0
2095#define MATCH_EN_3_0 0x1000000 /* Pattern Match Enable Byte 3 Bit 0 */ 1785#define MATCH_EN_3_0 0x1000000 /* Pattern Match Enable Byte 3 Bit 0 */
2096#define nMATCH_EN_3_0 0x0
2097#define MATCH_EN_3_1 0x2000000 /* Pattern Match Enable Byte 3 Bit 1 */ 1786#define MATCH_EN_3_1 0x2000000 /* Pattern Match Enable Byte 3 Bit 1 */
2098#define nMATCH_EN_3_1 0x0
2099#define MATCH_EN_3_2 0x4000000 /* Pattern Match Enable Byte 3 Bit 2 */ 1787#define MATCH_EN_3_2 0x4000000 /* Pattern Match Enable Byte 3 Bit 2 */
2100#define nMATCH_EN_3_2 0x0
2101#define MATCH_EN_3_3 0x8000000 /* Pattern Match Enable Byte 3 Bit 3 */ 1788#define MATCH_EN_3_3 0x8000000 /* Pattern Match Enable Byte 3 Bit 3 */
2102#define nMATCH_EN_3_3 0x0
2103#define MATCH_EN_3_4 0x10000000 /* Pattern Match Enable Byte 3 Bit 4 */ 1789#define MATCH_EN_3_4 0x10000000 /* Pattern Match Enable Byte 3 Bit 4 */
2104#define nMATCH_EN_3_4 0x0
2105#define MATCH_EN_3_5 0x20000000 /* Pattern Match Enable Byte 3 Bit 5 */ 1790#define MATCH_EN_3_5 0x20000000 /* Pattern Match Enable Byte 3 Bit 5 */
2106#define nMATCH_EN_3_5 0x0
2107#define MATCH_EN_3_6 0x40000000 /* Pattern Match Enable Byte 3 Bit 6 */ 1791#define MATCH_EN_3_6 0x40000000 /* Pattern Match Enable Byte 3 Bit 6 */
2108#define nMATCH_EN_3_6 0x0
2109#define MATCH_EN_3_7 0x80000000 /* Pattern Match Enable Byte 3 Bit 7 */ 1792#define MATCH_EN_3_7 0x80000000 /* Pattern Match Enable Byte 3 Bit 7 */
2110#define nMATCH_EN_3_7 0x0
2111 1793
2112/* Bit masks for MXVR_PAT_EN_1 */ 1794/* Bit masks for MXVR_PAT_EN_1 */
2113 1795
2114#define MATCH_EN_0_0 0x1 /* Pattern Match Enable Byte 0 Bit 0 */ 1796#define MATCH_EN_0_0 0x1 /* Pattern Match Enable Byte 0 Bit 0 */
2115#define nMATCH_EN_0_0 0x0
2116#define MATCH_EN_0_1 0x2 /* Pattern Match Enable Byte 0 Bit 1 */ 1797#define MATCH_EN_0_1 0x2 /* Pattern Match Enable Byte 0 Bit 1 */
2117#define nMATCH_EN_0_1 0x0
2118#define MATCH_EN_0_2 0x4 /* Pattern Match Enable Byte 0 Bit 2 */ 1798#define MATCH_EN_0_2 0x4 /* Pattern Match Enable Byte 0 Bit 2 */
2119#define nMATCH_EN_0_2 0x0
2120#define MATCH_EN_0_3 0x8 /* Pattern Match Enable Byte 0 Bit 3 */ 1799#define MATCH_EN_0_3 0x8 /* Pattern Match Enable Byte 0 Bit 3 */
2121#define nMATCH_EN_0_3 0x0
2122#define MATCH_EN_0_4 0x10 /* Pattern Match Enable Byte 0 Bit 4 */ 1800#define MATCH_EN_0_4 0x10 /* Pattern Match Enable Byte 0 Bit 4 */
2123#define nMATCH_EN_0_4 0x0
2124#define MATCH_EN_0_5 0x20 /* Pattern Match Enable Byte 0 Bit 5 */ 1801#define MATCH_EN_0_5 0x20 /* Pattern Match Enable Byte 0 Bit 5 */
2125#define nMATCH_EN_0_5 0x0
2126#define MATCH_EN_0_6 0x40 /* Pattern Match Enable Byte 0 Bit 6 */ 1802#define MATCH_EN_0_6 0x40 /* Pattern Match Enable Byte 0 Bit 6 */
2127#define nMATCH_EN_0_6 0x0
2128#define MATCH_EN_0_7 0x80 /* Pattern Match Enable Byte 0 Bit 7 */ 1803#define MATCH_EN_0_7 0x80 /* Pattern Match Enable Byte 0 Bit 7 */
2129#define nMATCH_EN_0_7 0x0
2130#define MATCH_EN_1_0 0x100 /* Pattern Match Enable Byte 1 Bit 0 */ 1804#define MATCH_EN_1_0 0x100 /* Pattern Match Enable Byte 1 Bit 0 */
2131#define nMATCH_EN_1_0 0x0
2132#define MATCH_EN_1_1 0x200 /* Pattern Match Enable Byte 1 Bit 1 */ 1805#define MATCH_EN_1_1 0x200 /* Pattern Match Enable Byte 1 Bit 1 */
2133#define nMATCH_EN_1_1 0x0
2134#define MATCH_EN_1_2 0x400 /* Pattern Match Enable Byte 1 Bit 2 */ 1806#define MATCH_EN_1_2 0x400 /* Pattern Match Enable Byte 1 Bit 2 */
2135#define nMATCH_EN_1_2 0x0
2136#define MATCH_EN_1_3 0x800 /* Pattern Match Enable Byte 1 Bit 3 */ 1807#define MATCH_EN_1_3 0x800 /* Pattern Match Enable Byte 1 Bit 3 */
2137#define nMATCH_EN_1_3 0x0
2138#define MATCH_EN_1_4 0x1000 /* Pattern Match Enable Byte 1 Bit 4 */ 1808#define MATCH_EN_1_4 0x1000 /* Pattern Match Enable Byte 1 Bit 4 */
2139#define nMATCH_EN_1_4 0x0
2140#define MATCH_EN_1_5 0x2000 /* Pattern Match Enable Byte 1 Bit 5 */ 1809#define MATCH_EN_1_5 0x2000 /* Pattern Match Enable Byte 1 Bit 5 */
2141#define nMATCH_EN_1_5 0x0
2142#define MATCH_EN_1_6 0x4000 /* Pattern Match Enable Byte 1 Bit 6 */ 1810#define MATCH_EN_1_6 0x4000 /* Pattern Match Enable Byte 1 Bit 6 */
2143#define nMATCH_EN_1_6 0x0
2144#define MATCH_EN_1_7 0x8000 /* Pattern Match Enable Byte 1 Bit 7 */ 1811#define MATCH_EN_1_7 0x8000 /* Pattern Match Enable Byte 1 Bit 7 */
2145#define nMATCH_EN_1_7 0x0
2146#define MATCH_EN_2_0 0x10000 /* Pattern Match Enable Byte 2 Bit 0 */ 1812#define MATCH_EN_2_0 0x10000 /* Pattern Match Enable Byte 2 Bit 0 */
2147#define nMATCH_EN_2_0 0x0
2148#define MATCH_EN_2_1 0x20000 /* Pattern Match Enable Byte 2 Bit 1 */ 1813#define MATCH_EN_2_1 0x20000 /* Pattern Match Enable Byte 2 Bit 1 */
2149#define nMATCH_EN_2_1 0x0
2150#define MATCH_EN_2_2 0x40000 /* Pattern Match Enable Byte 2 Bit 2 */ 1814#define MATCH_EN_2_2 0x40000 /* Pattern Match Enable Byte 2 Bit 2 */
2151#define nMATCH_EN_2_2 0x0
2152#define MATCH_EN_2_3 0x80000 /* Pattern Match Enable Byte 2 Bit 3 */ 1815#define MATCH_EN_2_3 0x80000 /* Pattern Match Enable Byte 2 Bit 3 */
2153#define nMATCH_EN_2_3 0x0
2154#define MATCH_EN_2_4 0x100000 /* Pattern Match Enable Byte 2 Bit 4 */ 1816#define MATCH_EN_2_4 0x100000 /* Pattern Match Enable Byte 2 Bit 4 */
2155#define nMATCH_EN_2_4 0x0
2156#define MATCH_EN_2_5 0x200000 /* Pattern Match Enable Byte 2 Bit 5 */ 1817#define MATCH_EN_2_5 0x200000 /* Pattern Match Enable Byte 2 Bit 5 */
2157#define nMATCH_EN_2_5 0x0
2158#define MATCH_EN_2_6 0x400000 /* Pattern Match Enable Byte 2 Bit 6 */ 1818#define MATCH_EN_2_6 0x400000 /* Pattern Match Enable Byte 2 Bit 6 */
2159#define nMATCH_EN_2_6 0x0
2160#define MATCH_EN_2_7 0x800000 /* Pattern Match Enable Byte 2 Bit 7 */ 1819#define MATCH_EN_2_7 0x800000 /* Pattern Match Enable Byte 2 Bit 7 */
2161#define nMATCH_EN_2_7 0x0
2162#define MATCH_EN_3_0 0x1000000 /* Pattern Match Enable Byte 3 Bit 0 */ 1820#define MATCH_EN_3_0 0x1000000 /* Pattern Match Enable Byte 3 Bit 0 */
2163#define nMATCH_EN_3_0 0x0
2164#define MATCH_EN_3_1 0x2000000 /* Pattern Match Enable Byte 3 Bit 1 */ 1821#define MATCH_EN_3_1 0x2000000 /* Pattern Match Enable Byte 3 Bit 1 */
2165#define nMATCH_EN_3_1 0x0
2166#define MATCH_EN_3_2 0x4000000 /* Pattern Match Enable Byte 3 Bit 2 */ 1822#define MATCH_EN_3_2 0x4000000 /* Pattern Match Enable Byte 3 Bit 2 */
2167#define nMATCH_EN_3_2 0x0
2168#define MATCH_EN_3_3 0x8000000 /* Pattern Match Enable Byte 3 Bit 3 */ 1823#define MATCH_EN_3_3 0x8000000 /* Pattern Match Enable Byte 3 Bit 3 */
2169#define nMATCH_EN_3_3 0x0
2170#define MATCH_EN_3_4 0x10000000 /* Pattern Match Enable Byte 3 Bit 4 */ 1824#define MATCH_EN_3_4 0x10000000 /* Pattern Match Enable Byte 3 Bit 4 */
2171#define nMATCH_EN_3_4 0x0
2172#define MATCH_EN_3_5 0x20000000 /* Pattern Match Enable Byte 3 Bit 5 */ 1825#define MATCH_EN_3_5 0x20000000 /* Pattern Match Enable Byte 3 Bit 5 */
2173#define nMATCH_EN_3_5 0x0
2174#define MATCH_EN_3_6 0x40000000 /* Pattern Match Enable Byte 3 Bit 6 */ 1826#define MATCH_EN_3_6 0x40000000 /* Pattern Match Enable Byte 3 Bit 6 */
2175#define nMATCH_EN_3_6 0x0
2176#define MATCH_EN_3_7 0x80000000 /* Pattern Match Enable Byte 3 Bit 7 */ 1827#define MATCH_EN_3_7 0x80000000 /* Pattern Match Enable Byte 3 Bit 7 */
2177#define nMATCH_EN_3_7 0x0
2178 1828
2179/* Bit masks for MXVR_FRAME_CNT_0 */ 1829/* Bit masks for MXVR_FRAME_CNT_0 */
2180 1830
@@ -2188,226 +1838,166 @@
2188 1838
2189#define TX_CH0 0x3f /* Transmit Channel 0 */ 1839#define TX_CH0 0x3f /* Transmit Channel 0 */
2190#define MUTE_CH0 0x80 /* Mute Channel 0 */ 1840#define MUTE_CH0 0x80 /* Mute Channel 0 */
2191#define nMUTE_CH0 0x0
2192#define TX_CH1 0x3f00 /* Transmit Channel 0 */ 1841#define TX_CH1 0x3f00 /* Transmit Channel 0 */
2193#define MUTE_CH1 0x8000 /* Mute Channel 0 */ 1842#define MUTE_CH1 0x8000 /* Mute Channel 0 */
2194#define nMUTE_CH1 0x0
2195#define TX_CH2 0x3f0000 /* Transmit Channel 0 */ 1843#define TX_CH2 0x3f0000 /* Transmit Channel 0 */
2196#define MUTE_CH2 0x800000 /* Mute Channel 0 */ 1844#define MUTE_CH2 0x800000 /* Mute Channel 0 */
2197#define nMUTE_CH2 0x0
2198#define TX_CH3 0x3f000000 /* Transmit Channel 0 */ 1845#define TX_CH3 0x3f000000 /* Transmit Channel 0 */
2199#define MUTE_CH3 0x80000000 /* Mute Channel 0 */ 1846#define MUTE_CH3 0x80000000 /* Mute Channel 0 */
2200#define nMUTE_CH3 0x0
2201 1847
2202/* Bit masks for MXVR_ROUTING_1 */ 1848/* Bit masks for MXVR_ROUTING_1 */
2203 1849
2204#define TX_CH4 0x3f /* Transmit Channel 4 */ 1850#define TX_CH4 0x3f /* Transmit Channel 4 */
2205#define MUTE_CH4 0x80 /* Mute Channel 4 */ 1851#define MUTE_CH4 0x80 /* Mute Channel 4 */
2206#define nMUTE_CH4 0x0
2207#define TX_CH5 0x3f00 /* Transmit Channel 5 */ 1852#define TX_CH5 0x3f00 /* Transmit Channel 5 */
2208#define MUTE_CH5 0x8000 /* Mute Channel 5 */ 1853#define MUTE_CH5 0x8000 /* Mute Channel 5 */
2209#define nMUTE_CH5 0x0
2210#define TX_CH6 0x3f0000 /* Transmit Channel 6 */ 1854#define TX_CH6 0x3f0000 /* Transmit Channel 6 */
2211#define MUTE_CH6 0x800000 /* Mute Channel 6 */ 1855#define MUTE_CH6 0x800000 /* Mute Channel 6 */
2212#define nMUTE_CH6 0x0
2213#define TX_CH7 0x3f000000 /* Transmit Channel 7 */ 1856#define TX_CH7 0x3f000000 /* Transmit Channel 7 */
2214#define MUTE_CH7 0x80000000 /* Mute Channel 7 */ 1857#define MUTE_CH7 0x80000000 /* Mute Channel 7 */
2215#define nMUTE_CH7 0x0
2216 1858
2217/* Bit masks for MXVR_ROUTING_2 */ 1859/* Bit masks for MXVR_ROUTING_2 */
2218 1860
2219#define TX_CH8 0x3f /* Transmit Channel 8 */ 1861#define TX_CH8 0x3f /* Transmit Channel 8 */
2220#define MUTE_CH8 0x80 /* Mute Channel 8 */ 1862#define MUTE_CH8 0x80 /* Mute Channel 8 */
2221#define nMUTE_CH8 0x0
2222#define TX_CH9 0x3f00 /* Transmit Channel 9 */ 1863#define TX_CH9 0x3f00 /* Transmit Channel 9 */
2223#define MUTE_CH9 0x8000 /* Mute Channel 9 */ 1864#define MUTE_CH9 0x8000 /* Mute Channel 9 */
2224#define nMUTE_CH9 0x0
2225#define TX_CH10 0x3f0000 /* Transmit Channel 10 */ 1865#define TX_CH10 0x3f0000 /* Transmit Channel 10 */
2226#define MUTE_CH10 0x800000 /* Mute Channel 10 */ 1866#define MUTE_CH10 0x800000 /* Mute Channel 10 */
2227#define nMUTE_CH10 0x0
2228#define TX_CH11 0x3f000000 /* Transmit Channel 11 */ 1867#define TX_CH11 0x3f000000 /* Transmit Channel 11 */
2229#define MUTE_CH11 0x80000000 /* Mute Channel 11 */ 1868#define MUTE_CH11 0x80000000 /* Mute Channel 11 */
2230#define nMUTE_CH11 0x0
2231 1869
2232/* Bit masks for MXVR_ROUTING_3 */ 1870/* Bit masks for MXVR_ROUTING_3 */
2233 1871
2234#define TX_CH12 0x3f /* Transmit Channel 12 */ 1872#define TX_CH12 0x3f /* Transmit Channel 12 */
2235#define MUTE_CH12 0x80 /* Mute Channel 12 */ 1873#define MUTE_CH12 0x80 /* Mute Channel 12 */
2236#define nMUTE_CH12 0x0
2237#define TX_CH13 0x3f00 /* Transmit Channel 13 */ 1874#define TX_CH13 0x3f00 /* Transmit Channel 13 */
2238#define MUTE_CH13 0x8000 /* Mute Channel 13 */ 1875#define MUTE_CH13 0x8000 /* Mute Channel 13 */
2239#define nMUTE_CH13 0x0
2240#define TX_CH14 0x3f0000 /* Transmit Channel 14 */ 1876#define TX_CH14 0x3f0000 /* Transmit Channel 14 */
2241#define MUTE_CH14 0x800000 /* Mute Channel 14 */ 1877#define MUTE_CH14 0x800000 /* Mute Channel 14 */
2242#define nMUTE_CH14 0x0
2243#define TX_CH15 0x3f000000 /* Transmit Channel 15 */ 1878#define TX_CH15 0x3f000000 /* Transmit Channel 15 */
2244#define MUTE_CH15 0x80000000 /* Mute Channel 15 */ 1879#define MUTE_CH15 0x80000000 /* Mute Channel 15 */
2245#define nMUTE_CH15 0x0
2246 1880
2247/* Bit masks for MXVR_ROUTING_4 */ 1881/* Bit masks for MXVR_ROUTING_4 */
2248 1882
2249#define TX_CH16 0x3f /* Transmit Channel 16 */ 1883#define TX_CH16 0x3f /* Transmit Channel 16 */
2250#define MUTE_CH16 0x80 /* Mute Channel 16 */ 1884#define MUTE_CH16 0x80 /* Mute Channel 16 */
2251#define nMUTE_CH16 0x0
2252#define TX_CH17 0x3f00 /* Transmit Channel 17 */ 1885#define TX_CH17 0x3f00 /* Transmit Channel 17 */
2253#define MUTE_CH17 0x8000 /* Mute Channel 17 */ 1886#define MUTE_CH17 0x8000 /* Mute Channel 17 */
2254#define nMUTE_CH17 0x0
2255#define TX_CH18 0x3f0000 /* Transmit Channel 18 */ 1887#define TX_CH18 0x3f0000 /* Transmit Channel 18 */
2256#define MUTE_CH18 0x800000 /* Mute Channel 18 */ 1888#define MUTE_CH18 0x800000 /* Mute Channel 18 */
2257#define nMUTE_CH18 0x0
2258#define TX_CH19 0x3f000000 /* Transmit Channel 19 */ 1889#define TX_CH19 0x3f000000 /* Transmit Channel 19 */
2259#define MUTE_CH19 0x80000000 /* Mute Channel 19 */ 1890#define MUTE_CH19 0x80000000 /* Mute Channel 19 */
2260#define nMUTE_CH19 0x0
2261 1891
2262/* Bit masks for MXVR_ROUTING_5 */ 1892/* Bit masks for MXVR_ROUTING_5 */
2263 1893
2264#define TX_CH20 0x3f /* Transmit Channel 20 */ 1894#define TX_CH20 0x3f /* Transmit Channel 20 */
2265#define MUTE_CH20 0x80 /* Mute Channel 20 */ 1895#define MUTE_CH20 0x80 /* Mute Channel 20 */
2266#define nMUTE_CH20 0x0
2267#define TX_CH21 0x3f00 /* Transmit Channel 21 */ 1896#define TX_CH21 0x3f00 /* Transmit Channel 21 */
2268#define MUTE_CH21 0x8000 /* Mute Channel 21 */ 1897#define MUTE_CH21 0x8000 /* Mute Channel 21 */
2269#define nMUTE_CH21 0x0
2270#define TX_CH22 0x3f0000 /* Transmit Channel 22 */ 1898#define TX_CH22 0x3f0000 /* Transmit Channel 22 */
2271#define MUTE_CH22 0x800000 /* Mute Channel 22 */ 1899#define MUTE_CH22 0x800000 /* Mute Channel 22 */
2272#define nMUTE_CH22 0x0
2273#define TX_CH23 0x3f000000 /* Transmit Channel 23 */ 1900#define TX_CH23 0x3f000000 /* Transmit Channel 23 */
2274#define MUTE_CH23 0x80000000 /* Mute Channel 23 */ 1901#define MUTE_CH23 0x80000000 /* Mute Channel 23 */
2275#define nMUTE_CH23 0x0
2276 1902
2277/* Bit masks for MXVR_ROUTING_6 */ 1903/* Bit masks for MXVR_ROUTING_6 */
2278 1904
2279#define TX_CH24 0x3f /* Transmit Channel 24 */ 1905#define TX_CH24 0x3f /* Transmit Channel 24 */
2280#define MUTE_CH24 0x80 /* Mute Channel 24 */ 1906#define MUTE_CH24 0x80 /* Mute Channel 24 */
2281#define nMUTE_CH24 0x0
2282#define TX_CH25 0x3f00 /* Transmit Channel 25 */ 1907#define TX_CH25 0x3f00 /* Transmit Channel 25 */
2283#define MUTE_CH25 0x8000 /* Mute Channel 25 */ 1908#define MUTE_CH25 0x8000 /* Mute Channel 25 */
2284#define nMUTE_CH25 0x0
2285#define TX_CH26 0x3f0000 /* Transmit Channel 26 */ 1909#define TX_CH26 0x3f0000 /* Transmit Channel 26 */
2286#define MUTE_CH26 0x800000 /* Mute Channel 26 */ 1910#define MUTE_CH26 0x800000 /* Mute Channel 26 */
2287#define nMUTE_CH26 0x0
2288#define TX_CH27 0x3f000000 /* Transmit Channel 27 */ 1911#define TX_CH27 0x3f000000 /* Transmit Channel 27 */
2289#define MUTE_CH27 0x80000000 /* Mute Channel 27 */ 1912#define MUTE_CH27 0x80000000 /* Mute Channel 27 */
2290#define nMUTE_CH27 0x0
2291 1913
2292/* Bit masks for MXVR_ROUTING_7 */ 1914/* Bit masks for MXVR_ROUTING_7 */
2293 1915
2294#define TX_CH28 0x3f /* Transmit Channel 28 */ 1916#define TX_CH28 0x3f /* Transmit Channel 28 */
2295#define MUTE_CH28 0x80 /* Mute Channel 28 */ 1917#define MUTE_CH28 0x80 /* Mute Channel 28 */
2296#define nMUTE_CH28 0x0
2297#define TX_CH29 0x3f00 /* Transmit Channel 29 */ 1918#define TX_CH29 0x3f00 /* Transmit Channel 29 */
2298#define MUTE_CH29 0x8000 /* Mute Channel 29 */ 1919#define MUTE_CH29 0x8000 /* Mute Channel 29 */
2299#define nMUTE_CH29 0x0
2300#define TX_CH30 0x3f0000 /* Transmit Channel 30 */ 1920#define TX_CH30 0x3f0000 /* Transmit Channel 30 */
2301#define MUTE_CH30 0x800000 /* Mute Channel 30 */ 1921#define MUTE_CH30 0x800000 /* Mute Channel 30 */
2302#define nMUTE_CH30 0x0
2303#define TX_CH31 0x3f000000 /* Transmit Channel 31 */ 1922#define TX_CH31 0x3f000000 /* Transmit Channel 31 */
2304#define MUTE_CH31 0x80000000 /* Mute Channel 31 */ 1923#define MUTE_CH31 0x80000000 /* Mute Channel 31 */
2305#define nMUTE_CH31 0x0
2306 1924
2307/* Bit masks for MXVR_ROUTING_8 */ 1925/* Bit masks for MXVR_ROUTING_8 */
2308 1926
2309#define TX_CH32 0x3f /* Transmit Channel 32 */ 1927#define TX_CH32 0x3f /* Transmit Channel 32 */
2310#define MUTE_CH32 0x80 /* Mute Channel 32 */ 1928#define MUTE_CH32 0x80 /* Mute Channel 32 */
2311#define nMUTE_CH32 0x0
2312#define TX_CH33 0x3f00 /* Transmit Channel 33 */ 1929#define TX_CH33 0x3f00 /* Transmit Channel 33 */
2313#define MUTE_CH33 0x8000 /* Mute Channel 33 */ 1930#define MUTE_CH33 0x8000 /* Mute Channel 33 */
2314#define nMUTE_CH33 0x0
2315#define TX_CH34 0x3f0000 /* Transmit Channel 34 */ 1931#define TX_CH34 0x3f0000 /* Transmit Channel 34 */
2316#define MUTE_CH34 0x800000 /* Mute Channel 34 */ 1932#define MUTE_CH34 0x800000 /* Mute Channel 34 */
2317#define nMUTE_CH34 0x0
2318#define TX_CH35 0x3f000000 /* Transmit Channel 35 */ 1933#define TX_CH35 0x3f000000 /* Transmit Channel 35 */
2319#define MUTE_CH35 0x80000000 /* Mute Channel 35 */ 1934#define MUTE_CH35 0x80000000 /* Mute Channel 35 */
2320#define nMUTE_CH35 0x0
2321 1935
2322/* Bit masks for MXVR_ROUTING_9 */ 1936/* Bit masks for MXVR_ROUTING_9 */
2323 1937
2324#define TX_CH36 0x3f /* Transmit Channel 36 */ 1938#define TX_CH36 0x3f /* Transmit Channel 36 */
2325#define MUTE_CH36 0x80 /* Mute Channel 36 */ 1939#define MUTE_CH36 0x80 /* Mute Channel 36 */
2326#define nMUTE_CH36 0x0
2327#define TX_CH37 0x3f00 /* Transmit Channel 37 */ 1940#define TX_CH37 0x3f00 /* Transmit Channel 37 */
2328#define MUTE_CH37 0x8000 /* Mute Channel 37 */ 1941#define MUTE_CH37 0x8000 /* Mute Channel 37 */
2329#define nMUTE_CH37 0x0
2330#define TX_CH38 0x3f0000 /* Transmit Channel 38 */ 1942#define TX_CH38 0x3f0000 /* Transmit Channel 38 */
2331#define MUTE_CH38 0x800000 /* Mute Channel 38 */ 1943#define MUTE_CH38 0x800000 /* Mute Channel 38 */
2332#define nMUTE_CH38 0x0
2333#define TX_CH39 0x3f000000 /* Transmit Channel 39 */ 1944#define TX_CH39 0x3f000000 /* Transmit Channel 39 */
2334#define MUTE_CH39 0x80000000 /* Mute Channel 39 */ 1945#define MUTE_CH39 0x80000000 /* Mute Channel 39 */
2335#define nMUTE_CH39 0x0
2336 1946
2337/* Bit masks for MXVR_ROUTING_10 */ 1947/* Bit masks for MXVR_ROUTING_10 */
2338 1948
2339#define TX_CH40 0x3f /* Transmit Channel 40 */ 1949#define TX_CH40 0x3f /* Transmit Channel 40 */
2340#define MUTE_CH40 0x80 /* Mute Channel 40 */ 1950#define MUTE_CH40 0x80 /* Mute Channel 40 */
2341#define nMUTE_CH40 0x0
2342#define TX_CH41 0x3f00 /* Transmit Channel 41 */ 1951#define TX_CH41 0x3f00 /* Transmit Channel 41 */
2343#define MUTE_CH41 0x8000 /* Mute Channel 41 */ 1952#define MUTE_CH41 0x8000 /* Mute Channel 41 */
2344#define nMUTE_CH41 0x0
2345#define TX_CH42 0x3f0000 /* Transmit Channel 42 */ 1953#define TX_CH42 0x3f0000 /* Transmit Channel 42 */
2346#define MUTE_CH42 0x800000 /* Mute Channel 42 */ 1954#define MUTE_CH42 0x800000 /* Mute Channel 42 */
2347#define nMUTE_CH42 0x0
2348#define TX_CH43 0x3f000000 /* Transmit Channel 43 */ 1955#define TX_CH43 0x3f000000 /* Transmit Channel 43 */
2349#define MUTE_CH43 0x80000000 /* Mute Channel 43 */ 1956#define MUTE_CH43 0x80000000 /* Mute Channel 43 */
2350#define nMUTE_CH43 0x0
2351 1957
2352/* Bit masks for MXVR_ROUTING_11 */ 1958/* Bit masks for MXVR_ROUTING_11 */
2353 1959
2354#define TX_CH44 0x3f /* Transmit Channel 44 */ 1960#define TX_CH44 0x3f /* Transmit Channel 44 */
2355#define MUTE_CH44 0x80 /* Mute Channel 44 */ 1961#define MUTE_CH44 0x80 /* Mute Channel 44 */
2356#define nMUTE_CH44 0x0
2357#define TX_CH45 0x3f00 /* Transmit Channel 45 */ 1962#define TX_CH45 0x3f00 /* Transmit Channel 45 */
2358#define MUTE_CH45 0x8000 /* Mute Channel 45 */ 1963#define MUTE_CH45 0x8000 /* Mute Channel 45 */
2359#define nMUTE_CH45 0x0
2360#define TX_CH46 0x3f0000 /* Transmit Channel 46 */ 1964#define TX_CH46 0x3f0000 /* Transmit Channel 46 */
2361#define MUTE_CH46 0x800000 /* Mute Channel 46 */ 1965#define MUTE_CH46 0x800000 /* Mute Channel 46 */
2362#define nMUTE_CH46 0x0
2363#define TX_CH47 0x3f000000 /* Transmit Channel 47 */ 1966#define TX_CH47 0x3f000000 /* Transmit Channel 47 */
2364#define MUTE_CH47 0x80000000 /* Mute Channel 47 */ 1967#define MUTE_CH47 0x80000000 /* Mute Channel 47 */
2365#define nMUTE_CH47 0x0
2366 1968
2367/* Bit masks for MXVR_ROUTING_12 */ 1969/* Bit masks for MXVR_ROUTING_12 */
2368 1970
2369#define TX_CH48 0x3f /* Transmit Channel 48 */ 1971#define TX_CH48 0x3f /* Transmit Channel 48 */
2370#define MUTE_CH48 0x80 /* Mute Channel 48 */ 1972#define MUTE_CH48 0x80 /* Mute Channel 48 */
2371#define nMUTE_CH48 0x0
2372#define TX_CH49 0x3f00 /* Transmit Channel 49 */ 1973#define TX_CH49 0x3f00 /* Transmit Channel 49 */
2373#define MUTE_CH49 0x8000 /* Mute Channel 49 */ 1974#define MUTE_CH49 0x8000 /* Mute Channel 49 */
2374#define nMUTE_CH49 0x0
2375#define TX_CH50 0x3f0000 /* Transmit Channel 50 */ 1975#define TX_CH50 0x3f0000 /* Transmit Channel 50 */
2376#define MUTE_CH50 0x800000 /* Mute Channel 50 */ 1976#define MUTE_CH50 0x800000 /* Mute Channel 50 */
2377#define nMUTE_CH50 0x0
2378#define TX_CH51 0x3f000000 /* Transmit Channel 51 */ 1977#define TX_CH51 0x3f000000 /* Transmit Channel 51 */
2379#define MUTE_CH51 0x80000000 /* Mute Channel 51 */ 1978#define MUTE_CH51 0x80000000 /* Mute Channel 51 */
2380#define nMUTE_CH51 0x0
2381 1979
2382/* Bit masks for MXVR_ROUTING_13 */ 1980/* Bit masks for MXVR_ROUTING_13 */
2383 1981
2384#define TX_CH52 0x3f /* Transmit Channel 52 */ 1982#define TX_CH52 0x3f /* Transmit Channel 52 */
2385#define MUTE_CH52 0x80 /* Mute Channel 52 */ 1983#define MUTE_CH52 0x80 /* Mute Channel 52 */
2386#define nMUTE_CH52 0x0
2387#define TX_CH53 0x3f00 /* Transmit Channel 53 */ 1984#define TX_CH53 0x3f00 /* Transmit Channel 53 */
2388#define MUTE_CH53 0x8000 /* Mute Channel 53 */ 1985#define MUTE_CH53 0x8000 /* Mute Channel 53 */
2389#define nMUTE_CH53 0x0
2390#define TX_CH54 0x3f0000 /* Transmit Channel 54 */ 1986#define TX_CH54 0x3f0000 /* Transmit Channel 54 */
2391#define MUTE_CH54 0x800000 /* Mute Channel 54 */ 1987#define MUTE_CH54 0x800000 /* Mute Channel 54 */
2392#define nMUTE_CH54 0x0
2393#define TX_CH55 0x3f000000 /* Transmit Channel 55 */ 1988#define TX_CH55 0x3f000000 /* Transmit Channel 55 */
2394#define MUTE_CH55 0x80000000 /* Mute Channel 55 */ 1989#define MUTE_CH55 0x80000000 /* Mute Channel 55 */
2395#define nMUTE_CH55 0x0
2396 1990
2397/* Bit masks for MXVR_ROUTING_14 */ 1991/* Bit masks for MXVR_ROUTING_14 */
2398 1992
2399#define TX_CH56 0x3f /* Transmit Channel 56 */ 1993#define TX_CH56 0x3f /* Transmit Channel 56 */
2400#define MUTE_CH56 0x80 /* Mute Channel 56 */ 1994#define MUTE_CH56 0x80 /* Mute Channel 56 */
2401#define nMUTE_CH56 0x0
2402#define TX_CH57 0x3f00 /* Transmit Channel 57 */ 1995#define TX_CH57 0x3f00 /* Transmit Channel 57 */
2403#define MUTE_CH57 0x8000 /* Mute Channel 57 */ 1996#define MUTE_CH57 0x8000 /* Mute Channel 57 */
2404#define nMUTE_CH57 0x0
2405#define TX_CH58 0x3f0000 /* Transmit Channel 58 */ 1997#define TX_CH58 0x3f0000 /* Transmit Channel 58 */
2406#define MUTE_CH58 0x800000 /* Mute Channel 58 */ 1998#define MUTE_CH58 0x800000 /* Mute Channel 58 */
2407#define nMUTE_CH58 0x0
2408#define TX_CH59 0x3f000000 /* Transmit Channel 59 */ 1999#define TX_CH59 0x3f000000 /* Transmit Channel 59 */
2409#define MUTE_CH59 0x80000000 /* Mute Channel 59 */ 2000#define MUTE_CH59 0x80000000 /* Mute Channel 59 */
2410#define nMUTE_CH59 0x0
2411 2001
2412/* Bit masks for MXVR_BLOCK_CNT */ 2002/* Bit masks for MXVR_BLOCK_CNT */
2413 2003
@@ -2416,53 +2006,37 @@
2416/* Bit masks for MXVR_CLK_CTL */ 2006/* Bit masks for MXVR_CLK_CTL */
2417 2007
2418#define MXTALCEN 0x1 /* MXVR Crystal Oscillator Clock Enable */ 2008#define MXTALCEN 0x1 /* MXVR Crystal Oscillator Clock Enable */
2419#define nMXTALCEN 0x0
2420#define MXTALFEN 0x2 /* MXVR Crystal Oscillator Feedback Enable */ 2009#define MXTALFEN 0x2 /* MXVR Crystal Oscillator Feedback Enable */
2421#define nMXTALFEN 0x0
2422#define MXTALMUL 0x30 /* MXVR Crystal Multiplier */ 2010#define MXTALMUL 0x30 /* MXVR Crystal Multiplier */
2423#define CLKX3SEL 0x80 /* Clock Generation Source Select */ 2011#define CLKX3SEL 0x80 /* Clock Generation Source Select */
2424#define nCLKX3SEL 0x0
2425#define MMCLKEN 0x100 /* Master Clock Enable */ 2012#define MMCLKEN 0x100 /* Master Clock Enable */
2426#define nMMCLKEN 0x0
2427#define MMCLKMUL 0x1e00 /* Master Clock Multiplication Factor */ 2013#define MMCLKMUL 0x1e00 /* Master Clock Multiplication Factor */
2428#define PLLSMPS 0xe000 /* MXVR PLL State Machine Prescaler */ 2014#define PLLSMPS 0xe000 /* MXVR PLL State Machine Prescaler */
2429#define MBCLKEN 0x10000 /* Bit Clock Enable */ 2015#define MBCLKEN 0x10000 /* Bit Clock Enable */
2430#define nMBCLKEN 0x0
2431#define MBCLKDIV 0x1e0000 /* Bit Clock Divide Factor */ 2016#define MBCLKDIV 0x1e0000 /* Bit Clock Divide Factor */
2432#define INVRX 0x800000 /* Invert Receive Data */ 2017#define INVRX 0x800000 /* Invert Receive Data */
2433#define nINVRX 0x0
2434#define MFSEN 0x1000000 /* Frame Sync Enable */ 2018#define MFSEN 0x1000000 /* Frame Sync Enable */
2435#define nMFSEN 0x0
2436#define MFSDIV 0x1e000000 /* Frame Sync Divide Factor */ 2019#define MFSDIV 0x1e000000 /* Frame Sync Divide Factor */
2437#define MFSSEL 0x60000000 /* Frame Sync Select */ 2020#define MFSSEL 0x60000000 /* Frame Sync Select */
2438#define MFSSYNC 0x80000000 /* Frame Sync Synchronization Select */ 2021#define MFSSYNC 0x80000000 /* Frame Sync Synchronization Select */
2439#define nMFSSYNC 0x0
2440 2022
2441/* Bit masks for MXVR_CDRPLL_CTL */ 2023/* Bit masks for MXVR_CDRPLL_CTL */
2442 2024
2443#define CDRSMEN 0x1 /* MXVR CDRPLL State Machine Enable */ 2025#define CDRSMEN 0x1 /* MXVR CDRPLL State Machine Enable */
2444#define nCDRSMEN 0x0
2445#define CDRRSTB 0x2 /* MXVR CDRPLL Reset */ 2026#define CDRRSTB 0x2 /* MXVR CDRPLL Reset */
2446#define nCDRRSTB 0x0
2447#define CDRSVCO 0x4 /* MXVR CDRPLL Start VCO */ 2027#define CDRSVCO 0x4 /* MXVR CDRPLL Start VCO */
2448#define nCDRSVCO 0x0
2449#define CDRMODE 0x8 /* MXVR CDRPLL CDR Mode Select */ 2028#define CDRMODE 0x8 /* MXVR CDRPLL CDR Mode Select */
2450#define nCDRMODE 0x0
2451#define CDRSCNT 0x3f0 /* MXVR CDRPLL Start Counter */ 2029#define CDRSCNT 0x3f0 /* MXVR CDRPLL Start Counter */
2452#define CDRLCNT 0xfc00 /* MXVR CDRPLL Lock Counter */ 2030#define CDRLCNT 0xfc00 /* MXVR CDRPLL Lock Counter */
2453#define CDRSHPSEL 0x3f0000 /* MXVR CDRPLL Shaper Select */ 2031#define CDRSHPSEL 0x3f0000 /* MXVR CDRPLL Shaper Select */
2454#define CDRSHPEN 0x800000 /* MXVR CDRPLL Shaper Enable */ 2032#define CDRSHPEN 0x800000 /* MXVR CDRPLL Shaper Enable */
2455#define nCDRSHPEN 0x0
2456#define CDRCPSEL 0xff000000 /* MXVR CDRPLL Charge Pump Current Select */ 2033#define CDRCPSEL 0xff000000 /* MXVR CDRPLL Charge Pump Current Select */
2457 2034
2458/* Bit masks for MXVR_FMPLL_CTL */ 2035/* Bit masks for MXVR_FMPLL_CTL */
2459 2036
2460#define FMSMEN 0x1 /* MXVR FMPLL State Machine Enable */ 2037#define FMSMEN 0x1 /* MXVR FMPLL State Machine Enable */
2461#define nFMSMEN 0x0
2462#define FMRSTB 0x2 /* MXVR FMPLL Reset */ 2038#define FMRSTB 0x2 /* MXVR FMPLL Reset */
2463#define nFMRSTB 0x0
2464#define FMSVCO 0x4 /* MXVR FMPLL Start VCO */ 2039#define FMSVCO 0x4 /* MXVR FMPLL Start VCO */
2465#define nFMSVCO 0x0
2466#define FMSCNT 0x3f0 /* MXVR FMPLL Start Counter */ 2040#define FMSCNT 0x3f0 /* MXVR FMPLL Start Counter */
2467#define FMLCNT 0xfc00 /* MXVR FMPLL Lock Counter */ 2041#define FMLCNT 0xfc00 /* MXVR FMPLL Lock Counter */
2468#define FMCPSEL 0xff000000 /* MXVR FMPLL Charge Pump Current Select */ 2042#define FMCPSEL 0xff000000 /* MXVR FMPLL Charge Pump Current Select */
@@ -2470,15 +2044,10 @@
2470/* Bit masks for MXVR_PIN_CTL */ 2044/* Bit masks for MXVR_PIN_CTL */
2471 2045
2472#define MTXONBOD 0x1 /* MTXONB Open Drain Select */ 2046#define MTXONBOD 0x1 /* MTXONB Open Drain Select */
2473#define nMTXONBOD 0x0
2474#define MTXONBG 0x2 /* MTXONB Gates MTX Select */ 2047#define MTXONBG 0x2 /* MTXONB Gates MTX Select */
2475#define nMTXONBG 0x0
2476#define MFSOE 0x10 /* MFS Output Enable */ 2048#define MFSOE 0x10 /* MFS Output Enable */
2477#define nMFSOE 0x0
2478#define MFSGPSEL 0x20 /* MFS General Purpose Output Select */ 2049#define MFSGPSEL 0x20 /* MFS General Purpose Output Select */
2479#define nMFSGPSEL 0x0
2480#define MFSGPDAT 0x40 /* MFS General Purpose Output Data */ 2050#define MFSGPDAT 0x40 /* MFS General Purpose Output Data */
2481#define nMFSGPDAT 0x0
2482 2051
2483/* Bit masks for MXVR_SCLK_CNT */ 2052/* Bit masks for MXVR_SCLK_CNT */
2484 2053
@@ -2487,7 +2056,6 @@
2487/* Bit masks for KPAD_CTL */ 2056/* Bit masks for KPAD_CTL */
2488 2057
2489#define KPAD_EN 0x1 /* Keypad Enable */ 2058#define KPAD_EN 0x1 /* Keypad Enable */
2490#define nKPAD_EN 0x0
2491#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */ 2059#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */
2492#define KPAD_ROWEN 0x1c00 /* Row Enable Width */ 2060#define KPAD_ROWEN 0x1c00 /* Row Enable Width */
2493#define KPAD_COLEN 0xe000 /* Column Enable Width */ 2061#define KPAD_COLEN 0xe000 /* Column Enable Width */
@@ -2509,29 +2077,21 @@
2509/* Bit masks for KPAD_STAT */ 2077/* Bit masks for KPAD_STAT */
2510 2078
2511#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */ 2079#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */
2512#define nKPAD_IRQ 0x0
2513#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */ 2080#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */
2514#define KPAD_PRESSED 0x8 /* Key press current status */ 2081#define KPAD_PRESSED 0x8 /* Key press current status */
2515#define nKPAD_PRESSED 0x0
2516 2082
2517/* Bit masks for KPAD_SOFTEVAL */ 2083/* Bit masks for KPAD_SOFTEVAL */
2518 2084
2519#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */ 2085#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */
2520#define nKPAD_SOFTEVAL_E 0x0
2521 2086
2522/* Bit masks for SDH_COMMAND */ 2087/* Bit masks for SDH_COMMAND */
2523 2088
2524#define CMD_IDX 0x3f /* Command Index */ 2089#define CMD_IDX 0x3f /* Command Index */
2525#define CMD_RSP 0x40 /* Response */ 2090#define CMD_RSP 0x40 /* Response */
2526#define nCMD_RSP 0x0
2527#define CMD_L_RSP 0x80 /* Long Response */ 2091#define CMD_L_RSP 0x80 /* Long Response */
2528#define nCMD_L_RSP 0x0
2529#define CMD_INT_E 0x100 /* Command Interrupt */ 2092#define CMD_INT_E 0x100 /* Command Interrupt */
2530#define nCMD_INT_E 0x0
2531#define CMD_PEND_E 0x200 /* Command Pending */ 2093#define CMD_PEND_E 0x200 /* Command Pending */
2532#define nCMD_PEND_E 0x0
2533#define CMD_E 0x400 /* Command Enable */ 2094#define CMD_E 0x400 /* Command Enable */
2534#define nCMD_E 0x0
2535 2095
2536/* Bit masks for SDH_PWR_CTL */ 2096/* Bit masks for SDH_PWR_CTL */
2537 2097
@@ -2540,21 +2100,15 @@
2540#define TBD 0x3c /* TBD */ 2100#define TBD 0x3c /* TBD */
2541#endif 2101#endif
2542#define SD_CMD_OD 0x40 /* Open Drain Output */ 2102#define SD_CMD_OD 0x40 /* Open Drain Output */
2543#define nSD_CMD_OD 0x0
2544#define ROD_CTL 0x80 /* Rod Control */ 2103#define ROD_CTL 0x80 /* Rod Control */
2545#define nROD_CTL 0x0
2546 2104
2547/* Bit masks for SDH_CLK_CTL */ 2105/* Bit masks for SDH_CLK_CTL */
2548 2106
2549#define CLKDIV 0xff /* MC_CLK Divisor */ 2107#define CLKDIV 0xff /* MC_CLK Divisor */
2550#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */ 2108#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
2551#define nCLK_E 0x0
2552#define PWR_SV_E 0x200 /* Power Save Enable */ 2109#define PWR_SV_E 0x200 /* Power Save Enable */
2553#define nPWR_SV_E 0x0
2554#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */ 2110#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
2555#define nCLKDIV_BYPASS 0x0
2556#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */ 2111#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
2557#define nWIDE_BUS 0x0
2558 2112
2559/* Bit masks for SDH_RESP_CMD */ 2113/* Bit masks for SDH_RESP_CMD */
2560 2114
@@ -2563,133 +2117,74 @@
2563/* Bit masks for SDH_DATA_CTL */ 2117/* Bit masks for SDH_DATA_CTL */
2564 2118
2565#define DTX_E 0x1 /* Data Transfer Enable */ 2119#define DTX_E 0x1 /* Data Transfer Enable */
2566#define nDTX_E 0x0
2567#define DTX_DIR 0x2 /* Data Transfer Direction */ 2120#define DTX_DIR 0x2 /* Data Transfer Direction */
2568#define nDTX_DIR 0x0
2569#define DTX_MODE 0x4 /* Data Transfer Mode */ 2121#define DTX_MODE 0x4 /* Data Transfer Mode */
2570#define nDTX_MODE 0x0
2571#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */ 2122#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
2572#define nDTX_DMA_E 0x0
2573#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */ 2123#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
2574 2124
2575/* Bit masks for SDH_STATUS */ 2125/* Bit masks for SDH_STATUS */
2576 2126
2577#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */ 2127#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
2578#define nCMD_CRC_FAIL 0x0
2579#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */ 2128#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
2580#define nDAT_CRC_FAIL 0x0 2129#define CMD_TIME_OUT 0x4 /* CMD Time Out */
2581#define CMD_TIMEOUT 0x4 /* CMD Time Out */ 2130#define DAT_TIME_OUT 0x8 /* Data Time Out */
2582#define nCMD_TIMEOUT 0x0
2583#define DAT_TIMEOUT 0x8 /* Data Time Out */
2584#define nDAT_TIMEOUT 0x0
2585#define TX_UNDERRUN 0x10 /* Transmit Underrun */ 2131#define TX_UNDERRUN 0x10 /* Transmit Underrun */
2586#define nTX_UNDERRUN 0x0
2587#define RX_OVERRUN 0x20 /* Receive Overrun */ 2132#define RX_OVERRUN 0x20 /* Receive Overrun */
2588#define nRX_OVERRUN 0x0
2589#define CMD_RESP_END 0x40 /* CMD Response End */ 2133#define CMD_RESP_END 0x40 /* CMD Response End */
2590#define nCMD_RESP_END 0x0
2591#define CMD_SENT 0x80 /* CMD Sent */ 2134#define CMD_SENT 0x80 /* CMD Sent */
2592#define nCMD_SENT 0x0
2593#define DAT_END 0x100 /* Data End */ 2135#define DAT_END 0x100 /* Data End */
2594#define nDAT_END 0x0
2595#define START_BIT_ERR 0x200 /* Start Bit Error */ 2136#define START_BIT_ERR 0x200 /* Start Bit Error */
2596#define nSTART_BIT_ERR 0x0
2597#define DAT_BLK_END 0x400 /* Data Block End */ 2137#define DAT_BLK_END 0x400 /* Data Block End */
2598#define nDAT_BLK_END 0x0
2599#define CMD_ACT 0x800 /* CMD Active */ 2138#define CMD_ACT 0x800 /* CMD Active */
2600#define nCMD_ACT 0x0
2601#define TX_ACT 0x1000 /* Transmit Active */ 2139#define TX_ACT 0x1000 /* Transmit Active */
2602#define nTX_ACT 0x0
2603#define RX_ACT 0x2000 /* Receive Active */ 2140#define RX_ACT 0x2000 /* Receive Active */
2604#define nRX_ACT 0x0
2605#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */ 2141#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
2606#define nTX_FIFO_STAT 0x0
2607#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */ 2142#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
2608#define nRX_FIFO_STAT 0x0
2609#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */ 2143#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
2610#define nTX_FIFO_FULL 0x0
2611#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */ 2144#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
2612#define nRX_FIFO_FULL 0x0
2613#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */ 2145#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
2614#define nTX_FIFO_ZERO 0x0
2615#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */ 2146#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
2616#define nRX_DAT_ZERO 0x0
2617#define TX_DAT_RDY 0x100000 /* Transmit Data Available */ 2147#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
2618#define nTX_DAT_RDY 0x0
2619#define RX_FIFO_RDY 0x200000 /* Receive Data Available */ 2148#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
2620#define nRX_FIFO_RDY 0x0
2621 2149
2622/* Bit masks for SDH_STATUS_CLR */ 2150/* Bit masks for SDH_STATUS_CLR */
2623 2151
2624#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */ 2152#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
2625#define nCMD_CRC_FAIL_STAT 0x0
2626#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */ 2153#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
2627#define nDAT_CRC_FAIL_STAT 0x0
2628#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */ 2154#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
2629#define nCMD_TIMEOUT_STAT 0x0
2630#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */ 2155#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
2631#define nDAT_TIMEOUT_STAT 0x0
2632#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */ 2156#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
2633#define nTX_UNDERRUN_STAT 0x0
2634#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */ 2157#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
2635#define nRX_OVERRUN_STAT 0x0
2636#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */ 2158#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
2637#define nCMD_RESP_END_STAT 0x0
2638#define CMD_SENT_STAT 0x80 /* CMD Sent Status */ 2159#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
2639#define nCMD_SENT_STAT 0x0
2640#define DAT_END_STAT 0x100 /* Data End Status */ 2160#define DAT_END_STAT 0x100 /* Data End Status */
2641#define nDAT_END_STAT 0x0
2642#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */ 2161#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
2643#define nSTART_BIT_ERR_STAT 0x0
2644#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */ 2162#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
2645#define nDAT_BLK_END_STAT 0x0
2646 2163
2647/* Bit masks for SDH_MASK0 */ 2164/* Bit masks for SDH_MASK0 */
2648 2165
2649#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */ 2166#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
2650#define nCMD_CRC_FAIL_MASK 0x0
2651#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */ 2167#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
2652#define nDAT_CRC_FAIL_MASK 0x0
2653#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */ 2168#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
2654#define nCMD_TIMEOUT_MASK 0x0
2655#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */ 2169#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
2656#define nDAT_TIMEOUT_MASK 0x0
2657#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */ 2170#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
2658#define nTX_UNDERRUN_MASK 0x0
2659#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */ 2171#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
2660#define nRX_OVERRUN_MASK 0x0
2661#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */ 2172#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
2662#define nCMD_RESP_END_MASK 0x0
2663#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */ 2173#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
2664#define nCMD_SENT_MASK 0x0
2665#define DAT_END_MASK 0x100 /* Data End Mask */ 2174#define DAT_END_MASK 0x100 /* Data End Mask */
2666#define nDAT_END_MASK 0x0
2667#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */ 2175#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
2668#define nSTART_BIT_ERR_MASK 0x0
2669#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */ 2176#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
2670#define nDAT_BLK_END_MASK 0x0
2671#define CMD_ACT_MASK 0x800 /* CMD Active Mask */ 2177#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
2672#define nCMD_ACT_MASK 0x0
2673#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */ 2178#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
2674#define nTX_ACT_MASK 0x0
2675#define RX_ACT_MASK 0x2000 /* Receive Active Mask */ 2179#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
2676#define nRX_ACT_MASK 0x0
2677#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */ 2180#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
2678#define nTX_FIFO_STAT_MASK 0x0
2679#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */ 2181#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
2680#define nRX_FIFO_STAT_MASK 0x0
2681#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */ 2182#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
2682#define nTX_FIFO_FULL_MASK 0x0
2683#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */ 2183#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
2684#define nRX_FIFO_FULL_MASK 0x0
2685#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */ 2184#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
2686#define nTX_FIFO_ZERO_MASK 0x0
2687#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */ 2185#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
2688#define nRX_DAT_ZERO_MASK 0x0
2689#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */ 2186#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
2690#define nTX_DAT_RDY_MASK 0x0
2691#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */ 2187#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
2692#define nRX_FIFO_RDY_MASK 0x0
2693 2188
2694/* Bit masks for SDH_FIFO_CNT */ 2189/* Bit masks for SDH_FIFO_CNT */
2695 2190
@@ -2698,73 +2193,47 @@
2698/* Bit masks for SDH_E_STATUS */ 2193/* Bit masks for SDH_E_STATUS */
2699 2194
2700#define SDIO_INT_DET 0x2 /* SDIO Int Detected */ 2195#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
2701#define nSDIO_INT_DET 0x0
2702#define SD_CARD_DET 0x10 /* SD Card Detect */ 2196#define SD_CARD_DET 0x10 /* SD Card Detect */
2703#define nSD_CARD_DET 0x0
2704 2197
2705/* Bit masks for SDH_E_MASK */ 2198/* Bit masks for SDH_E_MASK */
2706 2199
2707#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */ 2200#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
2708#define nSDIO_MSK 0x0
2709#define SCD_MSK 0x40 /* Mask Card Detect */ 2201#define SCD_MSK 0x40 /* Mask Card Detect */
2710#define nSCD_MSK 0x0
2711 2202
2712/* Bit masks for SDH_CFG */ 2203/* Bit masks for SDH_CFG */
2713 2204
2714#define CLKS_EN 0x1 /* Clocks Enable */ 2205#define CLKS_EN 0x1 /* Clocks Enable */
2715#define nCLKS_EN 0x0
2716#define SD4E 0x4 /* SDIO 4-Bit Enable */ 2206#define SD4E 0x4 /* SDIO 4-Bit Enable */
2717#define nSD4E 0x0
2718#define MWE 0x8 /* Moving Window Enable */ 2207#define MWE 0x8 /* Moving Window Enable */
2719#define nMWE 0x0
2720#define SD_RST 0x10 /* SDMMC Reset */ 2208#define SD_RST 0x10 /* SDMMC Reset */
2721#define nSD_RST 0x0
2722#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */ 2209#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
2723#define nPUP_SDDAT 0x0
2724#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */ 2210#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
2725#define nPUP_SDDAT3 0x0
2726#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */ 2211#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
2727#define nPD_SDDAT3 0x0
2728 2212
2729/* Bit masks for SDH_RD_WAIT_EN */ 2213/* Bit masks for SDH_RD_WAIT_EN */
2730 2214
2731#define RWR 0x1 /* Read Wait Request */ 2215#define RWR 0x1 /* Read Wait Request */
2732#define nRWR 0x0
2733 2216
2734/* Bit masks for ATAPI_CONTROL */ 2217/* Bit masks for ATAPI_CONTROL */
2735 2218
2736#define PIO_START 0x1 /* Start PIO/Reg Op */ 2219#define PIO_START 0x1 /* Start PIO/Reg Op */
2737#define nPIO_START 0x0
2738#define MULTI_START 0x2 /* Start Multi-DMA Op */ 2220#define MULTI_START 0x2 /* Start Multi-DMA Op */
2739#define nMULTI_START 0x0
2740#define ULTRA_START 0x4 /* Start Ultra-DMA Op */ 2221#define ULTRA_START 0x4 /* Start Ultra-DMA Op */
2741#define nULTRA_START 0x0
2742#define XFER_DIR 0x8 /* Transfer Direction */ 2222#define XFER_DIR 0x8 /* Transfer Direction */
2743#define nXFER_DIR 0x0
2744#define IORDY_EN 0x10 /* IORDY Enable */ 2223#define IORDY_EN 0x10 /* IORDY Enable */
2745#define nIORDY_EN 0x0
2746#define FIFO_FLUSH 0x20 /* Flush FIFOs */ 2224#define FIFO_FLUSH 0x20 /* Flush FIFOs */
2747#define nFIFO_FLUSH 0x0
2748#define SOFT_RST 0x40 /* Soft Reset */ 2225#define SOFT_RST 0x40 /* Soft Reset */
2749#define nSOFT_RST 0x0
2750#define DEV_RST 0x80 /* Device Reset */ 2226#define DEV_RST 0x80 /* Device Reset */
2751#define nDEV_RST 0x0
2752#define TFRCNT_RST 0x100 /* Trans Count Reset */ 2227#define TFRCNT_RST 0x100 /* Trans Count Reset */
2753#define nTFRCNT_RST 0x0
2754#define END_ON_TERM 0x200 /* End/Terminate Select */ 2228#define END_ON_TERM 0x200 /* End/Terminate Select */
2755#define nEND_ON_TERM 0x0
2756#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */ 2229#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */
2757#define nPIO_USE_DMA 0x0
2758#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */ 2230#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */
2759 2231
2760/* Bit masks for ATAPI_STATUS */ 2232/* Bit masks for ATAPI_STATUS */
2761 2233
2762#define PIO_XFER_ON 0x1 /* PIO transfer in progress */ 2234#define PIO_XFER_ON 0x1 /* PIO transfer in progress */
2763#define nPIO_XFER_ON 0x0
2764#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */ 2235#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */
2765#define nMULTI_XFER_ON 0x0
2766#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */ 2236#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */
2767#define nULTRA_XFER_ON 0x0
2768#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */ 2237#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */
2769 2238
2770/* Bit masks for ATAPI_DEV_ADDR */ 2239/* Bit masks for ATAPI_DEV_ADDR */
@@ -2774,66 +2243,39 @@
2774/* Bit masks for ATAPI_INT_MASK */ 2243/* Bit masks for ATAPI_INT_MASK */
2775 2244
2776#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */ 2245#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */
2777#define nATAPI_DEV_INT_MASK 0x0
2778#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */ 2246#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */
2779#define nPIO_DONE_MASK 0x0
2780#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */ 2247#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */
2781#define nMULTI_DONE_MASK 0x0
2782#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */ 2248#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */
2783#define nUDMAIN_DONE_MASK 0x0
2784#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */ 2249#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */
2785#define nUDMAOUT_DONE_MASK 0x0
2786#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */ 2250#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */
2787#define nHOST_TERM_XFER_MASK 0x0
2788#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */ 2251#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */
2789#define nMULTI_TERM_MASK 0x0
2790#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */ 2252#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */
2791#define nUDMAIN_TERM_MASK 0x0
2792#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */ 2253#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */
2793#define nUDMAOUT_TERM_MASK 0x0
2794 2254
2795/* Bit masks for ATAPI_INT_STATUS */ 2255/* Bit masks for ATAPI_INT_STATUS */
2796 2256
2797#define ATAPI_DEV_INT 0x1 /* Device interrupt status */ 2257#define ATAPI_DEV_INT 0x1 /* Device interrupt status */
2798#define nATAPI_DEV_INT 0x0
2799#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */ 2258#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */
2800#define nPIO_DONE_INT 0x0
2801#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */ 2259#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */
2802#define nMULTI_DONE_INT 0x0
2803#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */ 2260#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */
2804#define nUDMAIN_DONE_INT 0x0
2805#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */ 2261#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */
2806#define nUDMAOUT_DONE_INT 0x0
2807#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */ 2262#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */
2808#define nHOST_TERM_XFER_INT 0x0
2809#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */ 2263#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */
2810#define nMULTI_TERM_INT 0x0
2811#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */ 2264#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */
2812#define nUDMAIN_TERM_INT 0x0
2813#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */ 2265#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */
2814#define nUDMAOUT_TERM_INT 0x0
2815 2266
2816/* Bit masks for ATAPI_LINE_STATUS */ 2267/* Bit masks for ATAPI_LINE_STATUS */
2817 2268
2818#define ATAPI_INTR 0x1 /* Device interrupt to host line status */ 2269#define ATAPI_INTR 0x1 /* Device interrupt to host line status */
2819#define nATAPI_INTR 0x0
2820#define ATAPI_DASP 0x2 /* Device dasp to host line status */ 2270#define ATAPI_DASP 0x2 /* Device dasp to host line status */
2821#define nATAPI_DASP 0x0
2822#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */ 2271#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */
2823#define nATAPI_CS0N 0x0
2824#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */ 2272#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */
2825#define nATAPI_CS1N 0x0
2826#define ATAPI_ADDR 0x70 /* ATAPI address line status */ 2273#define ATAPI_ADDR 0x70 /* ATAPI address line status */
2827#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */ 2274#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */
2828#define nATAPI_DMAREQ 0x0
2829#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */ 2275#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */
2830#define nATAPI_DMAACKN 0x0
2831#define ATAPI_DIOWN 0x200 /* ATAPI write line status */ 2276#define ATAPI_DIOWN 0x200 /* ATAPI write line status */
2832#define nATAPI_DIOWN 0x0
2833#define ATAPI_DIORN 0x400 /* ATAPI read line status */ 2277#define ATAPI_DIORN 0x400 /* ATAPI read line status */
2834#define nATAPI_DIORN 0x0
2835#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */ 2278#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */
2836#define nATAPI_IORDY 0x0
2837 2279
2838/* Bit masks for ATAPI_SM_STATE */ 2280/* Bit masks for ATAPI_SM_STATE */
2839 2281
@@ -2845,7 +2287,6 @@
2845/* Bit masks for ATAPI_TERMINATE */ 2287/* Bit masks for ATAPI_TERMINATE */
2846 2288
2847#define ATAPI_HOST_TERM 0x1 /* Host terminationation */ 2289#define ATAPI_HOST_TERM 0x1 /* Host terminationation */
2848#define nATAPI_HOST_TERM 0x0
2849 2290
2850/* Bit masks for ATAPI_REG_TIM_0 */ 2291/* Bit masks for ATAPI_REG_TIM_0 */
2851 2292
@@ -2900,41 +2341,26 @@
2900/* Bit masks for TIMER_ENABLE1 */ 2341/* Bit masks for TIMER_ENABLE1 */
2901 2342
2902#define TIMEN8 0x1 /* Timer 8 Enable */ 2343#define TIMEN8 0x1 /* Timer 8 Enable */
2903#define nTIMEN8 0x0
2904#define TIMEN9 0x2 /* Timer 9 Enable */ 2344#define TIMEN9 0x2 /* Timer 9 Enable */
2905#define nTIMEN9 0x0
2906#define TIMEN10 0x4 /* Timer 10 Enable */ 2345#define TIMEN10 0x4 /* Timer 10 Enable */
2907#define nTIMEN10 0x0
2908 2346
2909/* Bit masks for TIMER_DISABLE1 */ 2347/* Bit masks for TIMER_DISABLE1 */
2910 2348
2911#define TIMDIS8 0x1 /* Timer 8 Disable */ 2349#define TIMDIS8 0x1 /* Timer 8 Disable */
2912#define nTIMDIS8 0x0
2913#define TIMDIS9 0x2 /* Timer 9 Disable */ 2350#define TIMDIS9 0x2 /* Timer 9 Disable */
2914#define nTIMDIS9 0x0
2915#define TIMDIS10 0x4 /* Timer 10 Disable */ 2351#define TIMDIS10 0x4 /* Timer 10 Disable */
2916#define nTIMDIS10 0x0
2917 2352
2918/* Bit masks for TIMER_STATUS1 */ 2353/* Bit masks for TIMER_STATUS1 */
2919 2354
2920#define TIMIL8 0x1 /* Timer 8 Interrupt */ 2355#define TIMIL8 0x1 /* Timer 8 Interrupt */
2921#define nTIMIL8 0x0
2922#define TIMIL9 0x2 /* Timer 9 Interrupt */ 2356#define TIMIL9 0x2 /* Timer 9 Interrupt */
2923#define nTIMIL9 0x0
2924#define TIMIL10 0x4 /* Timer 10 Interrupt */ 2357#define TIMIL10 0x4 /* Timer 10 Interrupt */
2925#define nTIMIL10 0x0
2926#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */ 2358#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */
2927#define nTOVF_ERR8 0x0
2928#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */ 2359#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */
2929#define nTOVF_ERR9 0x0
2930#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */ 2360#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */
2931#define nTOVF_ERR10 0x0
2932#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */ 2361#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */
2933#define nTRUN8 0x0
2934#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */ 2362#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */
2935#define nTRUN9 0x0
2936#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */ 2363#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */
2937#define nTRUN10 0x0
2938 2364
2939/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */ 2365/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */
2940 2366
@@ -2945,131 +2371,77 @@
2945/* Bit masks for USB_POWER */ 2371/* Bit masks for USB_POWER */
2946 2372
2947#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */ 2373#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
2948#define nENABLE_SUSPENDM 0x0
2949#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */ 2374#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
2950#define nSUSPEND_MODE 0x0
2951#define RESUME_MODE 0x4 /* DMA Mode */ 2375#define RESUME_MODE 0x4 /* DMA Mode */
2952#define nRESUME_MODE 0x0
2953#define RESET 0x8 /* Reset indicator */ 2376#define RESET 0x8 /* Reset indicator */
2954#define nRESET 0x0
2955#define HS_MODE 0x10 /* High Speed mode indicator */ 2377#define HS_MODE 0x10 /* High Speed mode indicator */
2956#define nHS_MODE 0x0
2957#define HS_ENABLE 0x20 /* high Speed Enable */ 2378#define HS_ENABLE 0x20 /* high Speed Enable */
2958#define nHS_ENABLE 0x0
2959#define SOFT_CONN 0x40 /* Soft connect */ 2379#define SOFT_CONN 0x40 /* Soft connect */
2960#define nSOFT_CONN 0x0
2961#define ISO_UPDATE 0x80 /* Isochronous update */ 2380#define ISO_UPDATE 0x80 /* Isochronous update */
2962#define nISO_UPDATE 0x0
2963 2381
2964/* Bit masks for USB_INTRTX */ 2382/* Bit masks for USB_INTRTX */
2965 2383
2966#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */ 2384#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
2967#define nEP0_TX 0x0
2968#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */ 2385#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
2969#define nEP1_TX 0x0
2970#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */ 2386#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
2971#define nEP2_TX 0x0
2972#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */ 2387#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
2973#define nEP3_TX 0x0
2974#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */ 2388#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
2975#define nEP4_TX 0x0
2976#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */ 2389#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
2977#define nEP5_TX 0x0
2978#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */ 2390#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
2979#define nEP6_TX 0x0
2980#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */ 2391#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
2981#define nEP7_TX 0x0
2982 2392
2983/* Bit masks for USB_INTRRX */ 2393/* Bit masks for USB_INTRRX */
2984 2394
2985#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */ 2395#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
2986#define nEP1_RX 0x0
2987#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */ 2396#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
2988#define nEP2_RX 0x0
2989#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */ 2397#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
2990#define nEP3_RX 0x0
2991#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */ 2398#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
2992#define nEP4_RX 0x0
2993#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */ 2399#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
2994#define nEP5_RX 0x0
2995#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */ 2400#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
2996#define nEP6_RX 0x0
2997#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */ 2401#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
2998#define nEP7_RX 0x0
2999 2402
3000/* Bit masks for USB_INTRTXE */ 2403/* Bit masks for USB_INTRTXE */
3001 2404
3002#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */ 2405#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
3003#define nEP0_TX_E 0x0
3004#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */ 2406#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
3005#define nEP1_TX_E 0x0
3006#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */ 2407#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
3007#define nEP2_TX_E 0x0
3008#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */ 2408#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
3009#define nEP3_TX_E 0x0
3010#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */ 2409#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
3011#define nEP4_TX_E 0x0
3012#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */ 2410#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
3013#define nEP5_TX_E 0x0
3014#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */ 2411#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
3015#define nEP6_TX_E 0x0
3016#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */ 2412#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
3017#define nEP7_TX_E 0x0
3018 2413
3019/* Bit masks for USB_INTRRXE */ 2414/* Bit masks for USB_INTRRXE */
3020 2415
3021#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */ 2416#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
3022#define nEP1_RX_E 0x0
3023#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */ 2417#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
3024#define nEP2_RX_E 0x0
3025#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */ 2418#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
3026#define nEP3_RX_E 0x0
3027#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */ 2419#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
3028#define nEP4_RX_E 0x0
3029#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */ 2420#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
3030#define nEP5_RX_E 0x0
3031#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */ 2421#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
3032#define nEP6_RX_E 0x0
3033#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */ 2422#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
3034#define nEP7_RX_E 0x0
3035 2423
3036/* Bit masks for USB_INTRUSB */ 2424/* Bit masks for USB_INTRUSB */
3037 2425
3038#define SUSPEND_B 0x1 /* Suspend indicator */ 2426#define SUSPEND_B 0x1 /* Suspend indicator */
3039#define nSUSPEND_B 0x0
3040#define RESUME_B 0x2 /* Resume indicator */ 2427#define RESUME_B 0x2 /* Resume indicator */
3041#define nRESUME_B 0x0
3042#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */ 2428#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
3043#define nRESET_OR_BABLE_B 0x0
3044#define SOF_B 0x8 /* Start of frame */ 2429#define SOF_B 0x8 /* Start of frame */
3045#define nSOF_B 0x0
3046#define CONN_B 0x10 /* Connection indicator */ 2430#define CONN_B 0x10 /* Connection indicator */
3047#define nCONN_B 0x0
3048#define DISCON_B 0x20 /* Disconnect indicator */ 2431#define DISCON_B 0x20 /* Disconnect indicator */
3049#define nDISCON_B 0x0
3050#define SESSION_REQ_B 0x40 /* Session Request */ 2432#define SESSION_REQ_B 0x40 /* Session Request */
3051#define nSESSION_REQ_B 0x0
3052#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */ 2433#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
3053#define nVBUS_ERROR_B 0x0
3054 2434
3055/* Bit masks for USB_INTRUSBE */ 2435/* Bit masks for USB_INTRUSBE */
3056 2436
3057#define SUSPEND_BE 0x1 /* Suspend indicator int enable */ 2437#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
3058#define nSUSPEND_BE 0x0
3059#define RESUME_BE 0x2 /* Resume indicator int enable */ 2438#define RESUME_BE 0x2 /* Resume indicator int enable */
3060#define nRESUME_BE 0x0
3061#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */ 2439#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
3062#define nRESET_OR_BABLE_BE 0x0
3063#define SOF_BE 0x8 /* Start of frame int enable */ 2440#define SOF_BE 0x8 /* Start of frame int enable */
3064#define nSOF_BE 0x0
3065#define CONN_BE 0x10 /* Connection indicator int enable */ 2441#define CONN_BE 0x10 /* Connection indicator int enable */
3066#define nCONN_BE 0x0
3067#define DISCON_BE 0x20 /* Disconnect indicator int enable */ 2442#define DISCON_BE 0x20 /* Disconnect indicator int enable */
3068#define nDISCON_BE 0x0
3069#define SESSION_REQ_BE 0x40 /* Session Request int enable */ 2443#define SESSION_REQ_BE 0x40 /* Session Request int enable */
3070#define nSESSION_REQ_BE 0x0
3071#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */ 2444#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
3072#define nVBUS_ERROR_BE 0x0
3073 2445
3074/* Bit masks for USB_FRAME */ 2446/* Bit masks for USB_FRAME */
3075 2447
@@ -3082,117 +2454,67 @@
3082/* Bit masks for USB_GLOBAL_CTL */ 2454/* Bit masks for USB_GLOBAL_CTL */
3083 2455
3084#define GLOBAL_ENA 0x1 /* enables USB module */ 2456#define GLOBAL_ENA 0x1 /* enables USB module */
3085#define nGLOBAL_ENA 0x0
3086#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */ 2457#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
3087#define nEP1_TX_ENA 0x0
3088#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */ 2458#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
3089#define nEP2_TX_ENA 0x0
3090#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */ 2459#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
3091#define nEP3_TX_ENA 0x0
3092#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */ 2460#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
3093#define nEP4_TX_ENA 0x0
3094#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */ 2461#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
3095#define nEP5_TX_ENA 0x0
3096#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */ 2462#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
3097#define nEP6_TX_ENA 0x0
3098#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */ 2463#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
3099#define nEP7_TX_ENA 0x0
3100#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */ 2464#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
3101#define nEP1_RX_ENA 0x0
3102#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */ 2465#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
3103#define nEP2_RX_ENA 0x0
3104#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */ 2466#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
3105#define nEP3_RX_ENA 0x0
3106#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */ 2467#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
3107#define nEP4_RX_ENA 0x0
3108#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */ 2468#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
3109#define nEP5_RX_ENA 0x0
3110#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */ 2469#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
3111#define nEP6_RX_ENA 0x0
3112#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */ 2470#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
3113#define nEP7_RX_ENA 0x0
3114 2471
3115/* Bit masks for USB_OTG_DEV_CTL */ 2472/* Bit masks for USB_OTG_DEV_CTL */
3116 2473
3117#define SESSION 0x1 /* session indicator */ 2474#define SESSION 0x1 /* session indicator */
3118#define nSESSION 0x0
3119#define HOST_REQ 0x2 /* Host negotiation request */ 2475#define HOST_REQ 0x2 /* Host negotiation request */
3120#define nHOST_REQ 0x0
3121#define HOST_MODE 0x4 /* indicates USBDRC is a host */ 2476#define HOST_MODE 0x4 /* indicates USBDRC is a host */
3122#define nHOST_MODE 0x0
3123#define VBUS0 0x8 /* Vbus level indicator[0] */ 2477#define VBUS0 0x8 /* Vbus level indicator[0] */
3124#define nVBUS0 0x0
3125#define VBUS1 0x10 /* Vbus level indicator[1] */ 2478#define VBUS1 0x10 /* Vbus level indicator[1] */
3126#define nVBUS1 0x0
3127#define LSDEV 0x20 /* Low-speed indicator */ 2479#define LSDEV 0x20 /* Low-speed indicator */
3128#define nLSDEV 0x0
3129#define FSDEV 0x40 /* Full or High-speed indicator */ 2480#define FSDEV 0x40 /* Full or High-speed indicator */
3130#define nFSDEV 0x0
3131#define B_DEVICE 0x80 /* A' or 'B' device indicator */ 2481#define B_DEVICE 0x80 /* A' or 'B' device indicator */
3132#define nB_DEVICE 0x0
3133 2482
3134/* Bit masks for USB_OTG_VBUS_IRQ */ 2483/* Bit masks for USB_OTG_VBUS_IRQ */
3135 2484
3136#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */ 2485#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
3137#define nDRIVE_VBUS_ON 0x0
3138#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */ 2486#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
3139#define nDRIVE_VBUS_OFF 0x0
3140#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */ 2487#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
3141#define nCHRG_VBUS_START 0x0
3142#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */ 2488#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
3143#define nCHRG_VBUS_END 0x0
3144#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */ 2489#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
3145#define nDISCHRG_VBUS_START 0x0
3146#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */ 2490#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
3147#define nDISCHRG_VBUS_END 0x0
3148 2491
3149/* Bit masks for USB_OTG_VBUS_MASK */ 2492/* Bit masks for USB_OTG_VBUS_MASK */
3150 2493
3151#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */ 2494#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
3152#define nDRIVE_VBUS_ON_ENA 0x0
3153#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */ 2495#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
3154#define nDRIVE_VBUS_OFF_ENA 0x0
3155#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */ 2496#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
3156#define nCHRG_VBUS_START_ENA 0x0
3157#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */ 2497#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
3158#define nCHRG_VBUS_END_ENA 0x0
3159#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */ 2498#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
3160#define nDISCHRG_VBUS_START_ENA 0x0
3161#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */ 2499#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
3162#define nDISCHRG_VBUS_END_ENA 0x0
3163 2500
3164/* Bit masks for USB_CSR0 */ 2501/* Bit masks for USB_CSR0 */
3165 2502
3166#define RXPKTRDY 0x1 /* data packet receive indicator */ 2503#define RXPKTRDY 0x1 /* data packet receive indicator */
3167#define nRXPKTRDY 0x0
3168#define TXPKTRDY 0x2 /* data packet in FIFO indicator */ 2504#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
3169#define nTXPKTRDY 0x0
3170#define STALL_SENT 0x4 /* STALL handshake sent */ 2505#define STALL_SENT 0x4 /* STALL handshake sent */
3171#define nSTALL_SENT 0x0
3172#define DATAEND 0x8 /* Data end indicator */ 2506#define DATAEND 0x8 /* Data end indicator */
3173#define nDATAEND 0x0
3174#define SETUPEND 0x10 /* Setup end */ 2507#define SETUPEND 0x10 /* Setup end */
3175#define nSETUPEND 0x0
3176#define SENDSTALL 0x20 /* Send STALL handshake */ 2508#define SENDSTALL 0x20 /* Send STALL handshake */
3177#define nSENDSTALL 0x0
3178#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */ 2509#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
3179#define nSERVICED_RXPKTRDY 0x0
3180#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */ 2510#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
3181#define nSERVICED_SETUPEND 0x0
3182#define FLUSHFIFO 0x100 /* flush endpoint FIFO */ 2511#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
3183#define nFLUSHFIFO 0x0
3184#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */ 2512#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
3185#define nSTALL_RECEIVED_H 0x0
3186#define SETUPPKT_H 0x8 /* send Setup token host mode */ 2513#define SETUPPKT_H 0x8 /* send Setup token host mode */
3187#define nSETUPPKT_H 0x0
3188#define ERROR_H 0x10 /* timeout error indicator host mode */ 2514#define ERROR_H 0x10 /* timeout error indicator host mode */
3189#define nERROR_H 0x0
3190#define REQPKT_H 0x20 /* Request an IN transaction host mode */ 2515#define REQPKT_H 0x20 /* Request an IN transaction host mode */
3191#define nREQPKT_H 0x0
3192#define STATUSPKT_H 0x40 /* Status stage transaction host mode */ 2516#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
3193#define nSTATUSPKT_H 0x0
3194#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */ 2517#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
3195#define nNAK_TIMEOUT_H 0x0
3196 2518
3197/* Bit masks for USB_COUNT0 */ 2519/* Bit masks for USB_COUNT0 */
3198 2520
@@ -3213,37 +2535,21 @@
3213/* Bit masks for USB_TXCSR */ 2535/* Bit masks for USB_TXCSR */
3214 2536
3215#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */ 2537#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
3216#define nTXPKTRDY_T 0x0
3217#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */ 2538#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
3218#define nFIFO_NOT_EMPTY_T 0x0
3219#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */ 2539#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
3220#define nUNDERRUN_T 0x0
3221#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */ 2540#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
3222#define nFLUSHFIFO_T 0x0
3223#define STALL_SEND_T 0x10 /* issue a Stall handshake */ 2541#define STALL_SEND_T 0x10 /* issue a Stall handshake */
3224#define nSTALL_SEND_T 0x0
3225#define STALL_SENT_T 0x20 /* Stall handshake transmitted */ 2542#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
3226#define nSTALL_SENT_T 0x0
3227#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */ 2543#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
3228#define nCLEAR_DATATOGGLE_T 0x0
3229#define INCOMPTX_T 0x80 /* indicates that a large packet is split */ 2544#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
3230#define nINCOMPTX_T 0x0
3231#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */ 2545#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
3232#define nDMAREQMODE_T 0x0
3233#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */ 2546#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
3234#define nFORCE_DATATOGGLE_T 0x0
3235#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */ 2547#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
3236#define nDMAREQ_ENA_T 0x0
3237#define ISO_T 0x4000 /* enable Isochronous transfers */ 2548#define ISO_T 0x4000 /* enable Isochronous transfers */
3238#define nISO_T 0x0
3239#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */ 2549#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
3240#define nAUTOSET_T 0x0
3241#define ERROR_TH 0x4 /* error condition host mode */ 2550#define ERROR_TH 0x4 /* error condition host mode */
3242#define nERROR_TH 0x0
3243#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */ 2551#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
3244#define nSTALL_RECEIVED_TH 0x0
3245#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */ 2552#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
3246#define nNAK_TIMEOUT_TH 0x0
3247 2553
3248/* Bit masks for USB_TXCOUNT */ 2554/* Bit masks for USB_TXCOUNT */
3249 2555
@@ -3252,45 +2558,25 @@
3252/* Bit masks for USB_RXCSR */ 2558/* Bit masks for USB_RXCSR */
3253 2559
3254#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */ 2560#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
3255#define nRXPKTRDY_R 0x0
3256#define FIFO_FULL_R 0x2 /* FIFO not empty */ 2561#define FIFO_FULL_R 0x2 /* FIFO not empty */
3257#define nFIFO_FULL_R 0x0
3258#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */ 2562#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
3259#define nOVERRUN_R 0x0
3260#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */ 2563#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
3261#define nDATAERROR_R 0x0
3262#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */ 2564#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
3263#define nFLUSHFIFO_R 0x0
3264#define STALL_SEND_R 0x20 /* issue a Stall handshake */ 2565#define STALL_SEND_R 0x20 /* issue a Stall handshake */
3265#define nSTALL_SEND_R 0x0
3266#define STALL_SENT_R 0x40 /* Stall handshake transmitted */ 2566#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
3267#define nSTALL_SENT_R 0x0
3268#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */ 2567#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
3269#define nCLEAR_DATATOGGLE_R 0x0
3270#define INCOMPRX_R 0x100 /* indicates that a large packet is split */ 2568#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
3271#define nINCOMPRX_R 0x0
3272#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */ 2569#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
3273#define nDMAREQMODE_R 0x0
3274#define DISNYET_R 0x1000 /* disable Nyet handshakes */ 2570#define DISNYET_R 0x1000 /* disable Nyet handshakes */
3275#define nDISNYET_R 0x0
3276#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */ 2571#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
3277#define nDMAREQ_ENA_R 0x0
3278#define ISO_R 0x4000 /* enable Isochronous transfers */ 2572#define ISO_R 0x4000 /* enable Isochronous transfers */
3279#define nISO_R 0x0
3280#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */ 2573#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
3281#define nAUTOCLEAR_R 0x0
3282#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */ 2574#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
3283#define nERROR_RH 0x0
3284#define REQPKT_RH 0x20 /* request an IN transaction host mode */ 2575#define REQPKT_RH 0x20 /* request an IN transaction host mode */
3285#define nREQPKT_RH 0x0
3286#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */ 2576#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
3287#define nSTALL_RECEIVED_RH 0x0
3288#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */ 2577#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
3289#define nINCOMPRX_RH 0x0
3290#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */ 2578#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
3291#define nDMAREQMODE_RH 0x0
3292#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */ 2579#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
3293#define nAUTOREQ_RH 0x0
3294 2580
3295/* Bit masks for USB_RXCOUNT */ 2581/* Bit masks for USB_RXCOUNT */
3296 2582
@@ -3317,35 +2603,22 @@
3317/* Bit masks for USB_DMA_INTERRUPT */ 2603/* Bit masks for USB_DMA_INTERRUPT */
3318 2604
3319#define DMA0_INT 0x1 /* DMA0 pending interrupt */ 2605#define DMA0_INT 0x1 /* DMA0 pending interrupt */
3320#define nDMA0_INT 0x0
3321#define DMA1_INT 0x2 /* DMA1 pending interrupt */ 2606#define DMA1_INT 0x2 /* DMA1 pending interrupt */
3322#define nDMA1_INT 0x0
3323#define DMA2_INT 0x4 /* DMA2 pending interrupt */ 2607#define DMA2_INT 0x4 /* DMA2 pending interrupt */
3324#define nDMA2_INT 0x0
3325#define DMA3_INT 0x8 /* DMA3 pending interrupt */ 2608#define DMA3_INT 0x8 /* DMA3 pending interrupt */
3326#define nDMA3_INT 0x0
3327#define DMA4_INT 0x10 /* DMA4 pending interrupt */ 2609#define DMA4_INT 0x10 /* DMA4 pending interrupt */
3328#define nDMA4_INT 0x0
3329#define DMA5_INT 0x20 /* DMA5 pending interrupt */ 2610#define DMA5_INT 0x20 /* DMA5 pending interrupt */
3330#define nDMA5_INT 0x0
3331#define DMA6_INT 0x40 /* DMA6 pending interrupt */ 2611#define DMA6_INT 0x40 /* DMA6 pending interrupt */
3332#define nDMA6_INT 0x0
3333#define DMA7_INT 0x80 /* DMA7 pending interrupt */ 2612#define DMA7_INT 0x80 /* DMA7 pending interrupt */
3334#define nDMA7_INT 0x0
3335 2613
3336/* Bit masks for USB_DMAxCONTROL */ 2614/* Bit masks for USB_DMAxCONTROL */
3337 2615
3338#define DMA_ENA 0x1 /* DMA enable */ 2616#define DMA_ENA 0x1 /* DMA enable */
3339#define nDMA_ENA 0x0
3340#define DIRECTION 0x2 /* direction of DMA transfer */ 2617#define DIRECTION 0x2 /* direction of DMA transfer */
3341#define nDIRECTION 0x0
3342#define MODE 0x4 /* DMA Bus error */ 2618#define MODE 0x4 /* DMA Bus error */
3343#define nMODE 0x0
3344#define INT_ENA 0x8 /* Interrupt enable */ 2619#define INT_ENA 0x8 /* Interrupt enable */
3345#define nINT_ENA 0x0
3346#define EPNUM 0xf0 /* EP number */ 2620#define EPNUM 0xf0 /* EP number */
3347#define BUSERROR 0x100 /* DMA Bus error */ 2621#define BUSERROR 0x100 /* DMA Bus error */
3348#define nBUSERROR 0x0
3349 2622
3350/* Bit masks for USB_DMAxADDRHIGH */ 2623/* Bit masks for USB_DMAxADDRHIGH */
3351 2624
@@ -3366,26 +2639,16 @@
3366/* Bit masks for HMDMAx_CONTROL */ 2639/* Bit masks for HMDMAx_CONTROL */
3367 2640
3368#define HMDMAEN 0x1 /* Handshake MDMA Enable */ 2641#define HMDMAEN 0x1 /* Handshake MDMA Enable */
3369#define nHMDMAEN 0x0
3370#define REP 0x2 /* Handshake MDMA Request Polarity */ 2642#define REP 0x2 /* Handshake MDMA Request Polarity */
3371#define nREP 0x0
3372#define UTE 0x8 /* Urgency Threshold Enable */ 2643#define UTE 0x8 /* Urgency Threshold Enable */
3373#define nUTE 0x0
3374#define OIE 0x10 /* Overflow Interrupt Enable */ 2644#define OIE 0x10 /* Overflow Interrupt Enable */
3375#define nOIE 0x0
3376#define BDIE 0x20 /* Block Done Interrupt Enable */ 2645#define BDIE 0x20 /* Block Done Interrupt Enable */
3377#define nBDIE 0x0
3378#define MBDI 0x40 /* Mask Block Done Interrupt */ 2646#define MBDI 0x40 /* Mask Block Done Interrupt */
3379#define nMBDI 0x0
3380#define DRQ 0x300 /* Handshake MDMA Request Type */ 2647#define DRQ 0x300 /* Handshake MDMA Request Type */
3381#define RBC 0x1000 /* Force Reload of BCOUNT */ 2648#define RBC 0x1000 /* Force Reload of BCOUNT */
3382#define nRBC 0x0
3383#define PS 0x2000 /* Pin Status */ 2649#define PS 0x2000 /* Pin Status */
3384#define nPS 0x0
3385#define OI 0x4000 /* Overflow Interrupt Generated */ 2650#define OI 0x4000 /* Overflow Interrupt Generated */
3386#define nOI 0x0
3387#define BDI 0x8000 /* Block Done Interrupt Generated */ 2651#define BDI 0x8000 /* Block Done Interrupt Generated */
3388#define nBDI 0x0
3389 2652
3390/* ******************************************* */ 2653/* ******************************************* */
3391/* MULTI BIT MACRO ENUMERATIONS */ 2654/* MULTI BIT MACRO ENUMERATIONS */
diff --git a/include/asm-blackfin/mach-bf548/defBF54x_base.h b/include/asm-blackfin/mach-bf548/defBF54x_base.h
index a1b200fe6a1f..895ddd40a838 100644
--- a/include/asm-blackfin/mach-bf548/defBF54x_base.h
+++ b/include/asm-blackfin/mach-bf548/defBF54x_base.h
@@ -46,7 +46,7 @@
46 46
47/* Debug/MP/Emulation Registers (0xFFC00014 - 0xFFC00014) */ 47/* Debug/MP/Emulation Registers (0xFFC00014 - 0xFFC00014) */
48 48
49#define CHIPID 0xffc00014 49#define CHIPID 0xffc00014
50 50
51/* System Reset and Interrupt Controller (0xFFC00100 - 0xFFC00104) */ 51/* System Reset and Interrupt Controller (0xFFC00100 - 0xFFC00104) */
52 52
@@ -1512,231 +1512,144 @@
1512/* and MULTI BIT READ MACROS */ 1512/* and MULTI BIT READ MACROS */
1513/* ********************************************************** */ 1513/* ********************************************************** */
1514 1514
1515/* SIC_IMASK Masks */
1516#define SIC_UNMASK_ALL 0x00000000 /* Unmask all peripheral interrupts */
1517#define SIC_MASK_ALL 0xFFFFFFFF /* Mask all peripheral interrupts */
1518#define SIC_MASK(x) (1 << (x)) /* Mask Peripheral #x interrupt */
1519#define SIC_UNMASK(x) (0xFFFFFFFF ^ (1 << (x))) /* Unmask Peripheral #x interrupt */
1520
1521/* SIC_IWR Masks */
1522#define IWR_DISABLE_ALL 0x00000000 /* Wakeup Disable all peripherals */
1523#define IWR_ENABLE_ALL 0xFFFFFFFF /* Wakeup Enable all peripherals */
1524#define IWR_ENABLE(x) (1 << (x)) /* Wakeup Enable Peripheral #x */
1525#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << (x))) /* Wakeup Disable Peripheral #x */
1526
1515/* Bit masks for SIC_IAR0 */ 1527/* Bit masks for SIC_IAR0 */
1516 1528
1517#define IRQ_PLL_WAKEUP 0x1 /* PLL Wakeup */ 1529#define PLL_WAKEUP 0x1 /* PLL Wakeup */
1518#define nIRQ_PLL_WAKEUP 0x0
1519 1530
1520/* Bit masks for SIC_IWR0, SIC_IMASK0, SIC_ISR0 */ 1531/* Bit masks for SIC_IWR0, SIC_IMASK0, SIC_ISR0 */
1521 1532
1522#define IRQ_DMA0_ERR 0x2 /* DMA Controller 0 Error */ 1533#define DMA0_ERR 0x2 /* DMA Controller 0 Error */
1523#define nIRQ_DMA0_ERR 0x0 1534#define EPPI0_ERR 0x4 /* EPPI0 Error */
1524#define IRQ_EPPI0_ERR 0x4 /* EPPI0 Error */ 1535#define SPORT0_ERR 0x8 /* SPORT0 Error */
1525#define nIRQ_EPPI0_ERR 0x0 1536#define SPORT1_ERR 0x10 /* SPORT1 Error */
1526#define IRQ_SPORT0_ERR 0x8 /* SPORT0 Error */ 1537#define SPI0_ERR 0x20 /* SPI0 Error */
1527#define nIRQ_SPORT0_ERR 0x0 1538#define UART0_ERR 0x40 /* UART0 Error */
1528#define IRQ_SPORT1_ERR 0x10 /* SPORT1 Error */ 1539#define RTC 0x80 /* Real-Time Clock */
1529#define nIRQ_SPORT1_ERR 0x0 1540#define DMA12 0x100 /* DMA Channel 12 */
1530#define IRQ_SPI0_ERR 0x20 /* SPI0 Error */ 1541#define DMA0 0x200 /* DMA Channel 0 */
1531#define nIRQ_SPI0_ERR 0x0 1542#define DMA1 0x400 /* DMA Channel 1 */
1532#define IRQ_UART0_ERR 0x40 /* UART0 Error */ 1543#define DMA2 0x800 /* DMA Channel 2 */
1533#define nIRQ_UART0_ERR 0x0 1544#define DMA3 0x1000 /* DMA Channel 3 */
1534#define IRQ_RTC 0x80 /* Real-Time Clock */ 1545#define DMA4 0x2000 /* DMA Channel 4 */
1535#define nIRQ_RTC 0x0 1546#define DMA6 0x4000 /* DMA Channel 6 */
1536#define IRQ_DMA12 0x100 /* DMA Channel 12 */ 1547#define DMA7 0x8000 /* DMA Channel 7 */
1537#define nIRQ_DMA12 0x0 1548#define PINT0 0x80000 /* Pin Interrupt 0 */
1538#define IRQ_DMA0 0x200 /* DMA Channel 0 */ 1549#define PINT1 0x100000 /* Pin Interrupt 1 */
1539#define nIRQ_DMA0 0x0 1550#define MDMA0 0x200000 /* Memory DMA Stream 0 */
1540#define IRQ_DMA1 0x400 /* DMA Channel 1 */ 1551#define MDMA1 0x400000 /* Memory DMA Stream 1 */
1541#define nIRQ_DMA1 0x0 1552#define WDOG 0x800000 /* Watchdog Timer */
1542#define IRQ_DMA2 0x800 /* DMA Channel 2 */ 1553#define DMA1_ERR 0x1000000 /* DMA Controller 1 Error */
1543#define nIRQ_DMA2 0x0 1554#define SPORT2_ERR 0x2000000 /* SPORT2 Error */
1544#define IRQ_DMA3 0x1000 /* DMA Channel 3 */ 1555#define SPORT3_ERR 0x4000000 /* SPORT3 Error */
1545#define nIRQ_DMA3 0x0 1556#define MXVR_SD 0x8000000 /* MXVR Synchronous Data */
1546#define IRQ_DMA4 0x2000 /* DMA Channel 4 */ 1557#define SPI1_ERR 0x10000000 /* SPI1 Error */
1547#define nIRQ_DMA4 0x0 1558#define SPI2_ERR 0x20000000 /* SPI2 Error */
1548#define IRQ_DMA6 0x4000 /* DMA Channel 6 */ 1559#define UART1_ERR 0x40000000 /* UART1 Error */
1549#define nIRQ_DMA6 0x0 1560#define UART2_ERR 0x80000000 /* UART2 Error */
1550#define IRQ_DMA7 0x8000 /* DMA Channel 7 */
1551#define nIRQ_DMA7 0x0
1552#define IRQ_PINT0 0x80000 /* Pin Interrupt 0 */
1553#define nIRQ_PINT0 0x0
1554#define IRQ_PINT1 0x100000 /* Pin Interrupt 1 */
1555#define nIRQ_PINT1 0x0
1556#define IRQ_MDMA0 0x200000 /* Memory DMA Stream 0 */
1557#define nIRQ_MDMA0 0x0
1558#define IRQ_MDMA1 0x400000 /* Memory DMA Stream 1 */
1559#define nIRQ_MDMA1 0x0
1560#define IRQ_WDOG 0x800000 /* Watchdog Timer */
1561#define nIRQ_WDOG 0x0
1562#define IRQ_DMA1_ERR 0x1000000 /* DMA Controller 1 Error */
1563#define nIRQ_DMA1_ERR 0x0
1564#define IRQ_SPORT2_ERR 0x2000000 /* SPORT2 Error */
1565#define nIRQ_SPORT2_ERR 0x0
1566#define IRQ_SPORT3_ERR 0x4000000 /* SPORT3 Error */
1567#define nIRQ_SPORT3_ERR 0x0
1568#define IRQ_MXVR_SD 0x8000000 /* MXVR Synchronous Data */
1569#define nIRQ_MXVR_SD 0x0
1570#define IRQ_SPI1_ERR 0x10000000 /* SPI1 Error */
1571#define nIRQ_SPI1_ERR 0x0
1572#define IRQ_SPI2_ERR 0x20000000 /* SPI2 Error */
1573#define nIRQ_SPI2_ERR 0x0
1574#define IRQ_UART1_ERR 0x40000000 /* UART1 Error */
1575#define nIRQ_UART1_ERR 0x0
1576#define IRQ_UART2_ERR 0x80000000 /* UART2 Error */
1577#define nIRQ_UART2_ERR 0x0
1578 1561
1579/* Bit masks for SIC_IWR1, SIC_IMASK1, SIC_ISR1 */ 1562/* Bit masks for SIC_IWR1, SIC_IMASK1, SIC_ISR1 */
1580 1563
1581#define IRQ_CAN0_ERR 0x1 /* CAN0 Error */ 1564#define CAN0_ERR 0x1 /* CAN0 Error */
1582#define nIRQ_CAN0_ERR 0x0 1565#define DMA18 0x2 /* DMA Channel 18 */
1583#define IRQ_DMA18 0x2 /* DMA Channel 18 */ 1566#define DMA19 0x4 /* DMA Channel 19 */
1584#define nIRQ_DMA18 0x0 1567#define DMA20 0x8 /* DMA Channel 20 */
1585#define IRQ_DMA19 0x4 /* DMA Channel 19 */ 1568#define DMA21 0x10 /* DMA Channel 21 */
1586#define nIRQ_DMA19 0x0 1569#define DMA13 0x20 /* DMA Channel 13 */
1587#define IRQ_DMA20 0x8 /* DMA Channel 20 */ 1570#define DMA14 0x40 /* DMA Channel 14 */
1588#define nIRQ_DMA20 0x0 1571#define DMA5 0x80 /* DMA Channel 5 */
1589#define IRQ_DMA21 0x10 /* DMA Channel 21 */ 1572#define DMA23 0x100 /* DMA Channel 23 */
1590#define nIRQ_DMA21 0x0 1573#define DMA8 0x200 /* DMA Channel 8 */
1591#define IRQ_DMA13 0x20 /* DMA Channel 13 */ 1574#define DMA9 0x400 /* DMA Channel 9 */
1592#define nIRQ_DMA13 0x0 1575#define DMA10 0x800 /* DMA Channel 10 */
1593#define IRQ_DMA14 0x40 /* DMA Channel 14 */ 1576#define DMA11 0x1000 /* DMA Channel 11 */
1594#define nIRQ_DMA14 0x0 1577#define TWI0 0x2000 /* TWI0 */
1595#define IRQ_DMA5 0x80 /* DMA Channel 5 */ 1578#define TWI1 0x4000 /* TWI1 */
1596#define nIRQ_DMA5 0x0 1579#define CAN0_RX 0x8000 /* CAN0 Receive */
1597#define IRQ_DMA23 0x100 /* DMA Channel 23 */ 1580#define CAN0_TX 0x10000 /* CAN0 Transmit */
1598#define nIRQ_DMA23 0x0 1581#define MDMA2 0x20000 /* Memory DMA Stream 0 */
1599#define IRQ_DMA8 0x200 /* DMA Channel 8 */ 1582#define MDMA3 0x40000 /* Memory DMA Stream 1 */
1600#define nIRQ_DMA8 0x0 1583#define MXVR_STAT 0x80000 /* MXVR Status */
1601#define IRQ_DMA9 0x400 /* DMA Channel 9 */ 1584#define MXVR_CM 0x100000 /* MXVR Control Message */
1602#define nIRQ_DMA9 0x0 1585#define MXVR_AP 0x200000 /* MXVR Asynchronous Packet */
1603#define IRQ_DMA10 0x800 /* DMA Channel 10 */ 1586#define EPPI1_ERR 0x400000 /* EPPI1 Error */
1604#define nIRQ_DMA10 0x0 1587#define EPPI2_ERR 0x800000 /* EPPI2 Error */
1605#define IRQ_DMA11 0x1000 /* DMA Channel 11 */ 1588#define UART3_ERR 0x1000000 /* UART3 Error */
1606#define nIRQ_DMA11 0x0 1589#define HOST_ERR 0x2000000 /* Host DMA Port Error */
1607#define IRQ_TWI0 0x2000 /* TWI0 */ 1590#define USB_ERR 0x4000000 /* USB Error */
1608#define nIRQ_TWI0 0x0 1591#define PIXC_ERR 0x8000000 /* Pixel Compositor Error */
1609#define IRQ_TWI1 0x4000 /* TWI1 */ 1592#define NFC_ERR 0x10000000 /* Nand Flash Controller Error */
1610#define nIRQ_TWI1 0x0 1593#define ATAPI_ERR 0x20000000 /* ATAPI Error */
1611#define IRQ_CAN0_RX 0x8000 /* CAN0 Receive */ 1594#define CAN1_ERR 0x40000000 /* CAN1 Error */
1612#define nIRQ_CAN0_RX 0x0 1595#define DMAR0_ERR 0x80000000 /* DMAR0 Overflow Error */
1613#define IRQ_CAN0_TX 0x10000 /* CAN0 Transmit */ 1596#define DMAR1_ERR 0x80000000 /* DMAR1 Overflow Error */
1614#define nIRQ_CAN0_TX 0x0 1597#define DMAR0 0x80000000 /* DMAR0 Block */
1615#define IRQ_MDMA2 0x20000 /* Memory DMA Stream 0 */ 1598#define DMAR1 0x80000000 /* DMAR1 Block */
1616#define nIRQ_MDMA2 0x0
1617#define IRQ_MDMA3 0x40000 /* Memory DMA Stream 1 */
1618#define nIRQ_MDMA3 0x0
1619#define IRQ_MXVR_STAT 0x80000 /* MXVR Status */
1620#define nIRQ_MXVR_STAT 0x0
1621#define IRQ_MXVR_CM 0x100000 /* MXVR Control Message */
1622#define nIRQ_MXVR_CM 0x0
1623#define IRQ_MXVR_AP 0x200000 /* MXVR Asynchronous Packet */
1624#define nIRQ_MXVR_AP 0x0
1625#define IRQ_EPPI1_ERR 0x400000 /* EPPI1 Error */
1626#define nIRQ_EPPI1_ERR 0x0
1627#define IRQ_EPPI2_ERR 0x800000 /* EPPI2 Error */
1628#define nIRQ_EPPI2_ERR 0x0
1629#define IRQ_UART3_ERR 0x1000000 /* UART3 Error */
1630#define nIRQ_UART3_ERR 0x0
1631#define IRQ_HOST_ERR 0x2000000 /* Host DMA Port Error */
1632#define nIRQ_HOST_ERR 0x0
1633#define IRQ_USB_ERR 0x4000000 /* USB Error */
1634#define nIRQ_USB_ERR 0x0
1635#define IRQ_PIXC_ERR 0x8000000 /* Pixel Compositor Error */
1636#define nIRQ_PIXC_ERR 0x0
1637#define IRQ_NFC_ERR 0x10000000 /* Nand Flash Controller Error */
1638#define nIRQ_NFC_ERR 0x0
1639#define IRQ_ATAPI_ERR 0x20000000 /* ATAPI Error */
1640#define nIRQ_ATAPI_ERR 0x0
1641#define IRQ_CAN1_ERR 0x40000000 /* CAN1 Error */
1642#define nIRQ_CAN1_ERR 0x0
1643#define IRQ_DMAR0_ERR 0x80000000 /* DMAR0 Overflow Error */
1644#define nIRQ_DMAR0_ERR 0x0
1645#define IRQ_DMAR1_ERR 0x80000000 /* DMAR1 Overflow Error */
1646#define nIRQ_DMAR1_ERR 0x0
1647#define IRQ_DMAR0 0x80000000 /* DMAR0 Block */
1648#define nIRQ_DMAR0 0x0
1649#define IRQ_DMAR1 0x80000000 /* DMAR1 Block */
1650#define nIRQ_DMAR1 0x0
1651 1599
1652/* Bit masks for SIC_IWR2, SIC_IMASK2, SIC_ISR2 */ 1600/* Bit masks for SIC_IWR2, SIC_IMASK2, SIC_ISR2 */
1653 1601
1654#define IRQ_DMA15 0x1 /* DMA Channel 15 */ 1602#define DMA15 0x1 /* DMA Channel 15 */
1655#define nIRQ_DMA15 0x0 1603#define DMA16 0x2 /* DMA Channel 16 */
1656#define IRQ_DMA16 0x2 /* DMA Channel 16 */ 1604#define DMA17 0x4 /* DMA Channel 17 */
1657#define nIRQ_DMA16 0x0 1605#define DMA22 0x8 /* DMA Channel 22 */
1658#define IRQ_DMA17 0x4 /* DMA Channel 17 */ 1606#define CNT 0x10 /* Counter */
1659#define nIRQ_DMA17 0x0 1607#define KEY 0x20 /* Keypad */
1660#define IRQ_DMA22 0x8 /* DMA Channel 22 */ 1608#define CAN1_RX 0x40 /* CAN1 Receive */
1661#define nIRQ_DMA22 0x0 1609#define CAN1_TX 0x80 /* CAN1 Transmit */
1662#define IRQ_CNT 0x10 /* Counter */ 1610#define SDH_INT_MASK0 0x100 /* SDH Mask 0 */
1663#define nIRQ_CNT 0x0 1611#define SDH_INT_MASK1 0x200 /* SDH Mask 1 */
1664#define IRQ_KEY 0x20 /* Keypad */ 1612#define USB_EINT 0x400 /* USB Exception */
1665#define nIRQ_KEY 0x0 1613#define USB_INT0 0x800 /* USB Interrupt 0 */
1666#define IRQ_CAN1_RX 0x40 /* CAN1 Receive */ 1614#define USB_INT1 0x1000 /* USB Interrupt 1 */
1667#define nIRQ_CAN1_RX 0x0 1615#define USB_INT2 0x2000 /* USB Interrupt 2 */
1668#define IRQ_CAN1_TX 0x80 /* CAN1 Transmit */ 1616#define USB_DMAINT 0x4000 /* USB DMA */
1669#define nIRQ_CAN1_TX 0x0 1617#define OTPSEC 0x8000 /* OTP Access Complete */
1670#define IRQ_SDH_MASK0 0x100 /* SDH Mask 0 */ 1618#define TIMER0 0x400000 /* Timer 0 */
1671#define nIRQ_SDH_MASK0 0x0 1619#define TIMER1 0x800000 /* Timer 1 */
1672#define IRQ_SDH_MASK1 0x200 /* SDH Mask 1 */ 1620#define TIMER2 0x1000000 /* Timer 2 */
1673#define nIRQ_SDH_MASK1 0x0 1621#define TIMER3 0x2000000 /* Timer 3 */
1674#define IRQ_USB_EINT 0x400 /* USB Exception */ 1622#define TIMER4 0x4000000 /* Timer 4 */
1675#define nIRQ_USB_EINT 0x0 1623#define TIMER5 0x8000000 /* Timer 5 */
1676#define IRQ_USB_INT0 0x800 /* USB Interrupt 0 */ 1624#define TIMER6 0x10000000 /* Timer 6 */
1677#define nIRQ_USB_INT0 0x0 1625#define TIMER7 0x20000000 /* Timer 7 */
1678#define IRQ_USB_INT1 0x1000 /* USB Interrupt 1 */ 1626#define PINT2 0x40000000 /* Pin Interrupt 2 */
1679#define nIRQ_USB_INT1 0x0 1627#define PINT3 0x80000000 /* Pin Interrupt 3 */
1680#define IRQ_USB_INT2 0x2000 /* USB Interrupt 2 */
1681#define nIRQ_USB_INT2 0x0
1682#define IRQ_USB_DMAINT 0x4000 /* USB DMA */
1683#define nIRQ_USB_DMAINT 0x0
1684#define IRQ_OTPSEC 0x8000 /* OTP Access Complete */
1685#define nIRQ_OTPSEC 0x0
1686#define IRQ_TIMER0 0x400000 /* Timer 0 */
1687#define nIRQ_TIMER0 0x0
1688#define IRQ_TIMER1 0x800000 /* Timer 1 */
1689#define nIRQ_TIMER1 0x0
1690#define IRQ_TIMER2 0x1000000 /* Timer 2 */
1691#define nIRQ_TIMER2 0x0
1692#define IRQ_TIMER3 0x2000000 /* Timer 3 */
1693#define nIRQ_TIMER3 0x0
1694#define IRQ_TIMER4 0x4000000 /* Timer 4 */
1695#define nIRQ_TIMER4 0x0
1696#define IRQ_TIMER5 0x8000000 /* Timer 5 */
1697#define nIRQ_TIMER5 0x0
1698#define IRQ_TIMER6 0x10000000 /* Timer 6 */
1699#define nIRQ_TIMER6 0x0
1700#define IRQ_TIMER7 0x20000000 /* Timer 7 */
1701#define nIRQ_TIMER7 0x0
1702#define IRQ_PINT2 0x40000000 /* Pin Interrupt 2 */
1703#define nIRQ_PINT2 0x0
1704#define IRQ_PINT3 0x80000000 /* Pin Interrupt 3 */
1705#define nIRQ_PINT3 0x0
1706 1628
1707/* Bit masks for DMAx_CONFIG, MDMA_Sx_CONFIG, MDMA_Dx_CONFIG */ 1629/* Bit masks for DMAx_CONFIG, MDMA_Sx_CONFIG, MDMA_Dx_CONFIG */
1708 1630
1709#define DMAEN 0x1 /* DMA Channel Enable */ 1631#define DMAEN 0x1 /* DMA Channel Enable */
1710#define nDMAEN 0x0
1711#define WNR 0x2 /* DMA Direction */ 1632#define WNR 0x2 /* DMA Direction */
1712#define nWNR 0x0 1633#define WDSIZE_8 0x0 /* Transfer Word Size = 8 */
1713#define WDSIZE 0xc /* Transfer Word Size */ 1634#define WDSIZE_16 0x4 /* Transfer Word Size = 16 */
1635#define WDSIZE_32 0x8 /* Transfer Word Size = 32 */
1714#define DMA2D 0x10 /* DMA Mode */ 1636#define DMA2D 0x10 /* DMA Mode */
1715#define nDMA2D 0x0
1716#define RESTART 0x20 /* Work Unit Transitions */ 1637#define RESTART 0x20 /* Work Unit Transitions */
1717#define nRESTART 0x0
1718#define DI_SEL 0x40 /* Data Interrupt Timing Select */ 1638#define DI_SEL 0x40 /* Data Interrupt Timing Select */
1719#define nDI_SEL 0x0
1720#define DI_EN 0x80 /* Data Interrupt Enable */ 1639#define DI_EN 0x80 /* Data Interrupt Enable */
1721#define nDI_EN 0x0
1722#define NDSIZE 0xf00 /* Flex Descriptor Size */ 1640#define NDSIZE 0xf00 /* Flex Descriptor Size */
1723#define DMAFLOW 0xf000 /* Next Operation */ 1641#define DMAFLOW 0xf000 /* Next Operation */
1724 1642
1725/* Bit masks for DMAx_IRQ_STATUS, MDMA_Sx_IRQ_STATUS, MDMA_Dx_IRQ_STATUS */ 1643/* Bit masks for DMAx_IRQ_STATUS, MDMA_Sx_IRQ_STATUS, MDMA_Dx_IRQ_STATUS */
1726 1644
1727#define DMA_DONE 0x1 /* DMA Completion Interrupt Status */ 1645#define DMA_DONE 0x1 /* DMA Completion Interrupt Status */
1728#define nDMA_DONE 0x0
1729#define DMA_ERR 0x2 /* DMA Error Interrupt Status */ 1646#define DMA_ERR 0x2 /* DMA Error Interrupt Status */
1730#define nDMA_ERR 0x0
1731#define DFETCH 0x4 /* DMA Descriptor Fetch */ 1647#define DFETCH 0x4 /* DMA Descriptor Fetch */
1732#define nDFETCH 0x0
1733#define DMA_RUN 0x8 /* DMA Channel Running */ 1648#define DMA_RUN 0x8 /* DMA Channel Running */
1734#define nDMA_RUN 0x0
1735 1649
1736/* Bit masks for DMAx_PERIPHERAL_MAP, MDMA_Sx_IRQ_STATUS, MDMA_Dx_IRQ_STATUS */ 1650/* Bit masks for DMAx_PERIPHERAL_MAP, MDMA_Sx_IRQ_STATUS, MDMA_Dx_IRQ_STATUS */
1737 1651
1738#define CTYPE 0x40 /* DMA Channel Type */ 1652#define CTYPE 0x40 /* DMA Channel Type */
1739#define nCTYPE 0x0
1740#define PMAP 0xf000 /* Peripheral Mapped To This Channel */ 1653#define PMAP 0xf000 /* Peripheral Mapped To This Channel */
1741 1654
1742/* Bit masks for DMACx_TCPER */ 1655/* Bit masks for DMACx_TCPER */
@@ -1756,29 +1669,28 @@
1756/* Bit masks for DMAC1_PERIMUX */ 1669/* Bit masks for DMAC1_PERIMUX */
1757 1670
1758#define PMUXSDH 0x1 /* Peripheral Select for DMA22 channel */ 1671#define PMUXSDH 0x1 /* Peripheral Select for DMA22 channel */
1759#define nPMUXSDH 0x0
1760 1672
1761/* Bit masks for EBIU_AMGCTL */ 1673/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS *************************/
1674/* EBIU_AMGCTL Masks */
1675#define AMCKEN 0x0001 /* Enable CLKOUT */
1676#define AMBEN_NONE 0x0000 /* All Banks Disabled */
1677#define AMBEN_B0 0x0002 /* Enable Async Memory Bank 0 only */
1678#define AMBEN_B0_B1 0x0004 /* Enable Async Memory Banks 0 & 1 only */
1679#define AMBEN_B0_B1_B2 0x0006 /* Enable Async Memory Banks 0, 1, and 2 */
1680#define AMBEN_ALL 0x0008 /* Enable Async Memory Banks (all) 0, 1, 2, and 3 */
1762 1681
1763#define AMCKEN 0x1 /* Async Memory Enable */
1764#define nAMCKEN 0x0
1765#define AMBEN 0xe /* Async bank enable */
1766 1682
1767/* Bit masks for EBIU_AMBCTL0 */ 1683/* Bit masks for EBIU_AMBCTL0 */
1768 1684
1769#define B0RDYEN 0x1 /* Bank 0 ARDY Enable */ 1685#define B0RDYEN 0x1 /* Bank 0 ARDY Enable */
1770#define nB0RDYEN 0x0
1771#define B0RDYPOL 0x2 /* Bank 0 ARDY Polarity */ 1686#define B0RDYPOL 0x2 /* Bank 0 ARDY Polarity */
1772#define nB0RDYPOL 0x0
1773#define B0TT 0xc /* Bank 0 transition time */ 1687#define B0TT 0xc /* Bank 0 transition time */
1774#define B0ST 0x30 /* Bank 0 Setup time */ 1688#define B0ST 0x30 /* Bank 0 Setup time */
1775#define B0HT 0xc0 /* Bank 0 Hold time */ 1689#define B0HT 0xc0 /* Bank 0 Hold time */
1776#define B0RAT 0xf00 /* Bank 0 Read access time */ 1690#define B0RAT 0xf00 /* Bank 0 Read access time */
1777#define B0WAT 0xf000 /* Bank 0 write access time */ 1691#define B0WAT 0xf000 /* Bank 0 write access time */
1778#define B1RDYEN 0x10000 /* Bank 1 ARDY Enable */ 1692#define B1RDYEN 0x10000 /* Bank 1 ARDY Enable */
1779#define nB1RDYEN 0x0
1780#define B1RDYPOL 0x20000 /* Bank 1 ARDY Polarity */ 1693#define B1RDYPOL 0x20000 /* Bank 1 ARDY Polarity */
1781#define nB1RDYPOL 0x0
1782#define B1TT 0xc0000 /* Bank 1 transition time */ 1694#define B1TT 0xc0000 /* Bank 1 transition time */
1783#define B1ST 0x300000 /* Bank 1 Setup time */ 1695#define B1ST 0x300000 /* Bank 1 Setup time */
1784#define B1HT 0xc00000 /* Bank 1 Hold time */ 1696#define B1HT 0xc00000 /* Bank 1 Hold time */
@@ -1788,18 +1700,14 @@
1788/* Bit masks for EBIU_AMBCTL1 */ 1700/* Bit masks for EBIU_AMBCTL1 */
1789 1701
1790#define B2RDYEN 0x1 /* Bank 2 ARDY Enable */ 1702#define B2RDYEN 0x1 /* Bank 2 ARDY Enable */
1791#define nB2RDYEN 0x0
1792#define B2RDYPOL 0x2 /* Bank 2 ARDY Polarity */ 1703#define B2RDYPOL 0x2 /* Bank 2 ARDY Polarity */
1793#define nB2RDYPOL 0x0
1794#define B2TT 0xc /* Bank 2 transition time */ 1704#define B2TT 0xc /* Bank 2 transition time */
1795#define B2ST 0x30 /* Bank 2 Setup time */ 1705#define B2ST 0x30 /* Bank 2 Setup time */
1796#define B2HT 0xc0 /* Bank 2 Hold time */ 1706#define B2HT 0xc0 /* Bank 2 Hold time */
1797#define B2RAT 0xf00 /* Bank 2 Read access time */ 1707#define B2RAT 0xf00 /* Bank 2 Read access time */
1798#define B2WAT 0xf000 /* Bank 2 write access time */ 1708#define B2WAT 0xf000 /* Bank 2 write access time */
1799#define B3RDYEN 0x10000 /* Bank 3 ARDY Enable */ 1709#define B3RDYEN 0x10000 /* Bank 3 ARDY Enable */
1800#define nB3RDYEN 0x0
1801#define B3RDYPOL 0x20000 /* Bank 3 ARDY Polarity */ 1710#define B3RDYPOL 0x20000 /* Bank 3 ARDY Polarity */
1802#define nB3RDYPOL 0x0
1803#define B3TT 0xc0000 /* Bank 3 transition time */ 1711#define B3TT 0xc0000 /* Bank 3 transition time */
1804#define B3ST 0x300000 /* Bank 3 Setup time */ 1712#define B3ST 0x300000 /* Bank 3 Setup time */
1805#define B3HT 0xc00000 /* Bank 3 Hold time */ 1713#define B3HT 0xc00000 /* Bank 3 Hold time */
@@ -1823,19 +1731,15 @@
1823/* Bit masks for EBIU_FCTL */ 1731/* Bit masks for EBIU_FCTL */
1824 1732
1825#define TESTSETLOCK 0x1 /* Test set lock */ 1733#define TESTSETLOCK 0x1 /* Test set lock */
1826#define nTESTSETLOCK 0x0
1827#define BCLK 0x6 /* Burst clock frequency */ 1734#define BCLK 0x6 /* Burst clock frequency */
1828#define PGWS 0x38 /* Page wait states */ 1735#define PGWS 0x38 /* Page wait states */
1829#define PGSZ 0x40 /* Page size */ 1736#define PGSZ 0x40 /* Page size */
1830#define nPGSZ 0x0
1831#define RDDL 0x380 /* Read data delay */ 1737#define RDDL 0x380 /* Read data delay */
1832 1738
1833/* Bit masks for EBIU_ARBSTAT */ 1739/* Bit masks for EBIU_ARBSTAT */
1834 1740
1835#define ARBSTAT 0x1 /* Arbitration status */ 1741#define ARBSTAT 0x1 /* Arbitration status */
1836#define nARBSTAT 0x0
1837#define BGSTAT 0x2 /* Bus grant status */ 1742#define BGSTAT 0x2 /* Bus grant status */
1838#define nBGSTAT 0x0
1839 1743
1840/* Bit masks for EBIU_DDRCTL0 */ 1744/* Bit masks for EBIU_DDRCTL0 */
1841 1745
@@ -1861,9 +1765,7 @@
1861#define BURSTLENGTH 0x7 /* Burst length */ 1765#define BURSTLENGTH 0x7 /* Burst length */
1862#define CASLATENCY 0x70 /* CAS latency */ 1766#define CASLATENCY 0x70 /* CAS latency */
1863#define DLLRESET 0x100 /* DLL Reset */ 1767#define DLLRESET 0x100 /* DLL Reset */
1864#define nDLLRESET 0x0
1865#define REGE 0x1000 /* Register mode enable */ 1768#define REGE 0x1000 /* Register mode enable */
1866#define nREGE 0x0
1867 1769
1868/* Bit masks for EBIU_DDRCTL3 */ 1770/* Bit masks for EBIU_DDRCTL3 */
1869 1771
@@ -1876,30 +1778,19 @@
1876#define DEB3_PFLEN 0x30 /* Pre fetch length for DEB3 accesses */ 1778#define DEB3_PFLEN 0x30 /* Pre fetch length for DEB3 accesses */
1877#define DEB_ARB_PRIORITY 0x700 /* Arbitration between DEB busses */ 1779#define DEB_ARB_PRIORITY 0x700 /* Arbitration between DEB busses */
1878#define DEB1_URGENT 0x1000 /* DEB1 Urgent */ 1780#define DEB1_URGENT 0x1000 /* DEB1 Urgent */
1879#define nDEB1_URGENT 0x0
1880#define DEB2_URGENT 0x2000 /* DEB2 Urgent */ 1781#define DEB2_URGENT 0x2000 /* DEB2 Urgent */
1881#define nDEB2_URGENT 0x0
1882#define DEB3_URGENT 0x4000 /* DEB3 Urgent */ 1782#define DEB3_URGENT 0x4000 /* DEB3 Urgent */
1883#define nDEB3_URGENT 0x0
1884 1783
1885/* Bit masks for EBIU_ERRMST */ 1784/* Bit masks for EBIU_ERRMST */
1886 1785
1887#define DEB1_ERROR 0x1 /* DEB1 Error */ 1786#define DEB1_ERROR 0x1 /* DEB1 Error */
1888#define nDEB1_ERROR 0x0
1889#define DEB2_ERROR 0x2 /* DEB2 Error */ 1787#define DEB2_ERROR 0x2 /* DEB2 Error */
1890#define nDEB2_ERROR 0x0
1891#define DEB3_ERROR 0x4 /* DEB3 Error */ 1788#define DEB3_ERROR 0x4 /* DEB3 Error */
1892#define nDEB3_ERROR 0x0
1893#define CORE_ERROR 0x8 /* Core error */ 1789#define CORE_ERROR 0x8 /* Core error */
1894#define nCORE_ERROR 0x0
1895#define DEB_MERROR 0x10 /* DEB1 Error (2nd) */ 1790#define DEB_MERROR 0x10 /* DEB1 Error (2nd) */
1896#define nDEB_MERROR 0x0
1897#define DEB2_MERROR 0x20 /* DEB2 Error (2nd) */ 1791#define DEB2_MERROR 0x20 /* DEB2 Error (2nd) */
1898#define nDEB2_MERROR 0x0
1899#define DEB3_MERROR 0x40 /* DEB3 Error (2nd) */ 1792#define DEB3_MERROR 0x40 /* DEB3 Error (2nd) */
1900#define nDEB3_MERROR 0x0
1901#define CORE_MERROR 0x80 /* Core Error (2nd) */ 1793#define CORE_MERROR 0x80 /* Core Error (2nd) */
1902#define nCORE_MERROR 0x0
1903 1794
1904/* Bit masks for EBIU_ERRADD */ 1795/* Bit masks for EBIU_ERRADD */
1905 1796
@@ -1908,15 +1799,10 @@
1908/* Bit masks for EBIU_RSTCTL */ 1799/* Bit masks for EBIU_RSTCTL */
1909 1800
1910#define DDRSRESET 0x1 /* DDR soft reset */ 1801#define DDRSRESET 0x1 /* DDR soft reset */
1911#define nDDRSRESET 0x0
1912#define PFTCHSRESET 0x4 /* DDR prefetch reset */ 1802#define PFTCHSRESET 0x4 /* DDR prefetch reset */
1913#define nPFTCHSRESET 0x0
1914#define SRREQ 0x8 /* Self-refresh request */ 1803#define SRREQ 0x8 /* Self-refresh request */
1915#define nSRREQ 0x0
1916#define SRACK 0x10 /* Self-refresh acknowledge */ 1804#define SRACK 0x10 /* Self-refresh acknowledge */
1917#define nSRACK 0x0
1918#define MDDRENABLE 0x20 /* Mobile DDR enable */ 1805#define MDDRENABLE 0x20 /* Mobile DDR enable */
1919#define nMDDRENABLE 0x0
1920 1806
1921/* Bit masks for EBIU_DDRBRC0 */ 1807/* Bit masks for EBIU_DDRBRC0 */
1922 1808
@@ -2013,136 +1899,74 @@
2013/* Bit masks for EBIU_DDRMCEN */ 1899/* Bit masks for EBIU_DDRMCEN */
2014 1900
2015#define B0WCENABLE 0x1 /* Bank 0 write count enable */ 1901#define B0WCENABLE 0x1 /* Bank 0 write count enable */
2016#define nB0WCENABLE 0x0
2017#define B1WCENABLE 0x2 /* Bank 1 write count enable */ 1902#define B1WCENABLE 0x2 /* Bank 1 write count enable */
2018#define nB1WCENABLE 0x0
2019#define B2WCENABLE 0x4 /* Bank 2 write count enable */ 1903#define B2WCENABLE 0x4 /* Bank 2 write count enable */
2020#define nB2WCENABLE 0x0
2021#define B3WCENABLE 0x8 /* Bank 3 write count enable */ 1904#define B3WCENABLE 0x8 /* Bank 3 write count enable */
2022#define nB3WCENABLE 0x0
2023#define B4WCENABLE 0x10 /* Bank 4 write count enable */ 1905#define B4WCENABLE 0x10 /* Bank 4 write count enable */
2024#define nB4WCENABLE 0x0
2025#define B5WCENABLE 0x20 /* Bank 5 write count enable */ 1906#define B5WCENABLE 0x20 /* Bank 5 write count enable */
2026#define nB5WCENABLE 0x0
2027#define B6WCENABLE 0x40 /* Bank 6 write count enable */ 1907#define B6WCENABLE 0x40 /* Bank 6 write count enable */
2028#define nB6WCENABLE 0x0
2029#define B7WCENABLE 0x80 /* Bank 7 write count enable */ 1908#define B7WCENABLE 0x80 /* Bank 7 write count enable */
2030#define nB7WCENABLE 0x0
2031#define B0RCENABLE 0x100 /* Bank 0 read count enable */ 1909#define B0RCENABLE 0x100 /* Bank 0 read count enable */
2032#define nB0RCENABLE 0x0
2033#define B1RCENABLE 0x200 /* Bank 1 read count enable */ 1910#define B1RCENABLE 0x200 /* Bank 1 read count enable */
2034#define nB1RCENABLE 0x0
2035#define B2RCENABLE 0x400 /* Bank 2 read count enable */ 1911#define B2RCENABLE 0x400 /* Bank 2 read count enable */
2036#define nB2RCENABLE 0x0
2037#define B3RCENABLE 0x800 /* Bank 3 read count enable */ 1912#define B3RCENABLE 0x800 /* Bank 3 read count enable */
2038#define nB3RCENABLE 0x0
2039#define B4RCENABLE 0x1000 /* Bank 4 read count enable */ 1913#define B4RCENABLE 0x1000 /* Bank 4 read count enable */
2040#define nB4RCENABLE 0x0
2041#define B5RCENABLE 0x2000 /* Bank 5 read count enable */ 1914#define B5RCENABLE 0x2000 /* Bank 5 read count enable */
2042#define nB5RCENABLE 0x0
2043#define B6RCENABLE 0x4000 /* Bank 6 read count enable */ 1915#define B6RCENABLE 0x4000 /* Bank 6 read count enable */
2044#define nB6RCENABLE 0x0
2045#define B7RCENABLE 0x8000 /* Bank 7 read count enable */ 1916#define B7RCENABLE 0x8000 /* Bank 7 read count enable */
2046#define nB7RCENABLE 0x0
2047#define ROWACTCENABLE 0x10000 /* DDR Row activate count enable */ 1917#define ROWACTCENABLE 0x10000 /* DDR Row activate count enable */
2048#define nROWACTCENABLE 0x0
2049#define RWTCENABLE 0x20000 /* DDR R/W Turn around count enable */ 1918#define RWTCENABLE 0x20000 /* DDR R/W Turn around count enable */
2050#define nRWTCENABLE 0x0
2051#define ARCENABLE 0x40000 /* DDR Auto-refresh count enable */ 1919#define ARCENABLE 0x40000 /* DDR Auto-refresh count enable */
2052#define nARCENABLE 0x0
2053#define GC0ENABLE 0x100000 /* DDR Grant count 0 enable */ 1920#define GC0ENABLE 0x100000 /* DDR Grant count 0 enable */
2054#define nGC0ENABLE 0x0
2055#define GC1ENABLE 0x200000 /* DDR Grant count 1 enable */ 1921#define GC1ENABLE 0x200000 /* DDR Grant count 1 enable */
2056#define nGC1ENABLE 0x0
2057#define GC2ENABLE 0x400000 /* DDR Grant count 2 enable */ 1922#define GC2ENABLE 0x400000 /* DDR Grant count 2 enable */
2058#define nGC2ENABLE 0x0
2059#define GC3ENABLE 0x800000 /* DDR Grant count 3 enable */ 1923#define GC3ENABLE 0x800000 /* DDR Grant count 3 enable */
2060#define nGC3ENABLE 0x0
2061#define GCCONTROL 0x3000000 /* DDR Grant Count Control */ 1924#define GCCONTROL 0x3000000 /* DDR Grant Count Control */
2062 1925
2063/* Bit masks for EBIU_DDRMCCL */ 1926/* Bit masks for EBIU_DDRMCCL */
2064 1927
2065#define CB0WCOUNT 0x1 /* Clear write count 0 */ 1928#define CB0WCOUNT 0x1 /* Clear write count 0 */
2066#define nCB0WCOUNT 0x0
2067#define CB1WCOUNT 0x2 /* Clear write count 1 */ 1929#define CB1WCOUNT 0x2 /* Clear write count 1 */
2068#define nCB1WCOUNT 0x0
2069#define CB2WCOUNT 0x4 /* Clear write count 2 */ 1930#define CB2WCOUNT 0x4 /* Clear write count 2 */
2070#define nCB2WCOUNT 0x0
2071#define CB3WCOUNT 0x8 /* Clear write count 3 */ 1931#define CB3WCOUNT 0x8 /* Clear write count 3 */
2072#define nCB3WCOUNT 0x0
2073#define CB4WCOUNT 0x10 /* Clear write count 4 */ 1932#define CB4WCOUNT 0x10 /* Clear write count 4 */
2074#define nCB4WCOUNT 0x0
2075#define CB5WCOUNT 0x20 /* Clear write count 5 */ 1933#define CB5WCOUNT 0x20 /* Clear write count 5 */
2076#define nCB5WCOUNT 0x0
2077#define CB6WCOUNT 0x40 /* Clear write count 6 */ 1934#define CB6WCOUNT 0x40 /* Clear write count 6 */
2078#define nCB6WCOUNT 0x0
2079#define CB7WCOUNT 0x80 /* Clear write count 7 */ 1935#define CB7WCOUNT 0x80 /* Clear write count 7 */
2080#define nCB7WCOUNT 0x0
2081#define CBRCOUNT 0x100 /* Clear read count 0 */ 1936#define CBRCOUNT 0x100 /* Clear read count 0 */
2082#define nCBRCOUNT 0x0
2083#define CB1RCOUNT 0x200 /* Clear read count 1 */ 1937#define CB1RCOUNT 0x200 /* Clear read count 1 */
2084#define nCB1RCOUNT 0x0
2085#define CB2RCOUNT 0x400 /* Clear read count 2 */ 1938#define CB2RCOUNT 0x400 /* Clear read count 2 */
2086#define nCB2RCOUNT 0x0
2087#define CB3RCOUNT 0x800 /* Clear read count 3 */ 1939#define CB3RCOUNT 0x800 /* Clear read count 3 */
2088#define nCB3RCOUNT 0x0
2089#define CB4RCOUNT 0x1000 /* Clear read count 4 */ 1940#define CB4RCOUNT 0x1000 /* Clear read count 4 */
2090#define nCB4RCOUNT 0x0
2091#define CB5RCOUNT 0x2000 /* Clear read count 5 */ 1941#define CB5RCOUNT 0x2000 /* Clear read count 5 */
2092#define nCB5RCOUNT 0x0
2093#define CB6RCOUNT 0x4000 /* Clear read count 6 */ 1942#define CB6RCOUNT 0x4000 /* Clear read count 6 */
2094#define nCB6RCOUNT 0x0
2095#define CB7RCOUNT 0x8000 /* Clear read count 7 */ 1943#define CB7RCOUNT 0x8000 /* Clear read count 7 */
2096#define nCB7RCOUNT 0x0
2097#define CRACOUNT 0x10000 /* Clear row activation count */ 1944#define CRACOUNT 0x10000 /* Clear row activation count */
2098#define nCRACOUNT 0x0
2099#define CRWTACOUNT 0x20000 /* Clear R/W turn-around count */ 1945#define CRWTACOUNT 0x20000 /* Clear R/W turn-around count */
2100#define nCRWTACOUNT 0x0
2101#define CARCOUNT 0x40000 /* Clear auto-refresh count */ 1946#define CARCOUNT 0x40000 /* Clear auto-refresh count */
2102#define nCARCOUNT 0x0
2103#define CG0COUNT 0x100000 /* Clear grant count 0 */ 1947#define CG0COUNT 0x100000 /* Clear grant count 0 */
2104#define nCG0COUNT 0x0
2105#define CG1COUNT 0x200000 /* Clear grant count 1 */ 1948#define CG1COUNT 0x200000 /* Clear grant count 1 */
2106#define nCG1COUNT 0x0
2107#define CG2COUNT 0x400000 /* Clear grant count 2 */ 1949#define CG2COUNT 0x400000 /* Clear grant count 2 */
2108#define nCG2COUNT 0x0
2109#define CG3COUNT 0x800000 /* Clear grant count 3 */ 1950#define CG3COUNT 0x800000 /* Clear grant count 3 */
2110#define nCG3COUNT 0x0
2111 1951
2112/* Bit masks for (PORTx is PORTA - PORTJ) includes PORTx_FER, PORTx_SET, PORTx_CLEAR, PORTx_DIR_SET, PORTx_DIR_CLEAR, PORTx_INEN */ 1952/* Bit masks for (PORTx is PORTA - PORTJ) includes PORTx_FER, PORTx_SET, PORTx_CLEAR, PORTx_DIR_SET, PORTx_DIR_CLEAR, PORTx_INEN */
2113 1953
2114#define Px0 0x1 /* GPIO 0 */ 1954#define Px0 0x1 /* GPIO 0 */
2115#define nPx0 0x0
2116#define Px1 0x2 /* GPIO 1 */ 1955#define Px1 0x2 /* GPIO 1 */
2117#define nPx1 0x0
2118#define Px2 0x4 /* GPIO 2 */ 1956#define Px2 0x4 /* GPIO 2 */
2119#define nPx2 0x0
2120#define Px3 0x8 /* GPIO 3 */ 1957#define Px3 0x8 /* GPIO 3 */
2121#define nPx3 0x0
2122#define Px4 0x10 /* GPIO 4 */ 1958#define Px4 0x10 /* GPIO 4 */
2123#define nPx4 0x0
2124#define Px5 0x20 /* GPIO 5 */ 1959#define Px5 0x20 /* GPIO 5 */
2125#define nPx5 0x0
2126#define Px6 0x40 /* GPIO 6 */ 1960#define Px6 0x40 /* GPIO 6 */
2127#define nPx6 0x0
2128#define Px7 0x80 /* GPIO 7 */ 1961#define Px7 0x80 /* GPIO 7 */
2129#define nPx7 0x0
2130#define Px8 0x100 /* GPIO 8 */ 1962#define Px8 0x100 /* GPIO 8 */
2131#define nPx8 0x0
2132#define Px9 0x200 /* GPIO 9 */ 1963#define Px9 0x200 /* GPIO 9 */
2133#define nPx9 0x0
2134#define Px10 0x400 /* GPIO 10 */ 1964#define Px10 0x400 /* GPIO 10 */
2135#define nPx10 0x0
2136#define Px11 0x800 /* GPIO 11 */ 1965#define Px11 0x800 /* GPIO 11 */
2137#define nPx11 0x0
2138#define Px12 0x1000 /* GPIO 12 */ 1966#define Px12 0x1000 /* GPIO 12 */
2139#define nPx12 0x0
2140#define Px13 0x2000 /* GPIO 13 */ 1967#define Px13 0x2000 /* GPIO 13 */
2141#define nPx13 0x0
2142#define Px14 0x4000 /* GPIO 14 */ 1968#define Px14 0x4000 /* GPIO 14 */
2143#define nPx14 0x0
2144#define Px15 0x8000 /* GPIO 15 */ 1969#define Px15 0x8000 /* GPIO 15 */
2145#define nPx15 0x0
2146 1970
2147/* Bit masks for PORTA_MUX - PORTJ_MUX */ 1971/* Bit masks for PORTA_MUX - PORTJ_MUX */
2148 1972
@@ -2167,223 +1991,129 @@
2167/* Bit masks for PINTx_MASK_SET/CLEAR, PINTx_REQUEST, PINTx_LATCH, PINTx_EDGE_SET/CLEAR, PINTx_INVERT_SET/CLEAR, PINTx_PINTSTATE */ 1991/* Bit masks for PINTx_MASK_SET/CLEAR, PINTx_REQUEST, PINTx_LATCH, PINTx_EDGE_SET/CLEAR, PINTx_INVERT_SET/CLEAR, PINTx_PINTSTATE */
2168 1992
2169#define IB0 0x1 /* Interrupt Bit 0 */ 1993#define IB0 0x1 /* Interrupt Bit 0 */
2170#define nIB0 0x0
2171#define IB1 0x2 /* Interrupt Bit 1 */ 1994#define IB1 0x2 /* Interrupt Bit 1 */
2172#define nIB1 0x0
2173#define IB2 0x4 /* Interrupt Bit 2 */ 1995#define IB2 0x4 /* Interrupt Bit 2 */
2174#define nIB2 0x0
2175#define IB3 0x8 /* Interrupt Bit 3 */ 1996#define IB3 0x8 /* Interrupt Bit 3 */
2176#define nIB3 0x0
2177#define IB4 0x10 /* Interrupt Bit 4 */ 1997#define IB4 0x10 /* Interrupt Bit 4 */
2178#define nIB4 0x0
2179#define IB5 0x20 /* Interrupt Bit 5 */ 1998#define IB5 0x20 /* Interrupt Bit 5 */
2180#define nIB5 0x0
2181#define IB6 0x40 /* Interrupt Bit 6 */ 1999#define IB6 0x40 /* Interrupt Bit 6 */
2182#define nIB6 0x0
2183#define IB7 0x80 /* Interrupt Bit 7 */ 2000#define IB7 0x80 /* Interrupt Bit 7 */
2184#define nIB7 0x0
2185#define IB8 0x100 /* Interrupt Bit 8 */ 2001#define IB8 0x100 /* Interrupt Bit 8 */
2186#define nIB8 0x0
2187#define IB9 0x200 /* Interrupt Bit 9 */ 2002#define IB9 0x200 /* Interrupt Bit 9 */
2188#define nIB9 0x0
2189#define IB10 0x400 /* Interrupt Bit 10 */ 2003#define IB10 0x400 /* Interrupt Bit 10 */
2190#define nIB10 0x0
2191#define IB11 0x800 /* Interrupt Bit 11 */ 2004#define IB11 0x800 /* Interrupt Bit 11 */
2192#define nIB11 0x0
2193#define IB12 0x1000 /* Interrupt Bit 12 */ 2005#define IB12 0x1000 /* Interrupt Bit 12 */
2194#define nIB12 0x0
2195#define IB13 0x2000 /* Interrupt Bit 13 */ 2006#define IB13 0x2000 /* Interrupt Bit 13 */
2196#define nIB13 0x0
2197#define IB14 0x4000 /* Interrupt Bit 14 */ 2007#define IB14 0x4000 /* Interrupt Bit 14 */
2198#define nIB14 0x0
2199#define IB15 0x8000 /* Interrupt Bit 15 */ 2008#define IB15 0x8000 /* Interrupt Bit 15 */
2200#define nIB15 0x0
2201 2009
2202/* Bit masks for TIMERx_CONFIG */ 2010/* Bit masks for TIMERx_CONFIG */
2203 2011
2204#define TMODE 0x3 /* Timer Mode */ 2012#define TMODE 0x3 /* Timer Mode */
2205#define PULSE_HI 0x4 /* Pulse Polarity */ 2013#define PULSE_HI 0x4 /* Pulse Polarity */
2206#define nPULSE_HI 0x0
2207#define PERIOD_CNT 0x8 /* Period Count */ 2014#define PERIOD_CNT 0x8 /* Period Count */
2208#define nPERIOD_CNT 0x0
2209#define IRQ_ENA 0x10 /* Interrupt Request Enable */ 2015#define IRQ_ENA 0x10 /* Interrupt Request Enable */
2210#define nIRQ_ENA 0x0
2211#define TIN_SEL 0x20 /* Timer Input Select */ 2016#define TIN_SEL 0x20 /* Timer Input Select */
2212#define nTIN_SEL 0x0
2213#define OUT_DIS 0x40 /* Output Pad Disable */ 2017#define OUT_DIS 0x40 /* Output Pad Disable */
2214#define nOUT_DIS 0x0
2215#define CLK_SEL 0x80 /* Timer Clock Select */ 2018#define CLK_SEL 0x80 /* Timer Clock Select */
2216#define nCLK_SEL 0x0
2217#define TOGGLE_HI 0x100 /* Toggle Mode */ 2019#define TOGGLE_HI 0x100 /* Toggle Mode */
2218#define nTOGGLE_HI 0x0
2219#define EMU_RUN 0x200 /* Emulation Behavior Select */ 2020#define EMU_RUN 0x200 /* Emulation Behavior Select */
2220#define nEMU_RUN 0x0
2221#define ERR_TYP 0xc000 /* Error Type */ 2021#define ERR_TYP 0xc000 /* Error Type */
2222 2022
2223/* Bit masks for TIMER_ENABLE0 */ 2023/* Bit masks for TIMER_ENABLE0 */
2224 2024
2225#define TIMEN0 0x1 /* Timer 0 Enable */ 2025#define TIMEN0 0x1 /* Timer 0 Enable */
2226#define nTIMEN0 0x0
2227#define TIMEN1 0x2 /* Timer 1 Enable */ 2026#define TIMEN1 0x2 /* Timer 1 Enable */
2228#define nTIMEN1 0x0
2229#define TIMEN2 0x4 /* Timer 2 Enable */ 2027#define TIMEN2 0x4 /* Timer 2 Enable */
2230#define nTIMEN2 0x0
2231#define TIMEN3 0x8 /* Timer 3 Enable */ 2028#define TIMEN3 0x8 /* Timer 3 Enable */
2232#define nTIMEN3 0x0
2233#define TIMEN4 0x10 /* Timer 4 Enable */ 2029#define TIMEN4 0x10 /* Timer 4 Enable */
2234#define nTIMEN4 0x0
2235#define TIMEN5 0x20 /* Timer 5 Enable */ 2030#define TIMEN5 0x20 /* Timer 5 Enable */
2236#define nTIMEN5 0x0
2237#define TIMEN6 0x40 /* Timer 6 Enable */ 2031#define TIMEN6 0x40 /* Timer 6 Enable */
2238#define nTIMEN6 0x0
2239#define TIMEN7 0x80 /* Timer 7 Enable */ 2032#define TIMEN7 0x80 /* Timer 7 Enable */
2240#define nTIMEN7 0x0
2241 2033
2242/* Bit masks for TIMER_DISABLE0 */ 2034/* Bit masks for TIMER_DISABLE0 */
2243 2035
2244#define TIMDIS0 0x1 /* Timer 0 Disable */ 2036#define TIMDIS0 0x1 /* Timer 0 Disable */
2245#define nTIMDIS0 0x0
2246#define TIMDIS1 0x2 /* Timer 1 Disable */ 2037#define TIMDIS1 0x2 /* Timer 1 Disable */
2247#define nTIMDIS1 0x0
2248#define TIMDIS2 0x4 /* Timer 2 Disable */ 2038#define TIMDIS2 0x4 /* Timer 2 Disable */
2249#define nTIMDIS2 0x0
2250#define TIMDIS3 0x8 /* Timer 3 Disable */ 2039#define TIMDIS3 0x8 /* Timer 3 Disable */
2251#define nTIMDIS3 0x0
2252#define TIMDIS4 0x10 /* Timer 4 Disable */ 2040#define TIMDIS4 0x10 /* Timer 4 Disable */
2253#define nTIMDIS4 0x0
2254#define TIMDIS5 0x20 /* Timer 5 Disable */ 2041#define TIMDIS5 0x20 /* Timer 5 Disable */
2255#define nTIMDIS5 0x0
2256#define TIMDIS6 0x40 /* Timer 6 Disable */ 2042#define TIMDIS6 0x40 /* Timer 6 Disable */
2257#define nTIMDIS6 0x0
2258#define TIMDIS7 0x80 /* Timer 7 Disable */ 2043#define TIMDIS7 0x80 /* Timer 7 Disable */
2259#define nTIMDIS7 0x0
2260 2044
2261/* Bit masks for TIMER_STATUS0 */ 2045/* Bit masks for TIMER_STATUS0 */
2262 2046
2263#define TIMIL0 0x1 /* Timer 0 Interrupt */ 2047#define TIMIL0 0x1 /* Timer 0 Interrupt */
2264#define nTIMIL0 0x0
2265#define TIMIL1 0x2 /* Timer 1 Interrupt */ 2048#define TIMIL1 0x2 /* Timer 1 Interrupt */
2266#define nTIMIL1 0x0
2267#define TIMIL2 0x4 /* Timer 2 Interrupt */ 2049#define TIMIL2 0x4 /* Timer 2 Interrupt */
2268#define nTIMIL2 0x0
2269#define TIMIL3 0x8 /* Timer 3 Interrupt */ 2050#define TIMIL3 0x8 /* Timer 3 Interrupt */
2270#define nTIMIL3 0x0
2271#define TOVF_ERR0 0x10 /* Timer 0 Counter Overflow */ 2051#define TOVF_ERR0 0x10 /* Timer 0 Counter Overflow */
2272#define nTOVF_ERR0 0x0
2273#define TOVF_ERR1 0x20 /* Timer 1 Counter Overflow */ 2052#define TOVF_ERR1 0x20 /* Timer 1 Counter Overflow */
2274#define nTOVF_ERR1 0x0
2275#define TOVF_ERR2 0x40 /* Timer 2 Counter Overflow */ 2053#define TOVF_ERR2 0x40 /* Timer 2 Counter Overflow */
2276#define nTOVF_ERR2 0x0
2277#define TOVF_ERR3 0x80 /* Timer 3 Counter Overflow */ 2054#define TOVF_ERR3 0x80 /* Timer 3 Counter Overflow */
2278#define nTOVF_ERR3 0x0
2279#define TRUN0 0x1000 /* Timer 0 Slave Enable Status */ 2055#define TRUN0 0x1000 /* Timer 0 Slave Enable Status */
2280#define nTRUN0 0x0
2281#define TRUN1 0x2000 /* Timer 1 Slave Enable Status */ 2056#define TRUN1 0x2000 /* Timer 1 Slave Enable Status */
2282#define nTRUN1 0x0
2283#define TRUN2 0x4000 /* Timer 2 Slave Enable Status */ 2057#define TRUN2 0x4000 /* Timer 2 Slave Enable Status */
2284#define nTRUN2 0x0
2285#define TRUN3 0x8000 /* Timer 3 Slave Enable Status */ 2058#define TRUN3 0x8000 /* Timer 3 Slave Enable Status */
2286#define nTRUN3 0x0
2287#define TIMIL4 0x10000 /* Timer 4 Interrupt */ 2059#define TIMIL4 0x10000 /* Timer 4 Interrupt */
2288#define nTIMIL4 0x0
2289#define TIMIL5 0x20000 /* Timer 5 Interrupt */ 2060#define TIMIL5 0x20000 /* Timer 5 Interrupt */
2290#define nTIMIL5 0x0
2291#define TIMIL6 0x40000 /* Timer 6 Interrupt */ 2061#define TIMIL6 0x40000 /* Timer 6 Interrupt */
2292#define nTIMIL6 0x0
2293#define TIMIL7 0x80000 /* Timer 7 Interrupt */ 2062#define TIMIL7 0x80000 /* Timer 7 Interrupt */
2294#define nTIMIL7 0x0
2295#define TOVF_ERR4 0x100000 /* Timer 4 Counter Overflow */ 2063#define TOVF_ERR4 0x100000 /* Timer 4 Counter Overflow */
2296#define nTOVF_ERR4 0x0
2297#define TOVF_ERR5 0x200000 /* Timer 5 Counter Overflow */ 2064#define TOVF_ERR5 0x200000 /* Timer 5 Counter Overflow */
2298#define nTOVF_ERR5 0x0
2299#define TOVF_ERR6 0x400000 /* Timer 6 Counter Overflow */ 2065#define TOVF_ERR6 0x400000 /* Timer 6 Counter Overflow */
2300#define nTOVF_ERR6 0x0
2301#define TOVF_ERR7 0x800000 /* Timer 7 Counter Overflow */ 2066#define TOVF_ERR7 0x800000 /* Timer 7 Counter Overflow */
2302#define nTOVF_ERR7 0x0
2303#define TRUN4 0x10000000 /* Timer 4 Slave Enable Status */ 2067#define TRUN4 0x10000000 /* Timer 4 Slave Enable Status */
2304#define nTRUN4 0x0
2305#define TRUN5 0x20000000 /* Timer 5 Slave Enable Status */ 2068#define TRUN5 0x20000000 /* Timer 5 Slave Enable Status */
2306#define nTRUN5 0x0
2307#define TRUN6 0x40000000 /* Timer 6 Slave Enable Status */ 2069#define TRUN6 0x40000000 /* Timer 6 Slave Enable Status */
2308#define nTRUN6 0x0
2309#define TRUN7 0x80000000 /* Timer 7 Slave Enable Status */ 2070#define TRUN7 0x80000000 /* Timer 7 Slave Enable Status */
2310#define nTRUN7 0x0
2311 2071
2312/* Bit masks for WDOG_CTL */ 2072/* Bit masks for WDOG_CTL */
2313 2073
2314#define WDEV 0x6 /* Watchdog Event */ 2074#define WDEV 0x6 /* Watchdog Event */
2315#define WDEN 0xff0 /* Watchdog Enable */ 2075#define WDEN 0xff0 /* Watchdog Enable */
2316#define WDRO 0x8000 /* Watchdog Rolled Over */ 2076#define WDRO 0x8000 /* Watchdog Rolled Over */
2317#define nWDRO 0x0
2318 2077
2319/* Bit masks for CNT_CONFIG */ 2078/* Bit masks for CNT_CONFIG */
2320 2079
2321#define CNTE 0x1 /* Counter Enable */ 2080#define CNTE 0x1 /* Counter Enable */
2322#define nCNTE 0x0
2323#define DEBE 0x2 /* Debounce Enable */ 2081#define DEBE 0x2 /* Debounce Enable */
2324#define nDEBE 0x0
2325#define CDGINV 0x10 /* CDG Pin Polarity Invert */ 2082#define CDGINV 0x10 /* CDG Pin Polarity Invert */
2326#define nCDGINV 0x0
2327#define CUDINV 0x20 /* CUD Pin Polarity Invert */ 2083#define CUDINV 0x20 /* CUD Pin Polarity Invert */
2328#define nCUDINV 0x0
2329#define CZMINV 0x40 /* CZM Pin Polarity Invert */ 2084#define CZMINV 0x40 /* CZM Pin Polarity Invert */
2330#define nCZMINV 0x0
2331#define CNTMODE 0x700 /* Counter Operating Mode */ 2085#define CNTMODE 0x700 /* Counter Operating Mode */
2332#define ZMZC 0x800 /* CZM Zeroes Counter Enable */ 2086#define ZMZC 0x800 /* CZM Zeroes Counter Enable */
2333#define nZMZC 0x0
2334#define BNDMODE 0x3000 /* Boundary register Mode */ 2087#define BNDMODE 0x3000 /* Boundary register Mode */
2335#define INPDIS 0x8000 /* CUG and CDG Input Disable */ 2088#define INPDIS 0x8000 /* CUG and CDG Input Disable */
2336#define nINPDIS 0x0
2337 2089
2338/* Bit masks for CNT_IMASK */ 2090/* Bit masks for CNT_IMASK */
2339 2091
2340#define ICIE 0x1 /* Illegal Gray/Binary Code Interrupt Enable */ 2092#define ICIE 0x1 /* Illegal Gray/Binary Code Interrupt Enable */
2341#define nICIE 0x0
2342#define UCIE 0x2 /* Up count Interrupt Enable */ 2093#define UCIE 0x2 /* Up count Interrupt Enable */
2343#define nUCIE 0x0
2344#define DCIE 0x4 /* Down count Interrupt Enable */ 2094#define DCIE 0x4 /* Down count Interrupt Enable */
2345#define nDCIE 0x0
2346#define MINCIE 0x8 /* Min Count Interrupt Enable */ 2095#define MINCIE 0x8 /* Min Count Interrupt Enable */
2347#define nMINCIE 0x0
2348#define MAXCIE 0x10 /* Max Count Interrupt Enable */ 2096#define MAXCIE 0x10 /* Max Count Interrupt Enable */
2349#define nMAXCIE 0x0
2350#define COV31IE 0x20 /* Bit 31 Overflow Interrupt Enable */ 2097#define COV31IE 0x20 /* Bit 31 Overflow Interrupt Enable */
2351#define nCOV31IE 0x0
2352#define COV15IE 0x40 /* Bit 15 Overflow Interrupt Enable */ 2098#define COV15IE 0x40 /* Bit 15 Overflow Interrupt Enable */
2353#define nCOV15IE 0x0
2354#define CZEROIE 0x80 /* Count to Zero Interrupt Enable */ 2099#define CZEROIE 0x80 /* Count to Zero Interrupt Enable */
2355#define nCZEROIE 0x0
2356#define CZMIE 0x100 /* CZM Pin Interrupt Enable */ 2100#define CZMIE 0x100 /* CZM Pin Interrupt Enable */
2357#define nCZMIE 0x0
2358#define CZMEIE 0x200 /* CZM Error Interrupt Enable */ 2101#define CZMEIE 0x200 /* CZM Error Interrupt Enable */
2359#define nCZMEIE 0x0
2360#define CZMZIE 0x400 /* CZM Zeroes Counter Interrupt Enable */ 2102#define CZMZIE 0x400 /* CZM Zeroes Counter Interrupt Enable */
2361#define nCZMZIE 0x0
2362 2103
2363/* Bit masks for CNT_STATUS */ 2104/* Bit masks for CNT_STATUS */
2364 2105
2365#define ICII 0x1 /* Illegal Gray/Binary Code Interrupt Identifier */ 2106#define ICII 0x1 /* Illegal Gray/Binary Code Interrupt Identifier */
2366#define nICII 0x0
2367#define UCII 0x2 /* Up count Interrupt Identifier */ 2107#define UCII 0x2 /* Up count Interrupt Identifier */
2368#define nUCII 0x0
2369#define DCII 0x4 /* Down count Interrupt Identifier */ 2108#define DCII 0x4 /* Down count Interrupt Identifier */
2370#define nDCII 0x0
2371#define MINCII 0x8 /* Min Count Interrupt Identifier */ 2109#define MINCII 0x8 /* Min Count Interrupt Identifier */
2372#define nMINCII 0x0
2373#define MAXCII 0x10 /* Max Count Interrupt Identifier */ 2110#define MAXCII 0x10 /* Max Count Interrupt Identifier */
2374#define nMAXCII 0x0
2375#define COV31II 0x20 /* Bit 31 Overflow Interrupt Identifier */ 2111#define COV31II 0x20 /* Bit 31 Overflow Interrupt Identifier */
2376#define nCOV31II 0x0
2377#define COV15II 0x40 /* Bit 15 Overflow Interrupt Identifier */ 2112#define COV15II 0x40 /* Bit 15 Overflow Interrupt Identifier */
2378#define nCOV15II 0x0
2379#define CZEROII 0x80 /* Count to Zero Interrupt Identifier */ 2113#define CZEROII 0x80 /* Count to Zero Interrupt Identifier */
2380#define nCZEROII 0x0
2381#define CZMII 0x100 /* CZM Pin Interrupt Identifier */ 2114#define CZMII 0x100 /* CZM Pin Interrupt Identifier */
2382#define nCZMII 0x0
2383#define CZMEII 0x200 /* CZM Error Interrupt Identifier */ 2115#define CZMEII 0x200 /* CZM Error Interrupt Identifier */
2384#define nCZMEII 0x0
2385#define CZMZII 0x400 /* CZM Zeroes Counter Interrupt Identifier */ 2116#define CZMZII 0x400 /* CZM Zeroes Counter Interrupt Identifier */
2386#define nCZMZII 0x0
2387 2117
2388/* Bit masks for CNT_COMMAND */ 2118/* Bit masks for CNT_COMMAND */
2389 2119
@@ -2391,7 +2121,6 @@
2391#define W1LMIN 0xf0 /* Load Min Register */ 2121#define W1LMIN 0xf0 /* Load Min Register */
2392#define W1LMAX 0xf00 /* Load Max Register */ 2122#define W1LMAX 0xf00 /* Load Max Register */
2393#define W1ZMONCE 0x1000 /* Enable CZM Clear Counter Once */ 2123#define W1ZMONCE 0x1000 /* Enable CZM Clear Counter Once */
2394#define nW1ZMONCE 0x0
2395 2124
2396/* Bit masks for CNT_DEBOUNCE */ 2125/* Bit masks for CNT_DEBOUNCE */
2397 2126
@@ -2407,42 +2136,25 @@
2407/* Bit masks for RTC_ICTL */ 2136/* Bit masks for RTC_ICTL */
2408 2137
2409#define STOPWATCH_INTERRUPT_ENABLE 0x1 /* Stopwatch Interrupt Enable */ 2138#define STOPWATCH_INTERRUPT_ENABLE 0x1 /* Stopwatch Interrupt Enable */
2410#define nSTOPWATCH_INTERRUPT_ENABLE 0x0
2411#define ALARM_INTERRUPT_ENABLE 0x2 /* Alarm Interrupt Enable */ 2139#define ALARM_INTERRUPT_ENABLE 0x2 /* Alarm Interrupt Enable */
2412#define nALARM_INTERRUPT_ENABLE 0x0
2413#define SECONDS_INTERRUPT_ENABLE 0x4 /* Seconds Interrupt Enable */ 2140#define SECONDS_INTERRUPT_ENABLE 0x4 /* Seconds Interrupt Enable */
2414#define nSECONDS_INTERRUPT_ENABLE 0x0
2415#define MINUTES_INTERRUPT_ENABLE 0x8 /* Minutes Interrupt Enable */ 2141#define MINUTES_INTERRUPT_ENABLE 0x8 /* Minutes Interrupt Enable */
2416#define nMINUTES_INTERRUPT_ENABLE 0x0
2417#define HOURS_INTERRUPT_ENABLE 0x10 /* Hours Interrupt Enable */ 2142#define HOURS_INTERRUPT_ENABLE 0x10 /* Hours Interrupt Enable */
2418#define nHOURS_INTERRUPT_ENABLE 0x0
2419#define TWENTY_FOUR_HOURS_INTERRUPT_ENABLE 0x20 /* 24 Hours Interrupt Enable */ 2143#define TWENTY_FOUR_HOURS_INTERRUPT_ENABLE 0x20 /* 24 Hours Interrupt Enable */
2420#define nTWENTY_FOUR_HOURS_INTERRUPT_ENABLE 0x0
2421#define DAY_ALARM_INTERRUPT_ENABLE 0x40 /* Day Alarm Interrupt Enable */ 2144#define DAY_ALARM_INTERRUPT_ENABLE 0x40 /* Day Alarm Interrupt Enable */
2422#define nDAY_ALARM_INTERRUPT_ENABLE 0x0
2423#define WRITE_COMPLETE_INTERRUPT_ENABLE 0x8000 /* Write Complete Interrupt Enable */ 2145#define WRITE_COMPLETE_INTERRUPT_ENABLE 0x8000 /* Write Complete Interrupt Enable */
2424#define nWRITE_COMPLETE_INTERRUPT_ENABLE 0x0
2425 2146
2426/* Bit masks for RTC_ISTAT */ 2147/* Bit masks for RTC_ISTAT */
2427 2148
2428#define STOPWATCH_EVENT_FLAG 0x1 /* Stopwatch Event Flag */ 2149#define STOPWATCH_EVENT_FLAG 0x1 /* Stopwatch Event Flag */
2429#define nSTOPWATCH_EVENT_FLAG 0x0
2430#define ALARM_EVENT_FLAG 0x2 /* Alarm Event Flag */ 2150#define ALARM_EVENT_FLAG 0x2 /* Alarm Event Flag */
2431#define nALARM_EVENT_FLAG 0x0
2432#define SECONDS_EVENT_FLAG 0x4 /* Seconds Event Flag */ 2151#define SECONDS_EVENT_FLAG 0x4 /* Seconds Event Flag */
2433#define nSECONDS_EVENT_FLAG 0x0
2434#define MINUTES_EVENT_FLAG 0x8 /* Minutes Event Flag */ 2152#define MINUTES_EVENT_FLAG 0x8 /* Minutes Event Flag */
2435#define nMINUTES_EVENT_FLAG 0x0
2436#define HOURS_EVENT_FLAG 0x10 /* Hours Event Flag */ 2153#define HOURS_EVENT_FLAG 0x10 /* Hours Event Flag */
2437#define nHOURS_EVENT_FLAG 0x0
2438#define TWENTY_FOUR_HOURS_EVENT_FLAG 0x20 /* 24 Hours Event Flag */ 2154#define TWENTY_FOUR_HOURS_EVENT_FLAG 0x20 /* 24 Hours Event Flag */
2439#define nTWENTY_FOUR_HOURS_EVENT_FLAG 0x0
2440#define DAY_ALARM_EVENT_FLAG 0x40 /* Day Alarm Event Flag */ 2155#define DAY_ALARM_EVENT_FLAG 0x40 /* Day Alarm Event Flag */
2441#define nDAY_ALARM_EVENT_FLAG 0x0
2442#define WRITE_PENDING__STATUS 0x4000 /* Write Pending Status */ 2156#define WRITE_PENDING__STATUS 0x4000 /* Write Pending Status */
2443#define nWRITE_PENDING__STATUS 0x0
2444#define WRITE_COMPLETE 0x8000 /* Write Complete */ 2157#define WRITE_COMPLETE 0x8000 /* Write Complete */
2445#define nWRITE_COMPLETE 0x0
2446 2158
2447/* Bit masks for RTC_SWCNT */ 2159/* Bit masks for RTC_SWCNT */
2448 2160
@@ -2458,21 +2170,15 @@
2458/* Bit masks for RTC_PREN */ 2170/* Bit masks for RTC_PREN */
2459 2171
2460#define PREN 0x1 /* Prescaler Enable */ 2172#define PREN 0x1 /* Prescaler Enable */
2461#define nPREN 0x0
2462 2173
2463/* Bit masks for OTP_CONTROL */ 2174/* Bit masks for OTP_CONTROL */
2464 2175
2465#define FUSE_FADDR 0x1ff /* OTP/Fuse Address */ 2176#define FUSE_FADDR 0x1ff /* OTP/Fuse Address */
2466#define FIEN 0x800 /* OTP/Fuse Interrupt Enable */ 2177#define FIEN 0x800 /* OTP/Fuse Interrupt Enable */
2467#define nFIEN 0x0
2468#define FTESTDEC 0x1000 /* OTP/Fuse Test Decoder */ 2178#define FTESTDEC 0x1000 /* OTP/Fuse Test Decoder */
2469#define nFTESTDEC 0x0
2470#define FWRTEST 0x2000 /* OTP/Fuse Write Test */ 2179#define FWRTEST 0x2000 /* OTP/Fuse Write Test */
2471#define nFWRTEST 0x0
2472#define FRDEN 0x4000 /* OTP/Fuse Read Enable */ 2180#define FRDEN 0x4000 /* OTP/Fuse Read Enable */
2473#define nFRDEN 0x0
2474#define FWREN 0x8000 /* OTP/Fuse Write Enable */ 2181#define FWREN 0x8000 /* OTP/Fuse Write Enable */
2475#define nFWREN 0x0
2476 2182
2477/* Bit masks for OTP_BEN */ 2183/* Bit masks for OTP_BEN */
2478 2184
@@ -2481,15 +2187,10 @@
2481/* Bit masks for OTP_STATUS */ 2187/* Bit masks for OTP_STATUS */
2482 2188
2483#define FCOMP 0x1 /* OTP/Fuse Access Complete */ 2189#define FCOMP 0x1 /* OTP/Fuse Access Complete */
2484#define nFCOMP 0x0
2485#define FERROR 0x2 /* OTP/Fuse Access Error */ 2190#define FERROR 0x2 /* OTP/Fuse Access Error */
2486#define nFERROR 0x0
2487#define MMRGLOAD 0x10 /* Memory Mapped Register Gasket Load */ 2191#define MMRGLOAD 0x10 /* Memory Mapped Register Gasket Load */
2488#define nMMRGLOAD 0x0
2489#define MMRGLOCK 0x20 /* Memory Mapped Register Gasket Lock */ 2192#define MMRGLOCK 0x20 /* Memory Mapped Register Gasket Lock */
2490#define nMMRGLOCK 0x0
2491#define FPGMEN 0x40 /* OTP/Fuse Program Enable */ 2193#define FPGMEN 0x40 /* OTP/Fuse Program Enable */
2492#define nFPGMEN 0x0
2493 2194
2494/* Bit masks for OTP_TIMING */ 2195/* Bit masks for OTP_TIMING */
2495 2196
@@ -2503,42 +2204,29 @@
2503/* Bit masks for SECURE_SYSSWT */ 2204/* Bit masks for SECURE_SYSSWT */
2504 2205
2505#define EMUDABL 0x1 /* Emulation Disable. */ 2206#define EMUDABL 0x1 /* Emulation Disable. */
2506#define nEMUDABL 0x0
2507#define RSTDABL 0x2 /* Reset Disable */ 2207#define RSTDABL 0x2 /* Reset Disable */
2508#define nRSTDABL 0x0
2509#define L1IDABL 0x1c /* L1 Instruction Memory Disable. */ 2208#define L1IDABL 0x1c /* L1 Instruction Memory Disable. */
2510#define L1DADABL 0xe0 /* L1 Data Bank A Memory Disable. */ 2209#define L1DADABL 0xe0 /* L1 Data Bank A Memory Disable. */
2511#define L1DBDABL 0x700 /* L1 Data Bank B Memory Disable. */ 2210#define L1DBDABL 0x700 /* L1 Data Bank B Memory Disable. */
2512#define DMA0OVR 0x800 /* DMA0 Memory Access Override */ 2211#define DMA0OVR 0x800 /* DMA0 Memory Access Override */
2513#define nDMA0OVR 0x0
2514#define DMA1OVR 0x1000 /* DMA1 Memory Access Override */ 2212#define DMA1OVR 0x1000 /* DMA1 Memory Access Override */
2515#define nDMA1OVR 0x0
2516#define EMUOVR 0x4000 /* Emulation Override */ 2213#define EMUOVR 0x4000 /* Emulation Override */
2517#define nEMUOVR 0x0
2518#define OTPSEN 0x8000 /* OTP Secrets Enable. */ 2214#define OTPSEN 0x8000 /* OTP Secrets Enable. */
2519#define nOTPSEN 0x0
2520#define L2DABL 0x70000 /* L2 Memory Disable. */ 2215#define L2DABL 0x70000 /* L2 Memory Disable. */
2521 2216
2522/* Bit masks for SECURE_CONTROL */ 2217/* Bit masks for SECURE_CONTROL */
2523 2218
2524#define SECURE0 0x1 /* SECURE 0 */ 2219#define SECURE0 0x1 /* SECURE 0 */
2525#define nSECURE0 0x0
2526#define SECURE1 0x2 /* SECURE 1 */ 2220#define SECURE1 0x2 /* SECURE 1 */
2527#define nSECURE1 0x0
2528#define SECURE2 0x4 /* SECURE 2 */ 2221#define SECURE2 0x4 /* SECURE 2 */
2529#define nSECURE2 0x0
2530#define SECURE3 0x8 /* SECURE 3 */ 2222#define SECURE3 0x8 /* SECURE 3 */
2531#define nSECURE3 0x0
2532 2223
2533/* Bit masks for SECURE_STATUS */ 2224/* Bit masks for SECURE_STATUS */
2534 2225
2535#define SECMODE 0x3 /* Secured Mode Control State */ 2226#define SECMODE 0x3 /* Secured Mode Control State */
2536#define NMI 0x4 /* Non Maskable Interrupt */ 2227#define NMI 0x4 /* Non Maskable Interrupt */
2537#define nNMI 0x0
2538#define AFVALID 0x8 /* Authentication Firmware Valid */ 2228#define AFVALID 0x8 /* Authentication Firmware Valid */
2539#define nAFVALID 0x0
2540#define AFEXIT 0x10 /* Authentication Firmware Exit */ 2229#define AFEXIT 0x10 /* Authentication Firmware Exit */
2541#define nAFEXIT 0x0
2542#define SECSTAT 0xe0 /* Secure Status */ 2230#define SECSTAT 0xe0 /* Secure Status */
2543 2231
2544/* Bit masks for PLL_DIV */ 2232/* Bit masks for PLL_DIV */
@@ -2550,42 +2238,25 @@
2550 2238
2551#define MSEL 0x7e00 /* Multiplier Select */ 2239#define MSEL 0x7e00 /* Multiplier Select */
2552#define BYPASS 0x100 /* PLL Bypass Enable */ 2240#define BYPASS 0x100 /* PLL Bypass Enable */
2553#define nBYPASS 0x0
2554#define OUTPUT_DELAY 0x80 /* External Memory Output Delay Enable */ 2241#define OUTPUT_DELAY 0x80 /* External Memory Output Delay Enable */
2555#define nOUTPUT_DELAY 0x0
2556#define INPUT_DELAY 0x40 /* External Memory Input Delay Enable */ 2242#define INPUT_DELAY 0x40 /* External Memory Input Delay Enable */
2557#define nINPUT_DELAY 0x0
2558#define PDWN 0x20 /* Power Down */ 2243#define PDWN 0x20 /* Power Down */
2559#define nPDWN 0x0
2560#define STOPCK 0x8 /* Stop Clock */ 2244#define STOPCK 0x8 /* Stop Clock */
2561#define nSTOPCK 0x0
2562#define PLL_OFF 0x2 /* Disable PLL */ 2245#define PLL_OFF 0x2 /* Disable PLL */
2563#define nPLL_OFF 0x0
2564#define DF 0x1 /* Divide Frequency */ 2246#define DF 0x1 /* Divide Frequency */
2565#define nDF 0x0
2566 2247
2567/* Bit masks for PLL_STAT */ 2248/* Bit masks for PLL_STAT */
2568 2249
2569#define PLL_LOCKED 0x20 /* PLL Locked Status */ 2250#define PLL_LOCKED 0x20 /* PLL Locked Status */
2570#define nPLL_LOCKED 0x0
2571#define ACTIVE_PLLDISABLED 0x4 /* Active Mode With PLL Disabled */ 2251#define ACTIVE_PLLDISABLED 0x4 /* Active Mode With PLL Disabled */
2572#define nACTIVE_PLLDISABLED 0x0
2573#define FULL_ON 0x2 /* Full-On Mode */ 2252#define FULL_ON 0x2 /* Full-On Mode */
2574#define nFULL_ON 0x0
2575#define ACTIVE_PLLENABLED 0x1 /* Active Mode With PLL Enabled */ 2253#define ACTIVE_PLLENABLED 0x1 /* Active Mode With PLL Enabled */
2576#define nACTIVE_PLLENABLED 0x0
2577#define RTCWS 0x400 /* RTC/Reset Wake-Up Status */ 2254#define RTCWS 0x400 /* RTC/Reset Wake-Up Status */
2578#define nRTCWS 0x0
2579#define CANWS 0x800 /* CAN Wake-Up Status */ 2255#define CANWS 0x800 /* CAN Wake-Up Status */
2580#define nCANWS 0x0
2581#define USBWS 0x2000 /* USB Wake-Up Status */ 2256#define USBWS 0x2000 /* USB Wake-Up Status */
2582#define nUSBWS 0x0
2583#define KPADWS 0x4000 /* Keypad Wake-Up Status */ 2257#define KPADWS 0x4000 /* Keypad Wake-Up Status */
2584#define nKPADWS 0x0
2585#define ROTWS 0x8000 /* Rotary Wake-Up Status */ 2258#define ROTWS 0x8000 /* Rotary Wake-Up Status */
2586#define nROTWS 0x0
2587#define GPWS 0x1000 /* General-Purpose Wake-Up Status */ 2259#define GPWS 0x1000 /* General-Purpose Wake-Up Status */
2588#define nGPWS 0x0
2589 2260
2590/* Bit masks for VR_CTL */ 2261/* Bit masks for VR_CTL */
2591 2262
@@ -2593,79 +2264,52 @@
2593#define GAIN 0xc /* Voltage Output Level Gain */ 2264#define GAIN 0xc /* Voltage Output Level Gain */
2594#define VLEV 0xf0 /* Internal Voltage Level */ 2265#define VLEV 0xf0 /* Internal Voltage Level */
2595#define SCKELOW 0x8000 /* Drive SCKE Low During Reset Enable */ 2266#define SCKELOW 0x8000 /* Drive SCKE Low During Reset Enable */
2596#define nSCKELOW 0x0
2597#define WAKE 0x100 /* RTC/Reset Wake-Up Enable */ 2267#define WAKE 0x100 /* RTC/Reset Wake-Up Enable */
2598#define nWAKE 0x0
2599#define CANWE 0x200 /* CAN0/1 Wake-Up Enable */ 2268#define CANWE 0x200 /* CAN0/1 Wake-Up Enable */
2600#define nCANWE 0x0
2601#define GPWE 0x400 /* General-Purpose Wake-Up Enable */ 2269#define GPWE 0x400 /* General-Purpose Wake-Up Enable */
2602#define nGPWE 0x0
2603#define USBWE 0x800 /* USB Wake-Up Enable */ 2270#define USBWE 0x800 /* USB Wake-Up Enable */
2604#define nUSBWE 0x0
2605#define KPADWE 0x1000 /* Keypad Wake-Up Enable */ 2271#define KPADWE 0x1000 /* Keypad Wake-Up Enable */
2606#define nKPADWE 0x0
2607#define ROTWE 0x2000 /* Rotary Wake-Up Enable */ 2272#define ROTWE 0x2000 /* Rotary Wake-Up Enable */
2608#define nROTWE 0x0
2609 2273
2610/* Bit masks for NFC_CTL */ 2274/* Bit masks for NFC_CTL */
2611 2275
2612#define WR_DLY 0xf /* Write Strobe Delay */ 2276#define WR_DLY 0xf /* Write Strobe Delay */
2613#define RD_DLY 0xf0 /* Read Strobe Delay */ 2277#define RD_DLY 0xf0 /* Read Strobe Delay */
2614#define NWIDTH 0x100 /* NAND Data Width */ 2278#define NWIDTH 0x100 /* NAND Data Width */
2615#define nNWIDTH 0x0
2616#define PG_SIZE 0x200 /* Page Size */ 2279#define PG_SIZE 0x200 /* Page Size */
2617#define nPG_SIZE 0x0
2618 2280
2619/* Bit masks for NFC_STAT */ 2281/* Bit masks for NFC_STAT */
2620 2282
2621#define NBUSY 0x1 /* Not Busy */ 2283#define NBUSY 0x1 /* Not Busy */
2622#define nNBUSY 0x0
2623#define WB_FULL 0x2 /* Write Buffer Full */ 2284#define WB_FULL 0x2 /* Write Buffer Full */
2624#define nWB_FULL 0x0
2625#define PG_WR_STAT 0x4 /* Page Write Pending */ 2285#define PG_WR_STAT 0x4 /* Page Write Pending */
2626#define nPG_WR_STAT 0x0
2627#define PG_RD_STAT 0x8 /* Page Read Pending */ 2286#define PG_RD_STAT 0x8 /* Page Read Pending */
2628#define nPG_RD_STAT 0x0
2629#define WB_EMPTY 0x10 /* Write Buffer Empty */ 2287#define WB_EMPTY 0x10 /* Write Buffer Empty */
2630#define nWB_EMPTY 0x0
2631 2288
2632/* Bit masks for NFC_IRQSTAT */ 2289/* Bit masks for NFC_IRQSTAT */
2633 2290
2634#define NBUSYIRQ 0x1 /* Not Busy IRQ */ 2291#define NBUSYIRQ 0x1 /* Not Busy IRQ */
2635#define nNBUSYIRQ 0x0
2636#define WB_OVF 0x2 /* Write Buffer Overflow */ 2292#define WB_OVF 0x2 /* Write Buffer Overflow */
2637#define nWB_OVF 0x0
2638#define WB_EDGE 0x4 /* Write Buffer Edge Detect */ 2293#define WB_EDGE 0x4 /* Write Buffer Edge Detect */
2639#define nWB_EDGE 0x0
2640#define RD_RDY 0x8 /* Read Data Ready */ 2294#define RD_RDY 0x8 /* Read Data Ready */
2641#define nRD_RDY 0x0
2642#define WR_DONE 0x10 /* Page Write Done */ 2295#define WR_DONE 0x10 /* Page Write Done */
2643#define nWR_DONE 0x0
2644 2296
2645/* Bit masks for NFC_IRQMASK */ 2297/* Bit masks for NFC_IRQMASK */
2646 2298
2647#define MASK_BUSYIRQ 0x1 /* Mask Not Busy IRQ */ 2299#define MASK_BUSYIRQ 0x1 /* Mask Not Busy IRQ */
2648#define nMASK_BUSYIRQ 0x0
2649#define MASK_WBOVF 0x2 /* Mask Write Buffer Overflow */ 2300#define MASK_WBOVF 0x2 /* Mask Write Buffer Overflow */
2650#define nMASK_WBOVF 0x0
2651#define MASK_WBEMPTY 0x4 /* Mask Write Buffer Empty */ 2301#define MASK_WBEMPTY 0x4 /* Mask Write Buffer Empty */
2652#define nMASK_WBEMPTY 0x0
2653#define MASK_RDRDY 0x8 /* Mask Read Data Ready */ 2302#define MASK_RDRDY 0x8 /* Mask Read Data Ready */
2654#define nMASK_RDRDY 0x0
2655#define MASK_WRDONE 0x10 /* Mask Write Done */ 2303#define MASK_WRDONE 0x10 /* Mask Write Done */
2656#define nMASK_WRDONE 0x0
2657 2304
2658/* Bit masks for NFC_RST */ 2305/* Bit masks for NFC_RST */
2659 2306
2660#define ECC_RST 0x1 /* ECC (and NFC counters) Reset */ 2307#define ECC_RST 0x1 /* ECC (and NFC counters) Reset */
2661#define nECC_RST 0x0
2662 2308
2663/* Bit masks for NFC_PGCTL */ 2309/* Bit masks for NFC_PGCTL */
2664 2310
2665#define PG_RD_START 0x1 /* Page Read Start */ 2311#define PG_RD_START 0x1 /* Page Read Start */
2666#define nPG_RD_START 0x0
2667#define PG_WR_START 0x2 /* Page Write Start */ 2312#define PG_WR_START 0x2 /* Page Write Start */
2668#define nPG_WR_START 0x0
2669 2313
2670/* Bit masks for NFC_ECC0 */ 2314/* Bit masks for NFC_ECC0 */
2671 2315
@@ -2690,56 +2334,34 @@
2690/* Bit masks for CAN0_CONTROL */ 2334/* Bit masks for CAN0_CONTROL */
2691 2335
2692#define SRS 0x1 /* Software Reset */ 2336#define SRS 0x1 /* Software Reset */
2693#define nSRS 0x0
2694#define DNM 0x2 /* DeviceNet Mode */ 2337#define DNM 0x2 /* DeviceNet Mode */
2695#define nDNM 0x0
2696#define ABO 0x4 /* Auto Bus On */ 2338#define ABO 0x4 /* Auto Bus On */
2697#define nABO 0x0
2698#define WBA 0x10 /* Wakeup On CAN Bus Activity */ 2339#define WBA 0x10 /* Wakeup On CAN Bus Activity */
2699#define nWBA 0x0
2700#define SMR 0x20 /* Sleep Mode Request */ 2340#define SMR 0x20 /* Sleep Mode Request */
2701#define nSMR 0x0
2702#define CSR 0x40 /* CAN Suspend Mode Request */ 2341#define CSR 0x40 /* CAN Suspend Mode Request */
2703#define nCSR 0x0
2704#define CCR 0x80 /* CAN Configuration Mode Request */ 2342#define CCR 0x80 /* CAN Configuration Mode Request */
2705#define nCCR 0x0
2706 2343
2707/* Bit masks for CAN0_STATUS */ 2344/* Bit masks for CAN0_STATUS */
2708 2345
2709#define WT 0x1 /* CAN Transmit Warning Flag */ 2346#define WT 0x1 /* CAN Transmit Warning Flag */
2710#define nWT 0x0
2711#define WR 0x2 /* CAN Receive Warning Flag */ 2347#define WR 0x2 /* CAN Receive Warning Flag */
2712#define nWR 0x0
2713#define EP 0x4 /* CAN Error Passive Mode */ 2348#define EP 0x4 /* CAN Error Passive Mode */
2714#define nEP 0x0
2715#define EBO 0x8 /* CAN Error Bus Off Mode */ 2349#define EBO 0x8 /* CAN Error Bus Off Mode */
2716#define nEBO 0x0
2717#define CSA 0x40 /* CAN Suspend Mode Acknowledge */ 2350#define CSA 0x40 /* CAN Suspend Mode Acknowledge */
2718#define nCSA 0x0
2719#define CCA 0x80 /* CAN Configuration Mode Acknowledge */ 2351#define CCA 0x80 /* CAN Configuration Mode Acknowledge */
2720#define nCCA 0x0
2721#define MBPTR 0x1f00 /* Mailbox Pointer */ 2352#define MBPTR 0x1f00 /* Mailbox Pointer */
2722#define TRM 0x4000 /* Transmit Mode Status */ 2353#define TRM 0x4000 /* Transmit Mode Status */
2723#define nTRM 0x0
2724#define REC 0x8000 /* Receive Mode Status */ 2354#define REC 0x8000 /* Receive Mode Status */
2725#define nREC 0x0
2726 2355
2727/* Bit masks for CAN0_DEBUG */ 2356/* Bit masks for CAN0_DEBUG */
2728 2357
2729#define DEC 0x1 /* Disable Transmit/Receive Error Counters */ 2358#define DEC 0x1 /* Disable Transmit/Receive Error Counters */
2730#define nDEC 0x0
2731#define DRI 0x2 /* Disable CANRX Input Pin */ 2359#define DRI 0x2 /* Disable CANRX Input Pin */
2732#define nDRI 0x0
2733#define DTO 0x4 /* Disable CANTX Output Pin */ 2360#define DTO 0x4 /* Disable CANTX Output Pin */
2734#define nDTO 0x0
2735#define DIL 0x8 /* Disable Internal Loop */ 2361#define DIL 0x8 /* Disable Internal Loop */
2736#define nDIL 0x0
2737#define MAA 0x10 /* Mode Auto-Acknowledge */ 2362#define MAA 0x10 /* Mode Auto-Acknowledge */
2738#define nMAA 0x0
2739#define MRB 0x20 /* Mode Read Back */ 2363#define MRB 0x20 /* Mode Read Back */
2740#define nMRB 0x0
2741#define CDE 0x8000 /* CAN Debug Mode Enable */ 2364#define CDE 0x8000 /* CAN Debug Mode Enable */
2742#define nCDE 0x0
2743 2365
2744/* Bit masks for CAN0_CLOCK */ 2366/* Bit masks for CAN0_CLOCK */
2745 2367
@@ -2749,111 +2371,69 @@
2749 2371
2750#define SJW 0x300 /* Synchronization Jump Width */ 2372#define SJW 0x300 /* Synchronization Jump Width */
2751#define SAM 0x80 /* Sampling */ 2373#define SAM 0x80 /* Sampling */
2752#define nSAM 0x0
2753#define TSEG2 0x70 /* Time Segment 2 */ 2374#define TSEG2 0x70 /* Time Segment 2 */
2754#define TSEG1 0xf /* Time Segment 1 */ 2375#define TSEG1 0xf /* Time Segment 1 */
2755 2376
2756/* Bit masks for CAN0_INTR */ 2377/* Bit masks for CAN0_INTR */
2757 2378
2758#define CANRX 0x80 /* Serial Input From Transceiver */ 2379#define CANRX 0x80 /* Serial Input From Transceiver */
2759#define nCANRX 0x0
2760#define CANTX 0x40 /* Serial Output To Transceiver */ 2380#define CANTX 0x40 /* Serial Output To Transceiver */
2761#define nCANTX 0x0
2762#define SMACK 0x8 /* Sleep Mode Acknowledge */ 2381#define SMACK 0x8 /* Sleep Mode Acknowledge */
2763#define nSMACK 0x0
2764#define GIRQ 0x4 /* Global Interrupt Request Status */ 2382#define GIRQ 0x4 /* Global Interrupt Request Status */
2765#define nGIRQ 0x0
2766#define MBTIRQ 0x2 /* Mailbox Transmit Interrupt Request */ 2383#define MBTIRQ 0x2 /* Mailbox Transmit Interrupt Request */
2767#define nMBTIRQ 0x0
2768#define MBRIRQ 0x1 /* Mailbox Receive Interrupt Request */ 2384#define MBRIRQ 0x1 /* Mailbox Receive Interrupt Request */
2769#define nMBRIRQ 0x0
2770 2385
2771/* Bit masks for CAN0_GIM */ 2386/* Bit masks for CAN0_GIM */
2772 2387
2773#define EWTIM 0x1 /* Error Warning Transmit Interrupt Mask */ 2388#define EWTIM 0x1 /* Error Warning Transmit Interrupt Mask */
2774#define nEWTIM 0x0
2775#define EWRIM 0x2 /* Error Warning Receive Interrupt Mask */ 2389#define EWRIM 0x2 /* Error Warning Receive Interrupt Mask */
2776#define nEWRIM 0x0
2777#define EPIM 0x4 /* Error Passive Interrupt Mask */ 2390#define EPIM 0x4 /* Error Passive Interrupt Mask */
2778#define nEPIM 0x0
2779#define BOIM 0x8 /* Bus Off Interrupt Mask */ 2391#define BOIM 0x8 /* Bus Off Interrupt Mask */
2780#define nBOIM 0x0
2781#define WUIM 0x10 /* Wakeup Interrupt Mask */ 2392#define WUIM 0x10 /* Wakeup Interrupt Mask */
2782#define nWUIM 0x0
2783#define UIAIM 0x20 /* Unimplemented Address Interrupt Mask */ 2393#define UIAIM 0x20 /* Unimplemented Address Interrupt Mask */
2784#define nUIAIM 0x0
2785#define AAIM 0x40 /* Abort Acknowledge Interrupt Mask */ 2394#define AAIM 0x40 /* Abort Acknowledge Interrupt Mask */
2786#define nAAIM 0x0
2787#define RMLIM 0x80 /* Receive Message Lost Interrupt Mask */ 2395#define RMLIM 0x80 /* Receive Message Lost Interrupt Mask */
2788#define nRMLIM 0x0
2789#define UCEIM 0x100 /* Universal Counter Exceeded Interrupt Mask */ 2396#define UCEIM 0x100 /* Universal Counter Exceeded Interrupt Mask */
2790#define nUCEIM 0x0
2791#define ADIM 0x400 /* Access Denied Interrupt Mask */ 2397#define ADIM 0x400 /* Access Denied Interrupt Mask */
2792#define nADIM 0x0
2793 2398
2794/* Bit masks for CAN0_GIS */ 2399/* Bit masks for CAN0_GIS */
2795 2400
2796#define EWTIS 0x1 /* Error Warning Transmit Interrupt Status */ 2401#define EWTIS 0x1 /* Error Warning Transmit Interrupt Status */
2797#define nEWTIS 0x0
2798#define EWRIS 0x2 /* Error Warning Receive Interrupt Status */ 2402#define EWRIS 0x2 /* Error Warning Receive Interrupt Status */
2799#define nEWRIS 0x0
2800#define EPIS 0x4 /* Error Passive Interrupt Status */ 2403#define EPIS 0x4 /* Error Passive Interrupt Status */
2801#define nEPIS 0x0
2802#define BOIS 0x8 /* Bus Off Interrupt Status */ 2404#define BOIS 0x8 /* Bus Off Interrupt Status */
2803#define nBOIS 0x0
2804#define WUIS 0x10 /* Wakeup Interrupt Status */ 2405#define WUIS 0x10 /* Wakeup Interrupt Status */
2805#define nWUIS 0x0
2806#define UIAIS 0x20 /* Unimplemented Address Interrupt Status */ 2406#define UIAIS 0x20 /* Unimplemented Address Interrupt Status */
2807#define nUIAIS 0x0
2808#define AAIS 0x40 /* Abort Acknowledge Interrupt Status */ 2407#define AAIS 0x40 /* Abort Acknowledge Interrupt Status */
2809#define nAAIS 0x0
2810#define RMLIS 0x80 /* Receive Message Lost Interrupt Status */ 2408#define RMLIS 0x80 /* Receive Message Lost Interrupt Status */
2811#define nRMLIS 0x0
2812#define UCEIS 0x100 /* Universal Counter Exceeded Interrupt Status */ 2409#define UCEIS 0x100 /* Universal Counter Exceeded Interrupt Status */
2813#define nUCEIS 0x0
2814#define ADIS 0x400 /* Access Denied Interrupt Status */ 2410#define ADIS 0x400 /* Access Denied Interrupt Status */
2815#define nADIS 0x0
2816 2411
2817/* Bit masks for CAN0_GIF */ 2412/* Bit masks for CAN0_GIF */
2818 2413
2819#define EWTIF 0x1 /* Error Warning Transmit Interrupt Flag */ 2414#define EWTIF 0x1 /* Error Warning Transmit Interrupt Flag */
2820#define nEWTIF 0x0
2821#define EWRIF 0x2 /* Error Warning Receive Interrupt Flag */ 2415#define EWRIF 0x2 /* Error Warning Receive Interrupt Flag */
2822#define nEWRIF 0x0
2823#define EPIF 0x4 /* Error Passive Interrupt Flag */ 2416#define EPIF 0x4 /* Error Passive Interrupt Flag */
2824#define nEPIF 0x0
2825#define BOIF 0x8 /* Bus Off Interrupt Flag */ 2417#define BOIF 0x8 /* Bus Off Interrupt Flag */
2826#define nBOIF 0x0
2827#define WUIF 0x10 /* Wakeup Interrupt Flag */ 2418#define WUIF 0x10 /* Wakeup Interrupt Flag */
2828#define nWUIF 0x0
2829#define UIAIF 0x20 /* Unimplemented Address Interrupt Flag */ 2419#define UIAIF 0x20 /* Unimplemented Address Interrupt Flag */
2830#define nUIAIF 0x0
2831#define AAIF 0x40 /* Abort Acknowledge Interrupt Flag */ 2420#define AAIF 0x40 /* Abort Acknowledge Interrupt Flag */
2832#define nAAIF 0x0
2833#define RMLIF 0x80 /* Receive Message Lost Interrupt Flag */ 2421#define RMLIF 0x80 /* Receive Message Lost Interrupt Flag */
2834#define nRMLIF 0x0
2835#define UCEIF 0x100 /* Universal Counter Exceeded Interrupt Flag */ 2422#define UCEIF 0x100 /* Universal Counter Exceeded Interrupt Flag */
2836#define nUCEIF 0x0
2837#define ADIF 0x400 /* Access Denied Interrupt Flag */ 2423#define ADIF 0x400 /* Access Denied Interrupt Flag */
2838#define nADIF 0x0
2839 2424
2840/* Bit masks for CAN0_MBTD */ 2425/* Bit masks for CAN0_MBTD */
2841 2426
2842#define TDR 0x80 /* Temporary Disable Request */ 2427#define TDR 0x80 /* Temporary Disable Request */
2843#define nTDR 0x0
2844#define TDA 0x40 /* Temporary Disable Acknowledge */ 2428#define TDA 0x40 /* Temporary Disable Acknowledge */
2845#define nTDA 0x0
2846#define TDPTR 0x1f /* Temporary Disable Pointer */ 2429#define TDPTR 0x1f /* Temporary Disable Pointer */
2847 2430
2848/* Bit masks for CAN0_UCCNF */ 2431/* Bit masks for CAN0_UCCNF */
2849 2432
2850#define UCCNF 0xf /* Universal Counter Configuration */ 2433#define UCCNF 0xf /* Universal Counter Configuration */
2851#define UCRC 0x20 /* Universal Counter Reload/Clear */ 2434#define UCRC 0x20 /* Universal Counter Reload/Clear */
2852#define nUCRC 0x0
2853#define UCCT 0x40 /* Universal Counter CAN Trigger */ 2435#define UCCT 0x40 /* Universal Counter CAN Trigger */
2854#define nUCCT 0x0
2855#define UCE 0x80 /* Universal Counter Enable */ 2436#define UCE 0x80 /* Universal Counter Enable */
2856#define nUCE 0x0
2857 2437
2858/* Bit masks for CAN0_UCCNT */ 2438/* Bit masks for CAN0_UCCNT */
2859 2439
@@ -2871,17 +2451,11 @@
2871/* Bit masks for CAN0_ESR */ 2451/* Bit masks for CAN0_ESR */
2872 2452
2873#define FER 0x80 /* Form Error */ 2453#define FER 0x80 /* Form Error */
2874#define nFER 0x0
2875#define BEF 0x40 /* Bit Error Flag */ 2454#define BEF 0x40 /* Bit Error Flag */
2876#define nBEF 0x0
2877#define SA0 0x20 /* Stuck At Dominant */ 2455#define SA0 0x20 /* Stuck At Dominant */
2878#define nSA0 0x0
2879#define CRCE 0x10 /* CRC Error */ 2456#define CRCE 0x10 /* CRC Error */
2880#define nCRCE 0x0
2881#define SER 0x8 /* Stuff Bit Error */ 2457#define SER 0x8 /* Stuff Bit Error */
2882#define nSER 0x0
2883#define ACKE 0x4 /* Acknowledge Error */ 2458#define ACKE 0x4 /* Acknowledge Error */
2884#define nACKE 0x0
2885 2459
2886/* Bit masks for CAN0_EWR */ 2460/* Bit masks for CAN0_EWR */
2887 2461
@@ -2891,11 +2465,8 @@
2891/* Bit masks for CAN0_AMxx_H */ 2465/* Bit masks for CAN0_AMxx_H */
2892 2466
2893#define FDF 0x8000 /* Filter On Data Field */ 2467#define FDF 0x8000 /* Filter On Data Field */
2894#define nFDF 0x0
2895#define FMD 0x4000 /* Full Mask Data */ 2468#define FMD 0x4000 /* Full Mask Data */
2896#define nFMD 0x0
2897#define AMIDE 0x2000 /* Acceptance Mask Identifier Extension */ 2469#define AMIDE 0x2000 /* Acceptance Mask Identifier Extension */
2898#define nAMIDE 0x0
2899#define BASEID 0x1ffc /* Base Identifier */ 2470#define BASEID 0x1ffc /* Base Identifier */
2900#define EXTID_HI 0x3 /* Extended Identifier High Bits */ 2471#define EXTID_HI 0x3 /* Extended Identifier High Bits */
2901 2472
@@ -2907,11 +2478,8 @@
2907/* Bit masks for CAN0_MBxx_ID1 */ 2478/* Bit masks for CAN0_MBxx_ID1 */
2908 2479
2909#define AME 0x8000 /* Acceptance Mask Enable */ 2480#define AME 0x8000 /* Acceptance Mask Enable */
2910#define nAME 0x0
2911#define RTR 0x4000 /* Remote Transmission Request */ 2481#define RTR 0x4000 /* Remote Transmission Request */
2912#define nRTR 0x0
2913#define IDE 0x2000 /* Identifier Extension */ 2482#define IDE 0x2000 /* Identifier Extension */
2914#define nIDE 0x0
2915#define BASEID 0x1ffc /* Base Identifier */ 2483#define BASEID 0x1ffc /* Base Identifier */
2916#define EXTID_HI 0x3 /* Extended Identifier High Bits */ 2484#define EXTID_HI 0x3 /* Extended Identifier High Bits */
2917 2485
@@ -2951,980 +2519,546 @@
2951/* Bit masks for CAN0_MC1 */ 2519/* Bit masks for CAN0_MC1 */
2952 2520
2953#define MC0 0x1 /* Mailbox 0 Enable */ 2521#define MC0 0x1 /* Mailbox 0 Enable */
2954#define nMC0 0x0
2955#define MC1 0x2 /* Mailbox 1 Enable */ 2522#define MC1 0x2 /* Mailbox 1 Enable */
2956#define nMC1 0x0
2957#define MC2 0x4 /* Mailbox 2 Enable */ 2523#define MC2 0x4 /* Mailbox 2 Enable */
2958#define nMC2 0x0
2959#define MC3 0x8 /* Mailbox 3 Enable */ 2524#define MC3 0x8 /* Mailbox 3 Enable */
2960#define nMC3 0x0
2961#define MC4 0x10 /* Mailbox 4 Enable */ 2525#define MC4 0x10 /* Mailbox 4 Enable */
2962#define nMC4 0x0
2963#define MC5 0x20 /* Mailbox 5 Enable */ 2526#define MC5 0x20 /* Mailbox 5 Enable */
2964#define nMC5 0x0
2965#define MC6 0x40 /* Mailbox 6 Enable */ 2527#define MC6 0x40 /* Mailbox 6 Enable */
2966#define nMC6 0x0
2967#define MC7 0x80 /* Mailbox 7 Enable */ 2528#define MC7 0x80 /* Mailbox 7 Enable */
2968#define nMC7 0x0
2969#define MC8 0x100 /* Mailbox 8 Enable */ 2529#define MC8 0x100 /* Mailbox 8 Enable */
2970#define nMC8 0x0
2971#define MC9 0x200 /* Mailbox 9 Enable */ 2530#define MC9 0x200 /* Mailbox 9 Enable */
2972#define nMC9 0x0
2973#define MC10 0x400 /* Mailbox 10 Enable */ 2531#define MC10 0x400 /* Mailbox 10 Enable */
2974#define nMC10 0x0
2975#define MC11 0x800 /* Mailbox 11 Enable */ 2532#define MC11 0x800 /* Mailbox 11 Enable */
2976#define nMC11 0x0
2977#define MC12 0x1000 /* Mailbox 12 Enable */ 2533#define MC12 0x1000 /* Mailbox 12 Enable */
2978#define nMC12 0x0
2979#define MC13 0x2000 /* Mailbox 13 Enable */ 2534#define MC13 0x2000 /* Mailbox 13 Enable */
2980#define nMC13 0x0
2981#define MC14 0x4000 /* Mailbox 14 Enable */ 2535#define MC14 0x4000 /* Mailbox 14 Enable */
2982#define nMC14 0x0
2983#define MC15 0x8000 /* Mailbox 15 Enable */ 2536#define MC15 0x8000 /* Mailbox 15 Enable */
2984#define nMC15 0x0
2985 2537
2986/* Bit masks for CAN0_MC2 */ 2538/* Bit masks for CAN0_MC2 */
2987 2539
2988#define MC16 0x1 /* Mailbox 16 Enable */ 2540#define MC16 0x1 /* Mailbox 16 Enable */
2989#define nMC16 0x0
2990#define MC17 0x2 /* Mailbox 17 Enable */ 2541#define MC17 0x2 /* Mailbox 17 Enable */
2991#define nMC17 0x0
2992#define MC18 0x4 /* Mailbox 18 Enable */ 2542#define MC18 0x4 /* Mailbox 18 Enable */
2993#define nMC18 0x0
2994#define MC19 0x8 /* Mailbox 19 Enable */ 2543#define MC19 0x8 /* Mailbox 19 Enable */
2995#define nMC19 0x0
2996#define MC20 0x10 /* Mailbox 20 Enable */ 2544#define MC20 0x10 /* Mailbox 20 Enable */
2997#define nMC20 0x0
2998#define MC21 0x20 /* Mailbox 21 Enable */ 2545#define MC21 0x20 /* Mailbox 21 Enable */
2999#define nMC21 0x0
3000#define MC22 0x40 /* Mailbox 22 Enable */ 2546#define MC22 0x40 /* Mailbox 22 Enable */
3001#define nMC22 0x0
3002#define MC23 0x80 /* Mailbox 23 Enable */ 2547#define MC23 0x80 /* Mailbox 23 Enable */
3003#define nMC23 0x0
3004#define MC24 0x100 /* Mailbox 24 Enable */ 2548#define MC24 0x100 /* Mailbox 24 Enable */
3005#define nMC24 0x0
3006#define MC25 0x200 /* Mailbox 25 Enable */ 2549#define MC25 0x200 /* Mailbox 25 Enable */
3007#define nMC25 0x0
3008#define MC26 0x400 /* Mailbox 26 Enable */ 2550#define MC26 0x400 /* Mailbox 26 Enable */
3009#define nMC26 0x0
3010#define MC27 0x800 /* Mailbox 27 Enable */ 2551#define MC27 0x800 /* Mailbox 27 Enable */
3011#define nMC27 0x0
3012#define MC28 0x1000 /* Mailbox 28 Enable */ 2552#define MC28 0x1000 /* Mailbox 28 Enable */
3013#define nMC28 0x0
3014#define MC29 0x2000 /* Mailbox 29 Enable */ 2553#define MC29 0x2000 /* Mailbox 29 Enable */
3015#define nMC29 0x0
3016#define MC30 0x4000 /* Mailbox 30 Enable */ 2554#define MC30 0x4000 /* Mailbox 30 Enable */
3017#define nMC30 0x0
3018#define MC31 0x8000 /* Mailbox 31 Enable */ 2555#define MC31 0x8000 /* Mailbox 31 Enable */
3019#define nMC31 0x0
3020 2556
3021/* Bit masks for CAN0_MD1 */ 2557/* Bit masks for CAN0_MD1 */
3022 2558
3023#define MD0 0x1 /* Mailbox 0 Receive Enable */ 2559#define MD0 0x1 /* Mailbox 0 Receive Enable */
3024#define nMD0 0x0
3025#define MD1 0x2 /* Mailbox 1 Receive Enable */ 2560#define MD1 0x2 /* Mailbox 1 Receive Enable */
3026#define nMD1 0x0
3027#define MD2 0x4 /* Mailbox 2 Receive Enable */ 2561#define MD2 0x4 /* Mailbox 2 Receive Enable */
3028#define nMD2 0x0
3029#define MD3 0x8 /* Mailbox 3 Receive Enable */ 2562#define MD3 0x8 /* Mailbox 3 Receive Enable */
3030#define nMD3 0x0
3031#define MD4 0x10 /* Mailbox 4 Receive Enable */ 2563#define MD4 0x10 /* Mailbox 4 Receive Enable */
3032#define nMD4 0x0
3033#define MD5 0x20 /* Mailbox 5 Receive Enable */ 2564#define MD5 0x20 /* Mailbox 5 Receive Enable */
3034#define nMD5 0x0
3035#define MD6 0x40 /* Mailbox 6 Receive Enable */ 2565#define MD6 0x40 /* Mailbox 6 Receive Enable */
3036#define nMD6 0x0
3037#define MD7 0x80 /* Mailbox 7 Receive Enable */ 2566#define MD7 0x80 /* Mailbox 7 Receive Enable */
3038#define nMD7 0x0
3039#define MD8 0x100 /* Mailbox 8 Receive Enable */ 2567#define MD8 0x100 /* Mailbox 8 Receive Enable */
3040#define nMD8 0x0
3041#define MD9 0x200 /* Mailbox 9 Receive Enable */ 2568#define MD9 0x200 /* Mailbox 9 Receive Enable */
3042#define nMD9 0x0
3043#define MD10 0x400 /* Mailbox 10 Receive Enable */ 2569#define MD10 0x400 /* Mailbox 10 Receive Enable */
3044#define nMD10 0x0
3045#define MD11 0x800 /* Mailbox 11 Receive Enable */ 2570#define MD11 0x800 /* Mailbox 11 Receive Enable */
3046#define nMD11 0x0
3047#define MD12 0x1000 /* Mailbox 12 Receive Enable */ 2571#define MD12 0x1000 /* Mailbox 12 Receive Enable */
3048#define nMD12 0x0
3049#define MD13 0x2000 /* Mailbox 13 Receive Enable */ 2572#define MD13 0x2000 /* Mailbox 13 Receive Enable */
3050#define nMD13 0x0
3051#define MD14 0x4000 /* Mailbox 14 Receive Enable */ 2573#define MD14 0x4000 /* Mailbox 14 Receive Enable */
3052#define nMD14 0x0
3053#define MD15 0x8000 /* Mailbox 15 Receive Enable */ 2574#define MD15 0x8000 /* Mailbox 15 Receive Enable */
3054#define nMD15 0x0
3055 2575
3056/* Bit masks for CAN0_MD2 */ 2576/* Bit masks for CAN0_MD2 */
3057 2577
3058#define MD16 0x1 /* Mailbox 16 Receive Enable */ 2578#define MD16 0x1 /* Mailbox 16 Receive Enable */
3059#define nMD16 0x0
3060#define MD17 0x2 /* Mailbox 17 Receive Enable */ 2579#define MD17 0x2 /* Mailbox 17 Receive Enable */
3061#define nMD17 0x0
3062#define MD18 0x4 /* Mailbox 18 Receive Enable */ 2580#define MD18 0x4 /* Mailbox 18 Receive Enable */
3063#define nMD18 0x0
3064#define MD19 0x8 /* Mailbox 19 Receive Enable */ 2581#define MD19 0x8 /* Mailbox 19 Receive Enable */
3065#define nMD19 0x0
3066#define MD20 0x10 /* Mailbox 20 Receive Enable */ 2582#define MD20 0x10 /* Mailbox 20 Receive Enable */
3067#define nMD20 0x0
3068#define MD21 0x20 /* Mailbox 21 Receive Enable */ 2583#define MD21 0x20 /* Mailbox 21 Receive Enable */
3069#define nMD21 0x0
3070#define MD22 0x40 /* Mailbox 22 Receive Enable */ 2584#define MD22 0x40 /* Mailbox 22 Receive Enable */
3071#define nMD22 0x0
3072#define MD23 0x80 /* Mailbox 23 Receive Enable */ 2585#define MD23 0x80 /* Mailbox 23 Receive Enable */
3073#define nMD23 0x0
3074#define MD24 0x100 /* Mailbox 24 Receive Enable */ 2586#define MD24 0x100 /* Mailbox 24 Receive Enable */
3075#define nMD24 0x0
3076#define MD25 0x200 /* Mailbox 25 Receive Enable */ 2587#define MD25 0x200 /* Mailbox 25 Receive Enable */
3077#define nMD25 0x0
3078#define MD26 0x400 /* Mailbox 26 Receive Enable */ 2588#define MD26 0x400 /* Mailbox 26 Receive Enable */
3079#define nMD26 0x0
3080#define MD27 0x800 /* Mailbox 27 Receive Enable */ 2589#define MD27 0x800 /* Mailbox 27 Receive Enable */
3081#define nMD27 0x0
3082#define MD28 0x1000 /* Mailbox 28 Receive Enable */ 2590#define MD28 0x1000 /* Mailbox 28 Receive Enable */
3083#define nMD28 0x0
3084#define MD29 0x2000 /* Mailbox 29 Receive Enable */ 2591#define MD29 0x2000 /* Mailbox 29 Receive Enable */
3085#define nMD29 0x0
3086#define MD30 0x4000 /* Mailbox 30 Receive Enable */ 2592#define MD30 0x4000 /* Mailbox 30 Receive Enable */
3087#define nMD30 0x0
3088#define MD31 0x8000 /* Mailbox 31 Receive Enable */ 2593#define MD31 0x8000 /* Mailbox 31 Receive Enable */
3089#define nMD31 0x0
3090 2594
3091/* Bit masks for CAN0_RMP1 */ 2595/* Bit masks for CAN0_RMP1 */
3092 2596
3093#define RMP0 0x1 /* Mailbox 0 Receive Message Pending */ 2597#define RMP0 0x1 /* Mailbox 0 Receive Message Pending */
3094#define nRMP0 0x0
3095#define RMP1 0x2 /* Mailbox 1 Receive Message Pending */ 2598#define RMP1 0x2 /* Mailbox 1 Receive Message Pending */
3096#define nRMP1 0x0
3097#define RMP2 0x4 /* Mailbox 2 Receive Message Pending */ 2599#define RMP2 0x4 /* Mailbox 2 Receive Message Pending */
3098#define nRMP2 0x0
3099#define RMP3 0x8 /* Mailbox 3 Receive Message Pending */ 2600#define RMP3 0x8 /* Mailbox 3 Receive Message Pending */
3100#define nRMP3 0x0
3101#define RMP4 0x10 /* Mailbox 4 Receive Message Pending */ 2601#define RMP4 0x10 /* Mailbox 4 Receive Message Pending */
3102#define nRMP4 0x0
3103#define RMP5 0x20 /* Mailbox 5 Receive Message Pending */ 2602#define RMP5 0x20 /* Mailbox 5 Receive Message Pending */
3104#define nRMP5 0x0
3105#define RMP6 0x40 /* Mailbox 6 Receive Message Pending */ 2603#define RMP6 0x40 /* Mailbox 6 Receive Message Pending */
3106#define nRMP6 0x0
3107#define RMP7 0x80 /* Mailbox 7 Receive Message Pending */ 2604#define RMP7 0x80 /* Mailbox 7 Receive Message Pending */
3108#define nRMP7 0x0
3109#define RMP8 0x100 /* Mailbox 8 Receive Message Pending */ 2605#define RMP8 0x100 /* Mailbox 8 Receive Message Pending */
3110#define nRMP8 0x0
3111#define RMP9 0x200 /* Mailbox 9 Receive Message Pending */ 2606#define RMP9 0x200 /* Mailbox 9 Receive Message Pending */
3112#define nRMP9 0x0
3113#define RMP10 0x400 /* Mailbox 10 Receive Message Pending */ 2607#define RMP10 0x400 /* Mailbox 10 Receive Message Pending */
3114#define nRMP10 0x0
3115#define RMP11 0x800 /* Mailbox 11 Receive Message Pending */ 2608#define RMP11 0x800 /* Mailbox 11 Receive Message Pending */
3116#define nRMP11 0x0
3117#define RMP12 0x1000 /* Mailbox 12 Receive Message Pending */ 2609#define RMP12 0x1000 /* Mailbox 12 Receive Message Pending */
3118#define nRMP12 0x0
3119#define RMP13 0x2000 /* Mailbox 13 Receive Message Pending */ 2610#define RMP13 0x2000 /* Mailbox 13 Receive Message Pending */
3120#define nRMP13 0x0
3121#define RMP14 0x4000 /* Mailbox 14 Receive Message Pending */ 2611#define RMP14 0x4000 /* Mailbox 14 Receive Message Pending */
3122#define nRMP14 0x0
3123#define RMP15 0x8000 /* Mailbox 15 Receive Message Pending */ 2612#define RMP15 0x8000 /* Mailbox 15 Receive Message Pending */
3124#define nRMP15 0x0
3125 2613
3126/* Bit masks for CAN0_RMP2 */ 2614/* Bit masks for CAN0_RMP2 */
3127 2615
3128#define RMP16 0x1 /* Mailbox 16 Receive Message Pending */ 2616#define RMP16 0x1 /* Mailbox 16 Receive Message Pending */
3129#define nRMP16 0x0
3130#define RMP17 0x2 /* Mailbox 17 Receive Message Pending */ 2617#define RMP17 0x2 /* Mailbox 17 Receive Message Pending */
3131#define nRMP17 0x0
3132#define RMP18 0x4 /* Mailbox 18 Receive Message Pending */ 2618#define RMP18 0x4 /* Mailbox 18 Receive Message Pending */
3133#define nRMP18 0x0
3134#define RMP19 0x8 /* Mailbox 19 Receive Message Pending */ 2619#define RMP19 0x8 /* Mailbox 19 Receive Message Pending */
3135#define nRMP19 0x0
3136#define RMP20 0x10 /* Mailbox 20 Receive Message Pending */ 2620#define RMP20 0x10 /* Mailbox 20 Receive Message Pending */
3137#define nRMP20 0x0
3138#define RMP21 0x20 /* Mailbox 21 Receive Message Pending */ 2621#define RMP21 0x20 /* Mailbox 21 Receive Message Pending */
3139#define nRMP21 0x0
3140#define RMP22 0x40 /* Mailbox 22 Receive Message Pending */ 2622#define RMP22 0x40 /* Mailbox 22 Receive Message Pending */
3141#define nRMP22 0x0
3142#define RMP23 0x80 /* Mailbox 23 Receive Message Pending */ 2623#define RMP23 0x80 /* Mailbox 23 Receive Message Pending */
3143#define nRMP23 0x0
3144#define RMP24 0x100 /* Mailbox 24 Receive Message Pending */ 2624#define RMP24 0x100 /* Mailbox 24 Receive Message Pending */
3145#define nRMP24 0x0
3146#define RMP25 0x200 /* Mailbox 25 Receive Message Pending */ 2625#define RMP25 0x200 /* Mailbox 25 Receive Message Pending */
3147#define nRMP25 0x0
3148#define RMP26 0x400 /* Mailbox 26 Receive Message Pending */ 2626#define RMP26 0x400 /* Mailbox 26 Receive Message Pending */
3149#define nRMP26 0x0
3150#define RMP27 0x800 /* Mailbox 27 Receive Message Pending */ 2627#define RMP27 0x800 /* Mailbox 27 Receive Message Pending */
3151#define nRMP27 0x0
3152#define RMP28 0x1000 /* Mailbox 28 Receive Message Pending */ 2628#define RMP28 0x1000 /* Mailbox 28 Receive Message Pending */
3153#define nRMP28 0x0
3154#define RMP29 0x2000 /* Mailbox 29 Receive Message Pending */ 2629#define RMP29 0x2000 /* Mailbox 29 Receive Message Pending */
3155#define nRMP29 0x0
3156#define RMP30 0x4000 /* Mailbox 30 Receive Message Pending */ 2630#define RMP30 0x4000 /* Mailbox 30 Receive Message Pending */
3157#define nRMP30 0x0
3158#define RMP31 0x8000 /* Mailbox 31 Receive Message Pending */ 2631#define RMP31 0x8000 /* Mailbox 31 Receive Message Pending */
3159#define nRMP31 0x0
3160 2632
3161/* Bit masks for CAN0_RML1 */ 2633/* Bit masks for CAN0_RML1 */
3162 2634
3163#define RML0 0x1 /* Mailbox 0 Receive Message Lost */ 2635#define RML0 0x1 /* Mailbox 0 Receive Message Lost */
3164#define nRML0 0x0
3165#define RML1 0x2 /* Mailbox 1 Receive Message Lost */ 2636#define RML1 0x2 /* Mailbox 1 Receive Message Lost */
3166#define nRML1 0x0
3167#define RML2 0x4 /* Mailbox 2 Receive Message Lost */ 2637#define RML2 0x4 /* Mailbox 2 Receive Message Lost */
3168#define nRML2 0x0
3169#define RML3 0x8 /* Mailbox 3 Receive Message Lost */ 2638#define RML3 0x8 /* Mailbox 3 Receive Message Lost */
3170#define nRML3 0x0
3171#define RML4 0x10 /* Mailbox 4 Receive Message Lost */ 2639#define RML4 0x10 /* Mailbox 4 Receive Message Lost */
3172#define nRML4 0x0
3173#define RML5 0x20 /* Mailbox 5 Receive Message Lost */ 2640#define RML5 0x20 /* Mailbox 5 Receive Message Lost */
3174#define nRML5 0x0
3175#define RML6 0x40 /* Mailbox 6 Receive Message Lost */ 2641#define RML6 0x40 /* Mailbox 6 Receive Message Lost */
3176#define nRML6 0x0
3177#define RML7 0x80 /* Mailbox 7 Receive Message Lost */ 2642#define RML7 0x80 /* Mailbox 7 Receive Message Lost */
3178#define nRML7 0x0
3179#define RML8 0x100 /* Mailbox 8 Receive Message Lost */ 2643#define RML8 0x100 /* Mailbox 8 Receive Message Lost */
3180#define nRML8 0x0
3181#define RML9 0x200 /* Mailbox 9 Receive Message Lost */ 2644#define RML9 0x200 /* Mailbox 9 Receive Message Lost */
3182#define nRML9 0x0
3183#define RML10 0x400 /* Mailbox 10 Receive Message Lost */ 2645#define RML10 0x400 /* Mailbox 10 Receive Message Lost */
3184#define nRML10 0x0
3185#define RML11 0x800 /* Mailbox 11 Receive Message Lost */ 2646#define RML11 0x800 /* Mailbox 11 Receive Message Lost */
3186#define nRML11 0x0
3187#define RML12 0x1000 /* Mailbox 12 Receive Message Lost */ 2647#define RML12 0x1000 /* Mailbox 12 Receive Message Lost */
3188#define nRML12 0x0
3189#define RML13 0x2000 /* Mailbox 13 Receive Message Lost */ 2648#define RML13 0x2000 /* Mailbox 13 Receive Message Lost */
3190#define nRML13 0x0
3191#define RML14 0x4000 /* Mailbox 14 Receive Message Lost */ 2649#define RML14 0x4000 /* Mailbox 14 Receive Message Lost */
3192#define nRML14 0x0
3193#define RML15 0x8000 /* Mailbox 15 Receive Message Lost */ 2650#define RML15 0x8000 /* Mailbox 15 Receive Message Lost */
3194#define nRML15 0x0
3195 2651
3196/* Bit masks for CAN0_RML2 */ 2652/* Bit masks for CAN0_RML2 */
3197 2653
3198#define RML16 0x1 /* Mailbox 16 Receive Message Lost */ 2654#define RML16 0x1 /* Mailbox 16 Receive Message Lost */
3199#define nRML16 0x0
3200#define RML17 0x2 /* Mailbox 17 Receive Message Lost */ 2655#define RML17 0x2 /* Mailbox 17 Receive Message Lost */
3201#define nRML17 0x0
3202#define RML18 0x4 /* Mailbox 18 Receive Message Lost */ 2656#define RML18 0x4 /* Mailbox 18 Receive Message Lost */
3203#define nRML18 0x0
3204#define RML19 0x8 /* Mailbox 19 Receive Message Lost */ 2657#define RML19 0x8 /* Mailbox 19 Receive Message Lost */
3205#define nRML19 0x0
3206#define RML20 0x10 /* Mailbox 20 Receive Message Lost */ 2658#define RML20 0x10 /* Mailbox 20 Receive Message Lost */
3207#define nRML20 0x0
3208#define RML21 0x20 /* Mailbox 21 Receive Message Lost */ 2659#define RML21 0x20 /* Mailbox 21 Receive Message Lost */
3209#define nRML21 0x0
3210#define RML22 0x40 /* Mailbox 22 Receive Message Lost */ 2660#define RML22 0x40 /* Mailbox 22 Receive Message Lost */
3211#define nRML22 0x0
3212#define RML23 0x80 /* Mailbox 23 Receive Message Lost */ 2661#define RML23 0x80 /* Mailbox 23 Receive Message Lost */
3213#define nRML23 0x0
3214#define RML24 0x100 /* Mailbox 24 Receive Message Lost */ 2662#define RML24 0x100 /* Mailbox 24 Receive Message Lost */
3215#define nRML24 0x0
3216#define RML25 0x200 /* Mailbox 25 Receive Message Lost */ 2663#define RML25 0x200 /* Mailbox 25 Receive Message Lost */
3217#define nRML25 0x0
3218#define RML26 0x400 /* Mailbox 26 Receive Message Lost */ 2664#define RML26 0x400 /* Mailbox 26 Receive Message Lost */
3219#define nRML26 0x0
3220#define RML27 0x800 /* Mailbox 27 Receive Message Lost */ 2665#define RML27 0x800 /* Mailbox 27 Receive Message Lost */
3221#define nRML27 0x0
3222#define RML28 0x1000 /* Mailbox 28 Receive Message Lost */ 2666#define RML28 0x1000 /* Mailbox 28 Receive Message Lost */
3223#define nRML28 0x0
3224#define RML29 0x2000 /* Mailbox 29 Receive Message Lost */ 2667#define RML29 0x2000 /* Mailbox 29 Receive Message Lost */
3225#define nRML29 0x0
3226#define RML30 0x4000 /* Mailbox 30 Receive Message Lost */ 2668#define RML30 0x4000 /* Mailbox 30 Receive Message Lost */
3227#define nRML30 0x0
3228#define RML31 0x8000 /* Mailbox 31 Receive Message Lost */ 2669#define RML31 0x8000 /* Mailbox 31 Receive Message Lost */
3229#define nRML31 0x0
3230 2670
3231/* Bit masks for CAN0_OPSS1 */ 2671/* Bit masks for CAN0_OPSS1 */
3232 2672
3233#define OPSS0 0x1 /* Mailbox 0 Overwrite Protection/Single-Shot Transmission Enable */ 2673#define OPSS0 0x1 /* Mailbox 0 Overwrite Protection/Single-Shot Transmission Enable */
3234#define nOPSS0 0x0
3235#define OPSS1 0x2 /* Mailbox 1 Overwrite Protection/Single-Shot Transmission Enable */ 2674#define OPSS1 0x2 /* Mailbox 1 Overwrite Protection/Single-Shot Transmission Enable */
3236#define nOPSS1 0x0
3237#define OPSS2 0x4 /* Mailbox 2 Overwrite Protection/Single-Shot Transmission Enable */ 2675#define OPSS2 0x4 /* Mailbox 2 Overwrite Protection/Single-Shot Transmission Enable */
3238#define nOPSS2 0x0
3239#define OPSS3 0x8 /* Mailbox 3 Overwrite Protection/Single-Shot Transmission Enable */ 2676#define OPSS3 0x8 /* Mailbox 3 Overwrite Protection/Single-Shot Transmission Enable */
3240#define nOPSS3 0x0
3241#define OPSS4 0x10 /* Mailbox 4 Overwrite Protection/Single-Shot Transmission Enable */ 2677#define OPSS4 0x10 /* Mailbox 4 Overwrite Protection/Single-Shot Transmission Enable */
3242#define nOPSS4 0x0
3243#define OPSS5 0x20 /* Mailbox 5 Overwrite Protection/Single-Shot Transmission Enable */ 2678#define OPSS5 0x20 /* Mailbox 5 Overwrite Protection/Single-Shot Transmission Enable */
3244#define nOPSS5 0x0
3245#define OPSS6 0x40 /* Mailbox 6 Overwrite Protection/Single-Shot Transmission Enable */ 2679#define OPSS6 0x40 /* Mailbox 6 Overwrite Protection/Single-Shot Transmission Enable */
3246#define nOPSS6 0x0
3247#define OPSS7 0x80 /* Mailbox 7 Overwrite Protection/Single-Shot Transmission Enable */ 2680#define OPSS7 0x80 /* Mailbox 7 Overwrite Protection/Single-Shot Transmission Enable */
3248#define nOPSS7 0x0
3249#define OPSS8 0x100 /* Mailbox 8 Overwrite Protection/Single-Shot Transmission Enable */ 2681#define OPSS8 0x100 /* Mailbox 8 Overwrite Protection/Single-Shot Transmission Enable */
3250#define nOPSS8 0x0
3251#define OPSS9 0x200 /* Mailbox 9 Overwrite Protection/Single-Shot Transmission Enable */ 2682#define OPSS9 0x200 /* Mailbox 9 Overwrite Protection/Single-Shot Transmission Enable */
3252#define nOPSS9 0x0
3253#define OPSS10 0x400 /* Mailbox 10 Overwrite Protection/Single-Shot Transmission Enable */ 2683#define OPSS10 0x400 /* Mailbox 10 Overwrite Protection/Single-Shot Transmission Enable */
3254#define nOPSS10 0x0
3255#define OPSS11 0x800 /* Mailbox 11 Overwrite Protection/Single-Shot Transmission Enable */ 2684#define OPSS11 0x800 /* Mailbox 11 Overwrite Protection/Single-Shot Transmission Enable */
3256#define nOPSS11 0x0
3257#define OPSS12 0x1000 /* Mailbox 12 Overwrite Protection/Single-Shot Transmission Enable */ 2685#define OPSS12 0x1000 /* Mailbox 12 Overwrite Protection/Single-Shot Transmission Enable */
3258#define nOPSS12 0x0
3259#define OPSS13 0x2000 /* Mailbox 13 Overwrite Protection/Single-Shot Transmission Enable */ 2686#define OPSS13 0x2000 /* Mailbox 13 Overwrite Protection/Single-Shot Transmission Enable */
3260#define nOPSS13 0x0
3261#define OPSS14 0x4000 /* Mailbox 14 Overwrite Protection/Single-Shot Transmission Enable */ 2687#define OPSS14 0x4000 /* Mailbox 14 Overwrite Protection/Single-Shot Transmission Enable */
3262#define nOPSS14 0x0
3263#define OPSS15 0x8000 /* Mailbox 15 Overwrite Protection/Single-Shot Transmission Enable */ 2688#define OPSS15 0x8000 /* Mailbox 15 Overwrite Protection/Single-Shot Transmission Enable */
3264#define nOPSS15 0x0
3265 2689
3266/* Bit masks for CAN0_OPSS2 */ 2690/* Bit masks for CAN0_OPSS2 */
3267 2691
3268#define OPSS16 0x1 /* Mailbox 16 Overwrite Protection/Single-Shot Transmission Enable */ 2692#define OPSS16 0x1 /* Mailbox 16 Overwrite Protection/Single-Shot Transmission Enable */
3269#define nOPSS16 0x0
3270#define OPSS17 0x2 /* Mailbox 17 Overwrite Protection/Single-Shot Transmission Enable */ 2693#define OPSS17 0x2 /* Mailbox 17 Overwrite Protection/Single-Shot Transmission Enable */
3271#define nOPSS17 0x0
3272#define OPSS18 0x4 /* Mailbox 18 Overwrite Protection/Single-Shot Transmission Enable */ 2694#define OPSS18 0x4 /* Mailbox 18 Overwrite Protection/Single-Shot Transmission Enable */
3273#define nOPSS18 0x0
3274#define OPSS19 0x8 /* Mailbox 19 Overwrite Protection/Single-Shot Transmission Enable */ 2695#define OPSS19 0x8 /* Mailbox 19 Overwrite Protection/Single-Shot Transmission Enable */
3275#define nOPSS19 0x0
3276#define OPSS20 0x10 /* Mailbox 20 Overwrite Protection/Single-Shot Transmission Enable */ 2696#define OPSS20 0x10 /* Mailbox 20 Overwrite Protection/Single-Shot Transmission Enable */
3277#define nOPSS20 0x0
3278#define OPSS21 0x20 /* Mailbox 21 Overwrite Protection/Single-Shot Transmission Enable */ 2697#define OPSS21 0x20 /* Mailbox 21 Overwrite Protection/Single-Shot Transmission Enable */
3279#define nOPSS21 0x0
3280#define OPSS22 0x40 /* Mailbox 22 Overwrite Protection/Single-Shot Transmission Enable */ 2698#define OPSS22 0x40 /* Mailbox 22 Overwrite Protection/Single-Shot Transmission Enable */
3281#define nOPSS22 0x0
3282#define OPSS23 0x80 /* Mailbox 23 Overwrite Protection/Single-Shot Transmission Enable */ 2699#define OPSS23 0x80 /* Mailbox 23 Overwrite Protection/Single-Shot Transmission Enable */
3283#define nOPSS23 0x0
3284#define OPSS24 0x100 /* Mailbox 24 Overwrite Protection/Single-Shot Transmission Enable */ 2700#define OPSS24 0x100 /* Mailbox 24 Overwrite Protection/Single-Shot Transmission Enable */
3285#define nOPSS24 0x0
3286#define OPSS25 0x200 /* Mailbox 25 Overwrite Protection/Single-Shot Transmission Enable */ 2701#define OPSS25 0x200 /* Mailbox 25 Overwrite Protection/Single-Shot Transmission Enable */
3287#define nOPSS25 0x0
3288#define OPSS26 0x400 /* Mailbox 26 Overwrite Protection/Single-Shot Transmission Enable */ 2702#define OPSS26 0x400 /* Mailbox 26 Overwrite Protection/Single-Shot Transmission Enable */
3289#define nOPSS26 0x0
3290#define OPSS27 0x800 /* Mailbox 27 Overwrite Protection/Single-Shot Transmission Enable */ 2703#define OPSS27 0x800 /* Mailbox 27 Overwrite Protection/Single-Shot Transmission Enable */
3291#define nOPSS27 0x0
3292#define OPSS28 0x1000 /* Mailbox 28 Overwrite Protection/Single-Shot Transmission Enable */ 2704#define OPSS28 0x1000 /* Mailbox 28 Overwrite Protection/Single-Shot Transmission Enable */
3293#define nOPSS28 0x0
3294#define OPSS29 0x2000 /* Mailbox 29 Overwrite Protection/Single-Shot Transmission Enable */ 2705#define OPSS29 0x2000 /* Mailbox 29 Overwrite Protection/Single-Shot Transmission Enable */
3295#define nOPSS29 0x0
3296#define OPSS30 0x4000 /* Mailbox 30 Overwrite Protection/Single-Shot Transmission Enable */ 2706#define OPSS30 0x4000 /* Mailbox 30 Overwrite Protection/Single-Shot Transmission Enable */
3297#define nOPSS30 0x0
3298#define OPSS31 0x8000 /* Mailbox 31 Overwrite Protection/Single-Shot Transmission Enable */ 2707#define OPSS31 0x8000 /* Mailbox 31 Overwrite Protection/Single-Shot Transmission Enable */
3299#define nOPSS31 0x0
3300 2708
3301/* Bit masks for CAN0_TRS1 */ 2709/* Bit masks for CAN0_TRS1 */
3302 2710
3303#define TRS0 0x1 /* Mailbox 0 Transmit Request Set */ 2711#define TRS0 0x1 /* Mailbox 0 Transmit Request Set */
3304#define nTRS0 0x0
3305#define TRS1 0x2 /* Mailbox 1 Transmit Request Set */ 2712#define TRS1 0x2 /* Mailbox 1 Transmit Request Set */
3306#define nTRS1 0x0
3307#define TRS2 0x4 /* Mailbox 2 Transmit Request Set */ 2713#define TRS2 0x4 /* Mailbox 2 Transmit Request Set */
3308#define nTRS2 0x0
3309#define TRS3 0x8 /* Mailbox 3 Transmit Request Set */ 2714#define TRS3 0x8 /* Mailbox 3 Transmit Request Set */
3310#define nTRS3 0x0
3311#define TRS4 0x10 /* Mailbox 4 Transmit Request Set */ 2715#define TRS4 0x10 /* Mailbox 4 Transmit Request Set */
3312#define nTRS4 0x0
3313#define TRS5 0x20 /* Mailbox 5 Transmit Request Set */ 2716#define TRS5 0x20 /* Mailbox 5 Transmit Request Set */
3314#define nTRS5 0x0
3315#define TRS6 0x40 /* Mailbox 6 Transmit Request Set */ 2717#define TRS6 0x40 /* Mailbox 6 Transmit Request Set */
3316#define nTRS6 0x0
3317#define TRS7 0x80 /* Mailbox 7 Transmit Request Set */ 2718#define TRS7 0x80 /* Mailbox 7 Transmit Request Set */
3318#define nTRS7 0x0
3319#define TRS8 0x100 /* Mailbox 8 Transmit Request Set */ 2719#define TRS8 0x100 /* Mailbox 8 Transmit Request Set */
3320#define nTRS8 0x0
3321#define TRS9 0x200 /* Mailbox 9 Transmit Request Set */ 2720#define TRS9 0x200 /* Mailbox 9 Transmit Request Set */
3322#define nTRS9 0x0
3323#define TRS10 0x400 /* Mailbox 10 Transmit Request Set */ 2721#define TRS10 0x400 /* Mailbox 10 Transmit Request Set */
3324#define nTRS10 0x0
3325#define TRS11 0x800 /* Mailbox 11 Transmit Request Set */ 2722#define TRS11 0x800 /* Mailbox 11 Transmit Request Set */
3326#define nTRS11 0x0
3327#define TRS12 0x1000 /* Mailbox 12 Transmit Request Set */ 2723#define TRS12 0x1000 /* Mailbox 12 Transmit Request Set */
3328#define nTRS12 0x0
3329#define TRS13 0x2000 /* Mailbox 13 Transmit Request Set */ 2724#define TRS13 0x2000 /* Mailbox 13 Transmit Request Set */
3330#define nTRS13 0x0
3331#define TRS14 0x4000 /* Mailbox 14 Transmit Request Set */ 2725#define TRS14 0x4000 /* Mailbox 14 Transmit Request Set */
3332#define nTRS14 0x0
3333#define TRS15 0x8000 /* Mailbox 15 Transmit Request Set */ 2726#define TRS15 0x8000 /* Mailbox 15 Transmit Request Set */
3334#define nTRS15 0x0
3335 2727
3336/* Bit masks for CAN0_TRS2 */ 2728/* Bit masks for CAN0_TRS2 */
3337 2729
3338#define TRS16 0x1 /* Mailbox 16 Transmit Request Set */ 2730#define TRS16 0x1 /* Mailbox 16 Transmit Request Set */
3339#define nTRS16 0x0
3340#define TRS17 0x2 /* Mailbox 17 Transmit Request Set */ 2731#define TRS17 0x2 /* Mailbox 17 Transmit Request Set */
3341#define nTRS17 0x0
3342#define TRS18 0x4 /* Mailbox 18 Transmit Request Set */ 2732#define TRS18 0x4 /* Mailbox 18 Transmit Request Set */
3343#define nTRS18 0x0
3344#define TRS19 0x8 /* Mailbox 19 Transmit Request Set */ 2733#define TRS19 0x8 /* Mailbox 19 Transmit Request Set */
3345#define nTRS19 0x0
3346#define TRS20 0x10 /* Mailbox 20 Transmit Request Set */ 2734#define TRS20 0x10 /* Mailbox 20 Transmit Request Set */
3347#define nTRS20 0x0
3348#define TRS21 0x20 /* Mailbox 21 Transmit Request Set */ 2735#define TRS21 0x20 /* Mailbox 21 Transmit Request Set */
3349#define nTRS21 0x0
3350#define TRS22 0x40 /* Mailbox 22 Transmit Request Set */ 2736#define TRS22 0x40 /* Mailbox 22 Transmit Request Set */
3351#define nTRS22 0x0
3352#define TRS23 0x80 /* Mailbox 23 Transmit Request Set */ 2737#define TRS23 0x80 /* Mailbox 23 Transmit Request Set */
3353#define nTRS23 0x0
3354#define TRS24 0x100 /* Mailbox 24 Transmit Request Set */ 2738#define TRS24 0x100 /* Mailbox 24 Transmit Request Set */
3355#define nTRS24 0x0
3356#define TRS25 0x200 /* Mailbox 25 Transmit Request Set */ 2739#define TRS25 0x200 /* Mailbox 25 Transmit Request Set */
3357#define nTRS25 0x0
3358#define TRS26 0x400 /* Mailbox 26 Transmit Request Set */ 2740#define TRS26 0x400 /* Mailbox 26 Transmit Request Set */
3359#define nTRS26 0x0
3360#define TRS27 0x800 /* Mailbox 27 Transmit Request Set */ 2741#define TRS27 0x800 /* Mailbox 27 Transmit Request Set */
3361#define nTRS27 0x0
3362#define TRS28 0x1000 /* Mailbox 28 Transmit Request Set */ 2742#define TRS28 0x1000 /* Mailbox 28 Transmit Request Set */
3363#define nTRS28 0x0
3364#define TRS29 0x2000 /* Mailbox 29 Transmit Request Set */ 2743#define TRS29 0x2000 /* Mailbox 29 Transmit Request Set */
3365#define nTRS29 0x0
3366#define TRS30 0x4000 /* Mailbox 30 Transmit Request Set */ 2744#define TRS30 0x4000 /* Mailbox 30 Transmit Request Set */
3367#define nTRS30 0x0
3368#define TRS31 0x8000 /* Mailbox 31 Transmit Request Set */ 2745#define TRS31 0x8000 /* Mailbox 31 Transmit Request Set */
3369#define nTRS31 0x0
3370 2746
3371/* Bit masks for CAN0_TRR1 */ 2747/* Bit masks for CAN0_TRR1 */
3372 2748
3373#define TRR0 0x1 /* Mailbox 0 Transmit Request Reset */ 2749#define TRR0 0x1 /* Mailbox 0 Transmit Request Reset */
3374#define nTRR0 0x0
3375#define TRR1 0x2 /* Mailbox 1 Transmit Request Reset */ 2750#define TRR1 0x2 /* Mailbox 1 Transmit Request Reset */
3376#define nTRR1 0x0
3377#define TRR2 0x4 /* Mailbox 2 Transmit Request Reset */ 2751#define TRR2 0x4 /* Mailbox 2 Transmit Request Reset */
3378#define nTRR2 0x0
3379#define TRR3 0x8 /* Mailbox 3 Transmit Request Reset */ 2752#define TRR3 0x8 /* Mailbox 3 Transmit Request Reset */
3380#define nTRR3 0x0
3381#define TRR4 0x10 /* Mailbox 4 Transmit Request Reset */ 2753#define TRR4 0x10 /* Mailbox 4 Transmit Request Reset */
3382#define nTRR4 0x0
3383#define TRR5 0x20 /* Mailbox 5 Transmit Request Reset */ 2754#define TRR5 0x20 /* Mailbox 5 Transmit Request Reset */
3384#define nTRR5 0x0
3385#define TRR6 0x40 /* Mailbox 6 Transmit Request Reset */ 2755#define TRR6 0x40 /* Mailbox 6 Transmit Request Reset */
3386#define nTRR6 0x0
3387#define TRR7 0x80 /* Mailbox 7 Transmit Request Reset */ 2756#define TRR7 0x80 /* Mailbox 7 Transmit Request Reset */
3388#define nTRR7 0x0
3389#define TRR8 0x100 /* Mailbox 8 Transmit Request Reset */ 2757#define TRR8 0x100 /* Mailbox 8 Transmit Request Reset */
3390#define nTRR8 0x0
3391#define TRR9 0x200 /* Mailbox 9 Transmit Request Reset */ 2758#define TRR9 0x200 /* Mailbox 9 Transmit Request Reset */
3392#define nTRR9 0x0
3393#define TRR10 0x400 /* Mailbox 10 Transmit Request Reset */ 2759#define TRR10 0x400 /* Mailbox 10 Transmit Request Reset */
3394#define nTRR10 0x0
3395#define TRR11 0x800 /* Mailbox 11 Transmit Request Reset */ 2760#define TRR11 0x800 /* Mailbox 11 Transmit Request Reset */
3396#define nTRR11 0x0
3397#define TRR12 0x1000 /* Mailbox 12 Transmit Request Reset */ 2761#define TRR12 0x1000 /* Mailbox 12 Transmit Request Reset */
3398#define nTRR12 0x0
3399#define TRR13 0x2000 /* Mailbox 13 Transmit Request Reset */ 2762#define TRR13 0x2000 /* Mailbox 13 Transmit Request Reset */
3400#define nTRR13 0x0
3401#define TRR14 0x4000 /* Mailbox 14 Transmit Request Reset */ 2763#define TRR14 0x4000 /* Mailbox 14 Transmit Request Reset */
3402#define nTRR14 0x0
3403#define TRR15 0x8000 /* Mailbox 15 Transmit Request Reset */ 2764#define TRR15 0x8000 /* Mailbox 15 Transmit Request Reset */
3404#define nTRR15 0x0
3405 2765
3406/* Bit masks for CAN0_TRR2 */ 2766/* Bit masks for CAN0_TRR2 */
3407 2767
3408#define TRR16 0x1 /* Mailbox 16 Transmit Request Reset */ 2768#define TRR16 0x1 /* Mailbox 16 Transmit Request Reset */
3409#define nTRR16 0x0
3410#define TRR17 0x2 /* Mailbox 17 Transmit Request Reset */ 2769#define TRR17 0x2 /* Mailbox 17 Transmit Request Reset */
3411#define nTRR17 0x0
3412#define TRR18 0x4 /* Mailbox 18 Transmit Request Reset */ 2770#define TRR18 0x4 /* Mailbox 18 Transmit Request Reset */
3413#define nTRR18 0x0
3414#define TRR19 0x8 /* Mailbox 19 Transmit Request Reset */ 2771#define TRR19 0x8 /* Mailbox 19 Transmit Request Reset */
3415#define nTRR19 0x0
3416#define TRR20 0x10 /* Mailbox 20 Transmit Request Reset */ 2772#define TRR20 0x10 /* Mailbox 20 Transmit Request Reset */
3417#define nTRR20 0x0
3418#define TRR21 0x20 /* Mailbox 21 Transmit Request Reset */ 2773#define TRR21 0x20 /* Mailbox 21 Transmit Request Reset */
3419#define nTRR21 0x0
3420#define TRR22 0x40 /* Mailbox 22 Transmit Request Reset */ 2774#define TRR22 0x40 /* Mailbox 22 Transmit Request Reset */
3421#define nTRR22 0x0
3422#define TRR23 0x80 /* Mailbox 23 Transmit Request Reset */ 2775#define TRR23 0x80 /* Mailbox 23 Transmit Request Reset */
3423#define nTRR23 0x0
3424#define TRR24 0x100 /* Mailbox 24 Transmit Request Reset */ 2776#define TRR24 0x100 /* Mailbox 24 Transmit Request Reset */
3425#define nTRR24 0x0
3426#define TRR25 0x200 /* Mailbox 25 Transmit Request Reset */ 2777#define TRR25 0x200 /* Mailbox 25 Transmit Request Reset */
3427#define nTRR25 0x0
3428#define TRR26 0x400 /* Mailbox 26 Transmit Request Reset */ 2778#define TRR26 0x400 /* Mailbox 26 Transmit Request Reset */
3429#define nTRR26 0x0
3430#define TRR27 0x800 /* Mailbox 27 Transmit Request Reset */ 2779#define TRR27 0x800 /* Mailbox 27 Transmit Request Reset */
3431#define nTRR27 0x0
3432#define TRR28 0x1000 /* Mailbox 28 Transmit Request Reset */ 2780#define TRR28 0x1000 /* Mailbox 28 Transmit Request Reset */
3433#define nTRR28 0x0
3434#define TRR29 0x2000 /* Mailbox 29 Transmit Request Reset */ 2781#define TRR29 0x2000 /* Mailbox 29 Transmit Request Reset */
3435#define nTRR29 0x0
3436#define TRR30 0x4000 /* Mailbox 30 Transmit Request Reset */ 2782#define TRR30 0x4000 /* Mailbox 30 Transmit Request Reset */
3437#define nTRR30 0x0
3438#define TRR31 0x8000 /* Mailbox 31 Transmit Request Reset */ 2783#define TRR31 0x8000 /* Mailbox 31 Transmit Request Reset */
3439#define nTRR31 0x0
3440 2784
3441/* Bit masks for CAN0_AA1 */ 2785/* Bit masks for CAN0_AA1 */
3442 2786
3443#define AA0 0x1 /* Mailbox 0 Abort Acknowledge */ 2787#define AA0 0x1 /* Mailbox 0 Abort Acknowledge */
3444#define nAA0 0x0
3445#define AA1 0x2 /* Mailbox 1 Abort Acknowledge */ 2788#define AA1 0x2 /* Mailbox 1 Abort Acknowledge */
3446#define nAA1 0x0
3447#define AA2 0x4 /* Mailbox 2 Abort Acknowledge */ 2789#define AA2 0x4 /* Mailbox 2 Abort Acknowledge */
3448#define nAA2 0x0
3449#define AA3 0x8 /* Mailbox 3 Abort Acknowledge */ 2790#define AA3 0x8 /* Mailbox 3 Abort Acknowledge */
3450#define nAA3 0x0
3451#define AA4 0x10 /* Mailbox 4 Abort Acknowledge */ 2791#define AA4 0x10 /* Mailbox 4 Abort Acknowledge */
3452#define nAA4 0x0
3453#define AA5 0x20 /* Mailbox 5 Abort Acknowledge */ 2792#define AA5 0x20 /* Mailbox 5 Abort Acknowledge */
3454#define nAA5 0x0
3455#define AA6 0x40 /* Mailbox 6 Abort Acknowledge */ 2793#define AA6 0x40 /* Mailbox 6 Abort Acknowledge */
3456#define nAA6 0x0
3457#define AA7 0x80 /* Mailbox 7 Abort Acknowledge */ 2794#define AA7 0x80 /* Mailbox 7 Abort Acknowledge */
3458#define nAA7 0x0
3459#define AA8 0x100 /* Mailbox 8 Abort Acknowledge */ 2795#define AA8 0x100 /* Mailbox 8 Abort Acknowledge */
3460#define nAA8 0x0
3461#define AA9 0x200 /* Mailbox 9 Abort Acknowledge */ 2796#define AA9 0x200 /* Mailbox 9 Abort Acknowledge */
3462#define nAA9 0x0
3463#define AA10 0x400 /* Mailbox 10 Abort Acknowledge */ 2797#define AA10 0x400 /* Mailbox 10 Abort Acknowledge */
3464#define nAA10 0x0
3465#define AA11 0x800 /* Mailbox 11 Abort Acknowledge */ 2798#define AA11 0x800 /* Mailbox 11 Abort Acknowledge */
3466#define nAA11 0x0
3467#define AA12 0x1000 /* Mailbox 12 Abort Acknowledge */ 2799#define AA12 0x1000 /* Mailbox 12 Abort Acknowledge */
3468#define nAA12 0x0
3469#define AA13 0x2000 /* Mailbox 13 Abort Acknowledge */ 2800#define AA13 0x2000 /* Mailbox 13 Abort Acknowledge */
3470#define nAA13 0x0
3471#define AA14 0x4000 /* Mailbox 14 Abort Acknowledge */ 2801#define AA14 0x4000 /* Mailbox 14 Abort Acknowledge */
3472#define nAA14 0x0
3473#define AA15 0x8000 /* Mailbox 15 Abort Acknowledge */ 2802#define AA15 0x8000 /* Mailbox 15 Abort Acknowledge */
3474#define nAA15 0x0
3475 2803
3476/* Bit masks for CAN0_AA2 */ 2804/* Bit masks for CAN0_AA2 */
3477 2805
3478#define AA16 0x1 /* Mailbox 16 Abort Acknowledge */ 2806#define AA16 0x1 /* Mailbox 16 Abort Acknowledge */
3479#define nAA16 0x0
3480#define AA17 0x2 /* Mailbox 17 Abort Acknowledge */ 2807#define AA17 0x2 /* Mailbox 17 Abort Acknowledge */
3481#define nAA17 0x0
3482#define AA18 0x4 /* Mailbox 18 Abort Acknowledge */ 2808#define AA18 0x4 /* Mailbox 18 Abort Acknowledge */
3483#define nAA18 0x0
3484#define AA19 0x8 /* Mailbox 19 Abort Acknowledge */ 2809#define AA19 0x8 /* Mailbox 19 Abort Acknowledge */
3485#define nAA19 0x0
3486#define AA20 0x10 /* Mailbox 20 Abort Acknowledge */ 2810#define AA20 0x10 /* Mailbox 20 Abort Acknowledge */
3487#define nAA20 0x0
3488#define AA21 0x20 /* Mailbox 21 Abort Acknowledge */ 2811#define AA21 0x20 /* Mailbox 21 Abort Acknowledge */
3489#define nAA21 0x0
3490#define AA22 0x40 /* Mailbox 22 Abort Acknowledge */ 2812#define AA22 0x40 /* Mailbox 22 Abort Acknowledge */
3491#define nAA22 0x0
3492#define AA23 0x80 /* Mailbox 23 Abort Acknowledge */ 2813#define AA23 0x80 /* Mailbox 23 Abort Acknowledge */
3493#define nAA23 0x0
3494#define AA24 0x100 /* Mailbox 24 Abort Acknowledge */ 2814#define AA24 0x100 /* Mailbox 24 Abort Acknowledge */
3495#define nAA24 0x0
3496#define AA25 0x200 /* Mailbox 25 Abort Acknowledge */ 2815#define AA25 0x200 /* Mailbox 25 Abort Acknowledge */
3497#define nAA25 0x0
3498#define AA26 0x400 /* Mailbox 26 Abort Acknowledge */ 2816#define AA26 0x400 /* Mailbox 26 Abort Acknowledge */
3499#define nAA26 0x0
3500#define AA27 0x800 /* Mailbox 27 Abort Acknowledge */ 2817#define AA27 0x800 /* Mailbox 27 Abort Acknowledge */
3501#define nAA27 0x0
3502#define AA28 0x1000 /* Mailbox 28 Abort Acknowledge */ 2818#define AA28 0x1000 /* Mailbox 28 Abort Acknowledge */
3503#define nAA28 0x0
3504#define AA29 0x2000 /* Mailbox 29 Abort Acknowledge */ 2819#define AA29 0x2000 /* Mailbox 29 Abort Acknowledge */
3505#define nAA29 0x0
3506#define AA30 0x4000 /* Mailbox 30 Abort Acknowledge */ 2820#define AA30 0x4000 /* Mailbox 30 Abort Acknowledge */
3507#define nAA30 0x0
3508#define AA31 0x8000 /* Mailbox 31 Abort Acknowledge */ 2821#define AA31 0x8000 /* Mailbox 31 Abort Acknowledge */
3509#define nAA31 0x0
3510 2822
3511/* Bit masks for CAN0_TA1 */ 2823/* Bit masks for CAN0_TA1 */
3512 2824
3513#define TA0 0x1 /* Mailbox 0 Transmit Acknowledge */ 2825#define TA0 0x1 /* Mailbox 0 Transmit Acknowledge */
3514#define nTA0 0x0
3515#define TA1 0x2 /* Mailbox 1 Transmit Acknowledge */ 2826#define TA1 0x2 /* Mailbox 1 Transmit Acknowledge */
3516#define nTA1 0x0
3517#define TA2 0x4 /* Mailbox 2 Transmit Acknowledge */ 2827#define TA2 0x4 /* Mailbox 2 Transmit Acknowledge */
3518#define nTA2 0x0
3519#define TA3 0x8 /* Mailbox 3 Transmit Acknowledge */ 2828#define TA3 0x8 /* Mailbox 3 Transmit Acknowledge */
3520#define nTA3 0x0
3521#define TA4 0x10 /* Mailbox 4 Transmit Acknowledge */ 2829#define TA4 0x10 /* Mailbox 4 Transmit Acknowledge */
3522#define nTA4 0x0
3523#define TA5 0x20 /* Mailbox 5 Transmit Acknowledge */ 2830#define TA5 0x20 /* Mailbox 5 Transmit Acknowledge */
3524#define nTA5 0x0
3525#define TA6 0x40 /* Mailbox 6 Transmit Acknowledge */ 2831#define TA6 0x40 /* Mailbox 6 Transmit Acknowledge */
3526#define nTA6 0x0
3527#define TA7 0x80 /* Mailbox 7 Transmit Acknowledge */ 2832#define TA7 0x80 /* Mailbox 7 Transmit Acknowledge */
3528#define nTA7 0x0
3529#define TA8 0x100 /* Mailbox 8 Transmit Acknowledge */ 2833#define TA8 0x100 /* Mailbox 8 Transmit Acknowledge */
3530#define nTA8 0x0
3531#define TA9 0x200 /* Mailbox 9 Transmit Acknowledge */ 2834#define TA9 0x200 /* Mailbox 9 Transmit Acknowledge */
3532#define nTA9 0x0
3533#define TA10 0x400 /* Mailbox 10 Transmit Acknowledge */ 2835#define TA10 0x400 /* Mailbox 10 Transmit Acknowledge */
3534#define nTA10 0x0
3535#define TA11 0x800 /* Mailbox 11 Transmit Acknowledge */ 2836#define TA11 0x800 /* Mailbox 11 Transmit Acknowledge */
3536#define nTA11 0x0
3537#define TA12 0x1000 /* Mailbox 12 Transmit Acknowledge */ 2837#define TA12 0x1000 /* Mailbox 12 Transmit Acknowledge */
3538#define nTA12 0x0
3539#define TA13 0x2000 /* Mailbox 13 Transmit Acknowledge */ 2838#define TA13 0x2000 /* Mailbox 13 Transmit Acknowledge */
3540#define nTA13 0x0
3541#define TA14 0x4000 /* Mailbox 14 Transmit Acknowledge */ 2839#define TA14 0x4000 /* Mailbox 14 Transmit Acknowledge */
3542#define nTA14 0x0
3543#define TA15 0x8000 /* Mailbox 15 Transmit Acknowledge */ 2840#define TA15 0x8000 /* Mailbox 15 Transmit Acknowledge */
3544#define nTA15 0x0
3545 2841
3546/* Bit masks for CAN0_TA2 */ 2842/* Bit masks for CAN0_TA2 */
3547 2843
3548#define TA16 0x1 /* Mailbox 16 Transmit Acknowledge */ 2844#define TA16 0x1 /* Mailbox 16 Transmit Acknowledge */
3549#define nTA16 0x0
3550#define TA17 0x2 /* Mailbox 17 Transmit Acknowledge */ 2845#define TA17 0x2 /* Mailbox 17 Transmit Acknowledge */
3551#define nTA17 0x0
3552#define TA18 0x4 /* Mailbox 18 Transmit Acknowledge */ 2846#define TA18 0x4 /* Mailbox 18 Transmit Acknowledge */
3553#define nTA18 0x0
3554#define TA19 0x8 /* Mailbox 19 Transmit Acknowledge */ 2847#define TA19 0x8 /* Mailbox 19 Transmit Acknowledge */
3555#define nTA19 0x0
3556#define TA20 0x10 /* Mailbox 20 Transmit Acknowledge */ 2848#define TA20 0x10 /* Mailbox 20 Transmit Acknowledge */
3557#define nTA20 0x0
3558#define TA21 0x20 /* Mailbox 21 Transmit Acknowledge */ 2849#define TA21 0x20 /* Mailbox 21 Transmit Acknowledge */
3559#define nTA21 0x0
3560#define TA22 0x40 /* Mailbox 22 Transmit Acknowledge */ 2850#define TA22 0x40 /* Mailbox 22 Transmit Acknowledge */
3561#define nTA22 0x0
3562#define TA23 0x80 /* Mailbox 23 Transmit Acknowledge */ 2851#define TA23 0x80 /* Mailbox 23 Transmit Acknowledge */
3563#define nTA23 0x0
3564#define TA24 0x100 /* Mailbox 24 Transmit Acknowledge */ 2852#define TA24 0x100 /* Mailbox 24 Transmit Acknowledge */
3565#define nTA24 0x0
3566#define TA25 0x200 /* Mailbox 25 Transmit Acknowledge */ 2853#define TA25 0x200 /* Mailbox 25 Transmit Acknowledge */
3567#define nTA25 0x0
3568#define TA26 0x400 /* Mailbox 26 Transmit Acknowledge */ 2854#define TA26 0x400 /* Mailbox 26 Transmit Acknowledge */
3569#define nTA26 0x0
3570#define TA27 0x800 /* Mailbox 27 Transmit Acknowledge */ 2855#define TA27 0x800 /* Mailbox 27 Transmit Acknowledge */
3571#define nTA27 0x0
3572#define TA28 0x1000 /* Mailbox 28 Transmit Acknowledge */ 2856#define TA28 0x1000 /* Mailbox 28 Transmit Acknowledge */
3573#define nTA28 0x0
3574#define TA29 0x2000 /* Mailbox 29 Transmit Acknowledge */ 2857#define TA29 0x2000 /* Mailbox 29 Transmit Acknowledge */
3575#define nTA29 0x0
3576#define TA30 0x4000 /* Mailbox 30 Transmit Acknowledge */ 2858#define TA30 0x4000 /* Mailbox 30 Transmit Acknowledge */
3577#define nTA30 0x0
3578#define TA31 0x8000 /* Mailbox 31 Transmit Acknowledge */ 2859#define TA31 0x8000 /* Mailbox 31 Transmit Acknowledge */
3579#define nTA31 0x0
3580 2860
3581/* Bit masks for CAN0_RFH1 */ 2861/* Bit masks for CAN0_RFH1 */
3582 2862
3583#define RFH0 0x1 /* Mailbox 0 Remote Frame Handling Enable */ 2863#define RFH0 0x1 /* Mailbox 0 Remote Frame Handling Enable */
3584#define nRFH0 0x0
3585#define RFH1 0x2 /* Mailbox 1 Remote Frame Handling Enable */ 2864#define RFH1 0x2 /* Mailbox 1 Remote Frame Handling Enable */
3586#define nRFH1 0x0
3587#define RFH2 0x4 /* Mailbox 2 Remote Frame Handling Enable */ 2865#define RFH2 0x4 /* Mailbox 2 Remote Frame Handling Enable */
3588#define nRFH2 0x0
3589#define RFH3 0x8 /* Mailbox 3 Remote Frame Handling Enable */ 2866#define RFH3 0x8 /* Mailbox 3 Remote Frame Handling Enable */
3590#define nRFH3 0x0
3591#define RFH4 0x10 /* Mailbox 4 Remote Frame Handling Enable */ 2867#define RFH4 0x10 /* Mailbox 4 Remote Frame Handling Enable */
3592#define nRFH4 0x0
3593#define RFH5 0x20 /* Mailbox 5 Remote Frame Handling Enable */ 2868#define RFH5 0x20 /* Mailbox 5 Remote Frame Handling Enable */
3594#define nRFH5 0x0
3595#define RFH6 0x40 /* Mailbox 6 Remote Frame Handling Enable */ 2869#define RFH6 0x40 /* Mailbox 6 Remote Frame Handling Enable */
3596#define nRFH6 0x0
3597#define RFH7 0x80 /* Mailbox 7 Remote Frame Handling Enable */ 2870#define RFH7 0x80 /* Mailbox 7 Remote Frame Handling Enable */
3598#define nRFH7 0x0
3599#define RFH8 0x100 /* Mailbox 8 Remote Frame Handling Enable */ 2871#define RFH8 0x100 /* Mailbox 8 Remote Frame Handling Enable */
3600#define nRFH8 0x0
3601#define RFH9 0x200 /* Mailbox 9 Remote Frame Handling Enable */ 2872#define RFH9 0x200 /* Mailbox 9 Remote Frame Handling Enable */
3602#define nRFH9 0x0
3603#define RFH10 0x400 /* Mailbox 10 Remote Frame Handling Enable */ 2873#define RFH10 0x400 /* Mailbox 10 Remote Frame Handling Enable */
3604#define nRFH10 0x0
3605#define RFH11 0x800 /* Mailbox 11 Remote Frame Handling Enable */ 2874#define RFH11 0x800 /* Mailbox 11 Remote Frame Handling Enable */
3606#define nRFH11 0x0
3607#define RFH12 0x1000 /* Mailbox 12 Remote Frame Handling Enable */ 2875#define RFH12 0x1000 /* Mailbox 12 Remote Frame Handling Enable */
3608#define nRFH12 0x0
3609#define RFH13 0x2000 /* Mailbox 13 Remote Frame Handling Enable */ 2876#define RFH13 0x2000 /* Mailbox 13 Remote Frame Handling Enable */
3610#define nRFH13 0x0
3611#define RFH14 0x4000 /* Mailbox 14 Remote Frame Handling Enable */ 2877#define RFH14 0x4000 /* Mailbox 14 Remote Frame Handling Enable */
3612#define nRFH14 0x0
3613#define RFH15 0x8000 /* Mailbox 15 Remote Frame Handling Enable */ 2878#define RFH15 0x8000 /* Mailbox 15 Remote Frame Handling Enable */
3614#define nRFH15 0x0
3615 2879
3616/* Bit masks for CAN0_RFH2 */ 2880/* Bit masks for CAN0_RFH2 */
3617 2881
3618#define RFH16 0x1 /* Mailbox 16 Remote Frame Handling Enable */ 2882#define RFH16 0x1 /* Mailbox 16 Remote Frame Handling Enable */
3619#define nRFH16 0x0
3620#define RFH17 0x2 /* Mailbox 17 Remote Frame Handling Enable */ 2883#define RFH17 0x2 /* Mailbox 17 Remote Frame Handling Enable */
3621#define nRFH17 0x0
3622#define RFH18 0x4 /* Mailbox 18 Remote Frame Handling Enable */ 2884#define RFH18 0x4 /* Mailbox 18 Remote Frame Handling Enable */
3623#define nRFH18 0x0
3624#define RFH19 0x8 /* Mailbox 19 Remote Frame Handling Enable */ 2885#define RFH19 0x8 /* Mailbox 19 Remote Frame Handling Enable */
3625#define nRFH19 0x0
3626#define RFH20 0x10 /* Mailbox 20 Remote Frame Handling Enable */ 2886#define RFH20 0x10 /* Mailbox 20 Remote Frame Handling Enable */
3627#define nRFH20 0x0
3628#define RFH21 0x20 /* Mailbox 21 Remote Frame Handling Enable */ 2887#define RFH21 0x20 /* Mailbox 21 Remote Frame Handling Enable */
3629#define nRFH21 0x0
3630#define RFH22 0x40 /* Mailbox 22 Remote Frame Handling Enable */ 2888#define RFH22 0x40 /* Mailbox 22 Remote Frame Handling Enable */
3631#define nRFH22 0x0
3632#define RFH23 0x80 /* Mailbox 23 Remote Frame Handling Enable */ 2889#define RFH23 0x80 /* Mailbox 23 Remote Frame Handling Enable */
3633#define nRFH23 0x0
3634#define RFH24 0x100 /* Mailbox 24 Remote Frame Handling Enable */ 2890#define RFH24 0x100 /* Mailbox 24 Remote Frame Handling Enable */
3635#define nRFH24 0x0
3636#define RFH25 0x200 /* Mailbox 25 Remote Frame Handling Enable */ 2891#define RFH25 0x200 /* Mailbox 25 Remote Frame Handling Enable */
3637#define nRFH25 0x0
3638#define RFH26 0x400 /* Mailbox 26 Remote Frame Handling Enable */ 2892#define RFH26 0x400 /* Mailbox 26 Remote Frame Handling Enable */
3639#define nRFH26 0x0
3640#define RFH27 0x800 /* Mailbox 27 Remote Frame Handling Enable */ 2893#define RFH27 0x800 /* Mailbox 27 Remote Frame Handling Enable */
3641#define nRFH27 0x0
3642#define RFH28 0x1000 /* Mailbox 28 Remote Frame Handling Enable */ 2894#define RFH28 0x1000 /* Mailbox 28 Remote Frame Handling Enable */
3643#define nRFH28 0x0
3644#define RFH29 0x2000 /* Mailbox 29 Remote Frame Handling Enable */ 2895#define RFH29 0x2000 /* Mailbox 29 Remote Frame Handling Enable */
3645#define nRFH29 0x0
3646#define RFH30 0x4000 /* Mailbox 30 Remote Frame Handling Enable */ 2896#define RFH30 0x4000 /* Mailbox 30 Remote Frame Handling Enable */
3647#define nRFH30 0x0
3648#define RFH31 0x8000 /* Mailbox 31 Remote Frame Handling Enable */ 2897#define RFH31 0x8000 /* Mailbox 31 Remote Frame Handling Enable */
3649#define nRFH31 0x0
3650 2898
3651/* Bit masks for CAN0_MBIM1 */ 2899/* Bit masks for CAN0_MBIM1 */
3652 2900
3653#define MBIM0 0x1 /* Mailbox 0 Mailbox Interrupt Mask */ 2901#define MBIM0 0x1 /* Mailbox 0 Mailbox Interrupt Mask */
3654#define nMBIM0 0x0
3655#define MBIM1 0x2 /* Mailbox 1 Mailbox Interrupt Mask */ 2902#define MBIM1 0x2 /* Mailbox 1 Mailbox Interrupt Mask */
3656#define nMBIM1 0x0
3657#define MBIM2 0x4 /* Mailbox 2 Mailbox Interrupt Mask */ 2903#define MBIM2 0x4 /* Mailbox 2 Mailbox Interrupt Mask */
3658#define nMBIM2 0x0
3659#define MBIM3 0x8 /* Mailbox 3 Mailbox Interrupt Mask */ 2904#define MBIM3 0x8 /* Mailbox 3 Mailbox Interrupt Mask */
3660#define nMBIM3 0x0
3661#define MBIM4 0x10 /* Mailbox 4 Mailbox Interrupt Mask */ 2905#define MBIM4 0x10 /* Mailbox 4 Mailbox Interrupt Mask */
3662#define nMBIM4 0x0
3663#define MBIM5 0x20 /* Mailbox 5 Mailbox Interrupt Mask */ 2906#define MBIM5 0x20 /* Mailbox 5 Mailbox Interrupt Mask */
3664#define nMBIM5 0x0
3665#define MBIM6 0x40 /* Mailbox 6 Mailbox Interrupt Mask */ 2907#define MBIM6 0x40 /* Mailbox 6 Mailbox Interrupt Mask */
3666#define nMBIM6 0x0
3667#define MBIM7 0x80 /* Mailbox 7 Mailbox Interrupt Mask */ 2908#define MBIM7 0x80 /* Mailbox 7 Mailbox Interrupt Mask */
3668#define nMBIM7 0x0
3669#define MBIM8 0x100 /* Mailbox 8 Mailbox Interrupt Mask */ 2909#define MBIM8 0x100 /* Mailbox 8 Mailbox Interrupt Mask */
3670#define nMBIM8 0x0
3671#define MBIM9 0x200 /* Mailbox 9 Mailbox Interrupt Mask */ 2910#define MBIM9 0x200 /* Mailbox 9 Mailbox Interrupt Mask */
3672#define nMBIM9 0x0
3673#define MBIM10 0x400 /* Mailbox 10 Mailbox Interrupt Mask */ 2911#define MBIM10 0x400 /* Mailbox 10 Mailbox Interrupt Mask */
3674#define nMBIM10 0x0
3675#define MBIM11 0x800 /* Mailbox 11 Mailbox Interrupt Mask */ 2912#define MBIM11 0x800 /* Mailbox 11 Mailbox Interrupt Mask */
3676#define nMBIM11 0x0
3677#define MBIM12 0x1000 /* Mailbox 12 Mailbox Interrupt Mask */ 2913#define MBIM12 0x1000 /* Mailbox 12 Mailbox Interrupt Mask */
3678#define nMBIM12 0x0
3679#define MBIM13 0x2000 /* Mailbox 13 Mailbox Interrupt Mask */ 2914#define MBIM13 0x2000 /* Mailbox 13 Mailbox Interrupt Mask */
3680#define nMBIM13 0x0
3681#define MBIM14 0x4000 /* Mailbox 14 Mailbox Interrupt Mask */ 2915#define MBIM14 0x4000 /* Mailbox 14 Mailbox Interrupt Mask */
3682#define nMBIM14 0x0
3683#define MBIM15 0x8000 /* Mailbox 15 Mailbox Interrupt Mask */ 2916#define MBIM15 0x8000 /* Mailbox 15 Mailbox Interrupt Mask */
3684#define nMBIM15 0x0
3685 2917
3686/* Bit masks for CAN0_MBIM2 */ 2918/* Bit masks for CAN0_MBIM2 */
3687 2919
3688#define MBIM16 0x1 /* Mailbox 16 Mailbox Interrupt Mask */ 2920#define MBIM16 0x1 /* Mailbox 16 Mailbox Interrupt Mask */
3689#define nMBIM16 0x0
3690#define MBIM17 0x2 /* Mailbox 17 Mailbox Interrupt Mask */ 2921#define MBIM17 0x2 /* Mailbox 17 Mailbox Interrupt Mask */
3691#define nMBIM17 0x0
3692#define MBIM18 0x4 /* Mailbox 18 Mailbox Interrupt Mask */ 2922#define MBIM18 0x4 /* Mailbox 18 Mailbox Interrupt Mask */
3693#define nMBIM18 0x0
3694#define MBIM19 0x8 /* Mailbox 19 Mailbox Interrupt Mask */ 2923#define MBIM19 0x8 /* Mailbox 19 Mailbox Interrupt Mask */
3695#define nMBIM19 0x0
3696#define MBIM20 0x10 /* Mailbox 20 Mailbox Interrupt Mask */ 2924#define MBIM20 0x10 /* Mailbox 20 Mailbox Interrupt Mask */
3697#define nMBIM20 0x0
3698#define MBIM21 0x20 /* Mailbox 21 Mailbox Interrupt Mask */ 2925#define MBIM21 0x20 /* Mailbox 21 Mailbox Interrupt Mask */
3699#define nMBIM21 0x0
3700#define MBIM22 0x40 /* Mailbox 22 Mailbox Interrupt Mask */ 2926#define MBIM22 0x40 /* Mailbox 22 Mailbox Interrupt Mask */
3701#define nMBIM22 0x0
3702#define MBIM23 0x80 /* Mailbox 23 Mailbox Interrupt Mask */ 2927#define MBIM23 0x80 /* Mailbox 23 Mailbox Interrupt Mask */
3703#define nMBIM23 0x0
3704#define MBIM24 0x100 /* Mailbox 24 Mailbox Interrupt Mask */ 2928#define MBIM24 0x100 /* Mailbox 24 Mailbox Interrupt Mask */
3705#define nMBIM24 0x0
3706#define MBIM25 0x200 /* Mailbox 25 Mailbox Interrupt Mask */ 2929#define MBIM25 0x200 /* Mailbox 25 Mailbox Interrupt Mask */
3707#define nMBIM25 0x0
3708#define MBIM26 0x400 /* Mailbox 26 Mailbox Interrupt Mask */ 2930#define MBIM26 0x400 /* Mailbox 26 Mailbox Interrupt Mask */
3709#define nMBIM26 0x0
3710#define MBIM27 0x800 /* Mailbox 27 Mailbox Interrupt Mask */ 2931#define MBIM27 0x800 /* Mailbox 27 Mailbox Interrupt Mask */
3711#define nMBIM27 0x0
3712#define MBIM28 0x1000 /* Mailbox 28 Mailbox Interrupt Mask */ 2932#define MBIM28 0x1000 /* Mailbox 28 Mailbox Interrupt Mask */
3713#define nMBIM28 0x0
3714#define MBIM29 0x2000 /* Mailbox 29 Mailbox Interrupt Mask */ 2933#define MBIM29 0x2000 /* Mailbox 29 Mailbox Interrupt Mask */
3715#define nMBIM29 0x0
3716#define MBIM30 0x4000 /* Mailbox 30 Mailbox Interrupt Mask */ 2934#define MBIM30 0x4000 /* Mailbox 30 Mailbox Interrupt Mask */
3717#define nMBIM30 0x0
3718#define MBIM31 0x8000 /* Mailbox 31 Mailbox Interrupt Mask */ 2935#define MBIM31 0x8000 /* Mailbox 31 Mailbox Interrupt Mask */
3719#define nMBIM31 0x0
3720 2936
3721/* Bit masks for CAN0_MBTIF1 */ 2937/* Bit masks for CAN0_MBTIF1 */
3722 2938
3723#define MBTIF0 0x1 /* Mailbox 0 Mailbox Transmit Interrupt Flag */ 2939#define MBTIF0 0x1 /* Mailbox 0 Mailbox Transmit Interrupt Flag */
3724#define nMBTIF0 0x0
3725#define MBTIF1 0x2 /* Mailbox 1 Mailbox Transmit Interrupt Flag */ 2940#define MBTIF1 0x2 /* Mailbox 1 Mailbox Transmit Interrupt Flag */
3726#define nMBTIF1 0x0
3727#define MBTIF2 0x4 /* Mailbox 2 Mailbox Transmit Interrupt Flag */ 2941#define MBTIF2 0x4 /* Mailbox 2 Mailbox Transmit Interrupt Flag */
3728#define nMBTIF2 0x0
3729#define MBTIF3 0x8 /* Mailbox 3 Mailbox Transmit Interrupt Flag */ 2942#define MBTIF3 0x8 /* Mailbox 3 Mailbox Transmit Interrupt Flag */
3730#define nMBTIF3 0x0
3731#define MBTIF4 0x10 /* Mailbox 4 Mailbox Transmit Interrupt Flag */ 2943#define MBTIF4 0x10 /* Mailbox 4 Mailbox Transmit Interrupt Flag */
3732#define nMBTIF4 0x0
3733#define MBTIF5 0x20 /* Mailbox 5 Mailbox Transmit Interrupt Flag */ 2944#define MBTIF5 0x20 /* Mailbox 5 Mailbox Transmit Interrupt Flag */
3734#define nMBTIF5 0x0
3735#define MBTIF6 0x40 /* Mailbox 6 Mailbox Transmit Interrupt Flag */ 2945#define MBTIF6 0x40 /* Mailbox 6 Mailbox Transmit Interrupt Flag */
3736#define nMBTIF6 0x0
3737#define MBTIF7 0x80 /* Mailbox 7 Mailbox Transmit Interrupt Flag */ 2946#define MBTIF7 0x80 /* Mailbox 7 Mailbox Transmit Interrupt Flag */
3738#define nMBTIF7 0x0
3739#define MBTIF8 0x100 /* Mailbox 8 Mailbox Transmit Interrupt Flag */ 2947#define MBTIF8 0x100 /* Mailbox 8 Mailbox Transmit Interrupt Flag */
3740#define nMBTIF8 0x0
3741#define MBTIF9 0x200 /* Mailbox 9 Mailbox Transmit Interrupt Flag */ 2948#define MBTIF9 0x200 /* Mailbox 9 Mailbox Transmit Interrupt Flag */
3742#define nMBTIF9 0x0
3743#define MBTIF10 0x400 /* Mailbox 10 Mailbox Transmit Interrupt Flag */ 2949#define MBTIF10 0x400 /* Mailbox 10 Mailbox Transmit Interrupt Flag */
3744#define nMBTIF10 0x0
3745#define MBTIF11 0x800 /* Mailbox 11 Mailbox Transmit Interrupt Flag */ 2950#define MBTIF11 0x800 /* Mailbox 11 Mailbox Transmit Interrupt Flag */
3746#define nMBTIF11 0x0
3747#define MBTIF12 0x1000 /* Mailbox 12 Mailbox Transmit Interrupt Flag */ 2951#define MBTIF12 0x1000 /* Mailbox 12 Mailbox Transmit Interrupt Flag */
3748#define nMBTIF12 0x0
3749#define MBTIF13 0x2000 /* Mailbox 13 Mailbox Transmit Interrupt Flag */ 2952#define MBTIF13 0x2000 /* Mailbox 13 Mailbox Transmit Interrupt Flag */
3750#define nMBTIF13 0x0
3751#define MBTIF14 0x4000 /* Mailbox 14 Mailbox Transmit Interrupt Flag */ 2953#define MBTIF14 0x4000 /* Mailbox 14 Mailbox Transmit Interrupt Flag */
3752#define nMBTIF14 0x0
3753#define MBTIF15 0x8000 /* Mailbox 15 Mailbox Transmit Interrupt Flag */ 2954#define MBTIF15 0x8000 /* Mailbox 15 Mailbox Transmit Interrupt Flag */
3754#define nMBTIF15 0x0
3755 2955
3756/* Bit masks for CAN0_MBTIF2 */ 2956/* Bit masks for CAN0_MBTIF2 */
3757 2957
3758#define MBTIF16 0x1 /* Mailbox 16 Mailbox Transmit Interrupt Flag */ 2958#define MBTIF16 0x1 /* Mailbox 16 Mailbox Transmit Interrupt Flag */
3759#define nMBTIF16 0x0
3760#define MBTIF17 0x2 /* Mailbox 17 Mailbox Transmit Interrupt Flag */ 2959#define MBTIF17 0x2 /* Mailbox 17 Mailbox Transmit Interrupt Flag */
3761#define nMBTIF17 0x0
3762#define MBTIF18 0x4 /* Mailbox 18 Mailbox Transmit Interrupt Flag */ 2960#define MBTIF18 0x4 /* Mailbox 18 Mailbox Transmit Interrupt Flag */
3763#define nMBTIF18 0x0
3764#define MBTIF19 0x8 /* Mailbox 19 Mailbox Transmit Interrupt Flag */ 2961#define MBTIF19 0x8 /* Mailbox 19 Mailbox Transmit Interrupt Flag */
3765#define nMBTIF19 0x0
3766#define MBTIF20 0x10 /* Mailbox 20 Mailbox Transmit Interrupt Flag */ 2962#define MBTIF20 0x10 /* Mailbox 20 Mailbox Transmit Interrupt Flag */
3767#define nMBTIF20 0x0
3768#define MBTIF21 0x20 /* Mailbox 21 Mailbox Transmit Interrupt Flag */ 2963#define MBTIF21 0x20 /* Mailbox 21 Mailbox Transmit Interrupt Flag */
3769#define nMBTIF21 0x0
3770#define MBTIF22 0x40 /* Mailbox 22 Mailbox Transmit Interrupt Flag */ 2964#define MBTIF22 0x40 /* Mailbox 22 Mailbox Transmit Interrupt Flag */
3771#define nMBTIF22 0x0
3772#define MBTIF23 0x80 /* Mailbox 23 Mailbox Transmit Interrupt Flag */ 2965#define MBTIF23 0x80 /* Mailbox 23 Mailbox Transmit Interrupt Flag */
3773#define nMBTIF23 0x0
3774#define MBTIF24 0x100 /* Mailbox 24 Mailbox Transmit Interrupt Flag */ 2966#define MBTIF24 0x100 /* Mailbox 24 Mailbox Transmit Interrupt Flag */
3775#define nMBTIF24 0x0
3776#define MBTIF25 0x200 /* Mailbox 25 Mailbox Transmit Interrupt Flag */ 2967#define MBTIF25 0x200 /* Mailbox 25 Mailbox Transmit Interrupt Flag */
3777#define nMBTIF25 0x0
3778#define MBTIF26 0x400 /* Mailbox 26 Mailbox Transmit Interrupt Flag */ 2968#define MBTIF26 0x400 /* Mailbox 26 Mailbox Transmit Interrupt Flag */
3779#define nMBTIF26 0x0
3780#define MBTIF27 0x800 /* Mailbox 27 Mailbox Transmit Interrupt Flag */ 2969#define MBTIF27 0x800 /* Mailbox 27 Mailbox Transmit Interrupt Flag */
3781#define nMBTIF27 0x0
3782#define MBTIF28 0x1000 /* Mailbox 28 Mailbox Transmit Interrupt Flag */ 2970#define MBTIF28 0x1000 /* Mailbox 28 Mailbox Transmit Interrupt Flag */
3783#define nMBTIF28 0x0
3784#define MBTIF29 0x2000 /* Mailbox 29 Mailbox Transmit Interrupt Flag */ 2971#define MBTIF29 0x2000 /* Mailbox 29 Mailbox Transmit Interrupt Flag */
3785#define nMBTIF29 0x0
3786#define MBTIF30 0x4000 /* Mailbox 30 Mailbox Transmit Interrupt Flag */ 2972#define MBTIF30 0x4000 /* Mailbox 30 Mailbox Transmit Interrupt Flag */
3787#define nMBTIF30 0x0
3788#define MBTIF31 0x8000 /* Mailbox 31 Mailbox Transmit Interrupt Flag */ 2973#define MBTIF31 0x8000 /* Mailbox 31 Mailbox Transmit Interrupt Flag */
3789#define nMBTIF31 0x0
3790 2974
3791/* Bit masks for CAN0_MBRIF1 */ 2975/* Bit masks for CAN0_MBRIF1 */
3792 2976
3793#define MBRIF0 0x1 /* Mailbox 0 Mailbox Receive Interrupt Flag */ 2977#define MBRIF0 0x1 /* Mailbox 0 Mailbox Receive Interrupt Flag */
3794#define nMBRIF0 0x0
3795#define MBRIF1 0x2 /* Mailbox 1 Mailbox Receive Interrupt Flag */ 2978#define MBRIF1 0x2 /* Mailbox 1 Mailbox Receive Interrupt Flag */
3796#define nMBRIF1 0x0
3797#define MBRIF2 0x4 /* Mailbox 2 Mailbox Receive Interrupt Flag */ 2979#define MBRIF2 0x4 /* Mailbox 2 Mailbox Receive Interrupt Flag */
3798#define nMBRIF2 0x0
3799#define MBRIF3 0x8 /* Mailbox 3 Mailbox Receive Interrupt Flag */ 2980#define MBRIF3 0x8 /* Mailbox 3 Mailbox Receive Interrupt Flag */
3800#define nMBRIF3 0x0
3801#define MBRIF4 0x10 /* Mailbox 4 Mailbox Receive Interrupt Flag */ 2981#define MBRIF4 0x10 /* Mailbox 4 Mailbox Receive Interrupt Flag */
3802#define nMBRIF4 0x0
3803#define MBRIF5 0x20 /* Mailbox 5 Mailbox Receive Interrupt Flag */ 2982#define MBRIF5 0x20 /* Mailbox 5 Mailbox Receive Interrupt Flag */
3804#define nMBRIF5 0x0
3805#define MBRIF6 0x40 /* Mailbox 6 Mailbox Receive Interrupt Flag */ 2983#define MBRIF6 0x40 /* Mailbox 6 Mailbox Receive Interrupt Flag */
3806#define nMBRIF6 0x0
3807#define MBRIF7 0x80 /* Mailbox 7 Mailbox Receive Interrupt Flag */ 2984#define MBRIF7 0x80 /* Mailbox 7 Mailbox Receive Interrupt Flag */
3808#define nMBRIF7 0x0
3809#define MBRIF8 0x100 /* Mailbox 8 Mailbox Receive Interrupt Flag */ 2985#define MBRIF8 0x100 /* Mailbox 8 Mailbox Receive Interrupt Flag */
3810#define nMBRIF8 0x0
3811#define MBRIF9 0x200 /* Mailbox 9 Mailbox Receive Interrupt Flag */ 2986#define MBRIF9 0x200 /* Mailbox 9 Mailbox Receive Interrupt Flag */
3812#define nMBRIF9 0x0
3813#define MBRIF10 0x400 /* Mailbox 10 Mailbox Receive Interrupt Flag */ 2987#define MBRIF10 0x400 /* Mailbox 10 Mailbox Receive Interrupt Flag */
3814#define nMBRIF10 0x0
3815#define MBRIF11 0x800 /* Mailbox 11 Mailbox Receive Interrupt Flag */ 2988#define MBRIF11 0x800 /* Mailbox 11 Mailbox Receive Interrupt Flag */
3816#define nMBRIF11 0x0
3817#define MBRIF12 0x1000 /* Mailbox 12 Mailbox Receive Interrupt Flag */ 2989#define MBRIF12 0x1000 /* Mailbox 12 Mailbox Receive Interrupt Flag */
3818#define nMBRIF12 0x0
3819#define MBRIF13 0x2000 /* Mailbox 13 Mailbox Receive Interrupt Flag */ 2990#define MBRIF13 0x2000 /* Mailbox 13 Mailbox Receive Interrupt Flag */
3820#define nMBRIF13 0x0
3821#define MBRIF14 0x4000 /* Mailbox 14 Mailbox Receive Interrupt Flag */ 2991#define MBRIF14 0x4000 /* Mailbox 14 Mailbox Receive Interrupt Flag */
3822#define nMBRIF14 0x0
3823#define MBRIF15 0x8000 /* Mailbox 15 Mailbox Receive Interrupt Flag */ 2992#define MBRIF15 0x8000 /* Mailbox 15 Mailbox Receive Interrupt Flag */
3824#define nMBRIF15 0x0
3825 2993
3826/* Bit masks for CAN0_MBRIF2 */ 2994/* Bit masks for CAN0_MBRIF2 */
3827 2995
3828#define MBRIF16 0x1 /* Mailbox 16 Mailbox Receive Interrupt Flag */ 2996#define MBRIF16 0x1 /* Mailbox 16 Mailbox Receive Interrupt Flag */
3829#define nMBRIF16 0x0
3830#define MBRIF17 0x2 /* Mailbox 17 Mailbox Receive Interrupt Flag */ 2997#define MBRIF17 0x2 /* Mailbox 17 Mailbox Receive Interrupt Flag */
3831#define nMBRIF17 0x0
3832#define MBRIF18 0x4 /* Mailbox 18 Mailbox Receive Interrupt Flag */ 2998#define MBRIF18 0x4 /* Mailbox 18 Mailbox Receive Interrupt Flag */
3833#define nMBRIF18 0x0
3834#define MBRIF19 0x8 /* Mailbox 19 Mailbox Receive Interrupt Flag */ 2999#define MBRIF19 0x8 /* Mailbox 19 Mailbox Receive Interrupt Flag */
3835#define nMBRIF19 0x0
3836#define MBRIF20 0x10 /* Mailbox 20 Mailbox Receive Interrupt Flag */ 3000#define MBRIF20 0x10 /* Mailbox 20 Mailbox Receive Interrupt Flag */
3837#define nMBRIF20 0x0
3838#define MBRIF21 0x20 /* Mailbox 21 Mailbox Receive Interrupt Flag */ 3001#define MBRIF21 0x20 /* Mailbox 21 Mailbox Receive Interrupt Flag */
3839#define nMBRIF21 0x0
3840#define MBRIF22 0x40 /* Mailbox 22 Mailbox Receive Interrupt Flag */ 3002#define MBRIF22 0x40 /* Mailbox 22 Mailbox Receive Interrupt Flag */
3841#define nMBRIF22 0x0
3842#define MBRIF23 0x80 /* Mailbox 23 Mailbox Receive Interrupt Flag */ 3003#define MBRIF23 0x80 /* Mailbox 23 Mailbox Receive Interrupt Flag */
3843#define nMBRIF23 0x0
3844#define MBRIF24 0x100 /* Mailbox 24 Mailbox Receive Interrupt Flag */ 3004#define MBRIF24 0x100 /* Mailbox 24 Mailbox Receive Interrupt Flag */
3845#define nMBRIF24 0x0
3846#define MBRIF25 0x200 /* Mailbox 25 Mailbox Receive Interrupt Flag */ 3005#define MBRIF25 0x200 /* Mailbox 25 Mailbox Receive Interrupt Flag */
3847#define nMBRIF25 0x0
3848#define MBRIF26 0x400 /* Mailbox 26 Mailbox Receive Interrupt Flag */ 3006#define MBRIF26 0x400 /* Mailbox 26 Mailbox Receive Interrupt Flag */
3849#define nMBRIF26 0x0
3850#define MBRIF27 0x800 /* Mailbox 27 Mailbox Receive Interrupt Flag */ 3007#define MBRIF27 0x800 /* Mailbox 27 Mailbox Receive Interrupt Flag */
3851#define nMBRIF27 0x0
3852#define MBRIF28 0x1000 /* Mailbox 28 Mailbox Receive Interrupt Flag */ 3008#define MBRIF28 0x1000 /* Mailbox 28 Mailbox Receive Interrupt Flag */
3853#define nMBRIF28 0x0
3854#define MBRIF29 0x2000 /* Mailbox 29 Mailbox Receive Interrupt Flag */ 3009#define MBRIF29 0x2000 /* Mailbox 29 Mailbox Receive Interrupt Flag */
3855#define nMBRIF29 0x0
3856#define MBRIF30 0x4000 /* Mailbox 30 Mailbox Receive Interrupt Flag */ 3010#define MBRIF30 0x4000 /* Mailbox 30 Mailbox Receive Interrupt Flag */
3857#define nMBRIF30 0x0
3858#define MBRIF31 0x8000 /* Mailbox 31 Mailbox Receive Interrupt Flag */ 3011#define MBRIF31 0x8000 /* Mailbox 31 Mailbox Receive Interrupt Flag */
3859#define nMBRIF31 0x0
3860 3012
3861/* Bit masks for EPPIx_STATUS */ 3013/* Bit masks for EPPIx_STATUS */
3862 3014
3863#define CFIFO_ERR 0x1 /* Chroma FIFO Error */ 3015#define CFIFO_ERR 0x1 /* Chroma FIFO Error */
3864#define nCFIFO_ERR 0x0
3865#define YFIFO_ERR 0x2 /* Luma FIFO Error */ 3016#define YFIFO_ERR 0x2 /* Luma FIFO Error */
3866#define nYFIFO_ERR 0x0
3867#define LTERR_OVR 0x4 /* Line Track Overflow */ 3017#define LTERR_OVR 0x4 /* Line Track Overflow */
3868#define nLTERR_OVR 0x0
3869#define LTERR_UNDR 0x8 /* Line Track Underflow */ 3018#define LTERR_UNDR 0x8 /* Line Track Underflow */
3870#define nLTERR_UNDR 0x0
3871#define FTERR_OVR 0x10 /* Frame Track Overflow */ 3019#define FTERR_OVR 0x10 /* Frame Track Overflow */
3872#define nFTERR_OVR 0x0
3873#define FTERR_UNDR 0x20 /* Frame Track Underflow */ 3020#define FTERR_UNDR 0x20 /* Frame Track Underflow */
3874#define nFTERR_UNDR 0x0
3875#define ERR_NCOR 0x40 /* Preamble Error Not Corrected */ 3021#define ERR_NCOR 0x40 /* Preamble Error Not Corrected */
3876#define nERR_NCOR 0x0
3877#define DMA1URQ 0x80 /* DMA1 Urgent Request */ 3022#define DMA1URQ 0x80 /* DMA1 Urgent Request */
3878#define nDMA1URQ 0x0
3879#define DMA0URQ 0x100 /* DMA0 Urgent Request */ 3023#define DMA0URQ 0x100 /* DMA0 Urgent Request */
3880#define nDMA0URQ 0x0
3881#define ERR_DET 0x4000 /* Preamble Error Detected */ 3024#define ERR_DET 0x4000 /* Preamble Error Detected */
3882#define nERR_DET 0x0
3883#define FLD 0x8000 /* Field */ 3025#define FLD 0x8000 /* Field */
3884#define nFLD 0x0
3885 3026
3886/* Bit masks for EPPIx_CONTROL */ 3027/* Bit masks for EPPIx_CONTROL */
3887 3028
3888#define EPPI_EN 0x1 /* Enable */ 3029#define EPPI_EN 0x1 /* Enable */
3889#define nEPPI_EN 0x0
3890#define EPPI_DIR 0x2 /* Direction */ 3030#define EPPI_DIR 0x2 /* Direction */
3891#define nEPPI_DIR 0x0
3892#define XFR_TYPE 0xc /* Operating Mode */ 3031#define XFR_TYPE 0xc /* Operating Mode */
3893#define FS_CFG 0x30 /* Frame Sync Configuration */ 3032#define FS_CFG 0x30 /* Frame Sync Configuration */
3894#define FLD_SEL 0x40 /* Field Select/Trigger */ 3033#define FLD_SEL 0x40 /* Field Select/Trigger */
3895#define nFLD_SEL 0x0
3896#define ITU_TYPE 0x80 /* ITU Interlaced or Progressive */ 3034#define ITU_TYPE 0x80 /* ITU Interlaced or Progressive */
3897#define nITU_TYPE 0x0
3898#define BLANKGEN 0x100 /* ITU Output Mode with Internal Blanking Generation */ 3035#define BLANKGEN 0x100 /* ITU Output Mode with Internal Blanking Generation */
3899#define nBLANKGEN 0x0
3900#define ICLKGEN 0x200 /* Internal Clock Generation */ 3036#define ICLKGEN 0x200 /* Internal Clock Generation */
3901#define nICLKGEN 0x0
3902#define IFSGEN 0x400 /* Internal Frame Sync Generation */ 3037#define IFSGEN 0x400 /* Internal Frame Sync Generation */
3903#define nIFSGEN 0x0
3904#define POLC 0x1800 /* Frame Sync and Data Driving/Sampling Edges */ 3038#define POLC 0x1800 /* Frame Sync and Data Driving/Sampling Edges */
3905#define POLS 0x6000 /* Frame Sync Polarity */ 3039#define POLS 0x6000 /* Frame Sync Polarity */
3906#define DLENGTH 0x38000 /* Data Length */ 3040#define DLENGTH 0x38000 /* Data Length */
3907#define SKIP_EN 0x40000 /* Skip Enable */ 3041#define SKIP_EN 0x40000 /* Skip Enable */
3908#define nSKIP_EN 0x0
3909#define SKIP_EO 0x80000 /* Skip Even or Odd */ 3042#define SKIP_EO 0x80000 /* Skip Even or Odd */
3910#define nSKIP_EO 0x0
3911#define PACKEN 0x100000 /* Packing/Unpacking Enable */ 3043#define PACKEN 0x100000 /* Packing/Unpacking Enable */
3912#define nPACKEN 0x0
3913#define SWAPEN 0x200000 /* Swap Enable */ 3044#define SWAPEN 0x200000 /* Swap Enable */
3914#define nSWAPEN 0x0
3915#define SIGN_EXT 0x400000 /* Sign Extension or Zero-filled / Data Split Format */ 3045#define SIGN_EXT 0x400000 /* Sign Extension or Zero-filled / Data Split Format */
3916#define nSIGN_EXT 0x0
3917#define SPLT_EVEN_ODD 0x800000 /* Split Even and Odd Data Samples */ 3046#define SPLT_EVEN_ODD 0x800000 /* Split Even and Odd Data Samples */
3918#define nSPLT_EVEN_ODD 0x0
3919#define SUBSPLT_ODD 0x1000000 /* Sub-split Odd Samples */ 3047#define SUBSPLT_ODD 0x1000000 /* Sub-split Odd Samples */
3920#define nSUBSPLT_ODD 0x0
3921#define DMACFG 0x2000000 /* One or Two DMA Channels Mode */ 3048#define DMACFG 0x2000000 /* One or Two DMA Channels Mode */
3922#define nDMACFG 0x0
3923#define RGB_FMT_EN 0x4000000 /* RGB Formatting Enable */ 3049#define RGB_FMT_EN 0x4000000 /* RGB Formatting Enable */
3924#define nRGB_FMT_EN 0x0
3925#define FIFO_RWM 0x18000000 /* FIFO Regular Watermarks */ 3050#define FIFO_RWM 0x18000000 /* FIFO Regular Watermarks */
3926#define FIFO_UWM 0x60000000 /* FIFO Urgent Watermarks */ 3051#define FIFO_UWM 0x60000000 /* FIFO Urgent Watermarks */
3927 3052
3053#define DLEN_8 (0 << 15) /* 000 - 8 bits */
3054#define DLEN_10 (1 << 15) /* 001 - 10 bits */
3055#define DLEN_12 (2 << 15) /* 010 - 12 bits */
3056#define DLEN_14 (3 << 15) /* 011 - 14 bits */
3057#define DLEN_16 (4 << 15) /* 100 - 16 bits */
3058#define DLEN_18 (5 << 15) /* 101 - 18 bits */
3059#define DLEN_24 (6 << 15) /* 110 - 24 bits */
3060
3061
3928/* Bit masks for EPPIx_FS2W_LVB */ 3062/* Bit masks for EPPIx_FS2W_LVB */
3929 3063
3930#define F1VB_BD 0xff /* Vertical Blanking before Field 1 Active Data */ 3064#define F1VB_BD 0xff /* Vertical Blanking before Field 1 Active Data */
@@ -3951,60 +3085,36 @@
3951/* Bit masks for SPIx_CTL */ 3085/* Bit masks for SPIx_CTL */
3952 3086
3953#define SPE 0x4000 /* SPI Enable */ 3087#define SPE 0x4000 /* SPI Enable */
3954#define nSPE 0x0
3955#define WOM 0x2000 /* Write Open Drain Master */ 3088#define WOM 0x2000 /* Write Open Drain Master */
3956#define nWOM 0x0
3957#define MSTR 0x1000 /* Master Mode */ 3089#define MSTR 0x1000 /* Master Mode */
3958#define nMSTR 0x0
3959#define CPOL 0x800 /* Clock Polarity */ 3090#define CPOL 0x800 /* Clock Polarity */
3960#define nCPOL 0x0
3961#define CPHA 0x400 /* Clock Phase */ 3091#define CPHA 0x400 /* Clock Phase */
3962#define nCPHA 0x0
3963#define LSBF 0x200 /* LSB First */ 3092#define LSBF 0x200 /* LSB First */
3964#define nLSBF 0x0
3965#define SIZE 0x100 /* Size of Words */ 3093#define SIZE 0x100 /* Size of Words */
3966#define nSIZE 0x0
3967#define EMISO 0x20 /* Enable MISO Output */ 3094#define EMISO 0x20 /* Enable MISO Output */
3968#define nEMISO 0x0
3969#define PSSE 0x10 /* Slave-Select Enable */ 3095#define PSSE 0x10 /* Slave-Select Enable */
3970#define nPSSE 0x0
3971#define GM 0x8 /* Get More Data */ 3096#define GM 0x8 /* Get More Data */
3972#define nGM 0x0
3973#define SZ 0x4 /* Send Zero */ 3097#define SZ 0x4 /* Send Zero */
3974#define nSZ 0x0
3975#define TIMOD 0x3 /* Transfer Initiation Mode */ 3098#define TIMOD 0x3 /* Transfer Initiation Mode */
3976 3099
3977/* Bit masks for SPIx_FLG */ 3100/* Bit masks for SPIx_FLG */
3978 3101
3979#define FLS1 0x2 /* Slave Select Enable 1 */ 3102#define FLS1 0x2 /* Slave Select Enable 1 */
3980#define nFLS1 0x0
3981#define FLS2 0x4 /* Slave Select Enable 2 */ 3103#define FLS2 0x4 /* Slave Select Enable 2 */
3982#define nFLS2 0x0
3983#define FLS3 0x8 /* Slave Select Enable 3 */ 3104#define FLS3 0x8 /* Slave Select Enable 3 */
3984#define nFLS3 0x0
3985#define FLG1 0x200 /* Slave Select Value 1 */ 3105#define FLG1 0x200 /* Slave Select Value 1 */
3986#define nFLG1 0x0
3987#define FLG2 0x400 /* Slave Select Value 2 */ 3106#define FLG2 0x400 /* Slave Select Value 2 */
3988#define nFLG2 0x0
3989#define FLG3 0x800 /* Slave Select Value 3 */ 3107#define FLG3 0x800 /* Slave Select Value 3 */
3990#define nFLG3 0x0
3991 3108
3992/* Bit masks for SPIx_STAT */ 3109/* Bit masks for SPIx_STAT */
3993 3110
3994#define TXCOL 0x40 /* Transmit Collision Error */ 3111#define TXCOL 0x40 /* Transmit Collision Error */
3995#define nTXCOL 0x0
3996#define RXS 0x20 /* RDBR Data Buffer Status */ 3112#define RXS 0x20 /* RDBR Data Buffer Status */
3997#define nRXS 0x0
3998#define RBSY 0x10 /* Receive Error */ 3113#define RBSY 0x10 /* Receive Error */
3999#define nRBSY 0x0
4000#define TXS 0x8 /* TDBR Data Buffer Status */ 3114#define TXS 0x8 /* TDBR Data Buffer Status */
4001#define nTXS 0x0
4002#define TXE 0x4 /* Transmission Error */ 3115#define TXE 0x4 /* Transmission Error */
4003#define nTXE 0x0
4004#define MODF 0x2 /* Mode Fault Error */ 3116#define MODF 0x2 /* Mode Fault Error */
4005#define nMODF 0x0
4006#define SPIF 0x1 /* SPI Finished */ 3117#define SPIF 0x1 /* SPI Finished */
4007#define nSPIF 0x0
4008 3118
4009/* Bit masks for SPIx_TDBR */ 3119/* Bit masks for SPIx_TDBR */
4010 3120
@@ -4028,9 +3138,7 @@
4028 3138
4029#define PRESCALE 0x7f /* Prescale Value */ 3139#define PRESCALE 0x7f /* Prescale Value */
4030#define TWI_ENA 0x80 /* TWI Enable */ 3140#define TWI_ENA 0x80 /* TWI Enable */
4031#define nTWI_ENA 0x0
4032#define SCCB 0x200 /* Serial Camera Control Bus */ 3141#define SCCB 0x200 /* Serial Camera Control Bus */
4033#define nSCCB 0x0
4034 3142
4035/* Bit maskes for TWIx_CLKDIV */ 3143/* Bit maskes for TWIx_CLKDIV */
4036 3144
@@ -4040,13 +3148,9 @@
4040/* Bit maskes for TWIx_SLAVE_CTL */ 3148/* Bit maskes for TWIx_SLAVE_CTL */
4041 3149
4042#define SEN 0x1 /* Slave Enable */ 3150#define SEN 0x1 /* Slave Enable */
4043#define nSEN 0x0
4044#define STDVAL 0x4 /* Slave Transmit Data Valid */ 3151#define STDVAL 0x4 /* Slave Transmit Data Valid */
4045#define nSTDVAL 0x0
4046#define NAK 0x8 /* Not Acknowledge */ 3152#define NAK 0x8 /* Not Acknowledge */
4047#define nNAK 0x0
4048#define GEN 0x10 /* General Call Enable */ 3153#define GEN 0x10 /* General Call Enable */
4049#define nGEN 0x0
4050 3154
4051/* Bit maskes for TWIx_SLAVE_ADDR */ 3155/* Bit maskes for TWIx_SLAVE_ADDR */
4052 3156
@@ -4055,27 +3159,18 @@
4055/* Bit maskes for TWIx_SLAVE_STAT */ 3159/* Bit maskes for TWIx_SLAVE_STAT */
4056 3160
4057#define SDIR 0x1 /* Slave Transfer Direction */ 3161#define SDIR 0x1 /* Slave Transfer Direction */
4058#define nSDIR 0x0
4059#define GCALL 0x2 /* General Call */ 3162#define GCALL 0x2 /* General Call */
4060#define nGCALL 0x0
4061 3163
4062/* Bit maskes for TWIx_MASTER_CTL */ 3164/* Bit maskes for TWIx_MASTER_CTL */
4063 3165
4064#define MEN 0x1 /* Master Mode Enable */ 3166#define MEN 0x1 /* Master Mode Enable */
4065#define nMEN 0x0
4066#define MDIR 0x4 /* Master Transfer Direction */ 3167#define MDIR 0x4 /* Master Transfer Direction */
4067#define nMDIR 0x0
4068#define FAST 0x8 /* Fast Mode */ 3168#define FAST 0x8 /* Fast Mode */
4069#define nFAST 0x0
4070#define STOP 0x10 /* Issue Stop Condition */ 3169#define STOP 0x10 /* Issue Stop Condition */
4071#define nSTOP 0x0
4072#define RSTART 0x20 /* Repeat Start */ 3170#define RSTART 0x20 /* Repeat Start */
4073#define nRSTART 0x0
4074#define DCNT 0x3fc0 /* Data Transfer Count */ 3171#define DCNT 0x3fc0 /* Data Transfer Count */
4075#define SDAOVR 0x4000 /* Serial Data Override */ 3172#define SDAOVR 0x4000 /* Serial Data Override */
4076#define nSDAOVR 0x0
4077#define SCLOVR 0x8000 /* Serial Clock Override */ 3173#define SCLOVR 0x8000 /* Serial Clock Override */
4078#define nSCLOVR 0x0
4079 3174
4080/* Bit maskes for TWIx_MASTER_ADDR */ 3175/* Bit maskes for TWIx_MASTER_ADDR */
4081 3176
@@ -4084,34 +3179,21 @@
4084/* Bit maskes for TWIx_MASTER_STAT */ 3179/* Bit maskes for TWIx_MASTER_STAT */
4085 3180
4086#define MPROG 0x1 /* Master Transfer in Progress */ 3181#define MPROG 0x1 /* Master Transfer in Progress */
4087#define nMPROG 0x0
4088#define LOSTARB 0x2 /* Lost Arbitration */ 3182#define LOSTARB 0x2 /* Lost Arbitration */
4089#define nLOSTARB 0x0
4090#define ANAK 0x4 /* Address Not Acknowledged */ 3183#define ANAK 0x4 /* Address Not Acknowledged */
4091#define nANAK 0x0
4092#define DNAK 0x8 /* Data Not Acknowledged */ 3184#define DNAK 0x8 /* Data Not Acknowledged */
4093#define nDNAK 0x0
4094#define BUFRDERR 0x10 /* Buffer Read Error */ 3185#define BUFRDERR 0x10 /* Buffer Read Error */
4095#define nBUFRDERR 0x0
4096#define BUFWRERR 0x20 /* Buffer Write Error */ 3186#define BUFWRERR 0x20 /* Buffer Write Error */
4097#define nBUFWRERR 0x0
4098#define SDASEN 0x40 /* Serial Data Sense */ 3187#define SDASEN 0x40 /* Serial Data Sense */
4099#define nSDASEN 0x0
4100#define SCLSEN 0x80 /* Serial Clock Sense */ 3188#define SCLSEN 0x80 /* Serial Clock Sense */
4101#define nSCLSEN 0x0
4102#define BUSBUSY 0x100 /* Bus Busy */ 3189#define BUSBUSY 0x100 /* Bus Busy */
4103#define nBUSBUSY 0x0
4104 3190
4105/* Bit maskes for TWIx_FIFO_CTL */ 3191/* Bit maskes for TWIx_FIFO_CTL */
4106 3192
4107#define XMTFLUSH 0x1 /* Transmit Buffer Flush */ 3193#define XMTFLUSH 0x1 /* Transmit Buffer Flush */
4108#define nXMTFLUSH 0x0
4109#define RCVFLUSH 0x2 /* Receive Buffer Flush */ 3194#define RCVFLUSH 0x2 /* Receive Buffer Flush */
4110#define nRCVFLUSH 0x0
4111#define XMTINTLEN 0x4 /* Transmit Buffer Interrupt Length */ 3195#define XMTINTLEN 0x4 /* Transmit Buffer Interrupt Length */
4112#define nXMTINTLEN 0x0
4113#define RCVINTLEN 0x8 /* Receive Buffer Interrupt Length */ 3196#define RCVINTLEN 0x8 /* Receive Buffer Interrupt Length */
4114#define nRCVINTLEN 0x0
4115 3197
4116/* Bit maskes for TWIx_FIFO_STAT */ 3198/* Bit maskes for TWIx_FIFO_STAT */
4117 3199
@@ -4121,40 +3203,24 @@
4121/* Bit maskes for TWIx_INT_MASK */ 3203/* Bit maskes for TWIx_INT_MASK */
4122 3204
4123#define SINITM 0x1 /* Slave Transfer Initiated Interrupt Mask */ 3205#define SINITM 0x1 /* Slave Transfer Initiated Interrupt Mask */
4124#define nSINITM 0x0
4125#define SCOMPM 0x2 /* Slave Transfer Complete Interrupt Mask */ 3206#define SCOMPM 0x2 /* Slave Transfer Complete Interrupt Mask */
4126#define nSCOMPM 0x0
4127#define SERRM 0x4 /* Slave Transfer Error Interrupt Mask */ 3207#define SERRM 0x4 /* Slave Transfer Error Interrupt Mask */
4128#define nSERRM 0x0
4129#define SOVFM 0x8 /* Slave Overflow Interrupt Mask */ 3208#define SOVFM 0x8 /* Slave Overflow Interrupt Mask */
4130#define nSOVFM 0x0
4131#define MCOMPM 0x10 /* Master Transfer Complete Interrupt Mask */ 3209#define MCOMPM 0x10 /* Master Transfer Complete Interrupt Mask */
4132#define nMCOMPM 0x0
4133#define MERRM 0x20 /* Master Transfer Error Interrupt Mask */ 3210#define MERRM 0x20 /* Master Transfer Error Interrupt Mask */
4134#define nMERRM 0x0
4135#define XMTSERVM 0x40 /* Transmit FIFO Service Interrupt Mask */ 3211#define XMTSERVM 0x40 /* Transmit FIFO Service Interrupt Mask */
4136#define nXMTSERVM 0x0
4137#define RCVSERVM 0x80 /* Receive FIFO Service Interrupt Mask */ 3212#define RCVSERVM 0x80 /* Receive FIFO Service Interrupt Mask */
4138#define nRCVSERVM 0x0
4139 3213
4140/* Bit maskes for TWIx_INT_STAT */ 3214/* Bit maskes for TWIx_INT_STAT */
4141 3215
4142#define SINIT 0x1 /* Slave Transfer Initiated */ 3216#define SINIT 0x1 /* Slave Transfer Initiated */
4143#define nSINIT 0x0
4144#define SCOMP 0x2 /* Slave Transfer Complete */ 3217#define SCOMP 0x2 /* Slave Transfer Complete */
4145#define nSCOMP 0x0
4146#define SERR 0x4 /* Slave Transfer Error */ 3218#define SERR 0x4 /* Slave Transfer Error */
4147#define nSERR 0x0
4148#define SOVF 0x8 /* Slave Overflow */ 3219#define SOVF 0x8 /* Slave Overflow */
4149#define nSOVF 0x0
4150#define MCOMP 0x10 /* Master Transfer Complete */ 3220#define MCOMP 0x10 /* Master Transfer Complete */
4151#define nMCOMP 0x0
4152#define MERR 0x20 /* Master Transfer Error */ 3221#define MERR 0x20 /* Master Transfer Error */
4153#define nMERR 0x0
4154#define XMTSERV 0x40 /* Transmit FIFO Service */ 3222#define XMTSERV 0x40 /* Transmit FIFO Service */
4155#define nXMTSERV 0x0
4156#define RCVSERV 0x80 /* Receive FIFO Service */ 3223#define RCVSERV 0x80 /* Receive FIFO Service */
4157#define nRCVSERV 0x0
4158 3224
4159/* Bit maskes for TWIx_XMT_DATA8 */ 3225/* Bit maskes for TWIx_XMT_DATA8 */
4160 3226
@@ -4175,81 +3241,51 @@
4175/* Bit masks for SPORTx_TCR1 */ 3241/* Bit masks for SPORTx_TCR1 */
4176 3242
4177#define TCKFE 0x4000 /* Clock Falling Edge Select */ 3243#define TCKFE 0x4000 /* Clock Falling Edge Select */
4178#define nTCKFE 0x0
4179#define LATFS 0x2000 /* Late Transmit Frame Sync */ 3244#define LATFS 0x2000 /* Late Transmit Frame Sync */
4180#define nLATFS 0x0
4181#define LTFS 0x1000 /* Low Transmit Frame Sync Select */ 3245#define LTFS 0x1000 /* Low Transmit Frame Sync Select */
4182#define nLTFS 0x0
4183#define DITFS 0x800 /* Data-Independent Transmit Frame Sync Select */ 3246#define DITFS 0x800 /* Data-Independent Transmit Frame Sync Select */
4184#define nDITFS 0x0
4185#define TFSR 0x400 /* Transmit Frame Sync Required Select */ 3247#define TFSR 0x400 /* Transmit Frame Sync Required Select */
4186#define nTFSR 0x0
4187#define ITFS 0x200 /* Internal Transmit Frame Sync Select */ 3248#define ITFS 0x200 /* Internal Transmit Frame Sync Select */
4188#define nITFS 0x0
4189#define TLSBIT 0x10 /* Transmit Bit Order */ 3249#define TLSBIT 0x10 /* Transmit Bit Order */
4190#define nTLSBIT 0x0
4191#define TDTYPE 0xc /* Data Formatting Type Select */ 3250#define TDTYPE 0xc /* Data Formatting Type Select */
4192#define ITCLK 0x2 /* Internal Transmit Clock Select */ 3251#define ITCLK 0x2 /* Internal Transmit Clock Select */
4193#define nITCLK 0x0
4194#define TSPEN 0x1 /* Transmit Enable */ 3252#define TSPEN 0x1 /* Transmit Enable */
4195#define nTSPEN 0x0
4196 3253
4197/* Bit masks for SPORTx_TCR2 */ 3254/* Bit masks for SPORTx_TCR2 */
4198 3255
4199#define TRFST 0x400 /* Left/Right Order */ 3256#define TRFST 0x400 /* Left/Right Order */
4200#define nTRFST 0x0
4201#define TSFSE 0x200 /* Transmit Stereo Frame Sync Enable */ 3257#define TSFSE 0x200 /* Transmit Stereo Frame Sync Enable */
4202#define nTSFSE 0x0
4203#define TXSE 0x100 /* TxSEC Enable */ 3258#define TXSE 0x100 /* TxSEC Enable */
4204#define nTXSE 0x0
4205#define SLEN_T 0x1f /* SPORT Word Length */ 3259#define SLEN_T 0x1f /* SPORT Word Length */
4206 3260
4207/* Bit masks for SPORTx_RCR1 */ 3261/* Bit masks for SPORTx_RCR1 */
4208 3262
4209#define RCKFE 0x4000 /* Clock Falling Edge Select */ 3263#define RCKFE 0x4000 /* Clock Falling Edge Select */
4210#define nRCKFE 0x0
4211#define LARFS 0x2000 /* Late Receive Frame Sync */ 3264#define LARFS 0x2000 /* Late Receive Frame Sync */
4212#define nLARFS 0x0
4213#define LRFS 0x1000 /* Low Receive Frame Sync Select */ 3265#define LRFS 0x1000 /* Low Receive Frame Sync Select */
4214#define nLRFS 0x0
4215#define RFSR 0x400 /* Receive Frame Sync Required Select */ 3266#define RFSR 0x400 /* Receive Frame Sync Required Select */
4216#define nRFSR 0x0
4217#define IRFS 0x200 /* Internal Receive Frame Sync Select */ 3267#define IRFS 0x200 /* Internal Receive Frame Sync Select */
4218#define nIRFS 0x0
4219#define RLSBIT 0x10 /* Receive Bit Order */ 3268#define RLSBIT 0x10 /* Receive Bit Order */
4220#define nRLSBIT 0x0
4221#define RDTYPE 0xc /* Data Formatting Type Select */ 3269#define RDTYPE 0xc /* Data Formatting Type Select */
4222#define IRCLK 0x2 /* Internal Receive Clock Select */ 3270#define IRCLK 0x2 /* Internal Receive Clock Select */
4223#define nIRCLK 0x0
4224#define RSPEN 0x1 /* Receive Enable */ 3271#define RSPEN 0x1 /* Receive Enable */
4225#define nRSPEN 0x0
4226 3272
4227/* Bit masks for SPORTx_RCR2 */ 3273/* Bit masks for SPORTx_RCR2 */
4228 3274
4229#define RRFST 0x400 /* Left/Right Order */ 3275#define RRFST 0x400 /* Left/Right Order */
4230#define nRRFST 0x0
4231#define RSFSE 0x200 /* Receive Stereo Frame Sync Enable */ 3276#define RSFSE 0x200 /* Receive Stereo Frame Sync Enable */
4232#define nRSFSE 0x0
4233#define RXSE 0x100 /* RxSEC Enable */ 3277#define RXSE 0x100 /* RxSEC Enable */
4234#define nRXSE 0x0
4235#define SLEN_R 0x1f /* SPORT Word Length */ 3278#define SLEN_R 0x1f /* SPORT Word Length */
4236 3279
4237/* Bit masks for SPORTx_STAT */ 3280/* Bit masks for SPORTx_STAT */
4238 3281
4239#define TXHRE 0x40 /* Transmit Hold Register Empty */ 3282#define TXHRE 0x40 /* Transmit Hold Register Empty */
4240#define nTXHRE 0x0
4241#define TOVF 0x20 /* Sticky Transmit Overflow Status */ 3283#define TOVF 0x20 /* Sticky Transmit Overflow Status */
4242#define nTOVF 0x0
4243#define TUVF 0x10 /* Sticky Transmit Underflow Status */ 3284#define TUVF 0x10 /* Sticky Transmit Underflow Status */
4244#define nTUVF 0x0
4245#define TXF 0x8 /* Transmit FIFO Full Status */ 3285#define TXF 0x8 /* Transmit FIFO Full Status */
4246#define nTXF 0x0
4247#define ROVF 0x4 /* Sticky Receive Overflow Status */ 3286#define ROVF 0x4 /* Sticky Receive Overflow Status */
4248#define nROVF 0x0
4249#define RUVF 0x2 /* Sticky Receive Underflow Status */ 3287#define RUVF 0x2 /* Sticky Receive Underflow Status */
4250#define nRUVF 0x0
4251#define RXNE 0x1 /* Receive FIFO Not Empty Status */ 3288#define RXNE 0x1 /* Receive FIFO Not Empty Status */
4252#define nRXNE 0x0
4253 3289
4254/* Bit masks for SPORTx_MCMC1 */ 3290/* Bit masks for SPORTx_MCMC1 */
4255 3291
@@ -4260,13 +3296,9 @@
4260 3296
4261#define MFD 0xf000 /* Multi channel Frame Delay */ 3297#define MFD 0xf000 /* Multi channel Frame Delay */
4262#define FSDR 0x80 /* Frame Sync to Data Relationship */ 3298#define FSDR 0x80 /* Frame Sync to Data Relationship */
4263#define nFSDR 0x0
4264#define MCMEM 0x10 /* Multi channel Frame Mode Enable */ 3299#define MCMEM 0x10 /* Multi channel Frame Mode Enable */
4265#define nMCMEM 0x0
4266#define MCDRXPE 0x8 /* Multi channel DMA Receive Packing */ 3300#define MCDRXPE 0x8 /* Multi channel DMA Receive Packing */
4267#define nMCDRXPE 0x0
4268#define MCDTXPE 0x4 /* Multi channel DMA Transmit Packing */ 3301#define MCDTXPE 0x4 /* Multi channel DMA Transmit Packing */
4269#define nMCDTXPE 0x0
4270#define MCCRM 0x3 /* 2X Clock Recovery Mode */ 3302#define MCCRM 0x3 /* 2X Clock Recovery Mode */
4271 3303
4272/* Bit masks for SPORTx_CHNL */ 3304/* Bit masks for SPORTx_CHNL */
@@ -4280,115 +3312,59 @@
4280#define WLS 0x3 /* Word Length Select */ 3312#define WLS 0x3 /* Word Length Select */
4281#endif 3313#endif
4282#define STB 0x4 /* Stop Bits */ 3314#define STB 0x4 /* Stop Bits */
4283#define nSTB 0x0
4284#define PEN 0x8 /* Parity Enable */ 3315#define PEN 0x8 /* Parity Enable */
4285#define nPEN 0x0
4286#define EPS 0x10 /* Even Parity Select */ 3316#define EPS 0x10 /* Even Parity Select */
4287#define nEPS 0x0
4288#define STP 0x20 /* Sticky Parity */ 3317#define STP 0x20 /* Sticky Parity */
4289#define nSTP 0x0
4290#define SB 0x40 /* Set Break */ 3318#define SB 0x40 /* Set Break */
4291#define nSB 0x0
4292 3319
4293/* Bit masks for UARTx_MCR */ 3320/* Bit masks for UARTx_MCR */
4294 3321
4295#define XOFF 0x1 /* Transmitter Off */ 3322#define XOFF 0x1 /* Transmitter Off */
4296#define nXOFF 0x0
4297#define MRTS 0x2 /* Manual Request To Send */ 3323#define MRTS 0x2 /* Manual Request To Send */
4298#define nMRTS 0x0
4299#define RFIT 0x4 /* Receive FIFO IRQ Threshold */ 3324#define RFIT 0x4 /* Receive FIFO IRQ Threshold */
4300#define nRFIT 0x0
4301#define RFRT 0x8 /* Receive FIFO RTS Threshold */ 3325#define RFRT 0x8 /* Receive FIFO RTS Threshold */
4302#define nRFRT 0x0
4303#define LOOP_ENA 0x10 /* Loopback Mode Enable */ 3326#define LOOP_ENA 0x10 /* Loopback Mode Enable */
4304#define nLOOP_ENA 0x0
4305#define FCPOL 0x20 /* Flow Control Pin Polarity */ 3327#define FCPOL 0x20 /* Flow Control Pin Polarity */
4306#define nFCPOL 0x0
4307#define ARTS 0x40 /* Automatic Request To Send */ 3328#define ARTS 0x40 /* Automatic Request To Send */
4308#define nARTS 0x0
4309#define ACTS 0x80 /* Automatic Clear To Send */ 3329#define ACTS 0x80 /* Automatic Clear To Send */
4310#define nACTS 0x0
4311 3330
4312/* Bit masks for UARTx_LSR */ 3331/* Bit masks for UARTx_LSR */
4313 3332
4314#define DR 0x1 /* Data Ready */ 3333#define DR 0x1 /* Data Ready */
4315#define nDR 0x0
4316#define OE 0x2 /* Overrun Error */ 3334#define OE 0x2 /* Overrun Error */
4317#define nOE 0x0
4318#define PE 0x4 /* Parity Error */ 3335#define PE 0x4 /* Parity Error */
4319#define nPE 0x0
4320#define FE 0x8 /* Framing Error */ 3336#define FE 0x8 /* Framing Error */
4321#define nFE 0x0
4322#define BI 0x10 /* Break Interrupt */ 3337#define BI 0x10 /* Break Interrupt */
4323#define nBI 0x0
4324#define THRE 0x20 /* THR Empty */ 3338#define THRE 0x20 /* THR Empty */
4325#define nTHRE 0x0
4326#define TEMT 0x40 /* Transmitter Empty */ 3339#define TEMT 0x40 /* Transmitter Empty */
4327#define nTEMT 0x0
4328#define TFI 0x80 /* Transmission Finished Indicator */ 3340#define TFI 0x80 /* Transmission Finished Indicator */
4329#define nTFI 0x0
4330 3341
4331/* Bit masks for UARTx_MSR */ 3342/* Bit masks for UARTx_MSR */
4332 3343
4333#define SCTS 0x1 /* Sticky CTS */ 3344#define SCTS 0x1 /* Sticky CTS */
4334#define nSCTS 0x0
4335#define CTS 0x10 /* Clear To Send */ 3345#define CTS 0x10 /* Clear To Send */
4336#define nCTS 0x0
4337#define RFCS 0x20 /* Receive FIFO Count Status */ 3346#define RFCS 0x20 /* Receive FIFO Count Status */
4338#define nRFCS 0x0 3347
4339 3348/* Bit masks for UARTx_IER_SET & UARTx_IER_CLEAR */
4340/* Bit masks for UARTx_IER_SET */ 3349
4341 3350#define ERBFI 0x1 /* Enable Receive Buffer Full Interrupt */
4342#define ERBFI_S 0x1 /* Enable Receive Buffer Full Interrupt */ 3351#define ETBEI 0x2 /* Enable Transmit Buffer Empty Interrupt */
4343#define nERBFI_S 0x0 3352#define ELSI 0x4 /* Enable Receive Status Interrupt */
4344#define ETBEI_S 0x2 /* Enable Transmit Buffer Empty Interrupt */ 3353#define EDSSI 0x8 /* Enable Modem Status Interrupt */
4345#define nETBEI_S 0x0 3354#define EDTPTI 0x10 /* Enable DMA Transmit PIRQ Interrupt */
4346#define ELSI_S 0x4 /* Enable Receive Status Interrupt */ 3355#define ETFI 0x20 /* Enable Transmission Finished Interrupt */
4347#define nELSI_S 0x0 3356#define ERFCI 0x40 /* Enable Receive FIFO Count Interrupt */
4348#define EDSSI_S 0x8 /* Enable Modem Status Interrupt */
4349#define nEDSSI_S 0x0
4350#define EDTPTI_S 0x10 /* Enable DMA Transmit PIRQ Interrupt */
4351#define nEDTPTI_S 0x0
4352#define ETFI_S 0x20 /* Enable Transmission Finished Interrupt */
4353#define nETFI_S 0x0
4354#define ERFCI_S 0x40 /* Enable Receive FIFO Count Interrupt */
4355#define nERFCI_S 0x0
4356
4357/* Bit masks for UARTx_IER_CLEAR */
4358
4359#define ERBFI_C 0x1 /* Enable Receive Buffer Full Interrupt */
4360#define nERBFI_C 0x0
4361#define ETBEI_C 0x2 /* Enable Transmit Buffer Empty Interrupt */
4362#define nETBEI_C 0x0
4363#define ELSI_C 0x4 /* Enable Receive Status Interrupt */
4364#define nELSI_C 0x0
4365#define EDSSI_C 0x8 /* Enable Modem Status Interrupt */
4366#define nEDSSI_C 0x0
4367#define EDTPTI_C 0x10 /* Enable DMA Transmit PIRQ Interrupt */
4368#define nEDTPTI_C 0x0
4369#define ETFI_C 0x20 /* Enable Transmission Finished Interrupt */
4370#define nETFI_C 0x0
4371#define ERFCI_C 0x40 /* Enable Receive FIFO Count Interrupt */
4372#define nERFCI_C 0x0
4373 3357
4374/* Bit masks for UARTx_GCTL */ 3358/* Bit masks for UARTx_GCTL */
4375 3359
4376#define UCEN 0x1 /* UART Enable */ 3360#define UCEN 0x1 /* UART Enable */
4377#define nUCEN 0x0
4378#define IREN 0x2 /* IrDA Mode Enable */ 3361#define IREN 0x2 /* IrDA Mode Enable */
4379#define nIREN 0x0
4380#define TPOLC 0x4 /* IrDA TX Polarity Change */ 3362#define TPOLC 0x4 /* IrDA TX Polarity Change */
4381#define nTPOLC 0x0
4382#define RPOLC 0x8 /* IrDA RX Polarity Change */ 3363#define RPOLC 0x8 /* IrDA RX Polarity Change */
4383#define nRPOLC 0x0
4384#define FPE 0x10 /* Force Parity Error */ 3364#define FPE 0x10 /* Force Parity Error */
4385#define nFPE 0x0
4386#define FFE 0x20 /* Force Framing Error */ 3365#define FFE 0x20 /* Force Framing Error */
4387#define nFFE 0x0
4388#define EDBO 0x40 /* Enable Divide-by-One */ 3366#define EDBO 0x40 /* Enable Divide-by-One */
4389#define nEDBO 0x0
4390#define EGLSI 0x80 /* Enable Global LS Interrupt */ 3367#define EGLSI 0x80 /* Enable Global LS Interrupt */
4391#define nEGLSI 0x0
4392 3368
4393 3369
4394/* ******************************************* */ 3370/* ******************************************* */
@@ -4398,32 +3374,32 @@
4398/* BCODE bit field options (SYSCFG register) */ 3374/* BCODE bit field options (SYSCFG register) */
4399 3375
4400#define BCODE_WAKEUP 0x0000 /* boot according to wake-up condition */ 3376#define BCODE_WAKEUP 0x0000 /* boot according to wake-up condition */
4401#define BCODE_FULLBOOT 0x0010 /* always perform full boot */ 3377#define BCODE_FULLBOOT 0x0010 /* always perform full boot */
4402#define BCODE_QUICKBOOT 0x0020 /* always perform quick boot */ 3378#define BCODE_QUICKBOOT 0x0020 /* always perform quick boot */
4403#define BCODE_NOBOOT 0x0030 /* always perform full boot */ 3379#define BCODE_NOBOOT 0x0030 /* always perform full boot */
4404 3380
4405/* CNT_COMMAND bit field options */ 3381/* CNT_COMMAND bit field options */
4406 3382
4407#define W1LCNT_ZERO 0x0001 /* write 1 to load CNT_COUNTER with zero */ 3383#define W1LCNT_ZERO 0x0001 /* write 1 to load CNT_COUNTER with zero */
4408#define W1LCNT_MIN 0x0004 /* write 1 to load CNT_COUNTER from CNT_MIN */ 3384#define W1LCNT_MIN 0x0004 /* write 1 to load CNT_COUNTER from CNT_MIN */
4409#define W1LCNT_MAX 0x0008 /* write 1 to load CNT_COUNTER from CNT_MAX */ 3385#define W1LCNT_MAX 0x0008 /* write 1 to load CNT_COUNTER from CNT_MAX */
4410 3386
4411#define W1LMIN_ZERO 0x0010 /* write 1 to load CNT_MIN with zero */ 3387#define W1LMIN_ZERO 0x0010 /* write 1 to load CNT_MIN with zero */
4412#define W1LMIN_CNT 0x0020 /* write 1 to load CNT_MIN from CNT_COUNTER */ 3388#define W1LMIN_CNT 0x0020 /* write 1 to load CNT_MIN from CNT_COUNTER */
4413#define W1LMIN_MAX 0x0080 /* write 1 to load CNT_MIN from CNT_MAX */ 3389#define W1LMIN_MAX 0x0080 /* write 1 to load CNT_MIN from CNT_MAX */
4414 3390
4415#define W1LMAX_ZERO 0x0100 /* write 1 to load CNT_MAX with zero */ 3391#define W1LMAX_ZERO 0x0100 /* write 1 to load CNT_MAX with zero */
4416#define W1LMAX_CNT 0x0200 /* write 1 to load CNT_MAX from CNT_COUNTER */ 3392#define W1LMAX_CNT 0x0200 /* write 1 to load CNT_MAX from CNT_COUNTER */
4417#define W1LMAX_MIN 0x0400 /* write 1 to load CNT_MAX from CNT_MIN */ 3393#define W1LMAX_MIN 0x0400 /* write 1 to load CNT_MAX from CNT_MIN */
4418 3394
4419/* CNT_CONFIG bit field options */ 3395/* CNT_CONFIG bit field options */
4420 3396
4421#define CNTMODE_QUADENC 0x0000 /* quadrature encoder mode */ 3397#define CNTMODE_QUADENC 0x0000 /* quadrature encoder mode */
4422#define CNTMODE_BINENC 0x0100 /* binary encoder mode */ 3398#define CNTMODE_BINENC 0x0100 /* binary encoder mode */
4423#define CNTMODE_UDCNT 0x0200 /* up/down counter mode */ 3399#define CNTMODE_UDCNT 0x0200 /* up/down counter mode */
4424#define CNTMODE_DIRCNT 0x0400 /* direction counter mode */ 3400#define CNTMODE_DIRCNT 0x0400 /* direction counter mode */
4425#define CNTMODE_DIRTMR 0x0500 /* direction timer mode */ 3401#define CNTMODE_DIRTMR 0x0500 /* direction timer mode */
4426 3402
4427#define BNDMODE_COMP 0x0000 /* boundary compare mode */ 3403#define BNDMODE_COMP 0x0000 /* boundary compare mode */
4428#define BNDMODE_ZERO 0x1000 /* boundary compare and zero mode */ 3404#define BNDMODE_ZERO 0x1000 /* boundary compare and zero mode */
4429#define BNDMODE_CAPT 0x2000 /* boundary capture mode */ 3405#define BNDMODE_CAPT 0x2000 /* boundary capture mode */
@@ -4436,7 +3412,7 @@
4436#define EXT_CLK 0x0003 3412#define EXT_CLK 0x0003
4437 3413
4438/* UARTx_LCR bit field options */ 3414/* UARTx_LCR bit field options */
4439 3415
4440#define WLS_5 0x0000 /* 5 data bits */ 3416#define WLS_5 0x0000 /* 5 data bits */
4441#define WLS_6 0x0001 /* 6 data bits */ 3417#define WLS_6 0x0001 /* 6 data bits */
4442#define WLS_7 0x0002 /* 7 data bits */ 3418#define WLS_7 0x0002 /* 7 data bits */
@@ -4484,7 +3460,7 @@
4484#define PIQ30 0x40000000 3460#define PIQ30 0x40000000
4485#define PIQ31 0x80000000 3461#define PIQ31 0x80000000
4486 3462
4487/* PORT A Bit Definitions for the registers 3463/* PORT A Bit Definitions for the registers
4488PORTA, PORTA_SET, PORTA_CLEAR, 3464PORTA, PORTA_SET, PORTA_CLEAR,
4489PORTA_DIR_SET, PORTA_DIR_CLEAR, PORTA_INEN, 3465PORTA_DIR_SET, PORTA_DIR_CLEAR, PORTA_INEN,
4490PORTA_FER registers 3466PORTA_FER registers
@@ -4507,7 +3483,7 @@ PORTA_FER registers
4507#define PA14 0x4000 3483#define PA14 0x4000
4508#define PA15 0x8000 3484#define PA15 0x8000
4509 3485
4510/* PORT B Bit Definitions for the registers 3486/* PORT B Bit Definitions for the registers
4511PORTB, PORTB_SET, PORTB_CLEAR, 3487PORTB, PORTB_SET, PORTB_CLEAR,
4512PORTB_DIR_SET, PORTB_DIR_CLEAR, PORTB_INEN, 3488PORTB_DIR_SET, PORTB_DIR_CLEAR, PORTB_INEN,
4513PORTB_FER registers 3489PORTB_FER registers
@@ -4530,7 +3506,7 @@ PORTB_FER registers
4530#define PB14 0x4000 3506#define PB14 0x4000
4531 3507
4532 3508
4533/* PORT C Bit Definitions for the registers 3509/* PORT C Bit Definitions for the registers
4534PORTC, PORTC_SET, PORTC_CLEAR, 3510PORTC, PORTC_SET, PORTC_CLEAR,
4535PORTC_DIR_SET, PORTC_DIR_CLEAR, PORTC_INEN, 3511PORTC_DIR_SET, PORTC_DIR_CLEAR, PORTC_INEN,
4536PORTC_FER registers 3512PORTC_FER registers
@@ -4553,7 +3529,7 @@ PORTC_FER registers
4553#define PC13 0x2000 3529#define PC13 0x2000
4554 3530
4555 3531
4556/* PORT D Bit Definitions for the registers 3532/* PORT D Bit Definitions for the registers
4557PORTD, PORTD_SET, PORTD_CLEAR, 3533PORTD, PORTD_SET, PORTD_CLEAR,
4558PORTD_DIR_SET, PORTD_DIR_CLEAR, PORTD_INEN, 3534PORTD_DIR_SET, PORTD_DIR_CLEAR, PORTD_INEN,
4559PORTD_FER registers 3535PORTD_FER registers
@@ -4576,7 +3552,7 @@ PORTD_FER registers
4576#define PD14 0x4000 3552#define PD14 0x4000
4577#define PD15 0x8000 3553#define PD15 0x8000
4578 3554
4579/* PORT E Bit Definitions for the registers 3555/* PORT E Bit Definitions for the registers
4580PORTE, PORTE_SET, PORTE_CLEAR, 3556PORTE, PORTE_SET, PORTE_CLEAR,
4581PORTE_DIR_SET, PORTE_DIR_CLEAR, PORTE_INEN, 3557PORTE_DIR_SET, PORTE_DIR_CLEAR, PORTE_INEN,
4582PORTE_FER registers 3558PORTE_FER registers
@@ -4600,7 +3576,7 @@ PORTE_FER registers
4600#define PE14 0x4000 3576#define PE14 0x4000
4601#define PE15 0x8000 3577#define PE15 0x8000
4602 3578
4603/* PORT F Bit Definitions for the registers 3579/* PORT F Bit Definitions for the registers
4604PORTF, PORTF_SET, PORTF_CLEAR, 3580PORTF, PORTF_SET, PORTF_CLEAR,
4605PORTF_DIR_SET, PORTF_DIR_CLEAR, PORTF_INEN, 3581PORTF_DIR_SET, PORTF_DIR_CLEAR, PORTF_INEN,
4606PORTF_FER registers 3582PORTF_FER registers
@@ -4624,7 +3600,7 @@ PORTF_FER registers
4624#define PF14 0x4000 3600#define PF14 0x4000
4625#define PF15 0x8000 3601#define PF15 0x8000
4626 3602
4627/* PORT G Bit Definitions for the registers 3603/* PORT G Bit Definitions for the registers
4628PORTG, PORTG_SET, PORTG_CLEAR, 3604PORTG, PORTG_SET, PORTG_CLEAR,
4629PORTG_DIR_SET, PORTG_DIR_CLEAR, PORTG_INEN, 3605PORTG_DIR_SET, PORTG_DIR_CLEAR, PORTG_INEN,
4630PORTG_FER registers 3606PORTG_FER registers
@@ -4648,7 +3624,7 @@ PORTG_FER registers
4648#define PG14 0x4000 3624#define PG14 0x4000
4649#define PG15 0x8000 3625#define PG15 0x8000
4650 3626
4651/* PORT H Bit Definitions for the registers 3627/* PORT H Bit Definitions for the registers
4652PORTH, PORTH_SET, PORTH_CLEAR, 3628PORTH, PORTH_SET, PORTH_CLEAR,
4653PORTH_DIR_SET, PORTH_DIR_CLEAR, PORTH_INEN, 3629PORTH_DIR_SET, PORTH_DIR_CLEAR, PORTH_INEN,
4654PORTH_FER registers 3630PORTH_FER registers
@@ -4671,7 +3647,7 @@ PORTH_FER registers
4671#define PH13 0x2000 3647#define PH13 0x2000
4672 3648
4673 3649
4674/* PORT I Bit Definitions for the registers 3650/* PORT I Bit Definitions for the registers
4675PORTI, PORTI_SET, PORTI_CLEAR, 3651PORTI, PORTI_SET, PORTI_CLEAR,
4676PORTI_DIR_SET, PORTI_DIR_CLEAR, PORTI_INEN, 3652PORTI_DIR_SET, PORTI_DIR_CLEAR, PORTI_INEN,
4677PORTI_FER registers 3653PORTI_FER registers
@@ -4695,7 +3671,7 @@ PORTI_FER registers
4695#define PI14 0x4000 3671#define PI14 0x4000
4696#define PI15 0x8000 3672#define PI15 0x8000
4697 3673
4698/* PORT J Bit Definitions for the registers 3674/* PORT J Bit Definitions for the registers
4699PORTJ, PORTJ_SET, PORTJ_CLEAR, 3675PORTJ, PORTJ_SET, PORTJ_CLEAR,
4700PORTJ_DIR_SET, PORTJ_DIR_CLEAR, PORTJ_INEN, 3676PORTJ_DIR_SET, PORTJ_DIR_CLEAR, PORTJ_INEN,
4701PORTJ_FER registers 3677PORTJ_FER registers
@@ -4716,7 +3692,7 @@ PORTJ_FER registers
4716#define PJ11 0x0800 3692#define PJ11 0x0800
4717#define PJ12 0x1000 3693#define PJ12 0x1000
4718#define PJ13 0x2000 3694#define PJ13 0x2000
4719 3695
4720 3696
4721/* Port Muxing Bit Fields for PORTx_MUX Registers */ 3697/* Port Muxing Bit Fields for PORTx_MUX Registers */
4722 3698
@@ -4860,7 +3836,7 @@ PORTJ_FER registers
4860#define B0MAP_PIL 0x00000006 /* Map Port I Low to Byte 0 */ 3836#define B0MAP_PIL 0x00000006 /* Map Port I Low to Byte 0 */
4861#define B0MAP_PJL 0x00000007 /* Map Port J Low to Byte 0 */ 3837#define B0MAP_PJL 0x00000007 /* Map Port J Low to Byte 0 */
4862 3838
4863#define B1MAP_PCH 0x00000000 /* Map Port C High to Byte 1 */ 3839#define B1MAP_PCH 0x00000000 /* Map Port C High to Byte 1 */
4864#define B1MAP_PDH 0x00000100 /* Map Port D High to Byte 1 */ 3840#define B1MAP_PDH 0x00000100 /* Map Port D High to Byte 1 */
4865#define B1MAP_PEH 0x00000200 /* Map Port E High to Byte 1 */ 3841#define B1MAP_PEH 0x00000200 /* Map Port E High to Byte 1 */
4866#define B1MAP_PFH 0x00000300 /* Map Port F High to Byte 1 */ 3842#define B1MAP_PFH 0x00000300 /* Map Port F High to Byte 1 */
@@ -4869,27 +3845,27 @@ PORTJ_FER registers
4869#define B1MAP_PIH 0x00000600 /* Map Port I High to Byte 1 */ 3845#define B1MAP_PIH 0x00000600 /* Map Port I High to Byte 1 */
4870#define B1MAP_PJH 0x00000700 /* Map Port J High to Byte 1 */ 3846#define B1MAP_PJH 0x00000700 /* Map Port J High to Byte 1 */
4871 3847
4872#define B2MAP_PCL 0x00000000 /* Map Port C Low to Byte 2 */ 3848#define B2MAP_PCL 0x00000000 /* Map Port C Low to Byte 2 */
4873#define B2MAP_PDL 0x00010000 /* Map Port D Low to Byte 2 */ 3849#define B2MAP_PDL 0x00010000 /* Map Port D Low to Byte 2 */
4874#define B2MAP_PEL 0x00020000 /* Map Port E Low to Byte 2 */ 3850#define B2MAP_PEL 0x00020000 /* Map Port E Low to Byte 2 */
4875#define B2MAP_PFL 0x00030000 /* Map Port F Low to Byte 2 */ 3851#define B2MAP_PFL 0x00030000 /* Map Port F Low to Byte 2 */
4876#define B2MAP_PGL 0x00040000 /* Map Port G Low to Byte 2 */ 3852#define B2MAP_PGL 0x00040000 /* Map Port G Low to Byte 2 */
4877#define B2MAP_PHL 0x00050000 /* Map Port H Low to Byte 2 */ 3853#define B2MAP_PHL 0x00050000 /* Map Port H Low to Byte 2 */
4878#define B2MAP_PIL 0x00060000 /* Map Port I Low to Byte 2 */ 3854#define B2MAP_PIL 0x00060000 /* Map Port I Low to Byte 2 */
4879#define B2MAP_PJL 0x00070000 /* Map Port J Low to Byte 2 */ 3855#define B2MAP_PJL 0x00070000 /* Map Port J Low to Byte 2 */
4880 3856
4881#define B3MAP_PCH 0x00000000 /* Map Port C High to Byte 3 */ 3857#define B3MAP_PCH 0x00000000 /* Map Port C High to Byte 3 */
4882#define B3MAP_PDH 0x01000000 /* Map Port D High to Byte 3 */ 3858#define B3MAP_PDH 0x01000000 /* Map Port D High to Byte 3 */
4883#define B3MAP_PEH 0x02000000 /* Map Port E High to Byte 3 */ 3859#define B3MAP_PEH 0x02000000 /* Map Port E High to Byte 3 */
4884#define B3MAP_PFH 0x03000000 /* Map Port F High to Byte 3 */ 3860#define B3MAP_PFH 0x03000000 /* Map Port F High to Byte 3 */
4885#define B3MAP_PGH 0x04000000 /* Map Port G High to Byte 3 */ 3861#define B3MAP_PGH 0x04000000 /* Map Port G High to Byte 3 */
4886#define B3MAP_PHH 0x05000000 /* Map Port H High to Byte 3 */ 3862#define B3MAP_PHH 0x05000000 /* Map Port H High to Byte 3 */
4887#define B3MAP_PIH 0x06000000 /* Map Port I High to Byte 3 */ 3863#define B3MAP_PIH 0x06000000 /* Map Port I High to Byte 3 */
4888#define B3MAP_PJH 0x07000000 /* Map Port J High to Byte 3 */ 3864#define B3MAP_PJH 0x07000000 /* Map Port J High to Byte 3 */
4889 3865
4890 3866
4891/* for legacy compatibility */ 3867/* for legacy compatibility */
4892 3868
4893#define WLS(x) (((x)-5) & 0x03) /* Word Length Select */ 3869#define WLS(x) (((x)-5) & 0x03) /* Word Length Select */
4894#define W1LMAX_MAX W1LMAX_MIN 3870#define W1LMAX_MAX W1LMAX_MIN
4895#define EBIU_AMCBCTL0 EBIU_AMBCTL0 3871#define EBIU_AMCBCTL0 EBIU_AMBCTL0
diff --git a/include/asm-blackfin/mach-bf548/dma.h b/include/asm-blackfin/mach-bf548/dma.h
new file mode 100644
index 000000000000..fcc8b4c34c6a
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/dma.h
@@ -0,0 +1,73 @@
1/*
2 * file: include/asm-blackfin/mach-bf548/dma.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * system mmr register map
9 * rev:
10 *
11 * modified:
12 *
13 *
14 * bugs: enter bugs at http://blackfin.uclinux.org/
15 *
16 * this program is free software; you can redistribute it and/or modify
17 * it under the terms of the gnu general public license as published by
18 * the free software foundation; either version 2, or (at your option)
19 * 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; see the file copying.
28 * if not, write to the free software foundation,
29 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
30 */
31
32#ifndef _MACH_DMA_H_
33#define _MACH_DMA_H_
34
35#define CH_SPORT0_RX 0
36#define CH_SPORT0_TX 1
37#define CH_SPORT1_RX 2
38#define CH_SPORT1_TX 3
39#define CH_SPI0 4
40#define CH_SPI1 5
41#define CH_UART0_RX 6
42#define CH_UART0_TX 7
43#define CH_UART1_RX 8
44#define CH_UART1_TX 9
45#define CH_ATAPI_RX 10
46#define CH_ATAPI_TX 11
47#define CH_EPPI0 12
48#define CH_EPPI1 13
49#define CH_EPPI2 14
50#define CH_PIXC_IMAGE 15
51#define CH_PIXC_OVERLAY 16
52#define CH_PIXC_OUTPUT 17
53#define CH_SPORT2_RX 18
54#define CH_SPORT2_TX 19
55#define CH_SPORT3_RX 20
56#define CH_SPORT3_TX 21
57#define CH_SDH 22
58#define CH_SPI2 23
59
60#define CH_MEM_STREAM0_DEST 24
61#define CH_MEM_STREAM0_SRC 25
62#define CH_MEM_STREAM1_DEST 26
63#define CH_MEM_STREAM1_SRC 27
64#define CH_MEM_STREAM2_DEST 28
65#define CH_MEM_STREAM2_SRC 29
66#define CH_MEM_STREAM3_DEST 30
67#define CH_MEM_STREAM3_SRC 31
68
69#define MAX_BLACKFIN_DMA_CHANNEL 32
70
71extern int channel2irq(unsigned int channel);
72extern struct dma_register *base_addr[];
73#endif
diff --git a/include/asm-blackfin/mach-bf548/gpio.h b/include/asm-blackfin/mach-bf548/gpio.h
new file mode 100644
index 000000000000..dbf66bcabe35
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/gpio.h
@@ -0,0 +1,216 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/gpio.h
3 * Based on:
4 * Author: Michael Hennerich (hennerich@blackfin.uclinux.org)
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2004-2007 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30
31
32#define GPIO_PA0 0
33#define GPIO_PA1 1
34#define GPIO_PA2 2
35#define GPIO_PA3 3
36#define GPIO_PA4 4
37#define GPIO_PA5 5
38#define GPIO_PA6 6
39#define GPIO_PA7 7
40#define GPIO_PA8 8
41#define GPIO_PA9 9
42#define GPIO_PA10 10
43#define GPIO_PA11 11
44#define GPIO_PA12 12
45#define GPIO_PA13 13
46#define GPIO_PA14 14
47#define GPIO_PA15 15
48#define GPIO_PB0 16
49#define GPIO_PB1 17
50#define GPIO_PB2 18
51#define GPIO_PB3 19
52#define GPIO_PB4 20
53#define GPIO_PB5 21
54#define GPIO_PB6 22
55#define GPIO_PB7 23
56#define GPIO_PB8 24
57#define GPIO_PB9 25
58#define GPIO_PB10 26
59#define GPIO_PB11 27
60#define GPIO_PB12 28
61#define GPIO_PB13 29
62#define GPIO_PB14 30
63#define GPIO_PB15 31 /* N/A */
64#define GPIO_PC0 32
65#define GPIO_PC1 33
66#define GPIO_PC2 34
67#define GPIO_PC3 35
68#define GPIO_PC4 36
69#define GPIO_PC5 37
70#define GPIO_PC6 38
71#define GPIO_PC7 39
72#define GPIO_PC8 40
73#define GPIO_PC9 41
74#define GPIO_PC10 42
75#define GPIO_PC11 43
76#define GPIO_PC12 44
77#define GPIO_PC13 45
78#define GPIO_PC14 46 /* N/A */
79#define GPIO_PC15 47 /* N/A */
80#define GPIO_PD0 48
81#define GPIO_PD1 49
82#define GPIO_PD2 50
83#define GPIO_PD3 51
84#define GPIO_PD4 52
85#define GPIO_PD5 53
86#define GPIO_PD6 54
87#define GPIO_PD7 55
88#define GPIO_PD8 56
89#define GPIO_PD9 57
90#define GPIO_PD10 58
91#define GPIO_PD11 59
92#define GPIO_PD12 60
93#define GPIO_PD13 61
94#define GPIO_PD14 62
95#define GPIO_PD15 63
96#define GPIO_PE0 64
97#define GPIO_PE1 65
98#define GPIO_PE2 66
99#define GPIO_PE3 67
100#define GPIO_PE4 68
101#define GPIO_PE5 69
102#define GPIO_PE6 70
103#define GPIO_PE7 71
104#define GPIO_PE8 72
105#define GPIO_PE9 73
106#define GPIO_PE10 74
107#define GPIO_PE11 75
108#define GPIO_PE12 76
109#define GPIO_PE13 77
110#define GPIO_PE14 78
111#define GPIO_PE15 79
112#define GPIO_PF0 80
113#define GPIO_PF1 81
114#define GPIO_PF2 82
115#define GPIO_PF3 83
116#define GPIO_PF4 84
117#define GPIO_PF5 85
118#define GPIO_PF6 86
119#define GPIO_PF7 87
120#define GPIO_PF8 88
121#define GPIO_PF9 89
122#define GPIO_PF10 90
123#define GPIO_PF11 91
124#define GPIO_PF12 92
125#define GPIO_PF13 93
126#define GPIO_PF14 94
127#define GPIO_PF15 95
128#define GPIO_PG0 96
129#define GPIO_PG1 97
130#define GPIO_PG2 98
131#define GPIO_PG3 99
132#define GPIO_PG4 100
133#define GPIO_PG5 101
134#define GPIO_PG6 102
135#define GPIO_PG7 103
136#define GPIO_PG8 104
137#define GPIO_PG9 105
138#define GPIO_PG10 106
139#define GPIO_PG11 107
140#define GPIO_PG12 108
141#define GPIO_PG13 109
142#define GPIO_PG14 110
143#define GPIO_PG15 111
144#define GPIO_PH0 112
145#define GPIO_PH1 113
146#define GPIO_PH2 114
147#define GPIO_PH3 115
148#define GPIO_PH4 116
149#define GPIO_PH5 117
150#define GPIO_PH6 118
151#define GPIO_PH7 119
152#define GPIO_PH8 120
153#define GPIO_PH9 121
154#define GPIO_PH10 122
155#define GPIO_PH11 123
156#define GPIO_PH12 124
157#define GPIO_PH13 125
158#define GPIO_PH14 126 /* N/A */
159#define GPIO_PH15 127 /* N/A */
160#define GPIO_PI0 128
161#define GPIO_PI1 129
162#define GPIO_PI2 130
163#define GPIO_PI3 131
164#define GPIO_PI4 132
165#define GPIO_PI5 133
166#define GPIO_PI6 134
167#define GPIO_PI7 135
168#define GPIO_PI8 136
169#define GPIO_PI9 137
170#define GPIO_PI10 138
171#define GPIO_PI11 139
172#define GPIO_PI12 140
173#define GPIO_PI13 141
174#define GPIO_PI14 142
175#define GPIO_PI15 143
176#define GPIO_PJ0 144
177#define GPIO_PJ1 145
178#define GPIO_PJ2 146
179#define GPIO_PJ3 147
180#define GPIO_PJ4 148
181#define GPIO_PJ5 149
182#define GPIO_PJ6 150
183#define GPIO_PJ7 151
184#define GPIO_PJ8 152
185#define GPIO_PJ9 153
186#define GPIO_PJ10 154
187#define GPIO_PJ11 155
188#define GPIO_PJ12 156
189#define GPIO_PJ13 157
190#define GPIO_PJ14 158 /* N/A */
191#define GPIO_PJ15 159 /* N/A */
192
193#define MAX_BLACKFIN_GPIOS 160
194
195struct gpio_port_t {
196 unsigned short port_fer;
197 unsigned short dummy1;
198 unsigned short port_data;
199 unsigned short dummy2;
200 unsigned short port_set;
201 unsigned short dummy3;
202 unsigned short port_clear;
203 unsigned short dummy4;
204 unsigned short port_dir_set;
205 unsigned short dummy5;
206 unsigned short port_dir_clear;
207 unsigned short dummy6;
208 unsigned short port_inen;
209 unsigned short dummy7;
210 unsigned int port_mux;
211};
212
213int gpio_request(unsigned short gpio, const char *label);
214void peripheral_free(unsigned short per);
215int peripheral_request_list(unsigned short per[], const char *label);
216void peripheral_free_list(unsigned short per[]);
diff --git a/include/asm-blackfin/mach-bf548/irq.h b/include/asm-blackfin/mach-bf548/irq.h
new file mode 100644
index 000000000000..0b3325bb1fff
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/irq.h
@@ -0,0 +1,467 @@
1/*
2 * file: include/asm-blackfin/mach-bf548/irq.h
3 * based on: include/asm-blackfin/mach-bf537/irq.h
4 * author: Roy Huang (roy.huang@analog.com)
5 *
6 * created:
7 * description:
8 * system mmr register map
9 * rev:
10 *
11 * modified:
12 *
13 *
14 * bugs: enter bugs at http://blackfin.uclinux.org/
15 *
16 * this program is free software; you can redistribute it and/or modify
17 * it under the terms of the gnu general public license as published by
18 * the free software foundation; either version 2, or (at your option)
19 * 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; see the file copying.
28 * if not, write to the free software foundation,
29 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
30 */
31
32#ifndef _BF548_IRQ_H_
33#define _BF548_IRQ_H_
34
35/*
36 * Interrupt source definitions
37 Event Source Core Event Name
38Core Emulation **
39Events (highest priority) EMU 0
40 Reset RST 1
41 NMI NMI 2
42 Exception EVX 3
43 Reserved -- 4
44 Hardware Error IVHW 5
45 Core Timer IVTMR 6 *
46
47.....
48
49 Software Interrupt 1 IVG14 31
50 Software Interrupt 2 --
51 (lowest priority) IVG15 32 *
52 */
53
54#define NR_PERI_INTS (32 * 3)
55
56/* The ABSTRACT IRQ definitions */
57/** the first seven of the following are fixed, the rest you change if you need to **/
58#define IRQ_EMU 0 /* Emulation */
59#define IRQ_RST 1 /* reset */
60#define IRQ_NMI 2 /* Non Maskable */
61#define IRQ_EVX 3 /* Exception */
62#define IRQ_UNUSED 4 /* - unused interrupt*/
63#define IRQ_HWERR 5 /* Hardware Error */
64#define IRQ_CORETMR 6 /* Core timer */
65
66#define BFIN_IRQ(x) ((x) + 7)
67
68#define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */
69#define IRQ_DMAC0_ERR BFIN_IRQ(1) /* DMAC0 Status Interrupt */
70#define IRQ_EPPI0_ERR BFIN_IRQ(2) /* EPPI0 Error Interrupt */
71#define IRQ_SPORT0_ERR BFIN_IRQ(3) /* SPORT0 Error Interrupt */
72#define IRQ_SPORT1_ERR BFIN_IRQ(4) /* SPORT1 Error Interrupt */
73#define IRQ_SPI0_ERR BFIN_IRQ(5) /* SPI0 Status(Error) Interrupt */
74#define IRQ_UART0_ERR BFIN_IRQ(6) /* UART0 Status(Error) Interrupt */
75#define IRQ_RTC BFIN_IRQ(7) /* RTC Interrupt */
76#define IRQ_EPPI0 BFIN_IRQ(8) /* EPPI0 Interrupt (DMA12) */
77#define IRQ_SPORT0_RX BFIN_IRQ(9) /* SPORT0 RX Interrupt (DMA0) */
78#define IRQ_SPORT0_TX BFIN_IRQ(10) /* SPORT0 TX Interrupt (DMA1) */
79#define IRQ_SPORT1_RX BFIN_IRQ(11) /* SPORT1 RX Interrupt (DMA2) */
80#define IRQ_SPORT1_TX BFIN_IRQ(12) /* SPORT1 TX Interrupt (DMA3) */
81#define IRQ_SPI0 BFIN_IRQ(13) /* SPI0 Interrupt (DMA4) */
82#define IRQ_UART0_RX BFIN_IRQ(14) /* UART0 RX Interrupt (DMA6) */
83#define IRQ_UART0_TX BFIN_IRQ(15) /* UART0 TX Interrupt (DMA7) */
84#define IRQ_TIMER8 BFIN_IRQ(16) /* TIMER 8 Interrupt */
85#define IRQ_TIMER9 BFIN_IRQ(17) /* TIMER 9 Interrupt */
86#define IRQ_TIMER10 BFIN_IRQ(18) /* TIMER 10 Interrupt */
87#define IRQ_PINT0 BFIN_IRQ(19) /* PINT0 Interrupt */
88#define IRQ_PINT1 BFIN_IRQ(20) /* PINT1 Interrupt */
89#define IRQ_MDMAS0 BFIN_IRQ(21) /* MDMA Stream 0 Interrupt */
90#define IRQ_MDMAS1 BFIN_IRQ(22) /* MDMA Stream 1 Interrupt */
91#define IRQ_WATCHDOG BFIN_IRQ(23) /* Watchdog Interrupt */
92#define IRQ_DMAC1_ERR BFIN_IRQ(24) /* DMAC1 Status (Error) Interrupt */
93#define IRQ_SPORT2_ERR BFIN_IRQ(25) /* SPORT2 Error Interrupt */
94#define IRQ_SPORT3_ERR BFIN_IRQ(26) /* SPORT3 Error Interrupt */
95#define IRQ_MXVR_DATA BFIN_IRQ(27) /* MXVR Data Interrupt */
96#define IRQ_SPI1_ERR BFIN_IRQ(28) /* SPI1 Status (Error) Interrupt */
97#define IRQ_SPI2_ERR BFIN_IRQ(29) /* SPI2 Status (Error) Interrupt */
98#define IRQ_UART1_ERR BFIN_IRQ(30) /* UART1 Status (Error) Interrupt */
99#define IRQ_UART2_ERR BFIN_IRQ(31) /* UART2 Status (Error) Interrupt */
100#define IRQ_CAN0_ERR BFIN_IRQ(32) /* CAN0 Status (Error) Interrupt */
101#define IRQ_SPORT2_RX BFIN_IRQ(33) /* SPORT2 RX (DMA18) Interrupt */
102#define IRQ_SPORT2_TX BFIN_IRQ(34) /* SPORT2 TX (DMA19) Interrupt */
103#define IRQ_SPORT3_RX BFIN_IRQ(35) /* SPORT3 RX (DMA20) Interrupt */
104#define IRQ_SPORT3_TX BFIN_IRQ(36) /* SPORT3 TX (DMA21) Interrupt */
105#define IRQ_EPPI1 BFIN_IRQ(37) /* EPP1 (DMA13) Interrupt */
106#define IRQ_EPPI2 BFIN_IRQ(38) /* EPP2 (DMA14) Interrupt */
107#define IRQ_SPI1 BFIN_IRQ(39) /* SPI1 (DMA5) Interrupt */
108#define IRQ_SPI2 BFIN_IRQ(40) /* SPI2 (DMA23) Interrupt */
109#define IRQ_UART1_RX BFIN_IRQ(41) /* UART1 RX (DMA8) Interrupt */
110#define IRQ_UART1_TX BFIN_IRQ(42) /* UART1 TX (DMA9) Interrupt */
111#define IRQ_ATAPI_RX BFIN_IRQ(43) /* ATAPI RX (DMA10) Interrupt */
112#define IRQ_ATAPI_TX BFIN_IRQ(44) /* ATAPI TX (DMA11) Interrupt */
113#define IRQ_TWI0 BFIN_IRQ(45) /* TWI0 Interrupt */
114#define IRQ_TWI1 BFIN_IRQ(46) /* TWI1 Interrupt */
115#define IRQ_CAN0_RX BFIN_IRQ(47) /* CAN0 Receive Interrupt */
116#define IRQ_CAN0_TX BFIN_IRQ(48) /* CAN0 Transmit Interrupt */
117#define IRQ_MDMAS2 BFIN_IRQ(49) /* MDMA Stream 2 Interrupt */
118#define IRQ_MDMAS3 BFIN_IRQ(50) /* MDMA Stream 3 Interrupt */
119#define IRQ_MXVR_ERR BFIN_IRQ(51) /* MXVR Status (Error) Interrupt */
120#define IRQ_MXVR_MSG BFIN_IRQ(52) /* MXVR Message Interrupt */
121#define IRQ_MXVR_PKT BFIN_IRQ(53) /* MXVR Packet Interrupt */
122#define IRQ_EPP1_ERR BFIN_IRQ(54) /* EPPI1 Error Interrupt */
123#define IRQ_EPP2_ERR BFIN_IRQ(55) /* EPPI2 Error Interrupt */
124#define IRQ_UART3_ERR BFIN_IRQ(56) /* UART3 Status (Error) Interrupt */
125#define IRQ_HOST_ERR BFIN_IRQ(57) /* HOST Status (Error) Interrupt */
126#define IRQ_PIXC_ERR BFIN_IRQ(59) /* PIXC Status (Error) Interrupt */
127#define IRQ_NFC_ERR BFIN_IRQ(60) /* NFC Error Interrupt */
128#define IRQ_ATAPI_ERR BFIN_IRQ(61) /* ATAPI Error Interrupt */
129#define IRQ_CAN1_ERR BFIN_IRQ(62) /* CAN1 Status (Error) Interrupt */
130#define IRQ_HS_DMA_ERR BFIN_IRQ(63) /* Handshake DMA Status Interrupt */
131#define IRQ_PIXC_IN0 BFIN_IRQ(64) /* PIXC IN0 (DMA15) Interrupt */
132#define IRQ_PIXC_IN1 BFIN_IRQ(65) /* PIXC IN1 (DMA16) Interrupt */
133#define IRQ_PIXC_OUT BFIN_IRQ(66) /* PIXC OUT (DMA17) Interrupt */
134#define IRQ_SDH BFIN_IRQ(67) /* SDH/NFC (DMA22) Interrupt */
135#define IRQ_CNT BFIN_IRQ(68) /* CNT Interrupt */
136#define IRQ_KEY BFIN_IRQ(69) /* KEY Interrupt */
137#define IRQ_CAN1_RX BFIN_IRQ(70) /* CAN1 RX Interrupt */
138#define IRQ_CAN1_TX BFIN_IRQ(71) /* CAN1 TX Interrupt */
139#define IRQ_SDH_MASK0 BFIN_IRQ(72) /* SDH Mask 0 Interrupt */
140#define IRQ_SDH_MASK1 BFIN_IRQ(73) /* SDH Mask 1 Interrupt */
141#define IRQ_USB_INT0 BFIN_IRQ(75) /* USB INT0 Interrupt */
142#define IRQ_USB_INT1 BFIN_IRQ(76) /* USB INT1 Interrupt */
143#define IRQ_USB_INT2 BFIN_IRQ(77) /* USB INT2 Interrupt */
144#define IRQ_USB_DMA BFIN_IRQ(78) /* USB DMA Interrupt */
145#define IRQ_OPTSEC BFIN_IRQ(79) /* OTPSEC Interrupt */
146#define IRQ_TIMER0 BFIN_IRQ(86) /* Timer 0 Interrupt */
147#define IRQ_TIMER1 BFIN_IRQ(87) /* Timer 1 Interrupt */
148#define IRQ_TIMER2 BFIN_IRQ(88) /* Timer 2 Interrupt */
149#define IRQ_TIMER3 BFIN_IRQ(89) /* Timer 3 Interrupt */
150#define IRQ_TIMER4 BFIN_IRQ(90) /* Timer 4 Interrupt */
151#define IRQ_TIMER5 BFIN_IRQ(91) /* Timer 5 Interrupt */
152#define IRQ_TIMER6 BFIN_IRQ(92) /* Timer 6 Interrupt */
153#define IRQ_TIMER7 BFIN_IRQ(93) /* Timer 7 Interrupt */
154#define IRQ_PINT2 BFIN_IRQ(94) /* PINT2 Interrupt */
155#define IRQ_PINT3 BFIN_IRQ(95) /* PINT3 Interrupt */
156
157#define SYS_IRQS IRQ_PINT3
158
159#define BFIN_PA_IRQ(x) ((x) + SYS_IRQS + 1)
160#define IRQ_PA0 BFIN_PA_IRQ(0)
161#define IRQ_PA1 BFIN_PA_IRQ(1)
162#define IRQ_PA2 BFIN_PA_IRQ(2)
163#define IRQ_PA3 BFIN_PA_IRQ(3)
164#define IRQ_PA4 BFIN_PA_IRQ(4)
165#define IRQ_PA5 BFIN_PA_IRQ(5)
166#define IRQ_PA6 BFIN_PA_IRQ(6)
167#define IRQ_PA7 BFIN_PA_IRQ(7)
168#define IRQ_PA8 BFIN_PA_IRQ(8)
169#define IRQ_PA9 BFIN_PA_IRQ(9)
170#define IRQ_PA10 BFIN_PA_IRQ(10)
171#define IRQ_PA11 BFIN_PA_IRQ(11)
172#define IRQ_PA12 BFIN_PA_IRQ(12)
173#define IRQ_PA13 BFIN_PA_IRQ(13)
174#define IRQ_PA14 BFIN_PA_IRQ(14)
175#define IRQ_PA15 BFIN_PA_IRQ(15)
176
177#define BFIN_PB_IRQ(x) ((x) + IRQ_PA15 + 1)
178#define IRQ_PB0 BFIN_PB_IRQ(0)
179#define IRQ_PB1 BFIN_PB_IRQ(1)
180#define IRQ_PB2 BFIN_PB_IRQ(2)
181#define IRQ_PB3 BFIN_PB_IRQ(3)
182#define IRQ_PB4 BFIN_PB_IRQ(4)
183#define IRQ_PB5 BFIN_PB_IRQ(5)
184#define IRQ_PB6 BFIN_PB_IRQ(6)
185#define IRQ_PB7 BFIN_PB_IRQ(7)
186#define IRQ_PB8 BFIN_PB_IRQ(8)
187#define IRQ_PB9 BFIN_PB_IRQ(9)
188#define IRQ_PB10 BFIN_PB_IRQ(10)
189#define IRQ_PB11 BFIN_PB_IRQ(11)
190#define IRQ_PB12 BFIN_PB_IRQ(12)
191#define IRQ_PB13 BFIN_PB_IRQ(13)
192#define IRQ_PB14 BFIN_PB_IRQ(14)
193#define IRQ_PB15 BFIN_PB_IRQ(15) /* N/A */
194
195#define BFIN_PC_IRQ(x) ((x) + IRQ_PB15 + 1)
196#define IRQ_PC0 BFIN_PC_IRQ(0)
197#define IRQ_PC1 BFIN_PC_IRQ(1)
198#define IRQ_PC2 BFIN_PC_IRQ(2)
199#define IRQ_PC3 BFIN_PC_IRQ(3)
200#define IRQ_PC4 BFIN_PC_IRQ(4)
201#define IRQ_PC5 BFIN_PC_IRQ(5)
202#define IRQ_PC6 BFIN_PC_IRQ(6)
203#define IRQ_PC7 BFIN_PC_IRQ(7)
204#define IRQ_PC8 BFIN_PC_IRQ(8)
205#define IRQ_PC9 BFIN_PC_IRQ(9)
206#define IRQ_PC10 BFIN_PC_IRQ(10)
207#define IRQ_PC11 BFIN_PC_IRQ(11)
208#define IRQ_PC12 BFIN_PC_IRQ(12)
209#define IRQ_PC13 BFIN_PC_IRQ(13)
210#define IRQ_PC14 BFIN_PC_IRQ(14) /* N/A */
211#define IRQ_PC15 BFIN_PC_IRQ(15) /* N/A */
212
213#define BFIN_PD_IRQ(x) ((x) + IRQ_PC15 + 1)
214#define IRQ_PD0 BFIN_PD_IRQ(0)
215#define IRQ_PD1 BFIN_PD_IRQ(1)
216#define IRQ_PD2 BFIN_PD_IRQ(2)
217#define IRQ_PD3 BFIN_PD_IRQ(3)
218#define IRQ_PD4 BFIN_PD_IRQ(4)
219#define IRQ_PD5 BFIN_PD_IRQ(5)
220#define IRQ_PD6 BFIN_PD_IRQ(6)
221#define IRQ_PD7 BFIN_PD_IRQ(7)
222#define IRQ_PD8 BFIN_PD_IRQ(8)
223#define IRQ_PD9 BFIN_PD_IRQ(9)
224#define IRQ_PD10 BFIN_PD_IRQ(10)
225#define IRQ_PD11 BFIN_PD_IRQ(11)
226#define IRQ_PD12 BFIN_PD_IRQ(12)
227#define IRQ_PD13 BFIN_PD_IRQ(13)
228#define IRQ_PD14 BFIN_PD_IRQ(14)
229#define IRQ_PD15 BFIN_PD_IRQ(15)
230
231#define BFIN_PE_IRQ(x) ((x) + IRQ_PD15 + 1)
232#define IRQ_PE0 BFIN_PE_IRQ(0)
233#define IRQ_PE1 BFIN_PE_IRQ(1)
234#define IRQ_PE2 BFIN_PE_IRQ(2)
235#define IRQ_PE3 BFIN_PE_IRQ(3)
236#define IRQ_PE4 BFIN_PE_IRQ(4)
237#define IRQ_PE5 BFIN_PE_IRQ(5)
238#define IRQ_PE6 BFIN_PE_IRQ(6)
239#define IRQ_PE7 BFIN_PE_IRQ(7)
240#define IRQ_PE8 BFIN_PE_IRQ(8)
241#define IRQ_PE9 BFIN_PE_IRQ(9)
242#define IRQ_PE10 BFIN_PE_IRQ(10)
243#define IRQ_PE11 BFIN_PE_IRQ(11)
244#define IRQ_PE12 BFIN_PE_IRQ(12)
245#define IRQ_PE13 BFIN_PE_IRQ(13)
246#define IRQ_PE14 BFIN_PE_IRQ(14)
247#define IRQ_PE15 BFIN_PE_IRQ(15)
248
249#define BFIN_PF_IRQ(x) ((x) + IRQ_PE15 + 1)
250#define IRQ_PF0 BFIN_PF_IRQ(0)
251#define IRQ_PF1 BFIN_PF_IRQ(1)
252#define IRQ_PF2 BFIN_PF_IRQ(2)
253#define IRQ_PF3 BFIN_PF_IRQ(3)
254#define IRQ_PF4 BFIN_PF_IRQ(4)
255#define IRQ_PF5 BFIN_PF_IRQ(5)
256#define IRQ_PF6 BFIN_PF_IRQ(6)
257#define IRQ_PF7 BFIN_PF_IRQ(7)
258#define IRQ_PF8 BFIN_PF_IRQ(8)
259#define IRQ_PF9 BFIN_PF_IRQ(9)
260#define IRQ_PF10 BFIN_PF_IRQ(10)
261#define IRQ_PF11 BFIN_PF_IRQ(11)
262#define IRQ_PF12 BFIN_PF_IRQ(12)
263#define IRQ_PF13 BFIN_PF_IRQ(13)
264#define IRQ_PF14 BFIN_PF_IRQ(14)
265#define IRQ_PF15 BFIN_PF_IRQ(15)
266
267#define BFIN_PG_IRQ(x) ((x) + IRQ_PF15 + 1)
268#define IRQ_PG0 BFIN_PG_IRQ(0)
269#define IRQ_PG1 BFIN_PG_IRQ(1)
270#define IRQ_PG2 BFIN_PG_IRQ(2)
271#define IRQ_PG3 BFIN_PG_IRQ(3)
272#define IRQ_PG4 BFIN_PG_IRQ(4)
273#define IRQ_PG5 BFIN_PG_IRQ(5)
274#define IRQ_PG6 BFIN_PG_IRQ(6)
275#define IRQ_PG7 BFIN_PG_IRQ(7)
276#define IRQ_PG8 BFIN_PG_IRQ(8)
277#define IRQ_PG9 BFIN_PG_IRQ(9)
278#define IRQ_PG10 BFIN_PG_IRQ(10)
279#define IRQ_PG11 BFIN_PG_IRQ(11)
280#define IRQ_PG12 BFIN_PG_IRQ(12)
281#define IRQ_PG13 BFIN_PG_IRQ(13)
282#define IRQ_PG14 BFIN_PG_IRQ(14)
283#define IRQ_PG15 BFIN_PG_IRQ(15)
284
285#define BFIN_PH_IRQ(x) ((x) + IRQ_PG15 + 1)
286#define IRQ_PH0 BFIN_PH_IRQ(0)
287#define IRQ_PH1 BFIN_PH_IRQ(1)
288#define IRQ_PH2 BFIN_PH_IRQ(2)
289#define IRQ_PH3 BFIN_PH_IRQ(3)
290#define IRQ_PH4 BFIN_PH_IRQ(4)
291#define IRQ_PH5 BFIN_PH_IRQ(5)
292#define IRQ_PH6 BFIN_PH_IRQ(6)
293#define IRQ_PH7 BFIN_PH_IRQ(7)
294#define IRQ_PH8 BFIN_PH_IRQ(8)
295#define IRQ_PH9 BFIN_PH_IRQ(9)
296#define IRQ_PH10 BFIN_PH_IRQ(10)
297#define IRQ_PH11 BFIN_PH_IRQ(11)
298#define IRQ_PH12 BFIN_PH_IRQ(12)
299#define IRQ_PH13 BFIN_PH_IRQ(13)
300#define IRQ_PH14 BFIN_PH_IRQ(14) /* N/A */
301#define IRQ_PH15 BFIN_PH_IRQ(15) /* N/A */
302
303#define BFIN_PI_IRQ(x) ((x) + IRQ_PH15 + 1)
304#define IRQ_PI0 BFIN_PI_IRQ(0)
305#define IRQ_PI1 BFIN_PI_IRQ(1)
306#define IRQ_PI2 BFIN_PI_IRQ(2)
307#define IRQ_PI3 BFIN_PI_IRQ(3)
308#define IRQ_PI4 BFIN_PI_IRQ(4)
309#define IRQ_PI5 BFIN_PI_IRQ(5)
310#define IRQ_PI6 BFIN_PI_IRQ(6)
311#define IRQ_PI7 BFIN_PI_IRQ(7)
312#define IRQ_PI8 BFIN_PI_IRQ(8)
313#define IRQ_PI9 BFIN_PI_IRQ(9)
314#define IRQ_PI10 BFIN_PI_IRQ(10)
315#define IRQ_PI11 BFIN_PI_IRQ(11)
316#define IRQ_PI12 BFIN_PI_IRQ(12)
317#define IRQ_PI13 BFIN_PI_IRQ(13)
318#define IRQ_PI14 BFIN_PI_IRQ(14)
319#define IRQ_PI15 BFIN_PI_IRQ(15)
320
321#define BFIN_PJ_IRQ(x) ((x) + IRQ_PI15 + 1)
322#define IRQ_PJ0 BFIN_PJ_IRQ(0)
323#define IRQ_PJ1 BFIN_PJ_IRQ(1)
324#define IRQ_PJ2 BFIN_PJ_IRQ(2)
325#define IRQ_PJ3 BFIN_PJ_IRQ(3)
326#define IRQ_PJ4 BFIN_PJ_IRQ(4)
327#define IRQ_PJ5 BFIN_PJ_IRQ(5)
328#define IRQ_PJ6 BFIN_PJ_IRQ(6)
329#define IRQ_PJ7 BFIN_PJ_IRQ(7)
330#define IRQ_PJ8 BFIN_PJ_IRQ(8)
331#define IRQ_PJ9 BFIN_PJ_IRQ(9)
332#define IRQ_PJ10 BFIN_PJ_IRQ(10)
333#define IRQ_PJ11 BFIN_PJ_IRQ(11)
334#define IRQ_PJ12 BFIN_PJ_IRQ(12)
335#define IRQ_PJ13 BFIN_PJ_IRQ(13)
336#define IRQ_PJ14 BFIN_PJ_IRQ(14) /* N/A */
337#define IRQ_PJ15 BFIN_PJ_IRQ(15) /* N/A */
338
339#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
340#define NR_IRQS (IRQ_PJ15+1)
341#else
342#define NR_IRQS (SYS_IRQS+1)
343#endif
344
345#define IVG7 7
346#define IVG8 8
347#define IVG9 9
348#define IVG10 10
349#define IVG11 11
350#define IVG12 12
351#define IVG13 13
352#define IVG14 14
353#define IVG15 15
354
355/* IAR0 BIT FIELDS */
356#define IRQ_PLL_WAKEUP_POS 0
357#define IRQ_DMAC0_ERR_POS 4
358#define IRQ_EPPI0_ERR_POS 8
359#define IRQ_SPORT0_ERR_POS 12
360#define IRQ_SPORT1_ERR_POS 16
361#define IRQ_SPI0_ERR_POS 20
362#define IRQ_UART0_ERR_POS 24
363#define IRQ_RTC_POS 28
364
365/* IAR1 BIT FIELDS */
366#define IRQ_EPPI0_POS 0
367#define IRQ_SPORT0_RX_POS 4
368#define IRQ_SPORT0_TX_POS 8
369#define IRQ_SPORT1_RX_POS 12
370#define IRQ_SPORT1_TX_POS 16
371#define IRQ_SPI0_POS 20
372#define IRQ_UART0_RX_POS 24
373#define IRQ_UART0_TX_POS 28
374
375/* IAR2 BIT FIELDS */
376#define IRQ_TIMER8_POS 0
377#define IRQ_TIMER9_POS 4
378#define IRQ_TIMER10_POS 8
379#define IRQ_PINT0_POS 12
380#define IRQ_PINT1_POS 16
381#define IRQ_MDMAS0_POS 20
382#define IRQ_MDMAS1_POS 24
383#define IRQ_WATCHDOG_POS 28
384
385/* IAR3 BIT FIELDS */
386#define IRQ_DMAC1_ERR_POS 0
387#define IRQ_SPORT2_ERR_POS 4
388#define IRQ_SPORT3_ERR_POS 8
389#define IRQ_MXVR_DATA_POS 12
390#define IRQ_SPI1_ERR_POS 16
391#define IRQ_SPI2_ERR_POS 20
392#define IRQ_UART1_ERR_POS 24
393#define IRQ_UART2_ERR_POS 28
394
395/* IAR4 BIT FILEDS */
396#define IRQ_CAN0_ERR_POS 0
397#define IRQ_SPORT2_RX_POS 4
398#define IRQ_SPORT2_TX_POS 8
399#define IRQ_SPORT3_RX_POS 12
400#define IRQ_SPORT3_TX_POS 16
401#define IRQ_EPPI1_POS 20
402#define IRQ_EPPI2_POS 24
403#define IRQ_SPI1_POS 28
404
405/* IAR5 BIT FIELDS */
406#define IRQ_SPI2_POS 0
407#define IRQ_UART1_RX_POS 4
408#define IRQ_UART1_TX_POS 8
409#define IRQ_ATAPI_RX_POS 12
410#define IRQ_ATAPI_TX_POS 16
411#define IRQ_TWI0_POS 20
412#define IRQ_TWI1_POS 24
413#define IRQ_CAN0_RX_POS 28
414
415/* IAR6 BIT FIELDS */
416#define IRQ_CAN0_TX_POS 0
417#define IRQ_MDMAS2_POS 4
418#define IRQ_MDMAS3_POS 8
419#define IRQ_MXVR_ERR_POS 12
420#define IRQ_MXVR_MSG_POS 16
421#define IRQ_MXVR_PKT_POS 20
422#define IRQ_EPPI1_ERR_POS 24
423#define IRQ_EPPI2_ERR_POS 28
424
425/* IAR7 BIT FIELDS */
426#define IRQ_UART3_ERR_POS 0
427#define IRQ_HOST_ERR_POS 4
428#define IRQ_PIXC_ERR_POS 12
429#define IRQ_NFC_ERR_POS 16
430#define IRQ_ATAPI_ERR_POS 20
431#define IRQ_CAN1_ERR_POS 24
432#define IRQ_HS_DMA_ERR_POS 28
433
434/* IAR8 BIT FIELDS */
435#define IRQ_PIXC_IN0_POS 0
436#define IRQ_PIXC_IN1_POS 4
437#define IRQ_PIXC_OUT_POS 8
438#define IRQ_SDH_POS 12
439#define IRQ_CNT_POS 16
440#define IRQ_KEY_POS 20
441#define IRQ_CAN1_RX_POS 24
442#define IRQ_CAN1_TX_POS 28
443
444/* IAR9 BIT FIELDS */
445#define IRQ_SDH_MASK0_POS 0
446#define IRQ_SDH_MASK1_POS 4
447#define IRQ_USB_INT0_POS 12
448#define IRQ_USB_INT1_POS 16
449#define IRQ_USB_INT2_POS 20
450#define IRQ_USB_DMA_POS 24
451#define IRQ_OTPSEC_POS 28
452
453/* IAR10 BIT FIELDS */
454#define IRQ_TIMER0_POS 24
455#define IRQ_TIMER1_POS 28
456
457/* IAR11 BIT FIELDS */
458#define IRQ_TIMER2_POS 0
459#define IRQ_TIMER3_POS 4
460#define IRQ_TIMER4_POS 8
461#define IRQ_TIMER5_POS 12
462#define IRQ_TIMER6_POS 16
463#define IRQ_TIMER7_POS 20
464#define IRQ_PINT2_POS 24
465#define IRQ_PINT3_POS 28
466
467#endif /* _BF548_IRQ_H_ */
diff --git a/include/asm-blackfin/mach-bf548/mem_init.h b/include/asm-blackfin/mach-bf548/mem_init.h
new file mode 100644
index 000000000000..0cb279e973d7
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/mem_init.h
@@ -0,0 +1,189 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/mem_init.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 * Copyright 2004-2006 Analog Devices Inc.
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * 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; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#if (CONFIG_MEM_MT46V32M16)
33
34#if defined CONFIG_CLKIN_HALF
35#define CLKIN_HALF 1
36#else
37#define CLKIN_HALF 0
38#endif
39
40#if defined CONFIG_PLL_BYPASS
41#define PLL_BYPASS 1
42#else
43#define PLL_BYPASS 0
44#endif
45
46/***************************************Currently Not Being Used *********************************/
47#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
48#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
49#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
50#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
51#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
52
53#if (flash_EBIU_AMBCTL_TT > 3)
54#define flash_EBIU_AMBCTL0_TT B0TT_4
55#endif
56#if (flash_EBIU_AMBCTL_TT == 3)
57#define flash_EBIU_AMBCTL0_TT B0TT_3
58#endif
59#if (flash_EBIU_AMBCTL_TT == 2)
60#define flash_EBIU_AMBCTL0_TT B0TT_2
61#endif
62#if (flash_EBIU_AMBCTL_TT < 2)
63#define flash_EBIU_AMBCTL0_TT B0TT_1
64#endif
65
66#if (flash_EBIU_AMBCTL_ST > 3)
67#define flash_EBIU_AMBCTL0_ST B0ST_4
68#endif
69#if (flash_EBIU_AMBCTL_ST == 3)
70#define flash_EBIU_AMBCTL0_ST B0ST_3
71#endif
72#if (flash_EBIU_AMBCTL_ST == 2)
73#define flash_EBIU_AMBCTL0_ST B0ST_2
74#endif
75#if (flash_EBIU_AMBCTL_ST < 2)
76#define flash_EBIU_AMBCTL0_ST B0ST_1
77#endif
78
79#if (flash_EBIU_AMBCTL_HT > 2)
80#define flash_EBIU_AMBCTL0_HT B0HT_3
81#endif
82#if (flash_EBIU_AMBCTL_HT == 2)
83#define flash_EBIU_AMBCTL0_HT B0HT_2
84#endif
85#if (flash_EBIU_AMBCTL_HT == 1)
86#define flash_EBIU_AMBCTL0_HT B0HT_1
87#endif
88#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
89#define flash_EBIU_AMBCTL0_HT B0HT_0
90#endif
91#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
92#define flash_EBIU_AMBCTL0_HT B0HT_1
93#endif
94
95#if (flash_EBIU_AMBCTL_WAT > 14)
96#define flash_EBIU_AMBCTL0_WAT B0WAT_15
97#endif
98#if (flash_EBIU_AMBCTL_WAT == 14)
99#define flash_EBIU_AMBCTL0_WAT B0WAT_14
100#endif
101#if (flash_EBIU_AMBCTL_WAT == 13)
102#define flash_EBIU_AMBCTL0_WAT B0WAT_13
103#endif
104#if (flash_EBIU_AMBCTL_WAT == 12)
105#define flash_EBIU_AMBCTL0_WAT B0WAT_12
106#endif
107#if (flash_EBIU_AMBCTL_WAT == 11)
108#define flash_EBIU_AMBCTL0_WAT B0WAT_11
109#endif
110#if (flash_EBIU_AMBCTL_WAT == 10)
111#define flash_EBIU_AMBCTL0_WAT B0WAT_10
112#endif
113#if (flash_EBIU_AMBCTL_WAT == 9)
114#define flash_EBIU_AMBCTL0_WAT B0WAT_9
115#endif
116#if (flash_EBIU_AMBCTL_WAT == 8)
117#define flash_EBIU_AMBCTL0_WAT B0WAT_8
118#endif
119#if (flash_EBIU_AMBCTL_WAT == 7)
120#define flash_EBIU_AMBCTL0_WAT B0WAT_7
121#endif
122#if (flash_EBIU_AMBCTL_WAT == 6)
123#define flash_EBIU_AMBCTL0_WAT B0WAT_6
124#endif
125#if (flash_EBIU_AMBCTL_WAT == 5)
126#define flash_EBIU_AMBCTL0_WAT B0WAT_5
127#endif
128#if (flash_EBIU_AMBCTL_WAT == 4)
129#define flash_EBIU_AMBCTL0_WAT B0WAT_4
130#endif
131#if (flash_EBIU_AMBCTL_WAT == 3)
132#define flash_EBIU_AMBCTL0_WAT B0WAT_3
133#endif
134#if (flash_EBIU_AMBCTL_WAT == 2)
135#define flash_EBIU_AMBCTL0_WAT B0WAT_2
136#endif
137#if (flash_EBIU_AMBCTL_WAT == 1)
138#define flash_EBIU_AMBCTL0_WAT B0WAT_1
139#endif
140
141#if (flash_EBIU_AMBCTL_RAT > 14)
142#define flash_EBIU_AMBCTL0_RAT B0RAT_15
143#endif
144#if (flash_EBIU_AMBCTL_RAT == 14)
145#define flash_EBIU_AMBCTL0_RAT B0RAT_14
146#endif
147#if (flash_EBIU_AMBCTL_RAT == 13)
148#define flash_EBIU_AMBCTL0_RAT B0RAT_13
149#endif
150#if (flash_EBIU_AMBCTL_RAT == 12)
151#define flash_EBIU_AMBCTL0_RAT B0RAT_12
152#endif
153#if (flash_EBIU_AMBCTL_RAT == 11)
154#define flash_EBIU_AMBCTL0_RAT B0RAT_11
155#endif
156#if (flash_EBIU_AMBCTL_RAT == 10)
157#define flash_EBIU_AMBCTL0_RAT B0RAT_10
158#endif
159#if (flash_EBIU_AMBCTL_RAT == 9)
160#define flash_EBIU_AMBCTL0_RAT B0RAT_9
161#endif
162#if (flash_EBIU_AMBCTL_RAT == 8)
163#define flash_EBIU_AMBCTL0_RAT B0RAT_8
164#endif
165#if (flash_EBIU_AMBCTL_RAT == 7)
166#define flash_EBIU_AMBCTL0_RAT B0RAT_7
167#endif
168#if (flash_EBIU_AMBCTL_RAT == 6)
169#define flash_EBIU_AMBCTL0_RAT B0RAT_6
170#endif
171#if (flash_EBIU_AMBCTL_RAT == 5)
172#define flash_EBIU_AMBCTL0_RAT B0RAT_5
173#endif
174#if (flash_EBIU_AMBCTL_RAT == 4)
175#define flash_EBIU_AMBCTL0_RAT B0RAT_4
176#endif
177#if (flash_EBIU_AMBCTL_RAT == 3)
178#define flash_EBIU_AMBCTL0_RAT B0RAT_3
179#endif
180#if (flash_EBIU_AMBCTL_RAT == 2)
181#define flash_EBIU_AMBCTL0_RAT B0RAT_2
182#endif
183#if (flash_EBIU_AMBCTL_RAT == 1)
184#define flash_EBIU_AMBCTL0_RAT B0RAT_1
185#endif
186
187#define flash_EBIU_AMBCTL0 \
188 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
189 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
diff --git a/include/asm-blackfin/mach-bf548/mem_map.h b/include/asm-blackfin/mach-bf548/mem_map.h
new file mode 100644
index 000000000000..72d80e8a6e81
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/mem_map.h
@@ -0,0 +1,97 @@
1/*
2 * file: include/asm-blackfin/mach-bf548/mem_map.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * Memory MAP Common header file for blackfin BF537/6/4 of processors.
9 * rev:
10 *
11 * modified:
12 *
13 * bugs: enter bugs at http://blackfin.uclinux.org/
14 *
15 * this program is free software; you can redistribute it and/or modify
16 * it under the terms of the gnu general public license as published by
17 * the free software foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * this program is distributed in the hope that it will be useful,
21 * but without any warranty; without even the implied warranty of
22 * merchantability or fitness for a particular purpose. see the
23 * gnu general public license for more details.
24 *
25 * you should have received a copy of the gnu general public license
26 * along with this program; see the file copying.
27 * if not, write to the free software foundation,
28 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
29 */
30
31#ifndef _MEM_MAP_548_H_
32#define _MEM_MAP_548_H_
33
34#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
35#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
36
37/* Async Memory Banks */
38#define ASYNC_BANK3_BASE 0x2C000000 /* Async Bank 3 */
39#define ASYNC_BANK3_SIZE 0x04000000 /* 64M */
40#define ASYNC_BANK2_BASE 0x28000000 /* Async Bank 2 */
41#define ASYNC_BANK2_SIZE 0x04000000 /* 64M */
42#define ASYNC_BANK1_BASE 0x24000000 /* Async Bank 1 */
43#define ASYNC_BANK1_SIZE 0x04000000 /* 64M */
44#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */
45#define ASYNC_BANK0_SIZE 0x04000000 /* 64M */
46
47/* Boot ROM Memory */
48
49#define BOOT_ROM_START 0xEF000000
50
51/* Level 1 Memory */
52
53/* Memory Map for ADSP-BF548 processors */
54#ifdef CONFIG_BLKFIN_ICACHE
55#define BLKFIN_ICACHESIZE (16*1024)
56#else
57#define BLKFIN_ICACHESIZE (0*1024)
58#endif
59
60#define L1_CODE_START 0xFFA00000
61#define L1_DATA_A_START 0xFF800000
62#define L1_DATA_B_START 0xFF900000
63
64#define L1_CODE_LENGTH 0xC000
65
66#ifdef CONFIG_BLKFIN_DCACHE
67
68#ifdef CONFIG_BLKFIN_DCACHE_BANKA
69#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
70#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
71#define L1_DATA_B_LENGTH 0x8000
72#define BLKFIN_DCACHESIZE (16*1024)
73#define BLKFIN_DSUPBANKS 1
74#else
75#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
76#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
77#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
78#define BLKFIN_DCACHESIZE (32*1024)
79#define BLKFIN_DSUPBANKS 2
80#endif
81
82#else
83#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
84#define L1_DATA_A_LENGTH 0x8000
85#define L1_DATA_B_LENGTH 0x8000
86#define BLKFIN_DCACHESIZE (0*1024)
87#define BLKFIN_DSUPBANKS 0
88#endif /*CONFIG_BLKFIN_DCACHE*/
89
90/* Scratch Pad Memory */
91
92#if defined(CONFIG_BF54x)
93#define L1_SCRATCH_START 0xFFB00000
94#define L1_SCRATCH_LENGTH 0x1000
95#endif
96
97#endif/* _MEM_MAP_548_H_ */
diff --git a/include/asm-blackfin/mach-bf548/portmux.h b/include/asm-blackfin/mach-bf548/portmux.h
new file mode 100644
index 000000000000..b382deb501a7
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/portmux.h
@@ -0,0 +1,270 @@
1#ifndef _MACH_PORTMUX_H_
2#define _MACH_PORTMUX_H_
3
4#define P_SPORT2_TFS (P_DEFINED | P_IDENT(GPIO_PA0) | P_FUNCT(0))
5#define P_SPORT2_DTSEC (P_DEFINED | P_IDENT(GPIO_PA1) | P_FUNCT(0))
6#define P_SPORT2_DTPRI (P_DEFINED | P_IDENT(GPIO_PA2) | P_FUNCT(0))
7#define P_SPORT2_TSCLK (P_DEFINED | P_IDENT(GPIO_PA3) | P_FUNCT(0))
8#define P_SPORT2_RFS (P_DEFINED | P_IDENT(GPIO_PA4) | P_FUNCT(0))
9#define P_SPORT2_DRSEC (P_DEFINED | P_IDENT(GPIO_PA5) | P_FUNCT(0))
10#define P_SPORT2_DRPRI (P_DEFINED | P_IDENT(GPIO_PA6) | P_FUNCT(0))
11#define P_SPORT2_RSCLK (P_DEFINED | P_IDENT(GPIO_PA7) | P_FUNCT(0))
12#define P_SPORT3_TFS (P_DEFINED | P_IDENT(GPIO_PA8) | P_FUNCT(0))
13#define P_SPORT3_DTSEC (P_DEFINED | P_IDENT(GPIO_PA9) | P_FUNCT(0))
14#define P_SPORT3_DTPRI (P_DEFINED | P_IDENT(GPIO_PA10) | P_FUNCT(0))
15#define P_SPORT3_TSCLK (P_DEFINED | P_IDENT(GPIO_PA11) | P_FUNCT(0))
16#define P_SPORT3_RFS (P_DEFINED | P_IDENT(GPIO_PA12) | P_FUNCT(0))
17#define P_SPORT3_DRSEC (P_DEFINED | P_IDENT(GPIO_PA13) | P_FUNCT(0))
18#define P_SPORT3_DRPRI (P_DEFINED | P_IDENT(GPIO_PA14) | P_FUNCT(0))
19#define P_SPORT3_RSCLK (P_DEFINED | P_IDENT(GPIO_PA15) | P_FUNCT(0))
20#define P_TMR4 (P_DEFINED | P_IDENT(GPIO_PA1) | P_FUNCT(1))
21#define P_TMR5 (P_DEFINED | P_IDENT(GPIO_PA5) | P_FUNCT(1))
22#define P_TMR6 (P_DEFINED | P_IDENT(GPIO_PA9) | P_FUNCT(1))
23#define P_TMR7 (P_DEFINED | P_IDENT(GPIO_PA13) | P_FUNCT(1))
24
25#define P_TWI1_SCL (P_DEFINED | P_IDENT(GPIO_PB0) | P_FUNCT(0))
26#define P_TWI1_SDA (P_DEFINED | P_IDENT(GPIO_PB1) | P_FUNCT(0))
27#define P_UART3_RTS (P_DEFINED | P_IDENT(GPIO_PB2) | P_FUNCT(0))
28#define P_UART3_CTS (P_DEFINED | P_IDENT(GPIO_PB3) | P_FUNCT(0))
29#define P_UART2_TX (P_DEFINED | P_IDENT(GPIO_PB4) | P_FUNCT(0))
30#define P_UART2_RX (P_DEFINED | P_IDENT(GPIO_PB5) | P_FUNCT(0))
31#define P_UART3_TX (P_DEFINED | P_IDENT(GPIO_PB6) | P_FUNCT(0))
32#define P_UART3_RX (P_DEFINED | P_IDENT(GPIO_PB7) | P_FUNCT(0))
33#define P_SPI2_SS (P_DEFINED | P_IDENT(GPIO_PB8) | P_FUNCT(0))
34#define P_SPI2_SSEL1 (P_DEFINED | P_IDENT(GPIO_PB9) | P_FUNCT(0))
35#define P_SPI2_SSEL2 (P_DEFINED | P_IDENT(GPIO_PB10) | P_FUNCT(0))
36#define P_SPI2_SSEL3 (P_DEFINED | P_IDENT(GPIO_PB11) | P_FUNCT(0))
37#define P_SPI2_SCK (P_DEFINED | P_IDENT(GPIO_PB12) | P_FUNCT(0))
38#define P_SPI2_MOSI (P_DEFINED | P_IDENT(GPIO_PB13) | P_FUNCT(0))
39#define P_SPI2_MISO (P_DEFINED | P_IDENT(GPIO_PB14) | P_FUNCT(0))
40#define P_TMR0 (P_DEFINED | P_IDENT(GPIO_PB8) | P_FUNCT(1))
41#define P_TMR1 (P_DEFINED | P_IDENT(GPIO_PB9) | P_FUNCT(1))
42#define P_TMR2 (P_DEFINED | P_IDENT(GPIO_PB10) | P_FUNCT(1))
43#define P_TMR3 (P_DEFINED | P_IDENT(GPIO_PB11) | P_FUNCT(1))
44
45#define P_SPORT0_TFS (P_DEFINED | P_IDENT(GPIO_PC0) | P_FUNCT(0))
46#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(GPIO_PC1) | P_FUNCT(0))
47#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(GPIO_PC2) | P_FUNCT(0))
48#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(GPIO_PC3) | P_FUNCT(0))
49#define P_SPORT0_RFS (P_DEFINED | P_IDENT(GPIO_PC4) | P_FUNCT(0))
50#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(GPIO_PC5) | P_FUNCT(0))
51#define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(GPIO_PC6) | P_FUNCT(0))
52#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PC7) | P_FUNCT(0))
53#define P_SD_D0 (P_DEFINED | P_IDENT(GPIO_PC8) | P_FUNCT(0))
54#define P_SD_D1 (P_DEFINED | P_IDENT(GPIO_PC9) | P_FUNCT(0))
55#define P_SD_D2 (P_DEFINED | P_IDENT(GPIO_PC10) | P_FUNCT(0))
56#define P_SD_D3 (P_DEFINED | P_IDENT(GPIO_PC11) | P_FUNCT(0))
57#define P_SD_CLK (P_DEFINED | P_IDENT(GPIO_PC12) | P_FUNCT(0))
58#define P_SD_CMD (P_DEFINED | P_IDENT(GPIO_PC13) | P_FUNCT(0))
59#define P_MMCLK (P_DEFINED | P_IDENT(GPIO_PC1) | P_FUNCT(1))
60#define P_MBCLK (P_DEFINED | P_IDENT(GPIO_PC5) | P_FUNCT(1))
61
62#define P_PPI1_D0 (P_DEFINED | P_IDENT(GPIO_PD0) | P_FUNCT(0))
63#define P_PPI1_D1 (P_DEFINED | P_IDENT(GPIO_PD1) | P_FUNCT(0))
64#define P_PPI1_D2 (P_DEFINED | P_IDENT(GPIO_PD2) | P_FUNCT(0))
65#define P_PPI1_D3 (P_DEFINED | P_IDENT(GPIO_PD3) | P_FUNCT(0))
66#define P_PPI1_D4 (P_DEFINED | P_IDENT(GPIO_PD4) | P_FUNCT(0))
67#define P_PPI1_D5 (P_DEFINED | P_IDENT(GPIO_PD5) | P_FUNCT(0))
68#define P_PPI1_D6 (P_DEFINED | P_IDENT(GPIO_PD6) | P_FUNCT(0))
69#define P_PPI1_D7 (P_DEFINED | P_IDENT(GPIO_PD7) | P_FUNCT(0))
70#define P_PPI1_D8 (P_DEFINED | P_IDENT(GPIO_PD8) | P_FUNCT(0))
71#define P_PPI1_D9 (P_DEFINED | P_IDENT(GPIO_PD9) | P_FUNCT(0))
72#define P_PPI1_D10 (P_DEFINED | P_IDENT(GPIO_PD10) | P_FUNCT(0))
73#define P_PPI1_D11 (P_DEFINED | P_IDENT(GPIO_PD11) | P_FUNCT(0))
74#define P_PPI1_D12 (P_DEFINED | P_IDENT(GPIO_PD12) | P_FUNCT(0))
75#define P_PPI1_D13 (P_DEFINED | P_IDENT(GPIO_PD13) | P_FUNCT(0))
76#define P_PPI1_D14 (P_DEFINED | P_IDENT(GPIO_PD14) | P_FUNCT(0))
77#define P_PPI1_D15 (P_DEFINED | P_IDENT(GPIO_PD15) | P_FUNCT(0))
78
79#define P_HOST_D8 (P_DEFINED | P_IDENT(GPIO_PD0) | P_FUNCT(1))
80#define P_HOST_D9 (P_DEFINED | P_IDENT(GPIO_PD1) | P_FUNCT(1))
81#define P_HOST_D10 (P_DEFINED | P_IDENT(GPIO_PD2) | P_FUNCT(1))
82#define P_HOST_D11 (P_DEFINED | P_IDENT(GPIO_PD3) | P_FUNCT(1))
83#define P_HOST_D12 (P_DEFINED | P_IDENT(GPIO_PD4) | P_FUNCT(1))
84#define P_HOST_D13 (P_DEFINED | P_IDENT(GPIO_PD5) | P_FUNCT(1))
85#define P_HOST_D14 (P_DEFINED | P_IDENT(GPIO_PD6) | P_FUNCT(1))
86#define P_HOST_D15 (P_DEFINED | P_IDENT(GPIO_PD7) | P_FUNCT(1))
87#define P_HOST_D0 (P_DEFINED | P_IDENT(GPIO_PD8) | P_FUNCT(1))
88#define P_HOST_D1 (P_DEFINED | P_IDENT(GPIO_PD9) | P_FUNCT(1))
89#define P_HOST_D2 (P_DEFINED | P_IDENT(GPIO_PD10) | P_FUNCT(1))
90#define P_HOST_D3 (P_DEFINED | P_IDENT(GPIO_PD11) | P_FUNCT(1))
91#define P_HOST_D4 (P_DEFINED | P_IDENT(GPIO_PD12) | P_FUNCT(1))
92#define P_HOST_D5 (P_DEFINED | P_IDENT(GPIO_PD13) | P_FUNCT(1))
93#define P_HOST_D6 (P_DEFINED | P_IDENT(GPIO_PD14) | P_FUNCT(1))
94#define P_HOST_D7 (P_DEFINED | P_IDENT(GPIO_PD15) | P_FUNCT(1))
95#define P_SPORT1_TFS (P_DEFINED | P_IDENT(GPIO_PD0) | P_FUNCT(2))
96#define P_SPORT1_DTSEC (P_DEFINED | P_IDENT(GPIO_PD1) | P_FUNCT(2))
97#define P_SPORT1_DTPRI (P_DEFINED | P_IDENT(GPIO_PD2) | P_FUNCT(2))
98#define P_SPORT1_TSCLK (P_DEFINED | P_IDENT(GPIO_PD3) | P_FUNCT(2))
99#define P_SPORT1_RFS (P_DEFINED | P_IDENT(GPIO_PD4) | P_FUNCT(2))
100#define P_SPORT1_DRSEC (P_DEFINED | P_IDENT(GPIO_PD5) | P_FUNCT(2))
101#define P_SPORT1_DRPRI (P_DEFINED | P_IDENT(GPIO_PD6) | P_FUNCT(2))
102#define P_SPORT1_RSCLK (P_DEFINED | P_IDENT(GPIO_PD7) | P_FUNCT(2))
103#define P_PPI2_D0 (P_DEFINED | P_IDENT(GPIO_PD8) | P_FUNCT(2))
104#define P_PPI2_D1 (P_DEFINED | P_IDENT(GPIO_PD9) | P_FUNCT(2))
105#define P_PPI2_D2 (P_DEFINED | P_IDENT(GPIO_PD10) | P_FUNCT(2))
106#define P_PPI2_D3 (P_DEFINED | P_IDENT(GPIO_PD11) | P_FUNCT(2))
107#define P_PPI2_D4 (P_DEFINED | P_IDENT(GPIO_PD12) | P_FUNCT(2))
108#define P_PPI2_D5 (P_DEFINED | P_IDENT(GPIO_PD13) | P_FUNCT(2))
109#define P_PPI2_D6 (P_DEFINED | P_IDENT(GPIO_PD14) | P_FUNCT(2))
110#define P_PPI2_D7 (P_DEFINED | P_IDENT(GPIO_PD15) | P_FUNCT(2))
111#define P_PPI0_D18 (P_DEFINED | P_IDENT(GPIO_PD0) | P_FUNCT(3))
112#define P_PPI0_D19 (P_DEFINED | P_IDENT(GPIO_PD1) | P_FUNCT(3))
113#define P_PPI0_D20 (P_DEFINED | P_IDENT(GPIO_PD2) | P_FUNCT(3))
114#define P_PPI0_D21 (P_DEFINED | P_IDENT(GPIO_PD3) | P_FUNCT(3))
115#define P_PPI0_D22 (P_DEFINED | P_IDENT(GPIO_PD4) | P_FUNCT(3))
116#define P_PPI0_D23 (P_DEFINED | P_IDENT(GPIO_PD5) | P_FUNCT(3))
117#define P_KEY_ROW0 (P_DEFINED | P_IDENT(GPIO_PD8) | P_FUNCT(3))
118#define P_KEY_ROW1 (P_DEFINED | P_IDENT(GPIO_PD9) | P_FUNCT(3))
119#define P_KEY_ROW2 (P_DEFINED | P_IDENT(GPIO_PD10) | P_FUNCT(3))
120#define P_KEY_ROW3 (P_DEFINED | P_IDENT(GPIO_PD11) | P_FUNCT(3))
121#define P_KEY_COL0 (P_DEFINED | P_IDENT(GPIO_PD12) | P_FUNCT(3))
122#define P_KEY_COL1 (P_DEFINED | P_IDENT(GPIO_PD13) | P_FUNCT(3))
123#define P_KEY_COL2 (P_DEFINED | P_IDENT(GPIO_PD14) | P_FUNCT(3))
124#define P_KEY_COL3 (P_DEFINED | P_IDENT(GPIO_PD15) | P_FUNCT(3))
125
126#define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PE0) | P_FUNCT(0))
127#define P_SPI0_MISO (P_DEFINED | P_IDENT(GPIO_PE1) | P_FUNCT(0))
128#define P_SPI0_MOSI (P_DEFINED | P_IDENT(GPIO_PE2) | P_FUNCT(0))
129#define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PE3) | P_FUNCT(0))
130#define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PE4) | P_FUNCT(0))
131#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PE5) | P_FUNCT(0))
132#define P_SPI0_SSEL3 (P_DEFINED | P_IDENT(GPIO_PE6) | P_FUNCT(0))
133#define P_UART0_TX (P_DEFINED | P_IDENT(GPIO_PE7) | P_FUNCT(0))
134#define P_UART0_RX (P_DEFINED | P_IDENT(GPIO_PE8) | P_FUNCT(0))
135#define P_UART1_RTS (P_DEFINED | P_IDENT(GPIO_PE9) | P_FUNCT(0))
136#define P_UART1_CTS (P_DEFINED | P_IDENT(GPIO_PE10) | P_FUNCT(0))
137#define P_PPI1_CLK (P_DEFINED | P_IDENT(GPIO_PE11) | P_FUNCT(0))
138#define P_PPI1_FS1 (P_DEFINED | P_IDENT(GPIO_PE12) | P_FUNCT(0))
139#define P_PPI1_FS2 (P_DEFINED | P_IDENT(GPIO_PE13) | P_FUNCT(0))
140#define P_TWI0_SCL (P_DEFINED | P_IDENT(GPIO_PE14) | P_FUNCT(0))
141#define P_TWI0_SDA (P_DEFINED | P_IDENT(GPIO_PE15) | P_FUNCT(0))
142#define P_KEY_COL7 (P_DEFINED | P_IDENT(GPIO_PE0) | P_FUNCT(1))
143#define P_KEY_ROW6 (P_DEFINED | P_IDENT(GPIO_PE1) | P_FUNCT(1))
144#define P_KEY_COL6 (P_DEFINED | P_IDENT(GPIO_PE2) | P_FUNCT(1))
145#define P_KEY_ROW5 (P_DEFINED | P_IDENT(GPIO_PE3) | P_FUNCT(1))
146#define P_KEY_COL5 (P_DEFINED | P_IDENT(GPIO_PE4) | P_FUNCT(1))
147#define P_KEY_ROW4 (P_DEFINED | P_IDENT(GPIO_PE5) | P_FUNCT(1))
148#define P_KEY_COL4 (P_DEFINED | P_IDENT(GPIO_PE6) | P_FUNCT(1))
149#define P_KEY_ROW7 (P_DEFINED | P_IDENT(GPIO_PE7) | P_FUNCT(1))
150
151#define P_PPI0_D0 (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(0))
152#define P_PPI0_D1 (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(0))
153#define P_PPI0_D2 (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(0))
154#define P_PPI0_D3 (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(0))
155#define P_PPI0_D4 (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(0))
156#define P_PPI0_D5 (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(0))
157#define P_PPI0_D6 (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(0))
158#define P_PPI0_D7 (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(0))
159#define P_PPI0_D8 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(0))
160#define P_PPI0_D9 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(0))
161#define P_PPI0_D10 (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(0))
162#define P_PPI0_D11 (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(0))
163#define P_PPI0_D12 (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(0))
164#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(0))
165#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(0))
166#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(0))
167#define P_ATAPI_D0A (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(1))
168#define P_ATAPI_D1A (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(1))
169#define P_ATAPI_D2A (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(1))
170#define P_ATAPI_D3A (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(1))
171#define P_ATAPI_D4A (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(1))
172#define P_ATAPI_D5A (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(1))
173#define P_ATAPI_D6A (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(1))
174#define P_ATAPI_D7A (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(1))
175#define P_ATAPI_D8A (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(1))
176#define P_ATAPI_D9A (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1))
177#define P_ATAPI_D10A (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(1))
178#define P_ATAPI_D11A (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(1))
179#define P_ATAPI_D12A (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(1))
180#define P_ATAPI_D13A (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(1))
181#define P_ATAPI_D14A (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1))
182#define P_ATAPI_D15A (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1))
183
184#define P_PPI0_CLK (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0))
185#define P_PPI0_FS1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
186#define P_PPI0_FS2 (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(0))
187#define P_PPI0_D16 (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(0))
188#define P_PPI0_D17 (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(0))
189#define P_SPI1_SSEL1 (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(0))
190#define P_SPI1_SSEL2 (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(0))
191#define P_SPI1_SSEL3 (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(0))
192#define P_SPI1_SCK (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(0))
193#define P_SPI1_MISO (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(0))
194#define P_SPI1_MOSI (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(0))
195#define P_SPI1_SS (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(0))
196#define P_CAN0_TX (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(0))
197#define P_CAN0_RX (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(0))
198#define P_CAN1_TX (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(0))
199#define P_CAN1_RX (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(0))
200#define P_ATAPI_A0A (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(1))
201#define P_ATAPI_A1A (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(1))
202#define P_ATAPI_A2A (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(1))
203#define P_HOST_CE (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(1))
204#define P_HOST_RD (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(1))
205#define P_HOST_WR (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(1))
206#define P_MTXONB (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(1))
207#define P_PPI2_FS2 (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(2))
208#define P_PPI2_FS1 (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(2))
209#define P_PPI2_CLK (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(2))
210#define P_CNT_CZM (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(3))
211
212#define P_UART1_TX (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(0))
213#define P_UART1_RX (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(0))
214#define P_ATAPI_RESET (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(0))
215#define P_HOST_ADDR (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(0))
216#define P_HOST_ACK (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(0))
217#define P_MTX (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(0))
218#define P_MRX (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(0))
219#define P_MRXONB (P_DEFINED | P_IDENT(GPIO_PH7) | P_FUNCT(0))
220#define P_A4 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PH8) | P_FUNCT(0))
221#define P_A5 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PH9) | P_FUNCT(0))
222#define P_A6 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PH10) | P_FUNCT(0))
223#define P_A7 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PH11) | P_FUNCT(0))
224#define P_A8 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PH12) | P_FUNCT(0))
225#define P_A9 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PH13) | P_FUNCT(0))
226#define P_PPI1_FS3 (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(1))
227#define P_PPI2_FS3 (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(1))
228#define P_TMR8 (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(1))
229#define P_TMR9 (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(1))
230#define P_TMR10 (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(1))
231#define P_DMAR0 (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(1))
232#define P_DMAR1 (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(1))
233#define P_PPI0_FS3 (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(2))
234#define P_CNT_CDG (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(2))
235#define P_CNT_CUD (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(2))
236
237#define P_A10 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI0) | P_FUNCT(0))
238#define P_A11 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI1) | P_FUNCT(0))
239#define P_A12 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI2) | P_FUNCT(0))
240#define P_A13 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI3) | P_FUNCT(0))
241#define P_A14 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI4) | P_FUNCT(0))
242#define P_A15 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI5) | P_FUNCT(0))
243#define P_A16 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI6) | P_FUNCT(0))
244#define P_A17 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI7) | P_FUNCT(0))
245#define P_A18 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI8) | P_FUNCT(0))
246#define P_A19 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI9) | P_FUNCT(0))
247#define P_A20 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI10) | P_FUNCT(0))
248#define P_A21 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI11) | P_FUNCT(0))
249#define P_A22 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI12) | P_FUNCT(0))
250#define P_A23 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI13) | P_FUNCT(0))
251#define P_A24 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI14) | P_FUNCT(0))
252#define P_A25 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI15) | P_FUNCT(0))
253#define P_NOR_CLK (P_DEFINED | P_IDENT(GPIO_PI15) | P_FUNCT(1))
254
255#define P_AMC_ARDY_NOR_WAIT (P_DEFINED | P_IDENT(GPIO_PJ0) | P_FUNCT(0))
256#define P_NAND_CE (P_DEFINED | P_IDENT(GPIO_PJ1) | P_FUNCT(0))
257#define P_NAND_RB (P_DEFINED | P_IDENT(GPIO_PJ2) | P_FUNCT(0))
258#define P_ATAPI_DIOR (P_DEFINED | P_IDENT(GPIO_PJ3) | P_FUNCT(0))
259#define P_ATAPI_DIOW (P_DEFINED | P_IDENT(GPIO_PJ4) | P_FUNCT(0))
260#define P_ATAPI_CS0 (P_DEFINED | P_IDENT(GPIO_PJ5) | P_FUNCT(0))
261#define P_ATAPI_CS1 (P_DEFINED | P_IDENT(GPIO_PJ6) | P_FUNCT(0))
262#define P_ATAPI_DMACK (P_DEFINED | P_IDENT(GPIO_PJ7) | P_FUNCT(0))
263#define P_ATAPI_DMARQ (P_DEFINED | P_IDENT(GPIO_PJ8) | P_FUNCT(0))
264#define P_ATAPI_INTRQ (P_DEFINED | P_IDENT(GPIO_PJ9) | P_FUNCT(0))
265#define P_ATAPI_IORDY (P_DEFINED | P_IDENT(GPIO_PJ10) | P_FUNCT(0))
266#define P_AMC_BR (P_DEFINED | P_IDENT(GPIO_PJ11) | P_FUNCT(0))
267#define P_AMC_BG (P_DEFINED | P_IDENT(GPIO_PJ12) | P_FUNCT(0))
268#define P_AMC_BGH (P_DEFINED | P_IDENT(GPIO_PJ13) | P_FUNCT(0))
269
270#endif /* _MACH_PORTMUX_H_ */
diff --git a/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
index 23bf76aa3451..e043cafa3c42 100644
--- a/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
+++ b/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
@@ -78,6 +78,7 @@ struct bfin_serial_res {
78}; 78};
79 79
80struct bfin_serial_res bfin_serial_resource[] = { 80struct bfin_serial_res bfin_serial_resource[] = {
81 {
81 0xFFC00400, 82 0xFFC00400,
82 IRQ_UART_RX, 83 IRQ_UART_RX,
83#ifdef CONFIG_SERIAL_BFIN_DMA 84#ifdef CONFIG_SERIAL_BFIN_DMA
@@ -88,6 +89,7 @@ struct bfin_serial_res bfin_serial_resource[] = {
88 CONFIG_UART0_CTS_PIN, 89 CONFIG_UART0_CTS_PIN,
89 CONFIG_UART0_RTS_PIN, 90 CONFIG_UART0_RTS_PIN,
90#endif 91#endif
92 }
91}; 93};
92 94
93 95
diff --git a/include/asm-blackfin/mach-bf561/cdefBF561.h b/include/asm-blackfin/mach-bf561/cdefBF561.h
index b14f872e5703..1a8ec9e46922 100644
--- a/include/asm-blackfin/mach-bf561/cdefBF561.h
+++ b/include/asm-blackfin/mach-bf561/cdefBF561.h
@@ -57,12 +57,14 @@
57/* Writing to VR_CTL initiates a PLL relock sequence. */ 57/* Writing to VR_CTL initiates a PLL relock sequence. */
58static __inline__ void bfin_write_VR_CTL(unsigned int val) 58static __inline__ void bfin_write_VR_CTL(unsigned int val)
59{ 59{
60 unsigned long flags, iwr; 60 unsigned long flags, iwr0, iwr1;
61 61
62 /* Enable the PLL Wakeup bit in SIC IWR */ 62 /* Enable the PLL Wakeup bit in SIC IWR */
63 iwr = bfin_read32(SICA_IWR0); 63 iwr0 = bfin_read32(SICA_IWR0);
64 iwr1 = bfin_read32(SICA_IWR1);
64 /* Only allow PPL Wakeup) */ 65 /* Only allow PPL Wakeup) */
65 bfin_write32(SICA_IWR0, IWR_ENABLE(0)); 66 bfin_write32(SICA_IWR0, IWR_ENABLE(0));
67 bfin_write32(SICA_IWR1, 0);
66 68
67 bfin_write16(VR_CTL, val); 69 bfin_write16(VR_CTL, val);
68 __builtin_bfin_ssync(); 70 __builtin_bfin_ssync();
@@ -70,7 +72,8 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
70 local_irq_save(flags); 72 local_irq_save(flags);
71 asm("IDLE;"); 73 asm("IDLE;");
72 local_irq_restore(flags); 74 local_irq_restore(flags);
73 bfin_write32(SICA_IWR0, iwr); 75 bfin_write32(SICA_IWR0, iwr0);
76 bfin_write32(SICA_IWR1, iwr1);
74} 77}
75#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT) 78#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
76#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val) 79#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)
diff --git a/include/asm-blackfin/mach-bf561/dma.h b/include/asm-blackfin/mach-bf561/dma.h
index 21d982003e75..766334b7d8ab 100644
--- a/include/asm-blackfin/mach-bf561/dma.h
+++ b/include/asm-blackfin/mach-bf561/dma.h
@@ -32,4 +32,7 @@
32#define CH_IMEM_STREAM1_SRC 34 32#define CH_IMEM_STREAM1_SRC 34
33#define CH_IMEM_STREAM1_DEST 35 33#define CH_IMEM_STREAM1_DEST 35
34 34
35extern int channel2irq(unsigned int channel);
36extern struct dma_register *base_addr[];
37
35#endif 38#endif
diff --git a/include/asm-blackfin/mach-bf561/portmux.h b/include/asm-blackfin/mach-bf561/portmux.h
new file mode 100644
index 000000000000..10d11d5ffe23
--- /dev/null
+++ b/include/asm-blackfin/mach-bf561/portmux.h
@@ -0,0 +1,87 @@
1#ifndef _MACH_PORTMUX_H_
2#define _MACH_PORTMUX_H_
3
4#define P_PPI0_CLK (P_DONTCARE)
5#define P_PPI0_FS1 (P_DONTCARE)
6#define P_PPI0_FS2 (P_DONTCARE)
7#define P_PPI0_FS3 (P_DONTCARE)
8#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PF47))
9#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PF46))
10#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PF45))
11#define P_PPI0_D12 (P_DEFINED | P_IDENT(GPIO_PF44))
12#define P_PPI0_D11 (P_DEFINED | P_IDENT(GPIO_PF43))
13#define P_PPI0_D10 (P_DEFINED | P_IDENT(GPIO_PF42))
14#define P_PPI0_D9 (P_DEFINED | P_IDENT(GPIO_PF41))
15#define P_PPI0_D8 (P_DEFINED | P_IDENT(GPIO_PF40))
16#define P_PPI0_D0 (P_DONTCARE)
17#define P_PPI0_D1 (P_DONTCARE)
18#define P_PPI0_D2 (P_DONTCARE)
19#define P_PPI0_D3 (P_DONTCARE)
20#define P_PPI0_D4 (P_DONTCARE)
21#define P_PPI0_D5 (P_DONTCARE)
22#define P_PPI0_D6 (P_DONTCARE)
23#define P_PPI0_D7 (P_DONTCARE)
24#define P_PPI1_CLK (P_DONTCARE)
25#define P_PPI1_FS1 (P_DONTCARE)
26#define P_PPI1_FS2 (P_DONTCARE)
27#define P_PPI1_FS3 (P_DONTCARE)
28#define P_PPI1_D15 (P_DEFINED | P_IDENT(GPIO_PF39))
29#define P_PPI1_D14 (P_DEFINED | P_IDENT(GPIO_PF38))
30#define P_PPI1_D13 (P_DEFINED | P_IDENT(GPIO_PF37))
31#define P_PPI1_D12 (P_DEFINED | P_IDENT(GPIO_PF36))
32#define P_PPI1_D11 (P_DEFINED | P_IDENT(GPIO_PF35))
33#define P_PPI1_D10 (P_DEFINED | P_IDENT(GPIO_PF34))
34#define P_PPI1_D9 (P_DEFINED | P_IDENT(GPIO_PF33))
35#define P_PPI1_D8 (P_DEFINED | P_IDENT(GPIO_PF32))
36#define P_PPI1_D0 (P_DONTCARE)
37#define P_PPI1_D1 (P_DONTCARE)
38#define P_PPI1_D2 (P_DONTCARE)
39#define P_PPI1_D3 (P_DONTCARE)
40#define P_PPI1_D4 (P_DONTCARE)
41#define P_PPI1_D5 (P_DONTCARE)
42#define P_PPI1_D6 (P_DONTCARE)
43#define P_PPI1_D7 (P_DONTCARE)
44#define P_SPORT1_TSCLK (P_DEFINED | P_IDENT(GPIO_PF31))
45#define P_SPORT1_RSCLK (P_DEFINED | P_IDENT(GPIO_PF30))
46#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(GPIO_PF29))
47#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PF28))
48#define P_UART0_RX (P_DEFINED | P_IDENT(GPIO_PF27))
49#define P_UART0_TX (P_DEFINED | P_IDENT(GPIO_PF26))
50#define P_SPORT1_DRSEC (P_DEFINED | P_IDENT(GPIO_PF25))
51#define P_SPORT1_RFS (P_DEFINED | P_IDENT(GPIO_PF24))
52#define P_SPORT1_DTPRI (P_DEFINED | P_IDENT(GPIO_PF23))
53#define P_SPORT1_DTSEC (P_DEFINED | P_IDENT(GPIO_PF22))
54#define P_SPORT1_TFS (P_DEFINED | P_IDENT(GPIO_PF21))
55#define P_SPORT1_DRPRI (P_DONTCARE)
56#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(GPIO_PF20))
57#define P_SPORT0_RFS (P_DEFINED | P_IDENT(GPIO_PF19))
58#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(GPIO_PF18))
59#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(GPIO_PF17))
60#define P_SPORT0_TFS (P_DEFINED | P_IDENT(GPIO_PF16))
61#define P_SPORT0_DRPRI (P_DONTCARE)
62#define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF15))
63#define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(GPIO_PF7))
64#define P_SPI0_SSEL6 (P_DEFINED | P_IDENT(GPIO_PF6))
65#define P_SPI0_SSEL5 (P_DEFINED | P_IDENT(GPIO_PF5))
66#define P_SPI0_SSEL4 (P_DEFINED | P_IDENT(GPIO_PF4))
67#define P_SPI0_SSEL3 (P_DEFINED | P_IDENT(GPIO_PF3))
68#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF2))
69#define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF1))
70#define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF0))
71#define P_TMR11 (P_DONTCARE)
72#define P_TMR10 (P_DONTCARE)
73#define P_TMR9 (P_DONTCARE)
74#define P_TMR8 (P_DONTCARE)
75#define P_TMR7 (P_DEFINED | P_IDENT(GPIO_PF7))
76#define P_TMR6 (P_DEFINED | P_IDENT(GPIO_PF6))
77#define P_TMR5 (P_DEFINED | P_IDENT(GPIO_PF5))
78#define P_TMR4 (P_DEFINED | P_IDENT(GPIO_PF4))
79#define P_TMR3 (P_DEFINED | P_IDENT(GPIO_PF3))
80#define P_TMR2 (P_DEFINED | P_IDENT(GPIO_PF2))
81#define P_TMR1 (P_DEFINED | P_IDENT(GPIO_PF1))
82#define P_TMR0 (P_DEFINED | P_IDENT(GPIO_PF0))
83#define P_SPI0_MOSI (P_DONTCARE)
84#define P_SPI0_MIS0 (P_DONTCARE)
85#define P_SPI0_SCK (P_DONTCARE)
86
87#endif /* _MACH_PORTMUX_H_ */
diff --git a/include/asm-blackfin/mach-common/cdef_LPBlackfin.h b/include/asm-blackfin/mach-common/cdef_LPBlackfin.h
index d39c396f850d..94ed381e5606 100644
--- a/include/asm-blackfin/mach-common/cdef_LPBlackfin.h
+++ b/include/asm-blackfin/mach-common/cdef_LPBlackfin.h
@@ -39,7 +39,11 @@
39#define bfin_read_SRAM_BASE_ADDRESS() bfin_read32(SRAM_BASE_ADDRESS) 39#define bfin_read_SRAM_BASE_ADDRESS() bfin_read32(SRAM_BASE_ADDRESS)
40#define bfin_write_SRAM_BASE_ADDRESS(val) bfin_write32(SRAM_BASE_ADDRESS,val) 40#define bfin_write_SRAM_BASE_ADDRESS(val) bfin_write32(SRAM_BASE_ADDRESS,val)
41#define bfin_read_DMEM_CONTROL() bfin_read32(DMEM_CONTROL) 41#define bfin_read_DMEM_CONTROL() bfin_read32(DMEM_CONTROL)
42#ifdef ANOMALY_05000125
43extern void bfin_write_DMEM_CONTROL(unsigned int val);
44#else
42#define bfin_write_DMEM_CONTROL(val) bfin_write32(DMEM_CONTROL,val) 45#define bfin_write_DMEM_CONTROL(val) bfin_write32(DMEM_CONTROL,val)
46#endif
43#define bfin_read_DCPLB_STATUS() bfin_read32(DCPLB_STATUS) 47#define bfin_read_DCPLB_STATUS() bfin_read32(DCPLB_STATUS)
44#define bfin_write_DCPLB_STATUS(val) bfin_write32(DCPLB_STATUS,val) 48#define bfin_write_DCPLB_STATUS(val) bfin_write32(DCPLB_STATUS,val)
45#define bfin_read_DCPLB_FAULT_ADDR() bfin_read32(DCPLB_FAULT_ADDR) 49#define bfin_read_DCPLB_FAULT_ADDR() bfin_read32(DCPLB_FAULT_ADDR)
@@ -125,7 +129,11 @@
125#define DTEST_DATA3 0xFFE0040C 129#define DTEST_DATA3 0xFFE0040C
126*/ 130*/
127#define bfin_read_IMEM_CONTROL() bfin_read32(IMEM_CONTROL) 131#define bfin_read_IMEM_CONTROL() bfin_read32(IMEM_CONTROL)
132#ifdef ANOMALY_05000125
133extern void bfin_write_IMEM_CONTROL(unsigned int val);
134#else
128#define bfin_write_IMEM_CONTROL(val) bfin_write32(IMEM_CONTROL,val) 135#define bfin_write_IMEM_CONTROL(val) bfin_write32(IMEM_CONTROL,val)
136#endif
129#define bfin_read_ICPLB_STATUS() bfin_read32(ICPLB_STATUS) 137#define bfin_read_ICPLB_STATUS() bfin_read32(ICPLB_STATUS)
130#define bfin_write_ICPLB_STATUS(val) bfin_write32(ICPLB_STATUS,val) 138#define bfin_write_ICPLB_STATUS(val) bfin_write32(ICPLB_STATUS,val)
131#define bfin_read_ICPLB_FAULT_ADDR() bfin_read32(ICPLB_FAULT_ADDR) 139#define bfin_read_ICPLB_FAULT_ADDR() bfin_read32(ICPLB_FAULT_ADDR)
diff --git a/include/asm-blackfin/mach-common/def_LPBlackfin.h b/include/asm-blackfin/mach-common/def_LPBlackfin.h
index 76103526aec1..be1ece8c0c27 100644
--- a/include/asm-blackfin/mach-common/def_LPBlackfin.h
+++ b/include/asm-blackfin/mach-common/def_LPBlackfin.h
@@ -42,6 +42,12 @@
42 42
43#if defined(ANOMALY_05000198) 43#if defined(ANOMALY_05000198)
44 44
45#define bfin_read8(addr) ({ unsigned char __v; \
46 __asm__ __volatile__ ("NOP;\n\t" \
47 "%0 = b[%1] (z);\n\t" \
48 : "=d"(__v) : "a"(addr)); \
49 __v; })
50
45#define bfin_read16(addr) ({ unsigned __v; \ 51#define bfin_read16(addr) ({ unsigned __v; \
46 __asm__ __volatile__ ("NOP;\n\t"\ 52 __asm__ __volatile__ ("NOP;\n\t"\
47 "%0 = w[%1] (z);\n\t"\ 53 "%0 = w[%1] (z);\n\t"\
@@ -52,6 +58,11 @@
52 "%0 = [%1];\n\t"\ 58 "%0 = [%1];\n\t"\
53 : "=d"(__v) : "a"(addr)); __v; }) 59 : "=d"(__v) : "a"(addr)); __v; })
54 60
61#define bfin_write8(addr, val) ({ \
62 __asm__ __volatile__ ("NOP;\n\t" \
63 "b[%0] = %1;\n\t" \
64 : : "a"(addr), "d"(val) : "memory");})
65
55#define bfin_write16(addr,val) ({\ 66#define bfin_write16(addr,val) ({\
56 __asm__ __volatile__ ("NOP;\n\t"\ 67 __asm__ __volatile__ ("NOP;\n\t"\
57 "w[%0] = %1;\n\t"\ 68 "w[%0] = %1;\n\t"\
@@ -64,6 +75,12 @@
64 75
65#else 76#else
66 77
78#define bfin_read8(addr) ({ unsigned char __v; \
79 __asm__ __volatile__ ( \
80 "%0 = b[%1] (z);\n\t" \
81 :"=d"(__v) : "a"(addr)); \
82 __v; })
83
67#define bfin_read16(addr) ({ unsigned __v; \ 84#define bfin_read16(addr) ({ unsigned __v; \
68 __asm__ __volatile__ (\ 85 __asm__ __volatile__ (\
69 "%0 = w[%1] (z);\n\t"\ 86 "%0 = w[%1] (z);\n\t"\
@@ -74,6 +91,11 @@
74 "%0 = [%1];\n\t"\ 91 "%0 = [%1];\n\t"\
75 : "=d"(__v) : "a"(addr)); __v; }) 92 : "=d"(__v) : "a"(addr)); __v; })
76 93
94#define bfin_write8(addr, val) ({ \
95 __asm__ __volatile__ ( \
96 "b[%0] = %1; \n\t" \
97 ::"a"(addr), "d"(val) : "memory");})
98
77#define bfin_write16(addr,val) ({\ 99#define bfin_write16(addr,val) ({\
78 __asm__ __volatile__ (\ 100 __asm__ __volatile__ (\
79 "w[%0] = %1;\n\t"\ 101 "w[%0] = %1;\n\t"\
diff --git a/include/asm-blackfin/macros.h b/include/asm-blackfin/macros.h
deleted file mode 100644
index c0c04a2f2dd5..000000000000
--- a/include/asm-blackfin/macros.h
+++ /dev/null
@@ -1,95 +0,0 @@
1/************************************************************************
2 *
3 * macros.h
4 *
5 * (c) Copyright 2001-2003 Analog Devices, Inc. All rights reserved.
6 *
7 ************************************************************************/
8
9/* Defines various assembly macros. */
10
11#ifndef _MACROS_H
12#define _MACROS_H
13
14#define LO(con32) ((con32) & 0xFFFF)
15#define lo(con32) ((con32) & 0xFFFF)
16#define HI(con32) (((con32) >> 16) & 0xFFFF)
17#define hi(con32) (((con32) >> 16) & 0xFFFF)
18
19/*
20 * Set the corresponding bits in a System Register (SR);
21 * All bits set in "mask" will be set in the system register
22 * specified by "sys_reg" bitset_SR(sys_reg, mask), where
23 * sys_reg is the system register and mask are the bits to be set.
24 */
25#define bitset_SR(sys_reg, mask)\
26 [--SP] = (R7:6);\
27 r7 = sys_reg;\
28 r6.l = (mask) & 0xffff;\
29 r6.h = (mask) >> 16;\
30 r7 = r7 | r6;\
31 sys_reg = r7;\
32 csync;\
33 (R7:6) = [SP++]
34
35/*
36 * Clear the corresponding bits in a System Register (SR);
37 * All bits set in "mask" will be cleared in the SR
38 * specified by "sys_reg" bitclr_SR(sys_reg, mask), where
39 * sys_reg is the SR and mask are the bits to be cleared.
40 */
41#define bitclr_SR(sys_reg, mask)\
42 [--SP] = (R7:6);\
43 r7 = sys_reg;\
44 r7 =~ r7;\
45 r6.l = (mask) & 0xffff;\
46 r6.h = (mask) >> 16;\
47 r7 = r7 | r6;\
48 r7 =~ r7;\
49 sys_reg = r7;\
50 csync;\
51 (R7:6) = [SP++]
52
53/*
54 * Set the corresponding bits in a Memory Mapped Register (MMR);
55 * All bits set in "mask" will be set in the MMR specified by "mmr_reg"
56 * bitset_MMR(mmr_reg, mask), where mmr_reg is the MMR and mask are
57 * the bits to be set.
58 */
59#define bitset_MMR(mmr_reg, mask)\
60 [--SP] = (R7:6);\
61 [--SP] = P5;\
62 p5.l = mmr_reg & 0xffff;\
63 p5.h = mmr_reg >> 16;\
64 r7 = [p5];\
65 r6.l = (mask) & 0xffff;\
66 r6.h = (mask) >> 16;\
67 r7 = r7 | r6;\
68 [p5] = r7;\
69 csync;\
70 p5 = [SP++];\
71 (R7:6) = [SP++]
72
73/*
74 * Clear the corresponding bits in a Memory Mapped Register (MMR);
75 * All bits set in "mask" will be cleared in the MMR specified by "mmr_reg"
76 * bitclr_MMRreg(mmr_reg, mask), where sys_reg is the MMR and mask are
77 * the bits to be cleared.
78 */
79#define bitclr_MMR(mmr_reg, mask)\
80 [--SP] = (R7:6);\
81 [--SP] = P5;\
82 p5.l = mmr_reg & 0xffff;\
83 p5.h = mmr_reg >> 16;\
84 r7 = [p5];\
85 r7 =~ r7;\
86 r6.l = (mask) & 0xffff;\
87 r6.h = (mask) >> 16;\
88 r7 = r7 | r6;\
89 r7 =~ r7;\
90 [p5] = r7;\
91 csync;\
92 p5 = [SP++];\
93 (R7:6) = [SP++]
94
95#endif /* _MACROS_H */
diff --git a/include/asm-blackfin/mman.h b/include/asm-blackfin/mman.h
index 4d504f908c0c..b58f5ad3f024 100644
--- a/include/asm-blackfin/mman.h
+++ b/include/asm-blackfin/mman.h
@@ -22,8 +22,6 @@
22#define MAP_NORESERVE 0x4000 /* don't check for reservations */ 22#define MAP_NORESERVE 0x4000 /* don't check for reservations */
23#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ 23#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
24#define MAP_NONBLOCK 0x10000 /* do not block on IO */ 24#define MAP_NONBLOCK 0x10000 /* do not block on IO */
25#define MAP_UNINITIALIZE 0x4000000 /* For anonymous mmap, memory could
26 be uninitialized. */
27 25
28#define MS_ASYNC 1 /* sync memory asynchronously */ 26#define MS_ASYNC 1 /* sync memory asynchronously */
29#define MS_INVALIDATE 2 /* invalidate the caches */ 27#define MS_INVALIDATE 2 /* invalidate the caches */
diff --git a/include/asm-blackfin/page.h b/include/asm-blackfin/page.h
index ffad947f1b2a..8bc86717021c 100644
--- a/include/asm-blackfin/page.h
+++ b/include/asm-blackfin/page.h
@@ -4,7 +4,11 @@
4/* PAGE_SHIFT determines the page size */ 4/* PAGE_SHIFT determines the page size */
5 5
6#define PAGE_SHIFT 12 6#define PAGE_SHIFT 12
7#ifdef __ASSEMBLY__
8#define PAGE_SIZE (1 << PAGE_SHIFT)
9#else
7#define PAGE_SIZE (1UL << PAGE_SHIFT) 10#define PAGE_SIZE (1UL << PAGE_SHIFT)
11#endif
8#define PAGE_MASK (~(PAGE_SIZE-1)) 12#define PAGE_MASK (~(PAGE_SIZE-1))
9 13
10#ifdef __KERNEL__ 14#ifdef __KERNEL__
diff --git a/include/asm-blackfin/portmux.h b/include/asm-blackfin/portmux.h
new file mode 100644
index 000000000000..9d3681e42111
--- /dev/null
+++ b/include/asm-blackfin/portmux.h
@@ -0,0 +1,1133 @@
1/*
2 * Common header file for blackfin family of processors.
3 *
4 */
5
6#ifndef _PORTMUX_H_
7#define _PORTMUX_H_
8
9#define P_IDENT(x) ((x) & 0x1FF)
10#define P_FUNCT(x) (((x) & 0x3) << 9)
11#define P_FUNCT2MUX(x) (((x) >> 9) & 0x3)
12#define P_DEFINED 0x8000
13#define P_UNDEF 0x4000
14#define P_MAYSHARE 0x2000
15#define P_DONTCARE 0x1000
16
17#include <asm/gpio.h>
18#include <asm/mach/portmux.h>
19
20#ifndef P_SPORT2_TFS
21#define P_SPORT2_TFS P_UNDEF
22#endif
23
24#ifndef P_SPORT2_DTSEC
25#define P_SPORT2_DTSEC P_UNDEF
26#endif
27
28#ifndef P_SPORT2_DTPRI
29#define P_SPORT2_DTPRI P_UNDEF
30#endif
31
32#ifndef P_SPORT2_TSCLK
33#define P_SPORT2_TSCLK P_UNDEF
34#endif
35
36#ifndef P_SPORT2_RFS
37#define P_SPORT2_RFS P_UNDEF
38#endif
39
40#ifndef P_SPORT2_DRSEC
41#define P_SPORT2_DRSEC P_UNDEF
42#endif
43
44#ifndef P_SPORT2_DRPRI
45#define P_SPORT2_DRPRI P_UNDEF
46#endif
47
48#ifndef P_SPORT2_RSCLK
49#define P_SPORT2_RSCLK P_UNDEF
50#endif
51
52#ifndef P_SPORT3_TFS
53#define P_SPORT3_TFS P_UNDEF
54#endif
55
56#ifndef P_SPORT3_DTSEC
57#define P_SPORT3_DTSEC P_UNDEF
58#endif
59
60#ifndef P_SPORT3_DTPRI
61#define P_SPORT3_DTPRI P_UNDEF
62#endif
63
64#ifndef P_SPORT3_TSCLK
65#define P_SPORT3_TSCLK P_UNDEF
66#endif
67
68#ifndef P_SPORT3_RFS
69#define P_SPORT3_RFS P_UNDEF
70#endif
71
72#ifndef P_SPORT3_DRSEC
73#define P_SPORT3_DRSEC P_UNDEF
74#endif
75
76#ifndef P_SPORT3_DRPRI
77#define P_SPORT3_DRPRI P_UNDEF
78#endif
79
80#ifndef P_SPORT3_RSCLK
81#define P_SPORT3_RSCLK P_UNDEF
82#endif
83
84#ifndef P_TMR4
85#define P_TMR4 P_UNDEF
86#endif
87
88#ifndef P_TMR5
89#define P_TMR5 P_UNDEF
90#endif
91
92#ifndef P_TMR6
93#define P_TMR6 P_UNDEF
94#endif
95
96#ifndef P_TMR7
97#define P_TMR7 P_UNDEF
98#endif
99
100#ifndef P_TWI1_SCL
101#define P_TWI1_SCL P_UNDEF
102#endif
103
104#ifndef P_TWI1_SDA
105#define P_TWI1_SDA P_UNDEF
106#endif
107
108#ifndef P_UART3_RTS
109#define P_UART3_RTS P_UNDEF
110#endif
111
112#ifndef P_UART3_CTS
113#define P_UART3_CTS P_UNDEF
114#endif
115
116#ifndef P_UART2_TX
117#define P_UART2_TX P_UNDEF
118#endif
119
120#ifndef P_UART2_RX
121#define P_UART2_RX P_UNDEF
122#endif
123
124#ifndef P_UART3_TX
125#define P_UART3_TX P_UNDEF
126#endif
127
128#ifndef P_UART3_RX
129#define P_UART3_RX P_UNDEF
130#endif
131
132#ifndef P_SPI2_SS
133#define P_SPI2_SS P_UNDEF
134#endif
135
136#ifndef P_SPI2_SSEL1
137#define P_SPI2_SSEL1 P_UNDEF
138#endif
139
140#ifndef P_SPI2_SSEL2
141#define P_SPI2_SSEL2 P_UNDEF
142#endif
143
144#ifndef P_SPI2_SSEL3
145#define P_SPI2_SSEL3 P_UNDEF
146#endif
147
148#ifndef P_SPI2_SCK
149#define P_SPI2_SCK P_UNDEF
150#endif
151
152#ifndef P_SPI2_MOSI
153#define P_SPI2_MOSI P_UNDEF
154#endif
155
156#ifndef P_SPI2_MISO
157#define P_SPI2_MISO P_UNDEF
158#endif
159
160#ifndef P_TMR0
161#define P_TMR0 P_UNDEF
162#endif
163
164#ifndef P_TMR1
165#define P_TMR1 P_UNDEF
166#endif
167
168#ifndef P_TMR2
169#define P_TMR2 P_UNDEF
170#endif
171
172#ifndef P_TMR3
173#define P_TMR3 P_UNDEF
174#endif
175
176#ifndef P_SPORT0_TFS
177#define P_SPORT0_TFS P_UNDEF
178#endif
179
180#ifndef P_SPORT0_DTSEC
181#define P_SPORT0_DTSEC P_UNDEF
182#endif
183
184#ifndef P_SPORT0_DTPRI
185#define P_SPORT0_DTPRI P_UNDEF
186#endif
187
188#ifndef P_SPORT0_TSCLK
189#define P_SPORT0_TSCLK P_UNDEF
190#endif
191
192#ifndef P_SPORT0_RFS
193#define P_SPORT0_RFS P_UNDEF
194#endif
195
196#ifndef P_SPORT0_DRSEC
197#define P_SPORT0_DRSEC P_UNDEF
198#endif
199
200#ifndef P_SPORT0_DRPRI
201#define P_SPORT0_DRPRI P_UNDEF
202#endif
203
204#ifndef P_SPORT0_RSCLK
205#define P_SPORT0_RSCLK P_UNDEF
206#endif
207
208#ifndef P_SD_D0
209#define P_SD_D0 P_UNDEF
210#endif
211
212#ifndef P_SD_D1
213#define P_SD_D1 P_UNDEF
214#endif
215
216#ifndef P_SD_D2
217#define P_SD_D2 P_UNDEF
218#endif
219
220#ifndef P_SD_D3
221#define P_SD_D3 P_UNDEF
222#endif
223
224#ifndef P_SD_CLK
225#define P_SD_CLK P_UNDEF
226#endif
227
228#ifndef P_SD_CMD
229#define P_SD_CMD P_UNDEF
230#endif
231
232#ifndef P_MMCLK
233#define P_MMCLK P_UNDEF
234#endif
235
236#ifndef P_MBCLK
237#define P_MBCLK P_UNDEF
238#endif
239
240#ifndef P_PPI1_D0
241#define P_PPI1_D0 P_UNDEF
242#endif
243
244#ifndef P_PPI1_D1
245#define P_PPI1_D1 P_UNDEF
246#endif
247
248#ifndef P_PPI1_D2
249#define P_PPI1_D2 P_UNDEF
250#endif
251
252#ifndef P_PPI1_D3
253#define P_PPI1_D3 P_UNDEF
254#endif
255
256#ifndef P_PPI1_D4
257#define P_PPI1_D4 P_UNDEF
258#endif
259
260#ifndef P_PPI1_D5
261#define P_PPI1_D5 P_UNDEF
262#endif
263
264#ifndef P_PPI1_D6
265#define P_PPI1_D6 P_UNDEF
266#endif
267
268#ifndef P_PPI1_D7
269#define P_PPI1_D7 P_UNDEF
270#endif
271
272#ifndef P_PPI1_D8
273#define P_PPI1_D8 P_UNDEF
274#endif
275
276#ifndef P_PPI1_D9
277#define P_PPI1_D9 P_UNDEF
278#endif
279
280#ifndef P_PPI1_D10
281#define P_PPI1_D10 P_UNDEF
282#endif
283
284#ifndef P_PPI1_D11
285#define P_PPI1_D11 P_UNDEF
286#endif
287
288#ifndef P_PPI1_D12
289#define P_PPI1_D12 P_UNDEF
290#endif
291
292#ifndef P_PPI1_D13
293#define P_PPI1_D13 P_UNDEF
294#endif
295
296#ifndef P_PPI1_D14
297#define P_PPI1_D14 P_UNDEF
298#endif
299
300#ifndef P_PPI1_D15
301#define P_PPI1_D15 P_UNDEF
302#endif
303
304#ifndef P_HOST_D8
305#define P_HOST_D8 P_UNDEF
306#endif
307
308#ifndef P_HOST_D9
309#define P_HOST_D9 P_UNDEF
310#endif
311
312#ifndef P_HOST_D10
313#define P_HOST_D10 P_UNDEF
314#endif
315
316#ifndef P_HOST_D11
317#define P_HOST_D11 P_UNDEF
318#endif
319
320#ifndef P_HOST_D12
321#define P_HOST_D12 P_UNDEF
322#endif
323
324#ifndef P_HOST_D13
325#define P_HOST_D13 P_UNDEF
326#endif
327
328#ifndef P_HOST_D14
329#define P_HOST_D14 P_UNDEF
330#endif
331
332#ifndef P_HOST_D15
333#define P_HOST_D15 P_UNDEF
334#endif
335
336#ifndef P_HOST_D0
337#define P_HOST_D0 P_UNDEF
338#endif
339
340#ifndef P_HOST_D1
341#define P_HOST_D1 P_UNDEF
342#endif
343
344#ifndef P_HOST_D2
345#define P_HOST_D2 P_UNDEF
346#endif
347
348#ifndef P_HOST_D3
349#define P_HOST_D3 P_UNDEF
350#endif
351
352#ifndef P_HOST_D4
353#define P_HOST_D4 P_UNDEF
354#endif
355
356#ifndef P_HOST_D5
357#define P_HOST_D5 P_UNDEF
358#endif
359
360#ifndef P_HOST_D6
361#define P_HOST_D6 P_UNDEF
362#endif
363
364#ifndef P_HOST_D7
365#define P_HOST_D7 P_UNDEF
366#endif
367
368#ifndef P_SPORT1_TFS
369#define P_SPORT1_TFS P_UNDEF
370#endif
371
372#ifndef P_SPORT1_DTSEC
373#define P_SPORT1_DTSEC P_UNDEF
374#endif
375
376#ifndef P_SPORT1_DTPRI
377#define P_SPORT1_DTPRI P_UNDEF
378#endif
379
380#ifndef P_SPORT1_TSCLK
381#define P_SPORT1_TSCLK P_UNDEF
382#endif
383
384#ifndef P_SPORT1_RFS
385#define P_SPORT1_RFS P_UNDEF
386#endif
387
388#ifndef P_SPORT1_DRSEC
389#define P_SPORT1_DRSEC P_UNDEF
390#endif
391
392#ifndef P_SPORT1_DRPRI
393#define P_SPORT1_DRPRI P_UNDEF
394#endif
395
396#ifndef P_SPORT1_RSCLK
397#define P_SPORT1_RSCLK P_UNDEF
398#endif
399
400#ifndef P_PPI2_D0
401#define P_PPI2_D0 P_UNDEF
402#endif
403
404#ifndef P_PPI2_D1
405#define P_PPI2_D1 P_UNDEF
406#endif
407
408#ifndef P_PPI2_D2
409#define P_PPI2_D2 P_UNDEF
410#endif
411
412#ifndef P_PPI2_D3
413#define P_PPI2_D3 P_UNDEF
414#endif
415
416#ifndef P_PPI2_D4
417#define P_PPI2_D4 P_UNDEF
418#endif
419
420#ifndef P_PPI2_D5
421#define P_PPI2_D5 P_UNDEF
422#endif
423
424#ifndef P_PPI2_D6
425#define P_PPI2_D6 P_UNDEF
426#endif
427
428#ifndef P_PPI2_D7
429#define P_PPI2_D7 P_UNDEF
430#endif
431
432#ifndef P_PPI0_D18
433#define P_PPI0_D18 P_UNDEF
434#endif
435
436#ifndef P_PPI0_D19
437#define P_PPI0_D19 P_UNDEF
438#endif
439
440#ifndef P_PPI0_D20
441#define P_PPI0_D20 P_UNDEF
442#endif
443
444#ifndef P_PPI0_D21
445#define P_PPI0_D21 P_UNDEF
446#endif
447
448#ifndef P_PPI0_D22
449#define P_PPI0_D22 P_UNDEF
450#endif
451
452#ifndef P_PPI0_D23
453#define P_PPI0_D23 P_UNDEF
454#endif
455
456#ifndef P_KEY_ROW0
457#define P_KEY_ROW0 P_UNDEF
458#endif
459
460#ifndef P_KEY_ROW1
461#define P_KEY_ROW1 P_UNDEF
462#endif
463
464#ifndef P_KEY_ROW2
465#define P_KEY_ROW2 P_UNDEF
466#endif
467
468#ifndef P_KEY_ROW3
469#define P_KEY_ROW3 P_UNDEF
470#endif
471
472#ifndef P_KEY_COL0
473#define P_KEY_COL0 P_UNDEF
474#endif
475
476#ifndef P_KEY_COL1
477#define P_KEY_COL1 P_UNDEF
478#endif
479
480#ifndef P_KEY_COL2
481#define P_KEY_COL2 P_UNDEF
482#endif
483
484#ifndef P_KEY_COL3
485#define P_KEY_COL3 P_UNDEF
486#endif
487
488#ifndef P_SPI0_SCK
489#define P_SPI0_SCK P_UNDEF
490#endif
491
492#ifndef P_SPI0_MISO
493#define P_SPI0_MISO P_UNDEF
494#endif
495
496#ifndef P_SPI0_MOSI
497#define P_SPI0_MOSI P_UNDEF
498#endif
499
500#ifndef P_SPI0_SS
501#define P_SPI0_SS P_UNDEF
502#endif
503
504#ifndef P_SPI0_SSEL1
505#define P_SPI0_SSEL1 P_UNDEF
506#endif
507
508#ifndef P_SPI0_SSEL2
509#define P_SPI0_SSEL2 P_UNDEF
510#endif
511
512#ifndef P_SPI0_SSEL3
513#define P_SPI0_SSEL3 P_UNDEF
514#endif
515
516#ifndef P_UART0_TX
517#define P_UART0_TX P_UNDEF
518#endif
519
520#ifndef P_UART0_RX
521#define P_UART0_RX P_UNDEF
522#endif
523
524#ifndef P_UART1_RTS
525#define P_UART1_RTS P_UNDEF
526#endif
527
528#ifndef P_UART1_CTS
529#define P_UART1_CTS P_UNDEF
530#endif
531
532#ifndef P_PPI1_CLK
533#define P_PPI1_CLK P_UNDEF
534#endif
535
536#ifndef P_PPI1_FS1
537#define P_PPI1_FS1 P_UNDEF
538#endif
539
540#ifndef P_PPI1_FS2
541#define P_PPI1_FS2 P_UNDEF
542#endif
543
544#ifndef P_TWI0_SCL
545#define P_TWI0_SCL P_UNDEF
546#endif
547
548#ifndef P_TWI0_SDA
549#define P_TWI0_SDA P_UNDEF
550#endif
551
552#ifndef P_KEY_COL7
553#define P_KEY_COL7 P_UNDEF
554#endif
555
556#ifndef P_KEY_ROW6
557#define P_KEY_ROW6 P_UNDEF
558#endif
559
560#ifndef P_KEY_COL6
561#define P_KEY_COL6 P_UNDEF
562#endif
563
564#ifndef P_KEY_ROW5
565#define P_KEY_ROW5 P_UNDEF
566#endif
567
568#ifndef P_KEY_COL5
569#define P_KEY_COL5 P_UNDEF
570#endif
571
572#ifndef P_KEY_ROW4
573#define P_KEY_ROW4 P_UNDEF
574#endif
575
576#ifndef P_KEY_COL4
577#define P_KEY_COL4 P_UNDEF
578#endif
579
580#ifndef P_KEY_ROW7
581#define P_KEY_ROW7 P_UNDEF
582#endif
583
584#ifndef P_PPI0_D0
585#define P_PPI0_D0 P_UNDEF
586#endif
587
588#ifndef P_PPI0_D1
589#define P_PPI0_D1 P_UNDEF
590#endif
591
592#ifndef P_PPI0_D2
593#define P_PPI0_D2 P_UNDEF
594#endif
595
596#ifndef P_PPI0_D3
597#define P_PPI0_D3 P_UNDEF
598#endif
599
600#ifndef P_PPI0_D4
601#define P_PPI0_D4 P_UNDEF
602#endif
603
604#ifndef P_PPI0_D5
605#define P_PPI0_D5 P_UNDEF
606#endif
607
608#ifndef P_PPI0_D6
609#define P_PPI0_D6 P_UNDEF
610#endif
611
612#ifndef P_PPI0_D7
613#define P_PPI0_D7 P_UNDEF
614#endif
615
616#ifndef P_PPI0_D8
617#define P_PPI0_D8 P_UNDEF
618#endif
619
620#ifndef P_PPI0_D9
621#define P_PPI0_D9 P_UNDEF
622#endif
623
624#ifndef P_PPI0_D10
625#define P_PPI0_D10 P_UNDEF
626#endif
627
628#ifndef P_PPI0_D11
629#define P_PPI0_D11 P_UNDEF
630#endif
631
632#ifndef P_PPI0_D12
633#define P_PPI0_D12 P_UNDEF
634#endif
635
636#ifndef P_PPI0_D13
637#define P_PPI0_D13 P_UNDEF
638#endif
639
640#ifndef P_PPI0_D14
641#define P_PPI0_D14 P_UNDEF
642#endif
643
644#ifndef P_PPI0_D15
645#define P_PPI0_D15 P_UNDEF
646#endif
647
648#ifndef P_ATAPI_D0A
649#define P_ATAPI_D0A P_UNDEF
650#endif
651
652#ifndef P_ATAPI_D1A
653#define P_ATAPI_D1A P_UNDEF
654#endif
655
656#ifndef P_ATAPI_D2A
657#define P_ATAPI_D2A P_UNDEF
658#endif
659
660#ifndef P_ATAPI_D3A
661#define P_ATAPI_D3A P_UNDEF
662#endif
663
664#ifndef P_ATAPI_D4A
665#define P_ATAPI_D4A P_UNDEF
666#endif
667
668#ifndef P_ATAPI_D5A
669#define P_ATAPI_D5A P_UNDEF
670#endif
671
672#ifndef P_ATAPI_D6A
673#define P_ATAPI_D6A P_UNDEF
674#endif
675
676#ifndef P_ATAPI_D7A
677#define P_ATAPI_D7A P_UNDEF
678#endif
679
680#ifndef P_ATAPI_D8A
681#define P_ATAPI_D8A P_UNDEF
682#endif
683
684#ifndef P_ATAPI_D9A
685#define P_ATAPI_D9A P_UNDEF
686#endif
687
688#ifndef P_ATAPI_D10A
689#define P_ATAPI_D10A P_UNDEF
690#endif
691
692#ifndef P_ATAPI_D11A
693#define P_ATAPI_D11A P_UNDEF
694#endif
695
696#ifndef P_ATAPI_D12A
697#define P_ATAPI_D12A P_UNDEF
698#endif
699
700#ifndef P_ATAPI_D13A
701#define P_ATAPI_D13A P_UNDEF
702#endif
703
704#ifndef P_ATAPI_D14A
705#define P_ATAPI_D14A P_UNDEF
706#endif
707
708#ifndef P_ATAPI_D15A
709#define P_ATAPI_D15A P_UNDEF
710#endif
711
712#ifndef P_PPI0_CLK
713#define P_PPI0_CLK P_UNDEF
714#endif
715
716#ifndef P_PPI0_FS1
717#define P_PPI0_FS1 P_UNDEF
718#endif
719
720#ifndef P_PPI0_FS2
721#define P_PPI0_FS2 P_UNDEF
722#endif
723
724#ifndef P_PPI0_D16
725#define P_PPI0_D16 P_UNDEF
726#endif
727
728#ifndef P_PPI0_D17
729#define P_PPI0_D17 P_UNDEF
730#endif
731
732#ifndef P_SPI1_SSEL1
733#define P_SPI1_SSEL1 P_UNDEF
734#endif
735
736#ifndef P_SPI1_SSEL2
737#define P_SPI1_SSEL2 P_UNDEF
738#endif
739
740#ifndef P_SPI1_SSEL3
741#define P_SPI1_SSEL3 P_UNDEF
742#endif
743
744#ifndef P_SPI1_SCK
745#define P_SPI1_SCK P_UNDEF
746#endif
747
748#ifndef P_SPI1_MISO
749#define P_SPI1_MISO P_UNDEF
750#endif
751
752#ifndef P_SPI1_MOSI
753#define P_SPI1_MOSI P_UNDEF
754#endif
755
756#ifndef P_SPI1_SS
757#define P_SPI1_SS P_UNDEF
758#endif
759
760#ifndef P_CAN0_TX
761#define P_CAN0_TX P_UNDEF
762#endif
763
764#ifndef P_CAN0_RX
765#define P_CAN0_RX P_UNDEF
766#endif
767
768#ifndef P_CAN1_TX
769#define P_CAN1_TX P_UNDEF
770#endif
771
772#ifndef P_CAN1_RX
773#define P_CAN1_RX P_UNDEF
774#endif
775
776#ifndef P_ATAPI_A0A
777#define P_ATAPI_A0A P_UNDEF
778#endif
779
780#ifndef P_ATAPI_A1A
781#define P_ATAPI_A1A P_UNDEF
782#endif
783
784#ifndef P_ATAPI_A2A
785#define P_ATAPI_A2A P_UNDEF
786#endif
787
788#ifndef P_HOST_CE
789#define P_HOST_CE P_UNDEF
790#endif
791
792#ifndef P_HOST_RD
793#define P_HOST_RD P_UNDEF
794#endif
795
796#ifndef P_HOST_WR
797#define P_HOST_WR P_UNDEF
798#endif
799
800#ifndef P_MTXONB
801#define P_MTXONB P_UNDEF
802#endif
803
804#ifndef P_PPI2_FS2
805#define P_PPI2_FS2 P_UNDEF
806#endif
807
808#ifndef P_PPI2_FS1
809#define P_PPI2_FS1 P_UNDEF
810#endif
811
812#ifndef P_PPI2_CLK
813#define P_PPI2_CLK P_UNDEF
814#endif
815
816#ifndef P_CNT_CZM
817#define P_CNT_CZM P_UNDEF
818#endif
819
820#ifndef P_UART1_TX
821#define P_UART1_TX P_UNDEF
822#endif
823
824#ifndef P_UART1_RX
825#define P_UART1_RX P_UNDEF
826#endif
827
828#ifndef P_ATAPI_RESET
829#define P_ATAPI_RESET P_UNDEF
830#endif
831
832#ifndef P_HOST_ADDR
833#define P_HOST_ADDR P_UNDEF
834#endif
835
836#ifndef P_HOST_ACK
837#define P_HOST_ACK P_UNDEF
838#endif
839
840#ifndef P_MTX
841#define P_MTX P_UNDEF
842#endif
843
844#ifndef P_MRX
845#define P_MRX P_UNDEF
846#endif
847
848#ifndef P_MRXONB
849#define P_MRXONB P_UNDEF
850#endif
851
852#ifndef P_A4
853#define P_A4 P_UNDEF
854#endif
855
856#ifndef P_A5
857#define P_A5 P_UNDEF
858#endif
859
860#ifndef P_A6
861#define P_A6 P_UNDEF
862#endif
863
864#ifndef P_A7
865#define P_A7 P_UNDEF
866#endif
867
868#ifndef P_A8
869#define P_A8 P_UNDEF
870#endif
871
872#ifndef P_A9
873#define P_A9 P_UNDEF
874#endif
875
876#ifndef P_PPI1_FS3
877#define P_PPI1_FS3 P_UNDEF
878#endif
879
880#ifndef P_PPI2_FS3
881#define P_PPI2_FS3 P_UNDEF
882#endif
883
884#ifndef P_TMR8
885#define P_TMR8 P_UNDEF
886#endif
887
888#ifndef P_TMR9
889#define P_TMR9 P_UNDEF
890#endif
891
892#ifndef P_TMR10
893#define P_TMR10 P_UNDEF
894#endif
895#ifndef P_TMR11
896#define P_TMR11 P_UNDEF
897#endif
898
899#ifndef P_DMAR0
900#define P_DMAR0 P_UNDEF
901#endif
902
903#ifndef P_DMAR1
904#define P_DMAR1 P_UNDEF
905#endif
906
907#ifndef P_PPI0_FS3
908#define P_PPI0_FS3 P_UNDEF
909#endif
910
911#ifndef P_CNT_CDG
912#define P_CNT_CDG P_UNDEF
913#endif
914
915#ifndef P_CNT_CUD
916#define P_CNT_CUD P_UNDEF
917#endif
918
919#ifndef P_A10
920#define P_A10 P_UNDEF
921#endif
922
923#ifndef P_A11
924#define P_A11 P_UNDEF
925#endif
926
927#ifndef P_A12
928#define P_A12 P_UNDEF
929#endif
930
931#ifndef P_A13
932#define P_A13 P_UNDEF
933#endif
934
935#ifndef P_A14
936#define P_A14 P_UNDEF
937#endif
938
939#ifndef P_A15
940#define P_A15 P_UNDEF
941#endif
942
943#ifndef P_A16
944#define P_A16 P_UNDEF
945#endif
946
947#ifndef P_A17
948#define P_A17 P_UNDEF
949#endif
950
951#ifndef P_A18
952#define P_A18 P_UNDEF
953#endif
954
955#ifndef P_A19
956#define P_A19 P_UNDEF
957#endif
958
959#ifndef P_A20
960#define P_A20 P_UNDEF
961#endif
962
963#ifndef P_A21
964#define P_A21 P_UNDEF
965#endif
966
967#ifndef P_A22
968#define P_A22 P_UNDEF
969#endif
970
971#ifndef P_A23
972#define P_A23 P_UNDEF
973#endif
974
975#ifndef P_A24
976#define P_A24 P_UNDEF
977#endif
978
979#ifndef P_A25
980#define P_A25 P_UNDEF
981#endif
982
983#ifndef P_NOR_CLK
984#define P_NOR_CLK P_UNDEF
985#endif
986
987#ifndef P_TMRCLK
988#define P_TMRCLK P_UNDEF
989#endif
990
991#ifndef P_AMC_ARDY_NOR_WAIT
992#define P_AMC_ARDY_NOR_WAIT P_UNDEF
993#endif
994
995#ifndef P_NAND_CE
996#define P_NAND_CE P_UNDEF
997#endif
998
999#ifndef P_NAND_RB
1000#define P_NAND_RB P_UNDEF
1001#endif
1002
1003#ifndef P_ATAPI_DIOR
1004#define P_ATAPI_DIOR P_UNDEF
1005#endif
1006
1007#ifndef P_ATAPI_DIOW
1008#define P_ATAPI_DIOW P_UNDEF
1009#endif
1010
1011#ifndef P_ATAPI_CS0
1012#define P_ATAPI_CS0 P_UNDEF
1013#endif
1014
1015#ifndef P_ATAPI_CS1
1016#define P_ATAPI_CS1 P_UNDEF
1017#endif
1018
1019#ifndef P_ATAPI_DMACK
1020#define P_ATAPI_DMACK P_UNDEF
1021#endif
1022
1023#ifndef P_ATAPI_DMARQ
1024#define P_ATAPI_DMARQ P_UNDEF
1025#endif
1026
1027#ifndef P_ATAPI_INTRQ
1028#define P_ATAPI_INTRQ P_UNDEF
1029#endif
1030
1031#ifndef P_ATAPI_IORDY
1032#define P_ATAPI_IORDY P_UNDEF
1033#endif
1034
1035#ifndef P_AMC_BR
1036#define P_AMC_BR P_UNDEF
1037#endif
1038
1039#ifndef P_AMC_BG
1040#define P_AMC_BG P_UNDEF
1041#endif
1042
1043#ifndef P_AMC_BGH
1044#define P_AMC_BGH P_UNDEF
1045#endif
1046
1047/* EMAC */
1048
1049#ifndef P_MII0_ETxD0
1050#define P_MII0_ETxD0 P_UNDEF
1051#endif
1052
1053#ifndef P_MII0_ETxD1
1054#define P_MII0_ETxD1 P_UNDEF
1055#endif
1056
1057#ifndef P_MII0_ETxD2
1058#define P_MII0_ETxD2 P_UNDEF
1059#endif
1060
1061#ifndef P_MII0_ETxD3
1062#define P_MII0_ETxD3 P_UNDEF
1063#endif
1064
1065#ifndef P_MII0_ETxEN
1066#define P_MII0_ETxEN P_UNDEF
1067#endif
1068
1069#ifndef P_MII0_TxCLK
1070#define P_MII0_TxCLK P_UNDEF
1071#endif
1072
1073#ifndef P_MII0_PHYINT
1074#define P_MII0_PHYINT P_UNDEF
1075#endif
1076
1077#ifndef P_MII0_COL
1078#define P_MII0_COL P_UNDEF
1079#endif
1080
1081#ifndef P_MII0_ERxD0
1082#define P_MII0_ERxD0 P_UNDEF
1083#endif
1084
1085#ifndef P_MII0_ERxD1
1086#define P_MII0_ERxD1 P_UNDEF
1087#endif
1088
1089#ifndef P_MII0_ERxD2
1090#define P_MII0_ERxD2 P_UNDEF
1091#endif
1092
1093#ifndef P_MII0_ERxD3
1094#define P_MII0_ERxD3 P_UNDEF
1095#endif
1096
1097#ifndef P_MII0_ERxDV
1098#define P_MII0_ERxDV P_UNDEF
1099#endif
1100
1101#ifndef P_MII0_ERxCLK
1102#define P_MII0_ERxCLK P_UNDEF
1103#endif
1104
1105#ifndef P_MII0_ERxER
1106#define P_MII0_ERxER P_UNDEF
1107#endif
1108
1109#ifndef P_MII0_CRS
1110#define P_MII0_CRS P_UNDEF
1111#endif
1112
1113#ifndef P_RMII0_REF_CLK
1114#define P_RMII0_REF_CLK P_UNDEF
1115#endif
1116
1117#ifndef P_RMII0_MDINT
1118#define P_RMII0_MDINT P_UNDEF
1119#endif
1120
1121#ifndef P_RMII0_CRS_DV
1122#define P_RMII0_CRS_DV P_UNDEF
1123#endif
1124
1125#ifndef P_MDC
1126#define P_MDC P_UNDEF
1127#endif
1128
1129#ifndef P_MDIO
1130#define P_MDIO P_UNDEF
1131#endif
1132
1133#endif /* _PORTMUX_H_ */
diff --git a/include/asm-blackfin/processor.h b/include/asm-blackfin/processor.h
index aba2b30a8ed8..6bb3e0d4705d 100644
--- a/include/asm-blackfin/processor.h
+++ b/include/asm-blackfin/processor.h
@@ -124,6 +124,10 @@ static inline __attribute_pure__ uint32_t bfin_compiled_revid(void)
124 return 4; 124 return 4;
125#elif defined(CONFIG_BF_REV_0_5) 125#elif defined(CONFIG_BF_REV_0_5)
126 return 5; 126 return 5;
127#elif defined(CONFIG_BF_REV_ANY)
128 return 0xffff;
129#else
130 return -1;
127#endif 131#endif
128} 132}
129 133
diff --git a/include/asm-blackfin/termbits.h b/include/asm-blackfin/termbits.h
index 2fd9dabdba77..4eac38de8ce1 100644
--- a/include/asm-blackfin/termbits.h
+++ b/include/asm-blackfin/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct termios2 {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20struct ktermios { 31struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */ 32 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */ 33 tcflag_t c_oflag; /* output mode flags */
diff --git a/include/asm-blackfin/trace.h b/include/asm-blackfin/trace.h
new file mode 100644
index 000000000000..9c2474c9a589
--- /dev/null
+++ b/include/asm-blackfin/trace.h
@@ -0,0 +1,52 @@
1/*
2 * Common header file for blackfin family of processors.
3 *
4 */
5
6#ifndef _BLACKFIN_TRACE_
7#define _BLACKFIN_TRACE_
8
9#ifndef __ASSEMBLY__
10/* Trace Macros for C files */
11
12#define trace_buffer_save(x) \
13 do { \
14 (x) = bfin_read_TBUFCTL(); \
15 bfin_write_TBUFCTL((x) & ~TBUFEN); \
16 } while (0)
17
18#define trace_buffer_restore(x) \
19 do { \
20 bfin_write_TBUFCTL((x)); \
21 } while (0)
22
23#else
24/* Trace Macros for Assembly files */
25
26#define TRACE_BUFFER_START(preg, dreg) trace_buffer_start(preg, dreg)
27#define TRACE_BUFFER_STOP(preg, dreg) trace_buffer_stop(preg, dreg)
28
29#define trace_buffer_stop(preg, dreg) \
30 preg.L = LO(TBUFCTL); \
31 preg.H = HI(TBUFCTL); \
32 dreg = 0x1; \
33 [preg] = dreg;
34
35#define trace_buffer_start(preg, dreg) \
36 preg.L = LO(TBUFCTL); \
37 preg.H = HI(TBUFCTL); \
38 dreg = 0x13; \
39 [preg] = dreg;
40
41#ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
42# define DEBUG_START_HWTRACE(preg, dreg) trace_buffer_start(preg, dreg)
43# define DEBUG_STOP_HWTRACE(preg, dreg) trace_buffer_stop(preg, dreg)
44
45#else
46# define DEBUG_START_HWTRACE(preg, dreg)
47# define DEBUG_STOP_HWTRACE(preg, dreg)
48#endif
49
50#endif /* __ASSEMBLY__ */
51
52#endif /* _BLACKFIN_TRACE_ */
diff --git a/include/asm-blackfin/unistd.h b/include/asm-blackfin/unistd.h
index 4df8790a67d5..0df9f2d322a3 100644
--- a/include/asm-blackfin/unistd.h
+++ b/include/asm-blackfin/unistd.h
@@ -369,7 +369,6 @@
369#define __ARCH_WANT_SYS_NICE 369#define __ARCH_WANT_SYS_NICE
370#define __ARCH_WANT_SYS_RT_SIGACTION 370#define __ARCH_WANT_SYS_RT_SIGACTION
371#define __ARCH_WANT_SYS_RT_SIGSUSPEND 371#define __ARCH_WANT_SYS_RT_SIGSUSPEND
372#endif
373 372
374/* 373/*
375 * "Conditional" syscalls 374 * "Conditional" syscalls
@@ -379,4 +378,6 @@
379 */ 378 */
380#define cond_syscall(x) asm(".weak\t_" #x "\n\t.set\t_" #x ",_sys_ni_syscall"); 379#define cond_syscall(x) asm(".weak\t_" #x "\n\t.set\t_" #x ",_sys_ni_syscall");
381 380
381#endif /* __KERNEL__ */
382
382#endif /* __ASM_BFIN_UNISTD_H */ 383#endif /* __ASM_BFIN_UNISTD_H */
diff --git a/include/asm-cris/a.out.h b/include/asm-cris/a.out.h
index 770734ce54a6..919b34a084f8 100644
--- a/include/asm-cris/a.out.h
+++ b/include/asm-cris/a.out.h
@@ -8,6 +8,7 @@
8 8
9/* grabbed from the intel stuff */ 9/* grabbed from the intel stuff */
10#define STACK_TOP TASK_SIZE 10#define STACK_TOP TASK_SIZE
11#define STACK_TOP_MAX STACK_TOP
11 12
12 13
13struct exec 14struct exec
diff --git a/include/asm-cris/fb.h b/include/asm-cris/fb.h
new file mode 100644
index 000000000000..c7df38030992
--- /dev/null
+++ b/include/asm-cris/fb.h
@@ -0,0 +1,12 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/include/asm-cris/ioctls.h b/include/asm-cris/ioctls.h
index 97787c3c575f..4f4e52531fa0 100644
--- a/include/asm-cris/ioctls.h
+++ b/include/asm-cris/ioctls.h
@@ -48,6 +48,10 @@
48#define TIOCSBRK 0x5427 /* BSD compatibility */ 48#define TIOCSBRK 0x5427 /* BSD compatibility */
49#define TIOCCBRK 0x5428 /* BSD compatibility */ 49#define TIOCCBRK 0x5428 /* BSD compatibility */
50#define TIOCGSID 0x5429 /* Return the session ID of FD */ 50#define TIOCGSID 0x5429 /* Return the session ID of FD */
51#define TCGETS2 _IOR('T',0x2A, struct termios2)
52#define TCSETS2 _IOW('T',0x2B, struct termios2)
53#define TCSETSW2 _IOW('T',0x2C, struct termios2)
54#define TCSETSF2 _IOW('T',0x2D, struct termios2)
51#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 55#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
52#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 56#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
53 57
diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h
index 9f13c32552bf..0648e3153f81 100644
--- a/include/asm-cris/page.h
+++ b/include/asm-cris/page.h
@@ -20,7 +20,8 @@
20#define clear_user_page(page, vaddr, pg) clear_page(page) 20#define clear_user_page(page, vaddr, pg) clear_page(page)
21#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 21#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
22 22
23#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) 23#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
24 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
24#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 25#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
25 26
26/* 27/*
diff --git a/include/asm-cris/pci.h b/include/asm-cris/pci.h
index b2ac8a331da1..730ce40fdd0f 100644
--- a/include/asm-cris/pci.h
+++ b/include/asm-cris/pci.h
@@ -52,47 +52,11 @@ struct pci_dev;
52#define pci_unmap_len(PTR, LEN_NAME) (0) 52#define pci_unmap_len(PTR, LEN_NAME) (0)
53#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) 53#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
54 54
55/* This is always fine. */
56#define pci_dac_dma_supported(pci_dev, mask) (1)
57
58static inline dma64_addr_t
59pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page, unsigned long offset, int direction)
60{
61 return ((dma64_addr_t) page_to_phys(page) +
62 (dma64_addr_t) offset);
63}
64
65static inline struct page *
66pci_dac_dma_to_page(struct pci_dev *pdev, dma64_addr_t dma_addr)
67{
68 return pfn_to_page(dma_addr >> PAGE_SHIFT);
69}
70
71static inline unsigned long
72pci_dac_dma_to_offset(struct pci_dev *pdev, dma64_addr_t dma_addr)
73{
74 return (dma_addr & ~PAGE_MASK);
75}
76
77static inline void
78pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
79{
80}
81
82static inline void
83pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
84{
85}
86
87#define HAVE_PCI_MMAP 55#define HAVE_PCI_MMAP
88extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 56extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
89 enum pci_mmap_state mmap_state, int write_combine); 57 enum pci_mmap_state mmap_state, int write_combine);
90 58
91 59
92static inline void pcibios_add_platform_entries(struct pci_dev *dev)
93{
94}
95
96#endif /* __KERNEL__ */ 60#endif /* __KERNEL__ */
97 61
98/* implement the pci_ DMA API in terms of the generic device dma_ one */ 62/* implement the pci_ DMA API in terms of the generic device dma_ one */
diff --git a/include/asm-cris/pgtable.h b/include/asm-cris/pgtable.h
index c94a7107019c..417f71116215 100644
--- a/include/asm-cris/pgtable.h
+++ b/include/asm-cris/pgtable.h
@@ -111,9 +111,7 @@ extern unsigned long empty_zero_page;
111 * Undefined behaviour if not.. 111 * Undefined behaviour if not..
112 */ 112 */
113 113
114static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_READ; }
115static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } 114static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; }
116static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_READ; }
117static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; } 115static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; }
118static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 116static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
119static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 117static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
@@ -124,18 +122,6 @@ static inline pte_t pte_wrprotect(pte_t pte)
124 return pte; 122 return pte;
125} 123}
126 124
127static inline pte_t pte_rdprotect(pte_t pte)
128{
129 pte_val(pte) &= ~(_PAGE_READ | _PAGE_SILENT_READ);
130 return pte;
131}
132
133static inline pte_t pte_exprotect(pte_t pte)
134{
135 pte_val(pte) &= ~(_PAGE_READ | _PAGE_SILENT_READ);
136 return pte;
137}
138
139static inline pte_t pte_mkclean(pte_t pte) 125static inline pte_t pte_mkclean(pte_t pte)
140{ 126{
141 pte_val(pte) &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); 127 pte_val(pte) &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE);
@@ -156,22 +142,6 @@ static inline pte_t pte_mkwrite(pte_t pte)
156 return pte; 142 return pte;
157} 143}
158 144
159static inline pte_t pte_mkread(pte_t pte)
160{
161 pte_val(pte) |= _PAGE_READ;
162 if (pte_val(pte) & _PAGE_ACCESSED)
163 pte_val(pte) |= _PAGE_SILENT_READ;
164 return pte;
165}
166
167static inline pte_t pte_mkexec(pte_t pte)
168{
169 pte_val(pte) |= _PAGE_READ;
170 if (pte_val(pte) & _PAGE_ACCESSED)
171 pte_val(pte) |= _PAGE_SILENT_READ;
172 return pte;
173}
174
175static inline pte_t pte_mkdirty(pte_t pte) 145static inline pte_t pte_mkdirty(pte_t pte)
176{ 146{
177 pte_val(pte) |= _PAGE_MODIFIED; 147 pte_val(pte) |= _PAGE_MODIFIED;
diff --git a/include/asm-cris/termbits.h b/include/asm-cris/termbits.h
index 8d8cec225fe1..71c1b36269b8 100644
--- a/include/asm-cris/termbits.h
+++ b/include/asm-cris/termbits.h
@@ -19,6 +19,17 @@ struct termios {
19 cc_t c_cc[NCCS]; /* control characters */ 19 cc_t c_cc[NCCS]; /* control characters */
20}; 20};
21 21
22struct termios2 {
23 tcflag_t c_iflag; /* input mode flags */
24 tcflag_t c_oflag; /* output mode flags */
25 tcflag_t c_cflag; /* control mode flags */
26 tcflag_t c_lflag; /* local mode flags */
27 cc_t c_line; /* line discipline */
28 cc_t c_cc[NCCS]; /* control characters */
29 speed_t c_ispeed; /* input speed */
30 speed_t c_ospeed; /* output speed */
31};
32
22struct ktermios { 33struct ktermios {
23 tcflag_t c_iflag; /* input mode flags */ 34 tcflag_t c_iflag; /* input mode flags */
24 tcflag_t c_oflag; /* output mode flags */ 35 tcflag_t c_oflag; /* output mode flags */
@@ -155,6 +166,7 @@ struct ktermios {
155#define HUPCL 0002000 166#define HUPCL 0002000
156#define CLOCAL 0004000 167#define CLOCAL 0004000
157#define CBAUDEX 0010000 168#define CBAUDEX 0010000
169#define BOTHER 0010000
158#define B57600 0010001 170#define B57600 0010001
159#define B115200 0010002 171#define B115200 0010002
160#define B230400 0010003 172#define B230400 0010003
diff --git a/include/asm-cris/termios.h b/include/asm-cris/termios.h
index c9dbd4d43368..b0124e6c2e41 100644
--- a/include/asm-cris/termios.h
+++ b/include/asm-cris/termios.h
@@ -81,8 +81,10 @@ struct termio {
81 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 81 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
82}) 82})
83 83
84#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) 84#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
85#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) 85#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
86#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
87#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
86 88
87#endif /* __KERNEL__ */ 89#endif /* __KERNEL__ */
88 90
diff --git a/include/asm-frv/fb.h b/include/asm-frv/fb.h
new file mode 100644
index 000000000000..c7df38030992
--- /dev/null
+++ b/include/asm-frv/fb.h
@@ -0,0 +1,12 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/include/asm-frv/mem-layout.h b/include/asm-frv/mem-layout.h
index a025dd4514e7..aaf2a773d9d3 100644
--- a/include/asm-frv/mem-layout.h
+++ b/include/asm-frv/mem-layout.h
@@ -60,6 +60,7 @@
60 */ 60 */
61#define BRK_BASE __UL(2 * 1024 * 1024 + PAGE_SIZE) 61#define BRK_BASE __UL(2 * 1024 * 1024 + PAGE_SIZE)
62#define STACK_TOP __UL(2 * 1024 * 1024) 62#define STACK_TOP __UL(2 * 1024 * 1024)
63#define STACK_TOP_MAX STACK_TOP
63 64
64/* userspace process size */ 65/* userspace process size */
65#ifdef CONFIG_MMU 66#ifdef CONFIG_MMU
diff --git a/include/asm-frv/pci.h b/include/asm-frv/pci.h
index f35a4511e7b9..585d9b49949a 100644
--- a/include/asm-frv/pci.h
+++ b/include/asm-frv/pci.h
@@ -22,10 +22,6 @@ struct pci_dev;
22 22
23#define pcibios_assign_all_busses() 0 23#define pcibios_assign_all_busses() 0
24 24
25static inline void pcibios_add_platform_entries(struct pci_dev *dev)
26{
27}
28
29extern void pcibios_set_master(struct pci_dev *dev); 25extern void pcibios_set_master(struct pci_dev *dev);
30 26
31extern void pcibios_penalize_isa_irq(int irq); 27extern void pcibios_penalize_isa_irq(int irq);
@@ -44,9 +40,6 @@ extern void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
44extern void pci_free_consistent(struct pci_dev *hwdev, size_t size, 40extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
45 void *vaddr, dma_addr_t dma_handle); 41 void *vaddr, dma_addr_t dma_handle);
46 42
47/* This is always fine. */
48#define pci_dac_dma_supported(pci_dev, mask) (1)
49
50/* Return the index of the PCI controller for device PDEV. */ 43/* Return the index of the PCI controller for device PDEV. */
51#define pci_controller_num(PDEV) (0) 44#define pci_controller_num(PDEV) (0)
52 45
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h
index 2687c7715120..147e995bec24 100644
--- a/include/asm-frv/pgtable.h
+++ b/include/asm-frv/pgtable.h
@@ -25,7 +25,7 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/list.h> 26#include <linux/list.h>
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28struct mm_struct; 28#include <linux/sched.h>
29struct vm_area_struct; 29struct vm_area_struct;
30#endif 30#endif
31 31
@@ -377,30 +377,17 @@ static inline pmd_t *pmd_offset(pud_t *dir, unsigned long address)
377 * The following only work if pte_present() is true. 377 * The following only work if pte_present() is true.
378 * Undefined behaviour if not.. 378 * Undefined behaviour if not..
379 */ 379 */
380static inline int pte_read(pte_t pte) { return !((pte).pte & _PAGE_SUPER); }
381static inline int pte_exec(pte_t pte) { return !((pte).pte & _PAGE_SUPER); }
382static inline int pte_dirty(pte_t pte) { return (pte).pte & _PAGE_DIRTY; } 380static inline int pte_dirty(pte_t pte) { return (pte).pte & _PAGE_DIRTY; }
383static inline int pte_young(pte_t pte) { return (pte).pte & _PAGE_ACCESSED; } 381static inline int pte_young(pte_t pte) { return (pte).pte & _PAGE_ACCESSED; }
384static inline int pte_write(pte_t pte) { return !((pte).pte & _PAGE_WP); } 382static inline int pte_write(pte_t pte) { return !((pte).pte & _PAGE_WP); }
385 383
386static inline pte_t pte_rdprotect(pte_t pte) { (pte).pte |= _PAGE_SUPER; return pte; }
387static inline pte_t pte_exprotect(pte_t pte) { (pte).pte |= _PAGE_SUPER; return pte; }
388static inline pte_t pte_mkclean(pte_t pte) { (pte).pte &= ~_PAGE_DIRTY; return pte; } 384static inline pte_t pte_mkclean(pte_t pte) { (pte).pte &= ~_PAGE_DIRTY; return pte; }
389static inline pte_t pte_mkold(pte_t pte) { (pte).pte &= ~_PAGE_ACCESSED; return pte; } 385static inline pte_t pte_mkold(pte_t pte) { (pte).pte &= ~_PAGE_ACCESSED; return pte; }
390static inline pte_t pte_wrprotect(pte_t pte) { (pte).pte |= _PAGE_WP; return pte; } 386static inline pte_t pte_wrprotect(pte_t pte) { (pte).pte |= _PAGE_WP; return pte; }
391static inline pte_t pte_mkread(pte_t pte) { (pte).pte &= ~_PAGE_SUPER; return pte; }
392static inline pte_t pte_mkexec(pte_t pte) { (pte).pte &= ~_PAGE_SUPER; return pte; }
393static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte |= _PAGE_DIRTY; return pte; } 387static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte |= _PAGE_DIRTY; return pte; }
394static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte |= _PAGE_ACCESSED; return pte; } 388static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte |= _PAGE_ACCESSED; return pte; }
395static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte &= ~_PAGE_WP; return pte; } 389static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte &= ~_PAGE_WP; return pte; }
396 390
397static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
398{
399 int i = test_and_clear_bit(_PAGE_BIT_DIRTY, ptep);
400 asm volatile("dcf %M0" :: "U"(*ptep));
401 return i;
402}
403
404static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) 391static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
405{ 392{
406 int i = test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep); 393 int i = test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep);
@@ -510,7 +497,6 @@ static inline int pte_file(pte_t pte)
510 remap_pfn_range(vma, vaddr, pfn, size, prot) 497 remap_pfn_range(vma, vaddr, pfn, size, prot)
511 498
512#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 499#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
513#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
514#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 500#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
515#define __HAVE_ARCH_PTEP_SET_WRPROTECT 501#define __HAVE_ARCH_PTEP_SET_WRPROTECT
516#define __HAVE_ARCH_PTE_SAME 502#define __HAVE_ARCH_PTE_SAME
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h
index be303b3eef40..6931af525da3 100644
--- a/include/asm-frv/system.h
+++ b/include/asm-frv/system.h
@@ -12,6 +12,7 @@
12#ifndef _ASM_SYSTEM_H 12#ifndef _ASM_SYSTEM_H
13#define _ASM_SYSTEM_H 13#define _ASM_SYSTEM_H
14 14
15#include <linux/types.h>
15#include <linux/linkage.h> 16#include <linux/linkage.h>
16 17
17struct thread_struct; 18struct thread_struct;
diff --git a/include/asm-frv/termbits.h b/include/asm-frv/termbits.h
index 2d6d389cff49..74851b424d4f 100644
--- a/include/asm-frv/termbits.h
+++ b/include/asm-frv/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct termios2 {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20struct ktermios { 31struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */ 32 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */ 33 tcflag_t c_oflag; /* output mode flags */
diff --git a/include/asm-frv/uaccess.h b/include/asm-frv/uaccess.h
index 3d90e1018ee2..53650c958f41 100644
--- a/include/asm-frv/uaccess.h
+++ b/include/asm-frv/uaccess.h
@@ -277,6 +277,8 @@ extern long __memcpy_user(void *dst, const void *src, unsigned long count);
277 277
278#endif 278#endif
279 279
280#define __clear_user clear_user
281
280static inline unsigned long __must_check 282static inline unsigned long __must_check
281__copy_to_user(void __user *to, const void *from, unsigned long n) 283__copy_to_user(void __user *to, const void *from, unsigned long n)
282{ 284{
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h
index d0ea6789b31e..7306c71a8926 100644
--- a/include/asm-frv/unistd.h
+++ b/include/asm-frv/unistd.h
@@ -326,10 +326,14 @@
326#define __NR_move_pages 317 326#define __NR_move_pages 317
327#define __NR_getcpu 318 327#define __NR_getcpu 318
328#define __NR_epoll_pwait 319 328#define __NR_epoll_pwait 319
329#define __NR_utimensat 320
330#define __NR_signalfd 321
331#define __NR_timerfd 322
332#define __NR_eventfd 323
329 333
330#ifdef __KERNEL__ 334#ifdef __KERNEL__
331 335
332#define NR_syscalls 320 336#define NR_syscalls 324
333 337
334#define __ARCH_WANT_IPC_PARSE_VERSION 338#define __ARCH_WANT_IPC_PARSE_VERSION
335/* #define __ARCH_WANT_OLD_READDIR */ 339/* #define __ARCH_WANT_OLD_READDIR */
diff --git a/include/asm-generic/bitops/sched.h b/include/asm-generic/bitops/sched.h
index 815bb0148060..604fab7031a6 100644
--- a/include/asm-generic/bitops/sched.h
+++ b/include/asm-generic/bitops/sched.h
@@ -6,28 +6,23 @@
6 6
7/* 7/*
8 * Every architecture must define this function. It's the fastest 8 * Every architecture must define this function. It's the fastest
9 * way of searching a 140-bit bitmap where the first 100 bits are 9 * way of searching a 100-bit bitmap. It's guaranteed that at least
10 * unlikely to be set. It's guaranteed that at least one of the 140 10 * one of the 100 bits is cleared.
11 * bits is cleared.
12 */ 11 */
13static inline int sched_find_first_bit(const unsigned long *b) 12static inline int sched_find_first_bit(const unsigned long *b)
14{ 13{
15#if BITS_PER_LONG == 64 14#if BITS_PER_LONG == 64
16 if (unlikely(b[0])) 15 if (b[0])
17 return __ffs(b[0]); 16 return __ffs(b[0]);
18 if (likely(b[1])) 17 return __ffs(b[1]) + 64;
19 return __ffs(b[1]) + 64;
20 return __ffs(b[2]) + 128;
21#elif BITS_PER_LONG == 32 18#elif BITS_PER_LONG == 32
22 if (unlikely(b[0])) 19 if (b[0])
23 return __ffs(b[0]); 20 return __ffs(b[0]);
24 if (unlikely(b[1])) 21 if (b[1])
25 return __ffs(b[1]) + 32; 22 return __ffs(b[1]) + 32;
26 if (unlikely(b[2])) 23 if (b[2])
27 return __ffs(b[2]) + 64; 24 return __ffs(b[2]) + 64;
28 if (b[3]) 25 return __ffs(b[3]) + 96;
29 return __ffs(b[3]) + 96;
30 return __ffs(b[4]) + 128;
31#else 26#else
32#error BITS_PER_LONG not defined 27#error BITS_PER_LONG not defined
33#endif 28#endif
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 7f30cce52857..344e3091af24 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -28,7 +28,7 @@ struct bug_entry {
28#endif 28#endif
29 29
30#ifndef HAVE_ARCH_BUG_ON 30#ifndef HAVE_ARCH_BUG_ON
31#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) 31#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
32#endif 32#endif
33 33
34#ifndef HAVE_ARCH_WARN_ON 34#ifndef HAVE_ARCH_WARN_ON
diff --git a/include/asm-generic/dma-mapping-broken.h b/include/asm-generic/dma-mapping-broken.h
index 29413d3d4605..e2468f894d2a 100644
--- a/include/asm-generic/dma-mapping-broken.h
+++ b/include/asm-generic/dma-mapping-broken.h
@@ -1,24 +1,82 @@
1#ifndef _ASM_GENERIC_DMA_MAPPING_H 1#ifndef _ASM_GENERIC_DMA_MAPPING_H
2#define _ASM_GENERIC_DMA_MAPPING_H 2#define _ASM_GENERIC_DMA_MAPPING_H
3 3
4/* This is used for archs that do not support DMA */ 4/* define the dma api to allow compilation but not linking of
5 * dma dependent code. Code that depends on the dma-mapping
6 * API needs to set 'depends on HAS_DMA' in its Kconfig
7 */
5 8
6static inline void * 9struct scatterlist;
10
11extern void *
7dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 12dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
8 gfp_t flag) 13 gfp_t flag);
9{
10 BUG();
11 return NULL;
12}
13 14
14static inline void 15extern void
15dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, 16dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
16 dma_addr_t dma_handle) 17 dma_addr_t dma_handle);
17{
18 BUG();
19}
20 18
21#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 19#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
22#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 20#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
23 21
22extern dma_addr_t
23dma_map_single(struct device *dev, void *ptr, size_t size,
24 enum dma_data_direction direction);
25
26extern void
27dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
28 enum dma_data_direction direction);
29
30extern int
31dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
32 enum dma_data_direction direction);
33
34extern void
35dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
36 enum dma_data_direction direction);
37
38extern dma_addr_t
39dma_map_page(struct device *dev, struct page *page, unsigned long offset,
40 size_t size, enum dma_data_direction direction);
41
42extern void
43dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
44 enum dma_data_direction direction);
45
46extern void
47dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
48 enum dma_data_direction direction);
49
50extern void
51dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
52 unsigned long offset, size_t size,
53 enum dma_data_direction direction);
54
55extern void
56dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
57 enum dma_data_direction direction);
58
59#define dma_sync_single_for_device dma_sync_single_for_cpu
60#define dma_sync_single_range_for_device dma_sync_single_range_for_cpu
61#define dma_sync_sg_for_device dma_sync_sg_for_cpu
62
63extern int
64dma_mapping_error(dma_addr_t dma_addr);
65
66extern int
67dma_supported(struct device *dev, u64 mask);
68
69extern int
70dma_set_mask(struct device *dev, u64 mask);
71
72extern int
73dma_get_cache_alignment(void);
74
75extern int
76dma_is_consistent(struct device *dev, dma_addr_t dma_handle);
77
78extern void
79dma_cache_sync(struct device *dev, void *vaddr, size_t size,
80 enum dma_data_direction direction);
81
24#endif /* _ASM_GENERIC_DMA_MAPPING_H */ 82#endif /* _ASM_GENERIC_DMA_MAPPING_H */
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h
index c154b9d6e7e5..b8477414c5c8 100644
--- a/include/asm-generic/fcntl.h
+++ b/include/asm-generic/fcntl.h
@@ -48,6 +48,9 @@
48#ifndef O_NOATIME 48#ifndef O_NOATIME
49#define O_NOATIME 01000000 49#define O_NOATIME 01000000
50#endif 50#endif
51#ifndef O_CLOEXEC
52#define O_CLOEXEC 02000000 /* set close_on_exec */
53#endif
51#ifndef O_NDELAY 54#ifndef O_NDELAY
52#define O_NDELAY O_NONBLOCK 55#define O_NDELAY O_NONBLOCK
53#endif 56#endif
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index d984a9041436..d85172e9ed45 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -14,6 +14,11 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
14#define DEFINE_PER_CPU(type, name) \ 14#define DEFINE_PER_CPU(type, name) \
15 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name 15 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
16 16
17#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
18 __attribute__((__section__(".data.percpu.shared_aligned"))) \
19 __typeof__(type) per_cpu__##name \
20 ____cacheline_aligned_in_smp
21
17/* var is in discarded region: offset to particular copy we want */ 22/* var is in discarded region: offset to particular copy we want */
18#define per_cpu(var, cpu) (*({ \ 23#define per_cpu(var, cpu) (*({ \
19 extern int simple_identifier_##var(void); \ 24 extern int simple_identifier_##var(void); \
@@ -34,6 +39,9 @@ do { \
34#define DEFINE_PER_CPU(type, name) \ 39#define DEFINE_PER_CPU(type, name) \
35 __typeof__(type) per_cpu__##name 40 __typeof__(type) per_cpu__##name
36 41
42#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
43 DEFINE_PER_CPU(type, name)
44
37#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 45#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
38#define __get_cpu_var(var) per_cpu__##var 46#define __get_cpu_var(var) per_cpu__##var
39#define __raw_get_cpu_var(var) per_cpu__##var 47#define __raw_get_cpu_var(var) per_cpu__##var
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index dc8f99ee305f..f605e8d0eed3 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -3,37 +3,25 @@
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5 5
6#ifndef __HAVE_ARCH_PTEP_ESTABLISH
7/*
8 * Establish a new mapping:
9 * - flush the old one
10 * - update the page tables
11 * - inform the TLB about the new one
12 *
13 * We hold the mm semaphore for reading, and the pte lock.
14 *
15 * Note: the old pte is known to not be writable, so we don't need to
16 * worry about dirty bits etc getting lost.
17 */
18#define ptep_establish(__vma, __address, __ptep, __entry) \
19do { \
20 set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \
21 flush_tlb_page(__vma, __address); \
22} while (0)
23#endif
24
25#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 6#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
26/* 7/*
27 * Largely same as above, but only sets the access flags (dirty, 8 * Largely same as above, but only sets the access flags (dirty,
28 * accessed, and writable). Furthermore, we know it always gets set 9 * accessed, and writable). Furthermore, we know it always gets set
29 * to a "more permissive" setting, which allows most architectures 10 * to a "more permissive" setting, which allows most architectures
30 * to optimize this. 11 * to optimize this. We return whether the PTE actually changed, which
12 * in turn instructs the caller to do things like update__mmu_cache.
13 * This used to be done in the caller, but sparc needs minor faults to
14 * force that call on sun4c so we changed this macro slightly
31 */ 15 */
32#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ 16#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
33do { \ 17({ \
34 set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ 18 int __changed = !pte_same(*(__ptep), __entry); \
35 flush_tlb_page(__vma, __address); \ 19 if (__changed) { \
36} while (0) 20 set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \
21 flush_tlb_page(__vma, __address); \
22 } \
23 __changed; \
24})
37#endif 25#endif
38 26
39#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 27#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
@@ -61,31 +49,6 @@ do { \
61}) 49})
62#endif 50#endif
63 51
64#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
65#define ptep_test_and_clear_dirty(__vma, __address, __ptep) \
66({ \
67 pte_t __pte = *__ptep; \
68 int r = 1; \
69 if (!pte_dirty(__pte)) \
70 r = 0; \
71 else \
72 set_pte_at((__vma)->vm_mm, (__address), (__ptep), \
73 pte_mkclean(__pte)); \
74 r; \
75})
76#endif
77
78#ifndef __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
79#define ptep_clear_flush_dirty(__vma, __address, __ptep) \
80({ \
81 int __dirty; \
82 __dirty = ptep_test_and_clear_dirty(__vma, __address, __ptep); \
83 if (__dirty) \
84 flush_tlb_page(__vma, __address); \
85 __dirty; \
86})
87#endif
88
89#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR 52#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR
90#define ptep_get_and_clear(__mm, __address, __ptep) \ 53#define ptep_get_and_clear(__mm, __address, __ptep) \
91({ \ 54({ \
diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h
index 09ec447fe2af..16a466e50681 100644
--- a/include/asm-generic/unaligned.h
+++ b/include/asm-generic/unaligned.h
@@ -18,7 +18,8 @@
18#define get_unaligned(ptr) \ 18#define get_unaligned(ptr) \
19 __get_unaligned((ptr), sizeof(*(ptr))) 19 __get_unaligned((ptr), sizeof(*(ptr)))
20#define put_unaligned(x,ptr) \ 20#define put_unaligned(x,ptr) \
21 __put_unaligned((__u64)(x), (ptr), sizeof(*(ptr))) 21 ((void)sizeof(*(ptr)=(x)),\
22 __put_unaligned((__force __u64)(x), (ptr), sizeof(*(ptr))))
22 23
23/* 24/*
24 * This function doesn't actually exist. The idea is that when 25 * This function doesn't actually exist. The idea is that when
@@ -95,21 +96,21 @@ static inline void __ustw(__u16 val, __u16 *addr)
95 default: \ 96 default: \
96 bad_unaligned_access_length(); \ 97 bad_unaligned_access_length(); \
97 }; \ 98 }; \
98 (__typeof__(*(ptr)))val; \ 99 (__force __typeof__(*(ptr)))val; \
99}) 100})
100 101
101#define __put_unaligned(val, ptr, size) \ 102#define __put_unaligned(val, ptr, size) \
102do { \ 103({ \
103 void *__gu_p = ptr; \ 104 void *__gu_p = ptr; \
104 switch (size) { \ 105 switch (size) { \
105 case 1: \ 106 case 1: \
106 *(__u8 *)__gu_p = val; \ 107 *(__u8 *)__gu_p = (__force __u8)val; \
107 break; \ 108 break; \
108 case 2: \ 109 case 2: \
109 __ustw(val, __gu_p); \ 110 __ustw((__force __u16)val, __gu_p); \
110 break; \ 111 break; \
111 case 4: \ 112 case 4: \
112 __ustl(val, __gu_p); \ 113 __ustl((__force __u32)val, __gu_p); \
113 break; \ 114 break; \
114 case 8: \ 115 case 8: \
115 __ustq(val, __gu_p); \ 116 __ustq(val, __gu_p); \
@@ -117,6 +118,7 @@ do { \
117 default: \ 118 default: \
118 bad_unaligned_access_length(); \ 119 bad_unaligned_access_length(); \
119 }; \ 120 }; \
120} while(0) 121 (void)0; \
122})
121 123
122#endif /* _ASM_GENERIC_UNALIGNED_H */ 124#endif /* _ASM_GENERIC_UNALIGNED_H */
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 84155eb67f1d..0240e0506a07 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -224,7 +224,11 @@
224 } 224 }
225 225
226#define NOTES \ 226#define NOTES \
227 .notes : { *(.note.*) } :note 227 .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
228 VMLINUX_SYMBOL(__start_notes) = .; \
229 *(.note.*) \
230 VMLINUX_SYMBOL(__stop_notes) = .; \
231 }
228 232
229#define INITCALLS \ 233#define INITCALLS \
230 *(.initcall0.init) \ 234 *(.initcall0.init) \
@@ -245,3 +249,11 @@
245 *(.initcall7.init) \ 249 *(.initcall7.init) \
246 *(.initcall7s.init) 250 *(.initcall7s.init)
247 251
252#define PERCPU(align) \
253 . = ALIGN(align); \
254 __per_cpu_start = .; \
255 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \
256 *(.data.percpu) \
257 *(.data.percpu.shared_aligned) \
258 } \
259 __per_cpu_end = .;
diff --git a/include/asm-h8300/a.out.h b/include/asm-h8300/a.out.h
index 3c70939f9f00..aa5d22778235 100644
--- a/include/asm-h8300/a.out.h
+++ b/include/asm-h8300/a.out.h
@@ -20,6 +20,7 @@ struct exec
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#define STACK_TOP TASK_SIZE 22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
23 24
24#endif 25#endif
25 26
diff --git a/include/asm-h8300/dma-mapping.h b/include/asm-h8300/dma-mapping.h
deleted file mode 100644
index d00e40099165..000000000000
--- a/include/asm-h8300/dma-mapping.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/dma-mapping-broken.h>
diff --git a/include/asm-h8300/fb.h b/include/asm-h8300/fb.h
new file mode 100644
index 000000000000..c7df38030992
--- /dev/null
+++ b/include/asm-h8300/fb.h
@@ -0,0 +1,12 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/include/asm-h8300/ioctls.h b/include/asm-h8300/ioctls.h
index ac20457e5978..98a53d067269 100644
--- a/include/asm-h8300/ioctls.h
+++ b/include/asm-h8300/ioctls.h
@@ -47,6 +47,10 @@
47#define TIOCSBRK 0x5427 /* BSD compatibility */ 47#define TIOCSBRK 0x5427 /* BSD compatibility */
48#define TIOCCBRK 0x5428 /* BSD compatibility */ 48#define TIOCCBRK 0x5428 /* BSD compatibility */
49#define TIOCGSID 0x5429 /* Return the session ID of FD */ 49#define TIOCGSID 0x5429 /* Return the session ID of FD */
50#define TCGETS2 _IOR('T',0x2A, struct termios2)
51#define TCSETS2 _IOW('T',0x2B, struct termios2)
52#define TCSETSW2 _IOW('T',0x2C, struct termios2)
53#define TCSETSF2 _IOW('T',0x2D, struct termios2)
50#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
51#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
52 56
diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h
index 3b4f2903f91d..c8cc81a3aca5 100644
--- a/include/asm-h8300/page.h
+++ b/include/asm-h8300/page.h
@@ -22,7 +22,8 @@
22#define clear_user_page(page, vaddr, pg) clear_page(page) 22#define clear_user_page(page, vaddr, pg) clear_page(page)
23#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 23#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
24 24
25#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) 25#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
26 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
26#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 27#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
27 28
28/* 29/*
diff --git a/include/asm-h8300/pci.h b/include/asm-h8300/pci.h
index 0c771b05fdd5..97389b35aa35 100644
--- a/include/asm-h8300/pci.h
+++ b/include/asm-h8300/pci.h
@@ -22,8 +22,4 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
22 22
23#define PCI_DMA_BUS_IS_PHYS (1) 23#define PCI_DMA_BUS_IS_PHYS (1)
24 24
25static inline void pcibios_add_platform_entries(struct pci_dev *dev)
26{
27}
28
29#endif /* _ASM_H8300_PCI_H */ 25#endif /* _ASM_H8300_PCI_H */
diff --git a/include/asm-h8300/termbits.h b/include/asm-h8300/termbits.h
index 6a1f4d3807b4..31eca81db3f7 100644
--- a/include/asm-h8300/termbits.h
+++ b/include/asm-h8300/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct termios2 {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20struct ktermios { 31struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */ 32 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */ 33 tcflag_t c_oflag; /* output mode flags */
@@ -130,6 +141,7 @@ struct ktermios {
130#define HUPCL 0002000 141#define HUPCL 0002000
131#define CLOCAL 0004000 142#define CLOCAL 0004000
132#define CBAUDEX 0010000 143#define CBAUDEX 0010000
144#define BOTHER 0010000
133#define B57600 0010001 145#define B57600 0010001
134#define B115200 0010002 146#define B115200 0010002
135#define B230400 0010003 147#define B230400 0010003
@@ -145,10 +157,12 @@ struct ktermios {
145#define B3000000 0010015 157#define B3000000 0010015
146#define B3500000 0010016 158#define B3500000 0010016
147#define B4000000 0010017 159#define B4000000 0010017
148#define CIBAUD 002003600000 /* input baud rate (not used) */ 160#define CIBAUD 002003600000 /* input baud rate */
149#define CMSPAR 010000000000 /* mark or space (stick) parity */ 161#define CMSPAR 010000000000 /* mark or space (stick) parity */
150#define CRTSCTS 020000000000 /* flow control */ 162#define CRTSCTS 020000000000 /* flow control */
151 163
164#define IBSHIFT 16 /* shift from CBAUD to CIBAUD */
165
152/* c_lflag bits */ 166/* c_lflag bits */
153#define ISIG 0000001 167#define ISIG 0000001
154#define ICANON 0000002 168#define ICANON 0000002
diff --git a/include/asm-h8300/termios.h b/include/asm-h8300/termios.h
index fb2925d08c49..70eea64b4213 100644
--- a/include/asm-h8300/termios.h
+++ b/include/asm-h8300/termios.h
@@ -82,8 +82,10 @@ struct termio {
82 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 82 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
83}) 83})
84 84
85#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) 85#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
86#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) 86#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
87#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
88#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
87 89
88#endif /* __KERNEL__ */ 90#endif /* __KERNEL__ */
89 91
diff --git a/include/asm-h8300/thread_info.h b/include/asm-h8300/thread_info.h
index 45f09dc9caff..aee4009a498e 100644
--- a/include/asm-h8300/thread_info.h
+++ b/include/asm-h8300/thread_info.h
@@ -92,6 +92,7 @@ static inline struct thread_info *current_thread_info(void)
92#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling 92#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
93 TIF_NEED_RESCHED */ 93 TIF_NEED_RESCHED */
94#define TIF_MEMDIE 5 94#define TIF_MEMDIE 5
95#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
95 96
96/* as above, but as bit values */ 97/* as above, but as bit values */
97#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 98#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -99,6 +100,7 @@ static inline struct thread_info *current_thread_info(void)
99#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 100#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
100#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 101#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
101#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 102#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
103#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
102 104
103#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ 105#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
104 106
diff --git a/include/asm-i386/a.out.h b/include/asm-i386/a.out.h
index ab17bb8e5465..851a60f8258c 100644
--- a/include/asm-i386/a.out.h
+++ b/include/asm-i386/a.out.h
@@ -20,6 +20,7 @@ struct exec
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#define STACK_TOP TASK_SIZE 22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
23 24
24#endif 25#endif
25 26
diff --git a/include/asm-i386/boot.h b/include/asm-i386/boot.h
index bd024ab4fe53..ed8affbf96cb 100644
--- a/include/asm-i386/boot.h
+++ b/include/asm-i386/boot.h
@@ -1,5 +1,5 @@
1#ifndef _LINUX_BOOT_H 1#ifndef _ASM_BOOT_H
2#define _LINUX_BOOT_H 2#define _ASM_BOOT_H
3 3
4/* Don't touch these, unless you really know what you're doing. */ 4/* Don't touch these, unless you really know what you're doing. */
5#define DEF_INITSEG 0x9000 5#define DEF_INITSEG 0x9000
@@ -17,4 +17,4 @@
17 + (CONFIG_PHYSICAL_ALIGN - 1)) \ 17 + (CONFIG_PHYSICAL_ALIGN - 1)) \
18 & ~(CONFIG_PHYSICAL_ALIGN - 1)) 18 & ~(CONFIG_PHYSICAL_ALIGN - 1))
19 19
20#endif /* _LINUX_BOOT_H */ 20#endif /* _ASM_BOOT_H */
diff --git a/include/asm-i386/bootparam.h b/include/asm-i386/bootparam.h
new file mode 100644
index 000000000000..427d8652bfde
--- /dev/null
+++ b/include/asm-i386/bootparam.h
@@ -0,0 +1,85 @@
1#ifndef _ASM_BOOTPARAM_H
2#define _ASM_BOOTPARAM_H
3
4#include <linux/types.h>
5#include <linux/screen_info.h>
6#include <linux/apm_bios.h>
7#include <asm/e820.h>
8#include <linux/edd.h>
9#include <video/edid.h>
10
11struct setup_header {
12 u8 setup_sects;
13 u16 root_flags;
14 u32 syssize;
15 u16 ram_size;
16 u16 vid_mode;
17 u16 root_dev;
18 u16 boot_flag;
19 u16 jump;
20 u32 header;
21 u16 version;
22 u32 realmode_swtch;
23 u16 start_sys;
24 u16 kernel_version;
25 u8 type_of_loader;
26 u8 loadflags;
27#define LOADED_HIGH 0x01
28#define CAN_USE_HEAP 0x80
29 u16 setup_move_size;
30 u32 code32_start;
31 u32 ramdisk_image;
32 u32 ramdisk_size;
33 u32 bootsect_kludge;
34 u16 heap_end_ptr;
35 u16 _pad1;
36 u32 cmd_line_ptr;
37 u32 initrd_addr_max;
38 u32 kernel_alignment;
39 u8 relocatable_kernel;
40} __attribute__((packed));
41
42struct sys_desc_table {
43 u16 length;
44 u8 table[14];
45};
46
47struct efi_info {
48 u32 _pad1;
49 u32 efi_systab;
50 u32 efi_memdesc_size;
51 u32 efi_memdec_version;
52 u32 efi_memmap;
53 u32 fi_memmap_size;
54 u32 _pad2[2];
55};
56
57/* The so-called "zeropage" */
58struct boot_params {
59 struct screen_info screen_info; /* 0x000 */
60 struct apm_bios_info apm_bios_info; /* 0x040 */
61 u8 _pad2[12]; /* 0x054 */
62 u32 speedstep_info[4]; /* 0x060 */
63 u8 _pad3[16]; /* 0x070 */
64 u8 hd0_info[16]; /* obsolete! */ /* 0x080 */
65 u8 hd1_info[16]; /* obsolete! */ /* 0x090 */
66 struct sys_desc_table sys_desc_table; /* 0x0a0 */
67 u8 _pad4[144]; /* 0x0b0 */
68 struct edid_info edid_info; /* 0x140 */
69 struct efi_info efi_info; /* 0x1c0 */
70 u32 alt_mem_k; /* 0x1e0 */
71 u32 scratch; /* Scratch field! */ /* 0x1e4 */
72 u8 e820_entries; /* 0x1e8 */
73 u8 eddbuf_entries; /* 0x1e9 */
74 u8 edd_mbr_sig_buf_entries; /* 0x1ea */
75 u8 _pad6[6]; /* 0x1eb */
76 struct setup_header hdr; /* setup header */ /* 0x1f1 */
77 u8 _pad7[0x290-0x1f1-sizeof(struct setup_header)];
78 u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; /* 0x290 */
79 struct e820entry e820_map[E820MAX]; /* 0x2d0 */
80 u8 _pad8[48]; /* 0xcd0 */
81 struct edd_info eddbuf[EDDMAXNR]; /* 0xd00 */
82 u8 _pad9[276]; /* 0xeec */
83} __attribute__((packed));
84
85#endif /* _ASM_BOOTPARAM_H */
diff --git a/include/asm-i386/cmpxchg.h b/include/asm-i386/cmpxchg.h
index 7adcef0cd53b..64dcdf46117b 100644
--- a/include/asm-i386/cmpxchg.h
+++ b/include/asm-i386/cmpxchg.h
@@ -3,14 +3,16 @@
3 3
4#include <linux/bitops.h> /* for LOCK_PREFIX */ 4#include <linux/bitops.h> /* for LOCK_PREFIX */
5 5
6/*
7 * Note: if you use set64_bit(), __cmpxchg64(), or their variants, you
8 * you need to test for the feature in boot_cpu_data.
9 */
10
6#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr)))) 11#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
7 12
8struct __xchg_dummy { unsigned long a[100]; }; 13struct __xchg_dummy { unsigned long a[100]; };
9#define __xg(x) ((struct __xchg_dummy *)(x)) 14#define __xg(x) ((struct __xchg_dummy *)(x))
10 15
11
12#ifdef CONFIG_X86_CMPXCHG64
13
14/* 16/*
15 * The semantics of XCHGCMP8B are a bit strange, this is why 17 * The semantics of XCHGCMP8B are a bit strange, this is why
16 * there is a loop and the loading of %%eax and %%edx has to 18 * there is a loop and the loading of %%eax and %%edx has to
@@ -65,8 +67,6 @@ static inline void __set_64bit_var (unsigned long long *ptr,
65 __set_64bit(ptr, (unsigned int)(value), (unsigned int)((value)>>32ULL) ) : \ 67 __set_64bit(ptr, (unsigned int)(value), (unsigned int)((value)>>32ULL) ) : \
66 __set_64bit(ptr, ll_low(value), ll_high(value)) ) 68 __set_64bit(ptr, ll_low(value), ll_high(value)) )
67 69
68#endif
69
70/* 70/*
71 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway 71 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
72 * Note 2: xchg has side effect, so that attribute volatile is necessary, 72 * Note 2: xchg has side effect, so that attribute volatile is necessary,
@@ -252,8 +252,6 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
252}) 252})
253#endif 253#endif
254 254
255#ifdef CONFIG_X86_CMPXCHG64
256
257static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long long old, 255static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long long old,
258 unsigned long long new) 256 unsigned long long new)
259{ 257{
@@ -289,5 +287,3 @@ static inline unsigned long long __cmpxchg64_local(volatile void *ptr,
289 ((__typeof__(*(ptr)))__cmpxchg64_local((ptr),(unsigned long long)(o),\ 287 ((__typeof__(*(ptr)))__cmpxchg64_local((ptr),(unsigned long long)(o),\
290 (unsigned long long)(n))) 288 (unsigned long long)(n)))
291#endif 289#endif
292
293#endif
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h
index f514e906643a..c961c03cf1e2 100644
--- a/include/asm-i386/cpufeature.h
+++ b/include/asm-i386/cpufeature.h
@@ -12,7 +12,7 @@
12#endif 12#endif
13#include <asm/required-features.h> 13#include <asm/required-features.h>
14 14
15#define NCAPINTS 7 /* N 32-bit words worth of info */ 15#define NCAPINTS 8 /* N 32-bit words worth of info */
16 16
17/* Intel-defined CPU features, CPUID level 0x00000001 (edx), word 0 */ 17/* Intel-defined CPU features, CPUID level 0x00000001 (edx), word 0 */
18#define X86_FEATURE_FPU (0*32+ 0) /* Onboard FPU */ 18#define X86_FEATURE_FPU (0*32+ 0) /* Onboard FPU */
@@ -81,6 +81,7 @@
81#define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */ 81#define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */
82#define X86_FEATURE_LAPIC_TIMER_BROKEN (3*32+ 14) /* lapic timer broken in C1 */ 82#define X86_FEATURE_LAPIC_TIMER_BROKEN (3*32+ 14) /* lapic timer broken in C1 */
83#define X86_FEATURE_SYNC_RDTSC (3*32+15) /* RDTSC synchronizes the CPU */ 83#define X86_FEATURE_SYNC_RDTSC (3*32+15) /* RDTSC synchronizes the CPU */
84#define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */
84 85
85/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ 86/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
86#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ 87#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */
@@ -108,11 +109,24 @@
108#define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */ 109#define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */
109#define X86_FEATURE_CMP_LEGACY (6*32+ 1) /* If yes HyperThreading not valid */ 110#define X86_FEATURE_CMP_LEGACY (6*32+ 1) /* If yes HyperThreading not valid */
110 111
111#define cpu_has(c, bit) \ 112/*
112 ((__builtin_constant_p(bit) && (bit) < 32 && \ 113 * Auxiliary flags: Linux defined - For features scattered in various
113 (1UL << (bit)) & REQUIRED_MASK1) ? \ 114 * CPUID levels like 0x6, 0xA etc
114 1 : \ 115 */
115 test_bit(bit, (c)->x86_capability)) 116#define X86_FEATURE_IDA (7*32+ 0) /* Intel Dynamic Acceleration */
117
118#define cpu_has(c, bit) \
119 (__builtin_constant_p(bit) && \
120 ( (((bit)>>5)==0 && (1UL<<((bit)&31) & REQUIRED_MASK0)) || \
121 (((bit)>>5)==1 && (1UL<<((bit)&31) & REQUIRED_MASK1)) || \
122 (((bit)>>5)==2 && (1UL<<((bit)&31) & REQUIRED_MASK2)) || \
123 (((bit)>>5)==3 && (1UL<<((bit)&31) & REQUIRED_MASK3)) || \
124 (((bit)>>5)==4 && (1UL<<((bit)&31) & REQUIRED_MASK4)) || \
125 (((bit)>>5)==5 && (1UL<<((bit)&31) & REQUIRED_MASK5)) || \
126 (((bit)>>5)==6 && (1UL<<((bit)&31) & REQUIRED_MASK6)) || \
127 (((bit)>>5)==7 && (1UL<<((bit)&31) & REQUIRED_MASK7)) ) \
128 ? 1 : \
129 test_bit(bit, (c)->x86_capability))
116#define boot_cpu_has(bit) cpu_has(&boot_cpu_data, bit) 130#define boot_cpu_has(bit) cpu_has(&boot_cpu_data, bit)
117 131
118#define cpu_has_fpu boot_cpu_has(X86_FEATURE_FPU) 132#define cpu_has_fpu boot_cpu_has(X86_FEATURE_FPU)
diff --git a/include/asm-i386/dma-mapping.h b/include/asm-i386/dma-mapping.h
index 183eebeebbdc..f1d72d177f68 100644
--- a/include/asm-i386/dma-mapping.h
+++ b/include/asm-i386/dma-mapping.h
@@ -123,6 +123,8 @@ dma_mapping_error(dma_addr_t dma_addr)
123 return 0; 123 return 0;
124} 124}
125 125
126extern int forbid_dac;
127
126static inline int 128static inline int
127dma_supported(struct device *dev, u64 mask) 129dma_supported(struct device *dev, u64 mask)
128{ 130{
@@ -134,6 +136,10 @@ dma_supported(struct device *dev, u64 mask)
134 if(mask < 0x00ffffff) 136 if(mask < 0x00ffffff)
135 return 0; 137 return 0;
136 138
139 /* Work around chipset bugs */
140 if (forbid_dac > 0 && mask > 0xffffffffULL)
141 return 0;
142
137 return 1; 143 return 1;
138} 144}
139 145
diff --git a/include/asm-i386/e820.h b/include/asm-i386/e820.h
index 096a2a8eb1da..43114c824608 100644
--- a/include/asm-i386/e820.h
+++ b/include/asm-i386/e820.h
@@ -25,13 +25,15 @@
25 25
26#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
27 27
28struct e820entry {
29 u64 addr; /* start of memory segment */
30 u64 size; /* size of memory segment */
31 u32 type; /* type of memory segment */
32} __attribute__((packed));
33
28struct e820map { 34struct e820map {
29 int nr_map; 35 u32 nr_map;
30 struct e820entry { 36 struct e820entry map[E820MAX];
31 unsigned long long addr; /* start of memory segment */
32 unsigned long long size; /* size of memory segment */
33 unsigned long type; /* type of memory segment */
34 } map[E820MAX];
35}; 37};
36 38
37extern struct e820map e820; 39extern struct e820map e820;
@@ -45,6 +47,14 @@ extern void e820_register_memory(void);
45extern void limit_regions(unsigned long long size); 47extern void limit_regions(unsigned long long size);
46extern void print_memory_map(char *who); 48extern void print_memory_map(char *who);
47 49
50#if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND)
51extern void e820_mark_nosave_regions(void);
52#else
53static inline void e820_mark_nosave_regions(void)
54{
55}
56#endif
57
48#endif/*!__ASSEMBLY__*/ 58#endif/*!__ASSEMBLY__*/
49 59
50#endif/*__E820_HEADER*/ 60#endif/*__E820_HEADER*/
diff --git a/include/asm-i386/fb.h b/include/asm-i386/fb.h
new file mode 100644
index 000000000000..d1c6297d4a61
--- /dev/null
+++ b/include/asm-i386/fb.h
@@ -0,0 +1,17 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7
8extern int fb_is_primary_device(struct fb_info *info);
9
10static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
11 unsigned long off)
12{
13 if (boot_cpu_data.x86 > 3)
14 pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
15}
16
17#endif /* _ASM_FB_H_ */
diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h
index 80ea052ee3a4..249e753ac805 100644
--- a/include/asm-i386/fixmap.h
+++ b/include/asm-i386/fixmap.h
@@ -54,6 +54,8 @@ extern unsigned long __FIXADDR_TOP;
54enum fixed_addresses { 54enum fixed_addresses {
55 FIX_HOLE, 55 FIX_HOLE,
56 FIX_VDSO, 56 FIX_VDSO,
57 FIX_DBGP_BASE,
58 FIX_EARLYCON_MEM_BASE,
57#ifdef CONFIG_X86_LOCAL_APIC 59#ifdef CONFIG_X86_LOCAL_APIC
58 FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ 60 FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
59#endif 61#endif
diff --git a/include/asm-i386/geode.h b/include/asm-i386/geode.h
new file mode 100644
index 000000000000..6da4bbbea3dc
--- /dev/null
+++ b/include/asm-i386/geode.h
@@ -0,0 +1,159 @@
1/*
2 * AMD Geode definitions
3 * Copyright (C) 2006, Advanced Micro Devices, Inc.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public License
7 * as published by the Free Software Foundation.
8 */
9
10#ifndef _ASM_GEODE_H_
11#define _ASM_GEODE_H_
12
13#include <asm/processor.h>
14#include <linux/io.h>
15
16/* Generic southbridge functions */
17
18#define GEODE_DEV_PMS 0
19#define GEODE_DEV_ACPI 1
20#define GEODE_DEV_GPIO 2
21#define GEODE_DEV_MFGPT 3
22
23extern int geode_get_dev_base(unsigned int dev);
24
25/* Useful macros */
26#define geode_pms_base() geode_get_dev_base(GEODE_DEV_PMS)
27#define geode_acpi_base() geode_get_dev_base(GEODE_DEV_ACPI)
28#define geode_gpio_base() geode_get_dev_base(GEODE_DEV_GPIO)
29#define geode_mfgpt_base() geode_get_dev_base(GEODE_DEV_MFGPT)
30
31/* MSRS */
32
33#define GX_GLCP_SYS_RSTPLL 0x4C000014
34
35#define MSR_LBAR_SMB 0x5140000B
36#define MSR_LBAR_GPIO 0x5140000C
37#define MSR_LBAR_MFGPT 0x5140000D
38#define MSR_LBAR_ACPI 0x5140000E
39#define MSR_LBAR_PMS 0x5140000F
40
41#define MSR_PIC_YSEL_LOW 0x51400020
42#define MSR_PIC_YSEL_HIGH 0x51400021
43#define MSR_PIC_ZSEL_LOW 0x51400022
44#define MSR_PIC_ZSEL_HIGH 0x51400023
45
46#define MFGPT_IRQ_MSR 0x51400028
47#define MFGPT_NR_MSR 0x51400029
48
49/* Resource Sizes */
50
51#define LBAR_GPIO_SIZE 0xFF
52#define LBAR_MFGPT_SIZE 0x40
53#define LBAR_ACPI_SIZE 0x40
54#define LBAR_PMS_SIZE 0x80
55
56/* ACPI registers (PMS block) */
57
58/*
59 * PM1_EN is only valid when VSA is enabled for 16 bit reads.
60 * When VSA is not enabled, *always* read both PM1_STS and PM1_EN
61 * with a 32 bit read at offset 0x0
62 */
63
64#define PM1_STS 0x00
65#define PM1_EN 0x02
66#define PM1_CNT 0x08
67#define PM2_CNT 0x0C
68#define PM_TMR 0x10
69#define PM_GPE0_STS 0x18
70#define PM_GPE0_EN 0x1C
71
72/* PMC registers (PMS block) */
73
74#define PM_SSD 0x00
75#define PM_SCXA 0x04
76#define PM_SCYA 0x08
77#define PM_OUT_SLPCTL 0x0C
78#define PM_SCLK 0x10
79#define PM_SED 0x1
80#define PM_SCXD 0x18
81#define PM_SCYD 0x1C
82#define PM_IN_SLPCTL 0x20
83#define PM_WKD 0x30
84#define PM_WKXD 0x34
85#define PM_RD 0x38
86#define PM_WKXA 0x3C
87#define PM_FSD 0x40
88#define PM_TSD 0x44
89#define PM_PSD 0x48
90#define PM_NWKD 0x4C
91#define PM_AWKD 0x50
92#define PM_SSC 0x54
93
94/* GPIO */
95
96#define GPIO_OUTPUT_VAL 0x00
97#define GPIO_OUTPUT_ENABLE 0x04
98#define GPIO_OUTPUT_OPEN_DRAIN 0x08
99#define GPIO_OUTPUT_INVERT 0x0C
100#define GPIO_OUTPUT_AUX1 0x10
101#define GPIO_OUTPUT_AUX2 0x14
102#define GPIO_PULL_UP 0x18
103#define GPIO_PULL_DOWN 0x1C
104#define GPIO_INPUT_ENABLE 0x20
105#define GPIO_INPUT_INVERT 0x24
106#define GPIO_INPUT_FILTER 0x28
107#define GPIO_INPUT_EVENT_COUNT 0x2C
108#define GPIO_READ_BACK 0x30
109#define GPIO_INPUT_AUX1 0x34
110#define GPIO_EVENTS_ENABLE 0x38
111#define GPIO_LOCK_ENABLE 0x3C
112#define GPIO_POSITIVE_EDGE_EN 0x40
113#define GPIO_NEGATIVE_EDGE_EN 0x44
114#define GPIO_POSITIVE_EDGE_STS 0x48
115#define GPIO_NEGATIVE_EDGE_STS 0x4C
116
117#define GPIO_MAP_X 0xE0
118#define GPIO_MAP_Y 0xE4
119#define GPIO_MAP_Z 0xE8
120#define GPIO_MAP_W 0xEC
121
122extern void geode_gpio_set(unsigned int, unsigned int);
123extern void geode_gpio_clear(unsigned int, unsigned int);
124extern int geode_gpio_isset(unsigned int, unsigned int);
125extern void geode_gpio_setup_event(unsigned int, int, int);
126extern void geode_gpio_set_irq(unsigned int, unsigned int);
127
128static inline void geode_gpio_event_irq(unsigned int gpio, int pair)
129{
130 geode_gpio_setup_event(gpio, pair, 0);
131}
132
133static inline void geode_gpio_event_pme(unsigned int gpio, int pair)
134{
135 geode_gpio_setup_event(gpio, pair, 1);
136}
137
138/* Specific geode tests */
139
140static inline int is_geode_gx(void)
141{
142 return ((boot_cpu_data.x86_vendor == X86_VENDOR_NSC) &&
143 (boot_cpu_data.x86 == 5) &&
144 (boot_cpu_data.x86_model == 5));
145}
146
147static inline int is_geode_lx(void)
148{
149 return ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
150 (boot_cpu_data.x86 == 5) &&
151 (boot_cpu_data.x86_model == 10));
152}
153
154static inline int is_geode(void)
155{
156 return (is_geode_gx() || is_geode_lx());
157}
158
159#endif
diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h
index dddeedf504b7..c82dc7ed96b3 100644
--- a/include/asm-i386/hpet.h
+++ b/include/asm-i386/hpet.h
@@ -4,112 +4,82 @@
4 4
5#ifdef CONFIG_HPET_TIMER 5#ifdef CONFIG_HPET_TIMER
6 6
7#include <linux/errno.h>
8#include <linux/module.h>
9#include <linux/sched.h>
10#include <linux/kernel.h>
11#include <linux/param.h>
12#include <linux/string.h>
13#include <linux/mm.h>
14#include <linux/interrupt.h>
15#include <linux/time.h>
16#include <linux/delay.h>
17#include <linux/init.h>
18#include <linux/smp.h>
19
20#include <asm/io.h>
21#include <asm/smp.h>
22#include <asm/irq.h>
23#include <asm/msr.h>
24#include <asm/delay.h>
25#include <asm/mpspec.h>
26#include <asm/uaccess.h>
27#include <asm/processor.h>
28
29#include <linux/timex.h>
30
31/* 7/*
32 * Documentation on HPET can be found at: 8 * Documentation on HPET can be found at:
33 * http://www.intel.com/ial/home/sp/pcmmspec.htm 9 * http://www.intel.com/ial/home/sp/pcmmspec.htm
34 * ftp://download.intel.com/ial/home/sp/mmts098.pdf 10 * ftp://download.intel.com/ial/home/sp/mmts098.pdf
35 */ 11 */
36 12
37#define HPET_MMAP_SIZE 1024 13#define HPET_MMAP_SIZE 1024
38 14
39#define HPET_ID 0x000 15#define HPET_ID 0x000
40#define HPET_PERIOD 0x004 16#define HPET_PERIOD 0x004
41#define HPET_CFG 0x010 17#define HPET_CFG 0x010
42#define HPET_STATUS 0x020 18#define HPET_STATUS 0x020
43#define HPET_COUNTER 0x0f0 19#define HPET_COUNTER 0x0f0
44#define HPET_T0_CFG 0x100 20#define HPET_T0_CFG 0x100
45#define HPET_T0_CMP 0x108 21#define HPET_T0_CMP 0x108
46#define HPET_T0_ROUTE 0x110 22#define HPET_T0_ROUTE 0x110
47#define HPET_T1_CFG 0x120 23#define HPET_T1_CFG 0x120
48#define HPET_T1_CMP 0x128 24#define HPET_T1_CMP 0x128
49#define HPET_T1_ROUTE 0x130 25#define HPET_T1_ROUTE 0x130
50#define HPET_T2_CFG 0x140 26#define HPET_T2_CFG 0x140
51#define HPET_T2_CMP 0x148 27#define HPET_T2_CMP 0x148
52#define HPET_T2_ROUTE 0x150 28#define HPET_T2_ROUTE 0x150
53 29
54#define HPET_ID_LEGSUP 0x00008000 30#define HPET_ID_REV 0x000000ff
55#define HPET_ID_NUMBER 0x00001f00 31#define HPET_ID_NUMBER 0x00001f00
56#define HPET_ID_REV 0x000000ff 32#define HPET_ID_64BIT 0x00002000
33#define HPET_ID_LEGSUP 0x00008000
34#define HPET_ID_VENDOR 0xffff0000
57#define HPET_ID_NUMBER_SHIFT 8 35#define HPET_ID_NUMBER_SHIFT 8
36#define HPET_ID_VENDOR_SHIFT 16
58 37
59#define HPET_CFG_ENABLE 0x001 38#define HPET_ID_VENDOR_8086 0x8086
60#define HPET_CFG_LEGACY 0x002 39
40#define HPET_CFG_ENABLE 0x001
41#define HPET_CFG_LEGACY 0x002
61#define HPET_LEGACY_8254 2 42#define HPET_LEGACY_8254 2
62#define HPET_LEGACY_RTC 8 43#define HPET_LEGACY_RTC 8
63 44
64#define HPET_TN_ENABLE 0x004 45#define HPET_TN_LEVEL 0x0002
65#define HPET_TN_PERIODIC 0x008 46#define HPET_TN_ENABLE 0x0004
66#define HPET_TN_PERIODIC_CAP 0x010 47#define HPET_TN_PERIODIC 0x0008
67#define HPET_TN_SETVAL 0x040 48#define HPET_TN_PERIODIC_CAP 0x0010
68#define HPET_TN_32BIT 0x100 49#define HPET_TN_64BIT_CAP 0x0020
69 50#define HPET_TN_SETVAL 0x0040
70/* Use our own asm for 64 bit multiply/divide */ 51#define HPET_TN_32BIT 0x0100
71#define ASM_MUL64_REG(eax_out,edx_out,reg_in,eax_in) \ 52#define HPET_TN_ROUTE 0x3e00
72 __asm__ __volatile__("mull %2" \ 53#define HPET_TN_FSB 0x4000
73 :"=a" (eax_out), "=d" (edx_out) \ 54#define HPET_TN_FSB_CAP 0x8000
74 :"r" (reg_in), "0" (eax_in)) 55#define HPET_TN_ROUTE_SHIFT 9
75 56
76#define ASM_DIV64_REG(eax_out,edx_out,reg_in,eax_in,edx_in) \
77 __asm__ __volatile__("divl %2" \
78 :"=a" (eax_out), "=d" (edx_out) \
79 :"r" (reg_in), "0" (eax_in), "1" (edx_in))
80
81#define KERNEL_TICK_USEC (1000000UL/HZ) /* tick value in microsec */
82/* Max HPET Period is 10^8 femto sec as in HPET spec */ 57/* Max HPET Period is 10^8 femto sec as in HPET spec */
83#define HPET_MAX_PERIOD (100000000UL) 58#define HPET_MAX_PERIOD 100000000UL
84/* 59/*
85 * Min HPET period is 10^5 femto sec just for safety. If it is less than this, 60 * Min HPET period is 10^5 femto sec just for safety. If it is less than this,
86 * then 32 bit HPET counter wrapsaround in less than 0.5 sec. 61 * then 32 bit HPET counter wrapsaround in less than 0.5 sec.
87 */ 62 */
88#define HPET_MIN_PERIOD (100000UL) 63#define HPET_MIN_PERIOD 100000UL
89#define HPET_TICK_RATE (HZ * 100000UL)
90 64
91extern unsigned long hpet_address; /* hpet memory map physical address */ 65/* hpet memory map physical address */
66extern unsigned long hpet_address;
92extern int is_hpet_enabled(void); 67extern int is_hpet_enabled(void);
93
94#ifdef CONFIG_X86_64
95extern unsigned long hpet_tick; /* hpet clks count per tick */
96extern int hpet_use_timer;
97extern int hpet_rtc_timer_init(void);
98extern int hpet_enable(void); 68extern int hpet_enable(void);
99extern int is_hpet_capable(void);
100extern int hpet_readl(unsigned long a);
101#else
102extern int hpet_enable(void);
103#endif
104 69
105#ifdef CONFIG_HPET_EMULATE_RTC 70#ifdef CONFIG_HPET_EMULATE_RTC
71
72#include <linux/interrupt.h>
73
106extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask); 74extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask);
107extern int hpet_set_rtc_irq_bit(unsigned long bit_mask); 75extern int hpet_set_rtc_irq_bit(unsigned long bit_mask);
108extern int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec); 76extern int hpet_set_alarm_time(unsigned char hrs, unsigned char min,
77 unsigned char sec);
109extern int hpet_set_periodic_freq(unsigned long freq); 78extern int hpet_set_periodic_freq(unsigned long freq);
110extern int hpet_rtc_dropped_irq(void); 79extern int hpet_rtc_dropped_irq(void);
111extern int hpet_rtc_timer_init(void); 80extern int hpet_rtc_timer_init(void);
112extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id); 81extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id);
82
113#endif /* CONFIG_HPET_EMULATE_RTC */ 83#endif /* CONFIG_HPET_EMULATE_RTC */
114 84
115#else 85#else
diff --git a/include/asm-i386/i8253.h b/include/asm-i386/i8253.h
index 6cb0dd4dcdde..7577d058d86e 100644
--- a/include/asm-i386/i8253.h
+++ b/include/asm-i386/i8253.h
@@ -3,19 +3,15 @@
3 3
4#include <linux/clockchips.h> 4#include <linux/clockchips.h>
5 5
6/* i8253A PIT registers */
7#define PIT_MODE 0x43
8#define PIT_CH0 0x40
9#define PIT_CH2 0x42
10
6extern spinlock_t i8253_lock; 11extern spinlock_t i8253_lock;
7 12
8extern struct clock_event_device *global_clock_event; 13extern struct clock_event_device *global_clock_event;
9 14
10/** 15extern void setup_pit_timer(void);
11 * pit_interrupt_hook - hook into timer tick
12 * @regs: standard registers from interrupt
13 *
14 * Call the global clock event handler.
15 **/
16static inline void pit_interrupt_hook(void)
17{
18 global_clock_event->event_handler(global_clock_event);
19}
20 16
21#endif /* __ASM_I8253_H__ */ 17#endif /* __ASM_I8253_H__ */
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
index 0fc240c80f49..e7817a3d6578 100644
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -40,14 +40,13 @@ static __inline__ int ide_default_irq(unsigned long base)
40 40
41static __inline__ unsigned long ide_default_io_base(int index) 41static __inline__ unsigned long ide_default_io_base(int index)
42{ 42{
43 struct pci_dev *pdev;
44 /* 43 /*
45 * If PCI is present then it is not safe to poke around 44 * If PCI is present then it is not safe to poke around
46 * the other legacy IDE ports. Only 0x1f0 and 0x170 are 45 * the other legacy IDE ports. Only 0x1f0 and 0x170 are
47 * defined compatibility mode ports for PCI. A user can 46 * defined compatibility mode ports for PCI. A user can
48 * override this using ide= but we must default safe. 47 * override this using ide= but we must default safe.
49 */ 48 */
50 if ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL)) == NULL) { 49 if (no_pci_devices()) {
51 switch(index) { 50 switch(index) {
52 case 2: return 0x1e8; 51 case 2: return 0x1e8;
53 case 3: return 0x168; 52 case 3: return 0x168;
@@ -55,7 +54,6 @@ static __inline__ unsigned long ide_default_io_base(int index)
55 case 5: return 0x160; 54 case 5: return 0x160;
56 } 55 }
57 } 56 }
58 pci_dev_put(pdev);
59 switch (index) { 57 switch (index) {
60 case 0: return 0x1f0; 58 case 0: return 0x1f0;
61 case 1: return 0x170; 59 case 1: return 0x170;
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h
index e797586a5bfc..7b65b5b00034 100644
--- a/include/asm-i386/io.h
+++ b/include/asm-i386/io.h
@@ -129,6 +129,7 @@ extern void iounmap(volatile void __iomem *addr);
129 */ 129 */
130extern void *bt_ioremap(unsigned long offset, unsigned long size); 130extern void *bt_ioremap(unsigned long offset, unsigned long size);
131extern void bt_iounmap(void *addr, unsigned long size); 131extern void bt_iounmap(void *addr, unsigned long size);
132extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);
132 133
133/* Use early IO mappings for DMI because it's initialized early */ 134/* Use early IO mappings for DMI because it's initialized early */
134#define dmi_ioremap bt_ioremap 135#define dmi_ioremap bt_ioremap
diff --git a/include/asm-i386/irq.h b/include/asm-i386/irq.h
index 9e15ce0006eb..36f310632c49 100644
--- a/include/asm-i386/irq.h
+++ b/include/asm-i386/irq.h
@@ -41,6 +41,7 @@ extern int irqbalance_disable(char *str);
41extern void fixup_irqs(cpumask_t map); 41extern void fixup_irqs(cpumask_t map);
42#endif 42#endif
43 43
44unsigned int do_IRQ(struct pt_regs *regs);
44void init_IRQ(void); 45void init_IRQ(void);
45void __init native_init_IRQ(void); 46void __init native_init_IRQ(void);
46 47
diff --git a/include/asm-i386/kprobes.h b/include/asm-i386/kprobes.h
index 8774d06689da..06f7303c30ca 100644
--- a/include/asm-i386/kprobes.h
+++ b/include/asm-i386/kprobes.h
@@ -42,7 +42,6 @@ typedef u8 kprobe_opcode_t;
42 ? (MAX_STACK_SIZE) \ 42 ? (MAX_STACK_SIZE) \
43 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 43 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
44 44
45#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
46#define ARCH_SUPPORTS_KRETPROBES 45#define ARCH_SUPPORTS_KRETPROBES
47#define ARCH_INACTIVE_KPROBE_COUNT 0 46#define ARCH_INACTIVE_KPROBE_COUNT 0
48#define flush_insn_slot(p) do { } while (0) 47#define flush_insn_slot(p) do { } while (0)
diff --git a/include/asm-i386/mach-default/do_timer.h b/include/asm-i386/mach-default/do_timer.h
index 56e5689863ae..23ecda0b28a0 100644
--- a/include/asm-i386/mach-default/do_timer.h
+++ b/include/asm-i386/mach-default/do_timer.h
@@ -12,5 +12,5 @@
12 12
13static inline void do_timer_interrupt_hook(void) 13static inline void do_timer_interrupt_hook(void)
14{ 14{
15 pit_interrupt_hook(); 15 global_clock_event->event_handler(global_clock_event);
16} 16}
diff --git a/include/asm-i386/mach-default/io_ports.h b/include/asm-i386/mach-default/io_ports.h
index a96d9f6604ee..48540ba97166 100644
--- a/include/asm-i386/mach-default/io_ports.h
+++ b/include/asm-i386/mach-default/io_ports.h
@@ -7,11 +7,6 @@
7#ifndef _MACH_IO_PORTS_H 7#ifndef _MACH_IO_PORTS_H
8#define _MACH_IO_PORTS_H 8#define _MACH_IO_PORTS_H
9 9
10/* i8253A PIT registers */
11#define PIT_MODE 0x43
12#define PIT_CH0 0x40
13#define PIT_CH2 0x42
14
15/* i8259A PIC registers */ 10/* i8259A PIC registers */
16#define PIC_MASTER_CMD 0x20 11#define PIC_MASTER_CMD 0x20
17#define PIC_MASTER_IMR 0x21 12#define PIC_MASTER_IMR 0x21
diff --git a/include/asm-i386/mach-default/irq_vectors_limits.h b/include/asm-i386/mach-default/irq_vectors_limits.h
index 7f161e760be6..a90c7a60109f 100644
--- a/include/asm-i386/mach-default/irq_vectors_limits.h
+++ b/include/asm-i386/mach-default/irq_vectors_limits.h
@@ -1,7 +1,7 @@
1#ifndef _ASM_IRQ_VECTORS_LIMITS_H 1#ifndef _ASM_IRQ_VECTORS_LIMITS_H
2#define _ASM_IRQ_VECTORS_LIMITS_H 2#define _ASM_IRQ_VECTORS_LIMITS_H
3 3
4#ifdef CONFIG_X86_IO_APIC 4#if defined(CONFIG_X86_IO_APIC) || defined(CONFIG_PARAVIRT)
5#define NR_IRQS 224 5#define NR_IRQS 224
6# if (224 >= 32 * NR_CPUS) 6# if (224 >= 32 * NR_CPUS)
7# define NR_IRQ_VECTORS NR_IRQS 7# define NR_IRQ_VECTORS NR_IRQS
diff --git a/include/asm-i386/mach-default/mach_reboot.h b/include/asm-i386/mach-default/mach_reboot.h
index a955e57ad016..e23fd9fbebb3 100644
--- a/include/asm-i386/mach-default/mach_reboot.h
+++ b/include/asm-i386/mach-default/mach_reboot.h
@@ -19,14 +19,37 @@ static inline void kb_wait(void)
19static inline void mach_reboot(void) 19static inline void mach_reboot(void)
20{ 20{
21 int i; 21 int i;
22
23 /* old method, works on most machines */
22 for (i = 0; i < 10; i++) { 24 for (i = 0; i < 10; i++) {
23 kb_wait(); 25 kb_wait();
24 udelay(50); 26 udelay(50);
27 outb(0xfe, 0x64); /* pulse reset low */
28 udelay(50);
29 }
30
31 /* New method: sets the "System flag" which, when set, indicates
32 * successful completion of the keyboard controller self-test (Basic
33 * Assurance Test, BAT). This is needed for some machines with no
34 * keyboard plugged in. This read-modify-write sequence sets only the
35 * system flag
36 */
37 for (i = 0; i < 10; i++) {
38 int cmd;
39
40 outb(0x20, 0x64); /* read Controller Command Byte */
41 udelay(50);
42 kb_wait();
43 udelay(50);
44 cmd = inb(0x60);
45 udelay(50);
46 kb_wait();
47 udelay(50);
25 outb(0x60, 0x64); /* write Controller Command Byte */ 48 outb(0x60, 0x64); /* write Controller Command Byte */
26 udelay(50); 49 udelay(50);
27 kb_wait(); 50 kb_wait();
28 udelay(50); 51 udelay(50);
29 outb(0x14, 0x60); /* set "System flag" */ 52 outb(cmd | 0x04, 0x60); /* set "System flag" */
30 udelay(50); 53 udelay(50);
31 kb_wait(); 54 kb_wait();
32 udelay(50); 55 udelay(50);
diff --git a/include/asm-i386/mach-es7000/mach_apic.h b/include/asm-i386/mach-es7000/mach_apic.h
index 2d978928a395..caec64be516d 100644
--- a/include/asm-i386/mach-es7000/mach_apic.h
+++ b/include/asm-i386/mach-es7000/mach_apic.h
@@ -73,6 +73,10 @@ static inline void init_apic_ldr(void)
73 apic_write_around(APIC_LDR, val); 73 apic_write_around(APIC_LDR, val);
74} 74}
75 75
76#ifndef CONFIG_X86_GENERICARCH
77extern void enable_apic_mode(void);
78#endif
79
76extern int apic_version [MAX_APICS]; 80extern int apic_version [MAX_APICS];
77static inline void setup_apic_routing(void) 81static inline void setup_apic_routing(void)
78{ 82{
diff --git a/include/asm-i386/mach-es7000/mach_mpparse.h b/include/asm-i386/mach-es7000/mach_mpparse.h
index b9fb784e1fd5..8aa10547b4b1 100644
--- a/include/asm-i386/mach-es7000/mach_mpparse.h
+++ b/include/asm-i386/mach-es7000/mach_mpparse.h
@@ -18,6 +18,12 @@ extern int parse_unisys_oem (char *oemptr);
18extern int find_unisys_acpi_oem_table(unsigned long *oem_addr); 18extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
19extern void setup_unisys(void); 19extern void setup_unisys(void);
20 20
21#ifndef CONFIG_X86_GENERICARCH
22extern int acpi_madt_oem_check(char *oem_id, char *oem_table_id);
23extern int mps_oem_check(struct mp_config_table *mpc, char *oem,
24 char *productid);
25#endif
26
21#ifdef CONFIG_ACPI 27#ifdef CONFIG_ACPI
22 28
23static inline int es7000_check_dsdt(void) 29static inline int es7000_check_dsdt(void)
diff --git a/include/asm-i386/mach-voyager/do_timer.h b/include/asm-i386/mach-voyager/do_timer.h
index 60f9dcc15d54..bc2b58926308 100644
--- a/include/asm-i386/mach-voyager/do_timer.h
+++ b/include/asm-i386/mach-voyager/do_timer.h
@@ -12,7 +12,7 @@
12 **/ 12 **/
13static inline void do_timer_interrupt_hook(void) 13static inline void do_timer_interrupt_hook(void)
14{ 14{
15 pit_interrupt_hook(); 15 global_clock_event->event_handler(global_clock_event);
16 voyager_timer_interrupt(); 16 voyager_timer_interrupt();
17} 17}
18 18
diff --git a/include/asm-i386/mc146818rtc.h b/include/asm-i386/mc146818rtc.h
index 99a890047023..1613b42eaf58 100644
--- a/include/asm-i386/mc146818rtc.h
+++ b/include/asm-i386/mc146818rtc.h
@@ -6,6 +6,7 @@
6 6
7#include <asm/io.h> 7#include <asm/io.h>
8#include <asm/system.h> 8#include <asm/system.h>
9#include <asm/processor.h>
9#include <linux/mc146818rtc.h> 10#include <linux/mc146818rtc.h>
10 11
11#ifndef RTC_PORT 12#ifndef RTC_PORT
@@ -43,8 +44,10 @@ static inline void lock_cmos(unsigned char reg)
43 unsigned long new; 44 unsigned long new;
44 new = ((smp_processor_id()+1) << 8) | reg; 45 new = ((smp_processor_id()+1) << 8) | reg;
45 for (;;) { 46 for (;;) {
46 if (cmos_lock) 47 if (cmos_lock) {
48 cpu_relax();
47 continue; 49 continue;
50 }
48 if (__cmpxchg(&cmos_lock, 0, new, sizeof(cmos_lock)) == 0) 51 if (__cmpxchg(&cmos_lock, 0, new, sizeof(cmos_lock)) == 0)
49 return; 52 return;
50 } 53 }
diff --git a/include/asm-i386/mmu_context.h b/include/asm-i386/mmu_context.h
index 8198d1cca1f3..7eb0b0b1fb3c 100644
--- a/include/asm-i386/mmu_context.h
+++ b/include/asm-i386/mmu_context.h
@@ -32,6 +32,8 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
32#endif 32#endif
33} 33}
34 34
35void leave_mm(unsigned long cpu);
36
35static inline void switch_mm(struct mm_struct *prev, 37static inline void switch_mm(struct mm_struct *prev,
36 struct mm_struct *next, 38 struct mm_struct *next,
37 struct task_struct *tsk) 39 struct task_struct *tsk)
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index 818ac8bf01e2..80ecc66b6d86 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -34,7 +34,8 @@
34#define clear_user_page(page, vaddr, pg) clear_page(page) 34#define clear_user_page(page, vaddr, pg) clear_page(page)
35#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 35#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
36 36
37#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) 37#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
38 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
38#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 39#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
39 40
40/* 41/*
@@ -43,7 +44,6 @@
43extern int nx_enabled; 44extern int nx_enabled;
44 45
45#ifdef CONFIG_X86_PAE 46#ifdef CONFIG_X86_PAE
46extern unsigned long long __supported_pte_mask;
47typedef struct { unsigned long pte_low, pte_high; } pte_t; 47typedef struct { unsigned long pte_low, pte_high; } pte_t;
48typedef struct { unsigned long long pmd; } pmd_t; 48typedef struct { unsigned long long pmd; } pmd_t;
49typedef struct { unsigned long long pgd; } pgd_t; 49typedef struct { unsigned long long pgd; } pgd_t;
diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h
index d7a0512f88e0..7df88be2dd9e 100644
--- a/include/asm-i386/paravirt.h
+++ b/include/asm-i386/paravirt.h
@@ -52,6 +52,8 @@ struct paravirt_ops
52 /* Basic arch-specific setup */ 52 /* Basic arch-specific setup */
53 void (*arch_setup)(void); 53 void (*arch_setup)(void);
54 char *(*memory_setup)(void); 54 char *(*memory_setup)(void);
55 void (*post_allocator_init)(void);
56
55 void (*init_IRQ)(void); 57 void (*init_IRQ)(void);
56 void (*time_init)(void); 58 void (*time_init)(void);
57 59
@@ -116,7 +118,7 @@ struct paravirt_ops
116 118
117 u64 (*read_tsc)(void); 119 u64 (*read_tsc)(void);
118 u64 (*read_pmc)(void); 120 u64 (*read_pmc)(void);
119 u64 (*get_scheduled_cycles)(void); 121 unsigned long long (*sched_clock)(void);
120 unsigned long (*get_cpu_khz)(void); 122 unsigned long (*get_cpu_khz)(void);
121 123
122 /* Segment descriptor handling */ 124 /* Segment descriptor handling */
@@ -173,7 +175,7 @@ struct paravirt_ops
173 unsigned long va); 175 unsigned long va);
174 176
175 /* Hooks for allocating/releasing pagetable pages */ 177 /* Hooks for allocating/releasing pagetable pages */
176 void (*alloc_pt)(u32 pfn); 178 void (*alloc_pt)(struct mm_struct *mm, u32 pfn);
177 void (*alloc_pd)(u32 pfn); 179 void (*alloc_pd)(u32 pfn);
178 void (*alloc_pd_clone)(u32 pfn, u32 clonepfn, u32 start, u32 count); 180 void (*alloc_pd_clone)(u32 pfn, u32 clonepfn, u32 start, u32 count);
179 void (*release_pt)(u32 pfn); 181 void (*release_pt)(u32 pfn);
@@ -260,6 +262,7 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *site, unsigned len)
260unsigned paravirt_patch_insns(void *site, unsigned len, 262unsigned paravirt_patch_insns(void *site, unsigned len,
261 const char *start, const char *end); 263 const char *start, const char *end);
262 264
265int paravirt_disable_iospace(void);
263 266
264/* 267/*
265 * This generates an indirect call based on the operation type number. 268 * This generates an indirect call based on the operation type number.
@@ -539,7 +542,7 @@ static inline int paravirt_write_msr(unsigned msr, unsigned low, unsigned high)
539 val = paravirt_read_msr(msr, &_err); \ 542 val = paravirt_read_msr(msr, &_err); \
540} while(0) 543} while(0)
541 544
542#define wrmsrl(msr,val) ((void)paravirt_write_msr(msr, val, 0)) 545#define wrmsrl(msr,val) wrmsr(msr, (u32)((u64)(val)), ((u64)(val))>>32)
543#define wrmsr_safe(msr,a,b) paravirt_write_msr(msr, a, b) 546#define wrmsr_safe(msr,a,b) paravirt_write_msr(msr, a, b)
544 547
545/* rdmsr with exception handling */ 548/* rdmsr with exception handling */
@@ -563,7 +566,10 @@ static inline u64 paravirt_read_tsc(void)
563 566
564#define rdtscll(val) (val = paravirt_read_tsc()) 567#define rdtscll(val) (val = paravirt_read_tsc())
565 568
566#define get_scheduled_cycles(val) (val = paravirt_ops.get_scheduled_cycles()) 569static inline unsigned long long paravirt_sched_clock(void)
570{
571 return PVOP_CALL0(unsigned long long, sched_clock);
572}
567#define calculate_cpu_khz() (paravirt_ops.get_cpu_khz()) 573#define calculate_cpu_khz() (paravirt_ops.get_cpu_khz())
568 574
569#define write_tsc(val1,val2) wrmsr(0x10, val1, val2) 575#define write_tsc(val1,val2) wrmsr(0x10, val1, val2)
@@ -669,6 +675,12 @@ static inline void setup_secondary_clock(void)
669} 675}
670#endif 676#endif
671 677
678static inline void paravirt_post_allocator_init(void)
679{
680 if (paravirt_ops.post_allocator_init)
681 (*paravirt_ops.post_allocator_init)();
682}
683
672static inline void paravirt_pagetable_setup_start(pgd_t *base) 684static inline void paravirt_pagetable_setup_start(pgd_t *base)
673{ 685{
674 if (paravirt_ops.pagetable_setup_start) 686 if (paravirt_ops.pagetable_setup_start)
@@ -725,9 +737,9 @@ static inline void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm,
725 PVOP_VCALL3(flush_tlb_others, &cpumask, mm, va); 737 PVOP_VCALL3(flush_tlb_others, &cpumask, mm, va);
726} 738}
727 739
728static inline void paravirt_alloc_pt(unsigned pfn) 740static inline void paravirt_alloc_pt(struct mm_struct *mm, unsigned pfn)
729{ 741{
730 PVOP_VCALL1(alloc_pt, pfn); 742 PVOP_VCALL2(alloc_pt, mm, pfn);
731} 743}
732static inline void paravirt_release_pt(unsigned pfn) 744static inline void paravirt_release_pt(unsigned pfn)
733{ 745{
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index 64b6d0baedbc..d790343e9982 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -3,6 +3,11 @@
3 3
4 4
5#ifdef __KERNEL__ 5#ifdef __KERNEL__
6
7struct pci_sysdata {
8 int node; /* NUMA node */
9};
10
6#include <linux/mm.h> /* for struct page */ 11#include <linux/mm.h> /* for struct page */
7 12
8/* Can be used to override the logic in pci_scan_bus for skipping 13/* Can be used to override the logic in pci_scan_bus for skipping
@@ -56,48 +61,11 @@ struct pci_dev;
56#define pci_unmap_len(PTR, LEN_NAME) (0) 61#define pci_unmap_len(PTR, LEN_NAME) (0)
57#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) 62#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
58 63
59/* This is always fine. */
60#define pci_dac_dma_supported(pci_dev, mask) (1)
61
62static inline dma64_addr_t
63pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page, unsigned long offset, int direction)
64{
65 return ((dma64_addr_t) page_to_phys(page) +
66 (dma64_addr_t) offset);
67}
68
69static inline struct page *
70pci_dac_dma_to_page(struct pci_dev *pdev, dma64_addr_t dma_addr)
71{
72 return pfn_to_page(dma_addr >> PAGE_SHIFT);
73}
74
75static inline unsigned long
76pci_dac_dma_to_offset(struct pci_dev *pdev, dma64_addr_t dma_addr)
77{
78 return (dma_addr & ~PAGE_MASK);
79}
80
81static inline void
82pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
83{
84}
85
86static inline void
87pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
88{
89 flush_write_buffers();
90}
91
92#define HAVE_PCI_MMAP 64#define HAVE_PCI_MMAP
93extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 65extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
94 enum pci_mmap_state mmap_state, int write_combine); 66 enum pci_mmap_state mmap_state, int write_combine);
95 67
96 68
97static inline void pcibios_add_platform_entries(struct pci_dev *dev)
98{
99}
100
101#ifdef CONFIG_PCI 69#ifdef CONFIG_PCI
102static inline void pci_dma_burst_advice(struct pci_dev *pdev, 70static inline void pci_dma_burst_advice(struct pci_dev *pdev,
103 enum pci_dma_burst_strategy *strat, 71 enum pci_dma_burst_strategy *strat,
diff --git a/include/asm-i386/percpu.h b/include/asm-i386/percpu.h
index f54830b5d5ac..a7ebd436f3cc 100644
--- a/include/asm-i386/percpu.h
+++ b/include/asm-i386/percpu.h
@@ -54,6 +54,11 @@ extern unsigned long __per_cpu_offset[];
54#define DEFINE_PER_CPU(type, name) \ 54#define DEFINE_PER_CPU(type, name) \
55 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name 55 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
56 56
57#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
58 __attribute__((__section__(".data.percpu.shared_aligned"))) \
59 __typeof__(type) per_cpu__##name \
60 ____cacheline_aligned_in_smp
61
57/* We can use this directly for local CPU (faster). */ 62/* We can use this directly for local CPU (faster). */
58DECLARE_PER_CPU(unsigned long, this_cpu_off); 63DECLARE_PER_CPU(unsigned long, this_cpu_off);
59 64
diff --git a/include/asm-i386/pgalloc.h b/include/asm-i386/pgalloc.h
index d07b7afc2692..f2fc33ceb9f2 100644
--- a/include/asm-i386/pgalloc.h
+++ b/include/asm-i386/pgalloc.h
@@ -7,7 +7,7 @@
7#ifdef CONFIG_PARAVIRT 7#ifdef CONFIG_PARAVIRT
8#include <asm/paravirt.h> 8#include <asm/paravirt.h>
9#else 9#else
10#define paravirt_alloc_pt(pfn) do { } while (0) 10#define paravirt_alloc_pt(mm, pfn) do { } while (0)
11#define paravirt_alloc_pd(pfn) do { } while (0) 11#define paravirt_alloc_pd(pfn) do { } while (0)
12#define paravirt_alloc_pd(pfn) do { } while (0) 12#define paravirt_alloc_pd(pfn) do { } while (0)
13#define paravirt_alloc_pd_clone(pfn, clonepfn, start, count) do { } while (0) 13#define paravirt_alloc_pd_clone(pfn, clonepfn, start, count) do { } while (0)
@@ -17,13 +17,13 @@
17 17
18#define pmd_populate_kernel(mm, pmd, pte) \ 18#define pmd_populate_kernel(mm, pmd, pte) \
19do { \ 19do { \
20 paravirt_alloc_pt(__pa(pte) >> PAGE_SHIFT); \ 20 paravirt_alloc_pt(mm, __pa(pte) >> PAGE_SHIFT); \
21 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))); \ 21 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))); \
22} while (0) 22} while (0)
23 23
24#define pmd_populate(mm, pmd, pte) \ 24#define pmd_populate(mm, pmd, pte) \
25do { \ 25do { \
26 paravirt_alloc_pt(page_to_pfn(pte)); \ 26 paravirt_alloc_pt(mm, page_to_pfn(pte)); \
27 set_pmd(pmd, __pmd(_PAGE_TABLE + \ 27 set_pmd(pmd, __pmd(_PAGE_TABLE + \
28 ((unsigned long long)page_to_pfn(pte) << \ 28 ((unsigned long long)page_to_pfn(pte) << \
29 (unsigned long long) PAGE_SHIFT))); \ 29 (unsigned long long) PAGE_SHIFT))); \
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h
index a50fd1773de8..84b03cf56a79 100644
--- a/include/asm-i386/pgtable-2level.h
+++ b/include/asm-i386/pgtable-2level.h
@@ -57,14 +57,6 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp)
57#define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) 57#define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
58 58
59/* 59/*
60 * All present user pages are user-executable:
61 */
62static inline int pte_exec(pte_t pte)
63{
64 return pte_user(pte);
65}
66
67/*
68 * All present pages are kernel-executable: 60 * All present pages are kernel-executable:
69 */ 61 */
70static inline int pte_exec_kernel(pte_t pte) 62static inline int pte_exec_kernel(pte_t pte)
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h
index eb0f1d7e96a1..948a33414118 100644
--- a/include/asm-i386/pgtable-3level.h
+++ b/include/asm-i386/pgtable-3level.h
@@ -20,26 +20,11 @@
20#define pud_present(pud) 1 20#define pud_present(pud) 1
21 21
22/* 22/*
23 * Is the pte executable?
24 */
25static inline int pte_x(pte_t pte)
26{
27 return !(pte_val(pte) & _PAGE_NX);
28}
29
30/*
31 * All present user-pages with !NX bit are user-executable:
32 */
33static inline int pte_exec(pte_t pte)
34{
35 return pte_user(pte) && pte_x(pte);
36}
37/*
38 * All present pages with !NX bit are kernel-executable: 23 * All present pages with !NX bit are kernel-executable:
39 */ 24 */
40static inline int pte_exec_kernel(pte_t pte) 25static inline int pte_exec_kernel(pte_t pte)
41{ 26{
42 return pte_x(pte); 27 return !(pte_val(pte) & _PAGE_NX);
43} 28}
44 29
45/* Rules for using set_pte: the pte being assigned *must* be 30/* Rules for using set_pte: the pte being assigned *must* be
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 2394589786ba..c7fefa6b12fd 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -79,7 +79,7 @@ void paging_init(void);
79 * area for the same reason. ;) 79 * area for the same reason. ;)
80 */ 80 */
81#define VMALLOC_OFFSET (8*1024*1024) 81#define VMALLOC_OFFSET (8*1024*1024)
82#define VMALLOC_START (((unsigned long) high_memory + vmalloc_earlyreserve + \ 82#define VMALLOC_START (((unsigned long) high_memory + \
83 2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1)) 83 2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1))
84#ifdef CONFIG_HIGHMEM 84#ifdef CONFIG_HIGHMEM
85# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) 85# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE)
@@ -218,8 +218,6 @@ extern unsigned long pg0[];
218 * The following only work if pte_present() is true. 218 * The following only work if pte_present() is true.
219 * Undefined behaviour if not.. 219 * Undefined behaviour if not..
220 */ 220 */
221static inline int pte_user(pte_t pte) { return (pte).pte_low & _PAGE_USER; }
222static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_USER; }
223static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; } 221static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; }
224static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; } 222static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; }
225static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; } 223static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; }
@@ -230,13 +228,9 @@ static inline int pte_huge(pte_t pte) { return (pte).pte_low & _PAGE_PSE; }
230 */ 228 */
231static inline int pte_file(pte_t pte) { return (pte).pte_low & _PAGE_FILE; } 229static inline int pte_file(pte_t pte) { return (pte).pte_low & _PAGE_FILE; }
232 230
233static inline pte_t pte_rdprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_USER; return pte; }
234static inline pte_t pte_exprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_USER; return pte; }
235static inline pte_t pte_mkclean(pte_t pte) { (pte).pte_low &= ~_PAGE_DIRTY; return pte; } 231static inline pte_t pte_mkclean(pte_t pte) { (pte).pte_low &= ~_PAGE_DIRTY; return pte; }
236static inline pte_t pte_mkold(pte_t pte) { (pte).pte_low &= ~_PAGE_ACCESSED; return pte; } 232static inline pte_t pte_mkold(pte_t pte) { (pte).pte_low &= ~_PAGE_ACCESSED; return pte; }
237static inline pte_t pte_wrprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_RW; return pte; } 233static inline pte_t pte_wrprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_RW; return pte; }
238static inline pte_t pte_mkread(pte_t pte) { (pte).pte_low |= _PAGE_USER; return pte; }
239static inline pte_t pte_mkexec(pte_t pte) { (pte).pte_low |= _PAGE_USER; return pte; }
240static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; } 234static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; }
241static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; } 235static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; }
242static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; } 236static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; }
@@ -285,53 +279,25 @@ static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep)
285 */ 279 */
286#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 280#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
287#define ptep_set_access_flags(vma, address, ptep, entry, dirty) \ 281#define ptep_set_access_flags(vma, address, ptep, entry, dirty) \
288do { \ 282({ \
289 if (dirty) { \ 283 int __changed = !pte_same(*(ptep), entry); \
284 if (__changed && dirty) { \
290 (ptep)->pte_low = (entry).pte_low; \ 285 (ptep)->pte_low = (entry).pte_low; \
291 pte_update_defer((vma)->vm_mm, (address), (ptep)); \ 286 pte_update_defer((vma)->vm_mm, (address), (ptep)); \
292 flush_tlb_page(vma, address); \ 287 flush_tlb_page(vma, address); \
293 } \ 288 } \
294} while (0) 289 __changed; \
295
296#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
297#define ptep_test_and_clear_dirty(vma, addr, ptep) ({ \
298 int ret = 0; \
299 if (pte_dirty(*ptep)) \
300 ret = test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte_low); \
301 if (ret) \
302 pte_update_defer(vma->vm_mm, addr, ptep); \
303 ret; \
304}) 290})
305 291
306#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 292#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
307#define ptep_test_and_clear_young(vma, addr, ptep) ({ \ 293#define ptep_test_and_clear_young(vma, addr, ptep) ({ \
308 int ret = 0; \ 294 int __ret = 0; \
309 if (pte_young(*ptep)) \ 295 if (pte_young(*(ptep))) \
310 ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low); \ 296 __ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, \
311 if (ret) \ 297 &(ptep)->pte_low); \
312 pte_update_defer(vma->vm_mm, addr, ptep); \ 298 if (__ret) \
313 ret; \ 299 pte_update((vma)->vm_mm, addr, ptep); \
314}) 300 __ret; \
315
316/*
317 * Rules for using ptep_establish: the pte MUST be a user pte, and
318 * must be a present->present transition.
319 */
320#define __HAVE_ARCH_PTEP_ESTABLISH
321#define ptep_establish(vma, address, ptep, pteval) \
322do { \
323 set_pte_present((vma)->vm_mm, address, ptep, pteval); \
324 flush_tlb_page(vma, address); \
325} while (0)
326
327#define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
328#define ptep_clear_flush_dirty(vma, address, ptep) \
329({ \
330 int __dirty; \
331 __dirty = ptep_test_and_clear_dirty((vma), (address), (ptep)); \
332 if (__dirty) \
333 flush_tlb_page(vma, address); \
334 __dirty; \
335}) 301})
336 302
337#define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH 303#define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 338668bfb0a2..48a7f69bb767 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -88,7 +88,6 @@ struct cpuinfo_x86 {
88#define X86_VENDOR_UMC 3 88#define X86_VENDOR_UMC 3
89#define X86_VENDOR_NEXGEN 4 89#define X86_VENDOR_NEXGEN 4
90#define X86_VENDOR_CENTAUR 5 90#define X86_VENDOR_CENTAUR 5
91#define X86_VENDOR_RISE 6
92#define X86_VENDOR_TRANSMETA 7 91#define X86_VENDOR_TRANSMETA 7
93#define X86_VENDOR_NSC 8 92#define X86_VENDOR_NSC 8
94#define X86_VENDOR_NUM 9 93#define X86_VENDOR_NUM 9
@@ -119,6 +118,7 @@ void __init cpu_detect(struct cpuinfo_x86 *c);
119extern void identify_boot_cpu(void); 118extern void identify_boot_cpu(void);
120extern void identify_secondary_cpu(struct cpuinfo_x86 *); 119extern void identify_secondary_cpu(struct cpuinfo_x86 *);
121extern void print_cpu_info(struct cpuinfo_x86 *); 120extern void print_cpu_info(struct cpuinfo_x86 *);
121extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c);
122extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); 122extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
123extern unsigned short num_cache_leaves; 123extern unsigned short num_cache_leaves;
124 124
@@ -227,6 +227,10 @@ extern int bootloader_type;
227 227
228#define HAVE_ARCH_PICK_MMAP_LAYOUT 228#define HAVE_ARCH_PICK_MMAP_LAYOUT
229 229
230extern void hard_disable_TSC(void);
231extern void disable_TSC(void);
232extern void hard_enable_TSC(void);
233
230/* 234/*
231 * Size of io_bitmap. 235 * Size of io_bitmap.
232 */ 236 */
diff --git a/include/asm-i386/required-features.h b/include/asm-i386/required-features.h
index 9db866c1e64c..618feb98f9f5 100644
--- a/include/asm-i386/required-features.h
+++ b/include/asm-i386/required-features.h
@@ -3,32 +3,53 @@
3 3
4/* Define minimum CPUID feature set for kernel These bits are checked 4/* Define minimum CPUID feature set for kernel These bits are checked
5 really early to actually display a visible error message before the 5 really early to actually display a visible error message before the
6 kernel dies. Only add word 0 bits here 6 kernel dies. Make sure to assign features to the proper mask!
7 7
8 Some requirements that are not in CPUID yet are also in the 8 Some requirements that are not in CPUID yet are also in the
9 CONFIG_X86_MINIMUM_CPU mode which is checked too. 9 CONFIG_X86_MINIMUM_CPU_FAMILY which is checked too.
10 10
11 The real information is in arch/i386/Kconfig.cpu, this just converts 11 The real information is in arch/i386/Kconfig.cpu, this just converts
12 the CONFIGs into a bitmask */ 12 the CONFIGs into a bitmask */
13 13
14#ifndef CONFIG_MATH_EMULATION
15# define NEED_FPU (1<<(X86_FEATURE_FPU & 31))
16#else
17# define NEED_FPU 0
18#endif
19
14#ifdef CONFIG_X86_PAE 20#ifdef CONFIG_X86_PAE
15#define NEED_PAE (1<<X86_FEATURE_PAE) 21# define NEED_PAE (1<<(X86_FEATURE_PAE & 31))
16#else 22#else
17#define NEED_PAE 0 23# define NEED_PAE 0
18#endif 24#endif
19 25
20#ifdef CONFIG_X86_CMOV 26#ifdef CONFIG_X86_CMOV
21#define NEED_CMOV (1<<X86_FEATURE_CMOV) 27# define NEED_CMOV (1<<(X86_FEATURE_CMOV & 31))
22#else 28#else
23#define NEED_CMOV 0 29# define NEED_CMOV 0
24#endif 30#endif
25 31
26#ifdef CONFIG_X86_CMPXCHG64 32#ifdef CONFIG_X86_PAE
27#define NEED_CMPXCHG64 (1<<X86_FEATURE_CX8) 33# define NEED_CX8 (1<<(X86_FEATURE_CX8 & 31))
28#else 34#else
29#define NEED_CMPXCHG64 0 35# define NEED_CX8 0
30#endif 36#endif
31 37
32#define REQUIRED_MASK1 (NEED_PAE|NEED_CMOV|NEED_CMPXCHG64) 38#define REQUIRED_MASK0 (NEED_FPU|NEED_PAE|NEED_CMOV|NEED_CX8)
39
40#ifdef CONFIG_X86_USE_3DNOW
41# define NEED_3DNOW (1<<(X86_FEATURE_3DNOW & 31))
42#else
43# define NEED_3DNOW 0
44#endif
45
46#define REQUIRED_MASK1 (NEED_3DNOW)
47
48#define REQUIRED_MASK2 0
49#define REQUIRED_MASK3 0
50#define REQUIRED_MASK4 0
51#define REQUIRED_MASK5 0
52#define REQUIRED_MASK6 0
53#define REQUIRED_MASK7 0
33 54
34#endif 55#endif
diff --git a/include/asm-i386/resume-trace.h b/include/asm-i386/resume-trace.h
new file mode 100644
index 000000000000..ec9cfd656230
--- /dev/null
+++ b/include/asm-i386/resume-trace.h
@@ -0,0 +1,13 @@
1#define TRACE_RESUME(user) do { \
2 if (pm_trace_enabled) { \
3 void *tracedata; \
4 asm volatile("movl $1f,%0\n" \
5 ".section .tracedata,\"a\"\n" \
6 "1:\t.word %c1\n" \
7 "\t.long %c2\n" \
8 ".previous" \
9 :"=r" (tracedata) \
10 : "i" (__LINE__), "i" (__FILE__)); \
11 generate_resume_trace(tracedata, user); \
12 } \
13} while (0)
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h
index 0e8077cbfdac..7862fe858a9e 100644
--- a/include/asm-i386/setup.h
+++ b/include/asm-i386/setup.h
@@ -26,12 +26,15 @@
26#define NEW_CL_POINTER 0x228 /* Relative to real mode data */ 26#define NEW_CL_POINTER 0x228 /* Relative to real mode data */
27 27
28#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
29
30#include <asm/bootparam.h>
31
29/* 32/*
30 * This is set up by the setup-routine at boot-time 33 * This is set up by the setup-routine at boot-time
31 */ 34 */
32extern unsigned char boot_params[PARAM_SIZE]; 35extern struct boot_params boot_params;
33 36
34#define PARAM (boot_params) 37#define PARAM ((char *)&boot_params)
35#define SCREEN_INFO (*(struct screen_info *) (PARAM+0)) 38#define SCREEN_INFO (*(struct screen_info *) (PARAM+0))
36#define EXT_MEM_K (*(unsigned short *) (PARAM+2)) 39#define EXT_MEM_K (*(unsigned short *) (PARAM+2))
37#define ALT_MEM_K (*(unsigned long *) (PARAM+0x1e0)) 40#define ALT_MEM_K (*(unsigned long *) (PARAM+0x1e0))
@@ -39,8 +42,7 @@ extern unsigned char boot_params[PARAM_SIZE];
39#define E820_MAP ((struct e820entry *) (PARAM+E820MAP)) 42#define E820_MAP ((struct e820entry *) (PARAM+E820MAP))
40#define APM_BIOS_INFO (*(struct apm_bios_info *) (PARAM+0x40)) 43#define APM_BIOS_INFO (*(struct apm_bios_info *) (PARAM+0x40))
41#define IST_INFO (*(struct ist_info *) (PARAM+0x60)) 44#define IST_INFO (*(struct ist_info *) (PARAM+0x60))
42#define DRIVE_INFO (*(struct drive_info_struct *) (PARAM+0x80)) 45#define SYS_DESC_TABLE (*(struct sys_desc_table *)(PARAM+0xa0))
43#define SYS_DESC_TABLE (*(struct sys_desc_table_struct*)(PARAM+0xa0))
44#define EFI_SYSTAB ((efi_system_table_t *) *((unsigned long *)(PARAM+0x1c4))) 46#define EFI_SYSTAB ((efi_system_table_t *) *((unsigned long *)(PARAM+0x1c4)))
45#define EFI_MEMDESC_SIZE (*((unsigned long *) (PARAM+0x1c8))) 47#define EFI_MEMDESC_SIZE (*((unsigned long *) (PARAM+0x1c8)))
46#define EFI_MEMDESC_VERSION (*((unsigned long *) (PARAM+0x1cc))) 48#define EFI_MEMDESC_VERSION (*((unsigned long *) (PARAM+0x1cc)))
@@ -79,6 +81,10 @@ void __init add_memory_region(unsigned long long start,
79 81
80extern unsigned long init_pg_tables_end; 82extern unsigned long init_pg_tables_end;
81 83
84#ifndef CONFIG_PARAVIRT
85#define paravirt_post_allocator_init() do {} while (0)
86#endif
87
82#endif /* __ASSEMBLY__ */ 88#endif /* __ASSEMBLY__ */
83 89
84#endif /* __KERNEL__ */ 90#endif /* __KERNEL__ */
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index 0c7132787062..1f73bde165b1 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -43,9 +43,12 @@ extern u8 x86_cpu_to_apicid[];
43 43
44#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu] 44#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
45 45
46extern void set_cpu_sibling_map(int cpu);
47
46#ifdef CONFIG_HOTPLUG_CPU 48#ifdef CONFIG_HOTPLUG_CPU
47extern void cpu_exit_clear(void); 49extern void cpu_exit_clear(void);
48extern void cpu_uninit(void); 50extern void cpu_uninit(void);
51extern void remove_siblinginfo(int cpu);
49#endif 52#endif
50 53
51struct smp_ops 54struct smp_ops
@@ -129,6 +132,8 @@ extern int __cpu_disable(void);
129extern void __cpu_die(unsigned int cpu); 132extern void __cpu_die(unsigned int cpu);
130extern unsigned int num_processors; 133extern unsigned int num_processors;
131 134
135void __cpuinit smp_store_cpu_info(int id);
136
132#endif /* !__ASSEMBLY__ */ 137#endif /* !__ASSEMBLY__ */
133 138
134#else /* CONFIG_SMP */ 139#else /* CONFIG_SMP */
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index b9277361954b..a9b64453bdf5 100644
--- a/include/asm-i386/string.h
+++ b/include/asm-i386/string.h
@@ -2,203 +2,35 @@
2#define _I386_STRING_H_ 2#define _I386_STRING_H_
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5/*
6 * On a 486 or Pentium, we are better off not using the
7 * byte string operations. But on a 386 or a PPro the
8 * byte string ops are faster than doing it by hand
9 * (MUCH faster on a Pentium).
10 */
11
12/*
13 * This string-include defines all string functions as inline
14 * functions. Use gcc. It also assumes ds=es=data space, this should be
15 * normal. Most of the string-functions are rather heavily hand-optimized,
16 * see especially strsep,strstr,str[c]spn. They should work, but are not
17 * very easy to understand. Everything is done entirely within the register
18 * set, making the functions fast and clean. String instructions have been
19 * used through-out, making for "slightly" unclear code :-)
20 *
21 * NO Copyright (C) 1991, 1992 Linus Torvalds,
22 * consider these trivial functions to be PD.
23 */
24 5
25/* AK: in fact I bet it would be better to move this stuff all out of line. 6/* Let gcc decide wether to inline or use the out of line functions */
26 */
27 7
28#define __HAVE_ARCH_STRCPY 8#define __HAVE_ARCH_STRCPY
29static inline char * strcpy(char * dest,const char *src) 9extern char *strcpy(char *dest, const char *src);
30{
31int d0, d1, d2;
32__asm__ __volatile__(
33 "1:\tlodsb\n\t"
34 "stosb\n\t"
35 "testb %%al,%%al\n\t"
36 "jne 1b"
37 : "=&S" (d0), "=&D" (d1), "=&a" (d2)
38 :"0" (src),"1" (dest) : "memory");
39return dest;
40}
41 10
42#define __HAVE_ARCH_STRNCPY 11#define __HAVE_ARCH_STRNCPY
43static inline char * strncpy(char * dest,const char *src,size_t count) 12extern char *strncpy(char *dest, const char *src, size_t count);
44{
45int d0, d1, d2, d3;
46__asm__ __volatile__(
47 "1:\tdecl %2\n\t"
48 "js 2f\n\t"
49 "lodsb\n\t"
50 "stosb\n\t"
51 "testb %%al,%%al\n\t"
52 "jne 1b\n\t"
53 "rep\n\t"
54 "stosb\n"
55 "2:"
56 : "=&S" (d0), "=&D" (d1), "=&c" (d2), "=&a" (d3)
57 :"0" (src),"1" (dest),"2" (count) : "memory");
58return dest;
59}
60 13
61#define __HAVE_ARCH_STRCAT 14#define __HAVE_ARCH_STRCAT
62static inline char * strcat(char * dest,const char * src) 15extern char *strcat(char *dest, const char *src);
63{
64int d0, d1, d2, d3;
65__asm__ __volatile__(
66 "repne\n\t"
67 "scasb\n\t"
68 "decl %1\n"
69 "1:\tlodsb\n\t"
70 "stosb\n\t"
71 "testb %%al,%%al\n\t"
72 "jne 1b"
73 : "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
74 : "0" (src), "1" (dest), "2" (0), "3" (0xffffffffu):"memory");
75return dest;
76}
77 16
78#define __HAVE_ARCH_STRNCAT 17#define __HAVE_ARCH_STRNCAT
79static inline char * strncat(char * dest,const char * src,size_t count) 18extern char *strncat(char *dest, const char *src, size_t count);
80{
81int d0, d1, d2, d3;
82__asm__ __volatile__(
83 "repne\n\t"
84 "scasb\n\t"
85 "decl %1\n\t"
86 "movl %8,%3\n"
87 "1:\tdecl %3\n\t"
88 "js 2f\n\t"
89 "lodsb\n\t"
90 "stosb\n\t"
91 "testb %%al,%%al\n\t"
92 "jne 1b\n"
93 "2:\txorl %2,%2\n\t"
94 "stosb"
95 : "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
96 : "0" (src),"1" (dest),"2" (0),"3" (0xffffffffu), "g" (count)
97 : "memory");
98return dest;
99}
100 19
101#define __HAVE_ARCH_STRCMP 20#define __HAVE_ARCH_STRCMP
102static inline int strcmp(const char * cs,const char * ct) 21extern int strcmp(const char *cs, const char *ct);
103{
104int d0, d1;
105register int __res;
106__asm__ __volatile__(
107 "1:\tlodsb\n\t"
108 "scasb\n\t"
109 "jne 2f\n\t"
110 "testb %%al,%%al\n\t"
111 "jne 1b\n\t"
112 "xorl %%eax,%%eax\n\t"
113 "jmp 3f\n"
114 "2:\tsbbl %%eax,%%eax\n\t"
115 "orb $1,%%al\n"
116 "3:"
117 :"=a" (__res), "=&S" (d0), "=&D" (d1)
118 :"1" (cs),"2" (ct)
119 :"memory");
120return __res;
121}
122 22
123#define __HAVE_ARCH_STRNCMP 23#define __HAVE_ARCH_STRNCMP
124static inline int strncmp(const char * cs,const char * ct,size_t count) 24extern int strncmp(const char *cs, const char *ct, size_t count);
125{
126register int __res;
127int d0, d1, d2;
128__asm__ __volatile__(
129 "1:\tdecl %3\n\t"
130 "js 2f\n\t"
131 "lodsb\n\t"
132 "scasb\n\t"
133 "jne 3f\n\t"
134 "testb %%al,%%al\n\t"
135 "jne 1b\n"
136 "2:\txorl %%eax,%%eax\n\t"
137 "jmp 4f\n"
138 "3:\tsbbl %%eax,%%eax\n\t"
139 "orb $1,%%al\n"
140 "4:"
141 :"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
142 :"1" (cs),"2" (ct),"3" (count)
143 :"memory");
144return __res;
145}
146 25
147#define __HAVE_ARCH_STRCHR 26#define __HAVE_ARCH_STRCHR
148static inline char * strchr(const char * s, int c) 27extern char *strchr(const char *s, int c);
149{
150int d0;
151register char * __res;
152__asm__ __volatile__(
153 "movb %%al,%%ah\n"
154 "1:\tlodsb\n\t"
155 "cmpb %%ah,%%al\n\t"
156 "je 2f\n\t"
157 "testb %%al,%%al\n\t"
158 "jne 1b\n\t"
159 "movl $1,%1\n"
160 "2:\tmovl %1,%0\n\t"
161 "decl %0"
162 :"=a" (__res), "=&S" (d0)
163 :"1" (s),"0" (c)
164 :"memory");
165return __res;
166}
167 28
168#define __HAVE_ARCH_STRRCHR 29#define __HAVE_ARCH_STRRCHR
169static inline char * strrchr(const char * s, int c) 30extern char *strrchr(const char *s, int c);
170{
171int d0, d1;
172register char * __res;
173__asm__ __volatile__(
174 "movb %%al,%%ah\n"
175 "1:\tlodsb\n\t"
176 "cmpb %%ah,%%al\n\t"
177 "jne 2f\n\t"
178 "leal -1(%%esi),%0\n"
179 "2:\ttestb %%al,%%al\n\t"
180 "jne 1b"
181 :"=g" (__res), "=&S" (d0), "=&a" (d1)
182 :"0" (0),"1" (s),"2" (c)
183 :"memory");
184return __res;
185}
186 31
187#define __HAVE_ARCH_STRLEN 32#define __HAVE_ARCH_STRLEN
188static inline size_t strlen(const char * s) 33extern size_t strlen(const char *s);
189{
190int d0;
191register int __res;
192__asm__ __volatile__(
193 "repne\n\t"
194 "scasb\n\t"
195 "notl %0\n\t"
196 "decl %0"
197 :"=c" (__res), "=&D" (d0)
198 :"1" (s),"a" (0), "0" (0xffffffffu)
199 :"memory");
200return __res;
201}
202 34
203static __always_inline void * __memcpy(void * to, const void * from, size_t n) 35static __always_inline void * __memcpy(void * to, const void * from, size_t n)
204{ 36{
@@ -207,9 +39,7 @@ __asm__ __volatile__(
207 "rep ; movsl\n\t" 39 "rep ; movsl\n\t"
208 "movl %4,%%ecx\n\t" 40 "movl %4,%%ecx\n\t"
209 "andl $3,%%ecx\n\t" 41 "andl $3,%%ecx\n\t"
210#if 1 /* want to pay 2 byte penalty for a chance to skip microcoded rep? */
211 "jz 1f\n\t" 42 "jz 1f\n\t"
212#endif
213 "rep ; movsb\n\t" 43 "rep ; movsb\n\t"
214 "1:" 44 "1:"
215 : "=&c" (d0), "=&D" (d1), "=&S" (d2) 45 : "=&c" (d0), "=&D" (d1), "=&S" (d2)
@@ -328,23 +158,7 @@ void *memmove(void * dest,const void * src, size_t n);
328#define memcmp __builtin_memcmp 158#define memcmp __builtin_memcmp
329 159
330#define __HAVE_ARCH_MEMCHR 160#define __HAVE_ARCH_MEMCHR
331static inline void * memchr(const void * cs,int c,size_t count) 161extern void *memchr(const void * cs,int c,size_t count);
332{
333int d0;
334register void * __res;
335if (!count)
336 return NULL;
337__asm__ __volatile__(
338 "repne\n\t"
339 "scasb\n\t"
340 "je 1f\n\t"
341 "movl $1,%0\n"
342 "1:\tdecl %0"
343 :"=D" (__res), "=&c" (d0)
344 :"a" (c),"0" (cs),"1" (count)
345 :"memory");
346return __res;
347}
348 162
349static inline void * __memset_generic(void * s, char c,size_t count) 163static inline void * __memset_generic(void * s, char c,size_t count)
350{ 164{
@@ -386,29 +200,10 @@ return (s);
386 200
387/* Added by Gertjan van Wingerde to make minix and sysv module work */ 201/* Added by Gertjan van Wingerde to make minix and sysv module work */
388#define __HAVE_ARCH_STRNLEN 202#define __HAVE_ARCH_STRNLEN
389static inline size_t strnlen(const char * s, size_t count) 203extern size_t strnlen(const char * s, size_t count);
390{
391int d0;
392register int __res;
393__asm__ __volatile__(
394 "movl %2,%0\n\t"
395 "jmp 2f\n"
396 "1:\tcmpb $0,(%0)\n\t"
397 "je 3f\n\t"
398 "incl %0\n"
399 "2:\tdecl %1\n\t"
400 "cmpl $-1,%1\n\t"
401 "jne 1b\n"
402 "3:\tsubl %2,%0"
403 :"=a" (__res), "=&d" (d0)
404 :"c" (s),"1" (count)
405 :"memory");
406return __res;
407}
408/* end of additional stuff */ 204/* end of additional stuff */
409 205
410#define __HAVE_ARCH_STRSTR 206#define __HAVE_ARCH_STRSTR
411
412extern char *strstr(const char *cs, const char *ct); 207extern char *strstr(const char *cs, const char *ct);
413 208
414/* 209/*
@@ -474,19 +269,7 @@ __asm__ __volatile__( \
474 * find the first occurrence of byte 'c', or 1 past the area if none 269 * find the first occurrence of byte 'c', or 1 past the area if none
475 */ 270 */
476#define __HAVE_ARCH_MEMSCAN 271#define __HAVE_ARCH_MEMSCAN
477static inline void * memscan(void * addr, int c, size_t size) 272extern void *memscan(void * addr, int c, size_t size);
478{
479 if (!size)
480 return addr;
481 __asm__("repnz; scasb\n\t"
482 "jnz 1f\n\t"
483 "dec %%edi\n"
484 "1:"
485 : "=D" (addr), "=c" (size)
486 : "0" (addr), "1" (size), "a" (c)
487 : "memory");
488 return addr;
489}
490 273
491#endif /* __KERNEL__ */ 274#endif /* __KERNEL__ */
492 275
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 94ed3686a5f3..609756c61676 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -310,15 +310,6 @@ void enable_hlt(void);
310extern int es7000_plat; 310extern int es7000_plat;
311void cpu_idle_wait(void); 311void cpu_idle_wait(void);
312 312
313/*
314 * On SMP systems, when the scheduler does migration-cost autodetection,
315 * it needs a way to flush as much of the CPU's caches as possible:
316 */
317static inline void sched_cacheflush(void)
318{
319 wbinvd();
320}
321
322extern unsigned long arch_align_stack(unsigned long sp); 313extern unsigned long arch_align_stack(unsigned long sp);
323extern void free_init_pages(char *what, unsigned long begin, unsigned long end); 314extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
324 315
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 4cb0f91ae64f..54424e045e01 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -137,6 +137,7 @@ static inline struct thread_info *current_thread_info(void)
137#define TIF_DEBUG 17 /* uses debug registers */ 137#define TIF_DEBUG 17 /* uses debug registers */
138#define TIF_IO_BITMAP 18 /* uses I/O bitmap */ 138#define TIF_IO_BITMAP 18 /* uses I/O bitmap */
139#define TIF_FREEZE 19 /* is freezing for suspend */ 139#define TIF_FREEZE 19 /* is freezing for suspend */
140#define TIF_NOTSC 20 /* TSC is not accessible in userland */
140 141
141#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 142#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
142#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 143#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -151,6 +152,7 @@ static inline struct thread_info *current_thread_info(void)
151#define _TIF_DEBUG (1<<TIF_DEBUG) 152#define _TIF_DEBUG (1<<TIF_DEBUG)
152#define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP) 153#define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP)
153#define _TIF_FREEZE (1<<TIF_FREEZE) 154#define _TIF_FREEZE (1<<TIF_FREEZE)
155#define _TIF_NOTSC (1<<TIF_NOTSC)
154 156
155/* work to do on interrupt/exception return */ 157/* work to do on interrupt/exception return */
156#define _TIF_WORK_MASK \ 158#define _TIF_WORK_MASK \
@@ -160,7 +162,8 @@ static inline struct thread_info *current_thread_info(void)
160#define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) 162#define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP)
161 163
162/* flags to check in __switch_to() */ 164/* flags to check in __switch_to() */
163#define _TIF_WORK_CTXSW (_TIF_DEBUG|_TIF_IO_BITMAP) 165#define _TIF_WORK_CTXSW_NEXT (_TIF_IO_BITMAP | _TIF_NOTSC | _TIF_DEBUG)
166#define _TIF_WORK_CTXSW_PREV (_TIF_IO_BITMAP | _TIF_NOTSC)
164 167
165/* 168/*
166 * Thread-synchronous status. 169 * Thread-synchronous status.
diff --git a/include/asm-i386/timer.h b/include/asm-i386/timer.h
index 153770e25faa..0db7e994fb8b 100644
--- a/include/asm-i386/timer.h
+++ b/include/asm-i386/timer.h
@@ -5,18 +5,46 @@
5 5
6#define TICK_SIZE (tick_nsec / 1000) 6#define TICK_SIZE (tick_nsec / 1000)
7 7
8void setup_pit_timer(void);
9unsigned long long native_sched_clock(void); 8unsigned long long native_sched_clock(void);
10unsigned long native_calculate_cpu_khz(void); 9unsigned long native_calculate_cpu_khz(void);
11 10
12extern int timer_ack; 11extern int timer_ack;
13extern int no_timer_check; 12extern int no_timer_check;
14extern int no_sync_cmos_clock;
15extern int recalibrate_cpu_khz(void); 13extern int recalibrate_cpu_khz(void);
16 14
17#ifndef CONFIG_PARAVIRT 15#ifndef CONFIG_PARAVIRT
18#define get_scheduled_cycles(val) rdtscll(val)
19#define calculate_cpu_khz() native_calculate_cpu_khz() 16#define calculate_cpu_khz() native_calculate_cpu_khz()
20#endif 17#endif
21 18
19/* Accellerators for sched_clock()
20 * convert from cycles(64bits) => nanoseconds (64bits)
21 * basic equation:
22 * ns = cycles / (freq / ns_per_sec)
23 * ns = cycles * (ns_per_sec / freq)
24 * ns = cycles * (10^9 / (cpu_khz * 10^3))
25 * ns = cycles * (10^6 / cpu_khz)
26 *
27 * Then we use scaling math (suggested by george@mvista.com) to get:
28 * ns = cycles * (10^6 * SC / cpu_khz) / SC
29 * ns = cycles * cyc2ns_scale / SC
30 *
31 * And since SC is a constant power of two, we can convert the div
32 * into a shift.
33 *
34 * We can use khz divisor instead of mhz to keep a better percision, since
35 * cyc2ns_scale is limited to 10^6 * 2^10, which fits in 32 bits.
36 * (mathieu.desnoyers@polymtl.ca)
37 *
38 * -johnstul@us.ibm.com "math is hard, lets go shopping!"
39 */
40extern unsigned long cyc2ns_scale __read_mostly;
41
42#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
43
44static inline unsigned long long cycles_2_ns(unsigned long long cyc)
45{
46 return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
47}
48
49
22#endif 50#endif
diff --git a/include/asm-i386/tlbflush.h b/include/asm-i386/tlbflush.h
index fc525c5cd5a9..a50fa6741486 100644
--- a/include/asm-i386/tlbflush.h
+++ b/include/asm-i386/tlbflush.h
@@ -160,7 +160,11 @@ DECLARE_PER_CPU(struct tlb_state, cpu_tlbstate);
160 native_flush_tlb_others(&mask, mm, va) 160 native_flush_tlb_others(&mask, mm, va)
161#endif 161#endif
162 162
163#define flush_tlb_kernel_range(start, end) flush_tlb_all() 163static inline void flush_tlb_kernel_range(unsigned long start,
164 unsigned long end)
165{
166 flush_tlb_all();
167}
164 168
165static inline void flush_tlb_pgtables(struct mm_struct *mm, 169static inline void flush_tlb_pgtables(struct mm_struct *mm,
166 unsigned long start, unsigned long end) 170 unsigned long start, unsigned long end)
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h
index 7fc512d90ea8..19b2dafd0c81 100644
--- a/include/asm-i386/topology.h
+++ b/include/asm-i386/topology.h
@@ -67,7 +67,7 @@ static inline int node_to_first_cpu(int node)
67 return first_cpu(mask); 67 return first_cpu(mask);
68} 68}
69 69
70#define pcibus_to_node(bus) ((long) (bus)->sysdata) 70#define pcibus_to_node(bus) ((struct pci_sysdata *)((bus)->sysdata))->node
71#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus)) 71#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus))
72 72
73/* sched_domains SD_NODE_INIT for NUMAQ machines */ 73/* sched_domains SD_NODE_INIT for NUMAQ machines */
diff --git a/include/asm-i386/tsc.h b/include/asm-i386/tsc.h
index 62c091ffcccc..a4d806610b7f 100644
--- a/include/asm-i386/tsc.h
+++ b/include/asm-i386/tsc.h
@@ -63,6 +63,7 @@ extern void tsc_init(void);
63extern void mark_tsc_unstable(char *reason); 63extern void mark_tsc_unstable(char *reason);
64extern int unsynchronized_tsc(void); 64extern int unsynchronized_tsc(void);
65extern void init_tsc_clocksource(void); 65extern void init_tsc_clocksource(void);
66int check_tsc_unstable(void);
66 67
67/* 68/*
68 * Boot-time check whether the TSCs are synchronized across 69 * Boot-time check whether the TSCs are synchronized across
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index e2aa5e0d0cc7..d2a4f7be9c2c 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -581,7 +581,7 @@ long __must_check __strncpy_from_user(char *dst,
581 * If there is a limit on the length of a valid string, you may wish to 581 * If there is a limit on the length of a valid string, you may wish to
582 * consider using strnlen_user() instead. 582 * consider using strnlen_user() instead.
583 */ 583 */
584#define strlen_user(str) strnlen_user(str, ~0UL >> 1) 584#define strlen_user(str) strnlen_user(str, LONG_MAX)
585 585
586long strnlen_user(const char __user *str, long n); 586long strnlen_user(const char __user *str, long n);
587unsigned long __must_check clear_user(void __user *mem, unsigned long len); 587unsigned long __must_check clear_user(void __user *mem, unsigned long len);
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index e84ace1ec8bf..9b15545eb9b5 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -329,10 +329,11 @@
329#define __NR_signalfd 321 329#define __NR_signalfd 321
330#define __NR_timerfd 322 330#define __NR_timerfd 322
331#define __NR_eventfd 323 331#define __NR_eventfd 323
332#define __NR_fallocate 324
332 333
333#ifdef __KERNEL__ 334#ifdef __KERNEL__
334 335
335#define NR_syscalls 324 336#define NR_syscalls 325
336 337
337#define __ARCH_WANT_IPC_PARSE_VERSION 338#define __ARCH_WANT_IPC_PARSE_VERSION
338#define __ARCH_WANT_OLD_READDIR 339#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-i386/vmi_time.h b/include/asm-i386/vmi_time.h
index 213930b995cb..478188130328 100644
--- a/include/asm-i386/vmi_time.h
+++ b/include/asm-i386/vmi_time.h
@@ -49,7 +49,7 @@ extern struct vmi_timer_ops {
49extern void __init vmi_time_init(void); 49extern void __init vmi_time_init(void);
50extern unsigned long vmi_get_wallclock(void); 50extern unsigned long vmi_get_wallclock(void);
51extern int vmi_set_wallclock(unsigned long now); 51extern int vmi_set_wallclock(unsigned long now);
52extern unsigned long long vmi_get_sched_cycles(void); 52extern unsigned long long vmi_sched_clock(void);
53extern unsigned long vmi_cpu_khz(void); 53extern unsigned long vmi_cpu_khz(void);
54 54
55#ifdef CONFIG_X86_LOCAL_APIC 55#ifdef CONFIG_X86_LOCAL_APIC
diff --git a/include/asm-i386/xen/hypercall.h b/include/asm-i386/xen/hypercall.h
new file mode 100644
index 000000000000..bc0ee7d961ca
--- /dev/null
+++ b/include/asm-i386/xen/hypercall.h
@@ -0,0 +1,413 @@
1/******************************************************************************
2 * hypercall.h
3 *
4 * Linux-specific hypervisor handling.
5 *
6 * Copyright (c) 2002-2004, K A Fraser
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 version 2
10 * as published by the Free Software Foundation; or, when distributed
11 * separately from the Linux kernel or incorporated into other
12 * software packages, subject to the following license:
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining a copy
15 * of this source file (the "Software"), to deal in the Software without
16 * restriction, including without limitation the rights to use, copy, modify,
17 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
18 * and to permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be included in
22 * all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30 * IN THE SOFTWARE.
31 */
32
33#ifndef __HYPERCALL_H__
34#define __HYPERCALL_H__
35
36#include <linux/errno.h>
37#include <linux/string.h>
38
39#include <xen/interface/xen.h>
40#include <xen/interface/sched.h>
41#include <xen/interface/physdev.h>
42
43extern struct { char _entry[32]; } hypercall_page[];
44
45#define _hypercall0(type, name) \
46({ \
47 long __res; \
48 asm volatile ( \
49 "call %[call]" \
50 : "=a" (__res) \
51 : [call] "m" (hypercall_page[__HYPERVISOR_##name]) \
52 : "memory" ); \
53 (type)__res; \
54})
55
56#define _hypercall1(type, name, a1) \
57({ \
58 long __res, __ign1; \
59 asm volatile ( \
60 "call %[call]" \
61 : "=a" (__res), "=b" (__ign1) \
62 : "1" ((long)(a1)), \
63 [call] "m" (hypercall_page[__HYPERVISOR_##name]) \
64 : "memory" ); \
65 (type)__res; \
66})
67
68#define _hypercall2(type, name, a1, a2) \
69({ \
70 long __res, __ign1, __ign2; \
71 asm volatile ( \
72 "call %[call]" \
73 : "=a" (__res), "=b" (__ign1), "=c" (__ign2) \
74 : "1" ((long)(a1)), "2" ((long)(a2)), \
75 [call] "m" (hypercall_page[__HYPERVISOR_##name]) \
76 : "memory" ); \
77 (type)__res; \
78})
79
80#define _hypercall3(type, name, a1, a2, a3) \
81({ \
82 long __res, __ign1, __ign2, __ign3; \
83 asm volatile ( \
84 "call %[call]" \
85 : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
86 "=d" (__ign3) \
87 : "1" ((long)(a1)), "2" ((long)(a2)), \
88 "3" ((long)(a3)), \
89 [call] "m" (hypercall_page[__HYPERVISOR_##name]) \
90 : "memory" ); \
91 (type)__res; \
92})
93
94#define _hypercall4(type, name, a1, a2, a3, a4) \
95({ \
96 long __res, __ign1, __ign2, __ign3, __ign4; \
97 asm volatile ( \
98 "call %[call]" \
99 : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
100 "=d" (__ign3), "=S" (__ign4) \
101 : "1" ((long)(a1)), "2" ((long)(a2)), \
102 "3" ((long)(a3)), "4" ((long)(a4)), \
103 [call] "m" (hypercall_page[__HYPERVISOR_##name]) \
104 : "memory" ); \
105 (type)__res; \
106})
107
108#define _hypercall5(type, name, a1, a2, a3, a4, a5) \
109({ \
110 long __res, __ign1, __ign2, __ign3, __ign4, __ign5; \
111 asm volatile ( \
112 "call %[call]" \
113 : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
114 "=d" (__ign3), "=S" (__ign4), "=D" (__ign5) \
115 : "1" ((long)(a1)), "2" ((long)(a2)), \
116 "3" ((long)(a3)), "4" ((long)(a4)), \
117 "5" ((long)(a5)), \
118 [call] "m" (hypercall_page[__HYPERVISOR_##name]) \
119 : "memory" ); \
120 (type)__res; \
121})
122
123static inline int
124HYPERVISOR_set_trap_table(struct trap_info *table)
125{
126 return _hypercall1(int, set_trap_table, table);
127}
128
129static inline int
130HYPERVISOR_mmu_update(struct mmu_update *req, int count,
131 int *success_count, domid_t domid)
132{
133 return _hypercall4(int, mmu_update, req, count, success_count, domid);
134}
135
136static inline int
137HYPERVISOR_mmuext_op(struct mmuext_op *op, int count,
138 int *success_count, domid_t domid)
139{
140 return _hypercall4(int, mmuext_op, op, count, success_count, domid);
141}
142
143static inline int
144HYPERVISOR_set_gdt(unsigned long *frame_list, int entries)
145{
146 return _hypercall2(int, set_gdt, frame_list, entries);
147}
148
149static inline int
150HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp)
151{
152 return _hypercall2(int, stack_switch, ss, esp);
153}
154
155static inline int
156HYPERVISOR_set_callbacks(unsigned long event_selector,
157 unsigned long event_address,
158 unsigned long failsafe_selector,
159 unsigned long failsafe_address)
160{
161 return _hypercall4(int, set_callbacks,
162 event_selector, event_address,
163 failsafe_selector, failsafe_address);
164}
165
166static inline int
167HYPERVISOR_fpu_taskswitch(int set)
168{
169 return _hypercall1(int, fpu_taskswitch, set);
170}
171
172static inline int
173HYPERVISOR_sched_op(int cmd, unsigned long arg)
174{
175 return _hypercall2(int, sched_op, cmd, arg);
176}
177
178static inline long
179HYPERVISOR_set_timer_op(u64 timeout)
180{
181 unsigned long timeout_hi = (unsigned long)(timeout>>32);
182 unsigned long timeout_lo = (unsigned long)timeout;
183 return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi);
184}
185
186static inline int
187HYPERVISOR_set_debugreg(int reg, unsigned long value)
188{
189 return _hypercall2(int, set_debugreg, reg, value);
190}
191
192static inline unsigned long
193HYPERVISOR_get_debugreg(int reg)
194{
195 return _hypercall1(unsigned long, get_debugreg, reg);
196}
197
198static inline int
199HYPERVISOR_update_descriptor(u64 ma, u64 desc)
200{
201 return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32);
202}
203
204static inline int
205HYPERVISOR_memory_op(unsigned int cmd, void *arg)
206{
207 return _hypercall2(int, memory_op, cmd, arg);
208}
209
210static inline int
211HYPERVISOR_multicall(void *call_list, int nr_calls)
212{
213 return _hypercall2(int, multicall, call_list, nr_calls);
214}
215
216static inline int
217HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
218 unsigned long flags)
219{
220 unsigned long pte_hi = 0;
221#ifdef CONFIG_X86_PAE
222 pte_hi = new_val.pte_high;
223#endif
224 return _hypercall4(int, update_va_mapping, va,
225 new_val.pte_low, pte_hi, flags);
226}
227
228static inline int
229HYPERVISOR_event_channel_op(int cmd, void *arg)
230{
231 int rc = _hypercall2(int, event_channel_op, cmd, arg);
232 if (unlikely(rc == -ENOSYS)) {
233 struct evtchn_op op;
234 op.cmd = cmd;
235 memcpy(&op.u, arg, sizeof(op.u));
236 rc = _hypercall1(int, event_channel_op_compat, &op);
237 memcpy(arg, &op.u, sizeof(op.u));
238 }
239 return rc;
240}
241
242static inline int
243HYPERVISOR_xen_version(int cmd, void *arg)
244{
245 return _hypercall2(int, xen_version, cmd, arg);
246}
247
248static inline int
249HYPERVISOR_console_io(int cmd, int count, char *str)
250{
251 return _hypercall3(int, console_io, cmd, count, str);
252}
253
254static inline int
255HYPERVISOR_physdev_op(int cmd, void *arg)
256{
257 int rc = _hypercall2(int, physdev_op, cmd, arg);
258 if (unlikely(rc == -ENOSYS)) {
259 struct physdev_op op;
260 op.cmd = cmd;
261 memcpy(&op.u, arg, sizeof(op.u));
262 rc = _hypercall1(int, physdev_op_compat, &op);
263 memcpy(arg, &op.u, sizeof(op.u));
264 }
265 return rc;
266}
267
268static inline int
269HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
270{
271 return _hypercall3(int, grant_table_op, cmd, uop, count);
272}
273
274static inline int
275HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, pte_t new_val,
276 unsigned long flags, domid_t domid)
277{
278 unsigned long pte_hi = 0;
279#ifdef CONFIG_X86_PAE
280 pte_hi = new_val.pte_high;
281#endif
282 return _hypercall5(int, update_va_mapping_otherdomain, va,
283 new_val.pte_low, pte_hi, flags, domid);
284}
285
286static inline int
287HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type)
288{
289 return _hypercall2(int, vm_assist, cmd, type);
290}
291
292static inline int
293HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args)
294{
295 return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
296}
297
298static inline int
299HYPERVISOR_suspend(unsigned long srec)
300{
301 return _hypercall3(int, sched_op, SCHEDOP_shutdown,
302 SHUTDOWN_suspend, srec);
303}
304
305static inline int
306HYPERVISOR_nmi_op(unsigned long op, unsigned long arg)
307{
308 return _hypercall2(int, nmi_op, op, arg);
309}
310
311static inline void
312MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
313 pte_t new_val, unsigned long flags)
314{
315 mcl->op = __HYPERVISOR_update_va_mapping;
316 mcl->args[0] = va;
317#ifdef CONFIG_X86_PAE
318 mcl->args[1] = new_val.pte_low;
319 mcl->args[2] = new_val.pte_high;
320#else
321 mcl->args[1] = new_val.pte_low;
322 mcl->args[2] = 0;
323#endif
324 mcl->args[3] = flags;
325}
326
327static inline void
328MULTI_grant_table_op(struct multicall_entry *mcl, unsigned int cmd,
329 void *uop, unsigned int count)
330{
331 mcl->op = __HYPERVISOR_grant_table_op;
332 mcl->args[0] = cmd;
333 mcl->args[1] = (unsigned long)uop;
334 mcl->args[2] = count;
335}
336
337static inline void
338MULTI_update_va_mapping_otherdomain(struct multicall_entry *mcl, unsigned long va,
339 pte_t new_val, unsigned long flags,
340 domid_t domid)
341{
342 mcl->op = __HYPERVISOR_update_va_mapping_otherdomain;
343 mcl->args[0] = va;
344#ifdef CONFIG_X86_PAE
345 mcl->args[1] = new_val.pte_low;
346 mcl->args[2] = new_val.pte_high;
347#else
348 mcl->args[1] = new_val.pte_low;
349 mcl->args[2] = 0;
350#endif
351 mcl->args[3] = flags;
352 mcl->args[4] = domid;
353}
354
355static inline void
356MULTI_update_descriptor(struct multicall_entry *mcl, u64 maddr,
357 struct desc_struct desc)
358{
359 mcl->op = __HYPERVISOR_update_descriptor;
360 mcl->args[0] = maddr;
361 mcl->args[1] = maddr >> 32;
362 mcl->args[2] = desc.a;
363 mcl->args[3] = desc.b;
364}
365
366static inline void
367MULTI_memory_op(struct multicall_entry *mcl, unsigned int cmd, void *arg)
368{
369 mcl->op = __HYPERVISOR_memory_op;
370 mcl->args[0] = cmd;
371 mcl->args[1] = (unsigned long)arg;
372}
373
374static inline void
375MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
376 int count, int *success_count, domid_t domid)
377{
378 mcl->op = __HYPERVISOR_mmu_update;
379 mcl->args[0] = (unsigned long)req;
380 mcl->args[1] = count;
381 mcl->args[2] = (unsigned long)success_count;
382 mcl->args[3] = domid;
383}
384
385static inline void
386MULTI_mmuext_op(struct multicall_entry *mcl, struct mmuext_op *op, int count,
387 int *success_count, domid_t domid)
388{
389 mcl->op = __HYPERVISOR_mmuext_op;
390 mcl->args[0] = (unsigned long)op;
391 mcl->args[1] = count;
392 mcl->args[2] = (unsigned long)success_count;
393 mcl->args[3] = domid;
394}
395
396static inline void
397MULTI_set_gdt(struct multicall_entry *mcl, unsigned long *frames, int entries)
398{
399 mcl->op = __HYPERVISOR_set_gdt;
400 mcl->args[0] = (unsigned long)frames;
401 mcl->args[1] = entries;
402}
403
404static inline void
405MULTI_stack_switch(struct multicall_entry *mcl,
406 unsigned long ss, unsigned long esp)
407{
408 mcl->op = __HYPERVISOR_stack_switch;
409 mcl->args[0] = ss;
410 mcl->args[1] = esp;
411}
412
413#endif /* __HYPERCALL_H__ */
diff --git a/include/asm-i386/xen/hypervisor.h b/include/asm-i386/xen/hypervisor.h
new file mode 100644
index 000000000000..8e15dd28c91f
--- /dev/null
+++ b/include/asm-i386/xen/hypervisor.h
@@ -0,0 +1,73 @@
1/******************************************************************************
2 * hypervisor.h
3 *
4 * Linux-specific hypervisor handling.
5 *
6 * Copyright (c) 2002-2004, K A Fraser
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 version 2
10 * as published by the Free Software Foundation; or, when distributed
11 * separately from the Linux kernel or incorporated into other
12 * software packages, subject to the following license:
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining a copy
15 * of this source file (the "Software"), to deal in the Software without
16 * restriction, including without limitation the rights to use, copy, modify,
17 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
18 * and to permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be included in
22 * all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30 * IN THE SOFTWARE.
31 */
32
33#ifndef __HYPERVISOR_H__
34#define __HYPERVISOR_H__
35
36#include <linux/types.h>
37#include <linux/kernel.h>
38#include <linux/version.h>
39
40#include <xen/interface/xen.h>
41#include <xen/interface/version.h>
42
43#include <asm/ptrace.h>
44#include <asm/page.h>
45#include <asm/desc.h>
46#if defined(__i386__)
47# ifdef CONFIG_X86_PAE
48# include <asm-generic/pgtable-nopud.h>
49# else
50# include <asm-generic/pgtable-nopmd.h>
51# endif
52#endif
53#include <asm/xen/hypercall.h>
54
55/* arch/i386/kernel/setup.c */
56extern struct shared_info *HYPERVISOR_shared_info;
57extern struct start_info *xen_start_info;
58#define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN)
59
60/* arch/i386/mach-xen/evtchn.c */
61/* Force a proper event-channel callback from Xen. */
62extern void force_evtchn_callback(void);
63
64/* Turn jiffies into Xen system time. */
65u64 jiffies_to_st(unsigned long jiffies);
66
67
68#define MULTI_UVMFLAGS_INDEX 3
69#define MULTI_UVMDOMID_INDEX 4
70
71#define is_running_on_xen() (xen_start_info ? 1 : 0)
72
73#endif /* __HYPERVISOR_H__ */
diff --git a/include/asm-i386/xen/interface.h b/include/asm-i386/xen/interface.h
new file mode 100644
index 000000000000..165c3968e138
--- /dev/null
+++ b/include/asm-i386/xen/interface.h
@@ -0,0 +1,188 @@
1/******************************************************************************
2 * arch-x86_32.h
3 *
4 * Guest OS interface to x86 32-bit Xen.
5 *
6 * Copyright (c) 2004, K A Fraser
7 */
8
9#ifndef __XEN_PUBLIC_ARCH_X86_32_H__
10#define __XEN_PUBLIC_ARCH_X86_32_H__
11
12#ifdef __XEN__
13#define __DEFINE_GUEST_HANDLE(name, type) \
14 typedef struct { type *p; } __guest_handle_ ## name
15#else
16#define __DEFINE_GUEST_HANDLE(name, type) \
17 typedef type * __guest_handle_ ## name
18#endif
19
20#define DEFINE_GUEST_HANDLE_STRUCT(name) \
21 __DEFINE_GUEST_HANDLE(name, struct name)
22#define DEFINE_GUEST_HANDLE(name) __DEFINE_GUEST_HANDLE(name, name)
23#define GUEST_HANDLE(name) __guest_handle_ ## name
24
25#ifndef __ASSEMBLY__
26/* Guest handles for primitive C types. */
27__DEFINE_GUEST_HANDLE(uchar, unsigned char);
28__DEFINE_GUEST_HANDLE(uint, unsigned int);
29__DEFINE_GUEST_HANDLE(ulong, unsigned long);
30DEFINE_GUEST_HANDLE(char);
31DEFINE_GUEST_HANDLE(int);
32DEFINE_GUEST_HANDLE(long);
33DEFINE_GUEST_HANDLE(void);
34#endif
35
36/*
37 * SEGMENT DESCRIPTOR TABLES
38 */
39/*
40 * A number of GDT entries are reserved by Xen. These are not situated at the
41 * start of the GDT because some stupid OSes export hard-coded selector values
42 * in their ABI. These hard-coded values are always near the start of the GDT,
43 * so Xen places itself out of the way, at the far end of the GDT.
44 */
45#define FIRST_RESERVED_GDT_PAGE 14
46#define FIRST_RESERVED_GDT_BYTE (FIRST_RESERVED_GDT_PAGE * 4096)
47#define FIRST_RESERVED_GDT_ENTRY (FIRST_RESERVED_GDT_BYTE / 8)
48
49/*
50 * These flat segments are in the Xen-private section of every GDT. Since these
51 * are also present in the initial GDT, many OSes will be able to avoid
52 * installing their own GDT.
53 */
54#define FLAT_RING1_CS 0xe019 /* GDT index 259 */
55#define FLAT_RING1_DS 0xe021 /* GDT index 260 */
56#define FLAT_RING1_SS 0xe021 /* GDT index 260 */
57#define FLAT_RING3_CS 0xe02b /* GDT index 261 */
58#define FLAT_RING3_DS 0xe033 /* GDT index 262 */
59#define FLAT_RING3_SS 0xe033 /* GDT index 262 */
60
61#define FLAT_KERNEL_CS FLAT_RING1_CS
62#define FLAT_KERNEL_DS FLAT_RING1_DS
63#define FLAT_KERNEL_SS FLAT_RING1_SS
64#define FLAT_USER_CS FLAT_RING3_CS
65#define FLAT_USER_DS FLAT_RING3_DS
66#define FLAT_USER_SS FLAT_RING3_SS
67
68/* And the trap vector is... */
69#define TRAP_INSTR "int $0x82"
70
71/*
72 * Virtual addresses beyond this are not modifiable by guest OSes. The
73 * machine->physical mapping table starts at this address, read-only.
74 */
75#ifdef CONFIG_X86_PAE
76#define __HYPERVISOR_VIRT_START 0xF5800000
77#else
78#define __HYPERVISOR_VIRT_START 0xFC000000
79#endif
80
81#ifndef HYPERVISOR_VIRT_START
82#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START)
83#endif
84
85#ifndef machine_to_phys_mapping
86#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
87#endif
88
89/* Maximum number of virtual CPUs in multi-processor guests. */
90#define MAX_VIRT_CPUS 32
91
92#ifndef __ASSEMBLY__
93
94/*
95 * Send an array of these to HYPERVISOR_set_trap_table()
96 */
97#define TI_GET_DPL(_ti) ((_ti)->flags & 3)
98#define TI_GET_IF(_ti) ((_ti)->flags & 4)
99#define TI_SET_DPL(_ti, _dpl) ((_ti)->flags |= (_dpl))
100#define TI_SET_IF(_ti, _if) ((_ti)->flags |= ((!!(_if))<<2))
101
102struct trap_info {
103 uint8_t vector; /* exception vector */
104 uint8_t flags; /* 0-3: privilege level; 4: clear event enable? */
105 uint16_t cs; /* code selector */
106 unsigned long address; /* code offset */
107};
108DEFINE_GUEST_HANDLE_STRUCT(trap_info);
109
110struct cpu_user_regs {
111 uint32_t ebx;
112 uint32_t ecx;
113 uint32_t edx;
114 uint32_t esi;
115 uint32_t edi;
116 uint32_t ebp;
117 uint32_t eax;
118 uint16_t error_code; /* private */
119 uint16_t entry_vector; /* private */
120 uint32_t eip;
121 uint16_t cs;
122 uint8_t saved_upcall_mask;
123 uint8_t _pad0;
124 uint32_t eflags; /* eflags.IF == !saved_upcall_mask */
125 uint32_t esp;
126 uint16_t ss, _pad1;
127 uint16_t es, _pad2;
128 uint16_t ds, _pad3;
129 uint16_t fs, _pad4;
130 uint16_t gs, _pad5;
131};
132DEFINE_GUEST_HANDLE_STRUCT(cpu_user_regs);
133
134typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */
135
136/*
137 * The following is all CPU context. Note that the fpu_ctxt block is filled
138 * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
139 */
140struct vcpu_guest_context {
141 /* FPU registers come first so they can be aligned for FXSAVE/FXRSTOR. */
142 struct { char x[512]; } fpu_ctxt; /* User-level FPU registers */
143#define VGCF_I387_VALID (1<<0)
144#define VGCF_HVM_GUEST (1<<1)
145#define VGCF_IN_KERNEL (1<<2)
146 unsigned long flags; /* VGCF_* flags */
147 struct cpu_user_regs user_regs; /* User-level CPU registers */
148 struct trap_info trap_ctxt[256]; /* Virtual IDT */
149 unsigned long ldt_base, ldt_ents; /* LDT (linear address, # ents) */
150 unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
151 unsigned long kernel_ss, kernel_sp; /* Virtual TSS (only SS1/SP1) */
152 unsigned long ctrlreg[8]; /* CR0-CR7 (control registers) */
153 unsigned long debugreg[8]; /* DB0-DB7 (debug registers) */
154 unsigned long event_callback_cs; /* CS:EIP of event callback */
155 unsigned long event_callback_eip;
156 unsigned long failsafe_callback_cs; /* CS:EIP of failsafe callback */
157 unsigned long failsafe_callback_eip;
158 unsigned long vm_assist; /* VMASST_TYPE_* bitmap */
159};
160DEFINE_GUEST_HANDLE_STRUCT(vcpu_guest_context);
161
162struct arch_shared_info {
163 unsigned long max_pfn; /* max pfn that appears in table */
164 /* Frame containing list of mfns containing list of mfns containing p2m. */
165 unsigned long pfn_to_mfn_frame_list_list;
166 unsigned long nmi_reason;
167};
168
169struct arch_vcpu_info {
170 unsigned long cr2;
171 unsigned long pad[5]; /* sizeof(struct vcpu_info) == 64 */
172};
173
174#endif /* !__ASSEMBLY__ */
175
176/*
177 * Prefix forces emulation of some non-trapping instructions.
178 * Currently only CPUID.
179 */
180#ifdef __ASSEMBLY__
181#define XEN_EMULATE_PREFIX .byte 0x0f,0x0b,0x78,0x65,0x6e ;
182#define XEN_CPUID XEN_EMULATE_PREFIX cpuid
183#else
184#define XEN_EMULATE_PREFIX ".byte 0x0f,0x0b,0x78,0x65,0x6e ; "
185#define XEN_CPUID XEN_EMULATE_PREFIX "cpuid"
186#endif
187
188#endif
diff --git a/include/asm-ia64/compat.h b/include/asm-ia64/compat.h
index 40d01d80610d..0f6e5264ab8f 100644
--- a/include/asm-ia64/compat.h
+++ b/include/asm-ia64/compat.h
@@ -31,8 +31,10 @@ typedef s32 compat_timer_t;
31 31
32typedef s32 compat_int_t; 32typedef s32 compat_int_t;
33typedef s32 compat_long_t; 33typedef s32 compat_long_t;
34typedef s64 __attribute__((aligned(4))) compat_s64;
34typedef u32 compat_uint_t; 35typedef u32 compat_uint_t;
35typedef u32 compat_ulong_t; 36typedef u32 compat_ulong_t;
37typedef u64 __attribute__((aligned(4))) compat_u64;
36 38
37struct compat_timespec { 39struct compat_timespec {
38 compat_time_t tv_sec; 40 compat_time_t tv_sec;
diff --git a/include/asm-ia64/fb.h b/include/asm-ia64/fb.h
new file mode 100644
index 000000000000..89a397cee90a
--- /dev/null
+++ b/include/asm-ia64/fb.h
@@ -0,0 +1,23 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <linux/efi.h>
7#include <asm/page.h>
8
9static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
10 unsigned long off)
11{
12 if (efi_range_is_wc(vma->vm_start, vma->vm_end - vma->vm_start))
13 vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
14 else
15 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
16}
17
18static inline int fb_is_primary_device(struct fb_info *info)
19{
20 return 0;
21}
22
23#endif /* _ASM_FB_H_ */
diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h
index c054d7a9aaa7..efa1b8f7251d 100644
--- a/include/asm-ia64/hw_irq.h
+++ b/include/asm-ia64/hw_irq.h
@@ -90,13 +90,27 @@ enum {
90extern __u8 isa_irq_to_vector_map[16]; 90extern __u8 isa_irq_to_vector_map[16];
91#define isa_irq_to_vector(x) isa_irq_to_vector_map[(x)] 91#define isa_irq_to_vector(x) isa_irq_to_vector_map[(x)]
92 92
93struct irq_cfg {
94 ia64_vector vector;
95 cpumask_t domain;
96};
97extern spinlock_t vector_lock;
98extern struct irq_cfg irq_cfg[NR_IRQS];
99#define irq_to_domain(x) irq_cfg[(x)].domain
100DECLARE_PER_CPU(int[IA64_NUM_VECTORS], vector_irq);
101
93extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */ 102extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */
94 103
104extern int bind_irq_vector(int irq, int vector, cpumask_t domain);
95extern int assign_irq_vector (int irq); /* allocate a free vector */ 105extern int assign_irq_vector (int irq); /* allocate a free vector */
96extern void free_irq_vector (int vector); 106extern void free_irq_vector (int vector);
97extern int reserve_irq_vector (int vector); 107extern int reserve_irq_vector (int vector);
108extern void __setup_vector_irq(int cpu);
109extern int reassign_irq_vector(int irq, int cpu);
98extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); 110extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
99extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); 111extern void register_percpu_irq (ia64_vector vec, struct irqaction *action);
112extern int check_irq_used (int irq);
113extern void destroy_and_reserve_irq (unsigned int irq);
100 114
101static inline void ia64_resend_irq(unsigned int vector) 115static inline void ia64_resend_irq(unsigned int vector)
102{ 116{
@@ -113,7 +127,7 @@ extern irq_desc_t irq_desc[NR_IRQS];
113static inline unsigned int 127static inline unsigned int
114__ia64_local_vector_to_irq (ia64_vector vec) 128__ia64_local_vector_to_irq (ia64_vector vec)
115{ 129{
116 return (unsigned int) vec; 130 return __get_cpu_var(vector_irq)[vec];
117} 131}
118#endif 132#endif
119 133
@@ -131,7 +145,7 @@ __ia64_local_vector_to_irq (ia64_vector vec)
131static inline ia64_vector 145static inline ia64_vector
132irq_to_vector (int irq) 146irq_to_vector (int irq)
133{ 147{
134 return (ia64_vector) irq; 148 return irq_cfg[irq].vector;
135} 149}
136 150
137/* 151/*
diff --git a/include/asm-ia64/ioctls.h b/include/asm-ia64/ioctls.h
index 31ee521aeb7a..f41b636a0bf6 100644
--- a/include/asm-ia64/ioctls.h
+++ b/include/asm-ia64/ioctls.h
@@ -53,6 +53,10 @@
53#define TIOCSBRK 0x5427 /* BSD compatibility */ 53#define TIOCSBRK 0x5427 /* BSD compatibility */
54#define TIOCCBRK 0x5428 /* BSD compatibility */ 54#define TIOCCBRK 0x5428 /* BSD compatibility */
55#define TIOCGSID 0x5429 /* Return the session ID of FD */ 55#define TIOCGSID 0x5429 /* Return the session ID of FD */
56#define TCGETS2 _IOR('T',0x2A, struct termios2)
57#define TCSETS2 _IOW('T',0x2B, struct termios2)
58#define TCSETSW2 _IOW('T',0x2C, struct termios2)
59#define TCSETSF2 _IOW('T',0x2D, struct termios2)
56#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 60#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
57#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 61#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
58 62
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h
index 421cb6b62a7c..b8f712859140 100644
--- a/include/asm-ia64/iosapic.h
+++ b/include/asm-ia64/iosapic.h
@@ -47,19 +47,21 @@
47#define IOSAPIC_MASK_SHIFT 16 47#define IOSAPIC_MASK_SHIFT 16
48#define IOSAPIC_MASK (1<<IOSAPIC_MASK_SHIFT) 48#define IOSAPIC_MASK (1<<IOSAPIC_MASK_SHIFT)
49 49
50#define IOSAPIC_VECTOR_MASK 0xffffff00
51
50#ifndef __ASSEMBLY__ 52#ifndef __ASSEMBLY__
51 53
52#ifdef CONFIG_IOSAPIC 54#ifdef CONFIG_IOSAPIC
53 55
54#define NR_IOSAPICS 256 56#define NR_IOSAPICS 256
55 57
56static inline unsigned int iosapic_read(char __iomem *iosapic, unsigned int reg) 58static inline unsigned int __iosapic_read(char __iomem *iosapic, unsigned int reg)
57{ 59{
58 writel(reg, iosapic + IOSAPIC_REG_SELECT); 60 writel(reg, iosapic + IOSAPIC_REG_SELECT);
59 return readl(iosapic + IOSAPIC_WINDOW); 61 return readl(iosapic + IOSAPIC_WINDOW);
60} 62}
61 63
62static inline void iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val) 64static inline void __iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val)
63{ 65{
64 writel(reg, iosapic + IOSAPIC_REG_SELECT); 66 writel(reg, iosapic + IOSAPIC_REG_SELECT);
65 writel(val, iosapic + IOSAPIC_WINDOW); 67 writel(val, iosapic + IOSAPIC_WINDOW);
diff --git a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h
index 67221615e317..35b360b82e43 100644
--- a/include/asm-ia64/irq.h
+++ b/include/asm-ia64/irq.h
@@ -14,8 +14,13 @@
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/cpumask.h> 15#include <linux/cpumask.h>
16 16
17#define NR_IRQS 256 17#define NR_VECTORS 256
18#define NR_IRQ_VECTORS NR_IRQS 18
19#if (NR_VECTORS + 32 * NR_CPUS) < 1024
20#define NR_IRQS (NR_VECTORS + 32 * NR_CPUS)
21#else
22#define NR_IRQS 1024
23#endif
19 24
20static __inline__ int 25static __inline__ int
21irq_canonicalize (int irq) 26irq_canonicalize (int irq)
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index 6382e52ec227..067d9dea68f9 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -82,8 +82,6 @@ struct kprobe_ctlblk {
82 struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ]; 82 struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ];
83}; 83};
84 84
85#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
86
87#define ARCH_SUPPORTS_KRETPROBES 85#define ARCH_SUPPORTS_KRETPROBES
88#define ARCH_INACTIVE_KPROBE_COUNT 1 86#define ARCH_INACTIVE_KPROBE_COUNT 1
89 87
diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h
index 41098f459684..edd5d01028df 100644
--- a/include/asm-ia64/mca.h
+++ b/include/asm-ia64/mca.h
@@ -48,6 +48,7 @@ enum {
48 IA64_MCA_RENDEZ_CHECKIN_NOTDONE = 0x0, 48 IA64_MCA_RENDEZ_CHECKIN_NOTDONE = 0x0,
49 IA64_MCA_RENDEZ_CHECKIN_DONE = 0x1, 49 IA64_MCA_RENDEZ_CHECKIN_DONE = 0x1,
50 IA64_MCA_RENDEZ_CHECKIN_INIT = 0x2, 50 IA64_MCA_RENDEZ_CHECKIN_INIT = 0x2,
51 IA64_MCA_RENDEZ_CHECKIN_CONCURRENT_MCA = 0x3,
51}; 52};
52 53
53/* Information maintained by the MC infrastructure */ 54/* Information maintained by the MC infrastructure */
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
index 485759ba9e36..d6345464a2b3 100644
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -87,12 +87,13 @@ do { \
87} while (0) 87} while (0)
88 88
89 89
90#define alloc_zeroed_user_highpage(vma, vaddr) \ 90#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
91({ \ 91({ \
92 struct page *page = alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr); \ 92 struct page *page = alloc_page_vma( \
93 if (page) \ 93 GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr); \
94 flush_dcache_page(page); \ 94 if (page) \
95 page; \ 95 flush_dcache_page(page); \
96 page; \
96}) 97})
97 98
98#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 99#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h
index 5a5d1c2ce39d..0149097b736d 100644
--- a/include/asm-ia64/pci.h
+++ b/include/asm-ia64/pci.h
@@ -71,14 +71,6 @@ pcibios_penalize_isa_irq (int irq, int active)
71#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ 71#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
72 (((PTR)->LEN_NAME) = (VAL)) 72 (((PTR)->LEN_NAME) = (VAL))
73 73
74/* The ia64 platform always supports 64-bit addressing. */
75#define pci_dac_dma_supported(pci_dev, mask) (1)
76#define pci_dac_page_to_dma(dev,pg,off,dir) ((dma_addr_t) page_to_bus(pg) + (off))
77#define pci_dac_dma_to_page(dev,dma_addr) (virt_to_page(bus_to_virt(dma_addr)))
78#define pci_dac_dma_to_offset(dev,dma_addr) offset_in_page(dma_addr)
79#define pci_dac_dma_sync_single_for_cpu(dev,dma_addr,len,dir) do { } while (0)
80#define pci_dac_dma_sync_single_for_device(dev,dma_addr,len,dir) do { mb(); } while (0)
81
82#ifdef CONFIG_PCI 74#ifdef CONFIG_PCI
83static inline void pci_dma_burst_advice(struct pci_dev *pdev, 75static inline void pci_dma_burst_advice(struct pci_dev *pdev,
84 enum pci_dma_burst_strategy *strat, 76 enum pci_dma_burst_strategy *strat,
@@ -104,10 +96,12 @@ extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,
104#define HAVE_PCI_LEGACY 96#define HAVE_PCI_LEGACY
105extern int pci_mmap_legacy_page_range(struct pci_bus *bus, 97extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
106 struct vm_area_struct *vma); 98 struct vm_area_struct *vma);
107extern ssize_t pci_read_legacy_io(struct kobject *kobj, char *buf, loff_t off, 99extern ssize_t pci_read_legacy_io(struct kobject *kobj,
108 size_t count); 100 struct bin_attribute *bin_attr,
109extern ssize_t pci_write_legacy_io(struct kobject *kobj, char *buf, loff_t off, 101 char *buf, loff_t off, size_t count);
110 size_t count); 102extern ssize_t pci_write_legacy_io(struct kobject *kobj,
103 struct bin_attribute *bin_attr,
104 char *buf, loff_t off, size_t count);
111extern int pci_mmap_legacy_mem(struct kobject *kobj, 105extern int pci_mmap_legacy_mem(struct kobject *kobj,
112 struct bin_attribute *attr, 106 struct bin_attribute *attr,
113 struct vm_area_struct *vma); 107 struct vm_area_struct *vma);
@@ -143,10 +137,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
143 return (pci_domain_nr(bus) != 0); 137 return (pci_domain_nr(bus) != 0);
144} 138}
145 139
146static inline void pcibios_add_platform_entries(struct pci_dev *dev)
147{
148}
149
150extern void pcibios_resource_to_bus(struct pci_dev *dev, 140extern void pcibios_resource_to_bus(struct pci_dev *dev,
151 struct pci_bus_region *region, struct resource *res); 141 struct pci_bus_region *region, struct resource *res);
152 142
diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h
index fbe5cf3ab8dc..43a7aac414e0 100644
--- a/include/asm-ia64/percpu.h
+++ b/include/asm-ia64/percpu.h
@@ -29,6 +29,16 @@
29 __attribute__((__section__(".data.percpu"))) \ 29 __attribute__((__section__(".data.percpu"))) \
30 __SMALL_ADDR_AREA __typeof__(type) per_cpu__##name 30 __SMALL_ADDR_AREA __typeof__(type) per_cpu__##name
31 31
32#ifdef CONFIG_SMP
33#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
34 __attribute__((__section__(".data.percpu.shared_aligned"))) \
35 __SMALL_ADDR_AREA __typeof__(type) per_cpu__##name \
36 ____cacheline_aligned_in_smp
37#else
38#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
39 DEFINE_PER_CPU(type, name)
40#endif
41
32/* 42/*
33 * Pretty much a literal copy of asm-generic/percpu.h, except that percpu_modcopy() is an 43 * Pretty much a literal copy of asm-generic/percpu.h, except that percpu_modcopy() is an
34 * external routine, to avoid include-hell. 44 * external routine, to avoid include-hell.
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h
index 670b706411b8..de6d01e24dd0 100644
--- a/include/asm-ia64/pgtable.h
+++ b/include/asm-ia64/pgtable.h
@@ -297,8 +297,6 @@ ia64_phys_addr_valid (unsigned long addr)
297/* 297/*
298 * The following have defined behavior only work if pte_present() is true. 298 * The following have defined behavior only work if pte_present() is true.
299 */ 299 */
300#define pte_user(pte) ((pte_val(pte) & _PAGE_PL_MASK) == _PAGE_PL_3)
301#define pte_read(pte) (((pte_val(pte) & _PAGE_AR_MASK) >> _PAGE_AR_SHIFT) < 6)
302#define pte_write(pte) ((unsigned) (((pte_val(pte) & _PAGE_AR_MASK) >> _PAGE_AR_SHIFT) - 2) <= 4) 300#define pte_write(pte) ((unsigned) (((pte_val(pte) & _PAGE_AR_MASK) >> _PAGE_AR_SHIFT) - 2) <= 4)
303#define pte_exec(pte) ((pte_val(pte) & _PAGE_AR_RX) != 0) 301#define pte_exec(pte) ((pte_val(pte) & _PAGE_AR_RX) != 0)
304#define pte_dirty(pte) ((pte_val(pte) & _PAGE_D) != 0) 302#define pte_dirty(pte) ((pte_val(pte) & _PAGE_D) != 0)
@@ -310,7 +308,6 @@ ia64_phys_addr_valid (unsigned long addr)
310 */ 308 */
311#define pte_wrprotect(pte) (__pte(pte_val(pte) & ~_PAGE_AR_RW)) 309#define pte_wrprotect(pte) (__pte(pte_val(pte) & ~_PAGE_AR_RW))
312#define pte_mkwrite(pte) (__pte(pte_val(pte) | _PAGE_AR_RW)) 310#define pte_mkwrite(pte) (__pte(pte_val(pte) | _PAGE_AR_RW))
313#define pte_mkexec(pte) (__pte(pte_val(pte) | _PAGE_AR_RX))
314#define pte_mkold(pte) (__pte(pte_val(pte) & ~_PAGE_A)) 311#define pte_mkold(pte) (__pte(pte_val(pte) & ~_PAGE_A))
315#define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_A)) 312#define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_A))
316#define pte_mkclean(pte) (__pte(pte_val(pte) & ~_PAGE_D)) 313#define pte_mkclean(pte) (__pte(pte_val(pte) & ~_PAGE_D))
@@ -398,22 +395,6 @@ ptep_test_and_clear_young (struct vm_area_struct *vma, unsigned long addr, pte_t
398#endif 395#endif
399} 396}
400 397
401static inline int
402ptep_test_and_clear_dirty (struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
403{
404#ifdef CONFIG_SMP
405 if (!pte_dirty(*ptep))
406 return 0;
407 return test_and_clear_bit(_PAGE_D_BIT, ptep);
408#else
409 pte_t pte = *ptep;
410 if (!pte_dirty(pte))
411 return 0;
412 set_pte_at(vma->vm_mm, addr, ptep, pte_mkclean(pte));
413 return 1;
414#endif
415}
416
417static inline pte_t 398static inline pte_t
418ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 399ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
419{ 400{
@@ -533,16 +514,25 @@ extern void lazy_mmu_prot_update (pte_t pte);
533 * daccess_bit in ivt.S). 514 * daccess_bit in ivt.S).
534 */ 515 */
535#ifdef CONFIG_SMP 516#ifdef CONFIG_SMP
536# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \ 517# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \
537do { \ 518({ \
538 if (__safely_writable) { \ 519 int __changed = !pte_same(*(__ptep), __entry); \
539 set_pte(__ptep, __entry); \ 520 if (__changed && __safely_writable) { \
540 flush_tlb_page(__vma, __addr); \ 521 set_pte(__ptep, __entry); \
541 } \ 522 flush_tlb_page(__vma, __addr); \
542} while (0) 523 } \
524 __changed; \
525})
543#else 526#else
544# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \ 527# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \
545 ptep_establish(__vma, __addr, __ptep, __entry) 528({ \
529 int __changed = !pte_same(*(__ptep), __entry); \
530 if (__changed) { \
531 set_pte_at((__vma)->vm_mm, (__addr), __ptep, __entry); \
532 flush_tlb_page(__vma, __addr); \
533 } \
534 __changed; \
535})
546#endif 536#endif
547 537
548# ifdef CONFIG_VIRTUAL_MEM_MAP 538# ifdef CONFIG_VIRTUAL_MEM_MAP
@@ -584,7 +574,6 @@ do { \
584#endif 574#endif
585 575
586#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 576#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
587#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
588#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 577#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
589#define __HAVE_ARCH_PTEP_SET_WRPROTECT 578#define __HAVE_ARCH_PTEP_SET_WRPROTECT
590#define __HAVE_ARCH_PTE_SAME 579#define __HAVE_ARCH_PTE_SAME
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index db81ba406cef..6251c76437d2 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -295,9 +295,9 @@ struct thread_struct {
295 regs->ar_bspstore = current->thread.rbs_bot; \ 295 regs->ar_bspstore = current->thread.rbs_bot; \
296 regs->ar_fpsr = FPSR_DEFAULT; \ 296 regs->ar_fpsr = FPSR_DEFAULT; \
297 regs->loadrs = 0; \ 297 regs->loadrs = 0; \
298 regs->r8 = current->mm->dumpable; /* set "don't zap registers" flag */ \ 298 regs->r8 = get_dumpable(current->mm); /* set "don't zap registers" flag */ \
299 regs->r12 = new_sp - 16; /* allocate 16 byte scratch area */ \ 299 regs->r12 = new_sp - 16; /* allocate 16 byte scratch area */ \
300 if (unlikely(!current->mm->dumpable)) { \ 300 if (unlikely(!get_dumpable(current->mm))) { \
301 /* \ 301 /* \
302 * Zap scratch regs to avoid leaking bits between processes with different \ 302 * Zap scratch regs to avoid leaking bits between processes with different \
303 * uid/privileges. \ 303 * uid/privileges. \
diff --git a/include/asm-ia64/rwsem.h b/include/asm-ia64/rwsem.h
index 2d1640cc240a..8aba06a7b038 100644
--- a/include/asm-ia64/rwsem.h
+++ b/include/asm-ia64/rwsem.h
@@ -21,6 +21,10 @@
21#ifndef _ASM_IA64_RWSEM_H 21#ifndef _ASM_IA64_RWSEM_H
22#define _ASM_IA64_RWSEM_H 22#define _ASM_IA64_RWSEM_H
23 23
24#ifndef _LINUX_RWSEM_H
25#error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead."
26#endif
27
24#include <linux/list.h> 28#include <linux/list.h>
25#include <linux/spinlock.h> 29#include <linux/spinlock.h>
26 30
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index 291e8ceed6e6..676b31a08c61 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -32,6 +32,7 @@
32#define SN_SAL_NO_FAULT_ZONE_VIRTUAL 0x02000010 32#define SN_SAL_NO_FAULT_ZONE_VIRTUAL 0x02000010
33#define SN_SAL_NO_FAULT_ZONE_PHYSICAL 0x02000011 33#define SN_SAL_NO_FAULT_ZONE_PHYSICAL 0x02000011
34#define SN_SAL_PRINT_ERROR 0x02000012 34#define SN_SAL_PRINT_ERROR 0x02000012
35#define SN_SAL_REGISTER_PMI_HANDLER 0x02000014
35#define SN_SAL_SET_ERROR_HANDLING_FEATURES 0x0200001a // reentrant 36#define SN_SAL_SET_ERROR_HANDLING_FEATURES 0x0200001a // reentrant
36#define SN_SAL_GET_FIT_COMPT 0x0200001b // reentrant 37#define SN_SAL_GET_FIT_COMPT 0x0200001b // reentrant
37#define SN_SAL_GET_SAPIC_INFO 0x0200001d 38#define SN_SAL_GET_SAPIC_INFO 0x0200001d
@@ -680,6 +681,25 @@ sn_register_nofault_code(u64 start_addr, u64 end_addr, u64 return_addr,
680} 681}
681 682
682/* 683/*
684 * Register or unregister a function to handle a PMI received by a CPU.
685 * Before calling the registered handler, SAL sets r1 to the value that
686 * was passed in as the global_pointer.
687 *
688 * If the handler pointer is NULL, then the currently registered handler
689 * will be unregistered.
690 *
691 * Returns 0 on success, or a negative value if an error occurred.
692 */
693static inline int
694sn_register_pmi_handler(u64 handler, u64 global_pointer)
695{
696 struct ia64_sal_retval ret_stuff;
697 ia64_sal_oemcall(&ret_stuff, SN_SAL_REGISTER_PMI_HANDLER, handler,
698 global_pointer, 0, 0, 0, 0, 0);
699 return ret_stuff.status;
700}
701
702/*
683 * Change or query the coherence domain for this partition. Each cpu-based 703 * Change or query the coherence domain for this partition. Each cpu-based
684 * nasid is represented by a bit in an array of 64-bit words: 704 * nasid is represented by a bit in an array of 64-bit words:
685 * 0 = not in this partition's coherency domain 705 * 0 = not in this partition's coherency domain
@@ -696,8 +716,8 @@ static inline int
696sn_change_coherence(u64 *new_domain, u64 *old_domain) 716sn_change_coherence(u64 *new_domain, u64 *old_domain)
697{ 717{
698 struct ia64_sal_retval ret_stuff; 718 struct ia64_sal_retval ret_stuff;
699 ia64_sal_oemcall(&ret_stuff, SN_SAL_COHERENCE, (u64)new_domain, 719 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_COHERENCE, (u64)new_domain,
700 (u64)old_domain, 0, 0, 0, 0, 0); 720 (u64)old_domain, 0, 0, 0, 0, 0);
701 return ret_stuff.status; 721 return ret_stuff.status;
702} 722}
703 723
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index 384fbf7f2a0f..91bb8e00066c 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -259,7 +259,6 @@ extern void ia64_load_extra (struct task_struct *task);
259#define ia64_platform_is(x) (strcmp(x, platform_name) == 0) 259#define ia64_platform_is(x) (strcmp(x, platform_name) == 0)
260 260
261void cpu_idle_wait(void); 261void cpu_idle_wait(void);
262void sched_cacheflush(void);
263 262
264#define arch_align_stack(x) (x) 263#define arch_align_stack(x) (x)
265 264
diff --git a/include/asm-ia64/termbits.h b/include/asm-ia64/termbits.h
index 4531a511bde5..9f162e0089ad 100644
--- a/include/asm-ia64/termbits.h
+++ b/include/asm-ia64/termbits.h
@@ -26,6 +26,17 @@ struct termios {
26 cc_t c_cc[NCCS]; /* control characters */ 26 cc_t c_cc[NCCS]; /* control characters */
27}; 27};
28 28
29struct termios2 {
30 tcflag_t c_iflag; /* input mode flags */
31 tcflag_t c_oflag; /* output mode flags */
32 tcflag_t c_cflag; /* control mode flags */
33 tcflag_t c_lflag; /* local mode flags */
34 cc_t c_line; /* line discipline */
35 cc_t c_cc[NCCS]; /* control characters */
36 speed_t c_ispeed; /* input speed */
37 speed_t c_ospeed; /* output speed */
38};
39
29struct ktermios { 40struct ktermios {
30 tcflag_t c_iflag; /* input mode flags */ 41 tcflag_t c_iflag; /* input mode flags */
31 tcflag_t c_oflag; /* output mode flags */ 42 tcflag_t c_oflag; /* output mode flags */
@@ -138,6 +149,7 @@ struct ktermios {
138#define HUPCL 0002000 149#define HUPCL 0002000
139#define CLOCAL 0004000 150#define CLOCAL 0004000
140#define CBAUDEX 0010000 151#define CBAUDEX 0010000
152#define BOTHER 0010000
141#define B57600 0010001 153#define B57600 0010001
142#define B115200 0010002 154#define B115200 0010002
143#define B230400 0010003 155#define B230400 0010003
@@ -153,10 +165,12 @@ struct ktermios {
153#define B3000000 0010015 165#define B3000000 0010015
154#define B3500000 0010016 166#define B3500000 0010016
155#define B4000000 0010017 167#define B4000000 0010017
156#define CIBAUD 002003600000 /* input baud rate (not used) */ 168#define CIBAUD 002003600000 /* input baud rate */
157#define CMSPAR 010000000000 /* mark or space (stick) parity */ 169#define CMSPAR 010000000000 /* mark or space (stick) parity */
158#define CRTSCTS 020000000000 /* flow control */ 170#define CRTSCTS 020000000000 /* flow control */
159 171
172#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
173
160/* c_lflag bits */ 174/* c_lflag bits */
161#define ISIG 0000001 175#define ISIG 0000001
162#define ICANON 0000002 176#define ICANON 0000002
diff --git a/include/asm-ia64/termios.h b/include/asm-ia64/termios.h
index 08750c2d3607..689d218c0c28 100644
--- a/include/asm-ia64/termios.h
+++ b/include/asm-ia64/termios.h
@@ -87,8 +87,10 @@ struct termio {
87 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 87 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
88}) 88})
89 89
90#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) 90#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
91#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) 91#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
92#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
93#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
92 94
93# endif /* __KERNEL__ */ 95# endif /* __KERNEL__ */
94 96
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index 441c9e001776..315f8de950a2 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -292,7 +292,7 @@
292#define __NR_sync_file_range 1300 292#define __NR_sync_file_range 1300
293#define __NR_tee 1301 293#define __NR_tee 1301
294#define __NR_vmsplice 1302 294#define __NR_vmsplice 1302
295/* 1303 reserved for move_pages */ 295#define __NR_fallocate 1303
296#define __NR_getcpu 1304 296#define __NR_getcpu 1304
297#define __NR_epoll_pwait 1305 297#define __NR_epoll_pwait 1305
298#define __NR_utimensat 1306 298#define __NR_utimensat 1306
diff --git a/include/asm-ia64/ustack.h b/include/asm-ia64/ustack.h
index a349467913ea..504167c35b8b 100644
--- a/include/asm-ia64/ustack.h
+++ b/include/asm-ia64/ustack.h
@@ -11,6 +11,7 @@
11/* The absolute hard limit for stack size is 1/2 of the mappable space in the region */ 11/* The absolute hard limit for stack size is 1/2 of the mappable space in the region */
12#define MAX_USER_STACK_SIZE (RGN_MAP_LIMIT/2) 12#define MAX_USER_STACK_SIZE (RGN_MAP_LIMIT/2)
13#define STACK_TOP (0x6000000000000000UL + RGN_MAP_LIMIT) 13#define STACK_TOP (0x6000000000000000UL + RGN_MAP_LIMIT)
14#define STACK_TOP_MAX STACK_TOP
14#endif 15#endif
15 16
16/* Make a default stack size of 2GiB */ 17/* Make a default stack size of 2GiB */
diff --git a/include/asm-m32r/a.out.h b/include/asm-m32r/a.out.h
index 9a4a5d20160a..6a1b5d42f328 100644
--- a/include/asm-m32r/a.out.h
+++ b/include/asm-m32r/a.out.h
@@ -20,6 +20,7 @@ struct exec
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#define STACK_TOP TASK_SIZE 22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
23 24
24#endif 25#endif
25 26
diff --git a/include/asm-m32r/dma-mapping.h b/include/asm-m32r/dma-mapping.h
deleted file mode 100644
index f9b58ebba361..000000000000
--- a/include/asm-m32r/dma-mapping.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _ASM_M32R_DMA_MAPPING_H
2#define _ASM_M32R_DMA_MAPPING_H
3
4#include <asm-generic/dma-mapping-broken.h>
5
6#endif /* _ASM_M32R_DMA_MAPPING_H */
diff --git a/include/asm-m32r/fb.h b/include/asm-m32r/fb.h
new file mode 100644
index 000000000000..d92e99cd8c8a
--- /dev/null
+++ b/include/asm-m32r/fb.h
@@ -0,0 +1,19 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7
8static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
9 unsigned long off)
10{
11 vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
12}
13
14static inline int fb_is_primary_device(struct fb_info *info)
15{
16 return 0;
17}
18
19#endif /* _ASM_FB_H_ */
diff --git a/include/asm-m32r/ioctls.h b/include/asm-m32r/ioctls.h
index d23cfc45738a..b9f54bb5d7cf 100644
--- a/include/asm-m32r/ioctls.h
+++ b/include/asm-m32r/ioctls.h
@@ -47,6 +47,10 @@
47#define TIOCSBRK 0x5427 /* BSD compatibility */ 47#define TIOCSBRK 0x5427 /* BSD compatibility */
48#define TIOCCBRK 0x5428 /* BSD compatibility */ 48#define TIOCCBRK 0x5428 /* BSD compatibility */
49#define TIOCGSID 0x5429 /* Return the session ID of FD */ 49#define TIOCGSID 0x5429 /* Return the session ID of FD */
50#define TCGETS2 _IOR('T',0x2A, struct termios2)
51#define TCSETS2 _IOW('T',0x2B, struct termios2)
52#define TCSETSW2 _IOW('T',0x2C, struct termios2)
53#define TCSETSF2 _IOW('T',0x2D, struct termios2)
50#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
51#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
52 56
diff --git a/include/asm-m32r/page.h b/include/asm-m32r/page.h
index 6f6ecf7d14a3..04fd183a2c58 100644
--- a/include/asm-m32r/page.h
+++ b/include/asm-m32r/page.h
@@ -15,7 +15,8 @@ extern void copy_page(void *to, void *from);
15#define clear_user_page(page, vaddr, pg) clear_page(page) 15#define clear_user_page(page, vaddr, pg) clear_page(page)
16#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 16#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
17 17
18#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) 18#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
19 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
19#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 20#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
20 21
21/* 22/*
diff --git a/include/asm-m32r/pgtable.h b/include/asm-m32r/pgtable.h
index 6604303fc47c..92d7266783fd 100644
--- a/include/asm-m32r/pgtable.h
+++ b/include/asm-m32r/pgtable.h
@@ -191,16 +191,6 @@ extern unsigned long empty_zero_page[1024];
191 * The following only work if pte_present() is true. 191 * The following only work if pte_present() is true.
192 * Undefined behaviour if not.. 192 * Undefined behaviour if not..
193 */ 193 */
194static inline int pte_read(pte_t pte)
195{
196 return pte_val(pte) & _PAGE_READ;
197}
198
199static inline int pte_exec(pte_t pte)
200{
201 return pte_val(pte) & _PAGE_EXEC;
202}
203
204static inline int pte_dirty(pte_t pte) 194static inline int pte_dirty(pte_t pte)
205{ 195{
206 return pte_val(pte) & _PAGE_DIRTY; 196 return pte_val(pte) & _PAGE_DIRTY;
@@ -224,18 +214,6 @@ static inline int pte_file(pte_t pte)
224 return pte_val(pte) & _PAGE_FILE; 214 return pte_val(pte) & _PAGE_FILE;
225} 215}
226 216
227static inline pte_t pte_rdprotect(pte_t pte)
228{
229 pte_val(pte) &= ~_PAGE_READ;
230 return pte;
231}
232
233static inline pte_t pte_exprotect(pte_t pte)
234{
235 pte_val(pte) &= ~_PAGE_EXEC;
236 return pte;
237}
238
239static inline pte_t pte_mkclean(pte_t pte) 217static inline pte_t pte_mkclean(pte_t pte)
240{ 218{
241 pte_val(pte) &= ~_PAGE_DIRTY; 219 pte_val(pte) &= ~_PAGE_DIRTY;
@@ -254,18 +232,6 @@ static inline pte_t pte_wrprotect(pte_t pte)
254 return pte; 232 return pte;
255} 233}
256 234
257static inline pte_t pte_mkread(pte_t pte)
258{
259 pte_val(pte) |= _PAGE_READ;
260 return pte;
261}
262
263static inline pte_t pte_mkexec(pte_t pte)
264{
265 pte_val(pte) |= _PAGE_EXEC;
266 return pte;
267}
268
269static inline pte_t pte_mkdirty(pte_t pte) 235static inline pte_t pte_mkdirty(pte_t pte)
270{ 236{
271 pte_val(pte) |= _PAGE_DIRTY; 237 pte_val(pte) |= _PAGE_DIRTY;
@@ -284,11 +250,6 @@ static inline pte_t pte_mkwrite(pte_t pte)
284 return pte; 250 return pte;
285} 251}
286 252
287static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
288{
289 return test_and_clear_bit(_PAGE_BIT_DIRTY, ptep);
290}
291
292static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) 253static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
293{ 254{
294 return test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep); 255 return test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep);
@@ -382,7 +343,6 @@ static inline void pmd_set(pmd_t * pmdp, pte_t * ptep)
382 remap_pfn_range(vma, vaddr, pfn, size, prot) 343 remap_pfn_range(vma, vaddr, pfn, size, prot)
383 344
384#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 345#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
385#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
386#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 346#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
387#define __HAVE_ARCH_PTEP_SET_WRPROTECT 347#define __HAVE_ARCH_PTEP_SET_WRPROTECT
388#define __HAVE_ARCH_PTE_SAME 348#define __HAVE_ARCH_PTE_SAME
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h
index 8ee73d3f316d..2365de5c2955 100644
--- a/include/asm-m32r/system.h
+++ b/include/asm-m32r/system.h
@@ -54,16 +54,6 @@
54 ); \ 54 ); \
55} while(0) 55} while(0)
56 56
57/*
58 * On SMP systems, when the scheduler does migration-cost autodetection,
59 * it needs a way to flush as much of the CPU's caches as possible.
60 *
61 * TODO: fill this in!
62 */
63static inline void sched_cacheflush(void)
64{
65}
66
67/* Interrupt Control */ 57/* Interrupt Control */
68#if !defined(CONFIG_CHIP_M32102) && !defined(CONFIG_CHIP_M32104) 58#if !defined(CONFIG_CHIP_M32102) && !defined(CONFIG_CHIP_M32104)
69#define local_irq_enable() \ 59#define local_irq_enable() \
diff --git a/include/asm-m32r/termbits.h b/include/asm-m32r/termbits.h
index e402641dfbad..bc104008b55b 100644
--- a/include/asm-m32r/termbits.h
+++ b/include/asm-m32r/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct termios2 {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20struct ktermios { 31struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */ 32 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */ 33 tcflag_t c_oflag; /* output mode flags */
@@ -129,6 +140,7 @@ struct ktermios {
129#define HUPCL 0002000 140#define HUPCL 0002000
130#define CLOCAL 0004000 141#define CLOCAL 0004000
131#define CBAUDEX 0010000 142#define CBAUDEX 0010000
143#define BOTHER 0010000
132#define B57600 0010001 144#define B57600 0010001
133#define B115200 0010002 145#define B115200 0010002
134#define B230400 0010003 146#define B230400 0010003
@@ -144,11 +156,13 @@ struct ktermios {
144#define B3000000 0010015 156#define B3000000 0010015
145#define B3500000 0010016 157#define B3500000 0010016
146#define B4000000 0010017 158#define B4000000 0010017
147#define CIBAUD 002003600000 /* input baud rate (not used) */ 159#define CIBAUD 002003600000 /** input baud rate */
148#define CTVB 004000000000 /* VisioBraille Terminal flow control */ 160#define CTVB 004000000000 /* VisioBraille Terminal flow control */
149#define CMSPAR 010000000000 /* mark or space (stick) parity */ 161#define CMSPAR 010000000000 /* mark or space (stick) parity */
150#define CRTSCTS 020000000000 /* flow control */ 162#define CRTSCTS 020000000000 /* flow control */
151 163
164#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
165
152/* c_lflag bits */ 166/* c_lflag bits */
153#define ISIG 0000001 167#define ISIG 0000001
154#define ICANON 0000002 168#define ICANON 0000002
diff --git a/include/asm-m32r/termios.h b/include/asm-m32r/termios.h
index 4943dd8db44d..93ce79fd342a 100644
--- a/include/asm-m32r/termios.h
+++ b/include/asm-m32r/termios.h
@@ -81,8 +81,10 @@ struct termio {
81 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 81 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
82}) 82})
83 83
84#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) 84#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
85#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) 85#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
86#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
87#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
86 88
87#endif /* __KERNEL__ */ 89#endif /* __KERNEL__ */
88 90
diff --git a/include/asm-m68k/a.out.h b/include/asm-m68k/a.out.h
index eda1662773b8..6fc86a221a94 100644
--- a/include/asm-m68k/a.out.h
+++ b/include/asm-m68k/a.out.h
@@ -20,6 +20,7 @@ struct exec
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#define STACK_TOP TASK_SIZE 22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
23 24
24#endif 25#endif
25 26
diff --git a/include/asm-m68k/atari_SLM.h b/include/asm-m68k/atari_SLM.h
deleted file mode 100644
index 42f4fcdd8bc7..000000000000
--- a/include/asm-m68k/atari_SLM.h
+++ /dev/null
@@ -1,28 +0,0 @@
1
2#ifndef _ATARI_SLM_H
3#define _ATARI_SLM_H
4
5/* Atari SLM laser printer specific ioctls */
6
7#define SLMIOGSTAT 0xa100
8#define SLMIOGPSIZE 0xa101
9#define SLMIOGMFEED 0xa102
10
11#define SLMIORESET 0xa140
12
13#define SLMIOSPSIZE 0xa181
14#define SLMIOSMFEED 0xa182
15
16/* Status returning structure (SLMIOGSTAT) */
17struct SLM_status {
18 int stat; /* numeric status code */
19 char str[40]; /* status string */
20};
21
22/* Paper size structure (SLMIO[GS]PSIZE) */
23struct SLM_paper_size {
24 int width;
25 int height;
26};
27
28#endif /* _ATARI_SLM_H */
diff --git a/include/asm-m68k/atari_acsi.h b/include/asm-m68k/atari_acsi.h
deleted file mode 100644
index 10fea68f191a..000000000000
--- a/include/asm-m68k/atari_acsi.h
+++ /dev/null
@@ -1,37 +0,0 @@
1#ifndef _ASM_ATARI_ACSI_H
2#define _ASM_ATARI_ACSI_H
3
4/* Functions exported by drivers/block/acsi.c */
5
6void acsi_delay_start( void );
7void acsi_delay_end( long usec );
8int acsi_wait_for_IRQ( unsigned timeout );
9int acsi_wait_for_noIRQ( unsigned timeout );
10int acsicmd_nodma( const char *cmd, int enable);
11int acsi_getstatus( void );
12int acsi_extstatus( char *buffer, int cnt );
13void acsi_end_extstatus( void );
14int acsi_extcmd( unsigned char *buffer, int cnt );
15
16/* The ACSI buffer is guarantueed to reside in ST-RAM and may be used by other
17 * drivers that work on the ACSI bus, too. It's data are valid only as long as
18 * the ST-DMA is locked. */
19extern char *acsi_buffer;
20extern unsigned long phys_acsi_buffer;
21
22/* Utility macros */
23
24/* Send one data byte over the bus and set mode for next operation
25 * with one move.l -- Atari recommends this...
26 */
27
28#define DMA_LONG_WRITE(data,mode) \
29 do { \
30 *((unsigned long *)&dma_wd.fdc_acces_seccount) = \
31 ((data)<<16) | (mode); \
32 } while(0)
33
34#define ENABLE_IRQ() atari_turnon_irq( IRQ_MFP_ACSI )
35#define DISABLE_IRQ() atari_turnoff_irq( IRQ_MFP_ACSI )
36
37#endif /* _ASM_ATARI_ACSI_H */
diff --git a/include/asm-m68k/fb.h b/include/asm-m68k/fb.h
new file mode 100644
index 000000000000..380b97ae8157
--- /dev/null
+++ b/include/asm-m68k/fb.h
@@ -0,0 +1,34 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7#include <asm/setup.h>
8
9#ifdef CONFIG_SUN3
10static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
11 unsigned long off)
12{
13 pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE;
14}
15#else
16static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
17 unsigned long off)
18{
19 if (CPU_IS_020_OR_030)
20 pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030;
21 if (CPU_IS_040_OR_060) {
22 pgprot_val(vma->vm_page_prot) &= _CACHEMASK040;
23 /* Use no-cache mode, serialized */
24 pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S;
25 }
26}
27#endif /* CONFIG_SUN3 */
28
29static inline int fb_is_primary_device(struct fb_info *info)
30{
31 return 0;
32}
33
34#endif /* _ASM_FB_H_ */
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h
index 5e0fcf41804d..47bb9cf107b7 100644
--- a/include/asm-m68k/io.h
+++ b/include/asm-m68k/io.h
@@ -27,6 +27,7 @@
27#include <asm/raw_io.h> 27#include <asm/raw_io.h>
28#include <asm/virtconvert.h> 28#include <asm/virtconvert.h>
29 29
30#include <asm-generic/iomap.h>
30 31
31#ifdef CONFIG_ATARI 32#ifdef CONFIG_ATARI
32#include <asm/atarihw.h> 33#include <asm/atarihw.h>
@@ -152,6 +153,16 @@ static inline u16 __iomem *isa_itw(unsigned long addr)
152 default: return NULL; /* avoid warnings, just in case */ 153 default: return NULL; /* avoid warnings, just in case */
153 } 154 }
154} 155}
156static inline u32 __iomem *isa_itl(unsigned long addr)
157{
158 switch(ISA_TYPE)
159 {
160#ifdef CONFIG_AMIGA_PCMCIA
161 case AG_ISA: return (u32 __iomem *)AG_ISA_IO_W(addr);
162#endif
163 default: return 0; /* avoid warnings, just in case */
164 }
165}
155static inline u8 __iomem *isa_mtb(unsigned long addr) 166static inline u8 __iomem *isa_mtb(unsigned long addr)
156{ 167{
157 switch(ISA_TYPE) 168 switch(ISA_TYPE)
@@ -188,8 +199,10 @@ static inline u16 __iomem *isa_mtw(unsigned long addr)
188 199
189#define isa_inb(port) in_8(isa_itb(port)) 200#define isa_inb(port) in_8(isa_itb(port))
190#define isa_inw(port) (ISA_SEX ? in_be16(isa_itw(port)) : in_le16(isa_itw(port))) 201#define isa_inw(port) (ISA_SEX ? in_be16(isa_itw(port)) : in_le16(isa_itw(port)))
202#define isa_inl(port) (ISA_SEX ? in_be32(isa_itl(port)) : in_le32(isa_itl(port)))
191#define isa_outb(val,port) out_8(isa_itb(port),(val)) 203#define isa_outb(val,port) out_8(isa_itb(port),(val))
192#define isa_outw(val,port) (ISA_SEX ? out_be16(isa_itw(port),(val)) : out_le16(isa_itw(port),(val))) 204#define isa_outw(val,port) (ISA_SEX ? out_be16(isa_itw(port),(val)) : out_le16(isa_itw(port),(val)))
205#define isa_outl(val,port) (ISA_SEX ? out_be32(isa_itl(port),(val)) : out_le32(isa_itl(port),(val)))
193 206
194#define isa_readb(p) in_8(isa_mtb((unsigned long)(p))) 207#define isa_readb(p) in_8(isa_mtb((unsigned long)(p)))
195#define isa_readw(p) \ 208#define isa_readw(p) \
@@ -234,6 +247,15 @@ static inline void isa_delay(void)
234#define isa_outsw(port, buf, nr) \ 247#define isa_outsw(port, buf, nr) \
235 (ISA_SEX ? raw_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \ 248 (ISA_SEX ? raw_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \
236 raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr))) 249 raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
250
251#define isa_insl(port, buf, nr) \
252 (ISA_SEX ? raw_insl(isa_itl(port), (u32 *)(buf), (nr)) : \
253 raw_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
254
255#define isa_outsl(port, buf, nr) \
256 (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) : \
257 raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
258
237#endif /* CONFIG_ISA */ 259#endif /* CONFIG_ISA */
238 260
239 261
@@ -246,14 +268,16 @@ static inline void isa_delay(void)
246#define inw_p isa_inw_p 268#define inw_p isa_inw_p
247#define outw isa_outw 269#define outw isa_outw
248#define outw_p isa_outw_p 270#define outw_p isa_outw_p
249#define inl isa_inw 271#define inl isa_inl
250#define inl_p isa_inw_p 272#define inl_p isa_inl_p
251#define outl isa_outw 273#define outl isa_outl
252#define outl_p isa_outw_p 274#define outl_p isa_outl_p
253#define insb isa_insb 275#define insb isa_insb
254#define insw isa_insw 276#define insw isa_insw
277#define insl isa_insl
255#define outsb isa_outsb 278#define outsb isa_outsb
256#define outsw isa_outsw 279#define outsw isa_outsw
280#define outsl isa_outsl
257#define readb isa_readb 281#define readb isa_readb
258#define readw isa_readw 282#define readw isa_readw
259#define writeb isa_writeb 283#define writeb isa_writeb
@@ -262,8 +286,6 @@ static inline void isa_delay(void)
262 286
263#if defined(CONFIG_PCI) 287#if defined(CONFIG_PCI)
264 288
265#define inl(port) in_le32(port)
266#define outl(val,port) out_le32((port),(val))
267#define readl(addr) in_le32(addr) 289#define readl(addr) in_le32(addr)
268#define writel(val,addr) out_le32((addr),(val)) 290#define writel(val,addr) out_le32((addr),(val))
269 291
@@ -282,6 +304,8 @@ static inline void isa_delay(void)
282#define outb(val,port) out_8((port),(val)) 304#define outb(val,port) out_8((port),(val))
283#define inw(port) in_le16(port) 305#define inw(port) in_le16(port)
284#define outw(val,port) out_le16((port),(val)) 306#define outw(val,port) out_le16((port),(val))
307#define inl(port) in_le32(port)
308#define outl(val,port) out_le32((port),(val))
285 309
286#else 310#else
287/* 311/*
@@ -306,20 +330,35 @@ static inline void isa_delay(void)
306#endif 330#endif
307#endif /* CONFIG_PCI */ 331#endif /* CONFIG_PCI */
308 332
309#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI) && defined(CONFIG_HP300) 333#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI)
310/* 334/*
311 * We need to define dummy functions otherwise drivers/serial/8250.c doesn't link 335 * We need to define dummy functions for GENERIC_IOMAP support.
312 */ 336 */
313#define inb(port) 0xff 337#define inb(port) 0xff
314#define inb_p(port) 0xff 338#define inb_p(port) 0xff
315#define outb(val,port) do { } while (0) 339#define outb(val,port) ((void)0)
316#define outb_p(val,port) do { } while (0) 340#define outb_p(val,port) ((void)0)
341#define inw(port) 0xffff
342#define outw(val,port) ((void)0)
343#define inl(port) 0xffffffffUL
344#define outl(val,port) ((void)0)
345
346#define insb(port,buf,nr) ((void)0)
347#define outsb(port,buf,nr) ((void)0)
348#define insw(port,buf,nr) ((void)0)
349#define outsw(port,buf,nr) ((void)0)
350#define insl(port,buf,nr) ((void)0)
351#define outsl(port,buf,nr) ((void)0)
317 352
318/* 353/*
319 * These should be valid on any ioremap()ed region 354 * These should be valid on any ioremap()ed region
320 */ 355 */
321#define readb(addr) in_8(addr) 356#define readb(addr) in_8(addr)
322#define writeb(val,addr) out_8((addr),(val)) 357#define writeb(val,addr) out_8((addr),(val))
358#define readw(addr) in_le16(addr)
359#define writew(val,addr) out_le16((addr),(val))
360#endif
361#if !defined(CONFIG_PCI)
323#define readl(addr) in_le32(addr) 362#define readl(addr) in_le32(addr)
324#define writel(val,addr) out_le32((addr),(val)) 363#define writel(val,addr) out_le32((addr),(val))
325#endif 364#endif
@@ -351,6 +390,18 @@ extern void dma_cache_wback_inv(unsigned long start, unsigned long size);
351extern void dma_cache_wback(unsigned long start, unsigned long size); 390extern void dma_cache_wback(unsigned long start, unsigned long size);
352extern void dma_cache_inv(unsigned long start, unsigned long size); 391extern void dma_cache_inv(unsigned long start, unsigned long size);
353 392
393static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count)
394{
395 __builtin_memset((void __force *) addr, val, count);
396}
397static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
398{
399 __builtin_memcpy(dst, (void __force *) src, count);
400}
401static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count)
402{
403 __builtin_memcpy((void __force *) dst, src, count);
404}
354 405
355#ifndef CONFIG_SUN3 406#ifndef CONFIG_SUN3
356#define IO_SPACE_LIMIT 0xffff 407#define IO_SPACE_LIMIT 0xffff
diff --git a/include/asm-m68k/motorola_pgtable.h b/include/asm-m68k/motorola_pgtable.h
index b5b78c01eb6c..d029b75bcf04 100644
--- a/include/asm-m68k/motorola_pgtable.h
+++ b/include/asm-m68k/motorola_pgtable.h
@@ -164,21 +164,15 @@ static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)
164 * The following only work if pte_present() is true. 164 * The following only work if pte_present() is true.
165 * Undefined behaviour if not.. 165 * Undefined behaviour if not..
166 */ 166 */
167static inline int pte_read(pte_t pte) { return 1; }
168static inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_RONLY); } 167static inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_RONLY); }
169static inline int pte_exec(pte_t pte) { return 1; }
170static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } 168static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
171static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 169static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
172static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 170static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
173 171
174static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_RONLY; return pte; } 172static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_RONLY; return pte; }
175static inline pte_t pte_rdprotect(pte_t pte) { return pte; }
176static inline pte_t pte_exprotect(pte_t pte) { return pte; }
177static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; } 173static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
178static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } 174static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
179static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) &= ~_PAGE_RONLY; return pte; } 175static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) &= ~_PAGE_RONLY; return pte; }
180static inline pte_t pte_mkread(pte_t pte) { return pte; }
181static inline pte_t pte_mkexec(pte_t pte) { return pte; }
182static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; } 176static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; }
183static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; } 177static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; }
184static inline pte_t pte_mknocache(pte_t pte) 178static inline pte_t pte_mknocache(pte_t pte)
diff --git a/include/asm-m68k/pci.h b/include/asm-m68k/pci.h
index 9d2c07abe44f..678cb0b52314 100644
--- a/include/asm-m68k/pci.h
+++ b/include/asm-m68k/pci.h
@@ -54,8 +54,4 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
54 */ 54 */
55#define PCI_DMA_BUS_IS_PHYS (1) 55#define PCI_DMA_BUS_IS_PHYS (1)
56 56
57static inline void pcibios_add_platform_entries(struct pci_dev *dev)
58{
59}
60
61#endif /* _ASM_M68K_PCI_H */ 57#endif /* _ASM_M68K_PCI_H */
diff --git a/include/asm-m68k/raw_io.h b/include/asm-m68k/raw_io.h
index 811ccd25d4a6..91c623f0994c 100644
--- a/include/asm-m68k/raw_io.h
+++ b/include/asm-m68k/raw_io.h
@@ -49,10 +49,16 @@ extern void __iounmap(void *addr, unsigned long size);
49#define raw_inb in_8 49#define raw_inb in_8
50#define raw_inw in_be16 50#define raw_inw in_be16
51#define raw_inl in_be32 51#define raw_inl in_be32
52#define __raw_readb in_8
53#define __raw_readw in_be16
54#define __raw_readl in_be32
52 55
53#define raw_outb(val,port) out_8((port),(val)) 56#define raw_outb(val,port) out_8((port),(val))
54#define raw_outw(val,port) out_be16((port),(val)) 57#define raw_outw(val,port) out_be16((port),(val))
55#define raw_outl(val,port) out_be32((port),(val)) 58#define raw_outl(val,port) out_be32((port),(val))
59#define __raw_writeb(val,addr) out_8((addr),(val))
60#define __raw_writew(val,addr) out_be16((addr),(val))
61#define __raw_writel(val,addr) out_be32((addr),(val))
56 62
57static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) 63static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len)
58{ 64{
@@ -336,8 +342,6 @@ static inline void raw_outsw_swapw(volatile u16 __iomem *port, const u16 *buf,
336 : "d0", "a0", "a1", "d6"); 342 : "d0", "a0", "a1", "d6");
337} 343}
338 344
339#define __raw_writel raw_outl
340
341#endif /* __KERNEL__ */ 345#endif /* __KERNEL__ */
342 346
343#endif /* _RAW_IO_H */ 347#endif /* _RAW_IO_H */
diff --git a/include/asm-m68k/sun3_pgtable.h b/include/asm-m68k/sun3_pgtable.h
index b9e62c1e7ae3..b766fc261bde 100644
--- a/include/asm-m68k/sun3_pgtable.h
+++ b/include/asm-m68k/sun3_pgtable.h
@@ -165,21 +165,15 @@ static inline void pgd_clear (pgd_t *pgdp) {}
165 * Undefined behaviour if not... 165 * Undefined behaviour if not...
166 * [we have the full set here even if they don't change from m68k] 166 * [we have the full set here even if they don't change from m68k]
167 */ 167 */
168static inline int pte_read(pte_t pte) { return 1; }
169static inline int pte_write(pte_t pte) { return pte_val(pte) & SUN3_PAGE_WRITEABLE; } 168static inline int pte_write(pte_t pte) { return pte_val(pte) & SUN3_PAGE_WRITEABLE; }
170static inline int pte_exec(pte_t pte) { return 1; }
171static inline int pte_dirty(pte_t pte) { return pte_val(pte) & SUN3_PAGE_MODIFIED; } 169static inline int pte_dirty(pte_t pte) { return pte_val(pte) & SUN3_PAGE_MODIFIED; }
172static inline int pte_young(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; } 170static inline int pte_young(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; }
173static inline int pte_file(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; } 171static inline int pte_file(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; }
174 172
175static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_WRITEABLE; return pte; } 173static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_WRITEABLE; return pte; }
176static inline pte_t pte_rdprotect(pte_t pte) { return pte; }
177static inline pte_t pte_exprotect(pte_t pte) { return pte; }
178static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_MODIFIED; return pte; } 174static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_MODIFIED; return pte; }
179static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_ACCESSED; return pte; } 175static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_ACCESSED; return pte; }
180static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= SUN3_PAGE_WRITEABLE; return pte; } 176static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= SUN3_PAGE_WRITEABLE; return pte; }
181static inline pte_t pte_mkread(pte_t pte) { return pte; }
182static inline pte_t pte_mkexec(pte_t pte) { return pte; }
183static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= SUN3_PAGE_MODIFIED; return pte; } 177static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= SUN3_PAGE_MODIFIED; return pte; }
184static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= SUN3_PAGE_ACCESSED; return pte; } 178static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= SUN3_PAGE_ACCESSED; return pte; }
185static inline pte_t pte_mknocache(pte_t pte) { pte_val(pte) |= SUN3_PAGE_NOCACHE; return pte; } 179static inline pte_t pte_mknocache(pte_t pte) { pte_val(pte) |= SUN3_PAGE_NOCACHE; return pte; }
diff --git a/include/asm-m68k/termbits.h b/include/asm-m68k/termbits.h
index a194092240fb..0e520f328f53 100644
--- a/include/asm-m68k/termbits.h
+++ b/include/asm-m68k/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct termios2 {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20struct ktermios { 31struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */ 32 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */ 33 tcflag_t c_oflag; /* output mode flags */
diff --git a/include/asm-m68knommu/fb.h b/include/asm-m68knommu/fb.h
new file mode 100644
index 000000000000..c7df38030992
--- /dev/null
+++ b/include/asm-m68knommu/fb.h
@@ -0,0 +1,12 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/include/asm-m68knommu/irq.h b/include/asm-m68knommu/irq.h
index 7b8f874f8429..9373c31ac87d 100644
--- a/include/asm-m68knommu/irq.h
+++ b/include/asm-m68knommu/irq.h
@@ -1,7 +1,5 @@
1#ifndef _M68K_IRQ_H_ 1#ifndef _M68KNOMMU_IRQ_H_
2#define _M68K_IRQ_H_ 2#define _M68KNOMMU_IRQ_H_
3
4#include <asm/ptrace.h>
5 3
6#ifdef CONFIG_COLDFIRE 4#ifdef CONFIG_COLDFIRE
7/* 5/*
@@ -17,75 +15,12 @@
17/* 15/*
18 * # of m68k interrupts 16 * # of m68k interrupts
19 */ 17 */
20#define SYS_IRQS 8 18#define SYS_IRQS 8
21#define NR_IRQS (24+SYS_IRQS) 19#define NR_IRQS (24 + SYS_IRQS)
22 20
23#endif /* CONFIG_COLDFIRE */ 21#endif /* CONFIG_COLDFIRE */
24 22
25/*
26 * Interrupt source definitions
27 * General interrupt sources are the level 1-7.
28 * Adding an interrupt service routine for one of these sources
29 * results in the addition of that routine to a chain of routines.
30 * Each one is called in succession. Each individual interrupt
31 * service routine should determine if the device associated with
32 * that routine requires service.
33 */
34 23
35#define IRQ1 (1) /* level 1 interrupt */
36#define IRQ2 (2) /* level 2 interrupt */
37#define IRQ3 (3) /* level 3 interrupt */
38#define IRQ4 (4) /* level 4 interrupt */
39#define IRQ5 (5) /* level 5 interrupt */
40#define IRQ6 (6) /* level 6 interrupt */
41#define IRQ7 (7) /* level 7 interrupt (non-maskable) */
42
43/*
44 * Machine specific interrupt sources.
45 *
46 * Adding an interrupt service routine for a source with this bit
47 * set indicates a special machine specific interrupt source.
48 * The machine specific files define these sources.
49 *
50 * The IRQ_MACHSPEC bit is now gone - the only thing it did was to
51 * introduce unnecessary overhead.
52 *
53 * All interrupt handling is actually machine specific so it is better
54 * to use function pointers, as used by the Sparc port, and select the
55 * interrupt handling functions when initializing the kernel. This way
56 * we save some unnecessary overhead at run-time.
57 * 01/11/97 - Jes
58 */
59
60extern void (*mach_enable_irq)(unsigned int);
61extern void (*mach_disable_irq)(unsigned int);
62
63/*
64 * various flags for request_irq() - the Amiga now uses the standard
65 * mechanism like all other architectures - IRQF_DISABLED and
66 * IRQF_SHARED are your friends.
67 */
68#define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */
69#define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */
70#define IRQ_FLG_FAST (0x0004)
71#define IRQ_FLG_SLOW (0x0008)
72#define IRQ_FLG_STD (0x8000) /* internally used */
73
74#ifdef CONFIG_M68360
75
76#define CPM_INTERRUPT IRQ4
77
78/* see MC68360 User's Manual, p. 7-377 */
79#define CPM_VECTOR_BASE 0x04 /* 3 MSbits of CPM vector */
80
81#endif /* CONFIG_M68360 */
82
83/*
84 * Some drivers want these entry points
85 */
86#define enable_irq(x) do { } while (0)
87#define disable_irq(x) do { } while (0)
88#define disable_irq_nosync(x) disable_irq(x)
89#define irq_canonicalize(irq) (irq) 24#define irq_canonicalize(irq) (irq)
90 25
91#endif /* _M68K_IRQ_H_ */ 26#endif /* _M68KNOMMU_IRQ_H_ */
diff --git a/include/asm-m68knommu/irqnode.h b/include/asm-m68knommu/irqnode.h
deleted file mode 100644
index 6132a9858b52..000000000000
--- a/include/asm-m68knommu/irqnode.h
+++ /dev/null
@@ -1,36 +0,0 @@
1#ifndef _M68K_IRQNODE_H_
2#define _M68K_IRQNODE_H_
3
4#include <linux/interrupt.h>
5
6/*
7 * This structure is used to chain together the ISRs for a particular
8 * interrupt source (if it supports chaining).
9 */
10typedef struct irq_node {
11 irq_handler_t handler;
12 unsigned long flags;
13 void *dev_id;
14 const char *devname;
15 struct irq_node *next;
16} irq_node_t;
17
18/*
19 * This structure has only 4 elements for speed reasons
20 */
21struct irq_entry {
22 irq_handler_t handler;
23 unsigned long flags;
24 void *dev_id;
25 const char *devname;
26};
27
28/* count of spurious interrupts */
29extern volatile unsigned int num_spurious;
30
31/*
32 * This function returns a new irq_node_t
33 */
34extern irq_node_t *new_irq_node(void);
35
36#endif /* _M68K_IRQNODE_H_ */
diff --git a/include/asm-m68knommu/m68360.h b/include/asm-m68knommu/m68360.h
index dd11b070884b..eb7d39ef2855 100644
--- a/include/asm-m68knommu/m68360.h
+++ b/include/asm-m68knommu/m68360.h
@@ -3,3 +3,11 @@
3#include "m68360_quicc.h" 3#include "m68360_quicc.h"
4#include "m68360_enet.h" 4#include "m68360_enet.h"
5 5
6#ifdef CONFIG_M68360
7
8#define CPM_INTERRUPT 4
9
10/* see MC68360 User's Manual, p. 7-377 */
11#define CPM_VECTOR_BASE 0x04 /* 3 MSbits of CPM vector */
12
13#endif /* CONFIG_M68360 */
diff --git a/include/asm-m68knommu/page.h b/include/asm-m68knommu/page.h
index 2a1b8bdcb29c..9efa0a9851b1 100644
--- a/include/asm-m68knommu/page.h
+++ b/include/asm-m68knommu/page.h
@@ -22,7 +22,8 @@
22#define clear_user_page(page, vaddr, pg) clear_page(page) 22#define clear_user_page(page, vaddr, pg) clear_page(page)
23#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 23#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
24 24
25#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) 25#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
26 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
26#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 27#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
27 28
28/* 29/*
diff --git a/include/asm-m68knommu/pci.h b/include/asm-m68knommu/pci.h
index e04c77e1184d..a13f3cc87451 100644
--- a/include/asm-m68knommu/pci.h
+++ b/include/asm-m68knommu/pci.h
@@ -24,16 +24,6 @@ static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
24 return 1; 24 return 1;
25} 25}
26 26
27/*
28 * Not supporting more than 32-bit PCI bus addresses now, but
29 * must satisfy references to this function. Change if needed.
30 */
31#define pci_dac_dma_supported(pci_dev, mask) (0)
32
33static inline void pcibios_add_platform_entries(struct pci_dev *dev)
34{
35}
36
37#endif /* CONFIG_COMEMPCI */ 27#endif /* CONFIG_COMEMPCI */
38 28
39#endif /* M68KNOMMU_PCI_H */ 29#endif /* M68KNOMMU_PCI_H */
diff --git a/include/asm-m68knommu/pgtable.h b/include/asm-m68knommu/pgtable.h
index 9dfbbc24aa71..e1e6a1d2333a 100644
--- a/include/asm-m68knommu/pgtable.h
+++ b/include/asm-m68knommu/pgtable.h
@@ -49,7 +49,6 @@ static inline int pte_file(pte_t pte) { return 0; }
49 * These would be in other places but having them here reduces the diffs. 49 * These would be in other places but having them here reduces the diffs.
50 */ 50 */
51extern unsigned int kobjsize(const void *objp); 51extern unsigned int kobjsize(const void *objp);
52extern int is_in_rom(unsigned long);
53 52
54/* 53/*
55 * No page table caches to initialise. 54 * No page table caches to initialise.
diff --git a/include/asm-m68knommu/traps.h b/include/asm-m68knommu/traps.h
index f2a81317cc10..d0671e5f8e29 100644
--- a/include/asm-m68knommu/traps.h
+++ b/include/asm-m68knommu/traps.h
@@ -16,6 +16,10 @@
16typedef void (*e_vector)(void); 16typedef void (*e_vector)(void);
17 17
18extern e_vector vectors[]; 18extern e_vector vectors[];
19extern void init_vectors(void);
20extern void enable_vector(unsigned int irq);
21extern void disable_vector(unsigned int irq);
22extern void ack_vector(unsigned int irq);
19 23
20#endif 24#endif
21 25
diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h
index 62b29b10bc6d..9ed9169a8849 100644
--- a/include/asm-m68knommu/uaccess.h
+++ b/include/asm-m68knommu/uaccess.h
@@ -15,12 +15,15 @@
15 15
16#define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size)) 16#define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size))
17 17
18/*
19 * It is not enough to just have access_ok check for a real RAM address.
20 * This would disallow the case of code/ro-data running XIP in flash/rom.
21 * Ideally we would check the possible flash ranges too, but that is
22 * currently not so easy.
23 */
18static inline int _access_ok(unsigned long addr, unsigned long size) 24static inline int _access_ok(unsigned long addr, unsigned long size)
19{ 25{
20 extern unsigned long memory_start, memory_end; 26 return 1;
21
22 return (((addr >= memory_start) && (addr+size < memory_end)) ||
23 (is_in_rom(addr) && is_in_rom(addr+size)));
24} 27}
25 28
26/* 29/*
diff --git a/include/asm-mips/a.out.h b/include/asm-mips/a.out.h
index ef33c3f13484..1ad60ba186d0 100644
--- a/include/asm-mips/a.out.h
+++ b/include/asm-mips/a.out.h
@@ -40,6 +40,7 @@ struct exec
40#ifdef CONFIG_64BIT 40#ifdef CONFIG_64BIT
41#define STACK_TOP (current->thread.mflags & MF_32BIT_ADDR ? TASK_SIZE32 : TASK_SIZE) 41#define STACK_TOP (current->thread.mflags & MF_32BIT_ADDR ? TASK_SIZE32 : TASK_SIZE)
42#endif 42#endif
43#define STACK_TOP_MAX TASK_SIZE
43 44
44#endif 45#endif
45 46
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
index c6275088cf65..0b3ff9c48409 100644
--- a/include/asm-mips/addrspace.h
+++ b/include/asm-mips/addrspace.h
@@ -129,28 +129,12 @@
129#define PHYS_TO_XKPHYS(cm,a) (_CONST64_(0x8000000000000000) | \ 129#define PHYS_TO_XKPHYS(cm,a) (_CONST64_(0x8000000000000000) | \
130 ((cm)<<59) | (a)) 130 ((cm)<<59) | (a))
131 131
132#if defined (CONFIG_CPU_R4300) \ 132/*
133 || defined (CONFIG_CPU_R4X00) \ 133 * The ultimate limited of the 64-bit MIPS architecture: 2 bits for selecting
134 || defined (CONFIG_CPU_R5000) \ 134 * the region, 3 bits for the CCA mode. This leaves 59 bits of which the
135 || defined (CONFIG_CPU_RM7000) \ 135 * R8000 implements most with its 48-bit physical address space.
136 || defined (CONFIG_CPU_NEVADA) \ 136 */
137 || defined (CONFIG_CPU_TX49XX) \ 137#define TO_PHYS_MASK _CONST64_(0x07ffffffffffffff) /* 2^^59 - 1 */
138 || defined (CONFIG_CPU_MIPS64)
139#define TO_PHYS_MASK _CONST64_(0x0000000fffffffff) /* 2^^36 - 1 */
140#endif
141
142#if defined (CONFIG_CPU_R8000)
143/* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */
144#define TO_PHYS_MASK _CONST64_(0x000000ffffffffff) /* 2^^40 - 1 */
145#endif
146
147#if defined (CONFIG_CPU_R10000)
148#define TO_PHYS_MASK _CONST64_(0x000000ffffffffff) /* 2^^40 - 1 */
149#endif
150
151#if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A)
152#define TO_PHYS_MASK _CONST64_(0x00000fffffffffff) /* 2^^44 - 1 */
153#endif
154 138
155#ifndef CONFIG_CPU_R8000 139#ifndef CONFIG_CPU_R8000
156 140
diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h
index 92e62ef711ed..c5f20df780e9 100644
--- a/include/asm-mips/asmmacro.h
+++ b/include/asm-mips/asmmacro.h
@@ -52,21 +52,6 @@
52 .endm 52 .endm
53#endif /* CONFIG_MIPS_MT_SMTC */ 53#endif /* CONFIG_MIPS_MT_SMTC */
54 54
55#ifdef CONFIG_CPU_SB1
56 .macro fpu_enable_hazard
57 .set push
58 .set noreorder
59 .set mips2
60 SSNOP
61 bnezl $0, .+4
62 SSNOP
63 .set pop
64 .endm
65#else
66 .macro fpu_enable_hazard
67 .endm
68#endif
69
70/* 55/*
71 * Temporary until all gas have MT ASE support 56 * Temporary until all gas have MT ASE support
72 */ 57 */
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index 1b60624dab7e..7d8003769a44 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -138,7 +138,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
138{ 138{
139 unsigned long result; 139 unsigned long result;
140 140
141 smp_mb(); 141 smp_llsc_mb();
142 142
143 if (cpu_has_llsc && R10000_LLSC_WAR) { 143 if (cpu_has_llsc && R10000_LLSC_WAR) {
144 unsigned long temp; 144 unsigned long temp;
@@ -181,7 +181,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
181 raw_local_irq_restore(flags); 181 raw_local_irq_restore(flags);
182 } 182 }
183 183
184 smp_mb(); 184 smp_llsc_mb();
185 185
186 return result; 186 return result;
187} 187}
@@ -190,7 +190,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
190{ 190{
191 unsigned long result; 191 unsigned long result;
192 192
193 smp_mb(); 193 smp_llsc_mb();
194 194
195 if (cpu_has_llsc && R10000_LLSC_WAR) { 195 if (cpu_has_llsc && R10000_LLSC_WAR) {
196 unsigned long temp; 196 unsigned long temp;
@@ -233,7 +233,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
233 raw_local_irq_restore(flags); 233 raw_local_irq_restore(flags);
234 } 234 }
235 235
236 smp_mb(); 236 smp_llsc_mb();
237 237
238 return result; 238 return result;
239} 239}
@@ -250,7 +250,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
250{ 250{
251 unsigned long result; 251 unsigned long result;
252 252
253 smp_mb(); 253 smp_llsc_mb();
254 254
255 if (cpu_has_llsc && R10000_LLSC_WAR) { 255 if (cpu_has_llsc && R10000_LLSC_WAR) {
256 unsigned long temp; 256 unsigned long temp;
@@ -302,7 +302,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
302 raw_local_irq_restore(flags); 302 raw_local_irq_restore(flags);
303 } 303 }
304 304
305 smp_mb(); 305 smp_llsc_mb();
306 306
307 return result; 307 return result;
308} 308}
@@ -519,7 +519,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
519{ 519{
520 unsigned long result; 520 unsigned long result;
521 521
522 smp_mb(); 522 smp_llsc_mb();
523 523
524 if (cpu_has_llsc && R10000_LLSC_WAR) { 524 if (cpu_has_llsc && R10000_LLSC_WAR) {
525 unsigned long temp; 525 unsigned long temp;
@@ -562,7 +562,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
562 raw_local_irq_restore(flags); 562 raw_local_irq_restore(flags);
563 } 563 }
564 564
565 smp_mb(); 565 smp_llsc_mb();
566 566
567 return result; 567 return result;
568} 568}
@@ -571,7 +571,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
571{ 571{
572 unsigned long result; 572 unsigned long result;
573 573
574 smp_mb(); 574 smp_llsc_mb();
575 575
576 if (cpu_has_llsc && R10000_LLSC_WAR) { 576 if (cpu_has_llsc && R10000_LLSC_WAR) {
577 unsigned long temp; 577 unsigned long temp;
@@ -614,7 +614,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
614 raw_local_irq_restore(flags); 614 raw_local_irq_restore(flags);
615 } 615 }
616 616
617 smp_mb(); 617 smp_llsc_mb();
618 618
619 return result; 619 return result;
620} 620}
@@ -631,7 +631,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
631{ 631{
632 unsigned long result; 632 unsigned long result;
633 633
634 smp_mb(); 634 smp_llsc_mb();
635 635
636 if (cpu_has_llsc && R10000_LLSC_WAR) { 636 if (cpu_has_llsc && R10000_LLSC_WAR) {
637 unsigned long temp; 637 unsigned long temp;
@@ -683,7 +683,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
683 raw_local_irq_restore(flags); 683 raw_local_irq_restore(flags);
684 } 684 }
685 685
686 smp_mb(); 686 smp_llsc_mb();
687 687
688 return result; 688 return result;
689} 689}
@@ -791,10 +791,11 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
791 * atomic*_return operations are serializing but not the non-*_return 791 * atomic*_return operations are serializing but not the non-*_return
792 * versions. 792 * versions.
793 */ 793 */
794#define smp_mb__before_atomic_dec() smp_mb() 794#define smp_mb__before_atomic_dec() smp_llsc_mb()
795#define smp_mb__after_atomic_dec() smp_mb() 795#define smp_mb__after_atomic_dec() smp_llsc_mb()
796#define smp_mb__before_atomic_inc() smp_mb() 796#define smp_mb__before_atomic_inc() smp_llsc_mb()
797#define smp_mb__after_atomic_inc() smp_mb() 797#define smp_mb__after_atomic_inc() smp_llsc_mb()
798 798
799#include <asm-generic/atomic.h> 799#include <asm-generic/atomic.h>
800
800#endif /* _ASM_ATOMIC_H */ 801#endif /* _ASM_ATOMIC_H */
diff --git a/include/asm-mips/barrier.h b/include/asm-mips/barrier.h
index ed82631b0017..9d8cfbb5e796 100644
--- a/include/asm-mips/barrier.h
+++ b/include/asm-mips/barrier.h
@@ -121,6 +121,11 @@
121#else 121#else
122#define __WEAK_ORDERING_MB " \n" 122#define __WEAK_ORDERING_MB " \n"
123#endif 123#endif
124#if defined(CONFIG_WEAK_REORDERING_BEYOND_LLSC) && defined(CONFIG_SMP)
125#define __WEAK_LLSC_MB " sync \n"
126#else
127#define __WEAK_LLSC_MB " \n"
128#endif
124 129
125#define smp_mb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory") 130#define smp_mb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory")
126#define smp_rmb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory") 131#define smp_rmb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory")
@@ -129,4 +134,8 @@
129#define set_mb(var, value) \ 134#define set_mb(var, value) \
130 do { var = value; smp_mb(); } while (0) 135 do { var = value; smp_mb(); } while (0)
131 136
137#define smp_llsc_mb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
138#define smp_llsc_rmb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
139#define smp_llsc_wmb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
140
132#endif /* __ASM_BARRIER_H */ 141#endif /* __ASM_BARRIER_H */
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index d995413e11fd..148bc79557f1 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -38,8 +38,8 @@
38/* 38/*
39 * clear_bit() doesn't provide any barrier for the compiler. 39 * clear_bit() doesn't provide any barrier for the compiler.
40 */ 40 */
41#define smp_mb__before_clear_bit() smp_mb() 41#define smp_mb__before_clear_bit() smp_llsc_mb()
42#define smp_mb__after_clear_bit() smp_mb() 42#define smp_mb__after_clear_bit() smp_llsc_mb()
43 43
44/* 44/*
45 * set_bit - Atomically set a bit in memory 45 * set_bit - Atomically set a bit in memory
@@ -238,10 +238,11 @@ static inline int test_and_set_bit(unsigned long nr,
238 volatile unsigned long *addr) 238 volatile unsigned long *addr)
239{ 239{
240 unsigned short bit = nr & SZLONG_MASK; 240 unsigned short bit = nr & SZLONG_MASK;
241 unsigned long res;
241 242
242 if (cpu_has_llsc && R10000_LLSC_WAR) { 243 if (cpu_has_llsc && R10000_LLSC_WAR) {
243 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 244 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
244 unsigned long temp, res; 245 unsigned long temp;
245 246
246 __asm__ __volatile__( 247 __asm__ __volatile__(
247 " .set mips3 \n" 248 " .set mips3 \n"
@@ -254,11 +255,9 @@ static inline int test_and_set_bit(unsigned long nr,
254 : "=&r" (temp), "=m" (*m), "=&r" (res) 255 : "=&r" (temp), "=m" (*m), "=&r" (res)
255 : "r" (1UL << bit), "m" (*m) 256 : "r" (1UL << bit), "m" (*m)
256 : "memory"); 257 : "memory");
257
258 return res != 0;
259 } else if (cpu_has_llsc) { 258 } else if (cpu_has_llsc) {
260 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 259 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
261 unsigned long temp, res; 260 unsigned long temp;
262 261
263 __asm__ __volatile__( 262 __asm__ __volatile__(
264 " .set push \n" 263 " .set push \n"
@@ -277,25 +276,22 @@ static inline int test_and_set_bit(unsigned long nr,
277 : "=&r" (temp), "=m" (*m), "=&r" (res) 276 : "=&r" (temp), "=m" (*m), "=&r" (res)
278 : "r" (1UL << bit), "m" (*m) 277 : "r" (1UL << bit), "m" (*m)
279 : "memory"); 278 : "memory");
280
281 return res != 0;
282 } else { 279 } else {
283 volatile unsigned long *a = addr; 280 volatile unsigned long *a = addr;
284 unsigned long mask; 281 unsigned long mask;
285 int retval;
286 unsigned long flags; 282 unsigned long flags;
287 283
288 a += nr >> SZLONG_LOG; 284 a += nr >> SZLONG_LOG;
289 mask = 1UL << bit; 285 mask = 1UL << bit;
290 raw_local_irq_save(flags); 286 raw_local_irq_save(flags);
291 retval = (mask & *a) != 0; 287 res = (mask & *a);
292 *a |= mask; 288 *a |= mask;
293 raw_local_irq_restore(flags); 289 raw_local_irq_restore(flags);
294
295 return retval;
296 } 290 }
297 291
298 smp_mb(); 292 smp_llsc_mb();
293
294 return res != 0;
299} 295}
300 296
301/* 297/*
@@ -310,10 +306,11 @@ static inline int test_and_clear_bit(unsigned long nr,
310 volatile unsigned long *addr) 306 volatile unsigned long *addr)
311{ 307{
312 unsigned short bit = nr & SZLONG_MASK; 308 unsigned short bit = nr & SZLONG_MASK;
309 unsigned long res;
313 310
314 if (cpu_has_llsc && R10000_LLSC_WAR) { 311 if (cpu_has_llsc && R10000_LLSC_WAR) {
315 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 312 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
316 unsigned long temp, res; 313 unsigned long temp;
317 314
318 __asm__ __volatile__( 315 __asm__ __volatile__(
319 " .set mips3 \n" 316 " .set mips3 \n"
@@ -327,12 +324,10 @@ static inline int test_and_clear_bit(unsigned long nr,
327 : "=&r" (temp), "=m" (*m), "=&r" (res) 324 : "=&r" (temp), "=m" (*m), "=&r" (res)
328 : "r" (1UL << bit), "m" (*m) 325 : "r" (1UL << bit), "m" (*m)
329 : "memory"); 326 : "memory");
330
331 return res != 0;
332#ifdef CONFIG_CPU_MIPSR2 327#ifdef CONFIG_CPU_MIPSR2
333 } else if (__builtin_constant_p(nr)) { 328 } else if (__builtin_constant_p(nr)) {
334 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 329 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
335 unsigned long temp, res; 330 unsigned long temp;
336 331
337 __asm__ __volatile__( 332 __asm__ __volatile__(
338 "1: " __LL "%0, %1 # test_and_clear_bit \n" 333 "1: " __LL "%0, %1 # test_and_clear_bit \n"
@@ -346,12 +341,10 @@ static inline int test_and_clear_bit(unsigned long nr,
346 : "=&r" (temp), "=m" (*m), "=&r" (res) 341 : "=&r" (temp), "=m" (*m), "=&r" (res)
347 : "ri" (bit), "m" (*m) 342 : "ri" (bit), "m" (*m)
348 : "memory"); 343 : "memory");
349
350 return res;
351#endif 344#endif
352 } else if (cpu_has_llsc) { 345 } else if (cpu_has_llsc) {
353 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 346 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
354 unsigned long temp, res; 347 unsigned long temp;
355 348
356 __asm__ __volatile__( 349 __asm__ __volatile__(
357 " .set push \n" 350 " .set push \n"
@@ -371,25 +364,22 @@ static inline int test_and_clear_bit(unsigned long nr,
371 : "=&r" (temp), "=m" (*m), "=&r" (res) 364 : "=&r" (temp), "=m" (*m), "=&r" (res)
372 : "r" (1UL << bit), "m" (*m) 365 : "r" (1UL << bit), "m" (*m)
373 : "memory"); 366 : "memory");
374
375 return res != 0;
376 } else { 367 } else {
377 volatile unsigned long *a = addr; 368 volatile unsigned long *a = addr;
378 unsigned long mask; 369 unsigned long mask;
379 int retval;
380 unsigned long flags; 370 unsigned long flags;
381 371
382 a += nr >> SZLONG_LOG; 372 a += nr >> SZLONG_LOG;
383 mask = 1UL << bit; 373 mask = 1UL << bit;
384 raw_local_irq_save(flags); 374 raw_local_irq_save(flags);
385 retval = (mask & *a) != 0; 375 res = (mask & *a);
386 *a &= ~mask; 376 *a &= ~mask;
387 raw_local_irq_restore(flags); 377 raw_local_irq_restore(flags);
388
389 return retval;
390 } 378 }
391 379
392 smp_mb(); 380 smp_llsc_mb();
381
382 return res != 0;
393} 383}
394 384
395/* 385/*
@@ -404,10 +394,11 @@ static inline int test_and_change_bit(unsigned long nr,
404 volatile unsigned long *addr) 394 volatile unsigned long *addr)
405{ 395{
406 unsigned short bit = nr & SZLONG_MASK; 396 unsigned short bit = nr & SZLONG_MASK;
397 unsigned long res;
407 398
408 if (cpu_has_llsc && R10000_LLSC_WAR) { 399 if (cpu_has_llsc && R10000_LLSC_WAR) {
409 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 400 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
410 unsigned long temp, res; 401 unsigned long temp;
411 402
412 __asm__ __volatile__( 403 __asm__ __volatile__(
413 " .set mips3 \n" 404 " .set mips3 \n"
@@ -420,11 +411,9 @@ static inline int test_and_change_bit(unsigned long nr,
420 : "=&r" (temp), "=m" (*m), "=&r" (res) 411 : "=&r" (temp), "=m" (*m), "=&r" (res)
421 : "r" (1UL << bit), "m" (*m) 412 : "r" (1UL << bit), "m" (*m)
422 : "memory"); 413 : "memory");
423
424 return res != 0;
425 } else if (cpu_has_llsc) { 414 } else if (cpu_has_llsc) {
426 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 415 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
427 unsigned long temp, res; 416 unsigned long temp;
428 417
429 __asm__ __volatile__( 418 __asm__ __volatile__(
430 " .set push \n" 419 " .set push \n"
@@ -443,24 +432,22 @@ static inline int test_and_change_bit(unsigned long nr,
443 : "=&r" (temp), "=m" (*m), "=&r" (res) 432 : "=&r" (temp), "=m" (*m), "=&r" (res)
444 : "r" (1UL << bit), "m" (*m) 433 : "r" (1UL << bit), "m" (*m)
445 : "memory"); 434 : "memory");
446
447 return res != 0;
448 } else { 435 } else {
449 volatile unsigned long *a = addr; 436 volatile unsigned long *a = addr;
450 unsigned long mask, retval; 437 unsigned long mask;
451 unsigned long flags; 438 unsigned long flags;
452 439
453 a += nr >> SZLONG_LOG; 440 a += nr >> SZLONG_LOG;
454 mask = 1UL << bit; 441 mask = 1UL << bit;
455 raw_local_irq_save(flags); 442 raw_local_irq_save(flags);
456 retval = (mask & *a) != 0; 443 res = (mask & *a);
457 *a ^= mask; 444 *a ^= mask;
458 raw_local_irq_restore(flags); 445 raw_local_irq_restore(flags);
459
460 return retval;
461 } 446 }
462 447
463 smp_mb(); 448 smp_llsc_mb();
449
450 return res != 0;
464} 451}
465 452
466#include <asm-generic/bitops/non-atomic.h> 453#include <asm-generic/bitops/non-atomic.h>
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h
index b0c329783ac5..087126a5faf9 100644
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -109,18 +109,12 @@
109#define MACH_COSINE_ORION 0 109#define MACH_COSINE_ORION 0
110 110
111/* 111/*
112 * Valid machtype for group GALILEO
113 */
114#define MACH_GROUP_GALILEO 11 /* Galileo Eval Boards */
115#define MACH_EV64120A 0 /* EV64120A */
116
117/*
118 * Valid machtype for group MOMENCO 112 * Valid machtype for group MOMENCO
119 */ 113 */
120#define MACH_GROUP_MOMENCO 12 /* Momentum Boards */ 114#define MACH_GROUP_MOMENCO 12 /* Momentum Boards */
121#define MACH_MOMENCO_OCELOT 0 115#define MACH_MOMENCO_OCELOT 0
122#define MACH_MOMENCO_OCELOT_G 1 /* no more supported (may 2007) */ 116#define MACH_MOMENCO_OCELOT_G 1 /* no more supported (may 2007) */
123#define MACH_MOMENCO_OCELOT_C 2 117#define MACH_MOMENCO_OCELOT_C 2 /* no more supported (jun 2007) */
124#define MACH_MOMENCO_JAGUAR_ATX 3 /* no more supported (may 2007) */ 118#define MACH_MOMENCO_JAGUAR_ATX 3 /* no more supported (may 2007) */
125#define MACH_MOMENCO_OCELOT_3 4 119#define MACH_MOMENCO_OCELOT_3 4
126 120
@@ -194,13 +188,6 @@
194#define MACH_HP_LASERJET 1 188#define MACH_HP_LASERJET 1
195 189
196/* 190/*
197 * Valid machtype for group LASAT
198 */
199#define MACH_GROUP_LASAT 21
200#define MACH_LASAT_100 0 /* Masquerade II/SP100/SP50/SP25 */
201#define MACH_LASAT_200 1 /* Masquerade PRO/SP200 */
202
203/*
204 * Valid machtype for group TITAN 191 * Valid machtype for group TITAN
205 */ 192 */
206#define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */ 193#define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
@@ -213,6 +200,27 @@
213#define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */ 200#define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */
214#define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */ 201#define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */
215 202
203/*
204 * Valid machtype for group LEMOTE
205 */
206#define MACH_GROUP_LEMOTE 27
207#define MACH_LEMOTE_FULONG 0
208
209/*
210 * Valid machtype for group PMC-MSP
211 */
212#define MACH_GROUP_MSP 26 /* PMC-Sierra MSP boards/CPUs */
213#define MACH_MSP4200_EVAL 0 /* PMC-Sierra MSP4200 Evaluation */
214#define MACH_MSP4200_GW 1 /* PMC-Sierra MSP4200 Gateway demo */
215#define MACH_MSP4200_FPGA 2 /* PMC-Sierra MSP4200 Emulation */
216#define MACH_MSP7120_EVAL 3 /* PMC-Sierra MSP7120 Evaluation */
217#define MACH_MSP7120_GW 4 /* PMC-Sierra MSP7120 Residential GW */
218#define MACH_MSP7120_FPGA 5 /* PMC-Sierra MSP7120 Emulation */
219#define MACH_MSP_OTHER 255 /* PMC-Sierra unknown board type */
220
221#define MACH_GROUP_WINDRIVER 28 /* Windriver boards */
222#define MACH_WRPPMC 1
223
216#define CL_SIZE COMMAND_LINE_SIZE 224#define CL_SIZE COMMAND_LINE_SIZE
217 225
218const char *get_system_type(void); 226const char *get_system_type(void);
diff --git a/include/asm-mips/cacheops.h b/include/asm-mips/cacheops.h
index c4a1ec31ff6a..df7f2deb3b56 100644
--- a/include/asm-mips/cacheops.h
+++ b/include/asm-mips/cacheops.h
@@ -20,7 +20,11 @@
20#define Index_Load_Tag_D 0x05 20#define Index_Load_Tag_D 0x05
21#define Index_Store_Tag_I 0x08 21#define Index_Store_Tag_I 0x08
22#define Index_Store_Tag_D 0x09 22#define Index_Store_Tag_D 0x09
23#if defined(CONFIG_CPU_LOONGSON2)
24#define Hit_Invalidate_I 0x00
25#else
23#define Hit_Invalidate_I 0x10 26#define Hit_Invalidate_I 0x10
27#endif
24#define Hit_Invalidate_D 0x11 28#define Hit_Invalidate_D 0x11
25#define Hit_Writeback_Inv_D 0x15 29#define Hit_Writeback_Inv_D 0x15
26 30
diff --git a/include/asm-mips/compat-signal.h b/include/asm-mips/compat-signal.h
index 6599a901b63e..368a99e5c3e1 100644
--- a/include/asm-mips/compat-signal.h
+++ b/include/asm-mips/compat-signal.h
@@ -10,6 +10,68 @@
10 10
11#include <asm/uaccess.h> 11#include <asm/uaccess.h>
12 12
13#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
14
15typedef struct compat_siginfo {
16 int si_signo;
17 int si_code;
18 int si_errno;
19
20 union {
21 int _pad[SI_PAD_SIZE32];
22
23 /* kill() */
24 struct {
25 compat_pid_t _pid; /* sender's pid */
26 compat_uid_t _uid; /* sender's uid */
27 } _kill;
28
29 /* SIGCHLD */
30 struct {
31 compat_pid_t _pid; /* which child */
32 compat_uid_t _uid; /* sender's uid */
33 int _status; /* exit code */
34 compat_clock_t _utime;
35 compat_clock_t _stime;
36 } _sigchld;
37
38 /* IRIX SIGCHLD */
39 struct {
40 compat_pid_t _pid; /* which child */
41 compat_clock_t _utime;
42 int _status; /* exit code */
43 compat_clock_t _stime;
44 } _irix_sigchld;
45
46 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
47 struct {
48 s32 _addr; /* faulting insn/memory ref. */
49 } _sigfault;
50
51 /* SIGPOLL, SIGXFSZ (To do ...) */
52 struct {
53 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
54 int _fd;
55 } _sigpoll;
56
57 /* POSIX.1b timers */
58 struct {
59 timer_t _tid; /* timer id */
60 int _overrun; /* overrun count */
61 compat_sigval_t _sigval;/* same as below */
62 int _sys_private; /* not to be passed to user */
63 } _timer;
64
65 /* POSIX.1b signals */
66 struct {
67 compat_pid_t _pid; /* sender's pid */
68 compat_uid_t _uid; /* sender's uid */
69 compat_sigval_t _sigval;
70 } _rt;
71
72 } _sifields;
73} compat_siginfo_t;
74
13static inline int __copy_conv_sigset_to_user(compat_sigset_t __user *d, 75static inline int __copy_conv_sigset_to_user(compat_sigset_t __user *d,
14 const sigset_t *s) 76 const sigset_t *s)
15{ 77{
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h
index 432653d7ae09..568c76cdd900 100644
--- a/include/asm-mips/compat.h
+++ b/include/asm-mips/compat.h
@@ -37,8 +37,10 @@ typedef s32 compat_key_t;
37 37
38typedef s32 compat_int_t; 38typedef s32 compat_int_t;
39typedef s32 compat_long_t; 39typedef s32 compat_long_t;
40typedef s64 compat_s64;
40typedef u32 compat_uint_t; 41typedef u32 compat_uint_t;
41typedef u32 compat_ulong_t; 42typedef u32 compat_ulong_t;
43typedef u64 compat_u64;
42 44
43struct compat_timespec { 45struct compat_timespec {
44 compat_time_t tv_sec; 46 compat_time_t tv_sec;
@@ -132,7 +134,8 @@ typedef u32 compat_uptr_t;
132 134
133static inline void __user *compat_ptr(compat_uptr_t uptr) 135static inline void __user *compat_ptr(compat_uptr_t uptr)
134{ 136{
135 return (void __user *)(long)uptr; 137 /* cast to a __user pointer via "unsigned long" makes sparse happy */
138 return (void __user *)(unsigned long)(long)uptr;
136} 139}
137 140
138static inline compat_uptr_t ptr_to_compat(void __user *uptr) 141static inline compat_uptr_t ptr_to_compat(void __user *uptr)
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h
index 5e4bed123b48..d95a83e3e1d7 100644
--- a/include/asm-mips/cpu-features.h
+++ b/include/asm-mips/cpu-features.h
@@ -150,6 +150,10 @@
150#define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT) 150#define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT)
151#endif 151#endif
152 152
153#ifndef cpu_has_userlocal
154#define cpu_has_userlocal (cpu_data[0].options & MIPS_CPU_ULRI)
155#endif
156
153#ifdef CONFIG_32BIT 157#ifdef CONFIG_32BIT
154# ifndef cpu_has_nofpuex 158# ifndef cpu_has_nofpuex
155# define cpu_has_nofpuex (cpu_data[0].options & MIPS_CPU_NOFPUEX) 159# define cpu_has_nofpuex (cpu_data[0].options & MIPS_CPU_NOFPUEX)
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h
index d38fdbf845b2..3857358fb6de 100644
--- a/include/asm-mips/cpu.h
+++ b/include/asm-mips/cpu.h
@@ -89,6 +89,8 @@
89#define PRID_IMP_34K 0x9500 89#define PRID_IMP_34K 0x9500
90#define PRID_IMP_24KE 0x9600 90#define PRID_IMP_24KE 0x9600
91#define PRID_IMP_74K 0x9700 91#define PRID_IMP_74K 0x9700
92#define PRID_IMP_LOONGSON1 0x4200
93#define PRID_IMP_LOONGSON2 0x6300
92 94
93/* 95/*
94 * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE 96 * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE
@@ -107,6 +109,7 @@
107 * Definitions for 7:0 on legacy processors 109 * Definitions for 7:0 on legacy processors
108 */ 110 */
109 111
112#define PRID_REV_MASK 0x00ff
110 113
111#define PRID_REV_TX4927 0x0022 114#define PRID_REV_TX4927 0x0022
112#define PRID_REV_TX4937 0x0030 115#define PRID_REV_TX4937 0x0030
@@ -123,6 +126,18 @@
123#define PRID_REV_VR4122 0x0070 126#define PRID_REV_VR4122 0x0070
124#define PRID_REV_VR4181A 0x0070 /* Same as VR4122 */ 127#define PRID_REV_VR4181A 0x0070 /* Same as VR4122 */
125#define PRID_REV_VR4130 0x0080 128#define PRID_REV_VR4130 0x0080
129#define PRID_REV_34K_V1_0_2 0x0022
130
131/*
132 * Older processors used to encode processor version and revision in two
133 * 4-bit bitfields, the 4K seems to simply count up and even newer MTI cores
134 * have switched to use the 8-bits as 3:3:2 bitfield with the last field as
135 * the patch number. *ARGH*
136 */
137#define PRID_REV_ENCODE_44(ver, rev) \
138 ((ver) << 4 | (rev))
139#define PRID_REV_ENCODE_332(ver, rev, patch) \
140 ((ver) << 5 | (rev) << 2 | (patch))
126 141
127/* 142/*
128 * FPU implementation/revision register (CP1 control register 0). 143 * FPU implementation/revision register (CP1 control register 0).
@@ -200,7 +215,10 @@
200#define CPU_SB1A 62 215#define CPU_SB1A 62
201#define CPU_74K 63 216#define CPU_74K 63
202#define CPU_R14000 64 217#define CPU_R14000 64
203#define CPU_LAST 64 218#define CPU_LOONGSON1 65
219#define CPU_LOONGSON2 66
220
221#define CPU_LAST 66
204 222
205/* 223/*
206 * ISA Level encodings 224 * ISA Level encodings
@@ -246,6 +264,7 @@
246#define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */ 264#define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */
247#define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */ 265#define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */
248#define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */ 266#define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */
267#define MIPS_CPU_ULRI 0x00400000 /* CPU has ULRI feature */
249 268
250/* 269/*
251 * CPU ASE encodings 270 * CPU ASE encodings
diff --git a/include/asm-mips/dec/serial.h b/include/asm-mips/dec/serial.h
deleted file mode 100644
index acad75890a05..000000000000
--- a/include/asm-mips/dec/serial.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * include/asm-mips/dec/serial.h
3 *
4 * Definitions common to all DECstation serial devices.
5 *
6 * Copyright (C) 2004 Maciej W. Rozycki
7 *
8 * Based on bits extracted from drivers/tc/zs.h for which
9 * the following copyrights apply:
10 *
11 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
12 * Copyright (C) 1996 Paul Mackerras (Paul.Mackerras@cs.anu.edu.au)
13 * Copyright (C) Harald Koerfgen
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version.
19 */
20#ifndef __ASM_MIPS_DEC_SERIAL_H
21#define __ASM_MIPS_DEC_SERIAL_H
22
23struct dec_serial_hook {
24 int (*init_channel)(void *handle);
25 void (*init_info)(void *handle);
26 void (*rx_char)(unsigned char ch, unsigned char fl);
27 int (*poll_rx_char)(void *handle);
28 int (*poll_tx_char)(void *handle, unsigned char ch);
29 unsigned int cflags;
30};
31
32extern int register_dec_serial_hook(unsigned int channel,
33 struct dec_serial_hook *hook);
34extern int unregister_dec_serial_hook(unsigned int channel);
35
36#endif /* __ASM_MIPS_DEC_SERIAL_H */
diff --git a/include/asm-mips/div64.h b/include/asm-mips/div64.h
index 66189f5f6399..716371bd0980 100644
--- a/include/asm-mips/div64.h
+++ b/include/asm-mips/div64.h
@@ -20,7 +20,7 @@
20 */ 20 */
21 21
22#define do_div64_32(res, high, low, base) ({ \ 22#define do_div64_32(res, high, low, base) ({ \
23 unsigned long __quot, __mod; \ 23 unsigned long __quot32, __mod32; \
24 unsigned long __cf, __tmp, __tmp2, __i; \ 24 unsigned long __cf, __tmp, __tmp2, __i; \
25 \ 25 \
26 __asm__(".set push\n\t" \ 26 __asm__(".set push\n\t" \
@@ -48,12 +48,13 @@
48 "bnez %4, 0b\n\t" \ 48 "bnez %4, 0b\n\t" \
49 " srl %5, %1, 0x1f\n\t" \ 49 " srl %5, %1, 0x1f\n\t" \
50 ".set pop" \ 50 ".set pop" \
51 : "=&r" (__mod), "=&r" (__tmp), "=&r" (__quot), "=&r" (__cf), \ 51 : "=&r" (__mod32), "=&r" (__tmp), \
52 "=&r" (__quot32), "=&r" (__cf), \
52 "=&r" (__i), "=&r" (__tmp2) \ 53 "=&r" (__i), "=&r" (__tmp2) \
53 : "Jr" (base), "0" (high), "1" (low)); \ 54 : "Jr" (base), "0" (high), "1" (low)); \
54 \ 55 \
55 (res) = __quot; \ 56 (res) = __quot32; \
56 __mod; }) 57 __mod32; })
57 58
58#define do_div(n, base) ({ \ 59#define do_div(n, base) ({ \
59 unsigned long long __quot; \ 60 unsigned long long __quot; \
diff --git a/include/asm-mips/ds1216.h b/include/asm-mips/ds1216.h
deleted file mode 100644
index 1ff8b73f7a6a..000000000000
--- a/include/asm-mips/ds1216.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef _DS1216_H
2#define _DS1216_H
3
4extern volatile unsigned char *ds1216_base;
5unsigned long ds1216_get_cmos_time(void);
6int ds1216_set_rtc_mmss(unsigned long nowtime);
7
8#define DS1216_SEC_BYTE 1
9#define DS1216_MIN_BYTE 2
10#define DS1216_HOUR_BYTE 3
11#define DS1216_HOUR_MASK (0x1f)
12#define DS1216_AMPM_MASK (1<<5)
13#define DS1216_1224_MASK (1<<7)
14#define DS1216_DAY_BYTE 4
15#define DS1216_DAY_MASK (0x7)
16#define DS1216_DATE_BYTE 5
17#define DS1216_DATE_MASK (0x3f)
18#define DS1216_MONTH_BYTE 6
19#define DS1216_MONTH_MASK (0x1f)
20#define DS1216_YEAR_BYTE 7
21
22#define DS1216_SEC(buf) (buf[DS1216_SEC_BYTE])
23#define DS1216_MIN(buf) (buf[DS1216_MIN_BYTE])
24#define DS1216_HOUR(buf) (buf[DS1216_HOUR_BYTE] & DS1216_HOUR_MASK)
25#define DS1216_AMPM(buf) (buf[DS1216_HOUR_BYTE] & DS1216_AMPM_MASK)
26#define DS1216_1224(buf) (buf[DS1216_HOUR_BYTE] & DS1216_1224_MASK)
27#define DS1216_DATE(buf) (buf[DS1216_DATE_BYTE] & DS1216_DATE_MASK)
28#define DS1216_MONTH(buf) (buf[DS1216_MONTH_BYTE] & DS1216_MONTH_MASK)
29#define DS1216_YEAR(buf) (buf[DS1216_YEAR_BYTE])
30
31#endif
diff --git a/include/asm-mips/fb.h b/include/asm-mips/fb.h
new file mode 100644
index 000000000000..bd3f68c9ddfc
--- /dev/null
+++ b/include/asm-mips/fb.h
@@ -0,0 +1,19 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7
8static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
9 unsigned long off)
10{
11 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
12}
13
14static inline int fb_is_primary_device(struct fb_info *info)
15{
16 return 0;
17}
18
19#endif /* _ASM_FB_H_ */
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h
index 47e5679c2353..b623882bce19 100644
--- a/include/asm-mips/futex.h
+++ b/include/asm-mips/futex.h
@@ -29,7 +29,7 @@
29 " .set mips3 \n" \ 29 " .set mips3 \n" \
30 "2: sc $1, %2 \n" \ 30 "2: sc $1, %2 \n" \
31 " beqzl $1, 1b \n" \ 31 " beqzl $1, 1b \n" \
32 __WEAK_ORDERING_MB \ 32 __WEAK_LLSC_MB \
33 "3: \n" \ 33 "3: \n" \
34 " .set pop \n" \ 34 " .set pop \n" \
35 " .set mips0 \n" \ 35 " .set mips0 \n" \
@@ -55,7 +55,7 @@
55 " .set mips3 \n" \ 55 " .set mips3 \n" \
56 "2: sc $1, %2 \n" \ 56 "2: sc $1, %2 \n" \
57 " beqz $1, 1b \n" \ 57 " beqz $1, 1b \n" \
58 __WEAK_ORDERING_MB \ 58 __WEAK_LLSC_MB \
59 "3: \n" \ 59 "3: \n" \
60 " .set pop \n" \ 60 " .set pop \n" \
61 " .set mips0 \n" \ 61 " .set mips0 \n" \
@@ -152,7 +152,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
152 " .set mips3 \n" 152 " .set mips3 \n"
153 "2: sc $1, %1 \n" 153 "2: sc $1, %1 \n"
154 " beqzl $1, 1b \n" 154 " beqzl $1, 1b \n"
155 __WEAK_ORDERING_MB 155 __WEAK_LLSC_MB
156 "3: \n" 156 "3: \n"
157 " .set pop \n" 157 " .set pop \n"
158 " .section .fixup,\"ax\" \n" 158 " .section .fixup,\"ax\" \n"
@@ -179,7 +179,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
179 " .set mips3 \n" 179 " .set mips3 \n"
180 "2: sc $1, %1 \n" 180 "2: sc $1, %1 \n"
181 " beqz $1, 1b \n" 181 " beqz $1, 1b \n"
182 __WEAK_ORDERING_MB 182 __WEAK_LLSC_MB
183 "3: \n" 183 "3: \n"
184 " .set pop \n" 184 " .set pop \n"
185 " .section .fixup,\"ax\" \n" 185 " .section .fixup,\"ax\" \n"
diff --git a/include/asm-mips/gfx.h b/include/asm-mips/gfx.h
deleted file mode 100644
index 37235e41a6fd..000000000000
--- a/include/asm-mips/gfx.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * This is the user-visible SGI GFX interface.
7 *
8 * This must be used verbatim into the GNU libc. It does not include
9 * any kernel-only bits on it.
10 *
11 * miguel@nuclecu.unam.mx
12 */
13#ifndef _ASM_GFX_H
14#define _ASM_GFX_H
15
16/* The iocls, yes, they do not make sense, but such is life */
17#define GFX_BASE 100
18#define GFX_GETNUM_BOARDS (GFX_BASE + 1)
19#define GFX_GETBOARD_INFO (GFX_BASE + 2)
20#define GFX_ATTACH_BOARD (GFX_BASE + 3)
21#define GFX_DETACH_BOARD (GFX_BASE + 4)
22#define GFX_IS_MANAGED (GFX_BASE + 5)
23
24#define GFX_MAPALL (GFX_BASE + 10)
25#define GFX_LABEL (GFX_BASE + 11)
26
27#define GFX_INFO_NAME_SIZE 16
28#define GFX_INFO_LABEL_SIZE 16
29
30struct gfx_info {
31 char name [GFX_INFO_NAME_SIZE]; /* board name */
32 char label [GFX_INFO_LABEL_SIZE]; /* label name */
33 unsigned short int xpmax, ypmax; /* screen resolution */
34 unsigned int lenght; /* size of a complete gfx_info for this board */
35};
36
37struct gfx_getboardinfo_args {
38 unsigned int board; /* board number. starting from zero */
39 void *buf; /* pointer to gfx_info */
40 unsigned int len; /* buffer size of buf */
41};
42
43struct gfx_attach_board_args {
44 unsigned int board; /* board number, starting from zero */
45 void *vaddr; /* address where the board registers should be mapped */
46};
47
48#ifdef __KERNEL__
49/* umap.c */
50extern void remove_mapping (struct vm_area_struct *vma, struct task_struct *, unsigned long, unsigned long);
51extern void *vmalloc_uncached (unsigned long size);
52extern int vmap_page_range (struct vm_area_struct *vma, unsigned long from, unsigned long size, unsigned long vaddr);
53#endif
54
55#endif /* _ASM_GFX_H */
diff --git a/include/asm-mips/gpio.h b/include/asm-mips/gpio.h
new file mode 100644
index 000000000000..06e46faf862d
--- /dev/null
+++ b/include/asm-mips/gpio.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_MIPS_GPIO_H
2#define __ASM_MIPS_GPIO_H
3
4#include <gpio.h>
5
6#endif /* __ASM_MIPS_GPIO_H */
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
index 92ec2618560c..7ba92890ea13 100644
--- a/include/asm-mips/io.h
+++ b/include/asm-mips/io.h
@@ -178,6 +178,11 @@ extern void __iounmap(const volatile void __iomem *addr);
178static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, 178static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
179 unsigned long flags) 179 unsigned long flags)
180{ 180{
181 void __iomem *addr = plat_ioremap(offset, size, flags);
182
183 if (addr)
184 return addr;
185
181#define __IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL)) 186#define __IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL))
182 187
183 if (cpu_has_64bit_addresses) { 188 if (cpu_has_64bit_addresses) {
@@ -207,7 +212,8 @@ static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
207 */ 212 */
208 if (__IS_LOW512(phys_addr) && __IS_LOW512(last_addr) && 213 if (__IS_LOW512(phys_addr) && __IS_LOW512(last_addr) &&
209 flags == _CACHE_UNCACHED) 214 flags == _CACHE_UNCACHED)
210 return (void __iomem *)CKSEG1ADDR(phys_addr); 215 return (void __iomem *)
216 (unsigned long)CKSEG1ADDR(phys_addr);
211 } 217 }
212 218
213 return __ioremap(offset, size, flags); 219 return __ioremap(offset, size, flags);
@@ -282,6 +288,9 @@ static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
282 288
283static inline void iounmap(const volatile void __iomem *addr) 289static inline void iounmap(const volatile void __iomem *addr)
284{ 290{
291 if (plat_iounmap(addr))
292 return;
293
285#define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1) 294#define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1)
286 295
287 if (cpu_has_64bit_addresses || 296 if (cpu_has_64bit_addresses ||
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index 91803ba30ff2..97102ebc54b1 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -24,7 +24,7 @@ static inline int irq_canonicalize(int irq)
24#define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */ 24#define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
25#endif 25#endif
26 26
27#ifdef CONFIG_MIPS_MT_SMTC 27#ifdef CONFIG_MIPS_MT_SMTC_IM_BACKSTOP
28/* 28/*
29 * Clear interrupt mask handling "backstop" if irq_hwmask 29 * Clear interrupt mask handling "backstop" if irq_hwmask
30 * entry so indicates. This implies that the ack() or end() 30 * entry so indicates. This implies that the ack() or end()
@@ -72,4 +72,13 @@ extern int allocate_irqno(void);
72extern void alloc_legacy_irqno(void); 72extern void alloc_legacy_irqno(void);
73extern void free_irqno(unsigned int irq); 73extern void free_irqno(unsigned int irq);
74 74
75/*
76 * Before R2 the timer and performance counter interrupts were both fixed to
77 * IE7. Since R2 their number has to be read from the c0_intctl register.
78 */
79#define CP0_LEGACY_COMPARE_IRQ 7
80
81extern int cp0_compare_irq;
82extern int cp0_perfcount_irq;
83
75#endif /* _ASM_IRQ_H */ 84#endif /* _ASM_IRQ_H */
diff --git a/include/asm-mips/lasat/ds1603.h b/include/asm-mips/lasat/ds1603.h
deleted file mode 100644
index edcd7544b358..000000000000
--- a/include/asm-mips/lasat/ds1603.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#include <asm/addrspace.h>
2
3/* Lasat 100 */
4#define DS1603_REG_100 (KSEG1ADDR(0x1c810000))
5#define DS1603_RST_100 (1 << 2)
6#define DS1603_CLK_100 (1 << 0)
7#define DS1603_DATA_SHIFT_100 1
8#define DS1603_DATA_100 (1 << DS1603_DATA_SHIFT_100)
9
10/* Lasat 200 */
11#define DS1603_REG_200 (KSEG1ADDR(0x11000000))
12#define DS1603_RST_200 (1 << 3)
13#define DS1603_CLK_200 (1 << 4)
14#define DS1603_DATA_200 (1 << 5)
15
16#define DS1603_DATA_REG_200 (DS1603_REG_200 + 0x10000)
17#define DS1603_DATA_READ_SHIFT_200 9
18#define DS1603_DATA_READ_200 (1 << DS1603_DATA_READ_SHIFT_200)
diff --git a/include/asm-mips/lasat/eeprom.h b/include/asm-mips/lasat/eeprom.h
deleted file mode 100644
index 7b53edd5cd5f..000000000000
--- a/include/asm-mips/lasat/eeprom.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#include <asm/addrspace.h>
2
3/* lasat 100 */
4#define AT93C_REG_100 KSEG1ADDR(0x1c810000)
5#define AT93C_RDATA_REG_100 AT93C_REG_100
6#define AT93C_RDATA_SHIFT_100 4
7#define AT93C_WDATA_SHIFT_100 4
8#define AT93C_CS_M_100 ( 1 << 5 )
9#define AT93C_CLK_M_100 ( 1 << 3 )
10
11/* lasat 200 */
12#define AT93C_REG_200 KSEG1ADDR(0x11000000)
13#define AT93C_RDATA_REG_200 (AT93C_REG_200+0x10000)
14#define AT93C_RDATA_SHIFT_200 8
15#define AT93C_WDATA_SHIFT_200 2
16#define AT93C_CS_M_200 ( 1 << 0 )
17#define AT93C_CLK_M_200 ( 1 << 1 )
diff --git a/include/asm-mips/lasat/head.h b/include/asm-mips/lasat/head.h
deleted file mode 100644
index f5589f31a197..000000000000
--- a/include/asm-mips/lasat/head.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Image header stuff
3 */
4#ifndef _HEAD_H
5#define _HEAD_H
6
7#define LASAT_K_MAGIC0_VAL 0xfedeabba
8#define LASAT_K_MAGIC1_VAL 0x00bedead
9
10#ifndef _LANGUAGE_ASSEMBLY
11#include <linux/types.h>
12struct bootloader_header {
13 u32 magic[2];
14 u32 version;
15 u32 image_start;
16 u32 image_size;
17 u32 kernel_start;
18 u32 kernel_entry;
19};
20#endif
21
22#endif /* _HEAD_H */
diff --git a/include/asm-mips/lasat/lasat.h b/include/asm-mips/lasat/lasat.h
deleted file mode 100644
index 42077e367a5b..000000000000
--- a/include/asm-mips/lasat/lasat.h
+++ /dev/null
@@ -1,253 +0,0 @@
1/*
2 * lasat.h
3 *
4 * Thomas Horsten <thh@lasat.com>
5 * Copyright (C) 2000 LASAT Networks A/S.
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 * Configuration for LASAT boards, loads the appropriate include files.
21 */
22#ifndef _LASAT_H
23#define _LASAT_H
24
25#ifndef _LANGUAGE_ASSEMBLY
26
27extern struct lasat_misc {
28 volatile u32 *reset_reg;
29 volatile u32 *flash_wp_reg;
30 u32 flash_wp_bit;
31} *lasat_misc;
32
33enum lasat_mtdparts {
34 LASAT_MTD_BOOTLOADER,
35 LASAT_MTD_SERVICE,
36 LASAT_MTD_NORMAL,
37 LASAT_MTD_CONFIG,
38 LASAT_MTD_FS,
39 LASAT_MTD_LAST
40};
41
42/*
43 * The format of the data record in the EEPROM.
44 * See Documentation/LASAT/eeprom.txt for a detailed description
45 * of the fields in this struct, and the LASAT Hardware Configuration
46 * field specification for a detailed description of the config
47 * field.
48 */
49#include <linux/types.h>
50
51#define LASAT_EEPROM_VERSION 7
52struct lasat_eeprom_struct {
53 unsigned int version;
54 unsigned int cfg[3];
55 unsigned char hwaddr[6];
56 unsigned char print_partno[12];
57 unsigned char term0;
58 unsigned char print_serial[14];
59 unsigned char term1;
60 unsigned char prod_partno[12];
61 unsigned char term2;
62 unsigned char prod_serial[14];
63 unsigned char term3;
64 unsigned char passwd_hash[16];
65 unsigned char pwdnull;
66 unsigned char vendid;
67 unsigned char ts_ref;
68 unsigned char ts_signoff;
69 unsigned char reserved[11];
70 unsigned char debugaccess;
71 unsigned short prid;
72 unsigned int serviceflag;
73 unsigned int ipaddr;
74 unsigned int netmask;
75 unsigned int crc32;
76};
77
78struct lasat_eeprom_struct_pre7 {
79 unsigned int version;
80 unsigned int flags[3];
81 unsigned char hwaddr0[6];
82 unsigned char hwaddr1[6];
83 unsigned char print_partno[9];
84 unsigned char term0;
85 unsigned char print_serial[14];
86 unsigned char term1;
87 unsigned char prod_partno[9];
88 unsigned char term2;
89 unsigned char prod_serial[14];
90 unsigned char term3;
91 unsigned char passwd_hash[24];
92 unsigned char pwdnull;
93 unsigned char vendor;
94 unsigned char ts_ref;
95 unsigned char ts_signoff;
96 unsigned char reserved[6];
97 unsigned int writecount;
98 unsigned int ipaddr;
99 unsigned int netmask;
100 unsigned int crc32;
101};
102
103/* Configuration descriptor encoding - see the doc for details */
104
105#define LASAT_W0_DSCTYPE(v) ( ( (v) ) & 0xf )
106#define LASAT_W0_BMID(v) ( ( (v) >> 0x04 ) & 0xf )
107#define LASAT_W0_CPUTYPE(v) ( ( (v) >> 0x08 ) & 0xf )
108#define LASAT_W0_BUSSPEED(v) ( ( (v) >> 0x0c ) & 0xf )
109#define LASAT_W0_CPUCLK(v) ( ( (v) >> 0x10 ) & 0xf )
110#define LASAT_W0_SDRAMBANKSZ(v) ( ( (v) >> 0x14 ) & 0xf )
111#define LASAT_W0_SDRAMBANKS(v) ( ( (v) >> 0x18 ) & 0xf )
112#define LASAT_W0_L2CACHE(v) ( ( (v) >> 0x1c ) & 0xf )
113
114#define LASAT_W1_EDHAC(v) ( ( (v) ) & 0xf )
115#define LASAT_W1_HIFN(v) ( ( (v) >> 0x04 ) & 0x1 )
116#define LASAT_W1_ISDN(v) ( ( (v) >> 0x05 ) & 0x1 )
117#define LASAT_W1_IDE(v) ( ( (v) >> 0x06 ) & 0x1 )
118#define LASAT_W1_HDLC(v) ( ( (v) >> 0x07 ) & 0x1 )
119#define LASAT_W1_USVERSION(v) ( ( (v) >> 0x08 ) & 0x1 )
120#define LASAT_W1_4MACS(v) ( ( (v) >> 0x09 ) & 0x1 )
121#define LASAT_W1_EXTSERIAL(v) ( ( (v) >> 0x0a ) & 0x1 )
122#define LASAT_W1_FLASHSIZE(v) ( ( (v) >> 0x0c ) & 0xf )
123#define LASAT_W1_PCISLOTS(v) ( ( (v) >> 0x10 ) & 0xf )
124#define LASAT_W1_PCI1OPT(v) ( ( (v) >> 0x14 ) & 0xf )
125#define LASAT_W1_PCI2OPT(v) ( ( (v) >> 0x18 ) & 0xf )
126#define LASAT_W1_PCI3OPT(v) ( ( (v) >> 0x1c ) & 0xf )
127
128/* Routines specific to LASAT boards */
129
130#define LASAT_BMID_MASQUERADE2 0
131#define LASAT_BMID_MASQUERADEPRO 1
132#define LASAT_BMID_SAFEPIPE25 2
133#define LASAT_BMID_SAFEPIPE50 3
134#define LASAT_BMID_SAFEPIPE100 4
135#define LASAT_BMID_SAFEPIPE5000 5
136#define LASAT_BMID_SAFEPIPE7000 6
137#define LASAT_BMID_SAFEPIPE1000 7
138//#define LASAT_BMID_SAFEPIPE30 7
139//#define LASAT_BMID_SAFEPIPE5100 8
140//#define LASAT_BMID_SAFEPIPE7100 9
141#define LASAT_BMID_UNKNOWN 0xf
142#define LASAT_MAX_BMID_NAMES 9 // no larger than 15!
143
144#define LASAT_HAS_EDHAC ( 1 << 0 )
145#define LASAT_EDHAC_FAST ( 1 << 1 )
146#define LASAT_HAS_EADI ( 1 << 2 )
147#define LASAT_HAS_HIFN ( 1 << 3 )
148#define LASAT_HAS_ISDN ( 1 << 4 )
149#define LASAT_HAS_LEASEDLINE_IF ( 1 << 5 )
150#define LASAT_HAS_HDC ( 1 << 6 )
151
152#define LASAT_PRID_MASQUERADE2 0
153#define LASAT_PRID_MASQUERADEPRO 1
154#define LASAT_PRID_SAFEPIPE25 2
155#define LASAT_PRID_SAFEPIPE50 3
156#define LASAT_PRID_SAFEPIPE100 4
157#define LASAT_PRID_SAFEPIPE5000 5
158#define LASAT_PRID_SAFEPIPE7000 6
159#define LASAT_PRID_SAFEPIPE30 7
160#define LASAT_PRID_SAFEPIPE5100 8
161#define LASAT_PRID_SAFEPIPE7100 9
162
163#define LASAT_PRID_SAFEPIPE1110 10
164#define LASAT_PRID_SAFEPIPE3020 11
165#define LASAT_PRID_SAFEPIPE3030 12
166#define LASAT_PRID_SAFEPIPE5020 13
167#define LASAT_PRID_SAFEPIPE5030 14
168#define LASAT_PRID_SAFEPIPE1120 15
169#define LASAT_PRID_SAFEPIPE1130 16
170#define LASAT_PRID_SAFEPIPE6010 17
171#define LASAT_PRID_SAFEPIPE6110 18
172#define LASAT_PRID_SAFEPIPE6210 19
173#define LASAT_PRID_SAFEPIPE1020 20
174#define LASAT_PRID_SAFEPIPE1040 21
175#define LASAT_PRID_SAFEPIPE1060 22
176
177struct lasat_info {
178 unsigned int li_cpu_hz;
179 unsigned int li_bus_hz;
180 unsigned int li_bmid;
181 unsigned int li_memsize;
182 unsigned int li_flash_size;
183 unsigned int li_prid;
184 unsigned char li_bmstr[16];
185 unsigned char li_namestr[32];
186 unsigned char li_typestr[16];
187 /* Info on the Flash layout */
188 unsigned int li_flash_base;
189 unsigned long li_flashpart_base[LASAT_MTD_LAST];
190 unsigned long li_flashpart_size[LASAT_MTD_LAST];
191 struct lasat_eeprom_struct li_eeprom_info;
192 unsigned int li_eeprom_upgrade_version;
193 unsigned int li_debugaccess;
194};
195
196extern struct lasat_info lasat_board_info;
197
198static inline unsigned long lasat_flash_partition_start(int partno)
199{
200 if (partno < 0 || partno >= LASAT_MTD_LAST)
201 return 0;
202
203 return lasat_board_info.li_flashpart_base[partno];
204}
205
206static inline unsigned long lasat_flash_partition_size(int partno)
207{
208 if (partno < 0 || partno >= LASAT_MTD_LAST)
209 return 0;
210
211 return lasat_board_info.li_flashpart_size[partno];
212}
213
214/* Called from setup() to initialize the global board_info struct */
215extern int lasat_init_board_info(void);
216
217/* Write the modified EEPROM info struct */
218extern void lasat_write_eeprom_info(void);
219
220#define N_MACHTYPES 2
221/* for calibration of delays */
222
223/* the lasat_ndelay function is necessary because it is used at an
224 * early stage of the boot process where ndelay is not calibrated.
225 * It is used for the bit-banging rtc and eeprom drivers */
226
227#include <asm/delay.h>
228/* calculating with the slowest board with 100 MHz clock */
229#define LASAT_100_DIVIDER 20
230/* All 200's run at 250 MHz clock */
231#define LASAT_200_DIVIDER 8
232
233extern unsigned int lasat_ndelay_divider;
234
235static inline void lasat_ndelay(unsigned int ns)
236{
237 __delay(ns / lasat_ndelay_divider);
238}
239
240#endif /* !defined (_LANGUAGE_ASSEMBLY) */
241
242#define LASAT_SERVICEMODE_MAGIC_1 0xdeadbeef
243#define LASAT_SERVICEMODE_MAGIC_2 0xfedeabba
244
245/* Lasat 100 boards */
246#define LASAT_GT_BASE (KSEG1ADDR(0x14000000))
247
248/* Lasat 200 boards */
249#define Vrc5074_PHYS_BASE 0x1fa00000
250#define Vrc5074_BASE (KSEG1ADDR(Vrc5074_PHYS_BASE))
251#define PCI_WINDOW1 0x1a000000
252
253#endif /* _LASAT_H */
diff --git a/include/asm-mips/lasat/lasatint.h b/include/asm-mips/lasat/lasatint.h
deleted file mode 100644
index 065474feeccc..000000000000
--- a/include/asm-mips/lasat/lasatint.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#define LASATINT_END 16
2
3/* lasat 100 */
4#define LASAT_INT_STATUS_REG_100 (KSEG1ADDR(0x1c880000))
5#define LASAT_INT_MASK_REG_100 (KSEG1ADDR(0x1c890000))
6#define LASATINT_MASK_SHIFT_100 0
7
8/* lasat 200 */
9#define LASAT_INT_STATUS_REG_200 (KSEG1ADDR(0x1104003c))
10#define LASAT_INT_MASK_REG_200 (KSEG1ADDR(0x1104003c))
11#define LASATINT_MASK_SHIFT_200 16
12
diff --git a/include/asm-mips/lasat/picvue.h b/include/asm-mips/lasat/picvue.h
deleted file mode 100644
index 42a492edc40e..000000000000
--- a/include/asm-mips/lasat/picvue.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/* Lasat 100 */
2#define PVC_REG_100 KSEG1ADDR(0x1c820000)
3#define PVC_DATA_SHIFT_100 0
4#define PVC_DATA_M_100 0xFF
5#define PVC_E_100 (1 << 8)
6#define PVC_RW_100 (1 << 9)
7#define PVC_RS_100 (1 << 10)
8
9/* Lasat 200 */
10#define PVC_REG_200 KSEG1ADDR(0x11000000)
11#define PVC_DATA_SHIFT_200 24
12#define PVC_DATA_M_200 (0xFF << PVC_DATA_SHIFT_200)
13#define PVC_E_200 (1 << 16)
14#define PVC_RW_200 (1 << 17)
15#define PVC_RS_200 (1 << 18)
diff --git a/include/asm-mips/lasat/serial.h b/include/asm-mips/lasat/serial.h
deleted file mode 100644
index 9e88c7669c7a..000000000000
--- a/include/asm-mips/lasat/serial.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#include <asm/lasat/lasat.h>
2
3/* Lasat 100 boards serial configuration */
4#define LASAT_BASE_BAUD_100 ( 7372800 / 16 )
5#define LASAT_UART_REGS_BASE_100 0x1c8b0000
6#define LASAT_UART_REGS_SHIFT_100 2
7#define LASATINT_UART_100 8
8
9/* * LASAT 200 boards serial configuration */
10#define LASAT_BASE_BAUD_200 (100000000 / 16 / 12)
11#define LASAT_UART_REGS_BASE_200 (Vrc5074_PHYS_BASE + 0x0300)
12#define LASAT_UART_REGS_SHIFT_200 3
13#define LASATINT_UART_200 13
diff --git a/include/asm-mips/mach-au1x00/au1xxx_gpio.h b/include/asm-mips/mach-au1x00/au1xxx_gpio.h
deleted file mode 100644
index 27911e054ffc..000000000000
--- a/include/asm-mips/mach-au1x00/au1xxx_gpio.h
+++ /dev/null
@@ -1,20 +0,0 @@
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
index 8fcae21adbd5..4663e8b415c9 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_ide.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h
@@ -88,26 +88,26 @@ static const struct drive_list_entry dma_white_list [] = {
88/* 88/*
89 * Hitachi 89 * Hitachi
90 */ 90 */
91 { "HITACHI_DK14FA-20" , "ALL" }, 91 { "HITACHI_DK14FA-20" , NULL },
92 { "HTS726060M9AT00" , "ALL" }, 92 { "HTS726060M9AT00" , NULL },
93/* 93/*
94 * Maxtor 94 * Maxtor
95 */ 95 */
96 { "Maxtor 6E040L0" , "ALL" }, 96 { "Maxtor 6E040L0" , NULL },
97 { "Maxtor 6Y080P0" , "ALL" }, 97 { "Maxtor 6Y080P0" , NULL },
98 { "Maxtor 6Y160P0" , "ALL" }, 98 { "Maxtor 6Y160P0" , NULL },
99/* 99/*
100 * Seagate 100 * Seagate
101 */ 101 */
102 { "ST3120026A" , "ALL" }, 102 { "ST3120026A" , NULL },
103 { "ST320014A" , "ALL" }, 103 { "ST320014A" , NULL },
104 { "ST94011A" , "ALL" }, 104 { "ST94011A" , NULL },
105 { "ST340016A" , "ALL" }, 105 { "ST340016A" , NULL },
106/* 106/*
107 * Western Digital 107 * Western Digital
108 */ 108 */
109 { "WDC WD400UE-00HCT0" , "ALL" }, 109 { "WDC WD400UE-00HCT0" , NULL },
110 { "WDC WD400JB-00JJC0" , "ALL" }, 110 { "WDC WD400JB-00JJC0" , NULL },
111 { NULL , NULL } 111 { NULL , NULL }
112}; 112};
113 113
@@ -116,9 +116,9 @@ static const struct drive_list_entry dma_black_list [] = {
116/* 116/*
117 * Western Digital 117 * Western Digital
118 */ 118 */
119 { "WDC WD100EB-00CGH0" , "ALL" }, 119 { "WDC WD100EB-00CGH0" , NULL },
120 { "WDC WD200BB-00AUA1" , "ALL" }, 120 { "WDC WD200BB-00AUA1" , NULL },
121 { "WDC AC24300L" , "ALL" }, 121 { "WDC AC24300L" , NULL },
122 { NULL , NULL } 122 { NULL , NULL }
123}; 123};
124#endif 124#endif
diff --git a/include/asm-mips/mach-au1x00/gpio.h b/include/asm-mips/mach-au1x00/gpio.h
new file mode 100644
index 000000000000..2dc61e009a08
--- /dev/null
+++ b/include/asm-mips/mach-au1x00/gpio.h
@@ -0,0 +1,69 @@
1#ifndef _AU1XXX_GPIO_H_
2#define _AU1XXX_GPIO_H_
3
4#include <linux/types.h>
5
6#define AU1XXX_GPIO_BASE 200
7
8struct au1x00_gpio2 {
9 u32 dir;
10 u32 reserved;
11 u32 output;
12 u32 pinstate;
13 u32 inten;
14 u32 enable;
15};
16
17extern int au1xxx_gpio_get_value(unsigned gpio);
18extern void au1xxx_gpio_set_value(unsigned gpio, int value);
19extern int au1xxx_gpio_direction_input(unsigned gpio);
20extern int au1xxx_gpio_direction_output(unsigned gpio, int value);
21
22
23/* Wrappers for the arch-neutral GPIO API */
24
25static inline int gpio_request(unsigned gpio, const char *label)
26{
27 /* Not yet implemented */
28 return 0;
29}
30
31static inline void gpio_free(unsigned gpio)
32{
33 /* Not yet implemented */
34}
35
36static inline int gpio_direction_input(unsigned gpio)
37{
38 return au1xxx_gpio_direction_input(gpio);
39}
40
41static inline int gpio_direction_output(unsigned gpio, int value)
42{
43 return au1xxx_gpio_direction_output(gpio, value);
44}
45
46static inline int gpio_get_value(unsigned gpio)
47{
48 return au1xxx_gpio_get_value(gpio);
49}
50
51static inline void gpio_set_value(unsigned gpio, int value)
52{
53 au1xxx_gpio_set_value(gpio, value);
54}
55
56static inline int gpio_to_irq(unsigned gpio)
57{
58 return gpio;
59}
60
61static inline int irq_to_gpio(unsigned irq)
62{
63 return irq;
64}
65
66/* For cansleep */
67#include <asm-generic/gpio.h>
68
69#endif /* _AU1XXX_GPIO_H_ */
diff --git a/include/asm-mips/mach-au1x00/ioremap.h b/include/asm-mips/mach-au1x00/ioremap.h
index 098fca4289bb..364cea2dc71f 100644
--- a/include/asm-mips/mach-au1x00/ioremap.h
+++ b/include/asm-mips/mach-au1x00/ioremap.h
@@ -28,4 +28,15 @@ static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size)
28 return __fixup_bigphys_addr(phys_addr, size); 28 return __fixup_bigphys_addr(phys_addr, size);
29} 29}
30 30
31static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size,
32 unsigned long flags)
33{
34 return NULL;
35}
36
37static inline int plat_iounmap(const volatile void __iomem *addr)
38{
39 return 0;
40}
41
31#endif /* __ASM_MACH_AU1X00_IOREMAP_H */ 42#endif /* __ASM_MACH_AU1X00_IOREMAP_H */
diff --git a/include/asm-mips/mach-cobalt/cobalt.h b/include/asm-mips/mach-cobalt/cobalt.h
index 684a501c04cf..9c9d2b998ca4 100644
--- a/include/asm-mips/mach-cobalt/cobalt.h
+++ b/include/asm-mips/mach-cobalt/cobalt.h
@@ -30,7 +30,6 @@
30#define COBALT_CPU_IRQ MIPS_CPU_IRQ_BASE 30#define COBALT_CPU_IRQ MIPS_CPU_IRQ_BASE
31 31
32#define COBALT_GALILEO_IRQ (COBALT_CPU_IRQ + 2) 32#define COBALT_GALILEO_IRQ (COBALT_CPU_IRQ + 2)
33#define COBALT_SCC_IRQ (COBALT_CPU_IRQ + 3) /* pre-production has 85C30 */
34#define COBALT_RAQ_SCSI_IRQ (COBALT_CPU_IRQ + 3) 33#define COBALT_RAQ_SCSI_IRQ (COBALT_CPU_IRQ + 3)
35#define COBALT_ETH0_IRQ (COBALT_CPU_IRQ + 3) 34#define COBALT_ETH0_IRQ (COBALT_CPU_IRQ + 3)
36#define COBALT_QUBE1_ETH0_IRQ (COBALT_CPU_IRQ + 4) 35#define COBALT_QUBE1_ETH0_IRQ (COBALT_CPU_IRQ + 4)
@@ -71,10 +70,6 @@
71 70
72extern int cobalt_board_id; 71extern int cobalt_board_id;
73 72
74#define PCI_CFG_SET(devfn,where) \
75 GT_WRITE(GT_PCI0_CFGADDR_OFS, (0x80000000 | (PCI_SLOT (devfn) << 11) | \
76 (PCI_FUNC (devfn) << 8) | (where)))
77
78#define COBALT_LED_PORT (*(volatile unsigned char *) CKSEG1ADDR(0x1c000000)) 73#define COBALT_LED_PORT (*(volatile unsigned char *) CKSEG1ADDR(0x1c000000))
79# define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */ 74# define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */
80# define COBALT_LED_BAR_RIGHT (1 << 1) /* Qube */ 75# define COBALT_LED_BAR_RIGHT (1 << 1) /* Qube */
diff --git a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
index c6dfa59d1986..d38f069d9e95 100644
--- a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) 6 * Copyright (C) 2006, 07 Ralf Baechle (ralf@linux-mips.org)
7 */ 7 */
8#ifndef __ASM_COBALT_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_COBALT_CPU_FEATURE_OVERRIDES_H
9#define __ASM_COBALT_CPU_FEATURE_OVERRIDES_H 9#define __ASM_COBALT_CPU_FEATURE_OVERRIDES_H
@@ -46,6 +46,8 @@
46#define cpu_has_ic_fills_f_dc 0 46#define cpu_has_ic_fills_f_dc 0
47#define cpu_icache_snoops_remote_store 0 47#define cpu_icache_snoops_remote_store 0
48#define cpu_has_dsp 0 48#define cpu_has_dsp 0
49#define cpu_has_mipsmt 0
50#define cpu_has_userlocal 0
49 51
50#define cpu_has_mips32r1 0 52#define cpu_has_mips32r1 0
51#define cpu_has_mips32r2 0 53#define cpu_has_mips32r2 0
diff --git a/include/asm-mips/mach-ev64120/mach-gt64120.h b/include/asm-mips/mach-ev64120/mach-gt64120.h
deleted file mode 100644
index 7e272ce57ea3..000000000000
--- a/include/asm-mips/mach-ev64120/mach-gt64120.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * This is a direct copy of the ev96100.h file, with a global
3 * search and replace. The numbers are the same.
4 *
5 * The reason I'm duplicating this is so that the 64120/96100
6 * defines won't be confusing in the source code.
7 */
8#ifndef __ASM_GALILEO_BOARDS_MIPS_EV64120_H
9#define __ASM_GALILEO_BOARDS_MIPS_EV64120_H
10
11/*
12 * GT64120 config space base address
13 */
14extern unsigned long gt64120_base;
15
16#define GT64120_BASE (gt64120_base)
17
18/*
19 * PCI Bus allocation
20 */
21#define GT_PCI_MEM_BASE 0x12000000UL
22#define GT_PCI_MEM_SIZE 0x02000000UL
23#define GT_PCI_IO_BASE 0x10000000UL
24#define GT_PCI_IO_SIZE 0x02000000UL
25#define GT_ISA_IO_BASE PCI_IO_BASE
26
27/*
28 * Duart I/O ports.
29 */
30#define EV64120_COM1_BASE_ADDR (0x1d000000 + 0x20)
31#define EV64120_COM2_BASE_ADDR (0x1d000000 + 0x00)
32
33
34/*
35 * EV64120 interrupt controller register base.
36 */
37#define EV64120_ICTRL_REGS_BASE (KSEG1ADDR(0x1f000000))
38
39/*
40 * EV64120 UART register base.
41 */
42#define EV64120_UART0_REGS_BASE (KSEG1ADDR(EV64120_COM1_BASE_ADDR))
43#define EV64120_UART1_REGS_BASE (KSEG1ADDR(EV64120_COM2_BASE_ADDR))
44#define EV64120_BASE_BAUD ( 3686400 / 16 )
45#define EV64120_UART_IRQ 6
46
47/*
48 * PCI interrupts will come in on either the INTA or INTD interrups lines,
49 * which are mapped to the #2 and #5 interrupt pins of the MIPS. On our
50 * boards, they all either come in on IntD or they all come in on IntA, they
51 * aren't mixed. There can be numerous PCI interrupts, so we keep a list of the
52 * "requested" interrupt numbers and go through the list whenever we get an
53 * IntA/D.
54 *
55 * Interrupts < 8 are directly wired to the processor; PCI INTA is 8 and
56 * INTD is 11.
57 */
58#define GT_TIMER 4
59#define GT_INTA 2
60#define GT_INTD 5
61
62#endif /* __ASM_GALILEO_BOARDS_MIPS_EV64120_H */
diff --git a/include/asm-mips/mach-excite/cpu-feature-overrides.h b/include/asm-mips/mach-excite/cpu-feature-overrides.h
index 0d31854222f9..07f4322c235d 100644
--- a/include/asm-mips/mach-excite/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-excite/cpu-feature-overrides.h
@@ -4,6 +4,7 @@
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2004 Thomas Koeller <thomas.koeller@baslerweb.com> 6 * Copyright (C) 2004 Thomas Koeller <thomas.koeller@baslerweb.com>
7 * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
7 */ 8 */
8#ifndef __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H 9#ifndef __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H 10#define __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H
@@ -27,6 +28,8 @@
27#define cpu_has_ic_fills_f_dc 0 28#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0 29#define cpu_has_dsp 0
29#define cpu_icache_snoops_remote_store 0 30#define cpu_icache_snoops_remote_store 0
31#define cpu_has_mipsmt 0
32#define cpu_has_userlocal 0
30 33
31#define cpu_has_nofpuex 0 34#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 35#define cpu_has_64bits 1
diff --git a/include/asm-mips/mach-generic/gpio.h b/include/asm-mips/mach-generic/gpio.h
new file mode 100644
index 000000000000..6eaf5efedf3a
--- /dev/null
+++ b/include/asm-mips/mach-generic/gpio.h
@@ -0,0 +1,15 @@
1#ifndef __ASM_MACH_GENERIC_GPIO_H
2#define __ASM_MACH_GENERIC_GPIO_H
3
4int gpio_request(unsigned gpio, const char *label);
5void gpio_free(unsigned gpio);
6int gpio_direction_input(unsigned gpio);
7int gpio_direction_output(unsigned gpio, int value);
8int gpio_get_value(unsigned gpio);
9void gpio_set_value(unsigned gpio, int value);
10int gpio_to_irq(unsigned gpio);
11int irq_to_gpio(unsigned irq);
12
13#include <asm-generic/gpio.h> /* cansleep wrappers */
14
15#endif /* __ASM_MACH_GENERIC_GPIO_H */
diff --git a/include/asm-mips/mach-generic/ioremap.h b/include/asm-mips/mach-generic/ioremap.h
index 9b64ff6e485d..b379938d47f0 100644
--- a/include/asm-mips/mach-generic/ioremap.h
+++ b/include/asm-mips/mach-generic/ioremap.h
@@ -20,4 +20,15 @@ static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size)
20 return phys_addr; 20 return phys_addr;
21} 21}
22 22
23static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size,
24 unsigned long flags)
25{
26 return NULL;
27}
28
29static inline int plat_iounmap(const volatile void __iomem *addr)
30{
31 return 0;
32}
33
23#endif /* __ASM_MACH_GENERIC_IOREMAP_H */ 34#endif /* __ASM_MACH_GENERIC_IOREMAP_H */
diff --git a/include/asm-mips/mach-generic/spaces.h b/include/asm-mips/mach-generic/spaces.h
index 0ae9997bc9a8..c9fa4b14968d 100644
--- a/include/asm-mips/mach-generic/spaces.h
+++ b/include/asm-mips/mach-generic/spaces.h
@@ -10,38 +10,54 @@
10#ifndef _ASM_MACH_GENERIC_SPACES_H 10#ifndef _ASM_MACH_GENERIC_SPACES_H
11#define _ASM_MACH_GENERIC_SPACES_H 11#define _ASM_MACH_GENERIC_SPACES_H
12 12
13#include <linux/const.h>
14
15/*
16 * This gives the physical RAM offset.
17 */
18#ifndef PHYS_OFFSET
19#define PHYS_OFFSET _AC(0, UL)
20#endif
13 21
14#ifdef CONFIG_32BIT 22#ifdef CONFIG_32BIT
15 23
16#define CAC_BASE 0x80000000 24#define CAC_BASE _AC(0x80000000, UL)
17#define IO_BASE 0xa0000000 25#define IO_BASE _AC(0xa0000000, UL)
18#define UNCAC_BASE 0xa0000000 26#define UNCAC_BASE _AC(0xa0000000, UL)
19#define MAP_BASE 0xc0000000
20 27
21/* 28#ifndef MAP_BASE
22 * This handles the memory map. 29#define MAP_BASE _AC(0xc0000000, UL)
23 * We handle pages at KSEG0 for kernels with 32 bit address space. 30#endif
24 */
25#define PAGE_OFFSET 0x80000000UL
26 31
27/* 32/*
28 * Memory above this physical address will be considered highmem. 33 * Memory above this physical address will be considered highmem.
29 */ 34 */
30#ifndef HIGHMEM_START 35#ifndef HIGHMEM_START
31#define HIGHMEM_START 0x20000000UL 36#define HIGHMEM_START _AC(0x20000000, UL)
32#endif 37#endif
33 38
34#endif /* CONFIG_32BIT */ 39#endif /* CONFIG_32BIT */
35 40
36#ifdef CONFIG_64BIT 41#ifdef CONFIG_64BIT
37 42
38/* 43#ifndef CAC_BASE
39 * This handles the memory map.
40 */
41#ifdef CONFIG_DMA_NONCOHERENT 44#ifdef CONFIG_DMA_NONCOHERENT
42#define PAGE_OFFSET 0x9800000000000000UL 45#define CAC_BASE _AC(0x9800000000000000, UL)
43#else 46#else
44#define PAGE_OFFSET 0xa800000000000000UL 47#define CAC_BASE _AC(0xa800000000000000, UL)
48#endif
49#endif
50
51#ifndef IO_BASE
52#define IO_BASE _AC(0x9000000000000000, UL)
53#endif
54
55#ifndef UNCAC_BASE
56#define UNCAC_BASE _AC(0x9000000000000000, UL)
57#endif
58
59#ifndef MAP_BASE
60#define MAP_BASE _AC(0xc000000000000000, UL)
45#endif 61#endif
46 62
47/* 63/*
@@ -50,22 +66,20 @@
50 * in the distant future. Nobody will care for a few years :-) 66 * in the distant future. Nobody will care for a few years :-)
51 */ 67 */
52#ifndef HIGHMEM_START 68#ifndef HIGHMEM_START
53#define HIGHMEM_START (1UL << 59UL) 69#define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
54#endif 70#endif
55 71
56#ifdef CONFIG_DMA_NONCOHERENT
57#define CAC_BASE 0x9800000000000000UL
58#else
59#define CAC_BASE 0xa800000000000000UL
60#endif
61#define IO_BASE 0x9000000000000000UL
62#define UNCAC_BASE 0x9000000000000000UL
63#define MAP_BASE 0xc000000000000000UL
64
65#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) 72#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
66#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) 73#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
67#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) 74#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
68 75
69#endif /* CONFIG_64BIT */ 76#endif /* CONFIG_64BIT */
70 77
78/*
79 * This handles the memory map.
80 */
81#ifndef PAGE_OFFSET
82#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
83#endif
84
71#endif /* __ASM_MACH_GENERIC_SPACES_H */ 85#endif /* __ASM_MACH_GENERIC_SPACES_H */
diff --git a/include/asm-mips/mach-ip22/cpu-feature-overrides.h b/include/asm-mips/mach-ip22/cpu-feature-overrides.h
index f7c5dc8a5336..9c8735158da1 100644
--- a/include/asm-mips/mach-ip22/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip22/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003 Ralf Baechle 6 * Copyright (C) 2003, 07 Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
@@ -30,6 +30,8 @@
30#define cpu_has_ic_fills_f_dc 0 30#define cpu_has_ic_fills_f_dc 0
31 31
32#define cpu_has_dsp 0 32#define cpu_has_dsp 0
33#define cpu_has_mipsmt 0
34#define cpu_has_userlocal 0
33 35
34#define cpu_has_nofpuex 0 36#define cpu_has_nofpuex 0
35#define cpu_has_64bits 1 37#define cpu_has_64bits 1
diff --git a/include/asm-mips/mach-ip22/spaces.h b/include/asm-mips/mach-ip22/spaces.h
index ab20c026fd19..7f9fa6f66059 100644
--- a/include/asm-mips/mach-ip22/spaces.h
+++ b/include/asm-mips/mach-ip22/spaces.h
@@ -11,44 +11,17 @@
11#define _ASM_MACH_IP22_SPACES_H 11#define _ASM_MACH_IP22_SPACES_H
12 12
13 13
14#ifdef CONFIG_32BIT
15
16#define CAC_BASE 0x80000000
17#define IO_BASE 0xa0000000
18#define UNCAC_BASE 0xa0000000
19#define MAP_BASE 0xc0000000
20
21/*
22 * This handles the memory map.
23 * We handle pages at KSEG0 for kernels with 32 bit address space.
24 */
25#define PAGE_OFFSET 0x80000000UL
26
27/*
28 * Memory above this physical address will be considered highmem.
29 */
30#ifndef HIGHMEM_START
31#define HIGHMEM_START 0x20000000UL
32#endif
33
34#endif /* CONFIG_32BIT */
35
36#ifdef CONFIG_64BIT 14#ifdef CONFIG_64BIT
37#define PAGE_OFFSET 0xffffffff80000000UL
38 15
39#ifndef HIGHMEM_START 16#define PAGE_OFFSET 0xffffffff80000000UL
40#define HIGHMEM_START (1UL << 59UL)
41#endif
42 17
43#define CAC_BASE 0xffffffff80000000 18#define CAC_BASE 0xffffffff80000000
44#define IO_BASE 0xffffffffa0000000 19#define IO_BASE 0xffffffffa0000000
45#define UNCAC_BASE 0xffffffffa0000000 20#define UNCAC_BASE 0xffffffffa0000000
46#define MAP_BASE 0xc000000000000000 21#define MAP_BASE 0xc000000000000000
47 22
48#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
49#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
50#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
51
52#endif /* CONFIG_64BIT */ 23#endif /* CONFIG_64BIT */
53 24
25#include <asm/mach-generic/spaces.h>
26
54#endif /* __ASM_MACH_IP22_SPACES_H */ 27#endif /* __ASM_MACH_IP22_SPACES_H */
diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
index a071974b67bb..fe076380c189 100644
--- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003 Ralf Baechle 6 * Copyright (C) 2003, 07 Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
@@ -27,6 +27,8 @@
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_has_dsp 0
29#define cpu_icache_snoops_remote_store 1 29#define cpu_icache_snoops_remote_store 1
30#define cpu_has_mipsmt 0
31#define cpu_has_userlocal 0
30 32
31#define cpu_has_nofpuex 0 33#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 34#define cpu_has_64bits 1
diff --git a/include/asm-mips/mach-ip27/spaces.h b/include/asm-mips/mach-ip27/spaces.h
index 45e61785ef42..b18802a0b17e 100644
--- a/include/asm-mips/mach-ip27/spaces.h
+++ b/include/asm-mips/mach-ip27/spaces.h
@@ -14,22 +14,17 @@
14 * IP27 uses the R10000's uncached attribute feature. Attribute 3 selects 14 * IP27 uses the R10000's uncached attribute feature. Attribute 3 selects
15 * uncached memory addressing. 15 * uncached memory addressing.
16 */ 16 */
17#define CAC_BASE 0xa800000000000000
18 17
19#define HSPEC_BASE 0x9000000000000000 18#define HSPEC_BASE 0x9000000000000000
20#define IO_BASE 0x9200000000000000 19#define IO_BASE 0x9200000000000000
21#define MSPEC_BASE 0x9400000000000000 20#define MSPEC_BASE 0x9400000000000000
22#define UNCAC_BASE 0x9600000000000000 21#define UNCAC_BASE 0x9600000000000000
23#define MAP_BASE 0xc000000000000000
24 22
25#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
26#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
27#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
28#define TO_MSPEC(x) (MSPEC_BASE | ((x) & TO_PHYS_MASK)) 23#define TO_MSPEC(x) (MSPEC_BASE | ((x) & TO_PHYS_MASK))
29#define TO_HSPEC(x) (HSPEC_BASE | ((x) & TO_PHYS_MASK)) 24#define TO_HSPEC(x) (HSPEC_BASE | ((x) & TO_PHYS_MASK))
30 25
31#define PAGE_OFFSET CAC_BASE
32
33#define HIGHMEM_START (~0UL) 26#define HIGHMEM_START (~0UL)
34 27
28#include <asm/mach-generic/spaces.h>
29
35#endif /* _ASM_MACH_IP27_SPACES_H */ 30#endif /* _ASM_MACH_IP27_SPACES_H */
diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
index 2a3de092bf13..6782fccebe8d 100644
--- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
@@ -4,7 +4,7 @@
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2005 Ilya A. Volynets-Evenbakh 6 * Copyright (C) 2005 Ilya A. Volynets-Evenbakh
7 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) 7 * Copyright (C) 2005, 07 Ralf Baechle (ralf@linux-mips.org)
8 */ 8 */
9#ifndef __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H 9#ifndef __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H
10#define __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H 10#define __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H
@@ -38,6 +38,8 @@
38#define cpu_has_ic_fills_f_dc 0 38#define cpu_has_ic_fills_f_dc 0
39#define cpu_has_dsp 0 39#define cpu_has_dsp 0
40#define cpu_has_4k_cache 1 40#define cpu_has_4k_cache 1
41#define cpu_has_mipsmt 0
42#define cpu_has_userlocal 0
41 43
42 44
43#define cpu_has_mips32r1 0 45#define cpu_has_mips32r1 0
diff --git a/include/asm-mips/mach-ip32/dma-coherence.h b/include/asm-mips/mach-ip32/dma-coherence.h
index c3f9a6a20eb0..a5511ebb2d53 100644
--- a/include/asm-mips/mach-ip32/dma-coherence.h
+++ b/include/asm-mips/mach-ip32/dma-coherence.h
@@ -6,8 +6,8 @@
6 * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org> 6 * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org>
7 * 7 *
8 */ 8 */
9#ifndef __ASM_MACH_IP35_DMA_COHERENCE_H 9#ifndef __ASM_MACH_IP32_DMA_COHERENCE_H
10#define __ASM_MACH_IP35_DMA_COHERENCE_H 10#define __ASM_MACH_IP32_DMA_COHERENCE_H
11 11
12#include <asm/ip32/crime.h> 12#include <asm/ip32/crime.h>
13 13
@@ -69,4 +69,4 @@ static inline int plat_device_is_coherent(struct device *dev)
69 return 0; /* IP32 is non-cohernet */ 69 return 0; /* IP32 is non-cohernet */
70} 70}
71 71
72#endif /* __ASM_MACH_IP35_DMA_COHERENCE_H */ 72#endif /* __ASM_MACH_IP32_DMA_COHERENCE_H */
diff --git a/include/asm-mips/mach-ip32/spaces.h b/include/asm-mips/mach-ip32/spaces.h
deleted file mode 100644
index 44abe5c02389..000000000000
--- a/include/asm-mips/mach-ip32/spaces.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1994 - 1999, 2000, 03, 04, 05 Ralf Baechle (ralf@linux-mips.org)
7 * Copyright (C) 2000, 2002 Maciej W. Rozycki
8 * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_MACH_IP32_SPACES_H
11#define _ASM_MACH_IP32_SPACES_H
12
13/*
14 * Memory above this physical address will be considered highmem.
15 * Fixme: 59 bits is a fictive number and makes assumptions about processors
16 * in the distant future. Nobody will care for a few years :-)
17 */
18#ifndef HIGHMEM_START
19#define HIGHMEM_START (1UL << 59UL)
20#endif
21
22#define CAC_BASE 0x9800000000000000UL
23#define IO_BASE 0x9000000000000000UL
24#define UNCAC_BASE 0x9000000000000000UL
25#define MAP_BASE 0xc000000000000000UL
26
27#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
28#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
29#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
30
31/*
32 * This handles the memory map.
33 */
34#define PAGE_OFFSET CAC_BASE
35
36#endif /* __ASM_MACH_IP32_SPACES_H */
diff --git a/include/asm-mips/mach-jmr3927/ioremap.h b/include/asm-mips/mach-jmr3927/ioremap.h
new file mode 100644
index 000000000000..aa131ad7f717
--- /dev/null
+++ b/include/asm-mips/mach-jmr3927/ioremap.h
@@ -0,0 +1,38 @@
1/*
2 * include/asm-mips/mach-jmr3927/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_JMR3927_IOREMAP_H
10#define __ASM_MACH_JMR3927_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
23static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size,
24 unsigned long flags)
25{
26#define TXX9_DIRECTMAP_BASE 0xff000000ul
27 if (offset >= TXX9_DIRECTMAP_BASE &&
28 offset < TXX9_DIRECTMAP_BASE + 0xf0000)
29 return (void __iomem *)offset;
30 return NULL;
31}
32
33static inline int plat_iounmap(const volatile void __iomem *addr)
34{
35 return (unsigned long)addr >= TXX9_DIRECTMAP_BASE;
36}
37
38#endif /* __ASM_MACH_JMR3927_IOREMAP_H */
diff --git a/include/asm-mips/mach-lasat/mach-gt64120.h b/include/asm-mips/mach-lasat/mach-gt64120.h
deleted file mode 100644
index 1a9ad45cc135..000000000000
--- a/include/asm-mips/mach-lasat/mach-gt64120.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * This is a direct copy of the ev96100.h file, with a global
3 * search and replace. The numbers are the same.
4 *
5 * The reason I'm duplicating this is so that the 64120/96100
6 * defines won't be confusing in the source code.
7 */
8#ifndef _ASM_GT64120_LASAT_GT64120_DEP_H
9#define _ASM_GT64120_LASAT_GT64120_DEP_H
10
11/*
12 * GT64120 config space base address on Lasat 100
13 */
14#define GT64120_BASE (KSEG1ADDR(0x14000000))
15
16/*
17 * PCI Bus allocation
18 *
19 * (Guessing ...)
20 */
21#define GT_PCI_MEM_BASE 0x12000000UL
22#define GT_PCI_MEM_SIZE 0x02000000UL
23#define GT_PCI_IO_BASE 0x10000000UL
24#define GT_PCI_IO_SIZE 0x02000000UL
25#define GT_ISA_IO_BASE PCI_IO_BASE
26
27#endif /* _ASM_GT64120_LASAT_GT64120_DEP_H */
diff --git a/include/asm-mips/mach-lemote/dma-coherence.h b/include/asm-mips/mach-lemote/dma-coherence.h
new file mode 100644
index 000000000000..7e914777ebc4
--- /dev/null
+++ b/include/asm-mips/mach-lemote/dma-coherence.h
@@ -0,0 +1,42 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2006, 07 Ralf Baechle <ralf@linux-mips.org>
7 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
8 * Author: Fuxin Zhang, zhangfx@lemote.com
9 *
10 */
11#ifndef __ASM_MACH_LEMOTE_DMA_COHERENCE_H
12#define __ASM_MACH_LEMOTE_DMA_COHERENCE_H
13
14struct device;
15
16static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
17 size_t size)
18{
19 return virt_to_phys(addr) | 0x80000000;
20}
21
22static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
23 struct page *page)
24{
25 return page_to_phys(page) | 0x80000000;
26}
27
28static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
29{
30 return dma_addr & 0x7fffffff;
31}
32
33static inline void plat_unmap_dma_mem(dma_addr_t dma_addr)
34{
35}
36
37static inline int plat_device_is_coherent(struct device *dev)
38{
39 return 0;
40}
41
42#endif /* __ASM_MACH_LEMOTE_DMA_COHERENCE_H */
diff --git a/include/asm-mips/mach-lemote/mc146818rtc.h b/include/asm-mips/mach-lemote/mc146818rtc.h
new file mode 100644
index 000000000000..ed5147e11085
--- /dev/null
+++ b/include/asm-mips/mach-lemote/mc146818rtc.h
@@ -0,0 +1,36 @@
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) 1998, 2001, 03, 07 by Ralf Baechle (ralf@linux-mips.org)
7 *
8 * RTC routines for PC style attached Dallas chip.
9 */
10#ifndef __ASM_MACH_LEMOTE_MC146818RTC_H
11#define __ASM_MACH_LEMOTE_MC146818RTC_H
12
13#include <linux/io.h>
14
15#define RTC_PORT(x) (0x70 + (x))
16#define RTC_IRQ 8
17
18static inline unsigned char CMOS_READ(unsigned long addr)
19{
20 outb_p(addr, RTC_PORT(0));
21 return inb_p(RTC_PORT(1));
22}
23
24static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
25{
26 outb_p(addr, RTC_PORT(0));
27 outb_p(data, RTC_PORT(1));
28}
29
30#define RTC_ALWAYS_BCD 0
31
32#ifndef mc146818_decode_year
33#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970)
34#endif
35
36#endif /* __ASM_MACH_LEMOTE_MC146818RTC_H */
diff --git a/include/asm-mips/mach-mips/kernel-entry-init.h b/include/asm-mips/mach-mips/kernel-entry-init.h
new file mode 100644
index 000000000000..0b793e7bf67e
--- /dev/null
+++ b/include/asm-mips/mach-mips/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 * Chris Dearman (chris@mips.com)
7 * Copyright (C) 2007 Mips Technologies, Inc.
8 */
9#ifndef __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H
10#define __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H
11
12 .macro kernel_entry_setup
13#ifdef CONFIG_MIPS_MT_SMTC
14 mfc0 t0, CP0_CONFIG
15 bgez t0, 9f
16 mfc0 t0, CP0_CONFIG, 1
17 bgez t0, 9f
18 mfc0 t0, CP0_CONFIG, 2
19 bgez t0, 9f
20 mfc0 t0, CP0_CONFIG, 3
21 and t0, 1<<2
22 bnez t0, 0f
239:
24 /* Assume we came from YAMON... */
25 PTR_LA v0, 0x9fc00534 /* YAMON print */
26 lw v0, (v0)
27 move a0, zero
28 PTR_LA a1, nonmt_processor
29 jal v0
30
31 PTR_LA v0, 0x9fc00520 /* YAMON exit */
32 lw v0, (v0)
33 li a0, 1
34 jal v0
35
361: b 1b
37
38 __INITDATA
39nonmt_processor:
40 .asciz "SMTC kernel requires the MT ASE to run\n"
41 __FINIT
420:
43#endif
44 .endm
45
46/*
47 * Do SMP slave processor setup necessary before we can safely execute C code.
48 */
49 .macro smp_slave_setup
50 .endm
51
52#endif /* __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H */
diff --git a/include/asm-mips/mach-sim/cpu-feature-overrides.h b/include/asm-mips/mach-mipssim/cpu-feature-overrides.h
index 779b02205737..779b02205737 100644
--- a/include/asm-mips/mach-sim/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-mipssim/cpu-feature-overrides.h
diff --git a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
deleted file mode 100644
index 57a12ded0613..000000000000
--- a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2004 MontaVista Software Inc.
7 * Author: Manish Lachwani, mlachwani@mvista.com
8 * Copyright (C) 2004 Ralf Baechle
9 */
10#ifndef __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H
11#define __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H
12
13/*
14 * Momentum Ocelot-3 is based on Rm7900 processor which
15 * is based on the E9000 core.
16 */
17#define cpu_has_watch 1
18#define cpu_has_mips16 0
19#define cpu_has_divec 0
20#define cpu_has_vce 0
21#define cpu_has_cache_cdex_p 0
22#define cpu_has_cache_cdex_s 0
23#define cpu_has_prefetch 1
24#define cpu_has_mcheck 0
25#define cpu_has_ejtag 0
26
27#define cpu_has_llsc 1
28#define cpu_has_vtag_icache 0
29#define cpu_has_dc_aliases 0
30#define cpu_has_ic_fills_f_dc 0
31#define cpu_has_dsp 0
32#define cpu_icache_snoops_remote_store 0
33
34#define cpu_has_nofpuex 0
35#define cpu_has_64bits 1
36
37#define cpu_has_inclusive_pcaches 0
38
39#define cpu_dcache_line_size() 32
40#define cpu_icache_line_size() 32
41#define cpu_scache_line_size() 32
42
43#define cpu_has_mips32r1 0
44#define cpu_has_mips32r2 0
45#define cpu_has_mips64r1 0
46#define cpu_has_mips64r2 0
47
48#endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-qemu/cpu-feature-overrides.h b/include/asm-mips/mach-qemu/cpu-feature-overrides.h
index 529445dacedb..d2daaed235d5 100644
--- a/include/asm-mips/mach-qemu/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-qemu/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003 Ralf Baechle 6 * Copyright (C) 2003, 07 Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H
@@ -24,6 +24,7 @@
24#define cpu_has_ic_fills_f_dc 0 24#define cpu_has_ic_fills_f_dc 0
25 25
26#define cpu_has_dsp 0 26#define cpu_has_dsp 0
27#define cpu_has_mipsmt 0
27 28
28#define cpu_has_nofpuex 0 29#define cpu_has_nofpuex 0
29#define cpu_has_64bits 0 30#define cpu_has_64bits 0
diff --git a/include/asm-mips/mach-rm/cpu-feature-overrides.h b/include/asm-mips/mach-rm/cpu-feature-overrides.h
index 7e07283140a3..ccf543363537 100644
--- a/include/asm-mips/mach-rm/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-rm/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003, 2004 Ralf Baechle 6 * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)
7 * 7 *
8 * SNI RM200 C apparently was only shipped with R4600 V2.0 and R5000 processors. 8 * SNI RM200 C apparently was only shipped with R4600 V2.0 and R5000 processors.
9 */ 9 */
@@ -32,6 +32,8 @@
32#define cpu_has_dsp 0 32#define cpu_has_dsp 0
33#define cpu_has_nofpuex 0 33#define cpu_has_nofpuex 0
34#define cpu_has_64bits 1 34#define cpu_has_64bits 1
35#define cpu_has_mipsmt 0
36#define cpu_has_userlocal 0
35 37
36#define cpu_has_mips32r1 0 38#define cpu_has_mips32r1 0
37#define cpu_has_mips32r2 0 39#define cpu_has_mips32r2 0
diff --git a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
index a25968f277a2..63d5bf649af1 100644
--- a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003, 2004 Ralf Baechle 6 * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)
7 */ 7 */
8#ifndef __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H
@@ -26,6 +26,8 @@
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_has_dsp 0
29#define cpu_has_mipsmt 0
30#define cpu_has_userlocal 0
29#define cpu_icache_snoops_remote_store 0 31#define cpu_icache_snoops_remote_store 0
30 32
31#define cpu_has_nofpuex 0 33#define cpu_has_nofpuex 0
diff --git a/include/asm-mips/mach-tx49xx/ioremap.h b/include/asm-mips/mach-tx49xx/ioremap.h
new file mode 100644
index 000000000000..1e7beae72229
--- /dev/null
+++ b/include/asm-mips/mach-tx49xx/ioremap.h
@@ -0,0 +1,43 @@
1/*
2 * include/asm-mips/mach-tx49xx/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_TX49XX_IOREMAP_H
10#define __ASM_MACH_TX49XX_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
23static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size,
24 unsigned long flags)
25{
26#ifdef CONFIG_64BIT
27#define TXX9_DIRECTMAP_BASE 0xfff000000ul
28#else
29#define TXX9_DIRECTMAP_BASE 0xff000000ul
30#endif
31 if (offset >= TXX9_DIRECTMAP_BASE &&
32 offset < TXX9_DIRECTMAP_BASE + 0x400000)
33 return (void __iomem *)(unsigned long)(int)offset;
34 return NULL;
35}
36
37static inline int plat_iounmap(const volatile void __iomem *addr)
38{
39 return (unsigned long)addr >=
40 (unsigned long)(int)(TXX9_DIRECTMAP_BASE & 0xffffffff);
41}
42
43#endif /* __ASM_MACH_TX49XX_IOREMAP_H */
diff --git a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
index 42cebb7ce7a6..470e5e9e10d6 100644
--- a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003, 2004 Ralf Baechle 6 * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)
7 */ 7 */
8#ifndef __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H
@@ -26,6 +26,8 @@
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_has_dsp 0
29#define cpu_has_mipsmt 0
30#define cpu_has_userlocal 0
29#define cpu_icache_snoops_remote_store 0 31#define cpu_icache_snoops_remote_store 0
30 32
31#define cpu_has_nofpuex 0 33#define cpu_has_nofpuex 0
diff --git a/include/asm-mips/mips-boards/atlasint.h b/include/asm-mips/mips-boards/atlasint.h
index 76add42e486e..93ba1c1b2a4f 100644
--- a/include/asm-mips/mips-boards/atlasint.h
+++ b/include/asm-mips/mips-boards/atlasint.h
@@ -28,11 +28,6 @@
28 28
29#include <irq.h> 29#include <irq.h>
30 30
31/*
32 * Interrupts 0..7 are used for Atlas CPU interrupts (nonEIC mode)
33 */
34#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
35
36/* CPU interrupt offsets */ 31/* CPU interrupt offsets */
37#define MIPSCPU_INT_SW0 0 32#define MIPSCPU_INT_SW0 0
38#define MIPSCPU_INT_SW1 1 33#define MIPSCPU_INT_SW1 1
@@ -42,7 +37,6 @@
42#define MIPSCPU_INT_MB2 4 37#define MIPSCPU_INT_MB2 4
43#define MIPSCPU_INT_MB3 5 38#define MIPSCPU_INT_MB3 5
44#define MIPSCPU_INT_MB4 6 39#define MIPSCPU_INT_MB4 6
45#define MIPSCPU_INT_CPUCTR 7
46 40
47/* 41/*
48 * Interrupts 8..39 are used for Atlas interrupt controller interrupts 42 * Interrupts 8..39 are used for Atlas interrupt controller interrupts
diff --git a/include/asm-mips/mips-boards/bonito64.h b/include/asm-mips/mips-boards/bonito64.h
index cd7125610100..dc3fc32eedd8 100644
--- a/include/asm-mips/mips-boards/bonito64.h
+++ b/include/asm-mips/mips-boards/bonito64.h
@@ -26,7 +26,12 @@
26/* offsets from base register */ 26/* offsets from base register */
27#define BONITO(x) (x) 27#define BONITO(x) (x)
28 28
29#else /* !__ASSEMBLY__ */ 29#elif defined(CONFIG_LEMOTE_FULONG)
30
31#define BONITO(x) (*(volatile u32 *)((char *)CKSEG1ADDR(BONITO_REG_BASE) + (x)))
32#define BONITO_IRQ_BASE 32
33
34#else
30 35
31/* 36/*
32 * Algorithmics Bonito64 system controller register base. 37 * Algorithmics Bonito64 system controller register base.
diff --git a/include/asm-mips/mips-boards/generic.h b/include/asm-mips/mips-boards/generic.h
index b98f1658cfd0..c8ebcc3e1267 100644
--- a/include/asm-mips/mips-boards/generic.h
+++ b/include/asm-mips/mips-boards/generic.h
@@ -73,12 +73,28 @@
73 * CoreEMUL with Bonito System Controller is treated like a Core20K 73 * CoreEMUL with Bonito System Controller is treated like a Core20K
74 * CoreEMUL with SOC-it 101 System Controller is treated like a CoreMSC 74 * CoreEMUL with SOC-it 101 System Controller is treated like a CoreMSC
75 */ 75 */
76#define MIPS_REVISION_CORID_CORE_EMUL_BON 0x63 76#define MIPS_REVISION_CORID_CORE_EMUL_BON -1
77#define MIPS_REVISION_CORID_CORE_EMUL_MSC 0x65 77#define MIPS_REVISION_CORID_CORE_EMUL_MSC -2
78 78
79#define MIPS_REVISION_CORID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f) 79#define MIPS_REVISION_CORID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f)
80 80
81extern unsigned int mips_revision_corid; 81extern int mips_revision_corid;
82
83#define MIPS_REVISION_SCON_OTHER 0
84#define MIPS_REVISION_SCON_SOCITSC 1
85#define MIPS_REVISION_SCON_SOCITSCP 2
86
87/* Artificial SCON defines for MIPS_REVISION_SCON_OTHER */
88#define MIPS_REVISION_SCON_UNKNOWN -1
89#define MIPS_REVISION_SCON_GT64120 -2
90#define MIPS_REVISION_SCON_BONITO -3
91#define MIPS_REVISION_SCON_BRTL -4
92#define MIPS_REVISION_SCON_SOCIT -5
93#define MIPS_REVISION_SCON_ROCIT -6
94
95#define MIPS_REVISION_SCONID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 24) & 0xff)
96
97extern int mips_revision_sconid;
82 98
83#ifdef CONFIG_PCI 99#ifdef CONFIG_PCI
84extern void mips_pcibios_init(void); 100extern void mips_pcibios_init(void);
diff --git a/include/asm-mips/mips-boards/maltaint.h b/include/asm-mips/mips-boards/maltaint.h
index 9180d6466113..7461318f1cd1 100644
--- a/include/asm-mips/mips-boards/maltaint.h
+++ b/include/asm-mips/mips-boards/maltaint.h
@@ -32,11 +32,6 @@
32 */ 32 */
33#define MALTA_INT_BASE 0 33#define MALTA_INT_BASE 0
34 34
35/*
36 * Interrupts 16..23 are used for Malta CPU interrupts (nonEIC mode)
37 */
38#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
39
40/* CPU interrupt offsets */ 35/* CPU interrupt offsets */
41#define MIPSCPU_INT_SW0 0 36#define MIPSCPU_INT_SW0 0
42#define MIPSCPU_INT_SW1 1 37#define MIPSCPU_INT_SW1 1
@@ -49,7 +44,6 @@
49#define MIPSCPU_INT_COREHI MIPSCPU_INT_MB3 44#define MIPSCPU_INT_COREHI MIPSCPU_INT_MB3
50#define MIPSCPU_INT_MB4 6 45#define MIPSCPU_INT_MB4 6
51#define MIPSCPU_INT_CORELO MIPSCPU_INT_MB4 46#define MIPSCPU_INT_CORELO MIPSCPU_INT_MB4
52#define MIPSCPU_INT_CPUCTR 7
53 47
54/* 48/*
55 * Interrupts 64..127 are used for Soc-it Classic interrupts 49 * Interrupts 64..127 are used for Soc-it Classic interrupts
diff --git a/include/asm-mips/mips-boards/msc01_pci.h b/include/asm-mips/mips-boards/msc01_pci.h
index 8eaefb837b9d..e036b7dd6deb 100644
--- a/include/asm-mips/mips-boards/msc01_pci.h
+++ b/include/asm-mips/mips-boards/msc01_pci.h
@@ -208,6 +208,7 @@
208 * latter, they should be moved elsewhere. 208 * latter, they should be moved elsewhere.
209 */ 209 */
210#define MIPS_MSC01_PCI_REG_BASE 0x1bd00000 210#define MIPS_MSC01_PCI_REG_BASE 0x1bd00000
211#define MIPS_SOCITSC_PCI_REG_BASE 0x1ff10000
211 212
212extern unsigned long _pcictrl_msc; 213extern unsigned long _pcictrl_msc;
213 214
diff --git a/include/asm-mips/mips-boards/prom.h b/include/asm-mips/mips-boards/prom.h
index daaf9f98fc63..a9db576a9768 100644
--- a/include/asm-mips/mips-boards/prom.h
+++ b/include/asm-mips/mips-boards/prom.h
@@ -33,6 +33,7 @@ extern void prom_meminit(void);
33extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem); 33extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem);
34extern void mips_display_message(const char *str); 34extern void mips_display_message(const char *str);
35extern void mips_display_word(unsigned int num); 35extern void mips_display_word(unsigned int num);
36extern void mips_scroll_message(void);
36extern int get_ethernet_addr(char *ethernet_addr); 37extern int get_ethernet_addr(char *ethernet_addr);
37 38
38/* Memory descriptor management. */ 39/* Memory descriptor management. */
diff --git a/include/asm-mips/mips-boards/seadint.h b/include/asm-mips/mips-boards/seadint.h
index 4f6a3933699d..e710bae07340 100644
--- a/include/asm-mips/mips-boards/seadint.h
+++ b/include/asm-mips/mips-boards/seadint.h
@@ -22,14 +22,7 @@
22 22
23#include <irq.h> 23#include <irq.h>
24 24
25/*
26 * Interrupts 0..7 are used for SEAD CPU interrupts
27 */
28#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
29
30#define MIPSCPU_INT_UART0 2 25#define MIPSCPU_INT_UART0 2
31#define MIPSCPU_INT_UART1 3 26#define MIPSCPU_INT_UART1 3
32 27
33#define MIPSCPU_INT_CPUCTR 7
34
35#endif /* !(_MIPS_SEADINT_H) */ 28#endif /* !(_MIPS_SEADINT_H) */
diff --git a/include/asm-mips/mips-boards/simint.h b/include/asm-mips/mips-boards/simint.h
index 54f2fe621d69..8ef6db76d5c1 100644
--- a/include/asm-mips/mips-boards/simint.h
+++ b/include/asm-mips/mips-boards/simint.h
@@ -21,15 +21,11 @@
21 21
22#define SIM_INT_BASE 0 22#define SIM_INT_BASE 0
23#define MIPSCPU_INT_MB0 2 23#define MIPSCPU_INT_MB0 2
24#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
25#define MIPS_CPU_TIMER_IRQ 7 24#define MIPS_CPU_TIMER_IRQ 7
26 25
27 26
28#define MIPSCPU_INT_CPUCTR 7
29
30#define MSC01E_INT_BASE 64 27#define MSC01E_INT_BASE 64
31 28
32#define MIPSCPU_INT_CPUCTR 7
33#define MSC01E_INT_CPUCTR 11 29#define MSC01E_INT_CPUCTR 11
34 30
35#endif 31#endif
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h
index 9985cb7c16e7..18f47f1e8cd5 100644
--- a/include/asm-mips/mipsregs.h
+++ b/include/asm-mips/mipsregs.h
@@ -7,7 +7,7 @@
7 * Copyright (C) 2000 Silicon Graphics, Inc. 7 * Copyright (C) 2000 Silicon Graphics, Inc.
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, 07 MIPS Technologies, Inc.
11 * Copyright (C) 2003, 2004 Maciej W. Rozycki 11 * Copyright (C) 2003, 2004 Maciej W. Rozycki
12 */ 12 */
13#ifndef _ASM_MIPSREGS_H 13#ifndef _ASM_MIPSREGS_H
@@ -15,6 +15,7 @@
15 15
16#include <linux/linkage.h> 16#include <linux/linkage.h>
17#include <asm/hazards.h> 17#include <asm/hazards.h>
18#include <asm/war.h>
18 19
19/* 20/*
20 * The following macros are especially useful for __asm__ 21 * The following macros are especially useful for __asm__
@@ -533,6 +534,12 @@
533#define MIPS_CONF3_VEIC (_ULCAST_(1) << 6) 534#define MIPS_CONF3_VEIC (_ULCAST_(1) << 6)
534#define MIPS_CONF3_LPA (_ULCAST_(1) << 7) 535#define MIPS_CONF3_LPA (_ULCAST_(1) << 7)
535#define MIPS_CONF3_DSP (_ULCAST_(1) << 10) 536#define MIPS_CONF3_DSP (_ULCAST_(1) << 10)
537#define MIPS_CONF3_ULRI (_ULCAST_(1) << 13)
538
539#define MIPS_CONF7_WII (_ULCAST_(1) << 31)
540
541#define MIPS_CONF7_RPS (_ULCAST_(1) << 2)
542
536 543
537/* 544/*
538 * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register. 545 * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register.
@@ -700,10 +707,10 @@ do { \
700 */ 707 */
701#define __read_64bit_c0_split(source, sel) \ 708#define __read_64bit_c0_split(source, sel) \
702({ \ 709({ \
703 unsigned long long val; \ 710 unsigned long long __val; \
704 unsigned long flags; \ 711 unsigned long __flags; \
705 \ 712 \
706 local_irq_save(flags); \ 713 local_irq_save(__flags); \
707 if (sel == 0) \ 714 if (sel == 0) \
708 __asm__ __volatile__( \ 715 __asm__ __volatile__( \
709 ".set\tmips64\n\t" \ 716 ".set\tmips64\n\t" \
@@ -712,7 +719,7 @@ do { \
712 "dsrl\t%M0, %M0, 32\n\t" \ 719 "dsrl\t%M0, %M0, 32\n\t" \
713 "dsrl\t%L0, %L0, 32\n\t" \ 720 "dsrl\t%L0, %L0, 32\n\t" \
714 ".set\tmips0" \ 721 ".set\tmips0" \
715 : "=r" (val)); \ 722 : "=r" (__val)); \
716 else \ 723 else \
717 __asm__ __volatile__( \ 724 __asm__ __volatile__( \
718 ".set\tmips64\n\t" \ 725 ".set\tmips64\n\t" \
@@ -721,17 +728,17 @@ do { \
721 "dsrl\t%M0, %M0, 32\n\t" \ 728 "dsrl\t%M0, %M0, 32\n\t" \
722 "dsrl\t%L0, %L0, 32\n\t" \ 729 "dsrl\t%L0, %L0, 32\n\t" \
723 ".set\tmips0" \ 730 ".set\tmips0" \
724 : "=r" (val)); \ 731 : "=r" (__val)); \
725 local_irq_restore(flags); \ 732 local_irq_restore(__flags); \
726 \ 733 \
727 val; \ 734 __val; \
728}) 735})
729 736
730#define __write_64bit_c0_split(source, sel, val) \ 737#define __write_64bit_c0_split(source, sel, val) \
731do { \ 738do { \
732 unsigned long flags; \ 739 unsigned long __flags; \
733 \ 740 \
734 local_irq_save(flags); \ 741 local_irq_save(__flags); \
735 if (sel == 0) \ 742 if (sel == 0) \
736 __asm__ __volatile__( \ 743 __asm__ __volatile__( \
737 ".set\tmips64\n\t" \ 744 ".set\tmips64\n\t" \
@@ -752,7 +759,7 @@ do { \
752 "dmtc0\t%L0, " #source ", " #sel "\n\t" \ 759 "dmtc0\t%L0, " #source ", " #sel "\n\t" \
753 ".set\tmips0" \ 760 ".set\tmips0" \
754 : : "r" (val)); \ 761 : : "r" (val)); \
755 local_irq_restore(flags); \ 762 local_irq_restore(__flags); \
756} while (0) 763} while (0)
757 764
758#define read_c0_index() __read_32bit_c0_register($0, 0) 765#define read_c0_index() __read_32bit_c0_register($0, 0)
@@ -770,6 +777,9 @@ do { \
770#define read_c0_context() __read_ulong_c0_register($4, 0) 777#define read_c0_context() __read_ulong_c0_register($4, 0)
771#define write_c0_context(val) __write_ulong_c0_register($4, 0, val) 778#define write_c0_context(val) __write_ulong_c0_register($4, 0, val)
772 779
780#define read_c0_userlocal() __read_ulong_c0_register($4, 2)
781#define write_c0_userlocal(val) __write_ulong_c0_register($4, 2, val)
782
773#define read_c0_pagemask() __read_32bit_c0_register($5, 0) 783#define read_c0_pagemask() __read_32bit_c0_register($5, 0)
774#define write_c0_pagemask(val) __write_32bit_c0_register($5, 0, val) 784#define write_c0_pagemask(val) __write_32bit_c0_register($5, 0, val)
775 785
@@ -1292,10 +1302,39 @@ static inline void tlb_probe(void)
1292 1302
1293static inline void tlb_read(void) 1303static inline void tlb_read(void)
1294{ 1304{
1305#if MIPS34K_MISSED_ITLB_WAR
1306 int res = 0;
1307
1308 __asm__ __volatile__(
1309 " .set push \n"
1310 " .set noreorder \n"
1311 " .set noat \n"
1312 " .set mips32r2 \n"
1313 " .word 0x41610001 # dvpe $1 \n"
1314 " move %0, $1 \n"
1315 " ehb \n"
1316 " .set pop \n"
1317 : "=r" (res));
1318
1319 instruction_hazard();
1320#endif
1321
1295 __asm__ __volatile__( 1322 __asm__ __volatile__(
1296 ".set noreorder\n\t" 1323 ".set noreorder\n\t"
1297 "tlbr\n\t" 1324 "tlbr\n\t"
1298 ".set reorder"); 1325 ".set reorder");
1326
1327#if MIPS34K_MISSED_ITLB_WAR
1328 if ((res & _ULCAST_(1)))
1329 __asm__ __volatile__(
1330 " .set push \n"
1331 " .set noreorder \n"
1332 " .set noat \n"
1333 " .set mips32r2 \n"
1334 " .word 0x41600021 # evpe \n"
1335 " ehb \n"
1336 " .set pop \n");
1337#endif
1299} 1338}
1300 1339
1301static inline void tlb_write_indexed(void) 1340static inline void tlb_write_indexed(void)
diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h
index 399d03f1c4fc..de6d09ebbd80 100644
--- a/include/asm-mips/module.h
+++ b/include/asm-mips/module.h
@@ -112,6 +112,8 @@ search_module_dbetables(unsigned long addr)
112#define MODULE_PROC_FAMILY "RM9000 " 112#define MODULE_PROC_FAMILY "RM9000 "
113#elif defined CONFIG_CPU_SB1 113#elif defined CONFIG_CPU_SB1
114#define MODULE_PROC_FAMILY "SB1 " 114#define MODULE_PROC_FAMILY "SB1 "
115#elif defined CONFIG_CPU_LOONGSON2
116#define MODULE_PROC_FAMILY "LOONGSON2 "
115#else 117#else
116#error MODULE_PROC_FAMILY undefined for your processor configuration 118#error MODULE_PROC_FAMILY undefined for your processor configuration
117#endif 119#endif
@@ -122,6 +124,13 @@ search_module_dbetables(unsigned long addr)
122#define MODULE_KERNEL_TYPE "64BIT " 124#define MODULE_KERNEL_TYPE "64BIT "
123#endif 125#endif
124 126
125#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_KERNEL_TYPE 127#ifdef CONFIG_MIPS_MT_SMTC
128#define MODULE_KERNEL_SMTC "MT_SMTC "
129#else
130#define MODULE_KERNEL_SMTC ""
131#endif
132
133#define MODULE_ARCH_VERMAGIC \
134 MODULE_PROC_FAMILY MODULE_KERNEL_TYPE MODULE_KERNEL_SMTC
126 135
127#endif /* _ASM_MODULE_H */ 136#endif /* _ASM_MODULE_H */
diff --git a/include/asm-mips/nile4.h b/include/asm-mips/nile4.h
deleted file mode 100644
index c3ca959aa4d9..000000000000
--- a/include/asm-mips/nile4.h
+++ /dev/null
@@ -1,310 +0,0 @@
1/*
2 * asm-mips/nile4.h -- NEC Vrc-5074 Nile 4 definitions
3 *
4 * Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
5 * Sony Software Development Center Europe (SDCE), Brussels
6 *
7 * This file is based on the following documentation:
8 *
9 * NEC Vrc 5074 System Controller Data Sheet, June 1998
10 */
11
12#ifndef _ASM_NILE4_H
13#define _ASM_NILE4_H
14
15#define NILE4_BASE 0xbfa00000
16#define NILE4_SIZE 0x00200000 /* 2 MB */
17
18
19 /*
20 * Physical Device Address Registers (PDARs)
21 */
22
23#define NILE4_SDRAM0 0x0000 /* SDRAM Bank 0 [R/W] */
24#define NILE4_SDRAM1 0x0008 /* SDRAM Bank 1 [R/W] */
25#define NILE4_DCS2 0x0010 /* Device Chip-Select 2 [R/W] */
26#define NILE4_DCS3 0x0018 /* Device Chip-Select 3 [R/W] */
27#define NILE4_DCS4 0x0020 /* Device Chip-Select 4 [R/W] */
28#define NILE4_DCS5 0x0028 /* Device Chip-Select 5 [R/W] */
29#define NILE4_DCS6 0x0030 /* Device Chip-Select 6 [R/W] */
30#define NILE4_DCS7 0x0038 /* Device Chip-Select 7 [R/W] */
31#define NILE4_DCS8 0x0040 /* Device Chip-Select 8 [R/W] */
32#define NILE4_PCIW0 0x0060 /* PCI Address Window 0 [R/W] */
33#define NILE4_PCIW1 0x0068 /* PCI Address Window 1 [R/W] */
34#define NILE4_INTCS 0x0070 /* Controller Internal Registers and Devices */
35 /* [R/W] */
36#define NILE4_BOOTCS 0x0078 /* Boot ROM Chip-Select [R/W] */
37
38
39 /*
40 * CPU Interface Registers
41 */
42
43#define NILE4_CPUSTAT 0x0080 /* CPU Status [R/W] */
44#define NILE4_INTCTRL 0x0088 /* Interrupt Control [R/W] */
45#define NILE4_INTSTAT0 0x0090 /* Interrupt Status 0 [R] */
46#define NILE4_INTSTAT1 0x0098 /* Interrupt Status 1 and CPU Interrupt */
47 /* Enable [R/W] */
48#define NILE4_INTCLR 0x00A0 /* Interrupt Clear [R/W] */
49#define NILE4_INTPPES 0x00A8 /* PCI Interrupt Control [R/W] */
50
51
52 /*
53 * Memory-Interface Registers
54 */
55
56#define NILE4_MEMCTRL 0x00C0 /* Memory Control */
57#define NILE4_ACSTIME 0x00C8 /* Memory Access Timing [R/W] */
58#define NILE4_CHKERR 0x00D0 /* Memory Check Error Status [R] */
59
60
61 /*
62 * PCI-Bus Registers
63 */
64
65#define NILE4_PCICTRL 0x00E0 /* PCI Control [R/W] */
66#define NILE4_PCIARB 0x00E8 /* PCI Arbiter [R/W] */
67#define NILE4_PCIINIT0 0x00F0 /* PCI Master (Initiator) 0 [R/W] */
68#define NILE4_PCIINIT1 0x00F8 /* PCI Master (Initiator) 1 [R/W] */
69#define NILE4_PCIERR 0x00B8 /* PCI Error [R/W] */
70
71
72 /*
73 * Local-Bus Registers
74 */
75
76#define NILE4_LCNFG 0x0100 /* Local Bus Configuration [R/W] */
77#define NILE4_LCST2 0x0110 /* Local Bus Chip-Select Timing 2 [R/W] */
78#define NILE4_LCST3 0x0118 /* Local Bus Chip-Select Timing 3 [R/W] */
79#define NILE4_LCST4 0x0120 /* Local Bus Chip-Select Timing 4 [R/W] */
80#define NILE4_LCST5 0x0128 /* Local Bus Chip-Select Timing 5 [R/W] */
81#define NILE4_LCST6 0x0130 /* Local Bus Chip-Select Timing 6 [R/W] */
82#define NILE4_LCST7 0x0138 /* Local Bus Chip-Select Timing 7 [R/W] */
83#define NILE4_LCST8 0x0140 /* Local Bus Chip-Select Timing 8 [R/W] */
84#define NILE4_DCSFN 0x0150 /* Device Chip-Select Muxing and Output */
85 /* Enables [R/W] */
86#define NILE4_DCSIO 0x0158 /* Device Chip-Selects As I/O Bits [R/W] */
87#define NILE4_BCST 0x0178 /* Local Boot Chip-Select Timing [R/W] */
88
89
90 /*
91 * DMA Registers
92 */
93
94#define NILE4_DMACTRL0 0x0180 /* DMA Control 0 [R/W] */
95#define NILE4_DMASRCA0 0x0188 /* DMA Source Address 0 [R/W] */
96#define NILE4_DMADESA0 0x0190 /* DMA Destination Address 0 [R/W] */
97#define NILE4_DMACTRL1 0x0198 /* DMA Control 1 [R/W] */
98#define NILE4_DMASRCA1 0x01A0 /* DMA Source Address 1 [R/W] */
99#define NILE4_DMADESA1 0x01A8 /* DMA Destination Address 1 [R/W] */
100
101
102 /*
103 * Timer Registers
104 */
105
106#define NILE4_T0CTRL 0x01C0 /* SDRAM Refresh Control [R/W] */
107#define NILE4_T0CNTR 0x01C8 /* SDRAM Refresh Counter [R/W] */
108#define NILE4_T1CTRL 0x01D0 /* CPU-Bus Read Time-Out Control [R/W] */
109#define NILE4_T1CNTR 0x01D8 /* CPU-Bus Read Time-Out Counter [R/W] */
110#define NILE4_T2CTRL 0x01E0 /* General-Purpose Timer Control [R/W] */
111#define NILE4_T2CNTR 0x01E8 /* General-Purpose Timer Counter [R/W] */
112#define NILE4_T3CTRL 0x01F0 /* Watchdog Timer Control [R/W] */
113#define NILE4_T3CNTR 0x01F8 /* Watchdog Timer Counter [R/W] */
114
115
116 /*
117 * PCI Configuration Space Registers
118 */
119
120#define NILE4_PCI_BASE 0x0200
121
122#define NILE4_VID 0x0200 /* PCI Vendor ID [R] */
123#define NILE4_DID 0x0202 /* PCI Device ID [R] */
124#define NILE4_PCICMD 0x0204 /* PCI Command [R/W] */
125#define NILE4_PCISTS 0x0206 /* PCI Status [R/W] */
126#define NILE4_REVID 0x0208 /* PCI Revision ID [R] */
127#define NILE4_CLASS 0x0209 /* PCI Class Code [R] */
128#define NILE4_CLSIZ 0x020C /* PCI Cache Line Size [R/W] */
129#define NILE4_MLTIM 0x020D /* PCI Latency Timer [R/W] */
130#define NILE4_HTYPE 0x020E /* PCI Header Type [R] */
131#define NILE4_BIST 0x020F /* BIST [R] (unimplemented) */
132#define NILE4_BARC 0x0210 /* PCI Base Address Register Control [R/W] */
133#define NILE4_BAR0 0x0218 /* PCI Base Address Register 0 [R/W] */
134#define NILE4_BAR1 0x0220 /* PCI Base Address Register 1 [R/W] */
135#define NILE4_CIS 0x0228 /* PCI Cardbus CIS Pointer [R] */
136 /* (unimplemented) */
137#define NILE4_SSVID 0x022C /* PCI Sub-System Vendor ID [R/W] */
138#define NILE4_SSID 0x022E /* PCI Sub-System ID [R/W] */
139#define NILE4_ROM 0x0230 /* Expansion ROM Base Address [R] */
140 /* (unimplemented) */
141#define NILE4_INTLIN 0x023C /* PCI Interrupt Line [R/W] */
142#define NILE4_INTPIN 0x023D /* PCI Interrupt Pin [R] */
143#define NILE4_MINGNT 0x023E /* PCI Min_Gnt [R] (unimplemented) */
144#define NILE4_MAXLAT 0x023F /* PCI Max_Lat [R] (unimplemented) */
145#define NILE4_BAR2 0x0240 /* PCI Base Address Register 2 [R/W] */
146#define NILE4_BAR3 0x0248 /* PCI Base Address Register 3 [R/W] */
147#define NILE4_BAR4 0x0250 /* PCI Base Address Register 4 [R/W] */
148#define NILE4_BAR5 0x0258 /* PCI Base Address Register 5 [R/W] */
149#define NILE4_BAR6 0x0260 /* PCI Base Address Register 6 [R/W] */
150#define NILE4_BAR7 0x0268 /* PCI Base Address Register 7 [R/W] */
151#define NILE4_BAR8 0x0270 /* PCI Base Address Register 8 [R/W] */
152#define NILE4_BARB 0x0278 /* PCI Base Address Register BOOT [R/W] */
153
154
155 /*
156 * Serial-Port Registers
157 */
158
159#define NILE4_UART_BASE 0x0300
160
161#define NILE4_UARTRBR 0x0300 /* UART Receiver Data Buffer [R] */
162#define NILE4_UARTTHR 0x0300 /* UART Transmitter Data Holding [W] */
163#define NILE4_UARTIER 0x0308 /* UART Interrupt Enable [R/W] */
164#define NILE4_UARTDLL 0x0300 /* UART Divisor Latch LSB [R/W] */
165#define NILE4_UARTDLM 0x0308 /* UART Divisor Latch MSB [R/W] */
166#define NILE4_UARTIIR 0x0310 /* UART Interrupt ID [R] */
167#define NILE4_UARTFCR 0x0310 /* UART FIFO Control [W] */
168#define NILE4_UARTLCR 0x0318 /* UART Line Control [R/W] */
169#define NILE4_UARTMCR 0x0320 /* UART Modem Control [R/W] */
170#define NILE4_UARTLSR 0x0328 /* UART Line Status [R/W] */
171#define NILE4_UARTMSR 0x0330 /* UART Modem Status [R/W] */
172#define NILE4_UARTSCR 0x0338 /* UART Scratch [R/W] */
173
174#define NILE4_UART_BASE_BAUD 520833 /* 100 MHz / 12 / 16 */
175
176
177 /*
178 * Interrupt Lines
179 */
180
181#define NILE4_INT_CPCE 0 /* CPU-Interface Parity-Error Interrupt */
182#define NILE4_INT_CNTD 1 /* CPU No-Target Decode Interrupt */
183#define NILE4_INT_MCE 2 /* Memory-Check Error Interrupt */
184#define NILE4_INT_DMA 3 /* DMA Controller Interrupt */
185#define NILE4_INT_UART 4 /* UART Interrupt */
186#define NILE4_INT_WDOG 5 /* Watchdog Timer Interrupt */
187#define NILE4_INT_GPT 6 /* General-Purpose Timer Interrupt */
188#define NILE4_INT_LBRTD 7 /* Local-Bus Ready Timer Interrupt */
189#define NILE4_INT_INTA 8 /* PCI Interrupt Signal INTA# */
190#define NILE4_INT_INTB 9 /* PCI Interrupt Signal INTB# */
191#define NILE4_INT_INTC 10 /* PCI Interrupt Signal INTC# */
192#define NILE4_INT_INTD 11 /* PCI Interrupt Signal INTD# */
193#define NILE4_INT_INTE 12 /* PCI Interrupt Signal INTE# (ISA cascade) */
194#define NILE4_INT_RESV 13 /* Reserved */
195#define NILE4_INT_PCIS 14 /* PCI SERR# Interrupt */
196#define NILE4_INT_PCIE 15 /* PCI Internal Error Interrupt */
197
198
199 /*
200 * Nile 4 Register Access
201 */
202
203static inline void nile4_sync(void)
204{
205 volatile u32 *p = (volatile u32 *)0xbfc00000;
206 (void)(*p);
207}
208
209static inline void nile4_out32(u32 offset, u32 val)
210{
211 *(volatile u32 *)(NILE4_BASE+offset) = val;
212 nile4_sync();
213}
214
215static inline u32 nile4_in32(u32 offset)
216{
217 u32 val = *(volatile u32 *)(NILE4_BASE+offset);
218 nile4_sync();
219 return val;
220}
221
222static inline void nile4_out16(u32 offset, u16 val)
223{
224 *(volatile u16 *)(NILE4_BASE+offset) = val;
225 nile4_sync();
226}
227
228static inline u16 nile4_in16(u32 offset)
229{
230 u16 val = *(volatile u16 *)(NILE4_BASE+offset);
231 nile4_sync();
232 return val;
233}
234
235static inline void nile4_out8(u32 offset, u8 val)
236{
237 *(volatile u8 *)(NILE4_BASE+offset) = val;
238 nile4_sync();
239}
240
241static inline u8 nile4_in8(u32 offset)
242{
243 u8 val = *(volatile u8 *)(NILE4_BASE+offset);
244 nile4_sync();
245 return val;
246}
247
248
249 /*
250 * Physical Device Address Registers
251 */
252
253extern void nile4_set_pdar(u32 pdar, u32 phys, u32 size, int width,
254 int on_memory_bus, int visible);
255
256
257 /*
258 * PCI Master Registers
259 */
260
261#define NILE4_PCICMD_IACK 0 /* PCI Interrupt Acknowledge */
262#define NILE4_PCICMD_IO 1 /* PCI I/O Space */
263#define NILE4_PCICMD_MEM 3 /* PCI Memory Space */
264#define NILE4_PCICMD_CFG 5 /* PCI Configuration Space */
265
266
267 /*
268 * PCI Address Spaces
269 *
270 * Note that these are multiplexed using PCIINIT[01]!
271 */
272
273#define NILE4_PCI_IO_BASE 0xa6000000
274#define NILE4_PCI_MEM_BASE 0xa8000000
275#define NILE4_PCI_CFG_BASE NILE4_PCI_MEM_BASE
276#define NILE4_PCI_IACK_BASE NILE4_PCI_IO_BASE
277
278
279extern void nile4_set_pmr(u32 pmr, u32 type, u32 addr);
280
281
282 /*
283 * Interrupt Programming
284 */
285
286#define NUM_I8259_INTERRUPTS 16
287#define NUM_NILE4_INTERRUPTS 16
288
289#define IRQ_I8259_CASCADE NILE4_INT_INTE
290#define is_i8259_irq(irq) ((irq) < NUM_I8259_INTERRUPTS)
291#define nile4_to_irq(n) ((n)+NUM_I8259_INTERRUPTS)
292#define irq_to_nile4(n) ((n)-NUM_I8259_INTERRUPTS)
293
294extern void nile4_map_irq(int nile4_irq, int cpu_irq);
295extern void nile4_map_irq_all(int cpu_irq);
296extern void nile4_enable_irq(unsigned int nile4_irq);
297extern void nile4_disable_irq(unsigned int nile4_irq);
298extern void nile4_disable_irq_all(void);
299extern u16 nile4_get_irq_stat(int cpu_irq);
300extern void nile4_enable_irq_output(int cpu_irq);
301extern void nile4_disable_irq_output(int cpu_irq);
302extern void nile4_set_pci_irq_polarity(int pci_irq, int high);
303extern void nile4_set_pci_irq_level_or_edge(int pci_irq, int level);
304extern void nile4_clear_irq(int nile4_irq);
305extern void nile4_clear_irq_mask(u32 mask);
306extern u8 nile4_i8259_iack(void);
307extern void nile4_dump_irq_status(void); /* Debug */
308
309#endif
310
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 5c3239dad0f2..b92dd8c760da 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -34,12 +34,8 @@
34 34
35#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
36 36
37/* 37#include <linux/pfn.h>
38 * This gives the physical RAM offset. 38#include <asm/io.h>
39 */
40#ifndef PHYS_OFFSET
41#define PHYS_OFFSET 0UL
42#endif
43 39
44/* 40/*
45 * It's normally defined only for FLATMEM config but it's 41 * It's normally defined only for FLATMEM config but it's
@@ -48,9 +44,6 @@
48 */ 44 */
49#define ARCH_PFN_OFFSET PFN_UP(PHYS_OFFSET) 45#define ARCH_PFN_OFFSET PFN_UP(PHYS_OFFSET)
50 46
51#include <linux/pfn.h>
52#include <asm/io.h>
53
54extern void clear_page(void * page); 47extern void clear_page(void * page);
55extern void copy_page(void * to, void * from); 48extern void copy_page(void * to, void * from);
56 49
@@ -150,11 +143,15 @@ typedef struct { unsigned long pgprot; } pgprot_t;
150 * __pa()/__va() should be used only during mem init. 143 * __pa()/__va() should be used only during mem init.
151 */ 144 */
152#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) 145#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
153#define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0) 146#define __pa(x) \
147({ \
148 unsigned long __x = (unsigned long)(x); \
149 __x < CKSEG0 ? XPHYSADDR(__x) : CPHYSADDR(__x); \
150})
154#else 151#else
155#define __pa_page_offset(x) PAGE_OFFSET 152#define __pa(x) \
153 ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET)
156#endif 154#endif
157#define __pa(x) ((unsigned long)(x) - __pa_page_offset(x) + PHYS_OFFSET)
158#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) 155#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
159#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0)) 156#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0))
160 157
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index 3eea3ba0fca5..4fcc185cb2d1 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -56,7 +56,7 @@ extern void register_pci_controller(struct pci_controller *hose);
56/* 56/*
57 * board supplied pci irq fixup routine 57 * board supplied pci irq fixup routine
58 */ 58 */
59extern int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin); 59extern int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
60 60
61 61
62/* Can be used to override the logic in pci_scan_bus for skipping 62/* Can be used to override the logic in pci_scan_bus for skipping
@@ -121,20 +121,6 @@ extern unsigned int PCI_DMA_BUS_IS_PHYS;
121 121
122#endif /* CONFIG_DMA_NEED_PCI_MAP_STATE */ 122#endif /* CONFIG_DMA_NEED_PCI_MAP_STATE */
123 123
124/* This is always fine. */
125#define pci_dac_dma_supported(pci_dev, mask) (1)
126
127extern dma64_addr_t pci_dac_page_to_dma(struct pci_dev *pdev,
128 struct page *page, unsigned long offset, int direction);
129extern struct page *pci_dac_dma_to_page(struct pci_dev *pdev,
130 dma64_addr_t dma_addr);
131extern unsigned long pci_dac_dma_to_offset(struct pci_dev *pdev,
132 dma64_addr_t dma_addr);
133extern void pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev,
134 dma64_addr_t dma_addr, size_t len, int direction);
135extern void pci_dac_dma_sync_single_for_device(struct pci_dev *pdev,
136 dma64_addr_t dma_addr, size_t len, int direction);
137
138#ifdef CONFIG_PCI 124#ifdef CONFIG_PCI
139static inline void pci_dma_burst_advice(struct pci_dev *pdev, 125static inline void pci_dma_burst_advice(struct pci_dev *pdev,
140 enum pci_dma_burst_strategy *strat, 126 enum pci_dma_burst_strategy *strat,
@@ -181,10 +167,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
181/* implement the pci_ DMA API in terms of the generic device dma_ one */ 167/* implement the pci_ DMA API in terms of the generic device dma_ one */
182#include <asm-generic/pci-dma-compat.h> 168#include <asm-generic/pci-dma-compat.h>
183 169
184static inline void pcibios_add_platform_entries(struct pci_dev *dev)
185{
186}
187
188/* Do platform specific device initialization at pci_enable_device() time */ 170/* Do platform specific device initialization at pci_enable_device() time */
189extern int pcibios_plat_dev_init(struct pci_dev *dev); 171extern int pcibios_plat_dev_init(struct pci_dev *dev);
190 172
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 27d77d981937..2e2d70d13ff6 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -178,9 +178,7 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
178 * The following only work if pte_present() is true. 178 * The following only work if pte_present() is true.
179 * Undefined behaviour if not.. 179 * Undefined behaviour if not..
180 */ 180 */
181static inline int pte_user(pte_t pte) { BUG(); return 0; }
182#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) 181#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
183static inline int pte_read(pte_t pte) { return pte.pte_low & _PAGE_READ; }
184static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; } 182static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; }
185static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; } 183static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; }
186static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; } 184static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; }
@@ -193,13 +191,6 @@ static inline pte_t pte_wrprotect(pte_t pte)
193 return pte; 191 return pte;
194} 192}
195 193
196static inline pte_t pte_rdprotect(pte_t pte)
197{
198 pte.pte_low &= ~(_PAGE_READ | _PAGE_SILENT_READ);
199 pte.pte_high &= ~_PAGE_SILENT_READ;
200 return pte;
201}
202
203static inline pte_t pte_mkclean(pte_t pte) 194static inline pte_t pte_mkclean(pte_t pte)
204{ 195{
205 pte.pte_low &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); 196 pte.pte_low &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE);
@@ -224,16 +215,6 @@ static inline pte_t pte_mkwrite(pte_t pte)
224 return pte; 215 return pte;
225} 216}
226 217
227static inline pte_t pte_mkread(pte_t pte)
228{
229 pte.pte_low |= _PAGE_READ;
230 if (pte.pte_low & _PAGE_ACCESSED) {
231 pte.pte_low |= _PAGE_SILENT_READ;
232 pte.pte_high |= _PAGE_SILENT_READ;
233 }
234 return pte;
235}
236
237static inline pte_t pte_mkdirty(pte_t pte) 218static inline pte_t pte_mkdirty(pte_t pte)
238{ 219{
239 pte.pte_low |= _PAGE_MODIFIED; 220 pte.pte_low |= _PAGE_MODIFIED;
@@ -253,7 +234,6 @@ static inline pte_t pte_mkyoung(pte_t pte)
253 return pte; 234 return pte;
254} 235}
255#else 236#else
256static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_READ; }
257static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } 237static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; }
258static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; } 238static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; }
259static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 239static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
@@ -265,12 +245,6 @@ static inline pte_t pte_wrprotect(pte_t pte)
265 return pte; 245 return pte;
266} 246}
267 247
268static inline pte_t pte_rdprotect(pte_t pte)
269{
270 pte_val(pte) &= ~(_PAGE_READ | _PAGE_SILENT_READ);
271 return pte;
272}
273
274static inline pte_t pte_mkclean(pte_t pte) 248static inline pte_t pte_mkclean(pte_t pte)
275{ 249{
276 pte_val(pte) &= ~(_PAGE_MODIFIED|_PAGE_SILENT_WRITE); 250 pte_val(pte) &= ~(_PAGE_MODIFIED|_PAGE_SILENT_WRITE);
@@ -291,14 +265,6 @@ static inline pte_t pte_mkwrite(pte_t pte)
291 return pte; 265 return pte;
292} 266}
293 267
294static inline pte_t pte_mkread(pte_t pte)
295{
296 pte_val(pte) |= _PAGE_READ;
297 if (pte_val(pte) & _PAGE_ACCESSED)
298 pte_val(pte) |= _PAGE_SILENT_READ;
299 return pte;
300}
301
302static inline pte_t pte_mkdirty(pte_t pte) 268static inline pte_t pte_mkdirty(pte_t pte)
303{ 269{
304 pte_val(pte) |= _PAGE_MODIFIED; 270 pte_val(pte) |= _PAGE_MODIFIED;
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h b/include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h
new file mode 100644
index 000000000000..c84bcf9570b1
--- /dev/null
+++ b/include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h
@@ -0,0 +1,151 @@
1/*
2 * Defines for the MSP interrupt controller.
3 *
4 * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved.
5 * Author: Carsten Langgaard, carstenl@mips.com
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 */
24
25#ifndef _MSP_CIC_INT_H
26#define _MSP_CIC_INT_H
27
28/*
29 * The PMC-Sierra CIC interrupts are all centrally managed by the
30 * CIC sub-system.
31 * We attempt to keep the interrupt numbers as consistent as possible
32 * across all of the MSP devices, but some differences will creep in ...
33 * The interrupts which are directly forwarded to the MIPS core interrupts
34 * are assigned interrupts in the range 0-7, interrupts cascaded through
35 * the CIC are assigned interrupts 8-39. The cascade occurs on C_IRQ4
36 * (MSP_INT_CIC). Currently we don't really distinguish between VPE1
37 * and VPE0 (or thread contexts for that matter). Will have to fix.
38 * The PER interrupts are assigned interrupts in the range 40-71.
39*/
40
41
42/*
43 * IRQs directly forwarded to the CPU
44 */
45#define MSP_MIPS_INTBASE 0
46#define MSP_INT_SW0 0 /* IRQ for swint0, C_SW0 */
47#define MSP_INT_SW1 1 /* IRQ for swint1, C_SW1 */
48#define MSP_INT_MAC0 2 /* IRQ for MAC 0, C_IRQ0 */
49#define MSP_INT_MAC1 3 /* IRQ for MAC 1, C_IRQ1 */
50#define MSP_INT_USB 4 /* IRQ for USB, C_IRQ2 */
51#define MSP_INT_SAR 5 /* IRQ for ADSL2+ SAR, C_IRQ3 */
52#define MSP_INT_CIC 6 /* IRQ for CIC block, C_IRQ4 */
53#define MSP_INT_SEC 7 /* IRQ for Sec engine, C_IRQ5 */
54
55/*
56 * IRQs cascaded on CPU interrupt 4 (CAUSE bit 12, C_IRQ4)
57 * These defines should be tied to the register definitions for the CIC
58 * interrupt routine. For now, just use hard-coded values.
59 */
60#define MSP_CIC_INTBASE (MSP_MIPS_INTBASE + 8)
61#define MSP_INT_EXT0 (MSP_CIC_INTBASE + 0)
62 /* External interrupt 0 */
63#define MSP_INT_EXT1 (MSP_CIC_INTBASE + 1)
64 /* External interrupt 1 */
65#define MSP_INT_EXT2 (MSP_CIC_INTBASE + 2)
66 /* External interrupt 2 */
67#define MSP_INT_EXT3 (MSP_CIC_INTBASE + 3)
68 /* External interrupt 3 */
69#define MSP_INT_CPUIF (MSP_CIC_INTBASE + 4)
70 /* CPU interface interrupt */
71#define MSP_INT_EXT4 (MSP_CIC_INTBASE + 5)
72 /* External interrupt 4 */
73#define MSP_INT_CIC_USB (MSP_CIC_INTBASE + 6)
74 /* Cascaded IRQ for USB */
75#define MSP_INT_MBOX (MSP_CIC_INTBASE + 7)
76 /* Sec engine mailbox IRQ */
77#define MSP_INT_EXT5 (MSP_CIC_INTBASE + 8)
78 /* External interrupt 5 */
79#define MSP_INT_TDM (MSP_CIC_INTBASE + 9)
80 /* TDM interrupt */
81#define MSP_INT_CIC_MAC0 (MSP_CIC_INTBASE + 10)
82 /* Cascaded IRQ for MAC 0 */
83#define MSP_INT_CIC_MAC1 (MSP_CIC_INTBASE + 11)
84 /* Cascaded IRQ for MAC 1 */
85#define MSP_INT_CIC_SEC (MSP_CIC_INTBASE + 12)
86 /* Cascaded IRQ for sec engine */
87#define MSP_INT_PER (MSP_CIC_INTBASE + 13)
88 /* Peripheral interrupt */
89#define MSP_INT_TIMER0 (MSP_CIC_INTBASE + 14)
90 /* SLP timer 0 */
91#define MSP_INT_TIMER1 (MSP_CIC_INTBASE + 15)
92 /* SLP timer 1 */
93#define MSP_INT_TIMER2 (MSP_CIC_INTBASE + 16)
94 /* SLP timer 2 */
95#define MSP_INT_VPE0_TIMER (MSP_CIC_INTBASE + 17)
96 /* VPE0 MIPS timer */
97#define MSP_INT_BLKCP (MSP_CIC_INTBASE + 18)
98 /* Block Copy */
99#define MSP_INT_UART0 (MSP_CIC_INTBASE + 19)
100 /* UART 0 */
101#define MSP_INT_PCI (MSP_CIC_INTBASE + 20)
102 /* PCI subsystem */
103#define MSP_INT_EXT6 (MSP_CIC_INTBASE + 21)
104 /* External interrupt 5 */
105#define MSP_INT_PCI_MSI (MSP_CIC_INTBASE + 22)
106 /* PCI Message Signal */
107#define MSP_INT_CIC_SAR (MSP_CIC_INTBASE + 23)
108 /* Cascaded ADSL2+ SAR IRQ */
109#define MSP_INT_DSL (MSP_CIC_INTBASE + 24)
110 /* ADSL2+ IRQ */
111#define MSP_INT_CIC_ERR (MSP_CIC_INTBASE + 25)
112 /* SLP error condition */
113#define MSP_INT_VPE1_TIMER (MSP_CIC_INTBASE + 26)
114 /* VPE1 MIPS timer */
115#define MSP_INT_VPE0_PC (MSP_CIC_INTBASE + 27)
116 /* VPE0 Performance counter */
117#define MSP_INT_VPE1_PC (MSP_CIC_INTBASE + 28)
118 /* VPE1 Performance counter */
119#define MSP_INT_EXT7 (MSP_CIC_INTBASE + 29)
120 /* External interrupt 5 */
121#define MSP_INT_VPE0_SW (MSP_CIC_INTBASE + 30)
122 /* VPE0 Software interrupt */
123#define MSP_INT_VPE1_SW (MSP_CIC_INTBASE + 31)
124 /* VPE0 Software interrupt */
125
126/*
127 * IRQs cascaded on CIC PER interrupt (MSP_INT_PER)
128 */
129#define MSP_PER_INTBASE (MSP_CIC_INTBASE + 32)
130/* Reserved 0-1 */
131#define MSP_INT_UART1 (MSP_PER_INTBASE + 2)
132 /* UART 1 */
133/* Reserved 3-5 */
134#define MSP_INT_2WIRE (MSP_PER_INTBASE + 6)
135 /* 2-wire */
136#define MSP_INT_TM0 (MSP_PER_INTBASE + 7)
137 /* Peripheral timer block out 0 */
138#define MSP_INT_TM1 (MSP_PER_INTBASE + 8)
139 /* Peripheral timer block out 1 */
140/* Reserved 9 */
141#define MSP_INT_SPRX (MSP_PER_INTBASE + 10)
142 /* SPI RX complete */
143#define MSP_INT_SPTX (MSP_PER_INTBASE + 11)
144 /* SPI TX complete */
145#define MSP_INT_GPIO (MSP_PER_INTBASE + 12)
146 /* GPIO */
147#define MSP_INT_PER_ERR (MSP_PER_INTBASE + 13)
148 /* Peripheral error */
149/* Reserved 14-31 */
150
151#endif /* !_MSP_CIC_INT_H */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_int.h b/include/asm-mips/pmc-sierra/msp71xx/msp_int.h
new file mode 100644
index 000000000000..1d9f05474820
--- /dev/null
+++ b/include/asm-mips/pmc-sierra/msp71xx/msp_int.h
@@ -0,0 +1,43 @@
1/*
2 * Defines for the MSP interrupt handlers.
3 *
4 * Copyright (C) 2005, PMC-Sierra, Inc. All rights reserved.
5 * Author: Andrew Hughes, Andrew_Hughes@pmc-sierra.com
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 */
24
25#ifndef _MSP_INT_H
26#define _MSP_INT_H
27
28/*
29 * The PMC-Sierra MSP product line has at least two different interrupt
30 * controllers, the SLP register based scheme and the CIC interrupt
31 * controller block mechanism. This file distinguishes between them
32 * so that devices see a uniform interface.
33 */
34
35#if defined(CONFIG_IRQ_MSP_SLP)
36 #include "msp_slp_int.h"
37#elif defined(CONFIG_IRQ_MSP_CIC)
38 #include "msp_cic_int.h"
39#else
40 #error "What sort of interrupt controller does *your* MSP have?"
41#endif
42
43#endif /* !_MSP_INT_H */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_pci.h b/include/asm-mips/pmc-sierra/msp71xx/msp_pci.h
new file mode 100644
index 000000000000..415606903617
--- /dev/null
+++ b/include/asm-mips/pmc-sierra/msp71xx/msp_pci.h
@@ -0,0 +1,205 @@
1/*
2 * Copyright (c) 2000-2006 PMC-Sierra INC.
3 *
4 * This program is free software; you can redistribute it
5 * and/or modify it under the terms of the GNU General
6 * Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be
11 * useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 * PURPOSE. See the GNU General Public License for more
14 * details.
15 *
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the Free
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
19 * 02139, USA.
20 *
21 * PMC-SIERRA INC. DISCLAIMS ANY LIABILITY OF ANY KIND
22 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS
23 * SOFTWARE.
24 */
25
26#ifndef _MSP_PCI_H_
27#define _MSP_PCI_H_
28
29#define MSP_HAS_PCI(ID) (((u32)(ID) <= 0x4236) && ((u32)(ID) >= 0x4220))
30
31/*
32 * It is convenient to program the OATRAN register so that
33 * Athena virtual address space and PCI address space are
34 * the same. This is not a requirement, just a convenience.
35 *
36 * The only hard restrictions on the value of OATRAN is that
37 * OATRAN must not be programmed to allow translated memory
38 * addresses to fall within the lowest 512MB of
39 * PCI address space. This region is hardcoded
40 * for use as Athena PCI Host Controller target
41 * access memory space to the Athena's SDRAM.
42 *
43 * Note that OATRAN applies only to memory accesses, not
44 * to I/O accesses.
45 *
46 * To program OATRAN to make Athena virtual address space
47 * and PCI address space have the same values, OATRAN
48 * is to be programmed to 0xB8000000. The top seven
49 * bits of the value mimic the seven bits clipped off
50 * by the PCI Host controller.
51 *
52 * With OATRAN at the said value, when the CPU does
53 * an access to its virtual address at, say 0xB900_5000,
54 * the address appearing on the PCI bus will be
55 * 0xB900_5000.
56 * - Michael Penner
57 */
58#define MSP_PCI_OATRAN 0xB8000000UL
59
60#define MSP_PCI_SPACE_BASE (MSP_PCI_OATRAN + 0x1002000UL)
61#define MSP_PCI_SPACE_SIZE (0x3000000UL - 0x2000)
62#define MSP_PCI_SPACE_END \
63 (MSP_PCI_SPACE_BASE + MSP_PCI_SPACE_SIZE - 1)
64#define MSP_PCI_IOSPACE_BASE (MSP_PCI_OATRAN + 0x1001000UL)
65#define MSP_PCI_IOSPACE_SIZE 0x1000
66#define MSP_PCI_IOSPACE_END \
67 (MSP_PCI_IOSPACE_BASE + MSP_PCI_IOSPACE_SIZE - 1)
68
69/* IRQ for PCI status interrupts */
70#define PCI_STAT_IRQ 20
71
72#define QFLUSH_REG_1 0xB7F40000
73
74typedef volatile unsigned int pcireg;
75typedef void * volatile ppcireg;
76
77struct pci_block_copy
78{
79 pcireg unused1; /* +0x00 */
80 pcireg unused2; /* +0x04 */
81 ppcireg unused3; /* +0x08 */
82 ppcireg unused4; /* +0x0C */
83 pcireg unused5; /* +0x10 */
84 pcireg unused6; /* +0x14 */
85 pcireg unused7; /* +0x18 */
86 ppcireg unused8; /* +0x1C */
87 ppcireg unused9; /* +0x20 */
88 pcireg unusedA; /* +0x24 */
89 ppcireg unusedB; /* +0x28 */
90 ppcireg unusedC; /* +0x2C */
91};
92
93enum
94{
95 config_device_vendor, /* 0 */
96 config_status_command, /* 1 */
97 config_class_revision, /* 2 */
98 config_BIST_header_latency_cache, /* 3 */
99 config_BAR0, /* 4 */
100 config_BAR1, /* 5 */
101 config_BAR2, /* 6 */
102 config_not_used7, /* 7 */
103 config_not_used8, /* 8 */
104 config_not_used9, /* 9 */
105 config_CIS, /* 10 */
106 config_subsystem, /* 11 */
107 config_not_used12, /* 12 */
108 config_capabilities, /* 13 */
109 config_not_used14, /* 14 */
110 config_lat_grant_irq, /* 15 */
111 config_message_control,/* 16 */
112 config_message_addr, /* 17 */
113 config_message_data, /* 18 */
114 config_VPD_addr, /* 19 */
115 config_VPD_data, /* 20 */
116 config_maxregs /* 21 - number of registers */
117};
118
119struct msp_pci_regs
120{
121 pcireg hop_unused_00; /* +0x00 */
122 pcireg hop_unused_04; /* +0x04 */
123 pcireg hop_unused_08; /* +0x08 */
124 pcireg hop_unused_0C; /* +0x0C */
125 pcireg hop_unused_10; /* +0x10 */
126 pcireg hop_unused_14; /* +0x14 */
127 pcireg hop_unused_18; /* +0x18 */
128 pcireg hop_unused_1C; /* +0x1C */
129 pcireg hop_unused_20; /* +0x20 */
130 pcireg hop_unused_24; /* +0x24 */
131 pcireg hop_unused_28; /* +0x28 */
132 pcireg hop_unused_2C; /* +0x2C */
133 pcireg hop_unused_30; /* +0x30 */
134 pcireg hop_unused_34; /* +0x34 */
135 pcireg if_control; /* +0x38 */
136 pcireg oatran; /* +0x3C */
137 pcireg reset_ctl; /* +0x40 */
138 pcireg config_addr; /* +0x44 */
139 pcireg hop_unused_48; /* +0x48 */
140 pcireg msg_signaled_int_status; /* +0x4C */
141 pcireg msg_signaled_int_mask; /* +0x50 */
142 pcireg if_status; /* +0x54 */
143 pcireg if_mask; /* +0x58 */
144 pcireg hop_unused_5C; /* +0x5C */
145 pcireg hop_unused_60; /* +0x60 */
146 pcireg hop_unused_64; /* +0x64 */
147 pcireg hop_unused_68; /* +0x68 */
148 pcireg hop_unused_6C; /* +0x6C */
149 pcireg hop_unused_70; /* +0x70 */
150
151 struct pci_block_copy pci_bc[2] __attribute__((aligned(64)));
152
153 pcireg error_hdr1; /* +0xE0 */
154 pcireg error_hdr2; /* +0xE4 */
155
156 pcireg config[config_maxregs] __attribute__((aligned(256)));
157
158};
159
160#define BPCI_CFGADDR_BUSNUM_SHF 16
161#define BPCI_CFGADDR_FUNCTNUM_SHF 8
162#define BPCI_CFGADDR_REGNUM_SHF 2
163#define BPCI_CFGADDR_ENABLE (1<<31)
164
165#define BPCI_IFCONTROL_RTO (1<<20) /* Retry timeout */
166#define BPCI_IFCONTROL_HCE (1<<16) /* Host configuration enable */
167#define BPCI_IFCONTROL_CTO_SHF 12 /* Shift count for CTO bits */
168#define BPCI_IFCONTROL_SE (1<<5) /* Enable exceptions on errors */
169#define BPCI_IFCONTROL_BIST (1<<4) /* Use BIST in per. mode */
170#define BPCI_IFCONTROL_CAP (1<<3) /* Enable capabilities */
171#define BPCI_IFCONTROL_MMC_SHF 0 /* Shift count for MMC bits */
172
173#define BPCI_IFSTATUS_MGT (1<<8) /* Master Grant timeout */
174#define BPCI_IFSTATUS_MTT (1<<9) /* Master TRDY timeout */
175#define BPCI_IFSTATUS_MRT (1<<10) /* Master retry timeout */
176#define BPCI_IFSTATUS_BC0F (1<<13) /* Block copy 0 fault */
177#define BPCI_IFSTATUS_BC1F (1<<14) /* Block copy 1 fault */
178#define BPCI_IFSTATUS_PCIU (1<<15) /* PCI unable to respond */
179#define BPCI_IFSTATUS_BSIZ (1<<16) /* PCI access with illegal size */
180#define BPCI_IFSTATUS_BADD (1<<17) /* PCI access with illegal addr */
181#define BPCI_IFSTATUS_RTO (1<<18) /* Retry time out */
182#define BPCI_IFSTATUS_SER (1<<19) /* System error */
183#define BPCI_IFSTATUS_PER (1<<20) /* Parity error */
184#define BPCI_IFSTATUS_LCA (1<<21) /* Local CPU abort */
185#define BPCI_IFSTATUS_MEM (1<<22) /* Memory prot. violation */
186#define BPCI_IFSTATUS_ARB (1<<23) /* Arbiter timed out */
187#define BPCI_IFSTATUS_STA (1<<27) /* Signaled target abort */
188#define BPCI_IFSTATUS_TA (1<<28) /* Target abort */
189#define BPCI_IFSTATUS_MA (1<<29) /* Master abort */
190#define BPCI_IFSTATUS_PEI (1<<30) /* Parity error as initiator */
191#define BPCI_IFSTATUS_PET (1<<31) /* Parity error as target */
192
193#define BPCI_RESETCTL_PR (1<<0) /* True if reset asserted */
194#define BPCI_RESETCTL_RT (1<<4) /* Release time */
195#define BPCI_RESETCTL_CT (1<<8) /* Config time */
196#define BPCI_RESETCTL_PE (1<<12) /* PCI enabled */
197#define BPCI_RESETCTL_HM (1<<13) /* PCI host mode */
198#define BPCI_RESETCTL_RI (1<<14) /* PCI reset in */
199
200extern struct msp_pci_regs msp_pci_regs
201 __attribute__((section(".register")));
202extern unsigned long msp_pci_config_space
203 __attribute__((section(".register")));
204
205#endif /* !_MSP_PCI_H_ */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_prom.h b/include/asm-mips/pmc-sierra/msp71xx/msp_prom.h
new file mode 100644
index 000000000000..14ca7dc382a8
--- /dev/null
+++ b/include/asm-mips/pmc-sierra/msp71xx/msp_prom.h
@@ -0,0 +1,176 @@
1/*
2 * MIPS boards bootprom interface for the Linux kernel.
3 *
4 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
5 * Author: Carsten Langgaard, carstenl@mips.com
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 */
24
25#ifndef _ASM_MSP_PROM_H
26#define _ASM_MSP_PROM_H
27
28#include <linux/types.h>
29
30#define DEVICEID "deviceid"
31#define FEATURES "features"
32#define PROM_ENV "prom_env"
33#define PROM_ENV_FILE "/proc/"PROM_ENV
34#define PROM_ENV_SIZE 256
35
36#define CPU_DEVID_FAMILY 0x0000ff00
37#define CPU_DEVID_REVISION 0x000000ff
38
39#define FPGA_IS_POLO(revision) \
40 (((revision >= 0xb0) && (revision < 0xd0)))
41#define FPGA_IS_5000(revision) \
42 ((revision >= 0x80) && (revision <= 0x90))
43#define FPGA_IS_ZEUS(revision) ((revision < 0x7f))
44#define FPGA_IS_DUET(revision) \
45 (((revision >= 0xa0) && (revision < 0xb0)))
46#define FPGA_IS_MSP4200(revision) ((revision >= 0xd0))
47#define FPGA_IS_MSP7100(revision) ((revision >= 0xd0))
48
49#define MACHINE_TYPE_POLO "POLO"
50#define MACHINE_TYPE_DUET "DUET"
51#define MACHINE_TYPE_ZEUS "ZEUS"
52#define MACHINE_TYPE_MSP2000REVB "MSP2000REVB"
53#define MACHINE_TYPE_MSP5000 "MSP5000"
54#define MACHINE_TYPE_MSP4200 "MSP4200"
55#define MACHINE_TYPE_MSP7120 "MSP7120"
56#define MACHINE_TYPE_MSP7130 "MSP7130"
57#define MACHINE_TYPE_OTHER "OTHER"
58
59#define MACHINE_TYPE_POLO_FPGA "POLO-FPGA"
60#define MACHINE_TYPE_DUET_FPGA "DUET-FPGA"
61#define MACHINE_TYPE_ZEUS_FPGA "ZEUS_FPGA"
62#define MACHINE_TYPE_MSP2000REVB_FPGA "MSP2000REVB-FPGA"
63#define MACHINE_TYPE_MSP5000_FPGA "MSP5000-FPGA"
64#define MACHINE_TYPE_MSP4200_FPGA "MSP4200-FPGA"
65#define MACHINE_TYPE_MSP7100_FPGA "MSP7100-FPGA"
66#define MACHINE_TYPE_OTHER_FPGA "OTHER-FPGA"
67
68/* Device Family definitions */
69#define FAMILY_FPGA 0x0000
70#define FAMILY_ZEUS 0x1000
71#define FAMILY_POLO 0x2000
72#define FAMILY_DUET 0x4000
73#define FAMILY_TRIAD 0x5000
74#define FAMILY_MSP4200 0x4200
75#define FAMILY_MSP4200_FPGA 0x4f00
76#define FAMILY_MSP7100 0x7100
77#define FAMILY_MSP7100_FPGA 0x7f00
78
79/* Device Type definitions */
80#define TYPE_MSP7120 0x7120
81#define TYPE_MSP7130 0x7130
82
83#define ENET_KEY 'E'
84#define ENETTXD_KEY 'e'
85#define PCI_KEY 'P'
86#define PCIMUX_KEY 'p'
87#define SEC_KEY 'S'
88#define SPAD_KEY 'D'
89#define TDM_KEY 'T'
90#define ZSP_KEY 'Z'
91
92#define FEATURE_NOEXIST '-'
93#define FEATURE_EXIST '+'
94
95#define ENET_MII 'M'
96#define ENET_RMII 'R'
97
98#define ENETTXD_FALLING 'F'
99#define ENETTXD_RISING 'R'
100
101#define PCI_HOST 'H'
102#define PCI_PERIPHERAL 'P'
103
104#define PCIMUX_FULL 'F'
105#define PCIMUX_SINGLE 'S'
106
107#define SEC_DUET 'D'
108#define SEC_POLO 'P'
109#define SEC_SLOW 'S'
110#define SEC_TRIAD 'T'
111
112#define SPAD_POLO 'P'
113
114#define TDM_DUET 'D' /* DUET TDMs might exist */
115#define TDM_POLO 'P' /* POLO TDMs might exist */
116#define TDM_TRIAD 'T' /* TRIAD TDMs might exist */
117
118#define ZSP_DUET 'D' /* one DUET zsp engine */
119#define ZSP_TRIAD 'T' /* two TRIAD zsp engines */
120
121extern char *prom_getcmdline(void);
122extern char *prom_getenv(char *name);
123extern void prom_init_cmdline(void);
124extern void prom_meminit(void);
125extern void prom_fixup_mem_map(unsigned long start_mem,
126 unsigned long end_mem);
127
128#ifdef CONFIG_MTD_PMC_MSP_RAMROOT
129extern bool get_ramroot(void **start, unsigned long *size);
130#endif
131
132extern int get_ethernet_addr(char *ethaddr_name, char *ethernet_addr);
133extern unsigned long get_deviceid(void);
134extern char identify_enet(unsigned long interface_num);
135extern char identify_enetTxD(unsigned long interface_num);
136extern char identify_pci(void);
137extern char identify_sec(void);
138extern char identify_spad(void);
139extern char identify_sec(void);
140extern char identify_tdm(void);
141extern char identify_zsp(void);
142extern unsigned long identify_family(void);
143extern unsigned long identify_revision(void);
144
145/*
146 * The following macro calls prom_printf and puts the format string
147 * into an init section so it can be reclaimed.
148 */
149#define ppfinit(f, x...) \
150 do { \
151 static char _f[] __initdata = KERN_INFO f; \
152 printk(_f, ## x); \
153 } while (0)
154
155/* Memory descriptor management. */
156#define PROM_MAX_PMEMBLOCKS 7 /* 6 used */
157
158enum yamon_memtypes {
159 yamon_dontuse,
160 yamon_prom,
161 yamon_free,
162};
163
164struct prom_pmemblock {
165 unsigned long base; /* Within KSEG0. */
166 unsigned int size; /* In bytes. */
167 unsigned int type; /* free or prom memory */
168};
169
170extern int prom_argc;
171extern char **prom_argv;
172extern char **prom_envp;
173extern int *prom_vec;
174extern struct prom_pmemblock *prom_getmdesc(void);
175
176#endif /* !_ASM_MSP_PROM_H */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_regops.h b/include/asm-mips/pmc-sierra/msp71xx/msp_regops.h
new file mode 100644
index 000000000000..60a5a38dd5b2
--- /dev/null
+++ b/include/asm-mips/pmc-sierra/msp71xx/msp_regops.h
@@ -0,0 +1,236 @@
1/*
2 * SMP/VPE-safe functions to access "registers" (see note).
3 *
4 * NOTES:
5* - These macros use ll/sc instructions, so it is your responsibility to
6 * ensure these are available on your platform before including this file.
7 * - The MIPS32 spec states that ll/sc results are undefined for uncached
8 * accesses. This means they can't be used on HW registers accessed
9 * through kseg1. Code which requires these macros for this purpose must
10 * front-end the registers with cached memory "registers" and have a single
11 * thread update the actual HW registers.
12 * - A maximum of 2k of code can be inserted between ll and sc. Every
13 * memory accesses between the instructions will increase the chance of
14 * sc failing and having to loop.
15 * - When using custom_read_reg32/custom_write_reg32 only perform the
16 * necessary logical operations on the register value in between these
17 * two calls. All other logic should be performed before the first call.
18 * - There is a bug on the R10000 chips which has a workaround. If you
19 * are affected by this bug, make sure to define the symbol 'R10000_LLSC_WAR'
20 * to be non-zero. If you are using this header from within linux, you may
21 * include <asm/war.h> before including this file to have this defined
22 * appropriately for you.
23 *
24 * Copyright 2005-2007 PMC-Sierra, Inc.
25 *
26 * This program is free software; you can redistribute it and/or modify it
27 * under the terms of the GNU General Public License as published by the
28 * Free Software Foundation; either version 2 of the License, or (at your
29 * option) any later version.
30 *
31 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
32 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
33 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
34 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
35 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
40 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 *
42 * You should have received a copy of the GNU General Public License along
43 * with this program; if not, write to the Free Software Foundation, Inc., 675
44 * Mass Ave, Cambridge, MA 02139, USA.
45 */
46
47#ifndef __ASM_REGOPS_H__
48#define __ASM_REGOPS_H__
49
50#include <linux/types.h>
51
52#include <asm/war.h>
53
54#ifndef R10000_LLSC_WAR
55#define R10000_LLSC_WAR 0
56#endif
57
58#if R10000_LLSC_WAR == 1
59#define __beqz "beqzl "
60#else
61#define __beqz "beqz "
62#endif
63
64#ifndef _LINUX_TYPES_H
65typedef unsigned int u32;
66#endif
67
68/*
69 * Sets all the masked bits to the corresponding value bits
70 */
71static inline void set_value_reg32(volatile u32 *const addr,
72 u32 const mask,
73 u32 const value)
74{
75 u32 temp;
76
77 __asm__ __volatile__(
78 " .set push \n"
79 " .set mips3 \n"
80 "1: ll %0, %1 # set_value_reg32 \n"
81 " and %0, %2 \n"
82 " or %0, %3 \n"
83 " sc %0, %1 \n"
84 " "__beqz"%0, 1b \n"
85 " nop \n"
86 " .set pop \n"
87 : "=&r" (temp), "=m" (*addr)
88 : "ir" (~mask), "ir" (value), "m" (*addr));
89}
90
91/*
92 * Sets all the masked bits to '1'
93 */
94static inline void set_reg32(volatile u32 *const addr,
95 u32 const mask)
96{
97 u32 temp;
98
99 __asm__ __volatile__(
100 " .set push \n"
101 " .set mips3 \n"
102 "1: ll %0, %1 # set_reg32 \n"
103 " or %0, %2 \n"
104 " sc %0, %1 \n"
105 " "__beqz"%0, 1b \n"
106 " nop \n"
107 " .set pop \n"
108 : "=&r" (temp), "=m" (*addr)
109 : "ir" (mask), "m" (*addr));
110}
111
112/*
113 * Sets all the masked bits to '0'
114 */
115static inline void clear_reg32(volatile u32 *const addr,
116 u32 const mask)
117{
118 u32 temp;
119
120 __asm__ __volatile__(
121 " .set push \n"
122 " .set mips3 \n"
123 "1: ll %0, %1 # clear_reg32 \n"
124 " and %0, %2 \n"
125 " sc %0, %1 \n"
126 " "__beqz"%0, 1b \n"
127 " nop \n"
128 " .set pop \n"
129 : "=&r" (temp), "=m" (*addr)
130 : "ir" (~mask), "m" (*addr));
131}
132
133/*
134 * Toggles all masked bits from '0' to '1' and '1' to '0'
135 */
136static inline void toggle_reg32(volatile u32 *const addr,
137 u32 const mask)
138{
139 u32 temp;
140
141 __asm__ __volatile__(
142 " .set push \n"
143 " .set mips3 \n"
144 "1: ll %0, %1 # toggle_reg32 \n"
145 " xor %0, %2 \n"
146 " sc %0, %1 \n"
147 " "__beqz"%0, 1b \n"
148 " nop \n"
149 " .set pop \n"
150 : "=&r" (temp), "=m" (*addr)
151 : "ir" (mask), "m" (*addr));
152}
153
154/*
155 * Read all masked bits others are returned as '0'
156 */
157static inline u32 read_reg32(volatile u32 *const addr,
158 u32 const mask)
159{
160 u32 temp;
161
162 __asm__ __volatile__(
163 " .set push \n"
164 " .set noreorder \n"
165 " lw %0, %1 # read \n"
166 " and %0, %2 # mask \n"
167 " .set pop \n"
168 : "=&r" (temp)
169 : "m" (*addr), "ir" (mask));
170
171 return temp;
172}
173
174/*
175 * blocking_read_reg32 - Read address with blocking load
176 *
177 * Uncached writes need to be read back to ensure they reach RAM.
178 * The returned value must be 'used' to prevent from becoming a
179 * non-blocking load.
180 */
181static inline u32 blocking_read_reg32(volatile u32 *const addr)
182{
183 u32 temp;
184
185 __asm__ __volatile__(
186 " .set push \n"
187 " .set noreorder \n"
188 " lw %0, %1 # read \n"
189 " move %0, %0 # block \n"
190 " .set pop \n"
191 : "=&r" (temp)
192 : "m" (*addr));
193
194 return temp;
195}
196
197/*
198 * For special strange cases only:
199 *
200 * If you need custom processing within a ll/sc loop, use the following macros
201 * VERY CAREFULLY:
202 *
203 * u32 tmp; <-- Define a variable to hold the data
204 *
205 * custom_read_reg32(address, tmp); <-- Reads the address and put the value
206 * in the 'tmp' variable given
207 *
208 * From here on out, you are (basicly) atomic, so don't do anything too
209 * fancy!
210 * Also, this code may loop if the end of this block fails to write
211 * everything back safely due do the other CPU, so do NOT do anything
212 * with side-effects!
213 *
214 * custom_write_reg32(address, tmp); <-- Writes back 'tmp' safely.
215 */
216#define custom_read_reg32(address, tmp) \
217 __asm__ __volatile__( \
218 " .set push \n" \
219 " .set mips3 \n" \
220 "1: ll %0, %1 #custom_read_reg32 \n" \
221 " .set pop \n" \
222 : "=r" (tmp), "=m" (*address) \
223 : "m" (*address))
224
225#define custom_write_reg32(address, tmp) \
226 __asm__ __volatile__( \
227 " .set push \n" \
228 " .set mips3 \n" \
229 " sc %0, %1 #custom_write_reg32 \n" \
230 " "__beqz"%0, 1b \n" \
231 " nop \n" \
232 " .set pop \n" \
233 : "=&r" (tmp), "=m" (*address) \
234 : "0" (tmp), "m" (*address))
235
236#endif /* __ASM_REGOPS_H__ */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_regs.h b/include/asm-mips/pmc-sierra/msp71xx/msp_regs.h
new file mode 100644
index 000000000000..0b56f55206c6
--- /dev/null
+++ b/include/asm-mips/pmc-sierra/msp71xx/msp_regs.h
@@ -0,0 +1,667 @@
1/*
2 * Defines for the address space, registers and register configuration
3 * (bit masks, access macros etc) for the PMC-Sierra line of MSP products.
4 * This file contains addess maps for all the devices in the line of
5 * products but only has register definitions and configuration masks for
6 * registers which aren't definitely associated with any device. Things
7 * like clock settings, reset access, the ELB etc. Individual device
8 * drivers will reference the appropriate XXX_BASE value defined here
9 * and have individual registers offset from that.
10 *
11 * Copyright (C) 2005-2007 PMC-Sierra, Inc. All rights reserved.
12 * Author: Andrew Hughes, Andrew_Hughes@pmc-sierra.com
13 *
14 * ########################################################################
15 *
16 * This program is free software; you can distribute it and/or modify it
17 * under the terms of the GNU General Public License (Version 2) as
18 * published by the Free Software Foundation.
19 *
20 * This program is distributed in the hope it will be useful, but WITHOUT
21 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * for more details.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
28 *
29 * ########################################################################
30 */
31
32#include <asm/addrspace.h>
33#include <linux/types.h>
34
35#ifndef _ASM_MSP_REGS_H
36#define _ASM_MSP_REGS_H
37
38/*
39 ########################################################################
40 # Address space and device base definitions #
41 ########################################################################
42 */
43
44/*
45 ***************************************************************************
46 * System Logic and Peripherals (ELB, UART0, etc) device address space *
47 ***************************************************************************
48 */
49#define MSP_SLP_BASE 0x1c000000
50 /* System Logic and Peripherals */
51#define MSP_RST_BASE (MSP_SLP_BASE + 0x10)
52 /* System reset register base */
53#define MSP_RST_SIZE 0x0C /* System reset register space */
54
55#define MSP_WTIMER_BASE (MSP_SLP_BASE + 0x04C)
56 /* watchdog timer base */
57#define MSP_ITIMER_BASE (MSP_SLP_BASE + 0x054)
58 /* internal timer base */
59#define MSP_UART0_BASE (MSP_SLP_BASE + 0x100)
60 /* UART0 controller base */
61#define MSP_BCPY_CTRL_BASE (MSP_SLP_BASE + 0x120)
62 /* Block Copy controller base */
63#define MSP_BCPY_DESC_BASE (MSP_SLP_BASE + 0x160)
64 /* Block Copy descriptor base */
65
66/*
67 ***************************************************************************
68 * PCI address space *
69 ***************************************************************************
70 */
71#define MSP_PCI_BASE 0x19000000
72
73/*
74 ***************************************************************************
75 * MSbus device address space *
76 ***************************************************************************
77 */
78#define MSP_MSB_BASE 0x18000000
79 /* MSbus address start */
80#define MSP_PER_BASE (MSP_MSB_BASE + 0x400000)
81 /* Peripheral device registers */
82#define MSP_MAC0_BASE (MSP_MSB_BASE + 0x600000)
83 /* MAC A device registers */
84#define MSP_MAC1_BASE (MSP_MSB_BASE + 0x700000)
85 /* MAC B device registers */
86#define MSP_MAC_SIZE 0xE0 /* MAC register space */
87
88#define MSP_SEC_BASE (MSP_MSB_BASE + 0x800000)
89 /* Security Engine registers */
90#define MSP_MAC2_BASE (MSP_MSB_BASE + 0x900000)
91 /* MAC C device registers */
92#define MSP_ADSL2_BASE (MSP_MSB_BASE + 0xA80000)
93 /* ADSL2 device registers */
94#define MSP_USB_BASE (MSP_MSB_BASE + 0xB40000)
95 /* USB device registers */
96#define MSP_USB_BASE_START (MSP_MSB_BASE + 0xB40100)
97 /* USB device registers */
98#define MSP_USB_BASE_END (MSP_MSB_BASE + 0xB401FF)
99 /* USB device registers */
100#define MSP_CPUIF_BASE (MSP_MSB_BASE + 0xC00000)
101 /* CPU interface registers */
102
103/* Devices within the MSbus peripheral block */
104#define MSP_UART1_BASE (MSP_PER_BASE + 0x030)
105 /* UART1 controller base */
106#define MSP_SPI_BASE (MSP_PER_BASE + 0x058)
107 /* SPI/MPI control registers */
108#define MSP_TWI_BASE (MSP_PER_BASE + 0x090)
109 /* Two-wire control registers */
110#define MSP_PTIMER_BASE (MSP_PER_BASE + 0x0F0)
111 /* Programmable timer control */
112
113/*
114 ***************************************************************************
115 * Physical Memory configuration address space *
116 ***************************************************************************
117 */
118#define MSP_MEM_CFG_BASE 0x17f00000
119
120#define MSP_MEM_INDIRECT_CTL_10 0x10
121
122/*
123 * Notes:
124 * 1) The SPI registers are split into two blocks, one offset from the
125 * MSP_SPI_BASE by 0x00 and the other offset from the MSP_SPI_BASE by
126 * 0x68. The SPI driver definitions for the register must be aware
127 * of this.
128 * 2) The block copy engine register are divided into two regions, one
129 * for the control/configuration of the engine proper and one for the
130 * values of the descriptors used in the copy process. These have
131 * different base defines (CTRL_BASE vs DESC_BASE)
132 * 3) These constants are for physical addresses which means that they
133 * work correctly with "ioremap" and friends. This means that device
134 * drivers will need to remap these addresses using ioremap and perhaps
135 * the readw/writew macros. Or they could use the regptr() macro
136 * defined below, but the readw/writew calls are the correct thing.
137 * 4) The UARTs have an additional status register offset from the base
138 * address. This register isn't used in the standard 8250 driver but
139 * may be used in other software. Consult the hardware datasheet for
140 * offset details.
141 * 5) For some unknown reason the security engine (MSP_SEC_BASE) registers
142 * start at an offset of 0x84 from the base address but the block of
143 * registers before this is reserved for the security engine. The
144 * driver will have to be aware of this but it makes the register
145 * definitions line up better with the documentation.
146 */
147
148/*
149 ########################################################################
150 # System register definitions. Not associated with a specific device #
151 ########################################################################
152 */
153
154/*
155 * This macro maps the physical register number into uncached space
156 * and (for C code) casts it into a u32 pointer so it can be dereferenced
157 * Normally these would be accessed with ioremap and readX/writeX, but
158 * these are convenient for a lot of internal kernel code.
159 */
160#ifdef __ASSEMBLER__
161 #define regptr(addr) (KSEG1ADDR(addr))
162#else
163 #define regptr(addr) ((volatile u32 *const)(KSEG1ADDR(addr)))
164#endif
165
166/*
167 ***************************************************************************
168 * System Logic and Peripherals (RESET, ELB, etc) registers *
169 ***************************************************************************
170 */
171
172/* System Control register definitions */
173#define DEV_ID_REG regptr(MSP_SLP_BASE + 0x00)
174 /* Device-ID RO */
175#define FWR_ID_REG regptr(MSP_SLP_BASE + 0x04)
176 /* Firmware-ID Register RW */
177#define SYS_ID_REG0 regptr(MSP_SLP_BASE + 0x08)
178 /* System-ID Register-0 RW */
179#define SYS_ID_REG1 regptr(MSP_SLP_BASE + 0x0C)
180 /* System-ID Register-1 RW */
181
182/* System Reset register definitions */
183#define RST_STS_REG regptr(MSP_SLP_BASE + 0x10)
184 /* System Reset Status RO */
185#define RST_SET_REG regptr(MSP_SLP_BASE + 0x14)
186 /* System Set Reset WO */
187#define RST_CLR_REG regptr(MSP_SLP_BASE + 0x18)
188 /* System Clear Reset WO */
189
190/* System Clock Registers */
191#define PCI_SLP_REG regptr(MSP_SLP_BASE + 0x1C)
192 /* PCI clock generator RW */
193#define URT_SLP_REG regptr(MSP_SLP_BASE + 0x20)
194 /* UART clock generator RW */
195/* reserved (MSP_SLP_BASE + 0x24) */
196/* reserved (MSP_SLP_BASE + 0x28) */
197#define PLL1_SLP_REG regptr(MSP_SLP_BASE + 0x2C)
198 /* PLL1 clock generator RW */
199#define PLL0_SLP_REG regptr(MSP_SLP_BASE + 0x30)
200 /* PLL0 clock generator RW */
201#define MIPS_SLP_REG regptr(MSP_SLP_BASE + 0x34)
202 /* MIPS clock generator RW */
203#define VE_SLP_REG regptr(MSP_SLP_BASE + 0x38)
204 /* Voice Eng clock generator RW */
205/* reserved (MSP_SLP_BASE + 0x3C) */
206#define MSB_SLP_REG regptr(MSP_SLP_BASE + 0x40)
207 /* MS-Bus clock generator RW */
208#define SMAC_SLP_REG regptr(MSP_SLP_BASE + 0x44)
209 /* Sec & MAC clock generator RW */
210#define PERF_SLP_REG regptr(MSP_SLP_BASE + 0x48)
211 /* Per & TDM clock generator RW */
212
213/* Interrupt Controller Registers */
214#define SLP_INT_STS_REG regptr(MSP_SLP_BASE + 0x70)
215 /* Interrupt status register RW */
216#define SLP_INT_MSK_REG regptr(MSP_SLP_BASE + 0x74)
217 /* Interrupt enable/mask RW */
218#define SE_MBOX_REG regptr(MSP_SLP_BASE + 0x78)
219 /* Security Engine mailbox RW */
220#define VE_MBOX_REG regptr(MSP_SLP_BASE + 0x7C)
221 /* Voice Engine mailbox RW */
222
223/* ELB Controller Registers */
224#define CS0_CNFG_REG regptr(MSP_SLP_BASE + 0x80)
225 /* ELB CS0 Configuration Reg */
226#define CS0_ADDR_REG regptr(MSP_SLP_BASE + 0x84)
227 /* ELB CS0 Base Address Reg */
228#define CS0_MASK_REG regptr(MSP_SLP_BASE + 0x88)
229 /* ELB CS0 Mask Register */
230#define CS0_ACCESS_REG regptr(MSP_SLP_BASE + 0x8C)
231 /* ELB CS0 access register */
232
233#define CS1_CNFG_REG regptr(MSP_SLP_BASE + 0x90)
234 /* ELB CS1 Configuration Reg */
235#define CS1_ADDR_REG regptr(MSP_SLP_BASE + 0x94)
236 /* ELB CS1 Base Address Reg */
237#define CS1_MASK_REG regptr(MSP_SLP_BASE + 0x98)
238 /* ELB CS1 Mask Register */
239#define CS1_ACCESS_REG regptr(MSP_SLP_BASE + 0x9C)
240 /* ELB CS1 access register */
241
242#define CS2_CNFG_REG regptr(MSP_SLP_BASE + 0xA0)
243 /* ELB CS2 Configuration Reg */
244#define CS2_ADDR_REG regptr(MSP_SLP_BASE + 0xA4)
245 /* ELB CS2 Base Address Reg */
246#define CS2_MASK_REG regptr(MSP_SLP_BASE + 0xA8)
247 /* ELB CS2 Mask Register */
248#define CS2_ACCESS_REG regptr(MSP_SLP_BASE + 0xAC)
249 /* ELB CS2 access register */
250
251#define CS3_CNFG_REG regptr(MSP_SLP_BASE + 0xB0)
252 /* ELB CS3 Configuration Reg */
253#define CS3_ADDR_REG regptr(MSP_SLP_BASE + 0xB4)
254 /* ELB CS3 Base Address Reg */
255#define CS3_MASK_REG regptr(MSP_SLP_BASE + 0xB8)
256 /* ELB CS3 Mask Register */
257#define CS3_ACCESS_REG regptr(MSP_SLP_BASE + 0xBC)
258 /* ELB CS3 access register */
259
260#define CS4_CNFG_REG regptr(MSP_SLP_BASE + 0xC0)
261 /* ELB CS4 Configuration Reg */
262#define CS4_ADDR_REG regptr(MSP_SLP_BASE + 0xC4)
263 /* ELB CS4 Base Address Reg */
264#define CS4_MASK_REG regptr(MSP_SLP_BASE + 0xC8)
265 /* ELB CS4 Mask Register */
266#define CS4_ACCESS_REG regptr(MSP_SLP_BASE + 0xCC)
267 /* ELB CS4 access register */
268
269#define CS5_CNFG_REG regptr(MSP_SLP_BASE + 0xD0)
270 /* ELB CS5 Configuration Reg */
271#define CS5_ADDR_REG regptr(MSP_SLP_BASE + 0xD4)
272 /* ELB CS5 Base Address Reg */
273#define CS5_MASK_REG regptr(MSP_SLP_BASE + 0xD8)
274 /* ELB CS5 Mask Register */
275#define CS5_ACCESS_REG regptr(MSP_SLP_BASE + 0xDC)
276 /* ELB CS5 access register */
277
278/* reserved 0xE0 - 0xE8 */
279#define ELB_1PC_EN_REG regptr(MSP_SLP_BASE + 0xEC)
280 /* ELB single PC card detect */
281
282/* reserved 0xF0 - 0xF8 */
283#define ELB_CLK_CFG_REG regptr(MSP_SLP_BASE + 0xFC)
284 /* SDRAM read/ELB timing Reg */
285
286/* Extended UART status registers */
287#define UART0_STATUS_REG regptr(MSP_UART0_BASE + 0x0c0)
288 /* UART Status Register 0 */
289#define UART1_STATUS_REG regptr(MSP_UART1_BASE + 0x170)
290 /* UART Status Register 1 */
291
292/* Performance monitoring registers */
293#define PERF_MON_CTRL_REG regptr(MSP_SLP_BASE + 0x140)
294 /* Performance monitor control */
295#define PERF_MON_CLR_REG regptr(MSP_SLP_BASE + 0x144)
296 /* Performance monitor clear */
297#define PERF_MON_CNTH_REG regptr(MSP_SLP_BASE + 0x148)
298 /* Perf monitor counter high */
299#define PERF_MON_CNTL_REG regptr(MSP_SLP_BASE + 0x14C)
300 /* Perf monitor counter low */
301
302/* System control registers */
303#define SYS_CTRL_REG regptr(MSP_SLP_BASE + 0x150)
304 /* System control register */
305#define SYS_ERR1_REG regptr(MSP_SLP_BASE + 0x154)
306 /* System Error status 1 */
307#define SYS_ERR2_REG regptr(MSP_SLP_BASE + 0x158)
308 /* System Error status 2 */
309#define SYS_INT_CFG_REG regptr(MSP_SLP_BASE + 0x15C)
310 /* System Interrupt config */
311
312/* Voice Engine Memory configuration */
313#define VE_MEM_REG regptr(MSP_SLP_BASE + 0x17C)
314 /* Voice engine memory config */
315
316/* CPU/SLP Error Status registers */
317#define CPU_ERR1_REG regptr(MSP_SLP_BASE + 0x180)
318 /* CPU/SLP Error status 1 */
319#define CPU_ERR2_REG regptr(MSP_SLP_BASE + 0x184)
320 /* CPU/SLP Error status 1 */
321
322#define EXTENDED_GPIO_REG regptr(MSP_SLP_BASE + 0x188)
323 /* Extended GPIO register */
324
325/* System Error registers */
326#define SLP_ERR_STS_REG regptr(MSP_SLP_BASE + 0x190)
327 /* Int status for SLP errors */
328#define SLP_ERR_MSK_REG regptr(MSP_SLP_BASE + 0x194)
329 /* Int mask for SLP errors */
330#define SLP_ELB_ERST_REG regptr(MSP_SLP_BASE + 0x198)
331 /* External ELB reset */
332#define SLP_BOOT_STS_REG regptr(MSP_SLP_BASE + 0x19C)
333 /* Boot Status */
334
335/* Extended ELB addressing */
336#define CS0_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A0)
337 /* CS0 Extended address */
338#define CS1_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A4)
339 /* CS1 Extended address */
340#define CS2_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A8)
341 /* CS2 Extended address */
342#define CS3_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1AC)
343 /* CS3 Extended address */
344/* reserved 0x1B0 */
345#define CS5_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1B4)
346 /* CS5 Extended address */
347
348/* PLL Adjustment registers */
349#define PLL_LOCK_REG regptr(MSP_SLP_BASE + 0x200)
350 /* PLL0 lock status */
351#define PLL_ARST_REG regptr(MSP_SLP_BASE + 0x204)
352 /* PLL Analog reset status */
353#define PLL0_ADJ_REG regptr(MSP_SLP_BASE + 0x208)
354 /* PLL0 Adjustment value */
355#define PLL1_ADJ_REG regptr(MSP_SLP_BASE + 0x20C)
356 /* PLL1 Adjustment value */
357
358/*
359 ***************************************************************************
360 * Peripheral Register definitions *
361 ***************************************************************************
362 */
363
364/* Peripheral status */
365#define PER_CTRL_REG regptr(MSP_PER_BASE + 0x50)
366 /* Peripheral control register */
367#define PER_STS_REG regptr(MSP_PER_BASE + 0x54)
368 /* Peripheral status register */
369
370/* SPI/MPI Registers */
371#define SMPI_TX_SZ_REG regptr(MSP_PER_BASE + 0x58)
372 /* SPI/MPI Tx Size register */
373#define SMPI_RX_SZ_REG regptr(MSP_PER_BASE + 0x5C)
374 /* SPI/MPI Rx Size register */
375#define SMPI_CTL_REG regptr(MSP_PER_BASE + 0x60)
376 /* SPI/MPI Control register */
377#define SMPI_MS_REG regptr(MSP_PER_BASE + 0x64)
378 /* SPI/MPI Chip Select reg */
379#define SMPI_CORE_DATA_REG regptr(MSP_PER_BASE + 0xC0)
380 /* SPI/MPI Core Data reg */
381#define SMPI_CORE_CTRL_REG regptr(MSP_PER_BASE + 0xC4)
382 /* SPI/MPI Core Control reg */
383#define SMPI_CORE_STAT_REG regptr(MSP_PER_BASE + 0xC8)
384 /* SPI/MPI Core Status reg */
385#define SMPI_CORE_SSEL_REG regptr(MSP_PER_BASE + 0xCC)
386 /* SPI/MPI Core Ssel reg */
387#define SMPI_FIFO_REG regptr(MSP_PER_BASE + 0xD0)
388 /* SPI/MPI Data FIFO reg */
389
390/* Peripheral Block Error Registers */
391#define PER_ERR_STS_REG regptr(MSP_PER_BASE + 0x70)
392 /* Error Bit Status Register */
393#define PER_ERR_MSK_REG regptr(MSP_PER_BASE + 0x74)
394 /* Error Bit Mask Register */
395#define PER_HDR1_REG regptr(MSP_PER_BASE + 0x78)
396 /* Error Header 1 Register */
397#define PER_HDR2_REG regptr(MSP_PER_BASE + 0x7C)
398 /* Error Header 2 Register */
399
400/* Peripheral Block Interrupt Registers */
401#define PER_INT_STS_REG regptr(MSP_PER_BASE + 0x80)
402 /* Interrupt status register */
403#define PER_INT_MSK_REG regptr(MSP_PER_BASE + 0x84)
404 /* Interrupt Mask Register */
405#define GPIO_INT_STS_REG regptr(MSP_PER_BASE + 0x88)
406 /* GPIO interrupt status reg */
407#define GPIO_INT_MSK_REG regptr(MSP_PER_BASE + 0x8C)
408 /* GPIO interrupt MASK Reg */
409
410/* POLO GPIO registers */
411#define POLO_GPIO_DAT1_REG regptr(MSP_PER_BASE + 0x0E0)
412 /* Polo GPIO[8:0] data reg */
413#define POLO_GPIO_CFG1_REG regptr(MSP_PER_BASE + 0x0E4)
414 /* Polo GPIO[7:0] config reg */
415#define POLO_GPIO_CFG2_REG regptr(MSP_PER_BASE + 0x0E8)
416 /* Polo GPIO[15:8] config reg */
417#define POLO_GPIO_OD1_REG regptr(MSP_PER_BASE + 0x0EC)
418 /* Polo GPIO[31:0] output drive */
419#define POLO_GPIO_CFG3_REG regptr(MSP_PER_BASE + 0x170)
420 /* Polo GPIO[23:16] config reg */
421#define POLO_GPIO_DAT2_REG regptr(MSP_PER_BASE + 0x174)
422 /* Polo GPIO[15:9] data reg */
423#define POLO_GPIO_DAT3_REG regptr(MSP_PER_BASE + 0x178)
424 /* Polo GPIO[23:16] data reg */
425#define POLO_GPIO_DAT4_REG regptr(MSP_PER_BASE + 0x17C)
426 /* Polo GPIO[31:24] data reg */
427#define POLO_GPIO_DAT5_REG regptr(MSP_PER_BASE + 0x180)
428 /* Polo GPIO[39:32] data reg */
429#define POLO_GPIO_DAT6_REG regptr(MSP_PER_BASE + 0x184)
430 /* Polo GPIO[47:40] data reg */
431#define POLO_GPIO_DAT7_REG regptr(MSP_PER_BASE + 0x188)
432 /* Polo GPIO[54:48] data reg */
433#define POLO_GPIO_CFG4_REG regptr(MSP_PER_BASE + 0x18C)
434 /* Polo GPIO[31:24] config reg */
435#define POLO_GPIO_CFG5_REG regptr(MSP_PER_BASE + 0x190)
436 /* Polo GPIO[39:32] config reg */
437#define POLO_GPIO_CFG6_REG regptr(MSP_PER_BASE + 0x194)
438 /* Polo GPIO[47:40] config reg */
439#define POLO_GPIO_CFG7_REG regptr(MSP_PER_BASE + 0x198)
440 /* Polo GPIO[54:48] config reg */
441#define POLO_GPIO_OD2_REG regptr(MSP_PER_BASE + 0x19C)
442 /* Polo GPIO[54:32] output drive */
443
444/* Generic GPIO registers */
445#define GPIO_DATA1_REG regptr(MSP_PER_BASE + 0x170)
446 /* GPIO[1:0] data register */
447#define GPIO_DATA2_REG regptr(MSP_PER_BASE + 0x174)
448 /* GPIO[5:2] data register */
449#define GPIO_DATA3_REG regptr(MSP_PER_BASE + 0x178)
450 /* GPIO[9:6] data register */
451#define GPIO_DATA4_REG regptr(MSP_PER_BASE + 0x17C)
452 /* GPIO[15:10] data register */
453#define GPIO_CFG1_REG regptr(MSP_PER_BASE + 0x180)
454 /* GPIO[1:0] config register */
455#define GPIO_CFG2_REG regptr(MSP_PER_BASE + 0x184)
456 /* GPIO[5:2] config register */
457#define GPIO_CFG3_REG regptr(MSP_PER_BASE + 0x188)
458 /* GPIO[9:6] config register */
459#define GPIO_CFG4_REG regptr(MSP_PER_BASE + 0x18C)
460 /* GPIO[15:10] config register */
461#define GPIO_OD_REG regptr(MSP_PER_BASE + 0x190)
462 /* GPIO[15:0] output drive */
463
464/*
465 ***************************************************************************
466 * CPU Interface register definitions *
467 ***************************************************************************
468 */
469#define PCI_FLUSH_REG regptr(MSP_CPUIF_BASE + 0x00)
470 /* PCI-SDRAM queue flush trigger */
471#define OCP_ERR1_REG regptr(MSP_CPUIF_BASE + 0x04)
472 /* OCP Error Attribute 1 */
473#define OCP_ERR2_REG regptr(MSP_CPUIF_BASE + 0x08)
474 /* OCP Error Attribute 2 */
475#define OCP_STS_REG regptr(MSP_CPUIF_BASE + 0x0C)
476 /* OCP Error Status */
477#define CPUIF_PM_REG regptr(MSP_CPUIF_BASE + 0x10)
478 /* CPU policy configuration */
479#define CPUIF_CFG_REG regptr(MSP_CPUIF_BASE + 0x10)
480 /* Misc configuration options */
481
482/* Central Interrupt Controller Registers */
483#define MSP_CIC_BASE (MSP_CPUIF_BASE + 0x8000)
484 /* Central Interrupt registers */
485#define CIC_EXT_CFG_REG regptr(MSP_CIC_BASE + 0x00)
486 /* External interrupt config */
487#define CIC_STS_REG regptr(MSP_CIC_BASE + 0x04)
488 /* CIC Interrupt Status */
489#define CIC_VPE0_MSK_REG regptr(MSP_CIC_BASE + 0x08)
490 /* VPE0 Interrupt Mask */
491#define CIC_VPE1_MSK_REG regptr(MSP_CIC_BASE + 0x0C)
492 /* VPE1 Interrupt Mask */
493#define CIC_TC0_MSK_REG regptr(MSP_CIC_BASE + 0x10)
494 /* Thread Context 0 Int Mask */
495#define CIC_TC1_MSK_REG regptr(MSP_CIC_BASE + 0x14)
496 /* Thread Context 1 Int Mask */
497#define CIC_TC2_MSK_REG regptr(MSP_CIC_BASE + 0x18)
498 /* Thread Context 2 Int Mask */
499#define CIC_TC3_MSK_REG regptr(MSP_CIC_BASE + 0x18)
500 /* Thread Context 3 Int Mask */
501#define CIC_TC4_MSK_REG regptr(MSP_CIC_BASE + 0x18)
502 /* Thread Context 4 Int Mask */
503#define CIC_PCIMSI_STS_REG regptr(MSP_CIC_BASE + 0x18)
504#define CIC_PCIMSI_MSK_REG regptr(MSP_CIC_BASE + 0x18)
505#define CIC_PCIFLSH_REG regptr(MSP_CIC_BASE + 0x18)
506#define CIC_VPE0_SWINT_REG regptr(MSP_CIC_BASE + 0x08)
507
508
509/*
510 ***************************************************************************
511 * Memory controller registers *
512 ***************************************************************************
513 */
514#define MEM_CFG1_REG regptr(MSP_MEM_CFG_BASE + 0x00)
515#define MEM_SS_ADDR regptr(MSP_MEM_CFG_BASE + 0x00)
516#define MEM_SS_DATA regptr(MSP_MEM_CFG_BASE + 0x04)
517#define MEM_SS_WRITE regptr(MSP_MEM_CFG_BASE + 0x08)
518
519/*
520 ***************************************************************************
521 * PCI controller registers *
522 ***************************************************************************
523 */
524#define PCI_BASE_REG regptr(MSP_PCI_BASE + 0x00)
525#define PCI_CONFIG_SPACE_REG regptr(MSP_PCI_BASE + 0x800)
526#define PCI_JTAG_DEVID_REG regptr(MSP_SLP_BASE + 0x13c)
527
528/*
529 ########################################################################
530 # Register content & macro definitions #
531 ########################################################################
532 */
533
534/*
535 ***************************************************************************
536 * DEV_ID defines *
537 ***************************************************************************
538 */
539#define DEV_ID_PCI_DIS (1 << 26) /* Set if PCI disabled */
540#define DEV_ID_PCI_HOST (1 << 20) /* Set if PCI host */
541#define DEV_ID_SINGLE_PC (1 << 19) /* Set if single PC Card */
542#define DEV_ID_FAMILY (0xff << 8) /* family ID code */
543#define POLO_ZEUS_SUB_FAMILY (0x7 << 16) /* sub family for Polo/Zeus */
544
545#define MSPFPGA_ID (0x00 << 8) /* you are on your own here */
546#define MSP5000_ID (0x50 << 8)
547#define MSP4F00_ID (0x4f << 8) /* FPGA version of MSP4200 */
548#define MSP4E00_ID (0x4f << 8) /* FPGA version of MSP7120 */
549#define MSP4200_ID (0x42 << 8)
550#define MSP4000_ID (0x40 << 8)
551#define MSP2XXX_ID (0x20 << 8)
552#define MSPZEUS_ID (0x10 << 8)
553
554#define MSP2004_SUB_ID (0x0 << 16)
555#define MSP2005_SUB_ID (0x1 << 16)
556#define MSP2006_SUB_ID (0x1 << 16)
557#define MSP2007_SUB_ID (0x2 << 16)
558#define MSP2010_SUB_ID (0x3 << 16)
559#define MSP2015_SUB_ID (0x4 << 16)
560#define MSP2020_SUB_ID (0x5 << 16)
561#define MSP2100_SUB_ID (0x6 << 16)
562
563/*
564 ***************************************************************************
565 * RESET defines *
566 ***************************************************************************
567 */
568#define MSP_GR_RST (0x01 << 0) /* Global reset bit */
569#define MSP_MR_RST (0x01 << 1) /* MIPS reset bit */
570#define MSP_PD_RST (0x01 << 2) /* PVC DMA reset bit */
571#define MSP_PP_RST (0x01 << 3) /* PVC reset bit */
572/* reserved */
573#define MSP_EA_RST (0x01 << 6) /* Mac A reset bit */
574#define MSP_EB_RST (0x01 << 7) /* Mac B reset bit */
575#define MSP_SE_RST (0x01 << 8) /* Security Eng reset bit */
576#define MSP_PB_RST (0x01 << 9) /* Per block reset bit */
577#define MSP_EC_RST (0x01 << 10) /* Mac C reset bit */
578#define MSP_TW_RST (0x01 << 11) /* TWI reset bit */
579#define MSP_SPI_RST (0x01 << 12) /* SPI/MPI reset bit */
580#define MSP_U1_RST (0x01 << 13) /* UART1 reset bit */
581#define MSP_U0_RST (0x01 << 14) /* UART0 reset bit */
582
583/*
584 ***************************************************************************
585 * UART defines *
586 ***************************************************************************
587 */
588#ifndef CONFIG_MSP_FPGA
589#define MSP_BASE_BAUD 25000000
590#else
591#define MSP_BASE_BAUD 6000000
592#endif
593#define MSP_UART_REG_LEN 0x20
594
595/*
596 ***************************************************************************
597 * ELB defines *
598 ***************************************************************************
599 */
600#define PCCARD_32 0x02 /* Set if is PCCARD 32 (Cardbus) */
601#define SINGLE_PCCARD 0x01 /* Set to enable single PC card */
602
603/*
604 ***************************************************************************
605 * CIC defines *
606 ***************************************************************************
607 */
608
609/* CIC_EXT_CFG_REG */
610#define EXT_INT_POL(eirq) (1 << (eirq + 8))
611#define EXT_INT_EDGE(eirq) (1 << eirq)
612
613#define CIC_EXT_SET_TRIGGER_LEVEL(reg, eirq) (reg &= ~EXT_INT_EDGE(eirq))
614#define CIC_EXT_SET_TRIGGER_EDGE(reg, eirq) (reg |= EXT_INT_EDGE(eirq))
615#define CIC_EXT_SET_ACTIVE_HI(reg, eirq) (reg |= EXT_INT_POL(eirq))
616#define CIC_EXT_SET_ACTIVE_LO(reg, eirq) (reg &= ~EXT_INT_POL(eirq))
617#define CIC_EXT_SET_ACTIVE_RISING CIC_EXT_SET_ACTIVE_HI
618#define CIC_EXT_SET_ACTIVE_FALLING CIC_EXT_SET_ACTIVE_LO
619
620#define CIC_EXT_IS_TRIGGER_LEVEL(reg, eirq) \
621 ((reg & EXT_INT_EDGE(eirq)) == 0)
622#define CIC_EXT_IS_TRIGGER_EDGE(reg, eirq) (reg & EXT_INT_EDGE(eirq))
623#define CIC_EXT_IS_ACTIVE_HI(reg, eirq) (reg & EXT_INT_POL(eirq))
624#define CIC_EXT_IS_ACTIVE_LO(reg, eirq) \
625 ((reg & EXT_INT_POL(eirq)) == 0)
626#define CIC_EXT_IS_ACTIVE_RISING CIC_EXT_IS_ACTIVE_HI
627#define CIC_EXT_IS_ACTIVE_FALLING CIC_EXT_IS_ACTIVE_LO
628
629/*
630 ***************************************************************************
631 * Memory Controller defines *
632 ***************************************************************************
633 */
634
635/* Indirect memory controller registers */
636#define DDRC_CFG(n) (n)
637#define DDRC_DEBUG(n) (0x04 + n)
638#define DDRC_CTL(n) (0x40 + n)
639
640/* Macro to perform DDRC indirect write */
641#define DDRC_INDIRECT_WRITE(reg, mask, value) \
642({ \
643 *MEM_SS_ADDR = (((mask) & 0xf) << 8) | ((reg) & 0xff); \
644 *MEM_SS_DATA = (value); \
645 *MEM_SS_WRITE = 1; \
646})
647
648/*
649 ***************************************************************************
650 * SPI/MPI Mode *
651 ***************************************************************************
652 */
653#define SPI_MPI_RX_BUSY 0x00008000 /* SPI/MPI Receive Busy */
654#define SPI_MPI_FIFO_EMPTY 0x00004000 /* SPI/MPI Fifo Empty */
655#define SPI_MPI_TX_BUSY 0x00002000 /* SPI/MPI Transmit Busy */
656#define SPI_MPI_FIFO_FULL 0x00001000 /* SPI/MPU FIFO full */
657
658/*
659 ***************************************************************************
660 * SPI/MPI Control Register *
661 ***************************************************************************
662 */
663#define SPI_MPI_RX_START 0x00000004 /* Start receive command */
664#define SPI_MPI_FLUSH_Q 0x00000002 /* Flush SPI/MPI Queue */
665#define SPI_MPI_TX_START 0x00000001 /* Start Transmit Command */
666
667#endif /* !_ASM_MSP_REGS_H */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h b/include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h
new file mode 100644
index 000000000000..96d4c8ce8c83
--- /dev/null
+++ b/include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h
@@ -0,0 +1,141 @@
1/*
2 * Defines for the MSP interrupt controller.
3 *
4 * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved.
5 * Author: Carsten Langgaard, carstenl@mips.com
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 */
24
25#ifndef _MSP_SLP_INT_H
26#define _MSP_SLP_INT_H
27
28/*
29 * The PMC-Sierra SLP interrupts are arranged in a 3 level cascaded
30 * hierarchical system. The first level are the direct MIPS interrupts
31 * and are assigned the interrupt range 0-7. The second level is the SLM
32 * interrupt controller and is assigned the range 8-39. The third level
33 * comprises the Peripherial block, the PCI block, the PCI MSI block and
34 * the SLP. The PCI interrupts and the SLP errors are handled by the
35 * relevant subsystems so the core interrupt code needs only concern
36 * itself with the Peripheral block. These are assigned interrupts in
37 * the range 40-71.
38 */
39
40/*
41 * IRQs directly connected to CPU
42 */
43#define MSP_MIPS_INTBASE 0
44#define MSP_INT_SW0 0 /* IRQ for swint0, C_SW0 */
45#define MSP_INT_SW1 1 /* IRQ for swint1, C_SW1 */
46#define MSP_INT_MAC0 2 /* IRQ for MAC 0, C_IRQ0 */
47#define MSP_INT_MAC1 3 /* IRQ for MAC 1, C_IRQ1 */
48#define MSP_INT_C_IRQ2 4 /* Wired off, C_IRQ2 */
49#define MSP_INT_VE 5 /* IRQ for Voice Engine, C_IRQ3 */
50#define MSP_INT_SLP 6 /* IRQ for SLM block, C_IRQ4 */
51#define MSP_INT_TIMER 7 /* IRQ for the MIPS timer, C_IRQ5 */
52
53/*
54 * IRQs cascaded on CPU interrupt 4 (CAUSE bit 12, C_IRQ4)
55 * These defines should be tied to the register definition for the SLM
56 * interrupt routine. For now, just use hard-coded values.
57 */
58#define MSP_SLP_INTBASE (MSP_MIPS_INTBASE + 8)
59#define MSP_INT_EXT0 (MSP_SLP_INTBASE + 0)
60 /* External interrupt 0 */
61#define MSP_INT_EXT1 (MSP_SLP_INTBASE + 1)
62 /* External interrupt 1 */
63#define MSP_INT_EXT2 (MSP_SLP_INTBASE + 2)
64 /* External interrupt 2 */
65#define MSP_INT_EXT3 (MSP_SLP_INTBASE + 3)
66 /* External interrupt 3 */
67/* Reserved 4-7 */
68
69/*
70 *************************************************************************
71 * DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER *
72 * Some MSP produces have this interrupt labelled as Voice and some are *
73 * SEC mbox ... *
74 *************************************************************************
75 */
76#define MSP_INT_SLP_VE (MSP_SLP_INTBASE + 8)
77 /* Cascaded IRQ for Voice Engine*/
78#define MSP_INT_SLP_TDM (MSP_SLP_INTBASE + 9)
79 /* TDM interrupt */
80#define MSP_INT_SLP_MAC0 (MSP_SLP_INTBASE + 10)
81 /* Cascaded IRQ for MAC 0 */
82#define MSP_INT_SLP_MAC1 (MSP_SLP_INTBASE + 11)
83 /* Cascaded IRQ for MAC 1 */
84#define MSP_INT_SEC (MSP_SLP_INTBASE + 12)
85 /* IRQ for security engine */
86#define MSP_INT_PER (MSP_SLP_INTBASE + 13)
87 /* Peripheral interrupt */
88#define MSP_INT_TIMER0 (MSP_SLP_INTBASE + 14)
89 /* SLP timer 0 */
90#define MSP_INT_TIMER1 (MSP_SLP_INTBASE + 15)
91 /* SLP timer 1 */
92#define MSP_INT_TIMER2 (MSP_SLP_INTBASE + 16)
93 /* SLP timer 2 */
94#define MSP_INT_SLP_TIMER (MSP_SLP_INTBASE + 17)
95 /* Cascaded MIPS timer */
96#define MSP_INT_BLKCP (MSP_SLP_INTBASE + 18)
97 /* Block Copy */
98#define MSP_INT_UART0 (MSP_SLP_INTBASE + 19)
99 /* UART 0 */
100#define MSP_INT_PCI (MSP_SLP_INTBASE + 20)
101 /* PCI subsystem */
102#define MSP_INT_PCI_DBELL (MSP_SLP_INTBASE + 21)
103 /* PCI doorbell */
104#define MSP_INT_PCI_MSI (MSP_SLP_INTBASE + 22)
105 /* PCI Message Signal */
106#define MSP_INT_PCI_BC0 (MSP_SLP_INTBASE + 23)
107 /* PCI Block Copy 0 */
108#define MSP_INT_PCI_BC1 (MSP_SLP_INTBASE + 24)
109 /* PCI Block Copy 1 */
110#define MSP_INT_SLP_ERR (MSP_SLP_INTBASE + 25)
111 /* SLP error condition */
112#define MSP_INT_MAC2 (MSP_SLP_INTBASE + 26)
113 /* IRQ for MAC2 */
114/* Reserved 26-31 */
115
116/*
117 * IRQs cascaded on SLP PER interrupt (MSP_INT_PER)
118 */
119#define MSP_PER_INTBASE (MSP_SLP_INTBASE + 32)
120/* Reserved 0-1 */
121#define MSP_INT_UART1 (MSP_PER_INTBASE + 2)
122 /* UART 1 */
123/* Reserved 3-5 */
124#define MSP_INT_2WIRE (MSP_PER_INTBASE + 6)
125 /* 2-wire */
126#define MSP_INT_TM0 (MSP_PER_INTBASE + 7)
127 /* Peripheral timer block out 0 */
128#define MSP_INT_TM1 (MSP_PER_INTBASE + 8)
129 /* Peripheral timer block out 1 */
130/* Reserved 9 */
131#define MSP_INT_SPRX (MSP_PER_INTBASE + 10)
132 /* SPI RX complete */
133#define MSP_INT_SPTX (MSP_PER_INTBASE + 11)
134 /* SPI TX complete */
135#define MSP_INT_GPIO (MSP_PER_INTBASE + 12)
136 /* GPIO */
137#define MSP_INT_PER_ERR (MSP_PER_INTBASE + 13)
138 /* Peripheral error */
139/* Reserved 14-31 */
140
141#endif /* !_MSP_SLP_INT_H */
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index 5f80ba71ab92..1d8b9a8ae324 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -82,10 +82,6 @@ struct mips_fpu_struct {
82 unsigned int fcr31; 82 unsigned int fcr31;
83}; 83};
84 84
85#define INIT_FPU { \
86 {0,} \
87}
88
89#define NUM_DSP_REGS 6 85#define NUM_DSP_REGS 6
90 86
91typedef __u32 dspreg_t; 87typedef __u32 dspreg_t;
@@ -95,8 +91,6 @@ struct mips_dsp_state {
95 unsigned int dspcontrol; 91 unsigned int dspcontrol;
96}; 92};
97 93
98#define INIT_DSP {{0,},}
99
100#define INIT_CPUMASK { \ 94#define INIT_CPUMASK { \
101 {0,} \ 95 {0,} \
102} 96}
@@ -155,41 +149,63 @@ struct thread_struct {
155#define MF_N64 0 149#define MF_N64 0
156 150
157#ifdef CONFIG_MIPS_MT_FPAFF 151#ifdef CONFIG_MIPS_MT_FPAFF
158#define FPAFF_INIT 0, INIT_CPUMASK, 152#define FPAFF_INIT \
153 .emulated_fp = 0, \
154 .user_cpus_allowed = INIT_CPUMASK,
159#else 155#else
160#define FPAFF_INIT 156#define FPAFF_INIT
161#endif /* CONFIG_MIPS_MT_FPAFF */ 157#endif /* CONFIG_MIPS_MT_FPAFF */
162 158
163#define INIT_THREAD { \ 159#define INIT_THREAD { \
164 /* \ 160 /* \
165 * saved main processor registers \ 161 * Saved main processor registers \
166 */ \ 162 */ \
167 0, 0, 0, 0, 0, 0, 0, 0, \ 163 .reg16 = 0, \
168 0, 0, 0, \ 164 .reg17 = 0, \
169 /* \ 165 .reg18 = 0, \
170 * saved cp0 stuff \ 166 .reg19 = 0, \
171 */ \ 167 .reg20 = 0, \
172 0, \ 168 .reg21 = 0, \
173 /* \ 169 .reg22 = 0, \
174 * saved fpu/fpu emulator stuff \ 170 .reg23 = 0, \
175 */ \ 171 .reg29 = 0, \
176 INIT_FPU, \ 172 .reg30 = 0, \
177 /* \ 173 .reg31 = 0, \
178 * fpu affinity state (null if not FPAFF) \ 174 /* \
179 */ \ 175 * Saved cp0 stuff \
180 FPAFF_INIT \ 176 */ \
181 /* \ 177 .cp0_status = 0, \
182 * saved dsp/dsp emulator stuff \ 178 /* \
183 */ \ 179 * Saved FPU/FPU emulator stuff \
184 INIT_DSP, \ 180 */ \
185 /* \ 181 .fpu = { \
186 * Other stuff associated with the process \ 182 .fpr = {0,}, \
187 */ \ 183 .fcr31 = 0, \
188 0, 0, 0, 0, \ 184 }, \
189 /* \ 185 /* \
190 * For now the default is to fix address errors \ 186 * FPU affinity state (null if not FPAFF) \
191 */ \ 187 */ \
192 MF_FIXADE, 0, 0 \ 188 FPAFF_INIT \
189 /* \
190 * Saved DSP stuff \
191 */ \
192 .dsp = { \
193 .dspr = {0, }, \
194 .dspcontrol = 0, \
195 }, \
196 /* \
197 * Other stuff associated with the process \
198 */ \
199 .cp0_badvaddr = 0, \
200 .cp0_baduaddr = 0, \
201 .error_code = 0, \
202 .trap_no = 0, \
203 /* \
204 * For now the default is to fix address errors \
205 */ \
206 .mflags = MF_FIXADE, \
207 .irix_trampoline = 0, \
208 .irix_oldctx = 0, \
193} 209}
194 210
195struct task_struct; 211struct task_struct;
@@ -237,7 +253,7 @@ unsigned long get_wchan(struct task_struct *p);
237 253
238#define ARCH_HAS_PREFETCH 254#define ARCH_HAS_PREFETCH
239 255
240extern inline void prefetch(const void *addr) 256static inline void prefetch(const void *addr)
241{ 257{
242 __asm__ __volatile__( 258 __asm__ __volatile__(
243 " .set mips4 \n" 259 " .set mips4 \n"
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index 1906938285c0..85b44366343a 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -86,7 +86,7 @@ struct pt_regs {
86 86
87extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); 87extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit);
88 88
89extern NORET_TYPE void die(const char *, struct pt_regs *); 89extern NORET_TYPE void die(const char *, struct pt_regs *) ATTRIB_NORET;
90 90
91static inline void die_if_kernel(const char *str, struct pt_regs *regs) 91static inline void die_if_kernel(const char *str, struct pt_regs *regs)
92{ 92{
diff --git a/include/asm-mips/rtc.h b/include/asm-mips/rtc.h
deleted file mode 100644
index 82ad401c7dca..000000000000
--- a/include/asm-mips/rtc.h
+++ /dev/null
@@ -1,73 +0,0 @@
1/*
2 * include/asm-mips/rtc.h
3 *
4 * (Really an interface for drivers/char/genrtc.c)
5 *
6 * Copyright (C) 2004 MontaVista Software Inc.
7 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
8 *
9 * Please read the COPYING file for all license details.
10 */
11
12#ifndef _MIPS_RTC_H
13#define _MIPS_RTC_H
14
15#ifdef __KERNEL__
16
17#include <linux/rtc.h>
18#include <asm/time.h>
19
20#define RTC_PIE 0x40 /* periodic interrupt enable */
21#define RTC_AIE 0x20 /* alarm interrupt enable */
22#define RTC_UIE 0x10 /* update-finished interrupt enable */
23
24/* some dummy definitions */
25#define RTC_BATT_BAD 0x100 /* battery bad */
26#define RTC_SQWE 0x08 /* enable square-wave output */
27#define RTC_DM_BINARY 0x04 /* all time/date values are BCD if clear */
28#define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */
29#define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */
30
31static inline unsigned int get_rtc_time(struct rtc_time *time)
32{
33 unsigned long nowtime;
34
35 nowtime = rtc_mips_get_time();
36 to_tm(nowtime, time);
37 time->tm_year -= 1900;
38
39 return RTC_24H;
40}
41
42static inline int set_rtc_time(struct rtc_time *time)
43{
44 unsigned long nowtime;
45 int ret;
46
47 nowtime = mktime(time->tm_year+1900, time->tm_mon+1,
48 time->tm_mday, time->tm_hour, time->tm_min,
49 time->tm_sec);
50 ret = rtc_mips_set_time(nowtime);
51
52 return ret;
53}
54
55static inline unsigned int get_rtc_ss(void)
56{
57 struct rtc_time h;
58
59 get_rtc_time(&h);
60 return h.tm_sec;
61}
62
63static inline int get_rtc_pll(struct rtc_pll_info *pll)
64{
65 return -EINVAL;
66}
67
68static inline int set_rtc_pll(struct rtc_pll_info *pll)
69{
70 return -EINVAL;
71}
72#endif
73#endif
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
index ce51213d84f9..c07ebd8eb9e7 100644
--- a/include/asm-mips/serial.h
+++ b/include/asm-mips/serial.h
@@ -19,159 +19,4 @@
19 */ 19 */
20#define BASE_BAUD (1843200 / 16) 20#define BASE_BAUD (1843200 / 16)
21 21
22/* Standard COM flags (except for COM4, because of the 8514 problem) */
23#ifdef CONFIG_SERIAL_DETECT_IRQ
24#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
25#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
26#else
27#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
28#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
29#endif
30
31#ifdef CONFIG_MACH_JAZZ
32#include <asm/jazz.h>
33
34#ifndef CONFIG_OLIVETTI_M700
35 /* Some Jazz machines seem to have an 8MHz crystal clock but I don't know
36 exactly which ones ... XXX */
37#define JAZZ_BASE_BAUD ( 8000000 / 16 ) /* ( 3072000 / 16) */
38#else
39/* but the M700 isn't such a strange beast */
40#define JAZZ_BASE_BAUD BASE_BAUD
41#endif
42
43#define _JAZZ_SERIAL_INIT(int, base) \
44 { .baud_base = JAZZ_BASE_BAUD, .irq = int, .flags = STD_COM_FLAGS, \
45 .iomem_base = (u8 *) base, .iomem_reg_shift = 0, \
46 .io_type = SERIAL_IO_MEM }
47#define JAZZ_SERIAL_PORT_DEFNS \
48 _JAZZ_SERIAL_INIT(JAZZ_SERIAL1_IRQ, JAZZ_SERIAL1_BASE), \
49 _JAZZ_SERIAL_INIT(JAZZ_SERIAL2_IRQ, JAZZ_SERIAL2_BASE),
50#else
51#define JAZZ_SERIAL_PORT_DEFNS
52#endif
53
54/*
55 * Galileo EV64120 evaluation board
56 */
57#ifdef CONFIG_MIPS_EV64120
58#include <mach-gt64120.h>
59#define EV64120_SERIAL_PORT_DEFNS \
60 { .baud_base = EV64120_BASE_BAUD, .irq = EV64120_UART_IRQ, \
61 .flags = STD_COM_FLAGS, \
62 .iomem_base = EV64120_UART0_REGS_BASE, .iomem_reg_shift = 2, \
63 .io_type = SERIAL_IO_MEM }, \
64 { .baud_base = EV64120_BASE_BAUD, .irq = EV64120_UART_IRQ, \
65 .flags = STD_COM_FLAGS, \
66 .iomem_base = EV64120_UART1_REGS_BASE, .iomem_reg_shift = 2, \
67 .io_type = SERIAL_IO_MEM },
68#else
69#define EV64120_SERIAL_PORT_DEFNS
70#endif
71
72#ifdef CONFIG_HAVE_STD_PC_SERIAL_PORT
73#define STD_SERIAL_PORT_DEFNS \
74 /* UART CLK PORT IRQ FLAGS */ \
75 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
76 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
77 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
78 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
79
80#else /* CONFIG_HAVE_STD_PC_SERIAL_PORTS */
81#define STD_SERIAL_PORT_DEFNS
82#endif /* CONFIG_HAVE_STD_PC_SERIAL_PORTS */
83
84#ifdef CONFIG_MOMENCO_OCELOT_3
85#define OCELOT_3_BASE_BAUD ( 20000000 / 16 )
86#define OCELOT_3_SERIAL_IRQ 6
87#define OCELOT_3_SERIAL_BASE (signed)0xfd000020
88
89#define _OCELOT_3_SERIAL_INIT(int, base) \
90 { .baud_base = OCELOT_3_BASE_BAUD, irq: int, \
91 .flags = STD_COM_FLAGS, \
92 .iomem_base = (u8 *) base, iomem_reg_shift: 2, \
93 io_type: SERIAL_IO_MEM }
94
95#define MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS \
96 _OCELOT_3_SERIAL_INIT(OCELOT_3_SERIAL_IRQ, OCELOT_3_SERIAL_BASE)
97#else
98#define MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS
99#endif
100
101#ifdef CONFIG_MOMENCO_OCELOT
102/* Ordinary NS16552 duart with a 20MHz crystal. */
103#define OCELOT_BASE_BAUD ( 20000000 / 16 )
104
105#define OCELOT_SERIAL1_IRQ 4
106#define OCELOT_SERIAL1_BASE 0xe0001020
107
108#define _OCELOT_SERIAL_INIT(int, base) \
109 { .baud_base = OCELOT_BASE_BAUD, .irq = int, .flags = STD_COM_FLAGS, \
110 .iomem_base = (u8 *) base, .iomem_reg_shift = 2, \
111 .io_type = SERIAL_IO_MEM }
112#define MOMENCO_OCELOT_SERIAL_PORT_DEFNS \
113 _OCELOT_SERIAL_INIT(OCELOT_SERIAL1_IRQ, OCELOT_SERIAL1_BASE)
114#else
115#define MOMENCO_OCELOT_SERIAL_PORT_DEFNS
116#endif
117
118#ifdef CONFIG_MOMENCO_OCELOT_C
119/* Ordinary NS16552 duart with a 20MHz crystal. */
120#define OCELOT_C_BASE_BAUD ( 20000000 / 16 )
121
122#define OCELOT_C_SERIAL1_IRQ 80
123#define OCELOT_C_SERIAL1_BASE 0xfd000020
124
125#define OCELOT_C_SERIAL2_IRQ 81
126#define OCELOT_C_SERIAL2_BASE 0xfd000000
127
128#define _OCELOT_C_SERIAL_INIT(int, base) \
129 { .baud_base = OCELOT_C_BASE_BAUD, \
130 .irq = (int), \
131 .flags = STD_COM_FLAGS, \
132 .iomem_base = (u8 *) base, \
133 .iomem_reg_shift = 2, \
134 .io_type = SERIAL_IO_MEM \
135 }
136#define MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS \
137 _OCELOT_C_SERIAL_INIT(OCELOT_C_SERIAL1_IRQ, OCELOT_C_SERIAL1_BASE), \
138 _OCELOT_C_SERIAL_INIT(OCELOT_C_SERIAL2_IRQ, OCELOT_C_SERIAL2_BASE)
139#else
140#define MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS
141#endif
142
143#ifdef CONFIG_DDB5477
144#include <asm/ddb5xxx/ddb5477.h>
145#define DDB5477_SERIAL_PORT_DEFNS \
146 { .baud_base = BASE_BAUD, .irq = VRC5477_IRQ_UART0, \
147 .flags = STD_COM_FLAGS, .iomem_base = (u8*)0xbfa04200, \
148 .iomem_reg_shift = 3, .io_type = SERIAL_IO_MEM}, \
149 { .baud_base = BASE_BAUD, .irq = VRC5477_IRQ_UART1, \
150 .flags = STD_COM_FLAGS, .iomem_base = (u8*)0xbfa04240, \
151 .iomem_reg_shift = 3, .io_type = SERIAL_IO_MEM},
152#else
153#define DDB5477_SERIAL_PORT_DEFNS
154#endif
155
156#ifdef CONFIG_SGI_IP32
157/*
158 * The IP32 (SGI O2) has standard serial ports (UART 16550A) mapped in memory
159 * They are initialized in ip32_setup
160 */
161#define IP32_SERIAL_PORT_DEFNS \
162 {},{},
163#else
164#define IP32_SERIAL_PORT_DEFNS
165#endif /* CONFIG_SGI_IP32 */
166
167#define SERIAL_PORT_DFNS \
168 DDB5477_SERIAL_PORT_DEFNS \
169 EV64120_SERIAL_PORT_DEFNS \
170 IP32_SERIAL_PORT_DEFNS \
171 JAZZ_SERIAL_PORT_DEFNS \
172 STD_SERIAL_PORT_DEFNS \
173 MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS \
174 MOMENCO_OCELOT_SERIAL_PORT_DEFNS \
175 MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS
176
177#endif /* _ASM_SERIAL_H */ 22#endif /* _ASM_SERIAL_H */
diff --git a/include/asm-mips/sibyte/bcm1480_regs.h b/include/asm-mips/sibyte/bcm1480_regs.h
index bda391d3af85..2738c1366f66 100644
--- a/include/asm-mips/sibyte/bcm1480_regs.h
+++ b/include/asm-mips/sibyte/bcm1480_regs.h
@@ -220,17 +220,25 @@
220#define A_BCM1480_DUART(chan) ((((chan)&2) == 0)? A_BCM1480_DUART0 : A_BCM1480_DUART1) 220#define A_BCM1480_DUART(chan) ((((chan)&2) == 0)? A_BCM1480_DUART0 : A_BCM1480_DUART1)
221 221
222#define BCM1480_DUART_CHANREG_SPACING 0x100 222#define BCM1480_DUART_CHANREG_SPACING 0x100
223#define A_BCM1480_DUART_CHANREG(chan,reg) (A_BCM1480_DUART(chan) \ 223#define A_BCM1480_DUART_CHANREG(chan, reg) \
224 + BCM1480_DUART_CHANREG_SPACING*((chan)&1) \ 224 (A_BCM1480_DUART(chan) + \
225 + (reg)) 225 BCM1480_DUART_CHANREG_SPACING * (((chan) & 1) + 1) + (reg))
226#define R_BCM1480_DUART_CHANREG(chan,reg) (BCM1480_DUART_CHANREG_SPACING*((chan)&1) + (reg)) 226#define A_BCM1480_DUART_CTRLREG(chan, reg) \
227 227 (A_BCM1480_DUART(chan) + \
228#define R_BCM1480_DUART_IMRREG(chan) (R_DUART_IMR_A + ((chan)&1)*DUART_IMRISR_SPACING) 228 BCM1480_DUART_CHANREG_SPACING * 3 + (reg))
229#define R_BCM1480_DUART_ISRREG(chan) (R_DUART_ISR_A + ((chan)&1)*DUART_IMRISR_SPACING) 229
230 230#define R_BCM1480_DUART_IMRREG(chan) \
231#define A_BCM1480_DUART_IMRREG(chan) (A_BCM1480_DUART(chan) + R_BCM1480_DUART_IMRREG(chan)) 231 (R_DUART_IMR_A + ((chan) & 1) * DUART_IMRISR_SPACING)
232#define A_BCM1480_DUART_ISRREG(chan) (A_BCM1480_DUART(chan) + R_BCM1480_DUART_ISRREG(chan)) 232#define R_BCM1480_DUART_ISRREG(chan) \
233#define A_BCM1480_DUART_IN_PORT(chan) (A_BCM1480_DUART(chan) + R_DUART_INP_ORT) 233 (R_DUART_ISR_A + ((chan) & 1) * DUART_IMRISR_SPACING)
234
235#define A_BCM1480_DUART_IMRREG(chan) \
236 (A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_IMRREG(chan)))
237#define A_BCM1480_DUART_ISRREG(chan) \
238 (A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_ISRREG(chan)))
239
240#define A_BCM1480_DUART_IN_PORT(chan) \
241 (A_BCM1480_DUART_CTRLREG((chan), R_DUART_IN_PORT))
234 242
235/* 243/*
236 * These constants are the absolute addresses. 244 * These constants are the absolute addresses.
diff --git a/include/asm-mips/sibyte/sb1250_regs.h b/include/asm-mips/sibyte/sb1250_regs.h
index da7c188993c9..220b7e94f1bf 100644
--- a/include/asm-mips/sibyte/sb1250_regs.h
+++ b/include/asm-mips/sibyte/sb1250_regs.h
@@ -272,59 +272,69 @@
272 ********************************************************************* */ 272 ********************************************************************* */
273 273
274 274
275#if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */ 275#if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */
276#define R_DUART_NUM_PORTS 2 276#define R_DUART_NUM_PORTS 2
277 277
278#define A_DUART 0x0010060000 278#define A_DUART 0x0010060000
279 279
280#define DUART_CHANREG_SPACING 0x100 280#define DUART_CHANREG_SPACING 0x100
281#define A_DUART_CHANREG(chan,reg) (A_DUART + DUART_CHANREG_SPACING*(chan) + (reg)) 281
282#define R_DUART_CHANREG(chan,reg) (DUART_CHANREG_SPACING*(chan) + (reg)) 282#define A_DUART_CHANREG(chan, reg) \
283 (A_DUART + DUART_CHANREG_SPACING * ((chan) + 1) + (reg))
283#endif /* 1250 & 112x */ 284#endif /* 1250 & 112x */
284 285
285#define R_DUART_MODE_REG_1 0x100 286#define R_DUART_MODE_REG_1 0x000
286#define R_DUART_MODE_REG_2 0x110 287#define R_DUART_MODE_REG_2 0x010
287#define R_DUART_STATUS 0x120 288#define R_DUART_STATUS 0x020
288#define R_DUART_CLK_SEL 0x130 289#define R_DUART_CLK_SEL 0x030
289#define R_DUART_CMD 0x150 290#define R_DUART_CMD 0x050
290#define R_DUART_RX_HOLD 0x160 291#define R_DUART_RX_HOLD 0x060
291#define R_DUART_TX_HOLD 0x170 292#define R_DUART_TX_HOLD 0x070
292 293
293#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) 294#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
294#define R_DUART_FULL_CTL 0x140 295#define R_DUART_FULL_CTL 0x040
295#define R_DUART_OPCR_X 0x180 296#define R_DUART_OPCR_X 0x080
296#define R_DUART_AUXCTL_X 0x190 297#define R_DUART_AUXCTL_X 0x090
297#endif /* 1250 PASS2 || 112x PASS1 || 1480*/ 298#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
298 299
299 300
300/* 301/*
301 * The IMR and ISR can't be addressed with A_DUART_CHANREG, 302 * The IMR and ISR can't be addressed with A_DUART_CHANREG,
302 * so use this macro instead. 303 * so use these macros instead.
303 */ 304 */
304 305
305#define R_DUART_AUX_CTRL 0x310 306#if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */
306#define R_DUART_ISR_A 0x320 307#define DUART_IMRISR_SPACING 0x20
307#define R_DUART_IMR_A 0x330 308#define DUART_INCHNG_SPACING 0x10
308#define R_DUART_ISR_B 0x340
309#define R_DUART_IMR_B 0x350
310#define R_DUART_OUT_PORT 0x360
311#define R_DUART_OPCR 0x370
312#define R_DUART_IN_PORT 0x380
313 309
314#define R_DUART_SET_OPR 0x3B0 310#define A_DUART_CTRLREG(reg) \
315#define R_DUART_CLEAR_OPR 0x3C0 311 (A_DUART + DUART_CHANREG_SPACING * 3 + (reg))
316 312
317#define DUART_IMRISR_SPACING 0x20 313#define R_DUART_IMRREG(chan) \
314 (R_DUART_IMR_A + (chan) * DUART_IMRISR_SPACING)
315#define R_DUART_ISRREG(chan) \
316 (R_DUART_ISR_A + (chan) * DUART_IMRISR_SPACING)
317#define R_DUART_INCHREG(chan) \
318 (R_DUART_IN_CHNG_A + (chan) * DUART_INCHNG_SPACING)
318 319
319#if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */ 320#define A_DUART_IMRREG(chan) A_DUART_CTRLREG(R_DUART_IMRREG(chan))
320#define R_DUART_IMRREG(chan) (R_DUART_IMR_A + (chan)*DUART_IMRISR_SPACING) 321#define A_DUART_ISRREG(chan) A_DUART_CTRLREG(R_DUART_ISRREG(chan))
321#define R_DUART_ISRREG(chan) (R_DUART_ISR_A + (chan)*DUART_IMRISR_SPACING) 322#define A_DUART_INCHREG(chan) A_DUART_CTRLREG(R_DUART_INCHREG(chan))
322
323#define A_DUART_IMRREG(chan) (A_DUART + R_DUART_IMRREG(chan))
324#define A_DUART_ISRREG(chan) (A_DUART + R_DUART_ISRREG(chan))
325#endif /* 1250 & 112x */ 323#endif /* 1250 & 112x */
326 324
327 325#define R_DUART_AUX_CTRL 0x010
326#define R_DUART_ISR_A 0x020
327#define R_DUART_IMR_A 0x030
328#define R_DUART_ISR_B 0x040
329#define R_DUART_IMR_B 0x050
330#define R_DUART_OUT_PORT 0x060
331#define R_DUART_OPCR 0x070
332#define R_DUART_IN_PORT 0x080
333
334#define R_DUART_SET_OPR 0x0B0
335#define R_DUART_CLEAR_OPR 0x0C0
336#define R_DUART_IN_CHNG_A 0x0D0
337#define R_DUART_IN_CHNG_B 0x0E0
328 338
329 339
330/* 340/*
diff --git a/include/asm-mips/sibyte/sb1250_uart.h b/include/asm-mips/sibyte/sb1250_uart.h
index e87045e62bf0..cf74fedcbef1 100644
--- a/include/asm-mips/sibyte/sb1250_uart.h
+++ b/include/asm-mips/sibyte/sb1250_uart.h
@@ -75,7 +75,8 @@
75#define V_DUART_PARITY_MODE_ADD_FIXED V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_ADD_FIXED) 75#define V_DUART_PARITY_MODE_ADD_FIXED V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_ADD_FIXED)
76#define V_DUART_PARITY_MODE_NONE V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_NONE) 76#define V_DUART_PARITY_MODE_NONE V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_NONE)
77 77
78#define M_DUART_ERR_MODE _SB_MAKEMASK1(5) /* must be zero */ 78#define M_DUART_TX_IRQ_SEL_TXRDY 0
79#define M_DUART_TX_IRQ_SEL_TXEMPT _SB_MAKEMASK1(5)
79 80
80#define M_DUART_RX_IRQ_SEL_RXRDY 0 81#define M_DUART_RX_IRQ_SEL_RXRDY 0
81#define M_DUART_RX_IRQ_SEL_RXFULL _SB_MAKEMASK1(6) 82#define M_DUART_RX_IRQ_SEL_RXFULL _SB_MAKEMASK1(6)
@@ -246,10 +247,13 @@
246 247
247#define M_DUART_ISR_BRK_A _SB_MAKEMASK1(2) 248#define M_DUART_ISR_BRK_A _SB_MAKEMASK1(2)
248#define M_DUART_ISR_IN_A _SB_MAKEMASK1(3) 249#define M_DUART_ISR_IN_A _SB_MAKEMASK1(3)
250#define M_DUART_ISR_ALL_A _SB_MAKEMASK(4,0)
251
249#define M_DUART_ISR_TX_B _SB_MAKEMASK1(4) 252#define M_DUART_ISR_TX_B _SB_MAKEMASK1(4)
250#define M_DUART_ISR_RX_B _SB_MAKEMASK1(5) 253#define M_DUART_ISR_RX_B _SB_MAKEMASK1(5)
251#define M_DUART_ISR_BRK_B _SB_MAKEMASK1(6) 254#define M_DUART_ISR_BRK_B _SB_MAKEMASK1(6)
252#define M_DUART_ISR_IN_B _SB_MAKEMASK1(7) 255#define M_DUART_ISR_IN_B _SB_MAKEMASK1(7)
256#define M_DUART_ISR_ALL_B _SB_MAKEMASK(4,4)
253 257
254/* 258/*
255 * DUART Channel A Interrupt Status Register (Table 10-17) 259 * DUART Channel A Interrupt Status Register (Table 10-17)
@@ -262,6 +266,7 @@
262#define M_DUART_ISR_RX _SB_MAKEMASK1(1) 266#define M_DUART_ISR_RX _SB_MAKEMASK1(1)
263#define M_DUART_ISR_BRK _SB_MAKEMASK1(2) 267#define M_DUART_ISR_BRK _SB_MAKEMASK1(2)
264#define M_DUART_ISR_IN _SB_MAKEMASK1(3) 268#define M_DUART_ISR_IN _SB_MAKEMASK1(3)
269#define M_DUART_ISR_ALL _SB_MAKEMASK(4,0)
265#define M_DUART_ISR_RESERVED _SB_MAKEMASK(4,4) 270#define M_DUART_ISR_RESERVED _SB_MAKEMASK(4,4)
266 271
267/* 272/*
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h
index 1608fd71d6f7..13aef6af422c 100644
--- a/include/asm-mips/smp.h
+++ b/include/asm-mips/smp.h
@@ -49,13 +49,6 @@ extern struct call_data_struct *call_data;
49extern cpumask_t phys_cpu_present_map; 49extern cpumask_t phys_cpu_present_map;
50#define cpu_possible_map phys_cpu_present_map 50#define cpu_possible_map phys_cpu_present_map
51 51
52extern cpumask_t cpu_callout_map;
53/* We don't mark CPUs online until __cpu_up(), so we need another measure */
54static inline int num_booting_cpus(void)
55{
56 return cpus_weight(cpu_callout_map);
57}
58
59/* 52/*
60 * These are defined by the board-specific code. 53 * These are defined by the board-specific code.
61 */ 54 */
diff --git a/include/asm-mips/sni.h b/include/asm-mips/sni.h
index f257509b914f..ddaf36a1e389 100644
--- a/include/asm-mips/sni.h
+++ b/include/asm-mips/sni.h
@@ -146,9 +146,6 @@ extern unsigned int sni_brd_type;
146#define SNI_A20R_IRQ_BASE MIPS_CPU_IRQ_BASE 146#define SNI_A20R_IRQ_BASE MIPS_CPU_IRQ_BASE
147#define SNI_A20R_IRQ_TIMER (SNI_A20R_IRQ_BASE+5) 147#define SNI_A20R_IRQ_TIMER (SNI_A20R_IRQ_BASE+5)
148 148
149#define SNI_DS1216_A20R_BASE 0xbc081ffc
150#define SNI_DS1216_RM200_BASE 0xbcd41ffc
151
152#define SNI_PCIT_INT_REG 0xbfff000c 149#define SNI_PCIT_INT_REG 0xbfff000c
153 150
154#define SNI_PCIT_INT_START 24 151#define SNI_PCIT_INT_START 24
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h
index 35e431cd796b..bb897016c491 100644
--- a/include/asm-mips/spinlock.h
+++ b/include/asm-mips/spinlock.h
@@ -67,7 +67,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
67 : "memory"); 67 : "memory");
68 } 68 }
69 69
70 smp_mb(); 70 smp_llsc_mb();
71} 71}
72 72
73static inline void __raw_spin_unlock(raw_spinlock_t *lock) 73static inline void __raw_spin_unlock(raw_spinlock_t *lock)
@@ -118,7 +118,7 @@ static inline unsigned int __raw_spin_trylock(raw_spinlock_t *lock)
118 : "memory"); 118 : "memory");
119 } 119 }
120 120
121 smp_mb(); 121 smp_llsc_mb();
122 122
123 return res == 0; 123 return res == 0;
124} 124}
@@ -183,7 +183,7 @@ static inline void __raw_read_lock(raw_rwlock_t *rw)
183 : "memory"); 183 : "memory");
184 } 184 }
185 185
186 smp_mb(); 186 smp_llsc_mb();
187} 187}
188 188
189/* Note the use of sub, not subu which will make the kernel die with an 189/* Note the use of sub, not subu which will make the kernel die with an
@@ -193,7 +193,7 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw)
193{ 193{
194 unsigned int tmp; 194 unsigned int tmp;
195 195
196 smp_mb(); 196 smp_llsc_mb();
197 197
198 if (R10000_LLSC_WAR) { 198 if (R10000_LLSC_WAR) {
199 __asm__ __volatile__( 199 __asm__ __volatile__(
@@ -262,7 +262,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw)
262 : "memory"); 262 : "memory");
263 } 263 }
264 264
265 smp_mb(); 265 smp_llsc_mb();
266} 266}
267 267
268static inline void __raw_write_unlock(raw_rwlock_t *rw) 268static inline void __raw_write_unlock(raw_rwlock_t *rw)
@@ -293,7 +293,7 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw)
293 " .set reorder \n" 293 " .set reorder \n"
294 " beqzl %1, 1b \n" 294 " beqzl %1, 1b \n"
295 " nop \n" 295 " nop \n"
296 __WEAK_ORDERING_MB 296 __WEAK_LLSC_MB
297 " li %2, 1 \n" 297 " li %2, 1 \n"
298 "2: \n" 298 "2: \n"
299 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret) 299 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret)
@@ -310,7 +310,7 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw)
310 " beqz %1, 1b \n" 310 " beqz %1, 1b \n"
311 " nop \n" 311 " nop \n"
312 " .set reorder \n" 312 " .set reorder \n"
313 __WEAK_ORDERING_MB 313 __WEAK_LLSC_MB
314 " li %2, 1 \n" 314 " li %2, 1 \n"
315 "2: \n" 315 "2: \n"
316 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret) 316 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret)
@@ -336,7 +336,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
336 " sc %1, %0 \n" 336 " sc %1, %0 \n"
337 " beqzl %1, 1b \n" 337 " beqzl %1, 1b \n"
338 " nop \n" 338 " nop \n"
339 __WEAK_ORDERING_MB 339 __WEAK_LLSC_MB
340 " li %2, 1 \n" 340 " li %2, 1 \n"
341 " .set reorder \n" 341 " .set reorder \n"
342 "2: \n" 342 "2: \n"
@@ -354,7 +354,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
354 " beqz %1, 3f \n" 354 " beqz %1, 3f \n"
355 " li %2, 1 \n" 355 " li %2, 1 \n"
356 "2: \n" 356 "2: \n"
357 __WEAK_ORDERING_MB 357 __WEAK_LLSC_MB
358 " .subsection 2 \n" 358 " .subsection 2 \n"
359 "3: b 1b \n" 359 "3: b 1b \n"
360 " li %2, 0 \n" 360 " li %2, 0 \n"
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index 7afa1fdf70ca..ed33366b85b8 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -17,6 +17,18 @@
17#include <asm/mipsregs.h> 17#include <asm/mipsregs.h>
18#include <asm/asm-offsets.h> 18#include <asm/asm-offsets.h>
19 19
20/*
21 * For SMTC kernel, global IE should be left set, and interrupts
22 * controlled exclusively via IXMT.
23 */
24#ifdef CONFIG_MIPS_MT_SMTC
25#define STATMASK 0x1e
26#elif defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
27#define STATMASK 0x3f
28#else
29#define STATMASK 0x1f
30#endif
31
20#ifdef CONFIG_MIPS_MT_SMTC 32#ifdef CONFIG_MIPS_MT_SMTC
21#include <asm/mipsmtregs.h> 33#include <asm/mipsmtregs.h>
22#endif /* CONFIG_MIPS_MT_SMTC */ 34#endif /* CONFIG_MIPS_MT_SMTC */
@@ -236,10 +248,10 @@
236 .set reorder 248 .set reorder
237 .set noat 249 .set noat
238 mfc0 a0, CP0_STATUS 250 mfc0 a0, CP0_STATUS
239 ori a0, 0x1f
240 xori a0, 0x1f
241 mtc0 a0, CP0_STATUS
242 li v1, 0xff00 251 li v1, 0xff00
252 ori a0, STATMASK
253 xori a0, STATMASK
254 mtc0 a0, CP0_STATUS
243 and a0, v1 255 and a0, v1
244 LONG_L v0, PT_STATUS(sp) 256 LONG_L v0, PT_STATUS(sp)
245 nor v1, $0, v1 257 nor v1, $0, v1
@@ -249,10 +261,6 @@
249 LONG_L $31, PT_R31(sp) 261 LONG_L $31, PT_R31(sp)
250 LONG_L $28, PT_R28(sp) 262 LONG_L $28, PT_R28(sp)
251 LONG_L $25, PT_R25(sp) 263 LONG_L $25, PT_R25(sp)
252#ifdef CONFIG_64BIT
253 LONG_L $8, PT_R8(sp)
254 LONG_L $9, PT_R9(sp)
255#endif
256 LONG_L $7, PT_R7(sp) 264 LONG_L $7, PT_R7(sp)
257 LONG_L $6, PT_R6(sp) 265 LONG_L $6, PT_R6(sp)
258 LONG_L $5, PT_R5(sp) 266 LONG_L $5, PT_R5(sp)
@@ -273,16 +281,6 @@
273 .endm 281 .endm
274 282
275#else 283#else
276/*
277 * For SMTC kernel, global IE should be left set, and interrupts
278 * controlled exclusively via IXMT.
279 */
280
281#ifdef CONFIG_MIPS_MT_SMTC
282#define STATMASK 0x1e
283#else
284#define STATMASK 0x1f
285#endif
286 .macro RESTORE_SOME 284 .macro RESTORE_SOME
287 .set push 285 .set push
288 .set reorder 286 .set reorder
@@ -385,9 +383,9 @@
385 .macro CLI 383 .macro CLI
386#if !defined(CONFIG_MIPS_MT_SMTC) 384#if !defined(CONFIG_MIPS_MT_SMTC)
387 mfc0 t0, CP0_STATUS 385 mfc0 t0, CP0_STATUS
388 li t1, ST0_CU0 | 0x1f 386 li t1, ST0_CU0 | STATMASK
389 or t0, t1 387 or t0, t1
390 xori t0, 0x1f 388 xori t0, STATMASK
391 mtc0 t0, CP0_STATUS 389 mtc0 t0, CP0_STATUS
392#else /* CONFIG_MIPS_MT_SMTC */ 390#else /* CONFIG_MIPS_MT_SMTC */
393 /* 391 /*
@@ -420,9 +418,9 @@
420 .macro STI 418 .macro STI
421#if !defined(CONFIG_MIPS_MT_SMTC) 419#if !defined(CONFIG_MIPS_MT_SMTC)
422 mfc0 t0, CP0_STATUS 420 mfc0 t0, CP0_STATUS
423 li t1, ST0_CU0 | 0x1f 421 li t1, ST0_CU0 | STATMASK
424 or t0, t1 422 or t0, t1
425 xori t0, 0x1e 423 xori t0, STATMASK & ~1
426 mtc0 t0, CP0_STATUS 424 mtc0 t0, CP0_STATUS
427#else /* CONFIG_MIPS_MT_SMTC */ 425#else /* CONFIG_MIPS_MT_SMTC */
428 /* 426 /*
@@ -451,7 +449,8 @@
451 .endm 449 .endm
452 450
453/* 451/*
454 * Just move to kernel mode and leave interrupts as they are. 452 * Just move to kernel mode and leave interrupts as they are. Note
453 * for the R3000 this means copying the previous enable from IEp.
455 * Set cp0 enable bit as sign that we're running on the kernel stack 454 * Set cp0 enable bit as sign that we're running on the kernel stack
456 */ 455 */
457 .macro KMODE 456 .macro KMODE
@@ -482,9 +481,14 @@
482 move ra, t0 481 move ra, t0
483#endif /* CONFIG_MIPS_MT_SMTC */ 482#endif /* CONFIG_MIPS_MT_SMTC */
484 mfc0 t0, CP0_STATUS 483 mfc0 t0, CP0_STATUS
485 li t1, ST0_CU0 | 0x1e 484 li t1, ST0_CU0 | (STATMASK & ~1)
485#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
486 andi t2, t0, ST0_IEP
487 srl t2, 2
488 or t0, t2
489#endif
486 or t0, t1 490 or t0, t1
487 xori t0, 0x1e 491 xori t0, STATMASK & ~1
488 mtc0 t0, CP0_STATUS 492 mtc0 t0, CP0_STATUS
489#ifdef CONFIG_MIPS_MT_SMTC 493#ifdef CONFIG_MIPS_MT_SMTC
490 _ehb 494 _ehb
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index bb0b289dbc9e..8d0b1cd4a45e 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -44,7 +44,7 @@ struct task_struct;
44 * different thread. 44 * different thread.
45 */ 45 */
46 46
47#define switch_to(prev,next,last) \ 47#define __mips_mt_fpaff_switch_to(prev) \
48do { \ 48do { \
49 if (cpu_has_fpu && \ 49 if (cpu_has_fpu && \
50 (prev->thread.mflags & MF_FPUBOUND) && \ 50 (prev->thread.mflags & MF_FPUBOUND) && \
@@ -52,34 +52,24 @@ do { \
52 prev->thread.mflags &= ~MF_FPUBOUND; \ 52 prev->thread.mflags &= ~MF_FPUBOUND; \
53 prev->cpus_allowed = prev->thread.user_cpus_allowed; \ 53 prev->cpus_allowed = prev->thread.user_cpus_allowed; \
54 } \ 54 } \
55 if (cpu_has_dsp) \
56 __save_dsp(prev); \
57 next->thread.emulated_fp = 0; \ 55 next->thread.emulated_fp = 0; \
58 (last) = resume(prev, next, task_thread_info(next)); \
59 if (cpu_has_dsp) \
60 __restore_dsp(current); \
61} while(0) 56} while(0)
62 57
63#else 58#else
59#define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0)
60#endif
61
64#define switch_to(prev,next,last) \ 62#define switch_to(prev,next,last) \
65do { \ 63do { \
64 __mips_mt_fpaff_switch_to(prev); \
66 if (cpu_has_dsp) \ 65 if (cpu_has_dsp) \
67 __save_dsp(prev); \ 66 __save_dsp(prev); \
68 (last) = resume(prev, next, task_thread_info(next)); \ 67 (last) = resume(prev, next, task_thread_info(next)); \
69 if (cpu_has_dsp) \ 68 if (cpu_has_dsp) \
70 __restore_dsp(current); \ 69 __restore_dsp(current); \
70 if (cpu_has_userlocal) \
71 write_c0_userlocal(task_thread_info(current)->tp_value);\
71} while(0) 72} while(0)
72#endif
73
74/*
75 * On SMP systems, when the scheduler does migration-cost autodetection,
76 * it needs a way to flush as much of the CPU's caches as possible.
77 *
78 * TODO: fill this in!
79 */
80static inline void sched_cacheflush(void)
81{
82}
83 73
84static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) 74static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
85{ 75{
@@ -127,7 +117,7 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
127 raw_local_irq_restore(flags); /* implies memory barrier */ 117 raw_local_irq_restore(flags); /* implies memory barrier */
128 } 118 }
129 119
130 smp_mb(); 120 smp_llsc_mb();
131 121
132 return retval; 122 return retval;
133} 123}
@@ -175,7 +165,7 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
175 raw_local_irq_restore(flags); /* implies memory barrier */ 165 raw_local_irq_restore(flags); /* implies memory barrier */
176 } 166 }
177 167
178 smp_mb(); 168 smp_llsc_mb();
179 169
180 return retval; 170 return retval;
181} 171}
@@ -256,7 +246,7 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old,
256 raw_local_irq_restore(flags); /* implies memory barrier */ 246 raw_local_irq_restore(flags); /* implies memory barrier */
257 } 247 }
258 248
259 smp_mb(); 249 smp_llsc_mb();
260 250
261 return retval; 251 return retval;
262} 252}
@@ -362,7 +352,7 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
362 raw_local_irq_restore(flags); /* implies memory barrier */ 352 raw_local_irq_restore(flags); /* implies memory barrier */
363 } 353 }
364 354
365 smp_mb(); 355 smp_llsc_mb();
366 356
367 return retval; 357 return retval;
368} 358}
@@ -480,6 +470,6 @@ extern int stop_a_enabled;
480 */ 470 */
481#define __ARCH_WANT_UNLOCKED_CTXSW 471#define __ARCH_WANT_UNLOCKED_CTXSW
482 472
483#define arch_align_stack(x) (x) 473extern unsigned long arch_align_stack(unsigned long sp);
484 474
485#endif /* _ASM_SYSTEM_H */ 475#endif /* _ASM_SYSTEM_H */
diff --git a/include/asm-mips/termbits.h b/include/asm-mips/termbits.h
index 0bbe07b42a07..5bfdc3b64510 100644
--- a/include/asm-mips/termbits.h
+++ b/include/asm-mips/termbits.h
@@ -30,6 +30,17 @@ struct termios {
30 cc_t c_cc[NCCS]; /* control characters */ 30 cc_t c_cc[NCCS]; /* control characters */
31}; 31};
32 32
33struct termios2 {
34 tcflag_t c_iflag; /* input mode flags */
35 tcflag_t c_oflag; /* output mode flags */
36 tcflag_t c_cflag; /* control mode flags */
37 tcflag_t c_lflag; /* local mode flags */
38 cc_t c_line; /* line discipline */
39 cc_t c_cc[NCCS]; /* control characters */
40 speed_t c_ispeed; /* input speed */
41 speed_t c_ospeed; /* output speed */
42};
43
33struct ktermios { 44struct ktermios {
34 tcflag_t c_iflag; /* input mode flags */ 45 tcflag_t c_iflag; /* input mode flags */
35 tcflag_t c_oflag; /* output mode flags */ 46 tcflag_t c_oflag; /* output mode flags */
diff --git a/include/asm-mips/tlbdebug.h b/include/asm-mips/tlbdebug.h
index fff7a73e22d0..bb8f5c29c3d9 100644
--- a/include/asm-mips/tlbdebug.h
+++ b/include/asm-mips/tlbdebug.h
@@ -11,10 +11,6 @@
11/* 11/*
12 * TLB debugging functions: 12 * TLB debugging functions:
13 */ 13 */
14extern void dump_tlb(int first, int last);
15extern void dump_tlb_all(void); 14extern void dump_tlb_all(void);
16extern void dump_tlb_wired(void);
17extern void dump_tlb_addr(unsigned long addr);
18extern void dump_tlb_nonwired(void);
19 15
20#endif /* __ASM_TLBDEBUG_H */ 16#endif /* __ASM_TLBDEBUG_H */
diff --git a/include/asm-mips/tx4938/rbtx4938.h b/include/asm-mips/tx4938/rbtx4938.h
index 0fbedafdcea8..74e7d8061e58 100644
--- a/include/asm-mips/tx4938/rbtx4938.h
+++ b/include/asm-mips/tx4938/rbtx4938.h
@@ -105,12 +105,6 @@
105#define rbtx4938_pcireset_ptr \ 105#define rbtx4938_pcireset_ptr \
106 ((volatile unsigned char *)RBTX4938_PCIRESET_ADDR) 106 ((volatile unsigned char *)RBTX4938_PCIRESET_ADDR)
107 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/* 108/*
115 * IRQ mappings 109 * IRQ mappings
116 */ 110 */
diff --git a/include/asm-mips/tx4938/spi.h b/include/asm-mips/tx4938/spi.h
index 0dbbab820a5a..6a60c83e152b 100644
--- a/include/asm-mips/tx4938/spi.h
+++ b/include/asm-mips/tx4938/spi.h
@@ -14,61 +14,7 @@
14#ifndef __ASM_TX_BOARDS_TX4938_SPI_H 14#ifndef __ASM_TX_BOARDS_TX4938_SPI_H
15#define __ASM_TX_BOARDS_TX4938_SPI_H 15#define __ASM_TX_BOARDS_TX4938_SPI_H
16 16
17/* SPI */ 17extern int spi_eeprom_register(int chipid);
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); 18extern 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 19
74#endif /* __ASM_TX_BOARDS_TX4938_SPI_H */ 20#endif /* __ASM_TX_BOARDS_TX4938_SPI_H */
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 2f1087b3a202..ed16de0a6398 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -336,16 +336,20 @@
336#define __NR_epoll_pwait (__NR_Linux + 313) 336#define __NR_epoll_pwait (__NR_Linux + 313)
337#define __NR_ioprio_set (__NR_Linux + 314) 337#define __NR_ioprio_set (__NR_Linux + 314)
338#define __NR_ioprio_get (__NR_Linux + 315) 338#define __NR_ioprio_get (__NR_Linux + 315)
339#define __NR_utimensat (__NR_Linux + 316)
340#define __NR_signalfd (__NR_Linux + 317)
341#define __NR_timerfd (__NR_Linux + 318)
342#define __NR_eventfd (__NR_Linux + 319)
339 343
340/* 344/*
341 * Offset of the last Linux o32 flavoured syscall 345 * Offset of the last Linux o32 flavoured syscall
342 */ 346 */
343#define __NR_Linux_syscalls 315 347#define __NR_Linux_syscalls 319
344 348
345#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 349#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
346 350
347#define __NR_O32_Linux 4000 351#define __NR_O32_Linux 4000
348#define __NR_O32_Linux_syscalls 315 352#define __NR_O32_Linux_syscalls 319
349 353
350#if _MIPS_SIM == _MIPS_SIM_ABI64 354#if _MIPS_SIM == _MIPS_SIM_ABI64
351 355
@@ -628,16 +632,20 @@
628#define __NR_epoll_pwait (__NR_Linux + 272) 632#define __NR_epoll_pwait (__NR_Linux + 272)
629#define __NR_ioprio_set (__NR_Linux + 273) 633#define __NR_ioprio_set (__NR_Linux + 273)
630#define __NR_ioprio_get (__NR_Linux + 274) 634#define __NR_ioprio_get (__NR_Linux + 274)
635#define __NR_utimensat (__NR_Linux + 275)
636#define __NR_signalfd (__NR_Linux + 276)
637#define __NR_timerfd (__NR_Linux + 277)
638#define __NR_eventfd (__NR_Linux + 278)
631 639
632/* 640/*
633 * Offset of the last Linux 64-bit flavoured syscall 641 * Offset of the last Linux 64-bit flavoured syscall
634 */ 642 */
635#define __NR_Linux_syscalls 274 643#define __NR_Linux_syscalls 278
636 644
637#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 645#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
638 646
639#define __NR_64_Linux 5000 647#define __NR_64_Linux 5000
640#define __NR_64_Linux_syscalls 274 648#define __NR_64_Linux_syscalls 278
641 649
642#if _MIPS_SIM == _MIPS_SIM_NABI32 650#if _MIPS_SIM == _MIPS_SIM_NABI32
643 651
@@ -924,16 +932,20 @@
924#define __NR_epoll_pwait (__NR_Linux + 276) 932#define __NR_epoll_pwait (__NR_Linux + 276)
925#define __NR_ioprio_set (__NR_Linux + 277) 933#define __NR_ioprio_set (__NR_Linux + 277)
926#define __NR_ioprio_get (__NR_Linux + 278) 934#define __NR_ioprio_get (__NR_Linux + 278)
935#define __NR_utimensat (__NR_Linux + 279)
936#define __NR_signalfd (__NR_Linux + 280)
937#define __NR_timerfd (__NR_Linux + 281)
938#define __NR_eventfd (__NR_Linux + 282)
927 939
928/* 940/*
929 * Offset of the last N32 flavoured syscall 941 * Offset of the last N32 flavoured syscall
930 */ 942 */
931#define __NR_Linux_syscalls 278 943#define __NR_Linux_syscalls 282
932 944
933#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 945#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
934 946
935#define __NR_N32_Linux 6000 947#define __NR_N32_Linux 6000
936#define __NR_N32_Linux_syscalls 278 948#define __NR_N32_Linux_syscalls 282
937 949
938#ifdef __KERNEL__ 950#ifdef __KERNEL__
939 951
@@ -949,7 +961,6 @@
949#define __ARCH_WANT_SYS_UTIME 961#define __ARCH_WANT_SYS_UTIME
950#define __ARCH_WANT_SYS_WAITPID 962#define __ARCH_WANT_SYS_WAITPID
951#define __ARCH_WANT_SYS_SOCKETCALL 963#define __ARCH_WANT_SYS_SOCKETCALL
952#define __ARCH_WANT_SYS_FADVISE64
953#define __ARCH_WANT_SYS_GETPGRP 964#define __ARCH_WANT_SYS_GETPGRP
954#define __ARCH_WANT_SYS_LLSEEK 965#define __ARCH_WANT_SYS_LLSEEK
955#define __ARCH_WANT_SYS_NICE 966#define __ARCH_WANT_SYS_NICE
@@ -966,6 +977,22 @@
966# define __ARCH_WANT_COMPAT_SYS_TIME 977# define __ARCH_WANT_COMPAT_SYS_TIME
967# endif 978# endif
968 979
980/* whitelists for checksyscalls */
981#define __IGNORE_select
982#define __IGNORE_vfork
983#define __IGNORE_time
984#define __IGNORE_uselib
985#define __IGNORE_fadvise64_64
986#define __IGNORE_getdents64
987#if _MIPS_SIM == _MIPS_SIM_NABI32
988#define __IGNORE_truncate64
989#define __IGNORE_ftruncate64
990#define __IGNORE_stat64
991#define __IGNORE_lstat64
992#define __IGNORE_fstat64
993#define __IGNORE_fstatat64
994#endif
995
969#endif /* !__ASSEMBLY__ */ 996#endif /* !__ASSEMBLY__ */
970 997
971/* 998/*
diff --git a/include/asm-mips/vr41xx/giu.h b/include/asm-mips/vr41xx/giu.h
index 8109cda557dc..0bcdd3a5c256 100644
--- a/include/asm-mips/vr41xx/giu.h
+++ b/include/asm-mips/vr41xx/giu.h
@@ -20,6 +20,15 @@
20#ifndef __NEC_VR41XX_GIU_H 20#ifndef __NEC_VR41XX_GIU_H
21#define __NEC_VR41XX_GIU_H 21#define __NEC_VR41XX_GIU_H
22 22
23/*
24 * NEC VR4100 series GIU platform device IDs.
25 */
26enum {
27 GPIO_50PINS_PULLUPDOWN,
28 GPIO_36PINS,
29 GPIO_48PINS_EDGE_SELECT,
30};
31
23typedef enum { 32typedef enum {
24 IRQ_TRIGGER_LEVEL, 33 IRQ_TRIGGER_LEVEL,
25 IRQ_TRIGGER_EDGE, 34 IRQ_TRIGGER_EDGE,
diff --git a/include/asm-mips/vr41xx/siu.h b/include/asm-mips/vr41xx/siu.h
index 1fcf6e8082b4..98cdb4096485 100644
--- a/include/asm-mips/vr41xx/siu.h
+++ b/include/asm-mips/vr41xx/siu.h
@@ -20,6 +20,8 @@
20#ifndef __NEC_VR41XX_SIU_H 20#ifndef __NEC_VR41XX_SIU_H
21#define __NEC_VR41XX_SIU_H 21#define __NEC_VR41XX_SIU_H
22 22
23#define SIU_PORTS_MAX 2
24
23typedef enum { 25typedef enum {
24 SIU_INTERFACE_RS232C, 26 SIU_INTERFACE_RS232C,
25 SIU_INTERFACE_IRDA, 27 SIU_INTERFACE_IRDA,
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h
index 13a3502eef44..9de52a5b0f3d 100644
--- a/include/asm-mips/war.h
+++ b/include/asm-mips/war.h
@@ -169,26 +169,28 @@
169 169
170/* 170/*
171 * On the RM9000 there is a problem which makes the CreateDirtyExclusive 171 * On the RM9000 there is a problem which makes the CreateDirtyExclusive
172 * cache operation unusable on SMP systems. 172 * eache operation unusable on SMP systems.
173 */ 173 */
174#if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_PMC_YOSEMITE) || \ 174#if defined(CONFIG_PMC_YOSEMITE) || defined(CONFIG_BASLER_EXCITE)
175 defined(CONFIG_BASLER_EXCITE)
176#define RM9000_CDEX_SMP_WAR 1 175#define RM9000_CDEX_SMP_WAR 1
177#endif 176#endif
178 177
179/* 178/*
180 * The RM9000 has a bug (though PMC-Sierra opposes it being called that) 179 * The RM7000 processors and the E9000 cores have a bug (though PMC-Sierra
181 * where invalid instructions in the same I-cache line worth of instructions 180 * opposes it being called that) where invalid instructions in the same
182 * being fetched may case spurious exceptions. 181 * I-cache line worth of instructions being fetched may case spurious
182 * exceptions.
183 */ 183 */
184#if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_MOMENCO_OCELOT_3) || \ 184#if defined(CONFIG_BASLER_EXCITE) || defined(CONFIG_MIPS_ATLAS) || \
185 defined(CONFIG_PMC_YOSEMITE) || defined(CONFIG_BASLER_EXCITE) 185 defined(CONFIG_MIPS_MALTA) || defined(CONFIG_MOMENCO_OCELOT) || \
186 defined(CONFIG_PMC_YOSEMITE) || defined(CONFIG_SGI_IP32) || \
187 defined(CONFIG_WR_PPMC)
186#define ICACHE_REFILLS_WORKAROUND_WAR 1 188#define ICACHE_REFILLS_WORKAROUND_WAR 1
187#endif 189#endif
188 190
189 191
190/* 192/*
191 * ON the R10000 upto version 2.6 (not sure about 2.7) there is a bug that 193 * On the R10000 upto version 2.6 (not sure about 2.7) there is a bug that
192 * may cause ll / sc and lld / scd sequences to execute non-atomically. 194 * may cause ll / sc and lld / scd sequences to execute non-atomically.
193 */ 195 */
194#ifdef CONFIG_SGI_IP27 196#ifdef CONFIG_SGI_IP27
@@ -196,6 +198,14 @@
196#endif 198#endif
197 199
198/* 200/*
201 * 34K core erratum: "Problems Executing the TLBR Instruction"
202 */
203#if defined(CONFIG_PMC_MSP7120_EVAL) || defined(CONFIG_PMC_MSP7120_GW) || \
204 defined(CONFIG_PMC_MSP7120_FPGA)
205#define MIPS34K_MISSED_ITLB_WAR 1
206#endif
207
208/*
199 * Workarounds default to off 209 * Workarounds default to off
200 */ 210 */
201#ifndef ICACHE_REFILLS_WORKAROUND_WAR 211#ifndef ICACHE_REFILLS_WORKAROUND_WAR
@@ -234,5 +244,8 @@
234#ifndef R10000_LLSC_WAR 244#ifndef R10000_LLSC_WAR
235#define R10000_LLSC_WAR 0 245#define R10000_LLSC_WAR 0
236#endif 246#endif
247#ifndef MIPS34K_MISSED_ITLB_WAR
248#define MIPS34K_MISSED_ITLB_WAR 0
249#endif
237 250
238#endif /* _ASM_WAR_H */ 251#endif /* _ASM_WAR_H */
diff --git a/include/asm-mips/watch.h b/include/asm-mips/watch.h
deleted file mode 100644
index 6aa90cae1114..000000000000
--- a/include/asm-mips/watch.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1996, 1997, 1998, 2000, 2001 by Ralf Baechle
7 */
8#ifndef _ASM_WATCH_H
9#define _ASM_WATCH_H
10
11#include <linux/linkage.h>
12
13/*
14 * Types of reference for watch_set()
15 */
16enum wref_type {
17 wr_save = 1,
18 wr_load = 2
19};
20
21extern asmlinkage void __watch_set(unsigned long addr, enum wref_type ref);
22extern asmlinkage void __watch_clear(void);
23extern asmlinkage void __watch_reenable(void);
24
25#define watch_set(addr, ref) \
26 if (cpu_has_watch) \
27 __watch_set(addr, ref)
28#define watch_clear() \
29 if (cpu_has_watch) \
30 __watch_clear()
31#define watch_reenable() \
32 if (cpu_has_watch) \
33 __watch_reenable()
34
35#endif /* _ASM_WATCH_H */
diff --git a/include/asm-parisc/a.out.h b/include/asm-parisc/a.out.h
index 2a490cc9ec91..23e2c90943e5 100644
--- a/include/asm-parisc/a.out.h
+++ b/include/asm-parisc/a.out.h
@@ -23,6 +23,7 @@ struct exec
23 * prumpf */ 23 * prumpf */
24 24
25#define STACK_TOP TASK_SIZE 25#define STACK_TOP TASK_SIZE
26#define STACK_TOP_MAX DEFAULT_TASK_SIZE
26 27
27#endif 28#endif
28 29
diff --git a/include/asm-parisc/compat.h b/include/asm-parisc/compat.h
index 11f4222597a0..5a85d1b025c8 100644
--- a/include/asm-parisc/compat.h
+++ b/include/asm-parisc/compat.h
@@ -31,8 +31,10 @@ typedef s32 compat_timer_t;
31 31
32typedef s32 compat_int_t; 32typedef s32 compat_int_t;
33typedef s32 compat_long_t; 33typedef s32 compat_long_t;
34typedef s64 compat_s64;
34typedef u32 compat_uint_t; 35typedef u32 compat_uint_t;
35typedef u32 compat_ulong_t; 36typedef u32 compat_ulong_t;
37typedef u64 compat_u64;
36 38
37struct compat_timespec { 39struct compat_timespec {
38 compat_time_t tv_sec; 40 compat_time_t tv_sec;
diff --git a/include/asm-parisc/fb.h b/include/asm-parisc/fb.h
new file mode 100644
index 000000000000..4d503a023ab2
--- /dev/null
+++ b/include/asm-parisc/fb.h
@@ -0,0 +1,19 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7
8static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
9 unsigned long off)
10{
11 pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
12}
13
14static inline int fb_is_primary_device(struct fb_info *info)
15{
16 return 0;
17}
18
19#endif /* _ASM_FB_H_ */
diff --git a/include/asm-parisc/fcntl.h b/include/asm-parisc/fcntl.h
index 317851fa78f3..1e1c824764ee 100644
--- a/include/asm-parisc/fcntl.h
+++ b/include/asm-parisc/fcntl.h
@@ -3,21 +3,22 @@
3 3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files 4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */ 5 located on an ext2 file system */
6#define O_APPEND 00000010 6#define O_APPEND 000000010
7#define O_BLKSEEK 00000100 /* HPUX only */ 7#define O_BLKSEEK 000000100 /* HPUX only */
8#define O_CREAT 00000400 /* not fcntl */ 8#define O_CREAT 000000400 /* not fcntl */
9#define O_EXCL 00002000 /* not fcntl */ 9#define O_EXCL 000002000 /* not fcntl */
10#define O_LARGEFILE 00004000 10#define O_LARGEFILE 000004000
11#define O_SYNC 00100000 11#define O_SYNC 000100000
12#define O_NONBLOCK 00200004 /* HPUX has separate NDELAY & NONBLOCK */ 12#define O_NONBLOCK 000200004 /* HPUX has separate NDELAY & NONBLOCK */
13#define O_NOCTTY 00400000 /* not fcntl */ 13#define O_NOCTTY 000400000 /* not fcntl */
14#define O_DSYNC 01000000 /* HPUX only */ 14#define O_DSYNC 001000000 /* HPUX only */
15#define O_RSYNC 02000000 /* HPUX only */ 15#define O_RSYNC 002000000 /* HPUX only */
16#define O_NOATIME 04000000 16#define O_NOATIME 004000000
17#define O_CLOEXEC 010000000 /* set close_on_exec */
17 18
18#define O_DIRECTORY 00010000 /* must be a directory */ 19#define O_DIRECTORY 000010000 /* must be a directory */
19#define O_NOFOLLOW 00000200 /* don't follow links */ 20#define O_NOFOLLOW 000000200 /* don't follow links */
20#define O_INVISIBLE 04000000 /* invisible I/O, for DMAPI/XDSM */ 21#define O_INVISIBLE 004000000 /* invisible I/O, for DMAPI/XDSM */
21 22
22#define F_GETLK64 8 23#define F_GETLK64 8
23#define F_SETLK64 9 24#define F_SETLK64 9
diff --git a/include/asm-parisc/hardware.h b/include/asm-parisc/hardware.h
index 76d880dc4bae..4e9626836bab 100644
--- a/include/asm-parisc/hardware.h
+++ b/include/asm-parisc/hardware.h
@@ -31,10 +31,11 @@ enum cpu_type {
31 pcxw = 8, /* pa8500 pa 2.0 */ 31 pcxw = 8, /* pa8500 pa 2.0 */
32 pcxw_ = 9, /* pa8600 (w+) pa 2.0 */ 32 pcxw_ = 9, /* pa8600 (w+) pa 2.0 */
33 pcxw2 = 10, /* pa8700 pa 2.0 */ 33 pcxw2 = 10, /* pa8700 pa 2.0 */
34 mako = 11 /* pa8800 pa 2.0 */ 34 mako = 11, /* pa8800 pa 2.0 */
35 mako2 = 12 /* pa8900 pa 2.0 */
35}; 36};
36 37
37extern char *cpu_name_version[][2]; /* mapping from enum cpu_type to strings */ 38extern const char * const cpu_name_version[][2]; /* mapping from enum cpu_type to strings */
38 39
39struct parisc_driver; 40struct parisc_driver;
40 41
diff --git a/include/asm-parisc/linkage.h b/include/asm-parisc/linkage.h
index 7a09d911b538..ad8cd0d069ea 100644
--- a/include/asm-parisc/linkage.h
+++ b/include/asm-parisc/linkage.h
@@ -8,8 +8,10 @@
8 8
9/* 9/*
10 * In parisc assembly a semicolon marks a comment while a 10 * In parisc assembly a semicolon marks a comment while a
11 * exclamation mark is used to seperate independend lines. 11 * exclamation mark is used to seperate independent lines.
12 */ 12 */
13#ifdef __ASSEMBLY__
14
13#define ENTRY(name) \ 15#define ENTRY(name) \
14 .export name !\ 16 .export name !\
15 ALIGN !\ 17 ALIGN !\
@@ -24,5 +26,6 @@ name:
24 END(name) 26 END(name)
25#endif 27#endif
26 28
29#endif /* __ASSEMBLY__ */
27 30
28#endif /* __ASM_PARISC_LINKAGE_H */ 31#endif /* __ASM_PARISC_LINKAGE_H */
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h
index 7b3be9ac0dda..61fbd57a8323 100644
--- a/include/asm-parisc/pci.h
+++ b/include/asm-parisc/pci.h
@@ -238,9 +238,6 @@ extern inline void pcibios_register_hba(struct pci_hba_data *x)
238#define PCIBIOS_MIN_IO 0x10 238#define PCIBIOS_MIN_IO 0x10
239#define PCIBIOS_MIN_MEM 0x1000 /* NBPG - but pci/setup-res.c dies */ 239#define PCIBIOS_MIN_MEM 0x1000 /* NBPG - but pci/setup-res.c dies */
240 240
241/* Don't support DAC yet. */
242#define pci_dac_dma_supported(pci_dev, mask) (0)
243
244/* export the pci_ DMA API in terms of the dma_ one */ 241/* export the pci_ DMA API in terms of the dma_ one */
245#include <asm-generic/pci-dma-compat.h> 242#include <asm-generic/pci-dma-compat.h>
246 243
@@ -284,10 +281,6 @@ pcibios_select_root(struct pci_dev *pdev, struct resource *res)
284 return root; 281 return root;
285} 282}
286 283
287static inline void pcibios_add_platform_entries(struct pci_dev *dev)
288{
289}
290
291static inline void pcibios_penalize_isa_irq(int irq, int active) 284static inline void pcibios_penalize_isa_irq(int irq, int active)
292{ 285{
293 /* We don't need to penalize isa irq's */ 286 /* We don't need to penalize isa irq's */
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index beb2adb979d9..e88cacd63724 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -335,18 +335,14 @@ extern inline void pgd_clear(pgd_t * pgdp) { }
335 * The following only work if pte_present() is true. 335 * The following only work if pte_present() is true.
336 * Undefined behaviour if not.. 336 * Undefined behaviour if not..
337 */ 337 */
338extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_READ; }
339extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } 338extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
340extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 339extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
341extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } 340extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; }
342extern inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 341extern inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
343extern inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
344 342
345extern inline pte_t pte_rdprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_READ; return pte; }
346extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; } 343extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
347extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } 344extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
348extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_WRITE; return pte; } 345extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_WRITE; return pte; }
349extern inline pte_t pte_mkread(pte_t pte) { pte_val(pte) |= _PAGE_READ; return pte; }
350extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; } 346extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; }
351extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; } 347extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; }
352extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_WRITE; return pte; } 348extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_WRITE; return pte; }
@@ -451,21 +447,6 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned
451#endif 447#endif
452} 448}
453 449
454static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
455{
456#ifdef CONFIG_SMP
457 if (!pte_dirty(*ptep))
458 return 0;
459 return test_and_clear_bit(xlate_pabit(_PAGE_DIRTY_BIT), &pte_val(*ptep));
460#else
461 pte_t pte = *ptep;
462 if (!pte_dirty(pte))
463 return 0;
464 set_pte_at(vma->vm_mm, addr, ptep, pte_mkclean(pte));
465 return 1;
466#endif
467}
468
469extern spinlock_t pa_dbit_lock; 450extern spinlock_t pa_dbit_lock;
470 451
471struct mm_struct; 452struct mm_struct;
@@ -533,7 +514,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
533#define HAVE_ARCH_UNMAPPED_AREA 514#define HAVE_ARCH_UNMAPPED_AREA
534 515
535#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 516#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
536#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
537#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 517#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
538#define __HAVE_ARCH_PTEP_SET_WRPROTECT 518#define __HAVE_ARCH_PTEP_SET_WRPROTECT
539#define __HAVE_ARCH_PTE_SAME 519#define __HAVE_ARCH_PTE_SAME
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h
index d2f396721d3e..6b294fb07a23 100644
--- a/include/asm-parisc/processor.h
+++ b/include/asm-parisc/processor.h
@@ -69,8 +69,8 @@ struct system_cpuinfo_parisc {
69 char sys_model_name[81]; /* PDC-ROM returnes this model name */ 69 char sys_model_name[81]; /* PDC-ROM returnes this model name */
70 } pdc; 70 } pdc;
71 71
72 char *cpu_name; /* e.g. "PA7300LC (PCX-L2)" */ 72 const char *cpu_name; /* e.g. "PA7300LC (PCX-L2)" */
73 char *family_name; /* e.g. "1.1e" */ 73 const char *family_name; /* e.g. "1.1e" */
74}; 74};
75 75
76 76
@@ -334,8 +334,8 @@ extern unsigned long get_wchan(struct task_struct *p);
334static inline int parisc_requires_coherency(void) 334static inline int parisc_requires_coherency(void)
335{ 335{
336#ifdef CONFIG_PA8X00 336#ifdef CONFIG_PA8X00
337 /* FIXME: also pa8900 - when we see one */ 337 return (boot_cpu_data.cpu_type == mako) ||
338 return boot_cpu_data.cpu_type == mako; 338 (boot_cpu_data.cpu_type == mako2);
339#else 339#else
340 return 0; 340 return 0;
341#endif 341#endif
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h
index 7e9afa720d43..ee80c920b464 100644
--- a/include/asm-parisc/system.h
+++ b/include/asm-parisc/system.h
@@ -48,17 +48,6 @@ extern struct task_struct *_switch_to(struct task_struct *, struct task_struct *
48 (last) = _switch_to(prev, next); \ 48 (last) = _switch_to(prev, next); \
49} while(0) 49} while(0)
50 50
51/*
52 * On SMP systems, when the scheduler does migration-cost autodetection,
53 * it needs a way to flush as much of the CPU's caches as possible.
54 *
55 * TODO: fill this in!
56 */
57static inline void sched_cacheflush(void)
58{
59}
60
61
62/* interrupt control */ 51/* interrupt control */
63#define local_save_flags(x) __asm__ __volatile__("ssm 0, %0" : "=r" (x) : : "memory") 52#define local_save_flags(x) __asm__ __volatile__("ssm 0, %0" : "=r" (x) : : "memory")
64#define local_irq_disable() __asm__ __volatile__("rsm %0,%%r0\n" : : "i" (PSW_I) : "memory" ) 53#define local_irq_disable() __asm__ __volatile__("rsm %0,%%r0\n" : : "i" (PSW_I) : "memory" )
@@ -188,7 +177,6 @@ static inline void set_eiem(unsigned long val)
188# define __lock_aligned __attribute__((__section__(".data.lock_aligned"))) 177# define __lock_aligned __attribute__((__section__(".data.lock_aligned")))
189#endif 178#endif
190 179
191#define KERNEL_START (0x10100000 - 0x1000)
192#define arch_align_stack(x) (x) 180#define arch_align_stack(x) (x)
193 181
194#endif 182#endif
diff --git a/include/asm-parisc/termbits.h b/include/asm-parisc/termbits.h
index a46e299a9391..e847fe979684 100644
--- a/include/asm-parisc/termbits.h
+++ b/include/asm-parisc/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct termios2 {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20struct ktermios { 31struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */ 32 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */ 33 tcflag_t c_oflag; /* output mode flags */
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index 2f7c40861c91..f74099bdca3c 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -792,8 +792,19 @@
792#define __NR_epoll_pwait (__NR_Linux + 297) 792#define __NR_epoll_pwait (__NR_Linux + 297)
793#define __NR_statfs64 (__NR_Linux + 298) 793#define __NR_statfs64 (__NR_Linux + 298)
794#define __NR_fstatfs64 (__NR_Linux + 299) 794#define __NR_fstatfs64 (__NR_Linux + 299)
795#define __NR_kexec_load (__NR_Linux + 300)
796#define __NR_utimensat (__NR_Linux + 301)
797#define __NR_signalfd (__NR_Linux + 302)
798#define __NR_timerfd (__NR_Linux + 303)
799#define __NR_eventfd (__NR_Linux + 304)
800
801#define __NR_Linux_syscalls (__NR_eventfd + 1)
802
803
804#define __IGNORE_select /* newselect */
805#define __IGNORE_fadvise64 /* fadvise64_64 */
806#define __IGNORE_utimes /* utime */
795 807
796#define __NR_Linux_syscalls (__NR_fstatfs64 + 1)
797 808
798#define HPUX_GATEWAY_ADDR 0xC0000004 809#define HPUX_GATEWAY_ADDR 0xC0000004
799#define LINUX_GATEWAY_ADDR 0x100 810#define LINUX_GATEWAY_ADDR 0x100
diff --git a/include/asm-powerpc/a.out.h b/include/asm-powerpc/a.out.h
index c7393a977364..5c5ea83f9349 100644
--- a/include/asm-powerpc/a.out.h
+++ b/include/asm-powerpc/a.out.h
@@ -26,9 +26,12 @@ struct exec
26#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ 26#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \
27 STACK_TOP_USER32 : STACK_TOP_USER64) 27 STACK_TOP_USER32 : STACK_TOP_USER64)
28 28
29#define STACK_TOP_MAX STACK_TOP_USER64
30
29#else /* __powerpc64__ */ 31#else /* __powerpc64__ */
30 32
31#define STACK_TOP TASK_SIZE 33#define STACK_TOP TASK_SIZE
34#define STACK_TOP_MAX STACK_TOP
32 35
33#endif /* __powerpc64__ */ 36#endif /* __powerpc64__ */
34#endif /* __KERNEL__ */ 37#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/cache.h b/include/asm-powerpc/cache.h
index 642be62cf393..53507046a1b1 100644
--- a/include/asm-powerpc/cache.h
+++ b/include/asm-powerpc/cache.h
@@ -34,5 +34,9 @@ struct ppc64_caches {
34extern struct ppc64_caches ppc64_caches; 34extern struct ppc64_caches ppc64_caches;
35#endif /* __powerpc64__ && ! __ASSEMBLY__ */ 35#endif /* __powerpc64__ && ! __ASSEMBLY__ */
36 36
37#if !defined(__ASSEMBLY__)
38#define __read_mostly __attribute__((__section__(".data.read_mostly")))
39#endif
40
37#endif /* __KERNEL__ */ 41#endif /* __KERNEL__ */
38#endif /* _ASM_POWERPC_CACHE_H */ 42#endif /* _ASM_POWERPC_CACHE_H */
diff --git a/include/asm-powerpc/compat.h b/include/asm-powerpc/compat.h
index aacaabd28ac1..64ab1ddbdf85 100644
--- a/include/asm-powerpc/compat.h
+++ b/include/asm-powerpc/compat.h
@@ -33,8 +33,10 @@ typedef s32 compat_timer_t;
33 33
34typedef s32 compat_int_t; 34typedef s32 compat_int_t;
35typedef s32 compat_long_t; 35typedef s32 compat_long_t;
36typedef s64 compat_s64;
36typedef u32 compat_uint_t; 37typedef u32 compat_uint_t;
37typedef u32 compat_ulong_t; 38typedef u32 compat_ulong_t;
39typedef u64 compat_u64;
38 40
39struct compat_timespec { 41struct compat_timespec {
40 compat_time_t tv_sec; 42 compat_time_t tv_sec;
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 82d595a52109..3dc8e2dfca84 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -111,7 +111,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
111/* CPU kernel features */ 111/* CPU kernel features */
112 112
113/* Retain the 32b definitions all use bottom half of word */ 113/* Retain the 32b definitions all use bottom half of word */
114#define CPU_FTR_SPLIT_ID_CACHE ASM_CONST(0x0000000000000001) 114#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000000000000001)
115#define CPU_FTR_L2CR ASM_CONST(0x0000000000000002) 115#define CPU_FTR_L2CR ASM_CONST(0x0000000000000002)
116#define CPU_FTR_SPEC7450 ASM_CONST(0x0000000000000004) 116#define CPU_FTR_SPEC7450 ASM_CONST(0x0000000000000004)
117#define CPU_FTR_ALTIVEC ASM_CONST(0x0000000000000008) 117#define CPU_FTR_ALTIVEC ASM_CONST(0x0000000000000008)
@@ -135,6 +135,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
135#define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000) 135#define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000)
136#define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000) 136#define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000)
137#define CPU_FTR_FPU_UNAVAILABLE ASM_CONST(0x0000000000800000) 137#define CPU_FTR_FPU_UNAVAILABLE ASM_CONST(0x0000000000800000)
138#define CPU_FTR_UNIFIED_ID_CACHE ASM_CONST(0x0000000001000000)
138 139
139/* 140/*
140 * Add the 64-bit processor unique features in the top half of the word; 141 * Add the 64-bit processor unique features in the top half of the word;
@@ -154,7 +155,6 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
154#define CPU_FTR_MMCRA LONG_ASM_CONST(0x0000004000000000) 155#define CPU_FTR_MMCRA LONG_ASM_CONST(0x0000004000000000)
155#define CPU_FTR_CTRL LONG_ASM_CONST(0x0000008000000000) 156#define CPU_FTR_CTRL LONG_ASM_CONST(0x0000008000000000)
156#define CPU_FTR_SMT LONG_ASM_CONST(0x0000010000000000) 157#define CPU_FTR_SMT LONG_ASM_CONST(0x0000010000000000)
157#define CPU_FTR_COHERENT_ICACHE LONG_ASM_CONST(0x0000020000000000)
158#define CPU_FTR_LOCKLESS_TLBIE LONG_ASM_CONST(0x0000040000000000) 158#define CPU_FTR_LOCKLESS_TLBIE LONG_ASM_CONST(0x0000040000000000)
159#define CPU_FTR_CI_LARGE_PAGE LONG_ASM_CONST(0x0000100000000000) 159#define CPU_FTR_CI_LARGE_PAGE LONG_ASM_CONST(0x0000100000000000)
160#define CPU_FTR_PAUSE_ZERO LONG_ASM_CONST(0x0000200000000000) 160#define CPU_FTR_PAUSE_ZERO LONG_ASM_CONST(0x0000200000000000)
@@ -206,164 +206,149 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
206 !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \ 206 !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \
207 !defined(CONFIG_BOOKE)) 207 !defined(CONFIG_BOOKE))
208 208
209#define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE) 209#define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE | \
210#define CPU_FTRS_603 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 210 CPU_FTR_COHERENT_ICACHE | CPU_FTR_UNIFIED_ID_CACHE)
211#define CPU_FTRS_603 (CPU_FTR_COMMON | \
211 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ 212 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
212 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) 213 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
213#define CPU_FTRS_604 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 214#define CPU_FTRS_604 (CPU_FTR_COMMON | \
214 CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE | \ 215 CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE | \
215 CPU_FTR_PPC_LE) 216 CPU_FTR_PPC_LE)
216#define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 217#define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | \
217 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 218 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
218 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) 219 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
219#define CPU_FTRS_740 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 220#define CPU_FTRS_740 (CPU_FTR_COMMON | \
220 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 221 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
221 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ 222 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
222 CPU_FTR_PPC_LE) 223 CPU_FTR_PPC_LE)
223#define CPU_FTRS_750 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 224#define CPU_FTRS_750 (CPU_FTR_COMMON | \
224 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 225 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
225 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ 226 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
226 CPU_FTR_PPC_LE) 227 CPU_FTR_PPC_LE)
227#define CPU_FTRS_750CL (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 228#define CPU_FTRS_750CL (CPU_FTRS_750 | CPU_FTR_HAS_HIGH_BATS)
228 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 229#define CPU_FTRS_750FX1 (CPU_FTRS_750 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM)
229 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ 230#define CPU_FTRS_750FX2 (CPU_FTRS_750 | CPU_FTR_NO_DPM)
230 CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE) 231#define CPU_FTRS_750FX (CPU_FTRS_750 | CPU_FTR_DUAL_PLL_750FX | \
231#define CPU_FTRS_750FX1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 232 CPU_FTR_HAS_HIGH_BATS)
232 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 233#define CPU_FTRS_750GX (CPU_FTRS_750FX)
233 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ 234#define CPU_FTRS_7400_NOTAU (CPU_FTR_COMMON | \
234 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM | CPU_FTR_PPC_LE)
235#define CPU_FTRS_750FX2 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
236 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
237 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
238 CPU_FTR_NO_DPM | CPU_FTR_PPC_LE)
239#define CPU_FTRS_750FX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
240 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
241 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
242 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE)
243#define CPU_FTRS_750GX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
244 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
245 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
246 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE)
247#define CPU_FTRS_7400_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
248 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 235 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
249 CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ 236 CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \
250 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) 237 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
251#define CPU_FTRS_7400 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 238#define CPU_FTRS_7400 (CPU_FTR_COMMON | \
252 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 239 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
253 CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ 240 CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \
254 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) 241 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
255#define CPU_FTRS_7450_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 242#define CPU_FTRS_7450_20 (CPU_FTR_COMMON | \
256 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 243 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
257 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 244 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
258 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) 245 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
259#define CPU_FTRS_7450_21 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 246#define CPU_FTRS_7450_21 (CPU_FTR_COMMON | \
260 CPU_FTR_USE_TB | \ 247 CPU_FTR_USE_TB | \
261 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 248 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
262 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 249 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
263 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ 250 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
264 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) 251 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
265#define CPU_FTRS_7450_23 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 252#define CPU_FTRS_7450_23 (CPU_FTR_COMMON | \
266 CPU_FTR_USE_TB | \ 253 CPU_FTR_USE_TB | \
267 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 254 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
268 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 255 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
269 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) 256 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
270#define CPU_FTRS_7455_1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 257#define CPU_FTRS_7455_1 (CPU_FTR_COMMON | \
271 CPU_FTR_USE_TB | \ 258 CPU_FTR_USE_TB | \
272 CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \ 259 CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \
273 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | \ 260 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | \
274 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) 261 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
275#define CPU_FTRS_7455_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 262#define CPU_FTRS_7455_20 (CPU_FTR_COMMON | \
276 CPU_FTR_USE_TB | \ 263 CPU_FTR_USE_TB | \
277 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 264 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
278 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 265 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
279 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ 266 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
280 CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE) 267 CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE)
281#define CPU_FTRS_7455 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 268#define CPU_FTRS_7455 (CPU_FTR_COMMON | \
282 CPU_FTR_USE_TB | \ 269 CPU_FTR_USE_TB | \
283 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 270 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
284 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 271 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
285 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ 272 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
286 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) 273 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
287#define CPU_FTRS_7447_10 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 274#define CPU_FTRS_7447_10 (CPU_FTR_COMMON | \
288 CPU_FTR_USE_TB | \ 275 CPU_FTR_USE_TB | \
289 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 276 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
290 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 277 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
291 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ 278 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
292 CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC | CPU_FTR_PPC_LE) 279 CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC | CPU_FTR_PPC_LE)
293#define CPU_FTRS_7447 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 280#define CPU_FTRS_7447 (CPU_FTR_COMMON | \
294 CPU_FTR_USE_TB | \ 281 CPU_FTR_USE_TB | \
295 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 282 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
296 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 283 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
297 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ 284 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
298 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) 285 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
299#define CPU_FTRS_7447A (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 286#define CPU_FTRS_7447A (CPU_FTR_COMMON | \
300 CPU_FTR_USE_TB | \ 287 CPU_FTR_USE_TB | \
301 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 288 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
302 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 289 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
303 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ 290 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
304 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) 291 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
305#define CPU_FTRS_7448 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 292#define CPU_FTRS_7448 (CPU_FTR_COMMON | \
306 CPU_FTR_USE_TB | \ 293 CPU_FTR_USE_TB | \
307 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 294 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
308 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 295 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
309 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ 296 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
310 CPU_FTR_PPC_LE) 297 CPU_FTR_PPC_LE)
311#define CPU_FTRS_82XX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 298#define CPU_FTRS_82XX (CPU_FTR_COMMON | \
312 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB) 299 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB)
313#define CPU_FTRS_G2_LE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ 300#define CPU_FTRS_G2_LE (CPU_FTR_MAYBE_CAN_DOZE | \
314 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS) 301 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS)
315#define CPU_FTRS_E300 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ 302#define CPU_FTRS_E300 (CPU_FTR_MAYBE_CAN_DOZE | \
316 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \ 303 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \
317 CPU_FTR_COMMON) 304 CPU_FTR_COMMON)
318#define CPU_FTRS_E300C2 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ 305#define CPU_FTRS_E300C2 (CPU_FTR_MAYBE_CAN_DOZE | \
319 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \ 306 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \
320 CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE) 307 CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE)
321#define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 308#define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | \
322 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE) 309 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE)
323#define CPU_FTRS_8XX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB) 310#define CPU_FTRS_8XX (CPU_FTR_USE_TB)
324#define CPU_FTRS_40X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 311#define CPU_FTRS_40X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN)
325 CPU_FTR_NODSISRALIGN) 312#define CPU_FTRS_44X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN)
326#define CPU_FTRS_44X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 313#define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \
327 CPU_FTR_NODSISRALIGN) 314 CPU_FTR_COHERENT_ICACHE | CPU_FTR_UNIFIED_ID_CACHE)
328#define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN) 315#define CPU_FTRS_E500 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN)
329#define CPU_FTRS_E500 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 316#define CPU_FTRS_E500_2 (CPU_FTR_USE_TB | \
330 CPU_FTR_NODSISRALIGN)
331#define CPU_FTRS_E500_2 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
332 CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN) 317 CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN)
333#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) 318#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
334 319
335/* 64-bit CPUs */ 320/* 64-bit CPUs */
336#define CPU_FTRS_POWER3 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 321#define CPU_FTRS_POWER3 (CPU_FTR_USE_TB | \
337 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_PPC_LE) 322 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_PPC_LE)
338#define CPU_FTRS_RS64 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 323#define CPU_FTRS_RS64 (CPU_FTR_USE_TB | \
339 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \ 324 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \
340 CPU_FTR_MMCRA | CPU_FTR_CTRL) 325 CPU_FTR_MMCRA | CPU_FTR_CTRL)
341#define CPU_FTRS_POWER4 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 326#define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | \
342 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 327 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
343 CPU_FTR_MMCRA) 328 CPU_FTR_MMCRA)
344#define CPU_FTRS_PPC970 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 329#define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | \
345 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 330 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
346 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA) 331 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA)
347#define CPU_FTRS_POWER5 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 332#define CPU_FTRS_POWER5 (CPU_FTR_USE_TB | \
348 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 333 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
349 CPU_FTR_MMCRA | CPU_FTR_SMT | \ 334 CPU_FTR_MMCRA | CPU_FTR_SMT | \
350 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 335 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
351 CPU_FTR_PURR) 336 CPU_FTR_PURR)
352#define CPU_FTRS_POWER6 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 337#define CPU_FTRS_POWER6 (CPU_FTR_USE_TB | \
353 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 338 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
354 CPU_FTR_MMCRA | CPU_FTR_SMT | \ 339 CPU_FTR_MMCRA | CPU_FTR_SMT | \
355 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 340 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
356 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ 341 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
357 CPU_FTR_DSCR) 342 CPU_FTR_DSCR)
358#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 343#define CPU_FTRS_CELL (CPU_FTR_USE_TB | \
359 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 344 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
360 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ 345 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
361 CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_CELL_TB_BUG) 346 CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_CELL_TB_BUG)
362#define CPU_FTRS_PA6T (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 347#define CPU_FTRS_PA6T (CPU_FTR_USE_TB | \
363 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ 348 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
364 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \ 349 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \
365 CPU_FTR_PURR | CPU_FTR_REAL_LE) 350 CPU_FTR_PURR | CPU_FTR_REAL_LE)
366#define CPU_FTRS_COMPATIBLE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 351#define CPU_FTRS_COMPATIBLE (CPU_FTR_USE_TB | \
367 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2) 352 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2)
368 353
369#ifdef __powerpc64__ 354#ifdef __powerpc64__
diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h
index a19a6f1a1cf1..f6bd804d9090 100644
--- a/include/asm-powerpc/dma-mapping.h
+++ b/include/asm-powerpc/dma-mapping.h
@@ -61,7 +61,6 @@ struct dma_mapping_ops {
61 void (*unmap_sg)(struct device *dev, struct scatterlist *sg, 61 void (*unmap_sg)(struct device *dev, struct scatterlist *sg,
62 int nents, enum dma_data_direction direction); 62 int nents, enum dma_data_direction direction);
63 int (*dma_supported)(struct device *dev, u64 mask); 63 int (*dma_supported)(struct device *dev, u64 mask);
64 int (*dac_dma_supported)(struct device *dev, u64 mask);
65 int (*set_dma_mask)(struct device *dev, u64 dma_mask); 64 int (*set_dma_mask)(struct device *dev, u64 dma_mask);
66}; 65};
67 66
diff --git a/include/asm-powerpc/fb.h b/include/asm-powerpc/fb.h
new file mode 100644
index 000000000000..411af8d17a69
--- /dev/null
+++ b/include/asm-powerpc/fb.h
@@ -0,0 +1,21 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7
8static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
9 unsigned long off)
10{
11 vma->vm_page_prot = phys_mem_access_prot(file, off >> PAGE_SHIFT,
12 vma->vm_end - vma->vm_start,
13 vma->vm_page_prot);
14}
15
16static inline int fb_is_primary_device(struct fb_info *info)
17{
18 return 0;
19}
20
21#endif /* _ASM_FB_H_ */
diff --git a/include/asm-powerpc/floppy.h b/include/asm-powerpc/floppy.h
index afa700ded877..34146f0eea63 100644
--- a/include/asm-powerpc/floppy.h
+++ b/include/asm-powerpc/floppy.h
@@ -29,7 +29,7 @@
29#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); 29#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL);
30 30
31#include <linux/pci.h> 31#include <linux/pci.h>
32#include <asm/ppc-pci.h> /* for ppc64_isabridge_dev */ 32#include <asm/ppc-pci.h> /* for isa_bridge_pcidev */
33 33
34#define fd_dma_setup(addr,size,mode,io) fd_ops->_dma_setup(addr,size,mode,io) 34#define fd_dma_setup(addr,size,mode,io) fd_ops->_dma_setup(addr,size,mode,io)
35 35
@@ -139,12 +139,12 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
139 if (bus_addr 139 if (bus_addr
140 && (addr != prev_addr || size != prev_size || dir != prev_dir)) { 140 && (addr != prev_addr || size != prev_size || dir != prev_dir)) {
141 /* different from last time -- unmap prev */ 141 /* different from last time -- unmap prev */
142 pci_unmap_single(ppc64_isabridge_dev, bus_addr, prev_size, prev_dir); 142 pci_unmap_single(isa_bridge_pcidev, bus_addr, prev_size, prev_dir);
143 bus_addr = 0; 143 bus_addr = 0;
144 } 144 }
145 145
146 if (!bus_addr) /* need to map it */ 146 if (!bus_addr) /* need to map it */
147 bus_addr = pci_map_single(ppc64_isabridge_dev, addr, size, dir); 147 bus_addr = pci_map_single(isa_bridge_pcidev, addr, size, dir);
148 148
149 /* remember this one as prev */ 149 /* remember this one as prev */
150 prev_addr = addr; 150 prev_addr = addr;
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h
index 62efd9d7a43d..bf6cd7cb996c 100644
--- a/include/asm-powerpc/hvcall.h
+++ b/include/asm-powerpc/hvcall.h
@@ -206,6 +206,7 @@
206#define H_FREE_LOGICAL_LAN_BUFFER 0x1D4 206#define H_FREE_LOGICAL_LAN_BUFFER 0x1D4
207#define H_QUERY_INT_STATE 0x1E4 207#define H_QUERY_INT_STATE 0x1E4
208#define H_POLL_PENDING 0x1D8 208#define H_POLL_PENDING 0x1D8
209#define H_ILLAN_ATTRIBUTES 0x244
209#define H_JOIN 0x298 210#define H_JOIN 0x298
210#define H_VASI_STATE 0x2A4 211#define H_VASI_STATE 0x2A4
211#define H_ENABLE_CRQ 0x2B0 212#define H_ENABLE_CRQ 0x2B0
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 350c9bdb31dc..bb8d965f96c6 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -607,9 +607,9 @@ static inline void iosync(void)
607 * 607 *
608 * * iounmap undoes such a mapping and can be hooked 608 * * iounmap undoes such a mapping and can be hooked
609 * 609 *
610 * * __ioremap_explicit (and the pending __iounmap_explicit) are low level 610 * * __ioremap_at (and the pending __iounmap_at) are low level functions to
611 * functions to create hand-made mappings for use only by the PCI code 611 * create hand-made mappings for use only by the PCI code and cannot
612 * and cannot currently be hooked. 612 * currently be hooked. Must be page aligned.
613 * 613 *
614 * * __ioremap is the low level implementation used by ioremap and 614 * * __ioremap is the low level implementation used by ioremap and
615 * ioremap_flags and cannot be hooked (but can be used by a hook on one 615 * ioremap_flags and cannot be hooked (but can be used by a hook on one
@@ -629,19 +629,9 @@ extern void __iomem *__ioremap(phys_addr_t, unsigned long size,
629 unsigned long flags); 629 unsigned long flags);
630extern void __iounmap(volatile void __iomem *addr); 630extern void __iounmap(volatile void __iomem *addr);
631 631
632extern int __ioremap_explicit(phys_addr_t p_addr, unsigned long v_addr, 632extern void __iomem * __ioremap_at(phys_addr_t pa, void *ea,
633 unsigned long size, unsigned long flags); 633 unsigned long size, unsigned long flags);
634extern int __iounmap_explicit(volatile void __iomem *start, 634extern void __iounmap_at(void *ea, unsigned long size);
635 unsigned long size);
636
637extern void __iomem * reserve_phb_iospace(unsigned long size);
638
639/* Those are more 32 bits only functions */
640extern unsigned long iopa(unsigned long addr);
641extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
642extern void io_block_mapping(unsigned long virt, phys_addr_t phys,
643 unsigned int size, int flags);
644
645 635
646/* 636/*
647 * When CONFIG_PPC_INDIRECT_IO is set, we use the generic iomap implementation 637 * When CONFIG_PPC_INDIRECT_IO is set, we use the generic iomap implementation
@@ -651,8 +641,8 @@ extern void io_block_mapping(unsigned long virt, phys_addr_t phys,
651 */ 641 */
652#define HAVE_ARCH_PIO_SIZE 1 642#define HAVE_ARCH_PIO_SIZE 1
653#define PIO_OFFSET 0x00000000UL 643#define PIO_OFFSET 0x00000000UL
654#define PIO_MASK 0x3fffffffUL 644#define PIO_MASK (FULL_IO_SIZE - 1)
655#define PIO_RESERVED 0x40000000UL 645#define PIO_RESERVED (FULL_IO_SIZE)
656 646
657#define mmio_read16be(addr) readw_be(addr) 647#define mmio_read16be(addr) readw_be(addr)
658#define mmio_read32be(addr) readl_be(addr) 648#define mmio_read32be(addr) readl_be(addr)
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index 4734cc178db5..0485c53db2b5 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -138,10 +138,7 @@ struct irq_map_entry {
138 138
139extern struct irq_map_entry irq_map[NR_IRQS]; 139extern struct irq_map_entry irq_map[NR_IRQS];
140 140
141static inline irq_hw_number_t virq_to_hw(unsigned int virq) 141extern irq_hw_number_t virq_to_hw(unsigned int virq);
142{
143 return irq_map[virq].hwirq;
144}
145 142
146/** 143/**
147 * irq_alloc_host - Allocate a new irq_host data structure 144 * irq_alloc_host - Allocate a new irq_host data structure
@@ -226,6 +223,15 @@ extern void irq_dispose_mapping(unsigned int virq);
226extern unsigned int irq_find_mapping(struct irq_host *host, 223extern unsigned int irq_find_mapping(struct irq_host *host,
227 irq_hw_number_t hwirq); 224 irq_hw_number_t hwirq);
228 225
226/**
227 * irq_create_direct_mapping - Allocate a virq for direct mapping
228 * @host: host to allocate the virq for or NULL for default host
229 *
230 * This routine is used for irq controllers which can choose the hardware
231 * interrupt numbers they generate. In such a case it's simplest to use
232 * the linux virq as the hardware interrupt number.
233 */
234extern unsigned int irq_create_direct_mapping(struct irq_host *host);
229 235
230/** 236/**
231 * irq_radix_revmap - Find a linux virq from a hw irq number. 237 * irq_radix_revmap - Find a linux virq from a hw irq number.
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index b0e40ff32ee0..8b08b447d6f3 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -65,20 +65,18 @@ typedef unsigned int kprobe_opcode_t;
65 } else if (name[0] != '.') \ 65 } else if (name[0] != '.') \
66 addr = *(kprobe_opcode_t **)addr; \ 66 addr = *(kprobe_opcode_t **)addr; \
67 } else { \ 67 } else { \
68 char dot_name[KSYM_NAME_LEN+1]; \ 68 char dot_name[KSYM_NAME_LEN]; \
69 dot_name[0] = '.'; \ 69 dot_name[0] = '.'; \
70 dot_name[1] = '\0'; \ 70 dot_name[1] = '\0'; \
71 strncat(dot_name, name, KSYM_NAME_LEN); \ 71 strncat(dot_name, name, KSYM_NAME_LEN - 2); \
72 addr = (kprobe_opcode_t *)kallsyms_lookup_name(dot_name); \ 72 addr = (kprobe_opcode_t *)kallsyms_lookup_name(dot_name); \
73 } \ 73 } \
74} 74}
75 75
76#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry)
77#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ 76#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \
78 IS_TWI(instr) || IS_TDI(instr)) 77 IS_TWI(instr) || IS_TDI(instr))
79#else 78#else
80/* Use stock kprobe_lookup_name since ppc32 doesn't use function descriptors */ 79/* Use stock kprobe_lookup_name since ppc32 doesn't use function descriptors */
81#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)(pentry)
82#define is_trap(instr) (IS_TW(instr) || IS_TWI(instr)) 80#define is_trap(instr) (IS_TW(instr) || IS_TWI(instr))
83#endif 81#endif
84 82
diff --git a/include/asm-powerpc/lppaca.h b/include/asm-powerpc/lppaca.h
index 821ea0c512b4..567ed92cd91f 100644
--- a/include/asm-powerpc/lppaca.h
+++ b/include/asm-powerpc/lppaca.h
@@ -98,7 +98,7 @@ struct lppaca {
98 u64 saved_gpr5; // Saved GPR5 x30-x37 98 u64 saved_gpr5; // Saved GPR5 x30-x37
99 99
100 u8 reserved4; // Reserved x38-x38 100 u8 reserved4; // Reserved x38-x38
101 u8 cpuctls_task_attrs; // Task attributes for cpuctls x39-x39 101 u8 donate_dedicated_cpu; // Donate dedicated CPU cycles x39-x39
102 u8 fpregs_in_use; // FP regs in use x3A-x3A 102 u8 fpregs_in_use; // FP regs in use x3A-x3A
103 u8 pmcregs_in_use; // PMC regs in use x3B-x3B 103 u8 pmcregs_in_use; // PMC regs in use x3B-x3B
104 volatile u32 saved_decr; // Saved Decr Value x3C-x3F 104 volatile u32 saved_decr; // Saved Decr Value x3C-x3F
diff --git a/include/asm-powerpc/lv1call.h b/include/asm-powerpc/lv1call.h
index f733beeea63a..81713acf7529 100644
--- a/include/asm-powerpc/lv1call.h
+++ b/include/asm-powerpc/lv1call.h
@@ -238,6 +238,7 @@ LV1_CALL(destruct_virtual_address_space, 1, 0, 10 )
238LV1_CALL(configure_irq_state_bitmap, 3, 0, 11 ) 238LV1_CALL(configure_irq_state_bitmap, 3, 0, 11 )
239LV1_CALL(connect_irq_plug_ext, 5, 0, 12 ) 239LV1_CALL(connect_irq_plug_ext, 5, 0, 12 )
240LV1_CALL(release_memory, 1, 0, 13 ) 240LV1_CALL(release_memory, 1, 0, 13 )
241LV1_CALL(put_iopte, 5, 0, 15 )
241LV1_CALL(disconnect_irq_plug_ext, 3, 0, 17 ) 242LV1_CALL(disconnect_irq_plug_ext, 3, 0, 17 )
242LV1_CALL(construct_event_receive_port, 0, 1, 18 ) 243LV1_CALL(construct_event_receive_port, 0, 1, 18 )
243LV1_CALL(destruct_event_receive_port, 1, 0, 19 ) 244LV1_CALL(destruct_event_receive_port, 1, 0, 19 )
@@ -268,6 +269,8 @@ LV1_CALL(remove_repository_node, 4, 0, 93 )
268LV1_CALL(read_htab_entries, 2, 5, 95 ) 269LV1_CALL(read_htab_entries, 2, 5, 95 )
269LV1_CALL(set_dabr, 2, 0, 96 ) 270LV1_CALL(set_dabr, 2, 0, 96 )
270LV1_CALL(get_total_execution_time, 2, 1, 103 ) 271LV1_CALL(get_total_execution_time, 2, 1, 103 )
272LV1_CALL(allocate_io_segment, 3, 1, 116 )
273LV1_CALL(release_io_segment, 2, 0, 117 )
271LV1_CALL(construct_io_irq_outlet, 1, 1, 120 ) 274LV1_CALL(construct_io_irq_outlet, 1, 1, 120 )
272LV1_CALL(destruct_io_irq_outlet, 1, 0, 121 ) 275LV1_CALL(destruct_io_irq_outlet, 1, 0, 121 )
273LV1_CALL(map_htab, 1, 1, 122 ) 276LV1_CALL(map_htab, 1, 1, 122 )
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 6cf1a831f550..71c6e7eb2a26 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -218,7 +218,7 @@ struct machdep_calls {
218 int (*pcibios_enable_device_hook)(struct pci_dev *, int initial); 218 int (*pcibios_enable_device_hook)(struct pci_dev *, int initial);
219 219
220 /* Called in indirect_* to avoid touching devices */ 220 /* Called in indirect_* to avoid touching devices */
221 int (*pci_exclude_device)(unsigned char, unsigned char); 221 int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char);
222 222
223 /* Called at then very end of pcibios_init() */ 223 /* Called at then very end of pcibios_init() */
224 void (*pcibios_after_init)(void); 224 void (*pcibios_after_init)(void);
diff --git a/include/asm-powerpc/mmu-8xx.h b/include/asm-powerpc/mmu-8xx.h
new file mode 100644
index 000000000000..952bd8899f2f
--- /dev/null
+++ b/include/asm-powerpc/mmu-8xx.h
@@ -0,0 +1,147 @@
1#ifndef _ASM_POWERPC_MMU_8XX_H_
2#define _ASM_POWERPC_MMU_8XX_H_
3/*
4 * PPC8xx support
5 */
6
7/* Control/status registers for the MPC8xx.
8 * A write operation to these registers causes serialized access.
9 * During software tablewalk, the registers used perform mask/shift-add
10 * operations when written/read. A TLB entry is created when the Mx_RPN
11 * is written, and the contents of several registers are used to
12 * create the entry.
13 */
14#define SPRN_MI_CTR 784 /* Instruction TLB control register */
15#define MI_GPM 0x80000000 /* Set domain manager mode */
16#define MI_PPM 0x40000000 /* Set subpage protection */
17#define MI_CIDEF 0x20000000 /* Set cache inhibit when MMU dis */
18#define MI_RSV4I 0x08000000 /* Reserve 4 TLB entries */
19#define MI_PPCS 0x02000000 /* Use MI_RPN prob/priv state */
20#define MI_IDXMASK 0x00001f00 /* TLB index to be loaded */
21#define MI_RESETVAL 0x00000000 /* Value of register at reset */
22
23/* These are the Ks and Kp from the PowerPC books. For proper operation,
24 * Ks = 0, Kp = 1.
25 */
26#define SPRN_MI_AP 786
27#define MI_Ks 0x80000000 /* Should not be set */
28#define MI_Kp 0x40000000 /* Should always be set */
29
30/* The effective page number register. When read, contains the information
31 * about the last instruction TLB miss. When MI_RPN is written, bits in
32 * this register are used to create the TLB entry.
33 */
34#define SPRN_MI_EPN 787
35#define MI_EPNMASK 0xfffff000 /* Effective page number for entry */
36#define MI_EVALID 0x00000200 /* Entry is valid */
37#define MI_ASIDMASK 0x0000000f /* ASID match value */
38 /* Reset value is undefined */
39
40/* A "level 1" or "segment" or whatever you want to call it register.
41 * For the instruction TLB, it contains bits that get loaded into the
42 * TLB entry when the MI_RPN is written.
43 */
44#define SPRN_MI_TWC 789
45#define MI_APG 0x000001e0 /* Access protection group (0) */
46#define MI_GUARDED 0x00000010 /* Guarded storage */
47#define MI_PSMASK 0x0000000c /* Mask of page size bits */
48#define MI_PS8MEG 0x0000000c /* 8M page size */
49#define MI_PS512K 0x00000004 /* 512K page size */
50#define MI_PS4K_16K 0x00000000 /* 4K or 16K page size */
51#define MI_SVALID 0x00000001 /* Segment entry is valid */
52 /* Reset value is undefined */
53
54/* Real page number. Defined by the pte. Writing this register
55 * causes a TLB entry to be created for the instruction TLB, using
56 * additional information from the MI_EPN, and MI_TWC registers.
57 */
58#define SPRN_MI_RPN 790
59
60/* Define an RPN value for mapping kernel memory to large virtual
61 * pages for boot initialization. This has real page number of 0,
62 * large page size, shared page, cache enabled, and valid.
63 * Also mark all subpages valid and write access.
64 */
65#define MI_BOOTINIT 0x000001fd
66
67#define SPRN_MD_CTR 792 /* Data TLB control register */
68#define MD_GPM 0x80000000 /* Set domain manager mode */
69#define MD_PPM 0x40000000 /* Set subpage protection */
70#define MD_CIDEF 0x20000000 /* Set cache inhibit when MMU dis */
71#define MD_WTDEF 0x10000000 /* Set writethrough when MMU dis */
72#define MD_RSV4I 0x08000000 /* Reserve 4 TLB entries */
73#define MD_TWAM 0x04000000 /* Use 4K page hardware assist */
74#define MD_PPCS 0x02000000 /* Use MI_RPN prob/priv state */
75#define MD_IDXMASK 0x00001f00 /* TLB index to be loaded */
76#define MD_RESETVAL 0x04000000 /* Value of register at reset */
77
78#define SPRN_M_CASID 793 /* Address space ID (context) to match */
79#define MC_ASIDMASK 0x0000000f /* Bits used for ASID value */
80
81
82/* These are the Ks and Kp from the PowerPC books. For proper operation,
83 * Ks = 0, Kp = 1.
84 */
85#define SPRN_MD_AP 794
86#define MD_Ks 0x80000000 /* Should not be set */
87#define MD_Kp 0x40000000 /* Should always be set */
88
89/* The effective page number register. When read, contains the information
90 * about the last instruction TLB miss. When MD_RPN is written, bits in
91 * this register are used to create the TLB entry.
92 */
93#define SPRN_MD_EPN 795
94#define MD_EPNMASK 0xfffff000 /* Effective page number for entry */
95#define MD_EVALID 0x00000200 /* Entry is valid */
96#define MD_ASIDMASK 0x0000000f /* ASID match value */
97 /* Reset value is undefined */
98
99/* The pointer to the base address of the first level page table.
100 * During a software tablewalk, reading this register provides the address
101 * of the entry associated with MD_EPN.
102 */
103#define SPRN_M_TWB 796
104#define M_L1TB 0xfffff000 /* Level 1 table base address */
105#define M_L1INDX 0x00000ffc /* Level 1 index, when read */
106 /* Reset value is undefined */
107
108/* A "level 1" or "segment" or whatever you want to call it register.
109 * For the data TLB, it contains bits that get loaded into the TLB entry
110 * when the MD_RPN is written. It is also provides the hardware assist
111 * for finding the PTE address during software tablewalk.
112 */
113#define SPRN_MD_TWC 797
114#define MD_L2TB 0xfffff000 /* Level 2 table base address */
115#define MD_L2INDX 0xfffffe00 /* Level 2 index (*pte), when read */
116#define MD_APG 0x000001e0 /* Access protection group (0) */
117#define MD_GUARDED 0x00000010 /* Guarded storage */
118#define MD_PSMASK 0x0000000c /* Mask of page size bits */
119#define MD_PS8MEG 0x0000000c /* 8M page size */
120#define MD_PS512K 0x00000004 /* 512K page size */
121#define MD_PS4K_16K 0x00000000 /* 4K or 16K page size */
122#define MD_WT 0x00000002 /* Use writethrough page attribute */
123#define MD_SVALID 0x00000001 /* Segment entry is valid */
124 /* Reset value is undefined */
125
126
127/* Real page number. Defined by the pte. Writing this register
128 * causes a TLB entry to be created for the data TLB, using
129 * additional information from the MD_EPN, and MD_TWC registers.
130 */
131#define SPRN_MD_RPN 798
132
133/* This is a temporary storage register that could be used to save
134 * a processor working register during a tablewalk.
135 */
136#define SPRN_M_TW 799
137
138#ifndef __ASSEMBLY__
139typedef unsigned long phys_addr_t;
140
141typedef struct {
142 unsigned long id;
143 unsigned long vdso_base;
144} mm_context_t;
145#endif /* !__ASSEMBLY__ */
146
147#endif /* _ASM_POWERPC_MMU_8XX_H_ */
diff --git a/include/asm-powerpc/mmu-fsl-booke.h b/include/asm-powerpc/mmu-fsl-booke.h
new file mode 100644
index 000000000000..37580004cd7a
--- /dev/null
+++ b/include/asm-powerpc/mmu-fsl-booke.h
@@ -0,0 +1,88 @@
1#ifndef _ASM_POWERPC_MMU_FSL_BOOKE_H_
2#define _ASM_POWERPC_MMU_FSL_BOOKE_H_
3/*
4 * Freescale Book-E MMU support
5 */
6
7/* Book-E defined page sizes */
8#define BOOKE_PAGESZ_1K 0
9#define BOOKE_PAGESZ_4K 1
10#define BOOKE_PAGESZ_16K 2
11#define BOOKE_PAGESZ_64K 3
12#define BOOKE_PAGESZ_256K 4
13#define BOOKE_PAGESZ_1M 5
14#define BOOKE_PAGESZ_4M 6
15#define BOOKE_PAGESZ_16M 7
16#define BOOKE_PAGESZ_64M 8
17#define BOOKE_PAGESZ_256M 9
18#define BOOKE_PAGESZ_1GB 10
19#define BOOKE_PAGESZ_4GB 11
20#define BOOKE_PAGESZ_16GB 12
21#define BOOKE_PAGESZ_64GB 13
22#define BOOKE_PAGESZ_256GB 14
23#define BOOKE_PAGESZ_1TB 15
24
25#define MAS0_TLBSEL(x) ((x << 28) & 0x30000000)
26#define MAS0_ESEL(x) ((x << 16) & 0x0FFF0000)
27#define MAS0_NV(x) ((x) & 0x00000FFF)
28
29#define MAS1_VALID 0x80000000
30#define MAS1_IPROT 0x40000000
31#define MAS1_TID(x) ((x << 16) & 0x3FFF0000)
32#define MAS1_TS 0x00001000
33#define MAS1_TSIZE(x) ((x << 8) & 0x00000F00)
34
35#define MAS2_EPN 0xFFFFF000
36#define MAS2_X0 0x00000040
37#define MAS2_X1 0x00000020
38#define MAS2_W 0x00000010
39#define MAS2_I 0x00000008
40#define MAS2_M 0x00000004
41#define MAS2_G 0x00000002
42#define MAS2_E 0x00000001
43
44#define MAS3_RPN 0xFFFFF000
45#define MAS3_U0 0x00000200
46#define MAS3_U1 0x00000100
47#define MAS3_U2 0x00000080
48#define MAS3_U3 0x00000040
49#define MAS3_UX 0x00000020
50#define MAS3_SX 0x00000010
51#define MAS3_UW 0x00000008
52#define MAS3_SW 0x00000004
53#define MAS3_UR 0x00000002
54#define MAS3_SR 0x00000001
55
56#define MAS4_TLBSELD(x) MAS0_TLBSEL(x)
57#define MAS4_TIDDSEL 0x000F0000
58#define MAS4_TSIZED(x) MAS1_TSIZE(x)
59#define MAS4_X0D 0x00000040
60#define MAS4_X1D 0x00000020
61#define MAS4_WD 0x00000010
62#define MAS4_ID 0x00000008
63#define MAS4_MD 0x00000004
64#define MAS4_GD 0x00000002
65#define MAS4_ED 0x00000001
66
67#define MAS6_SPID0 0x3FFF0000
68#define MAS6_SPID1 0x00007FFE
69#define MAS6_SAS 0x00000001
70#define MAS6_SPID MAS6_SPID0
71
72#define MAS7_RPN 0xFFFFFFFF
73
74#ifndef __ASSEMBLY__
75
76#ifndef CONFIG_PHYS_64BIT
77typedef unsigned long phys_addr_t;
78#else
79typedef unsigned long long phys_addr_t;
80#endif
81
82typedef struct {
83 unsigned long id;
84 unsigned long vdso_base;
85} mm_context_t;
86#endif /* !__ASSEMBLY__ */
87
88#endif /* _ASM_POWERPC_MMU_FSL_BOOKE_H_ */
diff --git a/include/asm-powerpc/mmu-hash32.h b/include/asm-powerpc/mmu-hash32.h
new file mode 100644
index 000000000000..4bd735be3833
--- /dev/null
+++ b/include/asm-powerpc/mmu-hash32.h
@@ -0,0 +1,91 @@
1#ifndef _ASM_POWERPC_MMU_HASH32_H_
2#define _ASM_POWERPC_MMU_HASH32_H_
3/*
4 * 32-bit hash table MMU support
5 */
6
7/*
8 * BATs
9 */
10
11/* Block size masks */
12#define BL_128K 0x000
13#define BL_256K 0x001
14#define BL_512K 0x003
15#define BL_1M 0x007
16#define BL_2M 0x00F
17#define BL_4M 0x01F
18#define BL_8M 0x03F
19#define BL_16M 0x07F
20#define BL_32M 0x0FF
21#define BL_64M 0x1FF
22#define BL_128M 0x3FF
23#define BL_256M 0x7FF
24
25/* BAT Access Protection */
26#define BPP_XX 0x00 /* No access */
27#define BPP_RX 0x01 /* Read only */
28#define BPP_RW 0x02 /* Read/write */
29
30#ifndef __ASSEMBLY__
31struct ppc_bat {
32 struct {
33 unsigned long bepi:15; /* Effective page index (virtual address) */
34 unsigned long :4; /* Unused */
35 unsigned long bl:11; /* Block size mask */
36 unsigned long vs:1; /* Supervisor valid */
37 unsigned long vp:1; /* User valid */
38 } batu; /* Upper register */
39 struct {
40 unsigned long brpn:15; /* Real page index (physical address) */
41 unsigned long :10; /* Unused */
42 unsigned long w:1; /* Write-thru cache */
43 unsigned long i:1; /* Cache inhibit */
44 unsigned long m:1; /* Memory coherence */
45 unsigned long g:1; /* Guarded (MBZ in IBAT) */
46 unsigned long :1; /* Unused */
47 unsigned long pp:2; /* Page access protections */
48 } batl; /* Lower register */
49};
50#endif /* !__ASSEMBLY__ */
51
52/*
53 * Hash table
54 */
55
56/* Values for PP (assumes Ks=0, Kp=1) */
57#define PP_RWXX 0 /* Supervisor read/write, User none */
58#define PP_RWRX 1 /* Supervisor read/write, User read */
59#define PP_RWRW 2 /* Supervisor read/write, User read/write */
60#define PP_RXRX 3 /* Supervisor read, User read */
61
62#ifndef __ASSEMBLY__
63
64/* Hardware Page Table Entry */
65struct hash_pte {
66 unsigned long v:1; /* Entry is valid */
67 unsigned long vsid:24; /* Virtual segment identifier */
68 unsigned long h:1; /* Hash algorithm indicator */
69 unsigned long api:6; /* Abbreviated page index */
70 unsigned long rpn:20; /* Real (physical) page number */
71 unsigned long :3; /* Unused */
72 unsigned long r:1; /* Referenced */
73 unsigned long c:1; /* Changed */
74 unsigned long w:1; /* Write-thru cache mode */
75 unsigned long i:1; /* Cache inhibited */
76 unsigned long m:1; /* Memory coherence */
77 unsigned long g:1; /* Guarded */
78 unsigned long :1; /* Unused */
79 unsigned long pp:2; /* Page protection */
80};
81
82typedef struct {
83 unsigned long id;
84 unsigned long vdso_base;
85} mm_context_t;
86
87typedef unsigned long phys_addr_t;
88
89#endif /* !__ASSEMBLY__ */
90
91#endif /* _ASM_POWERPC_MMU_HASH32_H_ */
diff --git a/include/asm-powerpc/mmu-hash64.h b/include/asm-powerpc/mmu-hash64.h
index b8dca30bd0b5..695962f02059 100644
--- a/include/asm-powerpc/mmu-hash64.h
+++ b/include/asm-powerpc/mmu-hash64.h
@@ -94,6 +94,9 @@ extern char initial_stab[];
94#define HPTE_R_C ASM_CONST(0x0000000000000080) 94#define HPTE_R_C ASM_CONST(0x0000000000000080)
95#define HPTE_R_R ASM_CONST(0x0000000000000100) 95#define HPTE_R_R ASM_CONST(0x0000000000000100)
96 96
97#define HPTE_V_1TB_SEG ASM_CONST(0x4000000000000000)
98#define HPTE_V_VRMA_MASK ASM_CONST(0x4001ffffff000000)
99
97/* Values for PP (assumes Ks=0, Kp=1) */ 100/* Values for PP (assumes Ks=0, Kp=1) */
98/* pp0 will always be 0 for linux */ 101/* pp0 will always be 0 for linux */
99#define PP_RWXX 0 /* Supervisor read/write, User none */ 102#define PP_RWXX 0 /* Supervisor read/write, User none */
@@ -103,12 +106,12 @@ extern char initial_stab[];
103 106
104#ifndef __ASSEMBLY__ 107#ifndef __ASSEMBLY__
105 108
106typedef struct { 109struct hash_pte {
107 unsigned long v; 110 unsigned long v;
108 unsigned long r; 111 unsigned long r;
109} hpte_t; 112};
110 113
111extern hpte_t *htab_address; 114extern struct hash_pte *htab_address;
112extern unsigned long htab_size_bytes; 115extern unsigned long htab_size_bytes;
113extern unsigned long htab_hash_mask; 116extern unsigned long htab_hash_mask;
114 117
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h
index fe510fff8907..d44d211e7588 100644
--- a/include/asm-powerpc/mmu.h
+++ b/include/asm-powerpc/mmu.h
@@ -5,13 +5,18 @@
5#ifdef CONFIG_PPC64 5#ifdef CONFIG_PPC64
6/* 64-bit classic hash table MMU */ 6/* 64-bit classic hash table MMU */
7# include <asm/mmu-hash64.h> 7# include <asm/mmu-hash64.h>
8#elif defined(CONFIG_PPC_STD_MMU)
9/* 32-bit classic hash table MMU */
10# include <asm/mmu-hash32.h>
8#elif defined(CONFIG_44x) 11#elif defined(CONFIG_44x)
9/* 44x-style software loaded TLB */ 12/* 44x-style software loaded TLB */
10# include <asm/mmu-44x.h> 13# include <asm/mmu-44x.h>
11#else 14#elif defined(CONFIG_FSL_BOOKE)
12/* Other 32-bit. FIXME: split up the other 32-bit MMU types, and 15/* Freescale Book-E software loaded TLB */
13 * revise for arch/powerpc */ 16# include <asm/mmu-fsl-booke.h>
14# include <asm-ppc/mmu.h> 17#elif defined (CONFIG_PPC_8xx)
18/* Motorola/Freescale 8xx software loaded TLB */
19# include <asm/mmu-8xx.h>
15#endif 20#endif
16 21
17#endif /* __KERNEL__ */ 22#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/mmu_context.h b/include/asm-powerpc/mmu_context.h
index 40c9e5a13ff1..f863ac21409e 100644
--- a/include/asm-powerpc/mmu_context.h
+++ b/include/asm-powerpc/mmu_context.h
@@ -2,16 +2,210 @@
2#define __ASM_POWERPC_MMU_CONTEXT_H 2#define __ASM_POWERPC_MMU_CONTEXT_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <asm/mmu.h>
6#include <asm/cputable.h>
7#include <asm-generic/mm_hooks.h>
8
5#ifndef CONFIG_PPC64 9#ifndef CONFIG_PPC64
6#include <asm-ppc/mmu_context.h> 10#include <asm/atomic.h>
11#include <asm/bitops.h>
12
13/*
14 * On 32-bit PowerPC 6xx/7xx/7xxx CPUs, we use a set of 16 VSIDs
15 * (virtual segment identifiers) for each context. Although the
16 * hardware supports 24-bit VSIDs, and thus >1 million contexts,
17 * we only use 32,768 of them. That is ample, since there can be
18 * at most around 30,000 tasks in the system anyway, and it means
19 * that we can use a bitmap to indicate which contexts are in use.
20 * Using a bitmap means that we entirely avoid all of the problems
21 * that we used to have when the context number overflowed,
22 * particularly on SMP systems.
23 * -- paulus.
24 */
25
26/*
27 * This function defines the mapping from contexts to VSIDs (virtual
28 * segment IDs). We use a skew on both the context and the high 4 bits
29 * of the 32-bit virtual address (the "effective segment ID") in order
30 * to spread out the entries in the MMU hash table. Note, if this
31 * function is changed then arch/ppc/mm/hashtable.S will have to be
32 * changed to correspond.
33 */
34#define CTX_TO_VSID(ctx, va) (((ctx) * (897 * 16) + ((va) >> 28) * 0x111) \
35 & 0xffffff)
36
37/*
38 The MPC8xx has only 16 contexts. We rotate through them on each
39 task switch. A better way would be to keep track of tasks that
40 own contexts, and implement an LRU usage. That way very active
41 tasks don't always have to pay the TLB reload overhead. The
42 kernel pages are mapped shared, so the kernel can run on behalf
43 of any task that makes a kernel entry. Shared does not mean they
44 are not protected, just that the ASID comparison is not performed.
45 -- Dan
46
47 The IBM4xx has 256 contexts, so we can just rotate through these
48 as a way of "switching" contexts. If the TID of the TLB is zero,
49 the PID/TID comparison is disabled, so we can use a TID of zero
50 to represent all kernel pages as shared among all contexts.
51 -- Dan
52 */
53
54static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
55{
56}
57
58#ifdef CONFIG_8xx
59#define NO_CONTEXT 16
60#define LAST_CONTEXT 15
61#define FIRST_CONTEXT 0
62
63#elif defined(CONFIG_4xx)
64#define NO_CONTEXT 256
65#define LAST_CONTEXT 255
66#define FIRST_CONTEXT 1
67
68#elif defined(CONFIG_E200) || defined(CONFIG_E500)
69#define NO_CONTEXT 256
70#define LAST_CONTEXT 255
71#define FIRST_CONTEXT 1
72
73#else
74
75/* PPC 6xx, 7xx CPUs */
76#define NO_CONTEXT ((unsigned long) -1)
77#define LAST_CONTEXT 32767
78#define FIRST_CONTEXT 1
79#endif
80
81/*
82 * Set the current MMU context.
83 * On 32-bit PowerPCs (other than the 8xx embedded chips), this is done by
84 * loading up the segment registers for the user part of the address space.
85 *
86 * Since the PGD is immediately available, it is much faster to simply
87 * pass this along as a second parameter, which is required for 8xx and
88 * can be used for debugging on all processors (if you happen to have
89 * an Abatron).
90 */
91extern void set_context(unsigned long contextid, pgd_t *pgd);
92
93/*
94 * Bitmap of contexts in use.
95 * The size of this bitmap is LAST_CONTEXT + 1 bits.
96 */
97extern unsigned long context_map[];
98
99/*
100 * This caches the next context number that we expect to be free.
101 * Its use is an optimization only, we can't rely on this context
102 * number to be free, but it usually will be.
103 */
104extern unsigned long next_mmu_context;
105
106/*
107 * If we don't have sufficient contexts to give one to every task
108 * that could be in the system, we need to be able to steal contexts.
109 * These variables support that.
110 */
111#if LAST_CONTEXT < 30000
112#define FEW_CONTEXTS 1
113extern atomic_t nr_free_contexts;
114extern struct mm_struct *context_mm[LAST_CONTEXT+1];
115extern void steal_context(void);
116#endif
117
118/*
119 * Get a new mmu context for the address space described by `mm'.
120 */
121static inline void get_mmu_context(struct mm_struct *mm)
122{
123 unsigned long ctx;
124
125 if (mm->context.id != NO_CONTEXT)
126 return;
127#ifdef FEW_CONTEXTS
128 while (atomic_dec_if_positive(&nr_free_contexts) < 0)
129 steal_context();
130#endif
131 ctx = next_mmu_context;
132 while (test_and_set_bit(ctx, context_map)) {
133 ctx = find_next_zero_bit(context_map, LAST_CONTEXT+1, ctx);
134 if (ctx > LAST_CONTEXT)
135 ctx = 0;
136 }
137 next_mmu_context = (ctx + 1) & LAST_CONTEXT;
138 mm->context.id = ctx;
139#ifdef FEW_CONTEXTS
140 context_mm[ctx] = mm;
141#endif
142}
143
144/*
145 * Set up the context for a new address space.
146 */
147static inline int init_new_context(struct task_struct *t, struct mm_struct *mm)
148{
149 mm->context.id = NO_CONTEXT;
150 mm->context.vdso_base = 0;
151 return 0;
152}
153
154/*
155 * We're finished using the context for an address space.
156 */
157static inline void destroy_context(struct mm_struct *mm)
158{
159 preempt_disable();
160 if (mm->context.id != NO_CONTEXT) {
161 clear_bit(mm->context.id, context_map);
162 mm->context.id = NO_CONTEXT;
163#ifdef FEW_CONTEXTS
164 atomic_inc(&nr_free_contexts);
165#endif
166 }
167 preempt_enable();
168}
169
170static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
171 struct task_struct *tsk)
172{
173#ifdef CONFIG_ALTIVEC
174 if (cpu_has_feature(CPU_FTR_ALTIVEC))
175 asm volatile ("dssall;\n"
176#ifndef CONFIG_POWER4
177 "sync;\n" /* G4 needs a sync here, G5 apparently not */
178#endif
179 : : );
180#endif /* CONFIG_ALTIVEC */
181
182 tsk->thread.pgdir = next->pgd;
183
184 /* No need to flush userspace segments if the mm doesnt change */
185 if (prev == next)
186 return;
187
188 /* Setup new userspace context */
189 get_mmu_context(next);
190 set_context(next->context.id, next->pgd);
191}
192
193#define deactivate_mm(tsk,mm) do { } while (0)
194
195/*
196 * After we have set current->mm to a new value, this activates
197 * the context for the new mm so we see the new mappings.
198 */
199#define activate_mm(active_mm, mm) switch_mm(active_mm, mm, current)
200
201extern void mmu_context_init(void);
202
203
7#else 204#else
8 205
9#include <linux/kernel.h> 206#include <linux/kernel.h>
10#include <linux/mm.h> 207#include <linux/mm.h>
11#include <linux/sched.h> 208#include <linux/sched.h>
12#include <asm/mmu.h>
13#include <asm/cputable.h>
14#include <asm-generic/mm_hooks.h>
15 209
16/* 210/*
17 * Copyright (C) 2001 PPC 64 Team, IBM Corp 211 * Copyright (C) 2001 PPC 64 Team, IBM Corp
diff --git a/include/asm-powerpc/mpc86xx.h b/include/asm-powerpc/mpc86xx.h
index b85df45b1a84..15f650f987e7 100644
--- a/include/asm-powerpc/mpc86xx.h
+++ b/include/asm-powerpc/mpc86xx.h
@@ -19,12 +19,6 @@
19 19
20#ifdef CONFIG_PPC_86xx 20#ifdef CONFIG_PPC_86xx
21 21
22#define _IO_BASE isa_io_base
23#define _ISA_MEM_BASE isa_mem_base
24#ifdef CONFIG_PCI
25#define PCI_DRAM_OFFSET pci_dram_offset
26#endif
27
28#define CPU0_BOOT_RELEASE 0x01000000 22#define CPU0_BOOT_RELEASE 0x01000000
29#define CPU1_BOOT_RELEASE 0x02000000 23#define CPU1_BOOT_RELEASE 0x02000000
30#define CPU_ALL_RELEASED (CPU0_BOOT_RELEASE | CPU1_BOOT_RELEASE) 24#define CPU_ALL_RELEASED (CPU0_BOOT_RELEASE | CPU1_BOOT_RELEASE)
diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h
index 580371120e1a..2be014b6f57c 100644
--- a/include/asm-powerpc/mpc8xx.h
+++ b/include/asm-powerpc/mpc8xx.h
@@ -23,6 +23,10 @@
23#include <platforms/8xx/mpc885ads.h> 23#include <platforms/8xx/mpc885ads.h>
24#endif 24#endif
25 25
26#ifdef CONFIG_PCMCIA_M8XX
27extern struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
28#endif
29
26#endif /* CONFIG_8xx */ 30#endif /* CONFIG_8xx */
27#endif /* __CONFIG_8xx_DEFS */ 31#endif /* __CONFIG_8xx_DEFS */
28#endif /* __KERNEL__ */ 32#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/of_device.h b/include/asm-powerpc/of_device.h
index e9af49eb1aa8..ec2a8a2c737c 100644
--- a/include/asm-powerpc/of_device.h
+++ b/include/asm-powerpc/of_device.h
@@ -3,14 +3,12 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/mod_devicetable.h> 6#include <linux/of.h>
7#include <asm/prom.h>
8
9 7
10/* 8/*
11 * The of_device is a kind of "base class" that is a superset of 9 * The of_device is a kind of "base class" that is a superset of
12 * struct device for use by devices attached to an OF node and 10 * struct device for use by devices attached to an OF node and
13 * probed using OF properties 11 * probed using OF properties.
14 */ 12 */
15struct of_device 13struct of_device
16{ 14{
@@ -18,24 +16,14 @@ struct of_device
18 u64 dma_mask; /* DMA mask */ 16 u64 dma_mask; /* DMA mask */
19 struct device dev; /* Generic device interface */ 17 struct device dev; /* Generic device interface */
20}; 18};
21#define to_of_device(d) container_of(d, struct of_device, dev)
22
23extern const struct of_device_id *of_match_node(
24 const struct of_device_id *matches, const struct device_node *node);
25extern const struct of_device_id *of_match_device(
26 const struct of_device_id *matches, const struct of_device *dev);
27
28extern struct of_device *of_dev_get(struct of_device *dev);
29extern void of_dev_put(struct of_device *dev);
30
31extern int of_device_register(struct of_device *ofdev);
32extern void of_device_unregister(struct of_device *ofdev);
33extern void of_release_dev(struct device *dev);
34 19
35extern ssize_t of_device_get_modalias(struct of_device *ofdev, 20extern ssize_t of_device_get_modalias(struct of_device *ofdev,
36 char *str, ssize_t len); 21 char *str, ssize_t len);
37extern int of_device_uevent(struct device *dev, 22extern int of_device_uevent(struct device *dev,
38 char **envp, int num_envp, char *buffer, int buffer_size); 23 char **envp, int num_envp, char *buffer, int buffer_size);
39 24
25/* This is just here during the transition */
26#include <linux/of_device.h>
27
40#endif /* __KERNEL__ */ 28#endif /* __KERNEL__ */
41#endif /* _ASM_POWERPC_OF_DEVICE_H */ 29#endif /* _ASM_POWERPC_OF_DEVICE_H */
diff --git a/include/asm-powerpc/of_platform.h b/include/asm-powerpc/of_platform.h
index 217eafb167e9..80e6fad28b4f 100644
--- a/include/asm-powerpc/of_platform.h
+++ b/include/asm-powerpc/of_platform.h
@@ -1,3 +1,5 @@
1#ifndef _ASM_POWERPC_OF_PLATFORM_H
2#define _ASM_POWERPC_OF_PLATFORM_H
1/* 3/*
2 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. 4 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
3 * <benh@kernel.crashing.org> 5 * <benh@kernel.crashing.org>
@@ -9,37 +11,8 @@
9 * 11 *
10 */ 12 */
11 13
12#include <asm/of_device.h> 14/* This is just here during the transition */
13 15#include <linux/of_platform.h>
14/*
15 * The of_platform_bus_type is a bus type used by drivers that do not
16 * attach to a macio or similar bus but still use OF probing
17 * mechanism
18 */
19extern struct bus_type of_platform_bus_type;
20
21/*
22 * An of_platform_driver driver is attached to a basic of_device on
23 * the "platform bus" (of_platform_bus_type)
24 */
25struct of_platform_driver
26{
27 char *name;
28 struct of_device_id *match_table;
29 struct module *owner;
30
31 int (*probe)(struct of_device* dev,
32 const struct of_device_id *match);
33 int (*remove)(struct of_device* dev);
34
35 int (*suspend)(struct of_device* dev, pm_message_t state);
36 int (*resume)(struct of_device* dev);
37 int (*shutdown)(struct of_device* dev);
38
39 struct device_driver driver;
40};
41#define to_of_platform_driver(drv) \
42 container_of(drv,struct of_platform_driver, driver)
43 16
44/* Platform drivers register/unregister */ 17/* Platform drivers register/unregister */
45extern int of_register_platform_driver(struct of_platform_driver *drv); 18extern int of_register_platform_driver(struct of_platform_driver *drv);
@@ -56,5 +29,6 @@ extern int of_platform_bus_probe(struct device_node *root,
56 struct of_device_id *matches, 29 struct of_device_id *matches,
57 struct device *parent); 30 struct device *parent);
58 31
59extern struct of_device *of_find_device_by_node(struct device_node *np);
60extern struct of_device *of_find_device_by_phandle(phandle ph); 32extern struct of_device *of_find_device_by_phandle(phandle ph);
33
34#endif /* _ASM_POWERPC_OF_PLATFORM_H */
diff --git a/include/asm-powerpc/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h
index 8d6b47f7b300..938fefb4c4bc 100644
--- a/include/asm-powerpc/oprofile_impl.h
+++ b/include/asm-powerpc/oprofile_impl.h
@@ -39,14 +39,16 @@ struct op_system_config {
39 39
40/* Per-arch configuration */ 40/* Per-arch configuration */
41struct op_powerpc_model { 41struct op_powerpc_model {
42 void (*reg_setup) (struct op_counter_config *, 42 int (*reg_setup) (struct op_counter_config *,
43 struct op_system_config *, 43 struct op_system_config *,
44 int num_counters); 44 int num_counters);
45 void (*cpu_setup) (struct op_counter_config *); 45 int (*cpu_setup) (struct op_counter_config *);
46 void (*start) (struct op_counter_config *); 46 int (*start) (struct op_counter_config *);
47 void (*global_start) (struct op_counter_config *); 47 int (*global_start) (struct op_counter_config *);
48 void (*stop) (void); 48 void (*stop) (void);
49 void (*global_stop) (void); 49 void (*global_stop) (void);
50 int (*sync_start)(void);
51 int (*sync_stop)(void);
50 void (*handle_interrupt) (struct pt_regs *, 52 void (*handle_interrupt) (struct pt_regs *,
51 struct op_counter_config *); 53 struct op_counter_config *);
52 int num_counters; 54 int num_counters;
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index d9bf5aba96cb..e72c2a60853c 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -2,12 +2,91 @@
2#define _ASM_POWERPC_PCI_BRIDGE_H 2#define _ASM_POWERPC_PCI_BRIDGE_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/pci.h>
6#include <linux/list.h>
7#include <linux/ioport.h>
8
5#ifndef CONFIG_PPC64 9#ifndef CONFIG_PPC64
6#include <asm-ppc/pci-bridge.h> 10
11struct device_node;
12struct pci_controller;
13
14/*
15 * Structure of a PCI controller (host bridge)
16 */
17struct pci_controller {
18 struct pci_bus *bus;
19 char is_dynamic;
20 void *arch_data;
21 struct list_head list_node;
22 struct device *parent;
23
24 int first_busno;
25 int last_busno;
26 int self_busno;
27
28 void __iomem *io_base_virt;
29 resource_size_t io_base_phys;
30
31 /* Some machines (PReP) have a non 1:1 mapping of
32 * the PCI memory space in the CPU bus space
33 */
34 resource_size_t pci_mem_offset;
35
36 struct pci_ops *ops;
37 volatile unsigned int __iomem *cfg_addr;
38 volatile void __iomem *cfg_data;
39
40 /*
41 * Used for variants of PCI indirect handling and possible quirks:
42 * SET_CFG_TYPE - used on 4xx or any PHB that does explicit type0/1
43 * EXT_REG - provides access to PCI-e extended registers
44 * SURPRESS_PRIMARY_BUS - we surpress the setting of PCI_PRIMARY_BUS
45 * on Freescale PCI-e controllers since they used the PCI_PRIMARY_BUS
46 * to determine which bus number to match on when generating type0
47 * config cycles
48 */
49#define PPC_INDIRECT_TYPE_SET_CFG_TYPE (0x00000001)
50#define PPC_INDIRECT_TYPE_EXT_REG (0x00000002)
51#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS (0x00000004)
52 u32 indirect_type;
53
54 /* Currently, we limit ourselves to 1 IO range and 3 mem
55 * ranges since the common pci_bus structure can't handle more
56 */
57 struct resource io_resource;
58 struct resource mem_resources[3];
59 int global_number; /* PCI domain number */
60};
61
62static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
63{
64 return bus->sysdata;
65}
66
67/* These are used for config access before all the PCI probing
68 has been done. */
69int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn,
70 int where, u8 *val);
71int early_read_config_word(struct pci_controller *hose, int bus, int dev_fn,
72 int where, u16 *val);
73int early_read_config_dword(struct pci_controller *hose, int bus, int dev_fn,
74 int where, u32 *val);
75int early_write_config_byte(struct pci_controller *hose, int bus, int dev_fn,
76 int where, u8 val);
77int early_write_config_word(struct pci_controller *hose, int bus, int dev_fn,
78 int where, u16 val);
79int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn,
80 int where, u32 val);
81
82extern void setup_indirect_pci_nomap(struct pci_controller* hose,
83 void __iomem *cfg_addr, void __iomem *cfg_data);
84extern void setup_indirect_pci(struct pci_controller* hose,
85 u32 cfg_addr, u32 cfg_data);
86extern void setup_grackle(struct pci_controller *hose);
87
7#else 88#else
8 89
9#include <linux/pci.h>
10#include <linux/list.h>
11 90
12/* 91/*
13 * This program is free software; you can redistribute it and/or 92 * This program is free software; you can redistribute it and/or
@@ -31,6 +110,7 @@ struct pci_controller {
31 int last_busno; 110 int last_busno;
32 111
33 void __iomem *io_base_virt; 112 void __iomem *io_base_virt;
113 void *io_base_alloc;
34 resource_size_t io_base_phys; 114 resource_size_t io_base_phys;
35 115
36 /* Some machines have a non 1:1 mapping of 116 /* Some machines have a non 1:1 mapping of
@@ -48,8 +128,7 @@ struct pci_controller {
48 */ 128 */
49 struct resource io_resource; 129 struct resource io_resource;
50 struct resource mem_resources[3]; 130 struct resource mem_resources[3];
51 int global_number; 131 int global_number;
52 int local_number;
53 unsigned long buid; 132 unsigned long buid;
54 unsigned long dma_window_base_cur; 133 unsigned long dma_window_base_cur;
55 unsigned long dma_window_size; 134 unsigned long dma_window_size;
@@ -70,19 +149,22 @@ struct pci_dn {
70 int devfn; /* pci device and function number */ 149 int devfn; /* pci device and function number */
71 int class_code; /* pci device class */ 150 int class_code; /* pci device class */
72 151
73#ifdef CONFIG_PPC_PSERIES 152 struct pci_controller *phb; /* for pci devices */
153 struct iommu_table *iommu_table; /* for phb's or bridges */
154 struct pci_dev *pcidev; /* back-pointer to the pci device */
155 struct device_node *node; /* back-pointer to the device_node */
156
157 int pci_ext_config_space; /* for pci devices */
158
159#ifdef CONFIG_EEH
74 int eeh_mode; /* See eeh.h for possible EEH_MODEs */ 160 int eeh_mode; /* See eeh.h for possible EEH_MODEs */
75 int eeh_config_addr; 161 int eeh_config_addr;
76 int eeh_pe_config_addr; /* new-style partition endpoint address */ 162 int eeh_pe_config_addr; /* new-style partition endpoint address */
77 int eeh_check_count; /* # times driver ignored error */ 163 int eeh_check_count; /* # times driver ignored error */
78 int eeh_freeze_count; /* # times this device froze up. */ 164 int eeh_freeze_count; /* # times this device froze up. */
79#endif 165 int eeh_false_positives; /* # times this device reported #ff's */
80 int pci_ext_config_space; /* for pci devices */
81 struct pci_controller *phb; /* for pci devices */
82 struct iommu_table *iommu_table; /* for phb's or bridges */
83 struct pci_dev *pcidev; /* back-pointer to the pci device */
84 struct device_node *node; /* back-pointer to the device_node */
85 u32 config_space[16]; /* saved PCI config space */ 166 u32 config_space[16]; /* saved PCI config space */
167#endif
86}; 168};
87 169
88/* Get the pointer to a device_node's pci_dn */ 170/* Get the pointer to a device_node's pci_dn */
@@ -128,9 +210,6 @@ static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
128/** Find the bus corresponding to the indicated device node */ 210/** Find the bus corresponding to the indicated device node */
129struct pci_bus * pcibios_find_pci_bus(struct device_node *dn); 211struct pci_bus * pcibios_find_pci_bus(struct device_node *dn);
130 212
131extern void pci_process_bridge_OF_ranges(struct pci_controller *hose,
132 struct device_node *dev, int primary);
133
134/** Remove all of the PCI devices under this bus */ 213/** Remove all of the PCI devices under this bus */
135void pcibios_remove_pci_devices(struct pci_bus *bus); 214void pcibios_remove_pci_devices(struct pci_bus *bus);
136 215
@@ -148,13 +227,38 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
148 return PCI_DN(busdn)->phb; 227 return PCI_DN(busdn)->phb;
149} 228}
150 229
230extern void pcibios_free_controller(struct pci_controller *phb);
231
232extern void isa_bridge_find_early(struct pci_controller *hose);
233
234extern int pcibios_unmap_io_space(struct pci_bus *bus);
235extern int pcibios_map_io_space(struct pci_bus *bus);
236
237/* Return values for ppc_md.pci_probe_mode function */
238#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */
239#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */
240#define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */
241
242#ifdef CONFIG_NUMA
243#define PHB_SET_NODE(PHB, NODE) ((PHB)->node = (NODE))
244#else
245#define PHB_SET_NODE(PHB, NODE) ((PHB)->node = -1)
246#endif
247
248#endif /* CONFIG_PPC64 */
249
250/* Get the PCI host controller for an OF device */
151extern struct pci_controller* 251extern struct pci_controller*
152pci_find_hose_for_OF_device(struct device_node* node); 252pci_find_hose_for_OF_device(struct device_node* node);
153 253
254/* Fill up host controller resources from the OF node */
255extern void
256pci_process_bridge_OF_ranges(struct pci_controller *hose,
257 struct device_node *dev, int primary);
258
259/* Allocate a new PCI host bridge structure */
154extern struct pci_controller * 260extern struct pci_controller *
155pcibios_alloc_controller(struct device_node *dev); 261pcibios_alloc_controller(struct device_node *dev);
156extern void pcibios_free_controller(struct pci_controller *phb);
157
158#ifdef CONFIG_PCI 262#ifdef CONFIG_PCI
159extern unsigned long pci_address_to_pio(phys_addr_t address); 263extern unsigned long pci_address_to_pio(phys_addr_t address);
160#else 264#else
@@ -164,17 +268,7 @@ static inline unsigned long pci_address_to_pio(phys_addr_t address)
164} 268}
165#endif 269#endif
166 270
167/* Return values for ppc_md.pci_probe_mode function */
168#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */
169#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */
170#define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */
171 271
172#ifdef CONFIG_NUMA
173#define PHB_SET_NODE(PHB, NODE) ((PHB)->node = (NODE))
174#else
175#define PHB_SET_NODE(PHB, NODE) ((PHB)->node = -1)
176#endif
177 272
178#endif /* CONFIG_PPC64 */
179#endif /* __KERNEL__ */ 273#endif /* __KERNEL__ */
180#endif 274#endif
diff --git a/include/asm-powerpc/pci.h b/include/asm-powerpc/pci.h
index ce0f13e8eb14..7b11765c6865 100644
--- a/include/asm-powerpc/pci.h
+++ b/include/asm-powerpc/pci.h
@@ -74,18 +74,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
74extern void set_pci_dma_ops(struct dma_mapping_ops *dma_ops); 74extern void set_pci_dma_ops(struct dma_mapping_ops *dma_ops);
75extern struct dma_mapping_ops *get_pci_dma_ops(void); 75extern struct dma_mapping_ops *get_pci_dma_ops(void);
76 76
77/* For DAC DMA, we currently don't support it by default, but
78 * we let 64-bit platforms override this.
79 */
80static inline int pci_dac_dma_supported(struct pci_dev *hwdev,u64 mask)
81{
82 struct dma_mapping_ops *d = get_pci_dma_ops();
83
84 if (d && d->dac_dma_supported)
85 return d->dac_dma_supported(&hwdev->dev, mask);
86 return 0;
87}
88
89static inline void pci_dma_burst_advice(struct pci_dev *pdev, 77static inline void pci_dma_burst_advice(struct pci_dev *pdev,
90 enum pci_dma_burst_strategy *strat, 78 enum pci_dma_burst_strategy *strat,
91 unsigned long *strategy_parameter) 79 unsigned long *strategy_parameter)
@@ -107,8 +95,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
107#define get_pci_dma_ops() NULL 95#define get_pci_dma_ops() NULL
108#endif 96#endif
109 97
110extern int pci_domain_nr(struct pci_bus *bus);
111
112/* Decide whether to display the domain number in /proc */ 98/* Decide whether to display the domain number in /proc */
113extern int pci_proc_domain(struct pci_bus *bus); 99extern int pci_proc_domain(struct pci_bus *bus);
114 100
@@ -124,15 +110,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
124} 110}
125#endif 111#endif
126 112
127/*
128 * At present there are very few 32-bit PPC machines that can have
129 * memory above the 4GB point, and we don't support that.
130 */
131#define pci_dac_dma_supported(pci_dev, mask) (0)
132
133/* Return the index of the PCI controller for device PDEV. */
134#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
135
136/* Set the name of the bus as it appears in /proc/bus/pci */ 113/* Set the name of the bus as it appears in /proc/bus/pci */
137static inline int pci_proc_domain(struct pci_bus *bus) 114static inline int pci_proc_domain(struct pci_bus *bus)
138{ 115{
@@ -141,6 +118,8 @@ static inline int pci_proc_domain(struct pci_bus *bus)
141 118
142#endif /* CONFIG_PPC64 */ 119#endif /* CONFIG_PPC64 */
143 120
121extern int pci_domain_nr(struct pci_bus *bus);
122
144struct vm_area_struct; 123struct vm_area_struct;
145/* Map a range of PCI memory or I/O space for a device into user space */ 124/* Map a range of PCI memory or I/O space for a device into user space */
146int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, 125int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
@@ -220,10 +199,6 @@ static inline struct resource *pcibios_select_root(struct pci_dev *pdev,
220 return root; 199 return root;
221} 200}
222 201
223extern int unmap_bus_range(struct pci_bus *bus);
224
225extern int remap_bus_range(struct pci_bus *bus);
226
227extern void pcibios_fixup_device_resources(struct pci_dev *dev, 202extern void pcibios_fixup_device_resources(struct pci_dev *dev,
228 struct pci_bus *bus); 203 struct pci_bus *bus);
229 204
@@ -243,8 +218,6 @@ extern void of_scan_bus(struct device_node *node, struct pci_bus *bus);
243 218
244extern int pci_read_irq_line(struct pci_dev *dev); 219extern int pci_read_irq_line(struct pci_dev *dev);
245 220
246extern void pcibios_add_platform_entries(struct pci_dev *dev);
247
248struct file; 221struct file;
249extern pgprot_t pci_phys_mem_access_prot(struct file *file, 222extern pgprot_t pci_phys_mem_access_prot(struct file *file,
250 unsigned long pfn, 223 unsigned long pfn,
diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h
index 2f2e3024fa61..73dc8ba4010d 100644
--- a/include/asm-powerpc/percpu.h
+++ b/include/asm-powerpc/percpu.h
@@ -20,6 +20,11 @@
20#define DEFINE_PER_CPU(type, name) \ 20#define DEFINE_PER_CPU(type, name) \
21 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name 21 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
22 22
23#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
24 __attribute__((__section__(".data.percpu.shared_aligned"))) \
25 __typeof__(type) per_cpu__##name \
26 ____cacheline_aligned_in_smp
27
23/* var is in discarded region: offset to particular copy we want */ 28/* var is in discarded region: offset to particular copy we want */
24#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) 29#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
25#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) 30#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
@@ -40,6 +45,8 @@ extern void setup_per_cpu_areas(void);
40 45
41#define DEFINE_PER_CPU(type, name) \ 46#define DEFINE_PER_CPU(type, name) \
42 __typeof__(type) per_cpu__##name 47 __typeof__(type) per_cpu__##name
48#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
49 DEFINE_PER_CPU(type, name)
43 50
44#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 51#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
45#define __get_cpu_var(var) per_cpu__##var 52#define __get_cpu_var(var) per_cpu__##var
diff --git a/include/asm-powerpc/pgalloc-64.h b/include/asm-powerpc/pgalloc-64.h
index d9a3a8ca58a1..94d0294341d6 100644
--- a/include/asm-powerpc/pgalloc-64.h
+++ b/include/asm-powerpc/pgalloc-64.h
@@ -90,7 +90,8 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
90static inline struct page *pte_alloc_one(struct mm_struct *mm, 90static inline struct page *pte_alloc_one(struct mm_struct *mm,
91 unsigned long address) 91 unsigned long address)
92{ 92{
93 return virt_to_page(pte_alloc_one_kernel(mm, address)); 93 pte_t *pte = pte_alloc_one_kernel(mm, address);
94 return pte ? virt_to_page(pte) : NULL;
94} 95}
95 96
96static inline void pte_free_kernel(pte_t *pte) 97static inline void pte_free_kernel(pte_t *pte)
diff --git a/include/asm-powerpc/pgtable-ppc32.h b/include/asm-powerpc/pgtable-ppc32.h
index c863bdb2889c..86a54a4a8a2a 100644
--- a/include/asm-powerpc/pgtable-ppc32.h
+++ b/include/asm-powerpc/pgtable-ppc32.h
@@ -6,11 +6,7 @@
6#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/threads.h> 8#include <linux/threads.h>
9#include <asm/processor.h> /* For TASK_SIZE */
10#include <asm/mmu.h>
11#include <asm/page.h>
12#include <asm/io.h> /* For sub-arch specific PPC_PIN_SIZE */ 9#include <asm/io.h> /* For sub-arch specific PPC_PIN_SIZE */
13struct mm_struct;
14 10
15extern unsigned long va_to_phys(unsigned long address); 11extern unsigned long va_to_phys(unsigned long address);
16extern pte_t *va_to_pte(unsigned long address); 12extern pte_t *va_to_pte(unsigned long address);
@@ -488,14 +484,6 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
488#define pfn_pte(pfn, prot) __pte(((pte_basic_t)(pfn) << PFN_SHIFT_OFFSET) |\ 484#define pfn_pte(pfn, prot) __pte(((pte_basic_t)(pfn) << PFN_SHIFT_OFFSET) |\
489 pgprot_val(prot)) 485 pgprot_val(prot))
490#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot) 486#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
491
492/*
493 * ZERO_PAGE is a global shared page that is always zero: used
494 * for zero-mapped memory areas etc..
495 */
496extern unsigned long empty_zero_page[1024];
497#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
498
499#endif /* __ASSEMBLY__ */ 487#endif /* __ASSEMBLY__ */
500 488
501#define pte_none(pte) ((pte_val(pte) & ~_PTE_NONE_MASK) == 0) 489#define pte_none(pte) ((pte_val(pte) & ~_PTE_NONE_MASK) == 0)
@@ -512,9 +500,7 @@ extern unsigned long empty_zero_page[1024];
512 * The following only work if pte_present() is true. 500 * The following only work if pte_present() is true.
513 * Undefined behaviour if not.. 501 * Undefined behaviour if not..
514 */ 502 */
515static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
516static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } 503static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
517static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; }
518static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } 504static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
519static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 505static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
520static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 506static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
@@ -522,21 +508,13 @@ static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
522static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } 508static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; }
523static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } 509static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; }
524 510
525static inline pte_t pte_rdprotect(pte_t pte) {
526 pte_val(pte) &= ~_PAGE_USER; return pte; }
527static inline pte_t pte_wrprotect(pte_t pte) { 511static inline pte_t pte_wrprotect(pte_t pte) {
528 pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; } 512 pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; }
529static inline pte_t pte_exprotect(pte_t pte) {
530 pte_val(pte) &= ~_PAGE_EXEC; return pte; }
531static inline pte_t pte_mkclean(pte_t pte) { 513static inline pte_t pte_mkclean(pte_t pte) {
532 pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; } 514 pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; }
533static inline pte_t pte_mkold(pte_t pte) { 515static inline pte_t pte_mkold(pte_t pte) {
534 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } 516 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
535 517
536static inline pte_t pte_mkread(pte_t pte) {
537 pte_val(pte) |= _PAGE_USER; return pte; }
538static inline pte_t pte_mkexec(pte_t pte) {
539 pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; }
540static inline pte_t pte_mkwrite(pte_t pte) { 518static inline pte_t pte_mkwrite(pte_t pte) {
541 pte_val(pte) |= _PAGE_RW; return pte; } 519 pte_val(pte) |= _PAGE_RW; return pte; }
542static inline pte_t pte_mkdirty(pte_t pte) { 520static inline pte_t pte_mkdirty(pte_t pte) {
@@ -643,13 +621,6 @@ static inline int __ptep_test_and_clear_young(unsigned int context, unsigned lon
643#define ptep_test_and_clear_young(__vma, __addr, __ptep) \ 621#define ptep_test_and_clear_young(__vma, __addr, __ptep) \
644 __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep) 622 __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep)
645 623
646#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
647static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma,
648 unsigned long addr, pte_t *ptep)
649{
650 return (pte_update(ptep, (_PAGE_DIRTY | _PAGE_HWWRITE), 0) & _PAGE_DIRTY) != 0;
651}
652
653#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 624#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
654static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, 625static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
655 pte_t *ptep) 626 pte_t *ptep)
@@ -673,10 +644,14 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
673} 644}
674 645
675#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ 646#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
676 do { \ 647({ \
677 __ptep_set_access_flags(__ptep, __entry, __dirty); \ 648 int __changed = !pte_same(*(__ptep), __entry); \
678 flush_tlb_page_nohash(__vma, __address); \ 649 if (__changed) { \
679 } while(0) 650 __ptep_set_access_flags(__ptep, __entry, __dirty); \
651 flush_tlb_page_nohash(__vma, __address); \
652 } \
653 __changed; \
654})
680 655
681/* 656/*
682 * Macro to mark a page protection value as "uncacheable". 657 * Macro to mark a page protection value as "uncacheable".
@@ -730,10 +705,6 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
730#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0) 705#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
731#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1) 706#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
732 707
733extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
734
735extern void paging_init(void);
736
737/* 708/*
738 * Encode and decode a swap entry. 709 * Encode and decode a swap entry.
739 * Note that the bits we use in a PTE for representing a swap entry 710 * Note that the bits we use in a PTE for representing a swap entry
@@ -751,40 +722,6 @@ extern void paging_init(void);
751#define pte_to_pgoff(pte) (pte_val(pte) >> 3) 722#define pte_to_pgoff(pte) (pte_val(pte) >> 3)
752#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE }) 723#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE })
753 724
754/* CONFIG_APUS */
755/* For virtual address to physical address conversion */
756extern void cache_clear(__u32 addr, int length);
757extern void cache_push(__u32 addr, int length);
758extern int mm_end_of_chunk (unsigned long addr, int len);
759extern unsigned long iopa(unsigned long addr);
760extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
761
762/* Values for nocacheflag and cmode */
763/* These are not used by the APUS kernel_map, but prevents
764 compilation errors. */
765#define KERNELMAP_FULL_CACHING 0
766#define KERNELMAP_NOCACHE_SER 1
767#define KERNELMAP_NOCACHE_NONSER 2
768#define KERNELMAP_NO_COPYBACK 3
769
770/*
771 * Map some physical address range into the kernel address space.
772 */
773extern unsigned long kernel_map(unsigned long paddr, unsigned long size,
774 int nocacheflag, unsigned long *memavailp );
775
776/*
777 * Set cache mode of (kernel space) address range.
778 */
779extern void kernel_set_cachemode (unsigned long address, unsigned long size,
780 unsigned int cmode);
781
782/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
783#define kern_addr_valid(addr) (1)
784
785#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
786 remap_pfn_range(vma, vaddr, pfn, size, prot)
787
788/* 725/*
789 * No page table caches to initialise 726 * No page table caches to initialise
790 */ 727 */
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h
index 704c4e669fe0..300f9a199bf2 100644
--- a/include/asm-powerpc/pgtable-ppc64.h
+++ b/include/asm-powerpc/pgtable-ppc64.h
@@ -7,11 +7,7 @@
7 7
8#ifndef __ASSEMBLY__ 8#ifndef __ASSEMBLY__
9#include <linux/stddef.h> 9#include <linux/stddef.h>
10#include <asm/processor.h> /* For TASK_SIZE */
11#include <asm/mmu.h>
12#include <asm/page.h>
13#include <asm/tlbflush.h> 10#include <asm/tlbflush.h>
14struct mm_struct;
15#endif /* __ASSEMBLY__ */ 11#endif /* __ASSEMBLY__ */
16 12
17#ifdef CONFIG_PPC_64K_PAGES 13#ifdef CONFIG_PPC_64K_PAGES
@@ -27,7 +23,7 @@ struct mm_struct;
27 */ 23 */
28#define PGTABLE_EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \ 24#define PGTABLE_EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
29 PUD_INDEX_SIZE + PGD_INDEX_SIZE + PAGE_SHIFT) 25 PUD_INDEX_SIZE + PGD_INDEX_SIZE + PAGE_SHIFT)
30#define PGTABLE_RANGE (1UL << PGTABLE_EADDR_SIZE) 26#define PGTABLE_RANGE (ASM_CONST(1) << PGTABLE_EADDR_SIZE)
31 27
32#if TASK_SIZE_USER64 > PGTABLE_RANGE 28#if TASK_SIZE_USER64 > PGTABLE_RANGE
33#error TASK_SIZE_USER64 exceeds pagetable range 29#error TASK_SIZE_USER64 exceeds pagetable range
@@ -37,19 +33,28 @@ struct mm_struct;
37#error TASK_SIZE_USER64 exceeds user VSID range 33#error TASK_SIZE_USER64 exceeds user VSID range
38#endif 34#endif
39 35
36
40/* 37/*
41 * Define the address range of the vmalloc VM area. 38 * Define the address range of the vmalloc VM area.
42 */ 39 */
43#define VMALLOC_START ASM_CONST(0xD000000000000000) 40#define VMALLOC_START ASM_CONST(0xD000000000000000)
44#define VMALLOC_SIZE ASM_CONST(0x80000000000) 41#define VMALLOC_SIZE (PGTABLE_RANGE >> 1)
45#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE) 42#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE)
46 43
47/* 44/*
48 * Define the address range of the imalloc VM area. 45 * Define the address ranges for MMIO and IO space :
46 *
47 * ISA_IO_BASE = VMALLOC_END, 64K reserved area
48 * PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces
49 * IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE
49 */ 50 */
50#define PHBS_IO_BASE VMALLOC_END 51#define FULL_IO_SIZE 0x80000000ul
51#define IMALLOC_BASE (PHBS_IO_BASE + 0x80000000ul) /* Reserve 2 gigs for PHBs */ 52#define ISA_IO_BASE (VMALLOC_END)
52#define IMALLOC_END (VMALLOC_START + PGTABLE_RANGE) 53#define ISA_IO_END (VMALLOC_END + 0x10000ul)
54#define PHB_IO_BASE (ISA_IO_END)
55#define PHB_IO_END (VMALLOC_END + FULL_IO_SIZE)
56#define IOREMAP_BASE (PHB_IO_END)
57#define IOREMAP_END (VMALLOC_START + PGTABLE_RANGE)
53 58
54/* 59/*
55 * Region IDs 60 * Region IDs
@@ -134,16 +139,6 @@ struct mm_struct;
134#define __S110 PAGE_SHARED_X 139#define __S110 PAGE_SHARED_X
135#define __S111 PAGE_SHARED_X 140#define __S111 PAGE_SHARED_X
136 141
137#ifndef __ASSEMBLY__
138
139/*
140 * ZERO_PAGE is a global shared page that is always zero: used
141 * for zero-mapped memory areas etc..
142 */
143extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
144#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
145#endif /* __ASSEMBLY__ */
146
147#ifdef CONFIG_HUGETLB_PAGE 142#ifdef CONFIG_HUGETLB_PAGE
148 143
149#define HAVE_ARCH_UNMAPPED_AREA 144#define HAVE_ARCH_UNMAPPED_AREA
@@ -232,9 +227,7 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
232 * The following only work if pte_present() is true. 227 * The following only work if pte_present() is true.
233 * Undefined behaviour if not.. 228 * Undefined behaviour if not..
234 */ 229 */
235static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER;}
236static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;} 230static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;}
237static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC;}
238static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;} 231static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;}
239static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;} 232static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;}
240static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;} 233static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;}
@@ -242,20 +235,12 @@ static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;}
242static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } 235static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; }
243static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } 236static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; }
244 237
245static inline pte_t pte_rdprotect(pte_t pte) {
246 pte_val(pte) &= ~_PAGE_USER; return pte; }
247static inline pte_t pte_exprotect(pte_t pte) {
248 pte_val(pte) &= ~_PAGE_EXEC; return pte; }
249static inline pte_t pte_wrprotect(pte_t pte) { 238static inline pte_t pte_wrprotect(pte_t pte) {
250 pte_val(pte) &= ~(_PAGE_RW); return pte; } 239 pte_val(pte) &= ~(_PAGE_RW); return pte; }
251static inline pte_t pte_mkclean(pte_t pte) { 240static inline pte_t pte_mkclean(pte_t pte) {
252 pte_val(pte) &= ~(_PAGE_DIRTY); return pte; } 241 pte_val(pte) &= ~(_PAGE_DIRTY); return pte; }
253static inline pte_t pte_mkold(pte_t pte) { 242static inline pte_t pte_mkold(pte_t pte) {
254 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } 243 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
255static inline pte_t pte_mkread(pte_t pte) {
256 pte_val(pte) |= _PAGE_USER; return pte; }
257static inline pte_t pte_mkexec(pte_t pte) {
258 pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; }
259static inline pte_t pte_mkwrite(pte_t pte) { 244static inline pte_t pte_mkwrite(pte_t pte) {
260 pte_val(pte) |= _PAGE_RW; return pte; } 245 pte_val(pte) |= _PAGE_RW; return pte; }
261static inline pte_t pte_mkdirty(pte_t pte) { 246static inline pte_t pte_mkdirty(pte_t pte) {
@@ -307,29 +292,6 @@ static inline int __ptep_test_and_clear_young(struct mm_struct *mm,
307 __r; \ 292 __r; \
308}) 293})
309 294
310/*
311 * On RW/DIRTY bit transitions we can avoid flushing the hpte. For the
312 * moment we always flush but we need to fix hpte_update and test if the
313 * optimisation is worth it.
314 */
315static inline int __ptep_test_and_clear_dirty(struct mm_struct *mm,
316 unsigned long addr, pte_t *ptep)
317{
318 unsigned long old;
319
320 if ((pte_val(*ptep) & _PAGE_DIRTY) == 0)
321 return 0;
322 old = pte_update(mm, addr, ptep, _PAGE_DIRTY, 0);
323 return (old & _PAGE_DIRTY) != 0;
324}
325#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
326#define ptep_test_and_clear_dirty(__vma, __addr, __ptep) \
327({ \
328 int __r; \
329 __r = __ptep_test_and_clear_dirty((__vma)->vm_mm, __addr, __ptep); \
330 __r; \
331})
332
333#define __HAVE_ARCH_PTEP_SET_WRPROTECT 295#define __HAVE_ARCH_PTEP_SET_WRPROTECT
334static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, 296static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
335 pte_t *ptep) 297 pte_t *ptep)
@@ -357,14 +319,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
357 __young; \ 319 __young; \
358}) 320})
359 321
360#define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
361#define ptep_clear_flush_dirty(__vma, __address, __ptep) \
362({ \
363 int __dirty = __ptep_test_and_clear_dirty((__vma)->vm_mm, __address, \
364 __ptep); \
365 __dirty; \
366})
367
368#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 322#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
369static inline pte_t ptep_get_and_clear(struct mm_struct *mm, 323static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
370 unsigned long addr, pte_t *ptep) 324 unsigned long addr, pte_t *ptep)
@@ -413,10 +367,14 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
413 :"cc"); 367 :"cc");
414} 368}
415#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ 369#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
416 do { \ 370({ \
417 __ptep_set_access_flags(__ptep, __entry, __dirty); \ 371 int __changed = !pte_same(*(__ptep), __entry); \
418 flush_tlb_page_nohash(__vma, __address); \ 372 if (__changed) { \
419 } while(0) 373 __ptep_set_access_flags(__ptep, __entry, __dirty); \
374 flush_tlb_page_nohash(__vma, __address); \
375 } \
376 __changed; \
377})
420 378
421/* 379/*
422 * Macro to mark a page protection value as "uncacheable". 380 * Macro to mark a page protection value as "uncacheable".
@@ -438,10 +396,6 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
438#define pgd_ERROR(e) \ 396#define pgd_ERROR(e) \
439 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) 397 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
440 398
441extern pgd_t swapper_pg_dir[];
442
443extern void paging_init(void);
444
445/* Encode and de-code a swap entry */ 399/* Encode and de-code a swap entry */
446#define __swp_type(entry) (((entry).val >> 1) & 0x3f) 400#define __swp_type(entry) (((entry).val >> 1) & 0x3f)
447#define __swp_offset(entry) ((entry).val >> 8) 401#define __swp_offset(entry) ((entry).val >> 8)
@@ -452,17 +406,6 @@ extern void paging_init(void);
452#define pgoff_to_pte(off) ((pte_t) {((off) << PTE_RPN_SHIFT)|_PAGE_FILE}) 406#define pgoff_to_pte(off) ((pte_t) {((off) << PTE_RPN_SHIFT)|_PAGE_FILE})
453#define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_RPN_SHIFT) 407#define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_RPN_SHIFT)
454 408
455/*
456 * kern_addr_valid is intended to indicate whether an address is a valid
457 * kernel address. Most 32-bit archs define it as always true (like this)
458 * but most 64-bit archs actually perform a test. What should we do here?
459 * The only use is in fs/ncpfs/dir.c
460 */
461#define kern_addr_valid(addr) (1)
462
463#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
464 remap_pfn_range(vma, vaddr, pfn, size, prot)
465
466void pgtable_cache_init(void); 409void pgtable_cache_init(void);
467 410
468/* 411/*
diff --git a/include/asm-powerpc/pgtable.h b/include/asm-powerpc/pgtable.h
index 78bf4ae712a6..d18ffe7bc7c4 100644
--- a/include/asm-powerpc/pgtable.h
+++ b/include/asm-powerpc/pgtable.h
@@ -2,6 +2,13 @@
2#define _ASM_POWERPC_PGTABLE_H 2#define _ASM_POWERPC_PGTABLE_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#ifndef __ASSEMBLY__
6#include <asm/processor.h> /* For TASK_SIZE */
7#include <asm/mmu.h>
8#include <asm/page.h>
9struct mm_struct;
10#endif /* !__ASSEMBLY__ */
11
5#if defined(CONFIG_PPC64) 12#if defined(CONFIG_PPC64)
6# include <asm/pgtable-ppc64.h> 13# include <asm/pgtable-ppc64.h>
7#else 14#else
@@ -9,6 +16,27 @@
9#endif 16#endif
10 17
11#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
19/*
20 * ZERO_PAGE is a global shared page that is always zero: used
21 * for zero-mapped memory areas etc..
22 */
23extern unsigned long empty_zero_page[];
24#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
25
26extern pgd_t swapper_pg_dir[];
27
28extern void paging_init(void);
29
30/*
31 * kern_addr_valid is intended to indicate whether an address is a valid
32 * kernel address. Most 32-bit archs define it as always true (like this)
33 * but most 64-bit archs actually perform a test. What should we do here?
34 */
35#define kern_addr_valid(addr) (1)
36
37#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
38 remap_pfn_range(vma, vaddr, pfn, size, prot)
39
12#include <asm-generic/pgtable.h> 40#include <asm-generic/pgtable.h>
13#endif /* __ASSEMBLY__ */ 41#endif /* __ASSEMBLY__ */
14 42
diff --git a/include/asm-powerpc/pmi.h b/include/asm-powerpc/pmi.h
index cb0f8aa43088..2259d4ce3846 100644
--- a/include/asm-powerpc/pmi.h
+++ b/include/asm-powerpc/pmi.h
@@ -55,13 +55,13 @@ typedef struct {
55struct pmi_handler { 55struct pmi_handler {
56 struct list_head node; 56 struct list_head node;
57 u8 type; 57 u8 type;
58 void (*handle_pmi_message) (struct of_device *, pmi_message_t); 58 void (*handle_pmi_message) (pmi_message_t);
59}; 59};
60 60
61void pmi_register_handler(struct of_device *, struct pmi_handler *); 61int pmi_register_handler(struct pmi_handler *);
62void pmi_unregister_handler(struct of_device *, struct pmi_handler *); 62void pmi_unregister_handler(struct pmi_handler *);
63 63
64void pmi_send_message(struct of_device *, pmi_message_t); 64int pmi_send_message(pmi_message_t);
65 65
66#endif /* __KERNEL__ */ 66#endif /* __KERNEL__ */
67#endif /* _POWERPC_PMI_H */ 67#endif /* _POWERPC_PMI_H */
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h
index 8e2005159ffd..b847aa10074b 100644
--- a/include/asm-powerpc/ppc-pci.h
+++ b/include/asm-powerpc/ppc-pci.h
@@ -26,7 +26,7 @@ extern int global_phb_number;
26 26
27extern void find_and_init_phbs(void); 27extern void find_and_init_phbs(void);
28 28
29extern struct pci_dev *ppc64_isabridge_dev; /* may be NULL if no ISA bus */ 29extern struct pci_dev *isa_bridge_pcidev; /* may be NULL if no ISA bus */
30 30
31/** Bus Unit ID macros; get low and hi 32-bits of the 64-bit BUID */ 31/** Bus Unit ID macros; get low and hi 32-bits of the 64-bit BUID */
32#define BUID_HI(buid) ((buid) >> 32) 32#define BUID_HI(buid) ((buid) >> 32)
@@ -47,8 +47,8 @@ extern void init_pci_config_tokens (void);
47extern unsigned long get_phb_buid (struct device_node *); 47extern unsigned long get_phb_buid (struct device_node *);
48extern int rtas_setup_phb(struct pci_controller *phb); 48extern int rtas_setup_phb(struct pci_controller *phb);
49 49
50/* From pSeries_pci.h */ 50/* From iSeries PCI */
51extern void pSeries_final_fixup(void); 51extern void iSeries_pcibios_init(void);
52 52
53extern unsigned long pci_probe_only; 53extern unsigned long pci_probe_only;
54 54
@@ -139,6 +139,9 @@ void eeh_clear_slot (struct device_node *dn, int mode_flag);
139 */ 139 */
140struct device_node * find_device_pe(struct device_node *dn); 140struct device_node * find_device_pe(struct device_node *dn);
141 141
142void eeh_sysfs_add_device(struct pci_dev *pdev);
143void eeh_sysfs_remove_device(struct pci_dev *pdev);
144
142#endif /* CONFIG_EEH */ 145#endif /* CONFIG_EEH */
143 146
144#else /* CONFIG_PCI */ 147#else /* CONFIG_PCI */
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h
index d947b1609491..e28b10805159 100644
--- a/include/asm-powerpc/processor.h
+++ b/include/asm-powerpc/processor.h
@@ -43,14 +43,6 @@ extern int _chrp_type;
43/* what kind of prep workstation we are */ 43/* what kind of prep workstation we are */
44extern int _prep_type; 44extern int _prep_type;
45 45
46/*
47 * This is used to identify the board type from a given PReP board
48 * vendor. Board revision is also made available. This will be moved
49 * elsewhere soon
50 */
51extern unsigned char ucBoardRev;
52extern unsigned char ucBoardRevMaj, ucBoardRevMin;
53
54#endif /* CONFIG_PPC_PREP */ 46#endif /* CONFIG_PPC_PREP */
55 47
56#endif /* defined(__KERNEL__) && defined(CONFIG_PPC32) */ 48#endif /* defined(__KERNEL__) && defined(CONFIG_PPC32) */
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 6845af93ba91..6e391c9894ce 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -21,6 +21,13 @@
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/atomic.h> 22#include <asm/atomic.h>
23 23
24#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
25#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
26
27#define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l))
28#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
29#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
30
24/* Definitions used by the flattened device tree */ 31/* Definitions used by the flattened device tree */
25#define OF_DT_HEADER 0xd00dfeed /* marker */ 32#define OF_DT_HEADER 0xd00dfeed /* marker */
26#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */ 33#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
@@ -97,11 +104,16 @@ struct device_node {
97 104
98extern struct device_node *of_chosen; 105extern struct device_node *of_chosen;
99 106
100/* flag descriptions */ 107static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
101#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ 108{
109 return test_bit(flag, &n->_flags);
110}
111
112static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
113{
114 set_bit(flag, &n->_flags);
115}
102 116
103#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
104#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
105 117
106#define HAVE_ARCH_DEVTREE_FIXUPS 118#define HAVE_ARCH_DEVTREE_FIXUPS
107 119
@@ -111,28 +123,7 @@ static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_e
111} 123}
112 124
113 125
114/* New style node lookup */
115extern struct device_node *of_find_node_by_name(struct device_node *from,
116 const char *name);
117#define for_each_node_by_name(dn, name) \
118 for (dn = of_find_node_by_name(NULL, name); dn; \
119 dn = of_find_node_by_name(dn, name))
120extern struct device_node *of_find_node_by_type(struct device_node *from,
121 const char *type);
122#define for_each_node_by_type(dn, type) \
123 for (dn = of_find_node_by_type(NULL, type); dn; \
124 dn = of_find_node_by_type(dn, type))
125extern struct device_node *of_find_compatible_node(struct device_node *from,
126 const char *type, const char *compat);
127extern struct device_node *of_find_node_by_path(const char *path);
128extern struct device_node *of_find_node_by_phandle(phandle handle);
129extern struct device_node *of_find_all_nodes(struct device_node *prev); 126extern struct device_node *of_find_all_nodes(struct device_node *prev);
130extern struct device_node *of_get_parent(const struct device_node *node);
131extern struct device_node *of_get_next_child(const struct device_node *node,
132 struct device_node *prev);
133extern struct property *of_find_property(const struct device_node *np,
134 const char *name,
135 int *lenp);
136extern struct device_node *of_node_get(struct device_node *node); 127extern struct device_node *of_node_get(struct device_node *node);
137extern void of_node_put(struct device_node *node); 128extern void of_node_put(struct device_node *node);
138 129
@@ -154,17 +145,9 @@ extern void of_detach_node(const struct device_node *);
154extern void finish_device_tree(void); 145extern void finish_device_tree(void);
155extern void unflatten_device_tree(void); 146extern void unflatten_device_tree(void);
156extern void early_init_devtree(void *); 147extern void early_init_devtree(void *);
157extern int of_device_is_compatible(const struct device_node *device,
158 const char *);
159#define device_is_compatible(d, c) of_device_is_compatible((d), (c)) 148#define device_is_compatible(d, c) of_device_is_compatible((d), (c))
160extern int machine_is_compatible(const char *compat); 149extern int machine_is_compatible(const char *compat);
161extern const void *of_get_property(const struct device_node *node,
162 const char *name,
163 int *lenp);
164#define get_property(a, b, c) of_get_property((a), (b), (c))
165extern void print_properties(struct device_node *node); 150extern void print_properties(struct device_node *node);
166extern int of_n_addr_cells(struct device_node* np);
167extern int of_n_size_cells(struct device_node* np);
168extern int prom_n_intr_cells(struct device_node* np); 151extern int prom_n_intr_cells(struct device_node* np);
169extern void prom_get_irq_senses(unsigned char *senses, int off, int max); 152extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
170extern int prom_add_property(struct device_node* np, struct property* prop); 153extern int prom_add_property(struct device_node* np, struct property* prop);
@@ -218,7 +201,6 @@ static inline unsigned long of_read_ulong(const u32 *cell, int size)
218 201
219/* Translate an OF address block into a CPU physical address 202/* Translate an OF address block into a CPU physical address
220 */ 203 */
221#define OF_BAD_ADDR ((u64)-1)
222extern u64 of_translate_address(struct device_node *np, const u32 *addr); 204extern u64 of_translate_address(struct device_node *np, const u32 *addr);
223 205
224/* Extract an address from a device, returns the region size and 206/* Extract an address from a device, returns the region size and
@@ -345,5 +327,11 @@ extern int of_irq_to_resource(struct device_node *dev, int index,
345 */ 327 */
346extern void __iomem *of_iomap(struct device_node *device, int index); 328extern void __iomem *of_iomap(struct device_node *device, int index);
347 329
330/*
331 * NB: This is here while we transition from using asm/prom.h
332 * to linux/of.h
333 */
334#include <linux/of.h>
335
348#endif /* __KERNEL__ */ 336#endif /* __KERNEL__ */
349#endif /* _POWERPC_PROM_H */ 337#endif /* _POWERPC_PROM_H */
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h
index 1e04651eedc4..a6f3f5ee7ca7 100644
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -35,7 +35,8 @@ union ps3_firmware_version {
35 }; 35 };
36}; 36};
37 37
38int ps3_get_firmware_version(union ps3_firmware_version *v); 38void ps3_get_firmware_version(union ps3_firmware_version *v);
39int ps3_compare_firmware_version(u16 major, u16 minor, u16 rev);
39 40
40/* 'Other OS' area */ 41/* 'Other OS' area */
41 42
@@ -48,18 +49,6 @@ enum ps3_param_av_multi_out {
48 49
49enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void); 50enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void);
50 51
51/**
52 * struct ps3_device_id - HV bus device identifier from the system repository
53 * @bus_id: HV bus id, {1..} (zero invalid)
54 * @dev_id: HV device id, {0..}
55 */
56
57struct ps3_device_id {
58 unsigned int bus_id;
59 unsigned int dev_id;
60};
61
62
63/* dma routines */ 52/* dma routines */
64 53
65enum ps3_dma_page_size { 54enum ps3_dma_page_size {
@@ -74,6 +63,8 @@ enum ps3_dma_region_type {
74 PS3_DMA_INTERNAL = 2, 63 PS3_DMA_INTERNAL = 2,
75}; 64};
76 65
66struct ps3_dma_region_ops;
67
77/** 68/**
78 * struct ps3_dma_region - A per device dma state variables structure 69 * struct ps3_dma_region - A per device dma state variables structure
79 * @did: The HV device id. 70 * @did: The HV device id.
@@ -81,21 +72,42 @@ enum ps3_dma_region_type {
81 * @region_type: The HV region type. 72 * @region_type: The HV region type.
82 * @bus_addr: The 'translated' bus address of the region. 73 * @bus_addr: The 'translated' bus address of the region.
83 * @len: The length in bytes of the region. 74 * @len: The length in bytes of the region.
75 * @offset: The offset from the start of memory of the region.
76 * @ioid: The IOID of the device who owns this region
84 * @chunk_list: Opaque variable used by the ioc page manager. 77 * @chunk_list: Opaque variable used by the ioc page manager.
78 * @region_ops: struct ps3_dma_region_ops - dma region operations
85 */ 79 */
86 80
87struct ps3_dma_region { 81struct ps3_dma_region {
88 struct ps3_device_id did; 82 struct ps3_system_bus_device *dev;
83 /* device variables */
84 const struct ps3_dma_region_ops *region_ops;
85 unsigned char ioid;
89 enum ps3_dma_page_size page_size; 86 enum ps3_dma_page_size page_size;
90 enum ps3_dma_region_type region_type; 87 enum ps3_dma_region_type region_type;
91 unsigned long bus_addr;
92 unsigned long len; 88 unsigned long len;
89 unsigned long offset;
90
91 /* driver variables (set by ps3_dma_region_create) */
92 unsigned long bus_addr;
93 struct { 93 struct {
94 spinlock_t lock; 94 spinlock_t lock;
95 struct list_head head; 95 struct list_head head;
96 } chunk_list; 96 } chunk_list;
97}; 97};
98 98
99struct ps3_dma_region_ops {
100 int (*create)(struct ps3_dma_region *);
101 int (*free)(struct ps3_dma_region *);
102 int (*map)(struct ps3_dma_region *,
103 unsigned long virt_addr,
104 unsigned long len,
105 unsigned long *bus_addr,
106 u64 iopte_pp);
107 int (*unmap)(struct ps3_dma_region *,
108 unsigned long bus_addr,
109 unsigned long len);
110};
99/** 111/**
100 * struct ps3_dma_region_init - Helper to initialize structure variables 112 * struct ps3_dma_region_init - Helper to initialize structure variables
101 * 113 *
@@ -103,18 +115,16 @@ struct ps3_dma_region {
103 * ps3_system_bus_device_register. 115 * ps3_system_bus_device_register.
104 */ 116 */
105 117
106static inline void ps3_dma_region_init(struct ps3_dma_region *r, 118struct ps3_system_bus_device;
107 const struct ps3_device_id* did, enum ps3_dma_page_size page_size, 119
108 enum ps3_dma_region_type region_type) 120int ps3_dma_region_init(struct ps3_system_bus_device *dev,
109{ 121 struct ps3_dma_region *r, enum ps3_dma_page_size page_size,
110 r->did = *did; 122 enum ps3_dma_region_type region_type, void *addr, unsigned long len);
111 r->page_size = page_size;
112 r->region_type = region_type;
113}
114int ps3_dma_region_create(struct ps3_dma_region *r); 123int ps3_dma_region_create(struct ps3_dma_region *r);
115int ps3_dma_region_free(struct ps3_dma_region *r); 124int ps3_dma_region_free(struct ps3_dma_region *r);
116int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr, 125int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr,
117 unsigned long len, unsigned long *bus_addr); 126 unsigned long len, unsigned long *bus_addr,
127 u64 iopte_pp);
118int ps3_dma_unmap(struct ps3_dma_region *r, unsigned long bus_addr, 128int ps3_dma_unmap(struct ps3_dma_region *r, unsigned long bus_addr,
119 unsigned long len); 129 unsigned long len);
120 130
@@ -125,6 +135,7 @@ enum ps3_mmio_page_size {
125 PS3_MMIO_64K = 16U 135 PS3_MMIO_64K = 16U
126}; 136};
127 137
138struct ps3_mmio_region_ops;
128/** 139/**
129 * struct ps3_mmio_region - a per device mmio state variables structure 140 * struct ps3_mmio_region - a per device mmio state variables structure
130 * 141 *
@@ -132,13 +143,18 @@ enum ps3_mmio_page_size {
132 */ 143 */
133 144
134struct ps3_mmio_region { 145struct ps3_mmio_region {
135 struct ps3_device_id did; 146 struct ps3_system_bus_device *dev;
147 const struct ps3_mmio_region_ops *mmio_ops;
136 unsigned long bus_addr; 148 unsigned long bus_addr;
137 unsigned long len; 149 unsigned long len;
138 enum ps3_mmio_page_size page_size; 150 enum ps3_mmio_page_size page_size;
139 unsigned long lpar_addr; 151 unsigned long lpar_addr;
140}; 152};
141 153
154struct ps3_mmio_region_ops {
155 int (*create)(struct ps3_mmio_region *);
156 int (*free)(struct ps3_mmio_region *);
157};
142/** 158/**
143 * struct ps3_mmio_region_init - Helper to initialize structure variables 159 * struct ps3_mmio_region_init - Helper to initialize structure variables
144 * 160 *
@@ -146,15 +162,9 @@ struct ps3_mmio_region {
146 * ps3_system_bus_device_register. 162 * ps3_system_bus_device_register.
147 */ 163 */
148 164
149static inline void ps3_mmio_region_init(struct ps3_mmio_region *r, 165int ps3_mmio_region_init(struct ps3_system_bus_device *dev,
150 const struct ps3_device_id* did, unsigned long bus_addr, 166 struct ps3_mmio_region *r, unsigned long bus_addr, unsigned long len,
151 unsigned long len, enum ps3_mmio_page_size page_size) 167 enum ps3_mmio_page_size page_size);
152{
153 r->did = *did;
154 r->bus_addr = bus_addr;
155 r->len = len;
156 r->page_size = page_size;
157}
158int ps3_mmio_region_create(struct ps3_mmio_region *r); 168int ps3_mmio_region_create(struct ps3_mmio_region *r);
159int ps3_free_mmio_region(struct ps3_mmio_region *r); 169int ps3_free_mmio_region(struct ps3_mmio_region *r);
160unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr); 170unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr);
@@ -187,11 +197,10 @@ int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id,
187 unsigned int class, unsigned int *virq); 197 unsigned int class, unsigned int *virq);
188int ps3_spe_irq_destroy(unsigned int virq); 198int ps3_spe_irq_destroy(unsigned int virq);
189 199
190int ps3_sb_event_receive_port_setup(enum ps3_cpu_binding cpu, 200int ps3_sb_event_receive_port_setup(struct ps3_system_bus_device *dev,
191 const struct ps3_device_id *did, unsigned int interrupt_id, 201 enum ps3_cpu_binding cpu, unsigned int *virq);
192 unsigned int *virq); 202int ps3_sb_event_receive_port_destroy(struct ps3_system_bus_device *dev,
193int ps3_sb_event_receive_port_destroy(const struct ps3_device_id *did, 203 unsigned int virq);
194 unsigned int interrupt_id, unsigned int virq);
195 204
196/* lv1 result codes */ 205/* lv1 result codes */
197 206
@@ -289,11 +298,33 @@ static inline const char* ps3_result(int result)
289/* system bus routines */ 298/* system bus routines */
290 299
291enum ps3_match_id { 300enum ps3_match_id {
292 PS3_MATCH_ID_EHCI = 1, 301 PS3_MATCH_ID_EHCI = 1,
293 PS3_MATCH_ID_OHCI, 302 PS3_MATCH_ID_OHCI = 2,
294 PS3_MATCH_ID_GELIC, 303 PS3_MATCH_ID_GELIC = 3,
295 PS3_MATCH_ID_AV_SETTINGS, 304 PS3_MATCH_ID_AV_SETTINGS = 4,
296 PS3_MATCH_ID_SYSTEM_MANAGER, 305 PS3_MATCH_ID_SYSTEM_MANAGER = 5,
306 PS3_MATCH_ID_STOR_DISK = 6,
307 PS3_MATCH_ID_STOR_ROM = 7,
308 PS3_MATCH_ID_STOR_FLASH = 8,
309 PS3_MATCH_ID_SOUND = 9,
310 PS3_MATCH_ID_GRAPHICS = 10,
311};
312
313#define PS3_MODULE_ALIAS_EHCI "ps3:1"
314#define PS3_MODULE_ALIAS_OHCI "ps3:2"
315#define PS3_MODULE_ALIAS_GELIC "ps3:3"
316#define PS3_MODULE_ALIAS_AV_SETTINGS "ps3:4"
317#define PS3_MODULE_ALIAS_SYSTEM_MANAGER "ps3:5"
318#define PS3_MODULE_ALIAS_STOR_DISK "ps3:6"
319#define PS3_MODULE_ALIAS_STOR_ROM "ps3:7"
320#define PS3_MODULE_ALIAS_STOR_FLASH "ps3:8"
321#define PS3_MODULE_ALIAS_SOUND "ps3:9"
322#define PS3_MODULE_ALIAS_GRAPHICS "ps3:10"
323
324enum ps3_system_bus_device_type {
325 PS3_DEVICE_TYPE_IOC0 = 1,
326 PS3_DEVICE_TYPE_SB,
327 PS3_DEVICE_TYPE_VUART,
297}; 328};
298 329
299/** 330/**
@@ -302,14 +333,23 @@ enum ps3_match_id {
302 333
303struct ps3_system_bus_device { 334struct ps3_system_bus_device {
304 enum ps3_match_id match_id; 335 enum ps3_match_id match_id;
305 struct ps3_device_id did; 336 enum ps3_system_bus_device_type dev_type;
306 unsigned int interrupt_id; 337
307/* struct iommu_table *iommu_table; -- waiting for Ben's cleanups */ 338 unsigned int bus_id; /* SB */
308 struct ps3_dma_region *d_region; 339 unsigned int dev_id; /* SB */
309 struct ps3_mmio_region *m_region; 340 unsigned int interrupt_id; /* SB */
341 struct ps3_dma_region *d_region; /* SB, IOC0 */
342 struct ps3_mmio_region *m_region; /* SB, IOC0*/
343 unsigned int port_number; /* VUART */
344
345/* struct iommu_table *iommu_table; -- waiting for BenH's cleanups */
310 struct device core; 346 struct device core;
347 void *driver_priv; /* private driver variables */
311}; 348};
312 349
350int ps3_open_hv_device(struct ps3_system_bus_device *dev);
351int ps3_close_hv_device(struct ps3_system_bus_device *dev);
352
313/** 353/**
314 * struct ps3_system_bus_driver - a driver for a device on the system bus 354 * struct ps3_system_bus_driver - a driver for a device on the system bus
315 */ 355 */
@@ -319,6 +359,7 @@ struct ps3_system_bus_driver {
319 struct device_driver core; 359 struct device_driver core;
320 int (*probe)(struct ps3_system_bus_device *); 360 int (*probe)(struct ps3_system_bus_device *);
321 int (*remove)(struct ps3_system_bus_device *); 361 int (*remove)(struct ps3_system_bus_device *);
362 int (*shutdown)(struct ps3_system_bus_device *);
322/* int (*suspend)(struct ps3_system_bus_device *, pm_message_t); */ 363/* int (*suspend)(struct ps3_system_bus_device *, pm_message_t); */
323/* int (*resume)(struct ps3_system_bus_device *); */ 364/* int (*resume)(struct ps3_system_bus_device *); */
324}; 365};
@@ -326,16 +367,24 @@ struct ps3_system_bus_driver {
326int ps3_system_bus_device_register(struct ps3_system_bus_device *dev); 367int ps3_system_bus_device_register(struct ps3_system_bus_device *dev);
327int ps3_system_bus_driver_register(struct ps3_system_bus_driver *drv); 368int ps3_system_bus_driver_register(struct ps3_system_bus_driver *drv);
328void ps3_system_bus_driver_unregister(struct ps3_system_bus_driver *drv); 369void ps3_system_bus_driver_unregister(struct ps3_system_bus_driver *drv);
329static inline struct ps3_system_bus_driver *to_ps3_system_bus_driver( 370
371static inline struct ps3_system_bus_driver *ps3_drv_to_system_bus_drv(
330 struct device_driver *_drv) 372 struct device_driver *_drv)
331{ 373{
332 return container_of(_drv, struct ps3_system_bus_driver, core); 374 return container_of(_drv, struct ps3_system_bus_driver, core);
333} 375}
334static inline struct ps3_system_bus_device *to_ps3_system_bus_device( 376static inline struct ps3_system_bus_device *ps3_dev_to_system_bus_dev(
335 struct device *_dev) 377 struct device *_dev)
336{ 378{
337 return container_of(_dev, struct ps3_system_bus_device, core); 379 return container_of(_dev, struct ps3_system_bus_device, core);
338} 380}
381static inline struct ps3_system_bus_driver *
382 ps3_system_bus_dev_to_system_bus_drv(struct ps3_system_bus_device *_dev)
383{
384 BUG_ON(!_dev);
385 BUG_ON(!_dev->core.driver);
386 return ps3_drv_to_system_bus_drv(_dev->core.driver);
387}
339 388
340/** 389/**
341 * ps3_system_bus_set_drvdata - 390 * ps3_system_bus_set_drvdata -
@@ -358,32 +407,17 @@ static inline void *ps3_system_bus_get_driver_data(
358 407
359extern struct bus_type ps3_system_bus_type; 408extern struct bus_type ps3_system_bus_type;
360 409
361/* vuart routines */ 410/* system manager */
362
363struct ps3_vuart_port_priv;
364
365/**
366 * struct ps3_vuart_port_device - a device on a vuart port
367 */
368
369struct ps3_vuart_port_device {
370 enum ps3_match_id match_id;
371 struct device core;
372 struct ps3_vuart_port_priv* priv; /* private driver variables */
373 411
412struct ps3_sys_manager_ops {
413 struct ps3_system_bus_device *dev;
414 void (*power_off)(struct ps3_system_bus_device *dev);
415 void (*restart)(struct ps3_system_bus_device *dev);
374}; 416};
375 417
376int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev); 418void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops);
377
378/* system manager */
379
380#ifdef CONFIG_PS3_SYS_MANAGER
381void ps3_sys_manager_restart(void);
382void ps3_sys_manager_power_off(void); 419void ps3_sys_manager_power_off(void);
383#else 420void ps3_sys_manager_restart(void);
384static inline void ps3_sys_manager_restart(void) {}
385static inline void ps3_sys_manager_power_off(void) {}
386#endif
387 421
388struct ps3_prealloc { 422struct ps3_prealloc {
389 const char *name; 423 const char *name;
@@ -393,5 +427,7 @@ struct ps3_prealloc {
393}; 427};
394 428
395extern struct ps3_prealloc ps3fb_videomemory; 429extern struct ps3_prealloc ps3fb_videomemory;
430extern struct ps3_prealloc ps3flash_bounce_buffer;
431
396 432
397#endif 433#endif
diff --git a/include/asm-powerpc/ps3av.h b/include/asm-powerpc/ps3av.h
index 9efc40f1c778..7df4250802de 100644
--- a/include/asm-powerpc/ps3av.h
+++ b/include/asm-powerpc/ps3av.h
@@ -1,20 +1,23 @@
1/* 1/*
2 * Copyright (C) 2006 Sony Computer Entertainment Inc. 2 * PS3 AV backend support.
3 * Copyright 2006, 2007 Sony Corporation
4 * 3 *
5 * This program is free software; you can redistribute it and/or modify it 4 * Copyright (C) 2007 Sony Computer Entertainment Inc.
6 * under the terms of the GNU General Public License as published 5 * Copyright 2007 Sony Corp.
7 * by the Free Software Foundation; version 2 of the License.
8 * 6 *
9 * This program is distributed in the hope that it will be useful, but 7 * This program is free software; you can redistribute it and/or modify
10 * WITHOUT ANY WARRANTY; without even the implied warranty of 8 * it under the terms of the GNU General Public License as published by
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 9 * the Free Software Foundation; version 2 of the License.
12 * General Public License for more details.
13 * 10 *
14 * You should have received a copy of the GNU General Public License along 11 * This program is distributed in the hope that it will be useful,
15 * with this program; if not, write to the Free Software Foundation, Inc., 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 19 */
20
18#ifndef _ASM_POWERPC_PS3AV_H_ 21#ifndef _ASM_POWERPC_PS3AV_H_
19#define _ASM_POWERPC_PS3AV_H_ 22#define _ASM_POWERPC_PS3AV_H_
20 23
@@ -159,6 +162,9 @@
159#define PS3AV_CMD_VIDEO_FMT_X8R8G8B8 0x0000 162#define PS3AV_CMD_VIDEO_FMT_X8R8G8B8 0x0000
160/* video_out_format */ 163/* video_out_format */
161#define PS3AV_CMD_VIDEO_OUT_FORMAT_RGB_12BIT 0x0000 164#define PS3AV_CMD_VIDEO_OUT_FORMAT_RGB_12BIT 0x0000
165/* video_cl_cnv */
166#define PS3AV_CMD_VIDEO_CL_CNV_ENABLE_LUT 0x0000
167#define PS3AV_CMD_VIDEO_CL_CNV_DISABLE_LUT 0x0010
162/* video_sync */ 168/* video_sync */
163#define PS3AV_CMD_VIDEO_SYNC_VSYNC 0x0001 169#define PS3AV_CMD_VIDEO_SYNC_VSYNC 0x0001
164#define PS3AV_CMD_VIDEO_SYNC_CSYNC 0x0004 170#define PS3AV_CMD_VIDEO_SYNC_CSYNC 0x0004
@@ -311,6 +317,8 @@
311#define PS3AV_MODE_MASK 0x000F 317#define PS3AV_MODE_MASK 0x000F
312#define PS3AV_MODE_HDCP_OFF 0x1000 /* Retail PS3 product doesn't support this */ 318#define PS3AV_MODE_HDCP_OFF 0x1000 /* Retail PS3 product doesn't support this */
313#define PS3AV_MODE_DITHER 0x0800 319#define PS3AV_MODE_DITHER 0x0800
320#define PS3AV_MODE_COLOR 0x0400
321#define PS3AV_MODE_WHITE 0x0200
314#define PS3AV_MODE_FULL 0x0080 322#define PS3AV_MODE_FULL 0x0080
315#define PS3AV_MODE_DVI 0x0040 323#define PS3AV_MODE_DVI 0x0040
316#define PS3AV_MODE_RGB 0x0020 324#define PS3AV_MODE_RGB 0x0020
@@ -529,9 +537,9 @@ struct ps3av_pkt_video_mode {
529 u32 video_out_format; /* in: out format */ 537 u32 video_out_format; /* in: out format */
530 u32 video_format; /* in: input frame buffer format */ 538 u32 video_format; /* in: input frame buffer format */
531 u8 reserved3; 539 u8 reserved3;
532 u8 reserved4; 540 u8 video_cl_cnv; /* in: color conversion */
533 u16 video_order; /* in: input RGB order */ 541 u16 video_order; /* in: input RGB order */
534 u32 reserved5; 542 u32 reserved4;
535}; 543};
536 544
537/* video: format */ 545/* video: format */
@@ -539,7 +547,8 @@ struct ps3av_pkt_video_format {
539 struct ps3av_send_hdr send_hdr; 547 struct ps3av_send_hdr send_hdr;
540 u32 video_head; /* in: head */ 548 u32 video_head; /* in: head */
541 u32 video_format; /* in: frame buffer format */ 549 u32 video_format; /* in: frame buffer format */
542 u16 reserved; 550 u8 reserved;
551 u8 video_cl_cnv; /* in: color conversion */
543 u16 video_order; /* in: input RGB order */ 552 u16 video_order; /* in: input RGB order */
544}; 553};
545 554
@@ -698,12 +707,6 @@ static inline void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_
698extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *, 707extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *,
699 u32); 708 u32);
700 709
701struct ps3_vuart_port_device;
702extern int ps3av_vuart_write(struct ps3_vuart_port_device *dev,
703 const void *buf, unsigned long size);
704extern int ps3av_vuart_read(struct ps3_vuart_port_device *dev, void *buf,
705 unsigned long size, int timeout);
706
707extern int ps3av_set_video_mode(u32, int); 710extern int ps3av_set_video_mode(u32, int);
708extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32); 711extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32);
709extern int ps3av_get_auto_mode(int); 712extern int ps3av_get_auto_mode(int);
@@ -716,5 +719,8 @@ extern int ps3av_video_mute(int);
716extern int ps3av_audio_mute(int); 719extern int ps3av_audio_mute(int);
717extern int ps3av_dev_open(void); 720extern int ps3av_dev_open(void);
718extern int ps3av_dev_close(void); 721extern int ps3av_dev_close(void);
722extern void ps3av_register_flip_ctl(void (*flip_ctl)(int on, void *data),
723 void *flip_data);
724extern void ps3av_flip_ctl(int on);
719 725
720#endif /* _ASM_POWERPC_PS3AV_H_ */ 726#endif /* _ASM_POWERPC_PS3AV_H_ */
diff --git a/include/asm-powerpc/ps3fb.h b/include/asm-powerpc/ps3fb.h
index ad81cf431964..3f121fe4010d 100644
--- a/include/asm-powerpc/ps3fb.h
+++ b/include/asm-powerpc/ps3fb.h
@@ -41,16 +41,4 @@ struct ps3fb_ioctl_res {
41 __u32 num_frames; /* num of frame buffers */ 41 __u32 num_frames; /* num of frame buffers */
42}; 42};
43 43
44#ifdef __KERNEL__
45
46#ifdef CONFIG_FB_PS3
47extern void ps3fb_flip_ctl(int on);
48extern void ps3fb_cleanup(void);
49#else
50static inline void ps3fb_flip_ctl(int on) {}
51static inline void ps3fb_cleanup(void) {}
52#endif
53
54#endif /* __KERNEL__ */
55
56#endif /* _ASM_POWERPC_PS3FB_H_ */ 44#endif /* _ASM_POWERPC_PS3FB_H_ */
diff --git a/include/asm-powerpc/ps3stor.h b/include/asm-powerpc/ps3stor.h
new file mode 100644
index 000000000000..6fcaf714fa50
--- /dev/null
+++ b/include/asm-powerpc/ps3stor.h
@@ -0,0 +1,71 @@
1/*
2 * PS3 Storage Devices
3 *
4 * Copyright (C) 2007 Sony Computer Entertainment Inc.
5 * Copyright 2007 Sony Corp.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License 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 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifndef _ASM_POWERPC_PS3STOR_H_
22#define _ASM_POWERPC_PS3STOR_H_
23
24#include <linux/interrupt.h>
25
26#include <asm/ps3.h>
27
28
29struct ps3_storage_region {
30 unsigned int id;
31 u64 start;
32 u64 size;
33};
34
35struct ps3_storage_device {
36 struct ps3_system_bus_device sbd;
37
38 struct ps3_dma_region dma_region;
39 unsigned int irq;
40 u64 blk_size;
41
42 u64 tag;
43 u64 lv1_status;
44 struct completion done;
45
46 unsigned long bounce_size;
47 void *bounce_buf;
48 u64 bounce_lpar;
49 dma_addr_t bounce_dma;
50
51 unsigned int num_regions;
52 unsigned long accessible_regions;
53 unsigned int region_idx; /* first accessible region */
54 struct ps3_storage_region regions[0]; /* Must be last */
55};
56
57static inline struct ps3_storage_device *to_ps3_storage_device(struct device *dev)
58{
59 return container_of(dev, struct ps3_storage_device, sbd.core);
60}
61
62extern int ps3stor_setup(struct ps3_storage_device *dev,
63 irq_handler_t handler);
64extern void ps3stor_teardown(struct ps3_storage_device *dev);
65extern u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64 lpar,
66 u64 start_sector, u64 sectors,
67 int write);
68extern u64 ps3stor_send_command(struct ps3_storage_device *dev, u64 cmd,
69 u64 arg1, u64 arg2, u64 arg3, u64 arg4);
70
71#endif /* _ASM_POWERPC_PS3STOR_H_ */
diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h
index 4ad77a13f865..13fccc5a4119 100644
--- a/include/asm-powerpc/ptrace.h
+++ b/include/asm-powerpc/ptrace.h
@@ -92,6 +92,11 @@ extern unsigned long profile_pc(struct pt_regs *regs);
92 set_thread_flag(TIF_NOERROR); \ 92 set_thread_flag(TIF_NOERROR); \
93 } while(0) 93 } while(0)
94 94
95struct task_struct;
96extern unsigned long ptrace_get_reg(struct task_struct *task, int regno);
97extern int ptrace_put_reg(struct task_struct *task, int regno,
98 unsigned long data);
99
95/* 100/*
96 * We use the least-significant bit of the trap field to indicate 101 * We use the least-significant bit of the trap field to indicate
97 * whether we have saved the full set of registers, or only a 102 * whether we have saved the full set of registers, or only a
@@ -158,9 +163,7 @@ do { \
158 163
159#define PT_NIP 32 164#define PT_NIP 32
160#define PT_MSR 33 165#define PT_MSR 33
161#ifdef __KERNEL__
162#define PT_ORIG_R3 34 166#define PT_ORIG_R3 34
163#endif
164#define PT_CTR 35 167#define PT_CTR 35
165#define PT_LNK 36 168#define PT_LNK 36
166#define PT_XER 37 169#define PT_XER 37
@@ -169,11 +172,12 @@ do { \
169#define PT_MQ 39 172#define PT_MQ 39
170#else 173#else
171#define PT_SOFTE 39 174#define PT_SOFTE 39
175#endif
172#define PT_TRAP 40 176#define PT_TRAP 40
173#define PT_DAR 41 177#define PT_DAR 41
174#define PT_DSISR 42 178#define PT_DSISR 42
175#define PT_RESULT 43 179#define PT_RESULT 43
176#endif 180#define PT_REGS_COUNT 44
177 181
178#define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */ 182#define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */
179 183
@@ -229,7 +233,17 @@ do { \
229#define PTRACE_GET_DEBUGREG 25 233#define PTRACE_GET_DEBUGREG 25
230#define PTRACE_SET_DEBUGREG 26 234#define PTRACE_SET_DEBUGREG 26
231 235
232/* Additional PTRACE requests implemented on PowerPC. */ 236/* (new) PTRACE requests using the same numbers as x86 and the same
237 * argument ordering. Additionally, they support more registers too
238 */
239#define PTRACE_GETREGS 12
240#define PTRACE_SETREGS 13
241#define PTRACE_GETFPREGS 14
242#define PTRACE_SETFPREGS 15
243#define PTRACE_GETREGS64 22
244#define PTRACE_SETREGS64 23
245
246/* (old) PTRACE requests with inverted arguments */
233#define PPC_PTRACE_GETREGS 0x99 /* Get GPRs 0 - 31 */ 247#define PPC_PTRACE_GETREGS 0x99 /* Get GPRs 0 - 31 */
234#define PPC_PTRACE_SETREGS 0x98 /* Set GPRs 0 - 31 */ 248#define PPC_PTRACE_SETREGS 0x98 /* Set GPRs 0 - 31 */
235#define PPC_PTRACE_GETFPREGS 0x97 /* Get FPRs 0 - 31 */ 249#define PPC_PTRACE_GETFPREGS 0x97 /* Get FPRs 0 - 31 */
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h
index 749c7f953b58..281011e953ec 100644
--- a/include/asm-powerpc/reg.h
+++ b/include/asm-powerpc/reg.h
@@ -453,6 +453,8 @@
453#define SPRN_MMCRA 0x312 453#define SPRN_MMCRA 0x312
454#define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */ 454#define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */
455#define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */ 455#define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */
456#define MMCRA_SLOT 0x07000000UL /* SLOT bits (37-39) */
457#define MMCRA_SLOT_SHIFT 24
456#define MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */ 458#define MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */
457#define POWER6_MMCRA_SIHV 0x0000040000000000ULL 459#define POWER6_MMCRA_SIHV 0x0000040000000000ULL
458#define POWER6_MMCRA_SIPR 0x0000020000000000ULL 460#define POWER6_MMCRA_SIPR 0x0000020000000000ULL
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index 31d5054be20f..8836c0f1f2f7 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -106,6 +106,14 @@ struct spu_context;
106struct spu_runqueue; 106struct spu_runqueue;
107struct device_node; 107struct device_node;
108 108
109enum spu_utilization_state {
110 SPU_UTIL_USER,
111 SPU_UTIL_SYSTEM,
112 SPU_UTIL_IOWAIT,
113 SPU_UTIL_IDLE_LOADED,
114 SPU_UTIL_MAX
115};
116
109struct spu { 117struct spu {
110 const char *name; 118 const char *name;
111 unsigned long local_store_phys; 119 unsigned long local_store_phys;
@@ -113,9 +121,9 @@ struct spu {
113 unsigned long problem_phys; 121 unsigned long problem_phys;
114 struct spu_problem __iomem *problem; 122 struct spu_problem __iomem *problem;
115 struct spu_priv2 __iomem *priv2; 123 struct spu_priv2 __iomem *priv2;
116 struct list_head list; 124 struct list_head cbe_list;
117 struct list_head sched_list;
118 struct list_head full_list; 125 struct list_head full_list;
126 enum { SPU_FREE, SPU_USED } alloc_state;
119 int number; 127 int number;
120 unsigned int irqs[3]; 128 unsigned int irqs[3];
121 u32 node; 129 u32 node;
@@ -129,6 +137,7 @@ struct spu {
129 struct spu_runqueue *rq; 137 struct spu_runqueue *rq;
130 unsigned long long timestamp; 138 unsigned long long timestamp;
131 pid_t pid; 139 pid_t pid;
140 pid_t tgid;
132 int class_0_pending; 141 int class_0_pending;
133 spinlock_t register_lock; 142 spinlock_t register_lock;
134 143
@@ -156,15 +165,49 @@ struct spu {
156 u64 shadow_int_mask_RW[3]; 165 u64 shadow_int_mask_RW[3];
157 166
158 struct sys_device sysdev; 167 struct sys_device sysdev;
168
169 int has_mem_affinity;
170 struct list_head aff_list;
171
172 struct {
173 /* protected by interrupt reentrancy */
174 enum spu_utilization_state util_state;
175 unsigned long long tstamp;
176 unsigned long long times[SPU_UTIL_MAX];
177 unsigned long long vol_ctx_switch;
178 unsigned long long invol_ctx_switch;
179 unsigned long long min_flt;
180 unsigned long long maj_flt;
181 unsigned long long hash_flt;
182 unsigned long long slb_flt;
183 unsigned long long class2_intr;
184 unsigned long long libassist;
185 } stats;
159}; 186};
160 187
161struct spu *spu_alloc(void); 188struct cbe_spu_info {
162struct spu *spu_alloc_node(int node); 189 struct mutex list_mutex;
163void spu_free(struct spu *spu); 190 struct list_head spus;
191 int n_spus;
192 int nr_active;
193 atomic_t reserved_spus;
194};
195
196extern struct cbe_spu_info cbe_spu_info[];
197
198void spu_init_channels(struct spu *spu);
164int spu_irq_class_0_bottom(struct spu *spu); 199int spu_irq_class_0_bottom(struct spu *spu);
165int spu_irq_class_1_bottom(struct spu *spu); 200int spu_irq_class_1_bottom(struct spu *spu);
166void spu_irq_setaffinity(struct spu *spu, int cpu); 201void spu_irq_setaffinity(struct spu *spu, int cpu);
167 202
203#ifdef CONFIG_KEXEC
204void crash_register_spus(struct list_head *list);
205#else
206static inline void crash_register_spus(struct list_head *list)
207{
208}
209#endif
210
168extern void spu_invalidate_slbs(struct spu *spu); 211extern void spu_invalidate_slbs(struct spu *spu);
169extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm); 212extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
170 213
@@ -172,6 +215,20 @@ extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
172struct mm_struct; 215struct mm_struct;
173extern void spu_flush_all_slbs(struct mm_struct *mm); 216extern void spu_flush_all_slbs(struct mm_struct *mm);
174 217
218/* This interface allows a profiler (e.g., OProfile) to store a ref
219 * to spu context information that it creates. This caching technique
220 * avoids the need to recreate this information after a save/restore operation.
221 *
222 * Assumes the caller has already incremented the ref count to
223 * profile_info; then spu_context_destroy must call kref_put
224 * on prof_info_kref.
225 */
226void spu_set_profile_private_kref(struct spu_context *ctx,
227 struct kref *prof_info_kref,
228 void ( * prof_info_release) (struct kref *kref));
229
230void *spu_get_profile_private_kref(struct spu_context *ctx);
231
175/* system callbacks from the SPU */ 232/* system callbacks from the SPU */
176struct spu_syscall_block { 233struct spu_syscall_block {
177 u64 nr_ret; 234 u64 nr_ret;
@@ -183,7 +240,8 @@ extern long spu_sys_callback(struct spu_syscall_block *s);
183struct file; 240struct file;
184extern struct spufs_calls { 241extern struct spufs_calls {
185 asmlinkage long (*create_thread)(const char __user *name, 242 asmlinkage long (*create_thread)(const char __user *name,
186 unsigned int flags, mode_t mode); 243 unsigned int flags, mode_t mode,
244 struct file *neighbor);
187 asmlinkage long (*spu_run)(struct file *filp, __u32 __user *unpc, 245 asmlinkage long (*spu_run)(struct file *filp, __u32 __user *unpc,
188 __u32 __user *ustatus); 246 __u32 __user *ustatus);
189 struct module *owner; 247 struct module *owner;
@@ -210,8 +268,10 @@ struct spu_coredump_calls {
210#define SPU_CREATE_GANG 0x0002 268#define SPU_CREATE_GANG 0x0002
211#define SPU_CREATE_NOSCHED 0x0004 269#define SPU_CREATE_NOSCHED 0x0004
212#define SPU_CREATE_ISOLATE 0x0008 270#define SPU_CREATE_ISOLATE 0x0008
271#define SPU_CREATE_AFFINITY_SPU 0x0010
272#define SPU_CREATE_AFFINITY_MEM 0x0020
213 273
214#define SPU_CREATE_FLAG_ALL 0x000f /* mask of all valid flags */ 274#define SPU_CREATE_FLAG_ALL 0x003f /* mask of all valid flags */
215 275
216 276
217#ifdef CONFIG_SPU_FS_MODULE 277#ifdef CONFIG_SPU_FS_MODULE
@@ -380,6 +440,7 @@ struct spu_priv2 {
380#define MFC_CNTL_RESUME_DMA_QUEUE (0ull << 0) 440#define MFC_CNTL_RESUME_DMA_QUEUE (0ull << 0)
381#define MFC_CNTL_SUSPEND_DMA_QUEUE (1ull << 0) 441#define MFC_CNTL_SUSPEND_DMA_QUEUE (1ull << 0)
382#define MFC_CNTL_SUSPEND_DMA_QUEUE_MASK (1ull << 0) 442#define MFC_CNTL_SUSPEND_DMA_QUEUE_MASK (1ull << 0)
443#define MFC_CNTL_SUSPEND_MASK (1ull << 4)
383#define MFC_CNTL_NORMAL_DMA_QUEUE_OPERATION (0ull << 8) 444#define MFC_CNTL_NORMAL_DMA_QUEUE_OPERATION (0ull << 8)
384#define MFC_CNTL_SUSPEND_IN_PROGRESS (1ull << 8) 445#define MFC_CNTL_SUSPEND_IN_PROGRESS (1ull << 8)
385#define MFC_CNTL_SUSPEND_COMPLETE (3ull << 8) 446#define MFC_CNTL_SUSPEND_COMPLETE (3ull << 8)
@@ -448,6 +509,7 @@ struct spu_priv1 {
448#define MFC_STATE1_PROBLEM_STATE_MASK 0x08ull 509#define MFC_STATE1_PROBLEM_STATE_MASK 0x08ull
449#define MFC_STATE1_RELOCATE_MASK 0x10ull 510#define MFC_STATE1_RELOCATE_MASK 0x10ull
450#define MFC_STATE1_MASTER_RUN_CONTROL_MASK 0x20ull 511#define MFC_STATE1_MASTER_RUN_CONTROL_MASK 0x20ull
512#define MFC_STATE1_TABLE_SEARCH_MASK 0x40ull
451 u64 mfc_lpid_RW; /* 0x008 */ 513 u64 mfc_lpid_RW; /* 0x008 */
452 u64 spu_idr_RW; /* 0x010 */ 514 u64 spu_idr_RW; /* 0x010 */
453 u64 mfc_vr_RO; /* 0x018 */ 515 u64 mfc_vr_RO; /* 0x018 */
diff --git a/include/asm-powerpc/spu_csa.h b/include/asm-powerpc/spu_csa.h
index c48ae185c874..e87794d5d4ea 100644
--- a/include/asm-powerpc/spu_csa.h
+++ b/include/asm-powerpc/spu_csa.h
@@ -50,6 +50,12 @@
50#define SPU_STOPPED_STATUS_P_I 8 50#define SPU_STOPPED_STATUS_P_I 8
51#define SPU_STOPPED_STATUS_R 9 51#define SPU_STOPPED_STATUS_R 9
52 52
53/*
54 * Definitions for software decrementer status flag.
55 */
56#define SPU_DECR_STATUS_RUNNING 0x1
57#define SPU_DECR_STATUS_WRAPPED 0x2
58
53#ifndef __ASSEMBLY__ 59#ifndef __ASSEMBLY__
54/** 60/**
55 * spu_reg128 - generic 128-bit register definition. 61 * spu_reg128 - generic 128-bit register definition.
@@ -63,7 +69,7 @@ struct spu_reg128 {
63 * @gprs: Array of saved registers. 69 * @gprs: Array of saved registers.
64 * @fpcr: Saved floating point status control register. 70 * @fpcr: Saved floating point status control register.
65 * @decr: Saved decrementer value. 71 * @decr: Saved decrementer value.
66 * @decr_status: Indicates decrementer run status. 72 * @decr_status: Indicates software decrementer status flags.
67 * @ppu_mb: Saved PPU mailbox data. 73 * @ppu_mb: Saved PPU mailbox data.
68 * @ppuint_mb: Saved PPU interrupting mailbox data. 74 * @ppuint_mb: Saved PPU interrupting mailbox data.
69 * @tag_mask: Saved tag group mask. 75 * @tag_mask: Saved tag group mask.
diff --git a/include/asm-powerpc/syscalls.h b/include/asm-powerpc/syscalls.h
index c2fe79d4f90f..b3ca41fc8bb1 100644
--- a/include/asm-powerpc/syscalls.h
+++ b/include/asm-powerpc/syscalls.h
@@ -43,16 +43,9 @@ asmlinkage long ppc_newuname(struct new_utsname __user * name);
43 43
44asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, 44asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset,
45 size_t sigsetsize); 45 size_t sigsetsize);
46
47#ifndef __powerpc64__
48asmlinkage long sys_sigaltstack(const stack_t __user *uss,
49 stack_t __user *uoss, int r5, int r6, int r7, int r8,
50 struct pt_regs *regs);
51#else /* __powerpc64__ */
52asmlinkage long sys_sigaltstack(const stack_t __user *uss, 46asmlinkage long sys_sigaltstack(const stack_t __user *uss,
53 stack_t __user *uoss, unsigned long r5, unsigned long r6, 47 stack_t __user *uoss, unsigned long r5, unsigned long r6,
54 unsigned long r7, unsigned long r8, struct pt_regs *regs); 48 unsigned long r7, unsigned long r8, struct pt_regs *regs);
55#endif /* __powerpc64__ */
56 49
57#endif /* __KERNEL__ */ 50#endif /* __KERNEL__ */
58#endif /* __ASM_POWERPC_SYSCALLS_H */ 51#endif /* __ASM_POWERPC_SYSCALLS_H */
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h
index 700ca5928741..cc6d87228258 100644
--- a/include/asm-powerpc/systbl.h
+++ b/include/asm-powerpc/systbl.h
@@ -308,6 +308,8 @@ COMPAT_SYS_SPU(move_pages)
308SYSCALL_SPU(getcpu) 308SYSCALL_SPU(getcpu)
309COMPAT_SYS(epoll_pwait) 309COMPAT_SYS(epoll_pwait)
310COMPAT_SYS_SPU(utimensat) 310COMPAT_SYS_SPU(utimensat)
311COMPAT_SYS(fallocate)
311COMPAT_SYS_SPU(signalfd) 312COMPAT_SYS_SPU(signalfd)
312COMPAT_SYS_SPU(timerfd) 313COMPAT_SYS_SPU(timerfd)
313SYSCALL_SPU(eventfd) 314SYSCALL_SPU(eventfd)
315COMPAT_SYS_SPU(sync_file_range2)
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 09621f611dbc..41520b7a7b76 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -43,7 +43,7 @@
43#ifdef CONFIG_SMP 43#ifdef CONFIG_SMP
44#define smp_mb() mb() 44#define smp_mb() mb()
45#define smp_rmb() rmb() 45#define smp_rmb() rmb()
46#define smp_wmb() __asm__ __volatile__ ("eieio" : : : "memory") 46#define smp_wmb() eieio()
47#define smp_read_barrier_depends() read_barrier_depends() 47#define smp_read_barrier_depends() read_barrier_depends()
48#else 48#else
49#define smp_mb() barrier() 49#define smp_mb() barrier()
@@ -184,16 +184,6 @@ struct thread_struct;
184extern struct task_struct *_switch(struct thread_struct *prev, 184extern struct task_struct *_switch(struct thread_struct *prev,
185 struct thread_struct *next); 185 struct thread_struct *next);
186 186
187/*
188 * On SMP systems, when the scheduler does migration-cost autodetection,
189 * it needs a way to flush as much of the CPU's caches as possible.
190 *
191 * TODO: fill this in!
192 */
193static inline void sched_cacheflush(void)
194{
195}
196
197extern unsigned int rtas_data; 187extern unsigned int rtas_data;
198extern int mem_init_done; /* set on boot once kmalloc can be called */ 188extern int mem_init_done; /* set on boot once kmalloc can be called */
199extern unsigned long memory_limit; 189extern unsigned long memory_limit;
@@ -559,5 +549,7 @@ static inline void create_function_call(unsigned long addr, void * func)
559extern void account_system_vtime(struct task_struct *); 549extern void account_system_vtime(struct task_struct *);
560#endif 550#endif
561 551
552extern struct dentry *powerpc_debugfs_root;
553
562#endif /* __KERNEL__ */ 554#endif /* __KERNEL__ */
563#endif /* _ASM_POWERPC_SYSTEM_H */ 555#endif /* _ASM_POWERPC_SYSTEM_H */
diff --git a/include/asm-powerpc/termbits.h b/include/asm-powerpc/termbits.h
index 5e79198f7d18..6698188ca550 100644
--- a/include/asm-powerpc/termbits.h
+++ b/include/asm-powerpc/termbits.h
@@ -152,6 +152,10 @@ struct ktermios {
152#define B3000000 00034 152#define B3000000 00034
153#define B3500000 00035 153#define B3500000 00035
154#define B4000000 00036 154#define B4000000 00036
155#define BOTHER 00037
156
157#define CIBAUD 077600000
158#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
155 159
156#define CSIZE 00001400 160#define CSIZE 00001400
157#define CS5 00000000 161#define CS5 00000000
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h
index 3f32ca8bfec9..9d9aeca8ad22 100644
--- a/include/asm-powerpc/thread_info.h
+++ b/include/asm-powerpc/thread_info.h
@@ -113,8 +113,8 @@ static inline struct thread_info *current_thread_info(void)
113#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling 113#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
114 TIF_NEED_RESCHED */ 114 TIF_NEED_RESCHED */
115#define TIF_32BIT 5 /* 32 bit binary */ 115#define TIF_32BIT 5 /* 32 bit binary */
116#define TIF_RUNLATCH 6 /* Is the runlatch enabled? */ 116#define TIF_PERFMON_WORK 6 /* work for pfm_handle_work() */
117#define TIF_ABI_PENDING 7 /* 32/64 bit switch needed */ 117#define TIF_PERFMON_CTXSW 7 /* perfmon needs ctxsw calls */
118#define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */ 118#define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */
119#define TIF_SINGLESTEP 9 /* singlestepping active */ 119#define TIF_SINGLESTEP 9 /* singlestepping active */
120#define TIF_MEMDIE 10 120#define TIF_MEMDIE 10
@@ -123,6 +123,8 @@ static inline struct thread_info *current_thread_info(void)
123#define TIF_NOERROR 14 /* Force successful syscall return */ 123#define TIF_NOERROR 14 /* Force successful syscall return */
124#define TIF_RESTORE_SIGMASK 15 /* Restore signal mask in do_signal */ 124#define TIF_RESTORE_SIGMASK 15 /* Restore signal mask in do_signal */
125#define TIF_FREEZE 16 /* Freezing for suspend */ 125#define TIF_FREEZE 16 /* Freezing for suspend */
126#define TIF_RUNLATCH 17 /* Is the runlatch enabled? */
127#define TIF_ABI_PENDING 18 /* 32/64 bit switch needed */
126 128
127/* as above, but as bit values */ 129/* as above, but as bit values */
128#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 130#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -131,8 +133,8 @@ static inline struct thread_info *current_thread_info(void)
131#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 133#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
132#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 134#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
133#define _TIF_32BIT (1<<TIF_32BIT) 135#define _TIF_32BIT (1<<TIF_32BIT)
134#define _TIF_RUNLATCH (1<<TIF_RUNLATCH) 136#define _TIF_PERFMON_WORK (1<<TIF_PERFMON_WORK)
135#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) 137#define _TIF_PERFMON_CTXSW (1<<TIF_PERFMON_CTXSW)
136#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 138#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
137#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) 139#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
138#define _TIF_SECCOMP (1<<TIF_SECCOMP) 140#define _TIF_SECCOMP (1<<TIF_SECCOMP)
@@ -140,6 +142,8 @@ static inline struct thread_info *current_thread_info(void)
140#define _TIF_NOERROR (1<<TIF_NOERROR) 142#define _TIF_NOERROR (1<<TIF_NOERROR)
141#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 143#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
142#define _TIF_FREEZE (1<<TIF_FREEZE) 144#define _TIF_FREEZE (1<<TIF_FREEZE)
145#define _TIF_RUNLATCH (1<<TIF_RUNLATCH)
146#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
143#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) 147#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP)
144 148
145#define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ 149#define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index 3fd57c048f59..d7f5ddfbaac7 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -232,7 +232,7 @@ extern void account_process_vtime(struct task_struct *tsk);
232#define account_process_vtime(tsk) do { } while (0) 232#define account_process_vtime(tsk) do { } while (0)
233#endif 233#endif
234 234
235#if defined(CONFIG_VIRT_CPU_ACCOUNTING) && defined(CONFIG_PPC_SPLPAR) 235#if defined(CONFIG_VIRT_CPU_ACCOUNTING)
236extern void calculate_steal_time(void); 236extern void calculate_steal_time(void);
237extern void snapshot_timebases(void); 237extern void snapshot_timebases(void);
238#else 238#else
@@ -240,5 +240,7 @@ extern void snapshot_timebases(void);
240#define snapshot_timebases() do { } while (0) 240#define snapshot_timebases() do { } while (0)
241#endif 241#endif
242 242
243extern void iSeries_time_init_early(void);
244
243#endif /* __KERNEL__ */ 245#endif /* __KERNEL__ */
244#endif /* __POWERPC_TIME_H */ 246#endif /* __POWERPC_TIME_H */
diff --git a/include/asm-powerpc/tlb.h b/include/asm-powerpc/tlb.h
index 0a17682663d8..66714042e438 100644
--- a/include/asm-powerpc/tlb.h
+++ b/include/asm-powerpc/tlb.h
@@ -38,6 +38,15 @@ extern void pte_free_finish(void);
38 38
39static inline void tlb_flush(struct mmu_gather *tlb) 39static inline void tlb_flush(struct mmu_gather *tlb)
40{ 40{
41 struct ppc64_tlb_batch *tlbbatch = &__get_cpu_var(ppc64_tlb_batch);
42
43 /* If there's a TLB batch pending, then we must flush it because the
44 * pages are going to be freed and we really don't want to have a CPU
45 * access a freed page because it has a stale TLB
46 */
47 if (tlbbatch->index)
48 __flush_tlb_pending(tlbbatch);
49
41 pte_free_finish(); 50 pte_free_finish();
42} 51}
43 52
diff --git a/include/asm-powerpc/tlbflush.h b/include/asm-powerpc/tlbflush.h
index 86e6266a028b..99a0439baa50 100644
--- a/include/asm-powerpc/tlbflush.h
+++ b/include/asm-powerpc/tlbflush.h
@@ -155,6 +155,11 @@ static inline void flush_tlb_kernel_range(unsigned long start,
155{ 155{
156} 156}
157 157
158/* Private function for use by PCI IO mapping code */
159extern void __flush_hash_table_range(struct mm_struct *mm, unsigned long start,
160 unsigned long end);
161
162
158#endif 163#endif
159 164
160/* 165/*
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index e3c28dc31abf..97d82b6a9406 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -330,10 +330,12 @@
330#define __NR_signalfd 305 330#define __NR_signalfd 305
331#define __NR_timerfd 306 331#define __NR_timerfd 306
332#define __NR_eventfd 307 332#define __NR_eventfd 307
333#define __NR_sync_file_range2 308
334#define __NR_fallocate 309
333 335
334#ifdef __KERNEL__ 336#ifdef __KERNEL__
335 337
336#define __NR_syscalls 308 338#define __NR_syscalls 310
337 339
338#define __NR__exit __NR_exit 340#define __NR__exit __NR_exit
339#define NR_syscalls __NR_syscalls 341#define NR_syscalls __NR_syscalls
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
index 9d162028dab9..d2442cd72a59 100644
--- a/include/asm-ppc/pci.h
+++ b/include/asm-ppc/pci.h
@@ -102,12 +102,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
102} 102}
103#endif 103#endif
104 104
105/*
106 * At present there are very few 32-bit PPC machines that can have
107 * memory above the 4GB point, and we don't support that.
108 */
109#define pci_dac_dma_supported(pci_dev, mask) (0)
110
111/* Return the index of the PCI controller for device PDEV. */ 105/* Return the index of the PCI controller for device PDEV. */
112#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index 106#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
113 107
@@ -145,8 +139,6 @@ pcibios_select_root(struct pci_dev *pdev, struct resource *res)
145 return root; 139 return root;
146} 140}
147 141
148extern void pcibios_add_platform_entries(struct pci_dev *dev);
149
150struct file; 142struct file;
151extern pgprot_t pci_phys_mem_access_prot(struct file *file, 143extern pgprot_t pci_phys_mem_access_prot(struct file *file,
152 unsigned long pfn, 144 unsigned long pfn,
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index bed452d4a5f0..c159315d2c8f 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -533,9 +533,7 @@ static inline int pgd_present(pgd_t pgd) { return 1; }
533 * The following only work if pte_present() is true. 533 * The following only work if pte_present() is true.
534 * Undefined behaviour if not.. 534 * Undefined behaviour if not..
535 */ 535 */
536static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
537static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } 536static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
538static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; }
539static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } 537static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
540static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 538static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
541static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 539static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
@@ -543,21 +541,13 @@ static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
543static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } 541static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; }
544static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } 542static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; }
545 543
546static inline pte_t pte_rdprotect(pte_t pte) {
547 pte_val(pte) &= ~_PAGE_USER; return pte; }
548static inline pte_t pte_wrprotect(pte_t pte) { 544static inline pte_t pte_wrprotect(pte_t pte) {
549 pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; } 545 pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; }
550static inline pte_t pte_exprotect(pte_t pte) {
551 pte_val(pte) &= ~_PAGE_EXEC; return pte; }
552static inline pte_t pte_mkclean(pte_t pte) { 546static inline pte_t pte_mkclean(pte_t pte) {
553 pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; } 547 pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; }
554static inline pte_t pte_mkold(pte_t pte) { 548static inline pte_t pte_mkold(pte_t pte) {
555 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } 549 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
556 550
557static inline pte_t pte_mkread(pte_t pte) {
558 pte_val(pte) |= _PAGE_USER; return pte; }
559static inline pte_t pte_mkexec(pte_t pte) {
560 pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; }
561static inline pte_t pte_mkwrite(pte_t pte) { 551static inline pte_t pte_mkwrite(pte_t pte) {
562 pte_val(pte) |= _PAGE_RW; return pte; } 552 pte_val(pte) |= _PAGE_RW; return pte; }
563static inline pte_t pte_mkdirty(pte_t pte) { 553static inline pte_t pte_mkdirty(pte_t pte) {
@@ -664,13 +654,6 @@ static inline int __ptep_test_and_clear_young(unsigned int context, unsigned lon
664#define ptep_test_and_clear_young(__vma, __addr, __ptep) \ 654#define ptep_test_and_clear_young(__vma, __addr, __ptep) \
665 __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep) 655 __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep)
666 656
667#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
668static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma,
669 unsigned long addr, pte_t *ptep)
670{
671 return (pte_update(ptep, (_PAGE_DIRTY | _PAGE_HWWRITE), 0) & _PAGE_DIRTY) != 0;
672}
673
674#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 657#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
675static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, 658static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
676 pte_t *ptep) 659 pte_t *ptep)
@@ -694,10 +677,14 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
694} 677}
695 678
696#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ 679#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
697 do { \ 680({ \
698 __ptep_set_access_flags(__ptep, __entry, __dirty); \ 681 int __changed = !pte_same(*(__ptep), __entry); \
699 flush_tlb_page_nohash(__vma, __address); \ 682 if (__changed) { \
700 } while(0) 683 __ptep_set_access_flags(__ptep, __entry, __dirty); \
684 flush_tlb_page_nohash(__vma, __address); \
685 } \
686 __changed; \
687})
701 688
702/* 689/*
703 * Macro to mark a page protection value as "uncacheable". 690 * Macro to mark a page protection value as "uncacheable".
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index d84a3cf4d033..f1311a8f310f 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -129,16 +129,6 @@ extern struct task_struct *__switch_to(struct task_struct *,
129 struct task_struct *); 129 struct task_struct *);
130#define switch_to(prev, next, last) ((last) = __switch_to((prev), (next))) 130#define switch_to(prev, next, last) ((last) = __switch_to((prev), (next)))
131 131
132/*
133 * On SMP systems, when the scheduler does migration-cost autodetection,
134 * it needs a way to flush as much of the CPU's caches as possible.
135 *
136 * TODO: fill this in!
137 */
138static inline void sched_cacheflush(void)
139{
140}
141
142struct thread_struct; 132struct thread_struct;
143extern struct task_struct *_switch(struct thread_struct *prev, 133extern struct task_struct *_switch(struct thread_struct *prev,
144 struct thread_struct *next); 134 struct thread_struct *next);
diff --git a/include/asm-s390/a.out.h b/include/asm-s390/a.out.h
index 72adee6ef338..46158dcaf517 100644
--- a/include/asm-s390/a.out.h
+++ b/include/asm-s390/a.out.h
@@ -32,6 +32,7 @@ struct exec
32#ifdef __KERNEL__ 32#ifdef __KERNEL__
33 33
34#define STACK_TOP TASK_SIZE 34#define STACK_TOP TASK_SIZE
35#define STACK_TOP_MAX DEFAULT_TASK_SIZE
35 36
36#endif 37#endif
37 38
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h
index c17bdbf22067..ea486952f778 100644
--- a/include/asm-s390/atomic.h
+++ b/include/asm-s390/atomic.h
@@ -24,7 +24,7 @@
24 */ 24 */
25 25
26typedef struct { 26typedef struct {
27 volatile int counter; 27 int counter;
28} __attribute__ ((aligned (4))) atomic_t; 28} __attribute__ ((aligned (4))) atomic_t;
29#define ATOMIC_INIT(i) { (i) } 29#define ATOMIC_INIT(i) { (i) }
30 30
@@ -141,7 +141,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
141 141
142#ifdef __s390x__ 142#ifdef __s390x__
143typedef struct { 143typedef struct {
144 volatile long long counter; 144 long long counter;
145} __attribute__ ((aligned (8))) atomic64_t; 145} __attribute__ ((aligned (8))) atomic64_t;
146#define ATOMIC64_INIT(i) { (i) } 146#define ATOMIC64_INIT(i) { (i) }
147 147
diff --git a/include/asm-s390/cmb.h b/include/asm-s390/cmb.h
index 241756f80df3..021e7c3223ec 100644
--- a/include/asm-s390/cmb.h
+++ b/include/asm-s390/cmb.h
@@ -88,7 +88,6 @@ extern u64 cmf_read(struct ccw_device *cdev, int index);
88 * any 88 * any
89 **/ 89 **/
90extern int cmf_readall(struct ccw_device *cdev, struct cmbdata*data); 90extern int cmf_readall(struct ccw_device *cdev, struct cmbdata*data);
91extern void cmf_reset(struct ccw_device *cdev);
92 91
93#endif /* __KERNEL__ */ 92#endif /* __KERNEL__ */
94#endif /* S390_CMB_H */ 93#endif /* S390_CMB_H */
diff --git a/include/asm-s390/compat.h b/include/asm-s390/compat.h
index 296f4f1a20e1..7f4ad623f7d5 100644
--- a/include/asm-s390/compat.h
+++ b/include/asm-s390/compat.h
@@ -60,8 +60,10 @@ typedef s32 compat_timer_t;
60 60
61typedef s32 compat_int_t; 61typedef s32 compat_int_t;
62typedef s32 compat_long_t; 62typedef s32 compat_long_t;
63typedef s64 compat_s64;
63typedef u32 compat_uint_t; 64typedef u32 compat_uint_t;
64typedef u32 compat_ulong_t; 65typedef u32 compat_ulong_t;
66typedef u64 compat_u64;
65 67
66struct compat_timespec { 68struct compat_timespec {
67 compat_time_t tv_sec; 69 compat_time_t tv_sec;
diff --git a/include/asm-s390/dma-mapping.h b/include/asm-s390/dma-mapping.h
deleted file mode 100644
index 3f8c12fde0f0..000000000000
--- a/include/asm-s390/dma-mapping.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 * include/asm-s390/dma-mapping.h
3 *
4 * S390 version
5 *
6 * This file exists so that #include <dma-mapping.h> doesn't break anything.
7 */
8
9#ifndef _ASM_DMA_MAPPING_H
10#define _ASM_DMA_MAPPING_H
11
12#endif /* _ASM_DMA_MAPPING_H */
diff --git a/include/asm-s390/fb.h b/include/asm-s390/fb.h
new file mode 100644
index 000000000000..c7df38030992
--- /dev/null
+++ b/include/asm-s390/fb.h
@@ -0,0 +1,12 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/include/asm-s390/kprobes.h b/include/asm-s390/kprobes.h
index 830fe4c4eea6..340ba10446ea 100644
--- a/include/asm-s390/kprobes.h
+++ b/include/asm-s390/kprobes.h
@@ -46,8 +46,6 @@ typedef u16 kprobe_opcode_t;
46 ? (MAX_STACK_SIZE) \ 46 ? (MAX_STACK_SIZE) \
47 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 47 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
48 48
49#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)(pentry)
50
51#define ARCH_SUPPORTS_KRETPROBES 49#define ARCH_SUPPORTS_KRETPROBES
52#define ARCH_INACTIVE_KPROBE_COUNT 0 50#define ARCH_INACTIVE_KPROBE_COUNT 0
53 51
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h
index 05ea6f172786..f326451ed6ec 100644
--- a/include/asm-s390/page.h
+++ b/include/asm-s390/page.h
@@ -64,7 +64,8 @@ static inline void copy_page(void *to, void *from)
64#define clear_user_page(page, vaddr, pg) clear_page(page) 64#define clear_user_page(page, vaddr, pg) clear_page(page)
65#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 65#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
66 66
67#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) 67#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
68 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
68#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 69#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
69 70
70/* 71/*
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h
index 9ea7f1023e57..545857e64443 100644
--- a/include/asm-s390/percpu.h
+++ b/include/asm-s390/percpu.h
@@ -41,6 +41,11 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
41 __attribute__((__section__(".data.percpu"))) \ 41 __attribute__((__section__(".data.percpu"))) \
42 __typeof__(type) per_cpu__##name 42 __typeof__(type) per_cpu__##name
43 43
44#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
45 __attribute__((__section__(".data.percpu.shared_aligned"))) \
46 __typeof__(type) per_cpu__##name \
47 ____cacheline_aligned_in_smp
48
44#define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) 49#define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
45#define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) 50#define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
46#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) 51#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu])
@@ -59,6 +64,8 @@ do { \
59 64
60#define DEFINE_PER_CPU(type, name) \ 65#define DEFINE_PER_CPU(type, name) \
61 __typeof__(type) per_cpu__##name 66 __typeof__(type) per_cpu__##name
67#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
68 DEFINE_PER_CPU(type, name)
62 69
63#define __get_cpu_var(var) __reloc_hide(var,0) 70#define __get_cpu_var(var) __reloc_hide(var,0)
64#define __raw_get_cpu_var(var) __reloc_hide(var,0) 71#define __raw_get_cpu_var(var) __reloc_hide(var,0)
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index 8fe8d42e64c3..3208dc6c412c 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -530,14 +530,6 @@ static inline int pte_young(pte_t pte)
530 return 0; 530 return 0;
531} 531}
532 532
533static inline int pte_read(pte_t pte)
534{
535 /* All pages are readable since we don't use the fetch
536 * protection bit in the storage key.
537 */
538 return 1;
539}
540
541/* 533/*
542 * pgd/pmd/pte modification functions 534 * pgd/pmd/pte modification functions
543 */ 535 */
@@ -677,19 +669,6 @@ ptep_clear_flush_young(struct vm_area_struct *vma,
677 return ptep_test_and_clear_young(vma, address, ptep); 669 return ptep_test_and_clear_young(vma, address, ptep);
678} 670}
679 671
680static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
681{
682 return 0;
683}
684
685static inline int
686ptep_clear_flush_dirty(struct vm_area_struct *vma,
687 unsigned long address, pte_t *ptep)
688{
689 /* No need to flush TLB; bits are in storage key */
690 return ptep_test_and_clear_dirty(vma, address, ptep);
691}
692
693static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 672static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
694{ 673{
695 pte_t pte = *ptep; 674 pte_t pte = *ptep;
@@ -715,16 +694,19 @@ static inline void __ptep_ipte(unsigned long address, pte_t *ptep)
715 pte_val(*ptep) = _PAGE_TYPE_EMPTY; 694 pte_val(*ptep) = _PAGE_TYPE_EMPTY;
716} 695}
717 696
718static inline pte_t 697static inline void ptep_invalidate(unsigned long address, pte_t *ptep)
719ptep_clear_flush(struct vm_area_struct *vma,
720 unsigned long address, pte_t *ptep)
721{ 698{
722 pte_t pte = *ptep;
723 pte_t *shadow_pte = get_shadow_pte(ptep);
724
725 __ptep_ipte(address, ptep); 699 __ptep_ipte(address, ptep);
726 if (shadow_pte) 700 ptep = get_shadow_pte(ptep);
727 __ptep_ipte(address, shadow_pte); 701 if (ptep)
702 __ptep_ipte(address, ptep);
703}
704
705static inline pte_t ptep_clear_flush(struct vm_area_struct *vma,
706 unsigned long address, pte_t *ptep)
707{
708 pte_t pte = *ptep;
709 ptep_invalidate(address, ptep);
728 return pte; 710 return pte;
729} 711}
730 712
@@ -734,17 +716,15 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
734 set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); 716 set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
735} 717}
736 718
737static inline void 719#define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __dirty) \
738ptep_establish(struct vm_area_struct *vma, 720({ \
739 unsigned long address, pte_t *ptep, 721 int __changed = !pte_same(*(__ptep), __entry); \
740 pte_t entry) 722 if (__changed) { \
741{ 723 ptep_invalidate(__addr, __ptep); \
742 ptep_clear_flush(vma, address, ptep); 724 set_pte_at((__vma)->vm_mm, __addr, __ptep, __entry); \
743 set_pte(ptep, entry); 725 } \
744} 726 __changed; \
745 727})
746#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
747 ptep_establish(__vma, __address, __ptep, __entry)
748 728
749/* 729/*
750 * Test and clear dirty bit in storage key. 730 * Test and clear dirty bit in storage key.
@@ -943,12 +923,9 @@ extern int remove_shared_memory(unsigned long start, unsigned long size);
943#define __HAVE_ARCH_MEMMAP_INIT 923#define __HAVE_ARCH_MEMMAP_INIT
944extern void memmap_init(unsigned long, int, unsigned long, unsigned long); 924extern void memmap_init(unsigned long, int, unsigned long, unsigned long);
945 925
946#define __HAVE_ARCH_PTEP_ESTABLISH
947#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 926#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
948#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 927#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
949#define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH 928#define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
950#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
951#define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
952#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 929#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
953#define __HAVE_ARCH_PTEP_CLEAR_FLUSH 930#define __HAVE_ARCH_PTEP_CLEAR_FLUSH
954#define __HAVE_ARCH_PTEP_SET_WRPROTECT 931#define __HAVE_ARCH_PTEP_SET_WRPROTECT
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index e0fcea8c64c3..3b972d4c6b29 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -216,6 +216,11 @@ static inline void cpu_relax(void)
216 barrier(); 216 barrier();
217} 217}
218 218
219static inline void psw_set_key(unsigned int key)
220{
221 asm volatile("spka 0(%0)" : : "d" (key));
222}
223
219/* 224/*
220 * Set PSW to specified value. 225 * Set PSW to specified value.
221 */ 226 */
@@ -352,8 +357,8 @@ extern void (*s390_base_ext_handler_fn)(void);
352/* 357/*
353 * CPU idle notifier chain. 358 * CPU idle notifier chain.
354 */ 359 */
355#define CPU_IDLE 0 360#define S390_CPU_IDLE 0
356#define CPU_NOT_IDLE 1 361#define S390_CPU_NOT_IDLE 1
357 362
358struct notifier_block; 363struct notifier_block;
359int register_idle_notifier(struct notifier_block *nb); 364int register_idle_notifier(struct notifier_block *nb);
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
index fa6ca87080e8..332ee73688fc 100644
--- a/include/asm-s390/ptrace.h
+++ b/include/asm-s390/ptrace.h
@@ -470,14 +470,7 @@ struct user_regs_struct
470#define regs_return_value(regs)((regs)->gprs[2]) 470#define regs_return_value(regs)((regs)->gprs[2])
471#define profile_pc(regs) instruction_pointer(regs) 471#define profile_pc(regs) instruction_pointer(regs)
472extern void show_regs(struct pt_regs * regs); 472extern void show_regs(struct pt_regs * regs);
473#endif 473#endif /* __KERNEL__ */
474
475static inline void
476psw_set_key(unsigned int key)
477{
478 asm volatile("spka 0(%0)" : : "d" (key));
479}
480
481#endif /* __ASSEMBLY__ */ 474#endif /* __ASSEMBLY__ */
482 475
483#endif /* _S390_PTRACE_H */ 476#endif /* _S390_PTRACE_H */
diff --git a/include/asm-s390/sclp.h b/include/asm-s390/sclp.h
index 21ed64773210..cb9faf1ea5cf 100644
--- a/include/asm-s390/sclp.h
+++ b/include/asm-s390/sclp.h
@@ -11,29 +11,6 @@
11#include <linux/types.h> 11#include <linux/types.h>
12#include <asm/chpid.h> 12#include <asm/chpid.h>
13 13
14struct sccb_header {
15 u16 length;
16 u8 function_code;
17 u8 control_mask[3];
18 u16 response_code;
19} __attribute__((packed));
20
21#define LOADPARM_LEN 8
22
23struct sclp_readinfo_sccb {
24 struct sccb_header header; /* 0-7 */
25 u16 rnmax; /* 8-9 */
26 u8 rnsize; /* 10 */
27 u8 _reserved0[24 - 11]; /* 11-23 */
28 u8 loadparm[LOADPARM_LEN]; /* 24-31 */
29 u8 _reserved1[91 - 32]; /* 32-90 */
30 u8 flags; /* 91 */
31 u8 _reserved2[100 - 92]; /* 92-99 */
32 u32 rnsize2; /* 100-103 */
33 u64 rnmax2; /* 104-111 */
34 u8 _reserved3[4096 - 112]; /* 112-4095 */
35} __attribute__((packed, aligned(4096)));
36
37#define SCLP_CHP_INFO_MASK_SIZE 32 14#define SCLP_CHP_INFO_MASK_SIZE 32
38 15
39struct sclp_chp_info { 16struct sclp_chp_info {
@@ -42,12 +19,22 @@ struct sclp_chp_info {
42 u8 configured[SCLP_CHP_INFO_MASK_SIZE]; 19 u8 configured[SCLP_CHP_INFO_MASK_SIZE];
43}; 20};
44 21
45extern struct sclp_readinfo_sccb s390_readinfo_sccb; 22#define LOADPARM_LEN 8
46extern void sclp_readinfo_early(void); 23
47extern int sclp_sdias_blk_count(void); 24struct sclp_ipl_info {
48extern int sclp_sdias_copy(void *dest, int blk_num, int nr_blks); 25 int is_valid;
49extern int sclp_chp_configure(struct chp_id chpid); 26 int has_dump;
50extern int sclp_chp_deconfigure(struct chp_id chpid); 27 char loadparm[LOADPARM_LEN];
51extern int sclp_chp_read_info(struct sclp_chp_info *info); 28};
29
30void sclp_readinfo_early(void);
31void sclp_facilities_detect(void);
32unsigned long long sclp_memory_detect(void);
33int sclp_sdias_blk_count(void);
34int sclp_sdias_copy(void *dest, int blk_num, int nr_blks);
35int sclp_chp_configure(struct chp_id chpid);
36int sclp_chp_deconfigure(struct chp_id chpid);
37int sclp_chp_read_info(struct sclp_chp_info *info);
38void sclp_get_ipl_info(struct sclp_ipl_info *info);
52 39
53#endif /* _ASM_S390_SCLP_H */ 40#endif /* _ASM_S390_SCLP_H */
diff --git a/include/asm-s390/sfp-machine.h b/include/asm-s390/sfp-machine.h
index 8ca8c77b2d04..4e16aede4b06 100644
--- a/include/asm-s390/sfp-machine.h
+++ b/include/asm-s390/sfp-machine.h
@@ -27,9 +27,9 @@
27 27
28 28
29#define _FP_W_TYPE_SIZE 32 29#define _FP_W_TYPE_SIZE 32
30#define _FP_W_TYPE unsigned long 30#define _FP_W_TYPE unsigned int
31#define _FP_WS_TYPE signed long 31#define _FP_WS_TYPE signed int
32#define _FP_I_TYPE long 32#define _FP_I_TYPE int
33 33
34#define _FP_MUL_MEAT_S(R,X,Y) \ 34#define _FP_MUL_MEAT_S(R,X,Y) \
35 _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm) 35 _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
diff --git a/include/asm-s390/sfp-util.h b/include/asm-s390/sfp-util.h
index 8cabcd23d976..0addc6466d95 100644
--- a/include/asm-s390/sfp-util.h
+++ b/include/asm-s390/sfp-util.h
@@ -51,6 +51,16 @@
51 wl = __wl; \ 51 wl = __wl; \
52}) 52})
53 53
54#ifdef __s390x__
55#define udiv_qrnnd(q, r, n1, n0, d) \
56 do { unsigned long __n; \
57 unsigned int __r, __d; \
58 __n = ((unsigned long)(n1) << 32) + n0; \
59 __d = (d); \
60 (q) = __n / __d; \
61 (r) = __n % __d; \
62 } while (0)
63#else
54#define udiv_qrnnd(q, r, n1, n0, d) \ 64#define udiv_qrnnd(q, r, n1, n0, d) \
55 do { unsigned int __r; \ 65 do { unsigned int __r; \
56 (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \ 66 (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
@@ -58,6 +68,7 @@
58 } while (0) 68 } while (0)
59extern unsigned long __udiv_qrnnd (unsigned int *, unsigned int, 69extern unsigned long __udiv_qrnnd (unsigned int *, unsigned int,
60 unsigned int , unsigned int); 70 unsigned int , unsigned int);
71#endif
61 72
62#define UDIV_NEEDS_NORMALIZATION 0 73#define UDIV_NEEDS_NORMALIZATION 0
63 74
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index bbe137c3ed69..64a3cd05cae1 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -97,16 +97,6 @@ static inline void restore_access_regs(unsigned int *acrs)
97 prev = __switch_to(prev,next); \ 97 prev = __switch_to(prev,next); \
98} while (0) 98} while (0)
99 99
100/*
101 * On SMP systems, when the scheduler does migration-cost autodetection,
102 * it needs a way to flush as much of the CPU's caches as possible.
103 *
104 * TODO: fill this in!
105 */
106static inline void sched_cacheflush(void)
107{
108}
109
110#ifdef CONFIG_VIRT_CPU_ACCOUNTING 100#ifdef CONFIG_VIRT_CPU_ACCOUNTING
111extern void account_vtime(struct task_struct *); 101extern void account_vtime(struct task_struct *);
112extern void account_tick_vtime(struct task_struct *); 102extern void account_tick_vtime(struct task_struct *);
diff --git a/include/asm-s390/termbits.h b/include/asm-s390/termbits.h
index 585c78a6e407..811b9a9cdc08 100644
--- a/include/asm-s390/termbits.h
+++ b/include/asm-s390/termbits.h
@@ -25,6 +25,17 @@ struct termios {
25 cc_t c_cc[NCCS]; /* control characters */ 25 cc_t c_cc[NCCS]; /* control characters */
26}; 26};
27 27
28struct termios2 {
29 tcflag_t c_iflag; /* input mode flags */
30 tcflag_t c_oflag; /* output mode flags */
31 tcflag_t c_cflag; /* control mode flags */
32 tcflag_t c_lflag; /* local mode flags */
33 cc_t c_line; /* line discipline */
34 cc_t c_cc[NCCS]; /* control characters */
35 speed_t c_ispeed; /* input speed */
36 speed_t c_ospeed; /* output speed */
37};
38
28struct ktermios { 39struct ktermios {
29 tcflag_t c_iflag; /* input mode flags */ 40 tcflag_t c_iflag; /* input mode flags */
30 tcflag_t c_oflag; /* output mode flags */ 41 tcflag_t c_oflag; /* output mode flags */
diff --git a/include/asm-sh/a.out.h b/include/asm-sh/a.out.h
index 6e9fca9ee333..685d0f6125fa 100644
--- a/include/asm-sh/a.out.h
+++ b/include/asm-sh/a.out.h
@@ -20,6 +20,7 @@ struct exec
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#define STACK_TOP TASK_SIZE 22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
23 24
24#endif 25#endif
25 26
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h
index 5a117ec43c77..aeee8da9c54f 100644
--- a/include/asm-sh/bugs.h
+++ b/include/asm-sh/bugs.h
@@ -22,7 +22,7 @@ static void __init check_bugs(void)
22 current_cpu_data.loops_per_jiffy = loops_per_jiffy; 22 current_cpu_data.loops_per_jiffy = loops_per_jiffy;
23 23
24 switch (current_cpu_data.type) { 24 switch (current_cpu_data.type) {
25 case CPU_SH7604 ... CPU_SH7619: 25 case CPU_SH7619:
26 *p++ = '2'; 26 *p++ = '2';
27 break; 27 break;
28 case CPU_SH7206: 28 case CPU_SH7206:
@@ -35,7 +35,7 @@ static void __init check_bugs(void)
35 case CPU_SH7750 ... CPU_SH4_501: 35 case CPU_SH7750 ... CPU_SH4_501:
36 *p++ = '4'; 36 *p++ = '4';
37 break; 37 break;
38 case CPU_SH7770 ... CPU_SH7785: 38 case CPU_SH7770 ... CPU_SHX3:
39 *p++ = '4'; 39 *p++ = '4';
40 *p++ = 'a'; 40 *p++ = 'a';
41 break; 41 break;
diff --git a/include/asm-sh/cache.h b/include/asm-sh/cache.h
index 9a3cb6ba9d15..7a18649d1ccb 100644
--- a/include/asm-sh/cache.h
+++ b/include/asm-sh/cache.h
@@ -9,6 +9,7 @@
9#define __ASM_SH_CACHE_H 9#define __ASM_SH_CACHE_H
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11 11
12#include <linux/init.h>
12#include <asm/cpu/cache.h> 13#include <asm/cpu/cache.h>
13 14
14#define SH_CACHE_VALID 1 15#define SH_CACHE_VALID 1
@@ -48,6 +49,9 @@ struct cache_info {
48 49
49 unsigned long flags; 50 unsigned long flags;
50}; 51};
52
53int __init detect_cpu_and_cache_system(void);
54
51#endif /* __ASSEMBLY__ */ 55#endif /* __ASSEMBLY__ */
52#endif /* __KERNEL__ */ 56#endif /* __KERNEL__ */
53#endif /* __ASM_SH_CACHE_H */ 57#endif /* __ASM_SH_CACHE_H */
diff --git a/include/asm-sh/clock.h b/include/asm-sh/clock.h
index 386d797d86b7..b550a27a7042 100644
--- a/include/asm-sh/clock.h
+++ b/include/asm-sh/clock.h
@@ -14,6 +14,7 @@ struct clk_ops {
14 void (*disable)(struct clk *clk); 14 void (*disable)(struct clk *clk);
15 void (*recalc)(struct clk *clk); 15 void (*recalc)(struct clk *clk);
16 int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id); 16 int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id);
17 long (*round_rate)(struct clk *clk, unsigned long rate);
17}; 18};
18 19
19struct clk { 20struct clk {
diff --git a/include/asm-sh/cpu-sh2/cache.h b/include/asm-sh/cpu-sh2/cache.h
index 20b9796842dc..f02ba7a672b2 100644
--- a/include/asm-sh/cpu-sh2/cache.h
+++ b/include/asm-sh/cpu-sh2/cache.h
@@ -12,23 +12,7 @@
12 12
13#define L1_CACHE_SHIFT 4 13#define L1_CACHE_SHIFT 4
14 14
15#if defined(CONFIG_CPU_SUBTYPE_SH7604) 15#if defined(CONFIG_CPU_SUBTYPE_SH7619)
16#define CCR 0xfffffe92 /* Address of Cache Control Register */
17
18#define CCR_CACHE_CE 0x01 /* Cache enable */
19#define CCR_CACHE_ID 0x02 /* Instruction Replacement disable */
20#define CCR_CACHE_OD 0x04 /* Data Replacement disable */
21#define CCR_CACHE_TW 0x08 /* Two-way mode */
22#define CCR_CACHE_CP 0x10 /* Cache purge */
23
24#define CACHE_OC_ADDRESS_ARRAY 0x60000000
25
26#define CCR_CACHE_ENABLE CCR_CACHE_CE
27#define CCR_CACHE_INVALIDATE CCR_CACHE_CP
28#define CCR_CACHE_ORA CCR_CACHE_TW
29#define CCR_CACHE_WT 0x00 /* SH-2 is _always_ write-through */
30
31#elif defined(CONFIG_CPU_SUBTYPE_SH7619)
32#define CCR1 0xffffffec 16#define CCR1 0xffffffec
33#define CCR CCR1 17#define CCR CCR1
34 18
@@ -49,5 +33,5 @@
49#define CCR_CACHE_ENABLE CCR_CACHE_CE 33#define CCR_CACHE_ENABLE CCR_CACHE_CE
50#define CCR_CACHE_INVALIDATE CCR_CACHE_CF 34#define CCR_CACHE_INVALIDATE CCR_CACHE_CF
51#endif 35#endif
52#endif /* __ASM_CPU_SH2_CACHE_H */
53 36
37#endif /* __ASM_CPU_SH2_CACHE_H */
diff --git a/include/asm-sh/cpu-sh3/timer.h b/include/asm-sh/cpu-sh3/timer.h
index b2394cf76f49..4928b08f9d19 100644
--- a/include/asm-sh/cpu-sh3/timer.h
+++ b/include/asm-sh/cpu-sh3/timer.h
@@ -29,7 +29,7 @@
29#endif 29#endif
30 30
31#if defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7710) 31#if defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7710)
32#define TMU_TSTR 0xa412fe92 /* Byte access */ 32#define TMU_012_TSTR 0xa412fe92 /* Byte access */
33 33
34#define TMU0_TCOR 0xa412fe94 /* Long access */ 34#define TMU0_TCOR 0xa412fe94 /* Long access */
35#define TMU0_TCNT 0xa412fe98 /* Long access */ 35#define TMU0_TCNT 0xa412fe98 /* Long access */
@@ -44,7 +44,7 @@
44#define TMU2_TCR 0xa412feb4 /* Word access */ 44#define TMU2_TCR 0xa412feb4 /* Word access */
45 45
46#else 46#else
47#define TMU_TSTR 0xfffffe92 /* Byte access */ 47#define TMU_012_TSTR 0xfffffe92 /* Byte access */
48 48
49#define TMU0_TCOR 0xfffffe94 /* Long access */ 49#define TMU0_TCOR 0xfffffe94 /* Long access */
50#define TMU0_TCNT 0xfffffe98 /* Long access */ 50#define TMU0_TCNT 0xfffffe98 /* Long access */
diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h
index 39f41fcd509d..026025b51cea 100644
--- a/include/asm-sh/cpu-sh4/freq.h
+++ b/include/asm-sh/cpu-sh4/freq.h
@@ -22,6 +22,8 @@
22#define FRQCR0 0xffc80000 22#define FRQCR0 0xffc80000
23#define FRQCR1 0xffc80004 23#define FRQCR1 0xffc80004
24#define FRQMR1 0xffc80014 24#define FRQMR1 0xffc80014
25#elif defined(CONFIG_CPU_SUBTYPE_SHX3)
26#define FRQCR 0xffc00014
25#else 27#else
26#define FRQCR 0xffc00000 28#define FRQCR 0xffc00000
27#define FRQCR_PSTBY 0x0200 29#define FRQCR_PSTBY 0x0200
diff --git a/include/asm-sh/cpu-sh4/timer.h b/include/asm-sh/cpu-sh4/timer.h
index 8a4af126c890..d1e796b96888 100644
--- a/include/asm-sh/cpu-sh4/timer.h
+++ b/include/asm-sh/cpu-sh4/timer.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-sh/cpu-sh4/timer.h 2 * include/asm-sh/cpu-sh4/timer.h
3 * 3 *
4 * Copyright (C) 2004 Lineo Solutions, Inc. 4 * Copyright (C) 2004 Lineo Solutions, Inc.
5 * 5 *
6 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive 7 * License. See the file "COPYING" in the main directory of this archive
@@ -16,36 +16,45 @@
16 * SH7750S/SH7750R 16 * SH7750S/SH7750R
17 * SH7751/SH7751R 17 * SH7751/SH7751R
18 * SH7760 18 * SH7760
19 * SH-X3
19 * --------------------------------------------------------------------------- 20 * ---------------------------------------------------------------------------
20 */ 21 */
21 22#ifdef CONFIG_CPU_SUBTYPE_SHX3
22#if !defined(CONFIG_CPU_SUBTYPE_SH7760) 23#define TMU_012_BASE 0xffc10000
23#define TMU_TOCR 0xffd80000 /* Byte access */ 24#define TMU_345_BASE 0xffc20000
25#else
26#define TMU_012_BASE 0xffd80000
27#define TMU_345_BASE 0xfe100000
24#endif 28#endif
25#define TMU_TSTR 0xffd80004 /* Byte access */
26 29
27#define TMU0_TCOR 0xffd80008 /* Long access */ 30#define TMU_TOCR TMU_012_BASE /* Not supported on all CPUs */
28#define TMU0_TCNT 0xffd8000c /* Long access */
29#define TMU0_TCR 0xffd80010 /* Word access */
30 31
31#define TMU1_TCOR 0xffd80014 /* Long access */ 32#define TMU_012_TSTR (TMU_012_BASE + 0x04)
32#define TMU1_TCNT 0xffd80018 /* Long access */ 33#define TMU_345_TSTR (TMU_345_BASE + 0x04)
33#define TMU1_TCR 0xffd8001c /* Word access */
34 34
35#define TMU2_TCOR 0xffd80020 /* Long access */ 35#define TMU0_TCOR (TMU_012_BASE + 0x08)
36#define TMU2_TCNT 0xffd80024 /* Long access */ 36#define TMU0_TCNT (TMU_012_BASE + 0x0c)
37#define TMU2_TCR 0xffd80028 /* Word access */ 37#define TMU0_TCR (TMU_012_BASE + 0x10)
38#define TMU2_TCPR 0xffd8002c /* Long access */
39 38
40#if !defined(CONFIG_CPU_SUBTYPE_SH7760) 39#define TMU1_TCOR (TMU_012_BASE + 0x14)
41#define TMU3_TCOR 0xfe100008 /* Long access */ 40#define TMU1_TCNT (TMU_012_BASE + 0x18)
42#define TMU3_TCNT 0xfe10000c /* Long access */ 41#define TMU1_TCR (TMU_012_BASE + 0x1c)
43#define TMU3_TCR 0xfe100010 /* Word access */
44 42
45#define TMU4_TCOR 0xfe100014 /* Long access */ 43#define TMU2_TCOR (TMU_012_BASE + 0x20)
46#define TMU4_TCNT 0xfe100018 /* Long access */ 44#define TMU2_TCNT (TMU_012_BASE + 0x24)
47#define TMU4_TCR 0xfe10001c /* Word access */ 45#define TMU2_TCR (TMU_012_BASE + 0x28)
48#endif 46#define TMU2_TCPR (TMU_012_BASE + 0x2c)
49 47
50#endif /* __ASM_CPU_SH4_TIMER_H */ 48#define TMU3_TCOR (TMU_345_BASE + 0x08)
49#define TMU3_TCNT (TMU_345_BASE + 0x0c)
50#define TMU3_TCR (TMU_345_BASE + 0x10)
51 51
52#define TMU4_TCOR (TMU_345_BASE + 0x14)
53#define TMU4_TCNT (TMU_345_BASE + 0x18)
54#define TMU4_TCR (TMU_345_BASE + 0x1c)
55
56#define TMU5_TCOR (TMU_345_BASE + 0x20)
57#define TMU5_TCNT (TMU_345_BASE + 0x24)
58#define TMU5_TCR (TMU_345_BASE + 0x28)
59
60#endif /* __ASM_CPU_SH4_TIMER_H */
diff --git a/include/asm-sh/fb.h b/include/asm-sh/fb.h
new file mode 100644
index 000000000000..d92e99cd8c8a
--- /dev/null
+++ b/include/asm-sh/fb.h
@@ -0,0 +1,19 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7
8static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
9 unsigned long off)
10{
11 vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
12}
13
14static inline int fb_is_primary_device(struct fb_info *info)
15{
16 return 0;
17}
18
19#endif /* _ASM_FB_H_ */
diff --git a/include/asm-sh/futex-irq.h b/include/asm-sh/futex-irq.h
new file mode 100644
index 000000000000..a9f16a7f9aea
--- /dev/null
+++ b/include/asm-sh/futex-irq.h
@@ -0,0 +1,111 @@
1#ifndef __ASM_SH_FUTEX_IRQ_H
2#define __ASM_SH_FUTEX_IRQ_H
3
4#include <asm/system.h>
5
6static inline int atomic_futex_op_xchg_set(int oparg, int __user *uaddr,
7 int *oldval)
8{
9 unsigned long flags;
10 int ret;
11
12 local_irq_save(flags);
13
14 ret = get_user(*oldval, uaddr);
15 if (!ret)
16 ret = put_user(oparg, uaddr);
17
18 local_irq_restore(flags);
19
20 return ret;
21}
22
23static inline int atomic_futex_op_xchg_add(int oparg, int __user *uaddr,
24 int *oldval)
25{
26 unsigned long flags;
27 int ret;
28
29 local_irq_save(flags);
30
31 ret = get_user(*oldval, uaddr);
32 if (!ret)
33 ret = put_user(*oldval + oparg, uaddr);
34
35 local_irq_restore(flags);
36
37 return ret;
38}
39
40static inline int atomic_futex_op_xchg_or(int oparg, int __user *uaddr,
41 int *oldval)
42{
43 unsigned long flags;
44 int ret;
45
46 local_irq_save(flags);
47
48 ret = get_user(*oldval, uaddr);
49 if (!ret)
50 ret = put_user(*oldval | oparg, uaddr);
51
52 local_irq_restore(flags);
53
54 return ret;
55}
56
57static inline int atomic_futex_op_xchg_and(int oparg, int __user *uaddr,
58 int *oldval)
59{
60 unsigned long flags;
61 int ret;
62
63 local_irq_save(flags);
64
65 ret = get_user(*oldval, uaddr);
66 if (!ret)
67 ret = put_user(*oldval & oparg, uaddr);
68
69 local_irq_restore(flags);
70
71 return ret;
72}
73
74static inline int atomic_futex_op_xchg_xor(int oparg, int __user *uaddr,
75 int *oldval)
76{
77 unsigned long flags;
78 int ret;
79
80 local_irq_save(flags);
81
82 ret = get_user(*oldval, uaddr);
83 if (!ret)
84 ret = put_user(*oldval ^ oparg, uaddr);
85
86 local_irq_restore(flags);
87
88 return ret;
89}
90
91static inline int atomic_futex_op_cmpxchg_inatomic(int __user *uaddr,
92 int oldval, int newval)
93{
94 unsigned long flags;
95 int ret, prev = 0;
96
97 local_irq_save(flags);
98
99 ret = get_user(prev, uaddr);
100 if (!ret && oldval == prev)
101 ret = put_user(newval, uaddr);
102
103 local_irq_restore(flags);
104
105 if (ret)
106 return ret;
107
108 return prev;
109}
110
111#endif /* __ASM_SH_FUTEX_IRQ_H */
diff --git a/include/asm-sh/futex.h b/include/asm-sh/futex.h
index 6a332a9f099c..74ed3681d33c 100644
--- a/include/asm-sh/futex.h
+++ b/include/asm-sh/futex.h
@@ -1,6 +1,77 @@
1#ifndef _ASM_FUTEX_H 1#ifndef __ASM_SH_FUTEX_H
2#define _ASM_FUTEX_H 2#define __ASM_SH_FUTEX_H
3 3
4#include <asm-generic/futex.h> 4#ifdef __KERNEL__
5 5
6#endif 6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10/* XXX: UP variants, fix for SH-4A and SMP.. */
11#include <asm/futex-irq.h>
12
13static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
14{
15 int op = (encoded_op >> 28) & 7;
16 int cmp = (encoded_op >> 24) & 15;
17 int oparg = (encoded_op << 8) >> 20;
18 int cmparg = (encoded_op << 20) >> 20;
19 int oldval = 0, ret;
20
21 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
22 oparg = 1 << oparg;
23
24 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
25 return -EFAULT;
26
27 pagefault_disable();
28
29 switch (op) {
30 case FUTEX_OP_SET:
31 ret = atomic_futex_op_xchg_set(oparg, uaddr, &oldval);
32 break;
33 case FUTEX_OP_ADD:
34 ret = atomic_futex_op_xchg_add(oparg, uaddr, &oldval);
35 break;
36 case FUTEX_OP_OR:
37 ret = atomic_futex_op_xchg_or(oparg, uaddr, &oldval);
38 break;
39 case FUTEX_OP_ANDN:
40 ret = atomic_futex_op_xchg_and(~oparg, uaddr, &oldval);
41 break;
42 case FUTEX_OP_XOR:
43 ret = atomic_futex_op_xchg_xor(oparg, uaddr, &oldval);
44 break;
45 default:
46 ret = -ENOSYS;
47 break;
48 }
49
50 pagefault_enable();
51
52 if (!ret) {
53 switch (cmp) {
54 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
55 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
56 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
57 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
58 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
59 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
60 default: ret = -ENOSYS;
61 }
62 }
63
64 return ret;
65}
66
67static inline int
68futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
69{
70 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
71 return -EFAULT;
72
73 return atomic_futex_op_cmpxchg_inatomic(uaddr, oldval, newval);
74}
75
76#endif /* __KERNEL__ */
77#endif /* __ASM_SH_FUTEX_H */
diff --git a/include/asm-sh/hd64461.h b/include/asm-sh/hd64461.h
index 27e5c34e2659..4dd8592ca014 100644
--- a/include/asm-sh/hd64461.h
+++ b/include/asm-sh/hd64461.h
@@ -1,200 +1,241 @@
1#ifndef __ASM_SH_HD64461 1#ifndef __ASM_SH_HD64461
2#define __ASM_SH_HD64461 2#define __ASM_SH_HD64461
3/* 3/*
4 * $Id: hd64461.h,v 1.5 2004/03/16 00:07:51 lethal Exp $ 4 * Copyright (C) 2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
5 * Copyright (C) 2004 Paul Mundt
5 * Copyright (C) 2000 YAEGASHI Takeshi 6 * Copyright (C) 2000 YAEGASHI Takeshi
6 * Hitachi HD64461 companion chip support 7 *
8 * Hitachi HD64461 companion chip support
9 * (please note manual reference 0x10000000 = 0xb0000000)
7 */ 10 */
8 11
9/* Constants for PCMCIA mappings */ 12/* Constants for PCMCIA mappings */
10#define HD64461_PCC_WINDOW 0x01000000 13#define HD64461_PCC_WINDOW 0x01000000
11 14
12#define HD64461_PCC0_BASE 0xb8000000 /* area 6 */ 15/* Area 6 - Slot 0 - memory and/or IO card */
13#define HD64461_PCC0_ATTR (HD64461_PCC0_BASE) 16#define HD64461_PCC0_BASE (CONFIG_HD64461_IOBASE + 0x8000000)
14#define HD64461_PCC0_COMM (HD64461_PCC0_BASE+HD64461_PCC_WINDOW) 17#define HD64461_PCC0_ATTR (HD64461_PCC0_BASE) /* 0xb80000000 */
15#define HD64461_PCC0_IO (HD64461_PCC0_BASE+2*HD64461_PCC_WINDOW) 18#define HD64461_PCC0_COMM (HD64461_PCC0_BASE+HD64461_PCC_WINDOW) /* 0xb90000000 */
16 19#define HD64461_PCC0_IO (HD64461_PCC0_BASE+2*HD64461_PCC_WINDOW) /* 0xba0000000 */
17#define HD64461_PCC1_BASE 0xb4000000 /* area 5 */ 20
18#define HD64461_PCC1_ATTR (HD64461_PCC1_BASE) 21/* Area 5 - Slot 1 - memory card only */
19#define HD64461_PCC1_COMM (HD64461_PCC1_BASE+HD64461_PCC_WINDOW) 22#define HD64461_PCC1_BASE (CONFIG_HD64461_IOBASE + 0x4000000)
20 23#define HD64461_PCC1_ATTR (HD64461_PCC1_BASE) /* 0xb4000000 */
21#define HD64461_STBCR 0x10000 24#define HD64461_PCC1_COMM (HD64461_PCC1_BASE+HD64461_PCC_WINDOW) /* 0xb5000000 */
22#define HD64461_STBCR_CKIO_STBY 0x2000 25
23#define HD64461_STBCR_SAFECKE_IST 0x1000 26/* Standby Control Register for HD64461 */
24#define HD64461_STBCR_SLCKE_IST 0x0800 27#define HD64461_STBCR CONFIG_HD64461_IOBASE
25#define HD64461_STBCR_SAFECKE_OST 0x0400 28#define HD64461_STBCR_CKIO_STBY 0x2000
26#define HD64461_STBCR_SLCKE_OST 0x0200 29#define HD64461_STBCR_SAFECKE_IST 0x1000
27#define HD64461_STBCR_SMIAST 0x0100 30#define HD64461_STBCR_SLCKE_IST 0x0800
28#define HD64461_STBCR_SLCDST 0x0080 31#define HD64461_STBCR_SAFECKE_OST 0x0400
29#define HD64461_STBCR_SPC0ST 0x0040 32#define HD64461_STBCR_SLCKE_OST 0x0200
30#define HD64461_STBCR_SPC1ST 0x0020 33#define HD64461_STBCR_SMIAST 0x0100
31#define HD64461_STBCR_SAFEST 0x0010 34#define HD64461_STBCR_SLCDST 0x0080
32#define HD64461_STBCR_STM0ST 0x0008 35#define HD64461_STBCR_SPC0ST 0x0040
33#define HD64461_STBCR_STM1ST 0x0004 36#define HD64461_STBCR_SPC1ST 0x0020
34#define HD64461_STBCR_SIRST 0x0002 37#define HD64461_STBCR_SAFEST 0x0010
35#define HD64461_STBCR_SURTST 0x0001 38#define HD64461_STBCR_STM0ST 0x0008
36 39#define HD64461_STBCR_STM1ST 0x0004
37#define HD64461_SYSCR 0x10002 40#define HD64461_STBCR_SIRST 0x0002
38#define HD64461_SCPUCR 0x10004 41#define HD64461_STBCR_SURTST 0x0001
39 42
40#define HD64461_LCDCBAR 0x11000 43/* System Configuration Register */
41#define HD64461_LCDCLOR 0x11002 44#define HD64461_SYSCR (CONFIG_HD64461_IOBASE + 0x02)
42#define HD64461_LCDCCR 0x11004 45
43#define HD64461_LCDCCR_STBACK 0x0400 46/* CPU Data Bus Control Register */
44#define HD64461_LCDCCR_STREQ 0x0100 47#define HD64461_SCPUCR (CONFIG_HD64461_IOBASE + 0x04)
45#define HD64461_LCDCCR_MOFF 0x0080 48
46#define HD64461_LCDCCR_REFSEL 0x0040 49/* Base Adress Register */
47#define HD64461_LCDCCR_EPON 0x0020 50#define HD64461_LCDCBAR (CONFIG_HD64461_IOBASE + 0x1000)
48#define HD64461_LCDCCR_SPON 0x0010 51
49 52/* Line increment adress */
50#define HD64461_LDR1 0x11010 53#define HD64461_LCDCLOR (CONFIG_HD64461_IOBASE + 0x1002)
51#define HD64461_LDR1_DON 0x01 54
52#define HD64461_LDR1_DINV 0x80 55/* Controls LCD controller */
53 56#define HD64461_LCDCCR (CONFIG_HD64461_IOBASE + 0x1004)
54#define HD64461_LDR2 0x11012 57
55#define HD64461_LDHNCR 0x11014 58/* LCCDR control bits */
56#define HD64461_LDHNSR 0x11016 59#define HD64461_LCDCCR_STBACK 0x0400 /* Standby Back */
57#define HD64461_LDVNTR 0x11018 60#define HD64461_LCDCCR_STREQ 0x0100 /* Standby Request */
58#define HD64461_LDVNDR 0x1101a 61#define HD64461_LCDCCR_MOFF 0x0080 /* Memory Off */
59#define HD64461_LDVSPR 0x1101c 62#define HD64461_LCDCCR_REFSEL 0x0040 /* Refresh Select */
60#define HD64461_LDR3 0x1101e 63#define HD64461_LCDCCR_EPON 0x0020 /* End Power On */
61 64#define HD64461_LCDCCR_SPON 0x0010 /* Start Power On */
62#define HD64461_CPTWAR 0x11030 65
63#define HD64461_CPTWDR 0x11032 66/* Controls LCD (1) */
64#define HD64461_CPTRAR 0x11034 67#define HD64461_LDR1 (CONFIG_HD64461_IOBASE + 0x1010)
65#define HD64461_CPTRDR 0x11036 68#define HD64461_LDR1_DON 0x01 /* Display On */
66 69#define HD64461_LDR1_DINV 0x80 /* Display Invert */
67#define HD64461_GRDOR 0x11040 70
68#define HD64461_GRSCR 0x11042 71/* Controls LCD (2) */
69#define HD64461_GRCFGR 0x11044 72#define HD64461_LDR2 (CONFIG_HD64461_IOBASE + 0x1012)
70#define HD64461_GRCFGR_ACCSTATUS 0x10 73#define HD64461_LDHNCR (CONFIG_HD64461_IOBASE + 0x1014) /* Number of horizontal characters */
71#define HD64461_GRCFGR_ACCRESET 0x08 74#define HD64461_LDHNSR (CONFIG_HD64461_IOBASE + 0x1016) /* Specify output start position + width of CL1 */
72#define HD64461_GRCFGR_ACCSTART_BITBLT 0x06 75#define HD64461_LDVNTR (CONFIG_HD64461_IOBASE + 0x1018) /* Specify total vertical lines */
73#define HD64461_GRCFGR_ACCSTART_LINE 0x04 76#define HD64461_LDVNDR (CONFIG_HD64461_IOBASE + 0x101a) /* specify number of display vertical lines */
74#define HD64461_GRCFGR_COLORDEPTH16 0x01 77#define HD64461_LDVSPR (CONFIG_HD64461_IOBASE + 0x101c) /* specify vertical synchronization pos and AC nr */
75 78
76#define HD64461_LNSARH 0x11046 79/* Controls LCD (3) */
77#define HD64461_LNSARL 0x11048 80#define HD64461_LDR3 (CONFIG_HD64461_IOBASE + 0x101e)
78#define HD64461_LNAXLR 0x1104a 81
79#define HD64461_LNDGR 0x1104c 82/* Palette Registers */
80#define HD64461_LNAXR 0x1104e 83#define HD64461_CPTWAR (CONFIG_HD64461_IOBASE + 0x1030) /* Color Palette Write Adress Register */
81#define HD64461_LNERTR 0x11050 84#define HD64461_CPTWDR (CONFIG_HD64461_IOBASE + 0x1032) /* Color Palette Write Data Register */
82#define HD64461_LNMDR 0x11052 85#define HD64461_CPTRAR (CONFIG_HD64461_IOBASE + 0x1034) /* Color Palette Read Adress Register */
83#define HD64461_BBTSSARH 0x11054 86#define HD64461_CPTRDR (CONFIG_HD64461_IOBASE + 0x1036) /* Color Palette Read Data Register */
84#define HD64461_BBTSSARL 0x11056 87
85#define HD64461_BBTDSARH 0x11058 88#define HD64461_GRDOR (CONFIG_HD64461_IOBASE + 0x1040) /* Display Resolution Offset Register */
86#define HD64461_BBTDSARL 0x1105a 89#define HD64461_GRSCR (CONFIG_HD64461_IOBASE + 0x1042) /* Solid Color Register */
87#define HD64461_BBTDWR 0x1105c 90#define HD64461_GRCFGR (CONFIG_HD64461_IOBASE + 0x1044) /* Accelerator Configuration Register */
88#define HD64461_BBTDHR 0x1105e 91
89#define HD64461_BBTPARH 0x11060 92#define HD64461_GRCFGR_ACCSTATUS 0x10 /* Accelerator Status */
90#define HD64461_BBTPARL 0x11062 93#define HD64461_GRCFGR_ACCRESET 0x08 /* Accelerator Reset */
91#define HD64461_BBTMARH 0x11064 94#define HD64461_GRCFGR_ACCSTART_BITBLT 0x06 /* Accelerator Start BITBLT */
92#define HD64461_BBTMARL 0x11066 95#define HD64461_GRCFGR_ACCSTART_LINE 0x04 /* Accelerator Start Line Drawing */
93#define HD64461_BBTROPR 0x11068 96#define HD64461_GRCFGR_COLORDEPTH16 0x01 /* Sets Colordepth 16 for Accelerator */
94#define HD64461_BBTMDR 0x1106a 97#define HD64461_GRCFGR_COLORDEPTH8 0x01 /* Sets Colordepth 8 for Accelerator */
98
99/* Line Drawing Registers */
100#define HD64461_LNSARH (CONFIG_HD64461_IOBASE + 0x1046) /* Line Start Adress Register (H) */
101#define HD64461_LNSARL (CONFIG_HD64461_IOBASE + 0x1048) /* Line Start Adress Register (L) */
102#define HD64461_LNAXLR (CONFIG_HD64461_IOBASE + 0x104a) /* Axis Pixel Length Register */
103#define HD64461_LNDGR (CONFIG_HD64461_IOBASE + 0x104c) /* Diagonal Register */
104#define HD64461_LNAXR (CONFIG_HD64461_IOBASE + 0x104e) /* Axial Register */
105#define HD64461_LNERTR (CONFIG_HD64461_IOBASE + 0x1050) /* Start Error Term Register */
106#define HD64461_LNMDR (CONFIG_HD64461_IOBASE + 0x1052) /* Line Mode Register */
107
108/* BitBLT Registers */
109#define HD64461_BBTSSARH (CONFIG_HD64461_IOBASE + 0x1054) /* Source Start Adress Register (H) */
110#define HD64461_BBTSSARL (CONFIG_HD64461_IOBASE + 0x1056) /* Source Start Adress Register (L) */
111#define HD64461_BBTDSARH (CONFIG_HD64461_IOBASE + 0x1058) /* Destination Start Adress Register (H) */
112#define HD64461_BBTDSARL (CONFIG_HD64461_IOBASE + 0x105a) /* Destination Start Adress Register (L) */
113#define HD64461_BBTDWR (CONFIG_HD64461_IOBASE + 0x105c) /* Destination Block Width Register */
114#define HD64461_BBTDHR (CONFIG_HD64461_IOBASE + 0x105e) /* Destination Block Height Register */
115#define HD64461_BBTPARH (CONFIG_HD64461_IOBASE + 0x1060) /* Pattern Start Adress Register (H) */
116#define HD64461_BBTPARL (CONFIG_HD64461_IOBASE + 0x1062) /* Pattern Start Adress Register (L) */
117#define HD64461_BBTMARH (CONFIG_HD64461_IOBASE + 0x1064) /* Mask Start Adress Register (H) */
118#define HD64461_BBTMARL (CONFIG_HD64461_IOBASE + 0x1066) /* Mask Start Adress Register (L) */
119#define HD64461_BBTROPR (CONFIG_HD64461_IOBASE + 0x1068) /* ROP Register */
120#define HD64461_BBTMDR (CONFIG_HD64461_IOBASE + 0x106a) /* BitBLT Mode Register */
95 121
96/* PC Card Controller Registers */ 122/* PC Card Controller Registers */
97#define HD64461_PCC0ISR 0x12000 /* socket 0 interface status */ 123/* Maps to Physical Area 6 */
98#define HD64461_PCC0GCR 0x12002 /* socket 0 general control */ 124#define HD64461_PCC0ISR (CONFIG_HD64461_IOBASE + 0x2000) /* socket 0 interface status */
99#define HD64461_PCC0CSCR 0x12004 /* socket 0 card status change */ 125#define HD64461_PCC0GCR (CONFIG_HD64461_IOBASE + 0x2002) /* socket 0 general control */
100#define HD64461_PCC0CSCIER 0x12006 /* socket 0 card status change interrupt enable */ 126#define HD64461_PCC0CSCR (CONFIG_HD64461_IOBASE + 0x2004) /* socket 0 card status change */
101#define HD64461_PCC0SCR 0x12008 /* socket 0 software control */ 127#define HD64461_PCC0CSCIER (CONFIG_HD64461_IOBASE + 0x2006) /* socket 0 card status change interrupt enable */
102#define HD64461_PCC1ISR 0x12010 /* socket 1 interface status */ 128#define HD64461_PCC0SCR (CONFIG_HD64461_IOBASE + 0x2008) /* socket 0 software control */
103#define HD64461_PCC1GCR 0x12012 /* socket 1 general control */ 129/* Maps to Physical Area 5 */
104#define HD64461_PCC1CSCR 0x12014 /* socket 1 card status change */ 130#define HD64461_PCC1ISR (CONFIG_HD64461_IOBASE + 0x2010) /* socket 1 interface status */
105#define HD64461_PCC1CSCIER 0x12016 /* socket 1 card status change interrupt enable */ 131#define HD64461_PCC1GCR (CONFIG_HD64461_IOBASE + 0x2012) /* socket 1 general control */
106#define HD64461_PCC1SCR 0x12018 /* socket 1 software control */ 132#define HD64461_PCC1CSCR (CONFIG_HD64461_IOBASE + 0x2014) /* socket 1 card status change */
133#define HD64461_PCC1CSCIER (CONFIG_HD64461_IOBASE + 0x2016) /* socket 1 card status change interrupt enable */
134#define HD64461_PCC1SCR (CONFIG_HD64461_IOBASE + 0x2018) /* socket 1 software control */
107 135
108/* PCC Interface Status Register */ 136/* PCC Interface Status Register */
109#define HD64461_PCCISR_READY 0x80 /* card ready */ 137#define HD64461_PCCISR_READY 0x80 /* card ready */
110#define HD64461_PCCISR_MWP 0x40 /* card write-protected */ 138#define HD64461_PCCISR_MWP 0x40 /* card write-protected */
111#define HD64461_PCCISR_VS2 0x20 /* voltage select pin 2 */ 139#define HD64461_PCCISR_VS2 0x20 /* voltage select pin 2 */
112#define HD64461_PCCISR_VS1 0x10 /* voltage select pin 1 */ 140#define HD64461_PCCISR_VS1 0x10 /* voltage select pin 1 */
113#define HD64461_PCCISR_CD2 0x08 /* card detect 2 */ 141#define HD64461_PCCISR_CD2 0x08 /* card detect 2 */
114#define HD64461_PCCISR_CD1 0x04 /* card detect 1 */ 142#define HD64461_PCCISR_CD1 0x04 /* card detect 1 */
115#define HD64461_PCCISR_BVD2 0x02 /* battery 1 */ 143#define HD64461_PCCISR_BVD2 0x02 /* battery 1 */
116#define HD64461_PCCISR_BVD1 0x01 /* battery 1 */ 144#define HD64461_PCCISR_BVD1 0x01 /* battery 1 */
117 145
118#define HD64461_PCCISR_PCD_MASK 0x0c /* card detect */ 146#define HD64461_PCCISR_PCD_MASK 0x0c /* card detect */
119#define HD64461_PCCISR_BVD_MASK 0x03 /* battery voltage */ 147#define HD64461_PCCISR_BVD_MASK 0x03 /* battery voltage */
120#define HD64461_PCCISR_BVD_BATGOOD 0x03 /* battery good */ 148#define HD64461_PCCISR_BVD_BATGOOD 0x03 /* battery good */
121#define HD64461_PCCISR_BVD_BATWARN 0x01 /* battery low warning */ 149#define HD64461_PCCISR_BVD_BATWARN 0x01 /* battery low warning */
122#define HD64461_PCCISR_BVD_BATDEAD1 0x02 /* battery dead */ 150#define HD64461_PCCISR_BVD_BATDEAD1 0x02 /* battery dead */
123#define HD64461_PCCISR_BVD_BATDEAD2 0x00 /* battery dead */ 151#define HD64461_PCCISR_BVD_BATDEAD2 0x00 /* battery dead */
124 152
125/* PCC General Control Register */ 153/* PCC General Control Register */
126#define HD64461_PCCGCR_DRVE 0x80 /* output drive */ 154#define HD64461_PCCGCR_DRVE 0x80 /* output drive */
127#define HD64461_PCCGCR_PCCR 0x40 /* PC card reset */ 155#define HD64461_PCCGCR_PCCR 0x40 /* PC card reset */
128#define HD64461_PCCGCR_PCCT 0x20 /* PC card type, 1=IO&mem, 0=mem */ 156#define HD64461_PCCGCR_PCCT 0x20 /* PC card type, 1=IO&mem, 0=mem */
129#define HD64461_PCCGCR_VCC0 0x10 /* voltage control pin VCC0SEL0 */ 157#define HD64461_PCCGCR_VCC0 0x10 /* voltage control pin VCC0SEL0 */
130#define HD64461_PCCGCR_PMMOD 0x08 /* memory mode */ 158#define HD64461_PCCGCR_PMMOD 0x08 /* memory mode */
131#define HD64461_PCCGCR_PA25 0x04 /* pin A25 */ 159#define HD64461_PCCGCR_PA25 0x04 /* pin A25 */
132#define HD64461_PCCGCR_PA24 0x02 /* pin A24 */ 160#define HD64461_PCCGCR_PA24 0x02 /* pin A24 */
133#define HD64461_PCCGCR_REG 0x01 /* pin PCC0REG# */ 161#define HD64461_PCCGCR_REG 0x01 /* pin PCC0REG# */
134 162
135/* PCC Card Status Change Register */ 163/* PCC Card Status Change Register */
136#define HD64461_PCCCSCR_SCDI 0x80 /* sw card detect intr */ 164#define HD64461_PCCCSCR_SCDI 0x80 /* sw card detect intr */
137#define HD64461_PCCCSCR_SRV1 0x40 /* reserved */ 165#define HD64461_PCCCSCR_SRV1 0x40 /* reserved */
138#define HD64461_PCCCSCR_IREQ 0x20 /* IREQ intr req */ 166#define HD64461_PCCCSCR_IREQ 0x20 /* IREQ intr req */
139#define HD64461_PCCCSCR_SC 0x10 /* STSCHG (status change) pin */ 167#define HD64461_PCCCSCR_SC 0x10 /* STSCHG (status change) pin */
140#define HD64461_PCCCSCR_CDC 0x08 /* CD (card detect) change */ 168#define HD64461_PCCCSCR_CDC 0x08 /* CD (card detect) change */
141#define HD64461_PCCCSCR_RC 0x04 /* READY change */ 169#define HD64461_PCCCSCR_RC 0x04 /* READY change */
142#define HD64461_PCCCSCR_BW 0x02 /* battery warning change */ 170#define HD64461_PCCCSCR_BW 0x02 /* battery warning change */
143#define HD64461_PCCCSCR_BD 0x01 /* battery dead change */ 171#define HD64461_PCCCSCR_BD 0x01 /* battery dead change */
144 172
145/* PCC Card Status Change Interrupt Enable Register */ 173/* PCC Card Status Change Interrupt Enable Register */
146#define HD64461_PCCCSCIER_CRE 0x80 /* change reset enable */ 174#define HD64461_PCCCSCIER_CRE 0x80 /* change reset enable */
147#define HD64461_PCCCSCIER_IREQE_MASK 0x60 /* IREQ enable */ 175#define HD64461_PCCCSCIER_IREQE_MASK 0x60 /* IREQ enable */
148#define HD64461_PCCCSCIER_IREQE_DISABLED 0x00 /* IREQ disabled */ 176#define HD64461_PCCCSCIER_IREQE_DISABLED 0x00 /* IREQ disabled */
149#define HD64461_PCCCSCIER_IREQE_LEVEL 0x20 /* IREQ level-triggered */ 177#define HD64461_PCCCSCIER_IREQE_LEVEL 0x20 /* IREQ level-triggered */
150#define HD64461_PCCCSCIER_IREQE_FALLING 0x40 /* IREQ falling-edge-trig */ 178#define HD64461_PCCCSCIER_IREQE_FALLING 0x40 /* IREQ falling-edge-trig */
151#define HD64461_PCCCSCIER_IREQE_RISING 0x60 /* IREQ rising-edge-trig */ 179#define HD64461_PCCCSCIER_IREQE_RISING 0x60 /* IREQ rising-edge-trig */
152 180
153#define HD64461_PCCCSCIER_SCE 0x10 /* status change enable */ 181#define HD64461_PCCCSCIER_SCE 0x10 /* status change enable */
154#define HD64461_PCCCSCIER_CDE 0x08 /* card detect change enable */ 182#define HD64461_PCCCSCIER_CDE 0x08 /* card detect change enable */
155#define HD64461_PCCCSCIER_RE 0x04 /* ready change enable */ 183#define HD64461_PCCCSCIER_RE 0x04 /* ready change enable */
156#define HD64461_PCCCSCIER_BWE 0x02 /* battery warn change enable */ 184#define HD64461_PCCCSCIER_BWE 0x02 /* battery warn change enable */
157#define HD64461_PCCCSCIER_BDE 0x01 /* battery dead change enable*/ 185#define HD64461_PCCCSCIER_BDE 0x01 /* battery dead change enable*/
158 186
159/* PCC Software Control Register */ 187/* PCC Software Control Register */
160#define HD64461_PCCSCR_VCC1 0x02 /* voltage control pin 1 */ 188#define HD64461_PCCSCR_VCC1 0x02 /* voltage control pin 1 */
161#define HD64461_PCCSCR_SWP 0x01 /* write protect */ 189#define HD64461_PCCSCR_SWP 0x01 /* write protect */
162 190
163#define HD64461_P0OCR 0x1202a 191/* PCC0 Output Pins Control Register */
164#define HD64461_P1OCR 0x1202c 192#define HD64461_P0OCR (CONFIG_HD64461_IOBASE + 0x202a)
165#define HD64461_PGCR 0x1202e 193
166 194/* PCC1 Output Pins Control Register */
167#define HD64461_GPACR 0x14000 195#define HD64461_P1OCR (CONFIG_HD64461_IOBASE + 0x202c)
168#define HD64461_GPBCR 0x14002 196
169#define HD64461_GPCCR 0x14004 197/* PC Card General Control Register */
170#define HD64461_GPDCR 0x14006 198#define HD64461_PGCR (CONFIG_HD64461_IOBASE + 0x202e)
171#define HD64461_GPADR 0x14010 199
172#define HD64461_GPBDR 0x14012 200/* Port Control Registers */
173#define HD64461_GPCDR 0x14014 201#define HD64461_GPACR (CONFIG_HD64461_IOBASE + 0x4000) /* Port A - Handles IRDA/TIMER */
174#define HD64461_GPDDR 0x14016 202#define HD64461_GPBCR (CONFIG_HD64461_IOBASE + 0x4002) /* Port B - Handles UART */
175#define HD64461_GPAICR 0x14020 203#define HD64461_GPCCR (CONFIG_HD64461_IOBASE + 0x4004) /* Port C - Handles PCMCIA 1 */
176#define HD64461_GPBICR 0x14022 204#define HD64461_GPDCR (CONFIG_HD64461_IOBASE + 0x4006) /* Port D - Handles PCMCIA 1 */
177#define HD64461_GPCICR 0x14024 205
178#define HD64461_GPDICR 0x14026 206/* Port Control Data Registers */
179#define HD64461_GPAISR 0x14040 207#define HD64461_GPADR (CONFIG_HD64461_IOBASE + 0x4010) /* A */
180#define HD64461_GPBISR 0x14042 208#define HD64461_GPBDR (CONFIG_HD64461_IOBASE + 0x4012) /* B */
181#define HD64461_GPCISR 0x14044 209#define HD64461_GPCDR (CONFIG_HD64461_IOBASE + 0x4014) /* C */
182#define HD64461_GPDISR 0x14046 210#define HD64461_GPDDR (CONFIG_HD64461_IOBASE + 0x4016) /* D */
183 211
184#define HD64461_NIRR 0x15000 212/* Interrupt Control Registers */
185#define HD64461_NIMR 0x15002 213#define HD64461_GPAICR (CONFIG_HD64461_IOBASE + 0x4020) /* A */
186 214#define HD64461_GPBICR (CONFIG_HD64461_IOBASE + 0x4022) /* B */
187#define HD64461_IRQBASE OFFCHIP_IRQ_BASE 215#define HD64461_GPCICR (CONFIG_HD64461_IOBASE + 0x4024) /* C */
188#define HD64461_IRQ_NUM 16 216#define HD64461_GPDICR (CONFIG_HD64461_IOBASE + 0x4026) /* D */
189 217
190#define HD64461_IRQ_UART (HD64461_IRQBASE+5) 218/* Interrupt Status Registers */
191#define HD64461_IRQ_IRDA (HD64461_IRQBASE+6) 219#define HD64461_GPAISR (CONFIG_HD64461_IOBASE + 0x4040) /* A */
192#define HD64461_IRQ_TMU1 (HD64461_IRQBASE+9) 220#define HD64461_GPBISR (CONFIG_HD64461_IOBASE + 0x4042) /* B */
193#define HD64461_IRQ_TMU0 (HD64461_IRQBASE+10) 221#define HD64461_GPCISR (CONFIG_HD64461_IOBASE + 0x4044) /* C */
194#define HD64461_IRQ_GPIO (HD64461_IRQBASE+11) 222#define HD64461_GPDISR (CONFIG_HD64461_IOBASE + 0x4046) /* D */
195#define HD64461_IRQ_AFE (HD64461_IRQBASE+12) 223
196#define HD64461_IRQ_PCC1 (HD64461_IRQBASE+13) 224/* Interrupt Request Register & Interrupt Mask Register */
197#define HD64461_IRQ_PCC0 (HD64461_IRQBASE+14) 225#define HD64461_NIRR (CONFIG_HD64461_IOBASE + 0x5000)
226#define HD64461_NIMR (CONFIG_HD64461_IOBASE + 0x5002)
227
228#define HD64461_IRQBASE OFFCHIP_IRQ_BASE
229#define HD64461_IRQ_NUM 16
230
231#define HD64461_IRQ_UART (HD64461_IRQBASE+5)
232#define HD64461_IRQ_IRDA (HD64461_IRQBASE+6)
233#define HD64461_IRQ_TMU1 (HD64461_IRQBASE+9)
234#define HD64461_IRQ_TMU0 (HD64461_IRQBASE+10)
235#define HD64461_IRQ_GPIO (HD64461_IRQBASE+11)
236#define HD64461_IRQ_AFE (HD64461_IRQBASE+12)
237#define HD64461_IRQ_PCC1 (HD64461_IRQBASE+13)
238#define HD64461_IRQ_PCC0 (HD64461_IRQBASE+14)
198 239
199#define __IO_PREFIX hd64461 240#define __IO_PREFIX hd64461
200#include <asm/io_generic.h> 241#include <asm/io_generic.h>
diff --git a/include/asm-sh/hw_irq.h b/include/asm-sh/hw_irq.h
index 80ee1cda7498..20d42959f52a 100644
--- a/include/asm-sh/hw_irq.h
+++ b/include/asm-sh/hw_irq.h
@@ -1,8 +1,121 @@
1#ifndef __ASM_SH_HW_IRQ_H 1#ifndef __ASM_SH_HW_IRQ_H
2#define __ASM_SH_HW_IRQ_H 2#define __ASM_SH_HW_IRQ_H
3 3
4#include <linux/init.h>
4#include <asm/atomic.h> 5#include <asm/atomic.h>
5 6
6extern atomic_t irq_err_count; 7extern atomic_t irq_err_count;
7 8
9struct intc2_data {
10 unsigned short irq;
11 unsigned char ipr_offset, ipr_shift;
12 unsigned char msk_offset, msk_shift;
13 unsigned char priority;
14};
15
16struct intc2_desc {
17 unsigned long prio_base;
18 unsigned long msk_base;
19 unsigned long mskclr_base;
20 struct intc2_data *intc2_data;
21 unsigned int nr_irqs;
22 struct irq_chip chip;
23};
24
25void register_intc2_controller(struct intc2_desc *);
26
27struct ipr_data {
28 unsigned char irq;
29 unsigned char ipr_idx; /* Index for the IPR registered */
30 unsigned char shift; /* Number of bits to shift the data */
31 unsigned char priority; /* The priority */
32};
33
34struct ipr_desc {
35 unsigned long *ipr_offsets;
36 unsigned int nr_offsets;
37 struct ipr_data *ipr_data;
38 unsigned int nr_irqs;
39 struct irq_chip chip;
40};
41
42void register_ipr_controller(struct ipr_desc *);
43
44/*
45 * Enable individual interrupt mode for external IPR IRQs.
46 */
47void __init ipr_irq_enable_irlm(void);
48
49typedef unsigned char intc_enum;
50
51struct intc_vect {
52 intc_enum enum_id;
53 unsigned short vect;
54};
55
56#define INTC_VECT(enum_id, vect) { enum_id, vect }
57
58struct intc_prio {
59 intc_enum enum_id;
60 unsigned char priority;
61};
62
63#define INTC_PRIO(enum_id, prio) { enum_id, prio }
64
65struct intc_group {
66 intc_enum enum_id;
67 intc_enum *enum_ids;
68};
69
70#define INTC_GROUP(enum_id, ids...) { enum_id, (intc_enum []) { ids, 0 } }
71
72struct intc_mask_reg {
73 unsigned long set_reg, clr_reg, reg_width;
74 intc_enum enum_ids[32];
75};
76
77struct intc_prio_reg {
78 unsigned long reg, reg_width, field_width;
79 intc_enum enum_ids[16];
80};
81
82struct intc_sense_reg {
83 unsigned long reg, reg_width, field_width;
84 intc_enum enum_ids[16];
85};
86
87struct intc_desc {
88 struct intc_vect *vectors;
89 unsigned int nr_vectors;
90 struct intc_group *groups;
91 unsigned int nr_groups;
92 struct intc_prio *priorities;
93 unsigned int nr_priorities;
94 struct intc_mask_reg *mask_regs;
95 unsigned int nr_mask_regs;
96 struct intc_prio_reg *prio_regs;
97 unsigned int nr_prio_regs;
98 struct intc_sense_reg *sense_regs;
99 unsigned int nr_sense_regs;
100 struct irq_chip chip;
101};
102
103#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a)
104#define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, \
105 priorities, mask_regs, prio_regs, sense_regs) \
106struct intc_desc symbol = { \
107 _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \
108 _INTC_ARRAY(priorities), \
109 _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \
110 _INTC_ARRAY(sense_regs), \
111 .chip.name = chipname, \
112}
113
114void __init register_intc_controller(struct intc_desc *desc);
115
116void __init plat_irq_setup(void);
117
118enum { IRQ_MODE_IRQ, IRQ_MODE_IRL7654, IRQ_MODE_IRL3210 };
119void __init plat_irq_setup_pins(int mode);
120
8#endif /* __ASM_SH_HW_IRQ_H */ 121#endif /* __ASM_SH_HW_IRQ_H */
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
index e81bf21c801e..c61d902b8bff 100644
--- a/include/asm-sh/irq.h
+++ b/include/asm-sh/irq.h
@@ -31,47 +31,7 @@ extern unsigned short *irq_mask_register;
31 * PINT IRQs 31 * PINT IRQs
32 */ 32 */
33void init_IRQ_pint(void); 33void init_IRQ_pint(void);
34
35/*
36 * The shift value is now the number of bits to shift, not the number of
37 * bits/4. This is to make it easier to read the value directly from the
38 * datasheets. The IPR address, addr, will be set from ipr_idx via the
39 * map_ipridx_to_addr function.
40 */
41struct ipr_data {
42 unsigned int irq;
43 int ipr_idx; /* Index for the IPR registered */
44 int shift; /* Number of bits to shift the data */
45 int priority; /* The priority */
46 unsigned int addr; /* Address of Interrupt Priority Register */
47};
48
49/*
50 * Given an IPR IDX, map the value to an IPR register address.
51 */
52unsigned int map_ipridx_to_addr(int idx);
53
54/*
55 * Enable individual interrupt mode for external IPR IRQs.
56 */
57void ipr_irq_enable_irlm(void);
58
59/*
60 * Function for "on chip support modules".
61 */
62void make_ipr_irq(struct ipr_data *table, unsigned int nr_irqs);
63void make_imask_irq(unsigned int irq); 34void make_imask_irq(unsigned int irq);
64void init_IRQ_ipr(void);
65
66struct intc2_data {
67 unsigned short irq;
68 unsigned char ipr_offset, ipr_shift;
69 unsigned char msk_offset, msk_shift;
70 unsigned char priority;
71};
72
73void make_intc2_irq(struct intc2_data *, unsigned int nr_irqs);
74void init_IRQ_intc2(void);
75 35
76static inline int generic_irq_demux(int irq) 36static inline int generic_irq_demux(int irq)
77{ 37{
diff --git a/include/asm-sh/machvec.h b/include/asm-sh/machvec.h
index 70389b72ffef..088698bacf2f 100644
--- a/include/asm-sh/machvec.h
+++ b/include/asm-sh/machvec.h
@@ -13,7 +13,6 @@
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/time.h> 14#include <linux/time.h>
15#include <asm/machtypes.h> 15#include <asm/machtypes.h>
16#include <asm/machvec_init.h>
17 16
18struct device; 17struct device;
19 18
@@ -68,4 +67,7 @@ extern struct sh_machine_vector sh_mv;
68 67
69#define get_system_type() sh_mv.mv_name 68#define get_system_type() sh_mv.mv_name
70 69
70#define __initmv \
71 __attribute_used__ __attribute__((__section__ (".machvec.init")))
72
71#endif /* _ASM_SH_MACHVEC_H */ 73#endif /* _ASM_SH_MACHVEC_H */
diff --git a/include/asm-sh/machvec_init.h b/include/asm-sh/machvec_init.h
deleted file mode 100644
index e397798ebd94..000000000000
--- a/include/asm-sh/machvec_init.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * include/asm-sh/machvec_init.h
3 *
4 * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
5 *
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
8 *
9 * This file has goodies to help simplify instantiation of machine vectors.
10 */
11
12#ifndef __SH_MACHVEC_INIT_H
13#define __SH_MACHVEC_INIT_H
14
15
16/*
17 * In a GENERIC kernel, we have lots of these vectors floating about,
18 * all but one of which we want to go away. In a non-GENERIC kernel,
19 * we want only one, ever.
20 *
21 * Accomplish this in the GENERIC kernel by puting all of the vectors
22 * in the .init.data section where they'll go away. We'll copy the
23 * one we want to the real alpha_mv vector in setup_arch.
24 *
25 * Accomplish this in a non-GENERIC kernel by ifdef'ing out all but
26 * one of the vectors, which will not reside in .init.data. We then
27 * alias this one vector to alpha_mv, so no copy is needed.
28 *
29 * Upshot: set __initdata to nothing for non-GENERIC kernels.
30 *
31 * Note we do the same thing for the UNKNOWN kernel, as we need to write
32 * to the machine vector while setting it up.
33 */
34
35#if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_UNKNOWN)
36#define __initmv __attribute__((unused,__section__ (".machvec.init")))
37#define ALIAS_MV(x)
38#else
39#define __initmv
40
41/* GCC actually has a syntax for defining aliases, but is under some
42 delusion that you shouldn't be able to declare it extern somewhere
43 else beforehand. Fine. We'll do it ourselves. */
44#if 0
45#define ALIAS_MV(system) \
46 struct sh_machine_vector sh_mv __attribute__((alias("mv_"#system)));
47#else
48#define ALIAS_MV(system) \
49 asm(".global sh_mv\nsh_mv = mv_"#system );
50#endif
51#endif /* GENERIC */
52
53#endif /* __SH_MACHVEC_INIT_H */
diff --git a/include/asm-sh/mmzone.h b/include/asm-sh/mmzone.h
new file mode 100644
index 000000000000..7969f381dff2
--- /dev/null
+++ b/include/asm-sh/mmzone.h
@@ -0,0 +1,46 @@
1#ifndef __ASM_SH_MMZONE_H
2#define __ASM_SH_MMZONE_H
3
4#ifdef __KERNEL__
5
6#ifdef CONFIG_NEED_MULTIPLE_NODES
7extern struct pglist_data *node_data[];
8#define NODE_DATA(nid) (node_data[nid])
9
10#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
11#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \
12 NODE_DATA(nid)->node_spanned_pages)
13
14static inline int pfn_to_nid(unsigned long pfn)
15{
16 int nid;
17
18 for (nid = 0; nid < MAX_NUMNODES; nid++)
19 if (pfn >= node_start_pfn(nid) && pfn <= node_end_pfn(nid))
20 break;
21
22 return nid;
23}
24
25static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn)
26{
27 return NODE_DATA(pfn_to_nid(pfn));
28}
29
30/* arch/sh/mm/numa.c */
31void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end);
32#else
33static inline void
34setup_bootmem_node(int nid, unsigned long start, unsigned long end)
35{
36}
37#endif /* CONFIG_NEED_MULTIPLE_NODES */
38
39/* Platform specific mem init */
40void __init plat_mem_setup(void);
41
42/* arch/sh/kernel/setup.c */
43void __init setup_bootmem_allocator(unsigned long start_pfn);
44
45#endif /* __KERNEL__ */
46#endif /* __ASM_SH_MMZONE_H */
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h
index 7464de4ba07d..6bc9bba10105 100644
--- a/include/asm-sh/page.h
+++ b/include/asm-sh/page.h
@@ -60,6 +60,7 @@ extern void (*copy_page)(void *to, void *from);
60 60
61extern unsigned long shm_align_mask; 61extern unsigned long shm_align_mask;
62extern unsigned long max_low_pfn, min_low_pfn; 62extern unsigned long max_low_pfn, min_low_pfn;
63extern unsigned long memory_start, memory_end;
63 64
64#ifdef CONFIG_MMU 65#ifdef CONFIG_MMU
65extern void clear_page_slow(void *to); 66extern void clear_page_slow(void *to);
@@ -134,7 +135,9 @@ typedef struct { unsigned long pgd; } pgd_t;
134#define PFN_START (__MEMORY_START >> PAGE_SHIFT) 135#define PFN_START (__MEMORY_START >> PAGE_SHIFT)
135#define ARCH_PFN_OFFSET (PFN_START) 136#define ARCH_PFN_OFFSET (PFN_START)
136#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 137#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
138#ifdef CONFIG_FLATMEM
137#define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_low_pfn) 139#define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_low_pfn)
140#endif
138#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 141#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
139 142
140#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 143#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
@@ -148,5 +151,12 @@ typedef struct { unsigned long pgd; } pgd_t;
148#define __HAVE_ARCH_GATE_AREA 151#define __HAVE_ARCH_GATE_AREA
149#endif 152#endif
150 153
154/*
155 * Slub defaults to 8-byte alignment, we're only interested in 4.
156 * Slab defaults to BYTES_PER_WORD, which ends up being the same anyways.
157 */
158#define ARCH_KMALLOC_MINALIGN 4
159#define ARCH_SLAB_MINALIGN 4
160
151#endif /* __KERNEL__ */ 161#endif /* __KERNEL__ */
152#endif /* __ASM_SH_PAGE_H */ 162#endif /* __ASM_SH_PAGE_H */
diff --git a/include/asm-sh/parport.h b/include/asm-sh/parport.h
new file mode 100644
index 000000000000..f67ba60a2acd
--- /dev/null
+++ b/include/asm-sh/parport.h
@@ -0,0 +1,16 @@
1/*
2 * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
3 *
4 * This file should only be included by drivers/parport/parport_pc.c.
5 */
6#ifndef __ASM_SH_PARPORT_H
7#define __ASM_SH_PARPORT_H
8
9static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma);
10
11static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma)
12{
13 return parport_pc_find_isa_ports(autoirq, autodma);
14}
15
16#endif /* __ASM_SH_PARPORT_H */
diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h
index b1f9a9e0231e..2757ce096ff7 100644
--- a/include/asm-sh/pci.h
+++ b/include/asm-sh/pci.h
@@ -110,11 +110,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
110#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) 110#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
111#endif 111#endif
112 112
113/* Not supporting more than 32-bit PCI bus addresses now, but
114 * must satisfy references to this function. Change if needed.
115 */
116#define pci_dac_dma_supported(pci_dev, mask) (0)
117
118#ifdef CONFIG_PCI 113#ifdef CONFIG_PCI
119static inline void pci_dma_burst_advice(struct pci_dev *pdev, 114static inline void pci_dma_burst_advice(struct pci_dev *pdev,
120 enum pci_dma_burst_strategy *strat, 115 enum pci_dma_burst_strategy *strat,
@@ -134,10 +129,6 @@ int pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin);
134int pciauto_assign_resources(int busno, struct pci_channel *hose); 129int pciauto_assign_resources(int busno, struct pci_channel *hose);
135#endif 130#endif
136 131
137static inline void pcibios_add_platform_entries(struct pci_dev *dev)
138{
139}
140
141#endif /* __KERNEL__ */ 132#endif /* __KERNEL__ */
142 133
143/* generic pci stuff */ 134/* generic pci stuff */
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index 5b523c7e7d99..22efffe45019 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -402,12 +402,8 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
402#define pte_file(pte) (pte_val(pte) & _PAGE_FILE) 402#define pte_file(pte) (pte_val(pte) & _PAGE_FILE)
403 403
404#ifdef CONFIG_X2TLB 404#ifdef CONFIG_X2TLB
405#define pte_read(pte) ((pte).pte_high & _PAGE_EXT_USER_READ)
406#define pte_exec(pte) ((pte).pte_high & _PAGE_EXT_USER_EXEC)
407#define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE) 405#define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE)
408#else 406#else
409#define pte_read(pte) (pte_val(pte) & _PAGE_USER)
410#define pte_exec(pte) (pte_val(pte) & _PAGE_USER)
411#define pte_write(pte) (pte_val(pte) & _PAGE_RW) 407#define pte_write(pte) (pte_val(pte) & _PAGE_RW)
412#endif 408#endif
413 409
@@ -420,20 +416,12 @@ static inline pte_t pte_##fn(pte_t pte) { pte.pte_##h op; return pte; }
420 * individually toggled (and user permissions are entirely decoupled from 416 * individually toggled (and user permissions are entirely decoupled from
421 * kernel permissions), we attempt to couple them a bit more sanely here. 417 * kernel permissions), we attempt to couple them a bit more sanely here.
422 */ 418 */
423PTE_BIT_FUNC(high, rdprotect, &= ~_PAGE_EXT_USER_READ);
424PTE_BIT_FUNC(high, mkread, |= _PAGE_EXT_USER_READ | _PAGE_EXT_KERN_READ);
425PTE_BIT_FUNC(high, wrprotect, &= ~_PAGE_EXT_USER_WRITE); 419PTE_BIT_FUNC(high, wrprotect, &= ~_PAGE_EXT_USER_WRITE);
426PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE); 420PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE);
427PTE_BIT_FUNC(high, exprotect, &= ~_PAGE_EXT_USER_EXEC);
428PTE_BIT_FUNC(high, mkexec, |= _PAGE_EXT_USER_EXEC | _PAGE_EXT_KERN_EXEC);
429PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE); 421PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE);
430#else 422#else
431PTE_BIT_FUNC(low, rdprotect, &= ~_PAGE_USER);
432PTE_BIT_FUNC(low, mkread, |= _PAGE_USER);
433PTE_BIT_FUNC(low, wrprotect, &= ~_PAGE_RW); 423PTE_BIT_FUNC(low, wrprotect, &= ~_PAGE_RW);
434PTE_BIT_FUNC(low, mkwrite, |= _PAGE_RW); 424PTE_BIT_FUNC(low, mkwrite, |= _PAGE_RW);
435PTE_BIT_FUNC(low, exprotect, &= ~_PAGE_USER);
436PTE_BIT_FUNC(low, mkexec, |= _PAGE_USER);
437PTE_BIT_FUNC(low, mkhuge, |= _PAGE_SZHUGE); 425PTE_BIT_FUNC(low, mkhuge, |= _PAGE_SZHUGE);
438#endif 426#endif
439 427
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index d42f68e724fa..2252e75daa26 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -36,7 +36,7 @@
36 */ 36 */
37enum cpu_type { 37enum cpu_type {
38 /* SH-2 types */ 38 /* SH-2 types */
39 CPU_SH7604, CPU_SH7619, 39 CPU_SH7619,
40 40
41 /* SH-2A types */ 41 /* SH-2A types */
42 CPU_SH7206, 42 CPU_SH7206,
@@ -52,7 +52,7 @@ enum cpu_type {
52 CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501, 52 CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501,
53 53
54 /* SH-4A types */ 54 /* SH-4A types */
55 CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, 55 CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3,
56 56
57 /* SH4AL-DSP types */ 57 /* SH4AL-DSP types */
58 CPU_SH73180, CPU_SH7343, CPU_SH7722, 58 CPU_SH73180, CPU_SH7343, CPU_SH7722,
@@ -228,11 +228,7 @@ static __inline__ void grab_fpu(struct pt_regs *regs)
228 regs->sr &= ~SR_FD; 228 regs->sr &= ~SR_FD;
229} 229}
230 230
231#ifdef CONFIG_CPU_SH4
232extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs); 231extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs);
233#else
234#define save_fpu(tsk) do { } while (0)
235#endif
236 232
237#define unlazy_fpu(tsk, regs) do { \ 233#define unlazy_fpu(tsk, regs) do { \
238 if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \ 234 if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \
diff --git a/include/asm-sh/rwsem.h b/include/asm-sh/rwsem.h
index 4931ba817d73..1987f3ea7f1b 100644
--- a/include/asm-sh/rwsem.h
+++ b/include/asm-sh/rwsem.h
@@ -1,11 +1,15 @@
1/* 1/*
2 * include/asm-ppc/rwsem.h: R/W semaphores for SH using the stuff 2 * include/asm-sh/rwsem.h: R/W semaphores for SH using the stuff
3 * in lib/rwsem.c. 3 * in lib/rwsem.c.
4 */ 4 */
5 5
6#ifndef _ASM_SH_RWSEM_H 6#ifndef _ASM_SH_RWSEM_H
7#define _ASM_SH_RWSEM_H 7#define _ASM_SH_RWSEM_H
8 8
9#ifndef _LINUX_RWSEM_H
10#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead"
11#endif
12
9#ifdef __KERNEL__ 13#ifdef __KERNEL__
10#include <linux/list.h> 14#include <linux/list.h>
11#include <linux/spinlock.h> 15#include <linux/spinlock.h>
diff --git a/include/asm-sh/saturn/io.h b/include/asm-sh/saturn/io.h
deleted file mode 100644
index f1b9b5d633f4..000000000000
--- a/include/asm-sh/saturn/io.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * include/asm-sh/saturn/io.h
3 *
4 * I/O functions for use on the Sega Saturn.
5 *
6 * Copyright (C) 2002 Paul Mundt
7 *
8 * Released under the terms of the GNU GPL v2.0.
9 */
10#ifndef __ASM_SH_SATURN_IO_H
11#define __ASM_SH_SATURN_IO_H
12
13/* arch/sh/boards/saturn/io.c */
14extern unsigned long saturn_isa_port2addr(unsigned long offset);
15extern void *saturn_ioremap(unsigned long offset, unsigned long size);
16extern void saturn_iounmap(void *addr);
17
18#endif /* __ASM_SH_SATURN_IO_H */
19
diff --git a/include/asm-sh/saturn/smpc.h b/include/asm-sh/saturn/smpc.h
deleted file mode 100644
index 5de5c12d6347..000000000000
--- a/include/asm-sh/saturn/smpc.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * include/asm-sh/saturn/smpc.h
3 *
4 * System Manager / Peripheral Control definitions.
5 *
6 * Copyright (C) 2002 Paul Mundt
7 *
8 * Released under the terms of the GNU GPL v2.0.
9 */
10#ifndef __ASM_SH_SATURN_SMPC_H
11#define __ASM_SH_SATURN_SMPC_H
12
13#include <asm/io.h>
14
15#define SMPC_COMMAND 0x2010001f /* SMPC command register */
16#define SMPC_RESULT 0x2010005f /* SMPC result register */
17#define SMPC_STATUS 0x20100063 /* SMPC status register */
18
19#define SMPC_CMD_MSHON 0x0001 /* Master SH On */
20#define SMPC_CMD_SSHON 0x0002 /* Slave SH On */
21#define SMPC_CMD_SSHOFF 0x0003 /* Slave SH Off */
22#define SMPC_CMD_SNDON 0x0004 /* Sound On */
23#define SMPC_CMD_SNDOFF 0x0005 /* Sound Off */
24#define SMPC_CMD_CDON 0x0006 /* CD On */
25#define SMPC_CMD_CDOFF 0x0007 /* CD Off */
26
27static inline void smpc_barrier(void)
28{
29 while ((ctrl_inb(SMPC_STATUS) & 0x0001) == 0x0001)
30 ;
31}
32
33#endif /* __ASM_SH_SATURN_SMPC_H */
34
diff --git a/include/asm-sh/se73180.h b/include/asm-sh/se73180.h
index 3a4acb3e38a1..907c062b4c9a 100644
--- a/include/asm-sh/se73180.h
+++ b/include/asm-sh/se73180.h
@@ -1,9 +1,7 @@
1#ifndef __ASM_SH_HITACHI_SE73180_H 1#ifndef __ASM_SH_SE73180_H
2#define __ASM_SH_HITACHI_SE73180_H 2#define __ASM_SH_SE73180_H
3 3
4/* 4/*
5 * include/asm-sh/se/se73180.h
6 *
7 * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp> 5 * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp>
8 * 6 *
9 * SH-Mobile SolutionEngine 73180 support 7 * SH-Mobile SolutionEngine 73180 support
@@ -62,4 +60,7 @@
62#define __IO_PREFIX sh73180se 60#define __IO_PREFIX sh73180se
63#include <asm/io_generic.h> 61#include <asm/io_generic.h>
64 62
65#endif /* __ASM_SH_HITACHI_SE73180_H */ 63/* arch/sh/boards/se/73180/irq.c */
64int shmse_irq_demux(int irq);
65
66#endif /* __ASM_SH_SE73180_H */
diff --git a/include/asm-sh/se7722.h b/include/asm-sh/se7722.h
index b3b31e4725c6..e0e89fcb8388 100644
--- a/include/asm-sh/se7722.h
+++ b/include/asm-sh/se7722.h
@@ -81,36 +81,32 @@
81/* IRQ */ 81/* IRQ */
82#define IRQ0_IRQ 32 82#define IRQ0_IRQ 32
83#define IRQ1_IRQ 33 83#define IRQ1_IRQ 33
84#define INTC_ICR0 0xA4140000UL
85#define INTC_ICR1 0xA414001CUL
86
87#define INTMSK0 0xa4140044
88#define INTMSKCLR0 0xa4140064
89#define INTC_INTPRI0 0xa4140010
90 84
91#define IRQ01_MODE 0xb1800000 85#define IRQ01_MODE 0xb1800000
92#define IRQ01_STS 0xb1800004 86#define IRQ01_STS 0xb1800004
93#define IRQ01_MASK 0xb1800008 87#define IRQ01_MASK 0xb1800008
94#define EXT_BIT (0x3fc0) /* SH IRQ1 */
95#define MRSHPC_BIT0 (0x0004) /* SH IRQ1 */
96#define MRSHPC_BIT1 (0x0008) /* SH IRQ1 */
97#define MRSHPC_BIT2 (0x0010) /* SH IRQ1 */
98#define MRSHPC_BIT3 (0x0020) /* SH IRQ1 */
99#define SMC_BIT (0x0002) /* SH IRQ0 */
100#define USB_BIT (0x0001) /* SH IRQ0 */
101
102#define MRSHPC_IRQ3 11
103#define MRSHPC_IRQ2 12
104#define MRSHPC_IRQ1 13
105#define MRSHPC_IRQ0 14
106#define SMC_IRQ 10
107#define EXT_IRQ 5
108#define USB_IRQ 6
109 88
89/* Bits in IRQ01_* registers */
90
91#define SE7722_FPGA_IRQ_USB 0 /* IRQ0 */
92#define SE7722_FPGA_IRQ_SMC 1 /* IRQ0 */
93#define SE7722_FPGA_IRQ_MRSHPC0 2 /* IRQ1 */
94#define SE7722_FPGA_IRQ_MRSHPC1 3 /* IRQ1 */
95#define SE7722_FPGA_IRQ_MRSHPC2 4 /* IRQ1 */
96#define SE7722_FPGA_IRQ_MRSHPC3 5 /* IRQ1 */
97
98#define SE7722_FPGA_IRQ_NR 6
99#define SE7722_FPGA_IRQ_BASE 110
100
101#define MRSHPC_IRQ3 (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC3)
102#define MRSHPC_IRQ2 (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC2)
103#define MRSHPC_IRQ1 (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC1)
104#define MRSHPC_IRQ0 (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC0)
105#define SMC_IRQ (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_SMC)
106#define USB_IRQ (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_USB)
110 107
111/* arch/sh/boards/se/7722/irq.c */ 108/* arch/sh/boards/se/7722/irq.c */
112void init_se7722_IRQ(void); 109void init_se7722_IRQ(void);
113int se7722_irq_demux(int);
114 110
115#define __IO_PREFIX se7722 111#define __IO_PREFIX se7722
116#include <asm/io_generic.h> 112#include <asm/io_generic.h>
diff --git a/include/asm-sh/sections.h b/include/asm-sh/sections.h
index 57abd708b236..2a696b8ee4f5 100644
--- a/include/asm-sh/sections.h
+++ b/include/asm-sh/sections.h
@@ -3,7 +3,7 @@
3 3
4#include <asm-generic/sections.h> 4#include <asm-generic/sections.h>
5 5
6extern char _end[]; 6extern long __machvec_start, __machvec_end;
7 7
8#endif /* __ASM_SH_SECTIONS_H */ 8#endif /* __ASM_SH_SECTIONS_H */
9 9
diff --git a/include/asm-sh/setup.h b/include/asm-sh/setup.h
index 1583c6b7bdaa..586a9711a75d 100644
--- a/include/asm-sh/setup.h
+++ b/include/asm-sh/setup.h
@@ -6,6 +6,7 @@
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7 7
8int setup_early_printk(char *); 8int setup_early_printk(char *);
9void sh_mv_setup(void);
9 10
10#endif /* __KERNEL__ */ 11#endif /* __KERNEL__ */
11 12
diff --git a/include/asm-sh/sh03/io.h b/include/asm-sh/sh03/io.h
index df3b187ef883..4ff1eb900301 100644
--- a/include/asm-sh/sh03/io.h
+++ b/include/asm-sh/sh03/io.h
@@ -14,22 +14,18 @@
14#define INTC_IPRD 0xffd00010UL 14#define INTC_IPRD 0xffd00010UL
15 15
16#define IRL0_IRQ 2 16#define IRL0_IRQ 2
17#define IRL0_IPR_ADDR INTC_IPRD
18#define IRL0_IPR_POS 3 17#define IRL0_IPR_POS 3
19#define IRL0_PRIORITY 13 18#define IRL0_PRIORITY 13
20 19
21#define IRL1_IRQ 5 20#define IRL1_IRQ 5
22#define IRL1_IPR_ADDR INTC_IPRD
23#define IRL1_IPR_POS 2 21#define IRL1_IPR_POS 2
24#define IRL1_PRIORITY 10 22#define IRL1_PRIORITY 10
25 23
26#define IRL2_IRQ 8 24#define IRL2_IRQ 8
27#define IRL2_IPR_ADDR INTC_IPRD
28#define IRL2_IPR_POS 1 25#define IRL2_IPR_POS 1
29#define IRL2_PRIORITY 7 26#define IRL2_PRIORITY 7
30 27
31#define IRL3_IRQ 11 28#define IRL3_IRQ 11
32#define IRL3_IPR_ADDR INTC_IPRD
33#define IRL3_IPR_POS 0 29#define IRL3_IPR_POS 0
34#define IRL3_PRIORITY 4 30#define IRL3_PRIORITY 4
35 31
diff --git a/include/asm-sh/smp.h b/include/asm-sh/smp.h
index caa7b93f1bce..b99ca786c0c1 100644
--- a/include/asm-sh/smp.h
+++ b/include/asm-sh/smp.h
@@ -39,4 +39,6 @@ extern struct smp_fn_call_struct smp_fn_call;
39 39
40#endif /* CONFIG_SMP */ 40#endif /* CONFIG_SMP */
41 41
42#define hard_smp_processor_id() (0)
43
42#endif /* __ASM_SH_SMP_H */ 44#endif /* __ASM_SH_SMP_H */
diff --git a/include/asm-sh/snapgear.h b/include/asm-sh/snapgear.h
index 2d712e72c9e5..3554e3a74e99 100644
--- a/include/asm-sh/snapgear.h
+++ b/include/asm-sh/snapgear.h
@@ -20,22 +20,18 @@
20 */ 20 */
21 21
22#define IRL0_IRQ 2 22#define IRL0_IRQ 2
23#define IRL0_IPR_ADDR INTC_IPRD
24#define IRL0_IPR_POS 3 23#define IRL0_IPR_POS 3
25#define IRL0_PRIORITY 13 24#define IRL0_PRIORITY 13
26 25
27#define IRL1_IRQ 5 26#define IRL1_IRQ 5
28#define IRL1_IPR_ADDR INTC_IPRD
29#define IRL1_IPR_POS 2 27#define IRL1_IPR_POS 2
30#define IRL1_PRIORITY 10 28#define IRL1_PRIORITY 10
31 29
32#define IRL2_IRQ 8 30#define IRL2_IRQ 8
33#define IRL2_IPR_ADDR INTC_IPRD
34#define IRL2_IPR_POS 1 31#define IRL2_IPR_POS 1
35#define IRL2_PRIORITY 7 32#define IRL2_PRIORITY 7
36 33
37#define IRL3_IRQ 11 34#define IRL3_IRQ 11
38#define IRL3_IPR_ADDR INTC_IPRD
39#define IRL3_IPR_POS 0 35#define IRL3_IPR_POS 0
40#define IRL3_PRIORITY 4 36#define IRL3_PRIORITY 4
41#endif 37#endif
diff --git a/include/asm-sh/sparsemem.h b/include/asm-sh/sparsemem.h
new file mode 100644
index 000000000000..547a540b6667
--- /dev/null
+++ b/include/asm-sh/sparsemem.h
@@ -0,0 +1,16 @@
1#ifndef __ASM_SH_SPARSEMEM_H
2#define __ASM_SH_SPARSEMEM_H
3
4#ifdef __KERNEL__
5/*
6 * SECTION_SIZE_BITS 2^N: how big each section will be
7 * MAX_PHYSADDR_BITS 2^N: how much physical address space we have
8 * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
9 */
10#define SECTION_SIZE_BITS 26
11#define MAX_PHYSADDR_BITS 32
12#define MAX_PHYSMEM_BITS 32
13
14#endif
15
16#endif /* __ASM_SH_SPARSEMEM_H */
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index 82f3e229e621..245042537205 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -8,9 +8,13 @@
8 8
9#include <linux/irqflags.h> 9#include <linux/irqflags.h>
10#include <linux/compiler.h> 10#include <linux/compiler.h>
11#include <linux/linkage.h>
11#include <asm/types.h> 12#include <asm/types.h>
12#include <asm/ptrace.h> 13#include <asm/ptrace.h>
13 14
15struct task_struct *__switch_to(struct task_struct *prev,
16 struct task_struct *next);
17
14/* 18/*
15 * switch_to() should switch tasks to task nr n, first 19 * switch_to() should switch tasks to task nr n, first
16 */ 20 */
@@ -60,16 +64,6 @@
60 last = __last; \ 64 last = __last; \
61} while (0) 65} while (0)
62 66
63/*
64 * On SMP systems, when the scheduler does migration-cost autodetection,
65 * it needs a way to flush as much of the CPU's caches as possible.
66 *
67 * TODO: fill this in!
68 */
69static inline void sched_cacheflush(void)
70{
71}
72
73#ifdef CONFIG_CPU_SH4A 67#ifdef CONFIG_CPU_SH4A
74#define __icbi() \ 68#define __icbi() \
75{ \ 69{ \
@@ -122,7 +116,7 @@ static inline void sched_cacheflush(void)
122#define smp_read_barrier_depends() do { } while(0) 116#define smp_read_barrier_depends() do { } while(0)
123#endif 117#endif
124 118
125#define set_mb(var, value) do { xchg(&var, value); } while (0) 119#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
126 120
127/* 121/*
128 * Jump to P2 area. 122 * Jump to P2 area.
@@ -271,6 +265,16 @@ extern unsigned int instruction_size(unsigned int insn);
271void disable_hlt(void); 265void disable_hlt(void);
272void enable_hlt(void); 266void enable_hlt(void);
273 267
268void default_idle(void);
269
270asmlinkage void break_point_trap(void);
271asmlinkage void debug_trap_handler(unsigned long r4, unsigned long r5,
272 unsigned long r6, unsigned long r7,
273 struct pt_regs __regs);
274asmlinkage void bug_trap_handler(unsigned long r4, unsigned long r5,
275 unsigned long r6, unsigned long r7,
276 struct pt_regs __regs);
277
274#define arch_align_stack(x) (x) 278#define arch_align_stack(x) (x)
275 279
276#endif 280#endif
diff --git a/include/asm-sh/termbits.h b/include/asm-sh/termbits.h
index f1b7b46f4e9a..7ee1b42eeab0 100644
--- a/include/asm-sh/termbits.h
+++ b/include/asm-sh/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct termios2 {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20struct ktermios { 31struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */ 32 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */ 33 tcflag_t c_oflag; /* output mode flags */
diff --git a/include/asm-sh/topology.h b/include/asm-sh/topology.h
index cff001c316fe..f402a3b1cfa4 100644
--- a/include/asm-sh/topology.h
+++ b/include/asm-sh/topology.h
@@ -1,6 +1,36 @@
1#ifndef _ASM_SH_TOPOLOGY_H 1#ifndef _ASM_SH_TOPOLOGY_H
2#define _ASM_SH_TOPOLOGY_H 2#define _ASM_SH_TOPOLOGY_H
3 3
4#ifdef CONFIG_NUMA
5
6/* sched_domains SD_NODE_INIT for sh machines */
7#define SD_NODE_INIT (struct sched_domain) { \
8 .span = CPU_MASK_NONE, \
9 .parent = NULL, \
10 .child = NULL, \
11 .groups = NULL, \
12 .min_interval = 8, \
13 .max_interval = 32, \
14 .busy_factor = 32, \
15 .imbalance_pct = 125, \
16 .cache_nice_tries = 2, \
17 .busy_idx = 3, \
18 .idle_idx = 2, \
19 .newidle_idx = 0, \
20 .wake_idx = 1, \
21 .forkexec_idx = 1, \
22 .flags = SD_LOAD_BALANCE \
23 | SD_BALANCE_FORK \
24 | SD_BALANCE_EXEC \
25 | SD_SERIALIZE \
26 | SD_WAKE_BALANCE, \
27 .last_balance = jiffies, \
28 .balance_interval = 1, \
29 .nr_balance_failed = 0, \
30}
31
32#endif
33
4#include <asm-generic/topology.h> 34#include <asm-generic/topology.h>
5 35
6#endif /* _ASM_SH_TOPOLOGY_H */ 36#endif /* _ASM_SH_TOPOLOGY_H */
diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h
index 5c49ed6715f2..f18a1a5c95c0 100644
--- a/include/asm-sh/uaccess.h
+++ b/include/asm-sh/uaccess.h
@@ -61,8 +61,6 @@ static inline void set_fs(mm_segment_t s)
61 */ 61 */
62static inline int __access_ok(unsigned long addr, unsigned long size) 62static inline int __access_ok(unsigned long addr, unsigned long size)
63{ 63{
64 extern unsigned long memory_start, memory_end;
65
66 return ((addr >= memory_start) && ((addr + size) < memory_end)); 64 return ((addr >= memory_start) && ((addr + size) < memory_end));
67} 65}
68#else /* CONFIG_MMU */ 66#else /* CONFIG_MMU */
@@ -76,7 +74,7 @@ static inline int __access_ok(unsigned long addr, unsigned long size)
76 * __access_ok: Check if address with size is OK or not. 74 * __access_ok: Check if address with size is OK or not.
77 * 75 *
78 * We do three checks: 76 * We do three checks:
79 * (1) is it user space? 77 * (1) is it user space?
80 * (2) addr + size --> carry? 78 * (2) addr + size --> carry?
81 * (3) addr + size >= 0x80000000 (PAGE_OFFSET) 79 * (3) addr + size >= 0x80000000 (PAGE_OFFSET)
82 * 80 *
@@ -142,11 +140,12 @@ static inline int access_ok(int type, const void __user *p, unsigned long size)
142 __get_user_nocheck((x),(ptr),sizeof(*(ptr))) 140 __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
143 141
144struct __large_struct { unsigned long buf[100]; }; 142struct __large_struct { unsigned long buf[100]; };
145#define __m(x) (*(struct __large_struct *)(x)) 143#define __m(x) (*(struct __large_struct __user *)(x))
146 144
147#define __get_user_size(x,ptr,size,retval) \ 145#define __get_user_size(x,ptr,size,retval) \
148do { \ 146do { \
149 retval = 0; \ 147 retval = 0; \
148 __chk_user_ptr(ptr); \
150 switch (size) { \ 149 switch (size) { \
151 case 1: \ 150 case 1: \
152 __get_user_asm(x, ptr, retval, "b"); \ 151 __get_user_asm(x, ptr, retval, "b"); \
@@ -175,6 +174,7 @@ do { \
175#define __get_user_check(x,ptr,size) \ 174#define __get_user_check(x,ptr,size) \
176({ \ 175({ \
177 long __gu_err, __gu_val; \ 176 long __gu_err, __gu_val; \
177 __chk_user_ptr(ptr); \
178 switch (size) { \ 178 switch (size) { \
179 case 1: \ 179 case 1: \
180 __get_user_1(__gu_val, (ptr), __gu_err); \ 180 __get_user_1(__gu_val, (ptr), __gu_err); \
@@ -300,6 +300,7 @@ extern void __get_user_unknown(void);
300#define __put_user_size(x,ptr,size,retval) \ 300#define __put_user_size(x,ptr,size,retval) \
301do { \ 301do { \
302 retval = 0; \ 302 retval = 0; \
303 __chk_user_ptr(ptr); \
303 switch (size) { \ 304 switch (size) { \
304 case 1: \ 305 case 1: \
305 __put_user_asm(x, ptr, retval, "b"); \ 306 __put_user_asm(x, ptr, retval, "b"); \
@@ -328,7 +329,7 @@ do { \
328#define __put_user_check(x,ptr,size) \ 329#define __put_user_check(x,ptr,size) \
329({ \ 330({ \
330 long __pu_err = -EFAULT; \ 331 long __pu_err = -EFAULT; \
331 __typeof__(*(ptr)) *__pu_addr = (ptr); \ 332 __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
332 \ 333 \
333 if (__access_ok((unsigned long)__pu_addr,size)) \ 334 if (__access_ok((unsigned long)__pu_addr,size)) \
334 __put_user_size((x),__pu_addr,(size),__pu_err); \ 335 __put_user_size((x),__pu_addr,(size),__pu_err); \
@@ -406,10 +407,10 @@ __asm__ __volatile__( \
406#endif 407#endif
407 408
408extern void __put_user_unknown(void); 409extern void __put_user_unknown(void);
409 410
410/* Generic arbitrary sized copy. */ 411/* Generic arbitrary sized copy. */
411/* Return the number of bytes NOT copied */ 412/* Return the number of bytes NOT copied */
412extern __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n); 413__kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n);
413 414
414#define copy_to_user(to,from,n) ({ \ 415#define copy_to_user(to,from,n) ({ \
415void *__copy_to = (void *) (to); \ 416void *__copy_to = (void *) (to); \
@@ -420,14 +421,6 @@ __copy_res = __copy_user(__copy_to, (void *) (from), __copy_size); \
420} else __copy_res = __copy_size; \ 421} else __copy_res = __copy_size; \
421__copy_res; }) 422__copy_res; })
422 423
423#define __copy_to_user(to,from,n) \
424 __copy_user((void *)(to), \
425 (void *)(from), n)
426
427#define __copy_to_user_inatomic __copy_to_user
428#define __copy_from_user_inatomic __copy_from_user
429
430
431#define copy_from_user(to,from,n) ({ \ 424#define copy_from_user(to,from,n) ({ \
432void *__copy_to = (void *) (to); \ 425void *__copy_to = (void *) (to); \
433void *__copy_from = (void *) (from); \ 426void *__copy_from = (void *) (from); \
@@ -438,9 +431,20 @@ __copy_res = __copy_user(__copy_to, __copy_from, __copy_size); \
438} else __copy_res = __copy_size; \ 431} else __copy_res = __copy_size; \
439__copy_res; }) 432__copy_res; })
440 433
441#define __copy_from_user(to,from,n) \ 434static __always_inline unsigned long
442 __copy_user((void *)(to), \ 435__copy_from_user(void *to, const void __user *from, unsigned long n)
443 (void *)(from), n) 436{
437 return __copy_user(to, (__force void *)from, n);
438}
439
440static __always_inline unsigned long __must_check
441__copy_to_user(void __user *to, const void *from, unsigned long n)
442{
443 return __copy_user((__force void *)to, from, n);
444}
445
446#define __copy_to_user_inatomic __copy_to_user
447#define __copy_from_user_inatomic __copy_from_user
444 448
445/* 449/*
446 * Clear the area and return remaining number of bytes 450 * Clear the area and return remaining number of bytes
diff --git a/include/asm-sh/ubc.h b/include/asm-sh/ubc.h
index ae9bbdeefbe1..38d46e01b846 100644
--- a/include/asm-sh/ubc.h
+++ b/include/asm-sh/ubc.h
@@ -51,9 +51,14 @@
51#define BRCR_UBDE (1 << 0) 51#define BRCR_UBDE (1 << 0)
52 52
53#ifndef __ASSEMBLY__ 53#ifndef __ASSEMBLY__
54/* arch/sh/kernel/ubc.S */ 54/* arch/sh/kernel/cpu/ubc.S */
55extern void ubc_wakeup(void);
56extern void ubc_sleep(void); 55extern void ubc_sleep(void);
56
57#ifdef CONFIG_UBC_WAKEUP
58extern void ubc_wakeup(void);
59#else
60#define ubc_wakeup() do { } while (0)
61#endif
57#endif 62#endif
58 63
59#endif /* __KERNEL__ */ 64#endif /* __KERNEL__ */
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index 77bcb09d6ac8..b182b1cb05fd 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -332,8 +332,9 @@
332#define __NR_signalfd 321 332#define __NR_signalfd 321
333#define __NR_timerfd 322 333#define __NR_timerfd 322
334#define __NR_eventfd 323 334#define __NR_eventfd 323
335#define __NR_fallocate 324
335 336
336#define NR_syscalls 324 337#define NR_syscalls 325
337 338
338#ifdef __KERNEL__ 339#ifdef __KERNEL__
339 340
diff --git a/include/asm-sh64/a.out.h b/include/asm-sh64/a.out.h
index e1995e86b663..237ee4e5b72a 100644
--- a/include/asm-sh64/a.out.h
+++ b/include/asm-sh64/a.out.h
@@ -31,6 +31,7 @@ struct exec
31#ifdef __KERNEL__ 31#ifdef __KERNEL__
32 32
33#define STACK_TOP TASK_SIZE 33#define STACK_TOP TASK_SIZE
34#define STACK_TOP_MAX STACK_TOP
34 35
35#endif 36#endif
36 37
diff --git a/include/asm-sh64/fb.h b/include/asm-sh64/fb.h
new file mode 100644
index 000000000000..d92e99cd8c8a
--- /dev/null
+++ b/include/asm-sh64/fb.h
@@ -0,0 +1,19 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7
8static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
9 unsigned long off)
10{
11 vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
12}
13
14static inline int fb_is_primary_device(struct fb_info *info)
15{
16 return 0;
17}
18
19#endif /* _ASM_FB_H_ */
diff --git a/include/asm-sh64/pci.h b/include/asm-sh64/pci.h
index aa8043089bb6..57a67cf7a5c4 100644
--- a/include/asm-sh64/pci.h
+++ b/include/asm-sh64/pci.h
@@ -72,11 +72,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
72#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) 72#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
73#endif 73#endif
74 74
75/* Not supporting more than 32-bit PCI bus addresses now, but
76 * must satisfy references to this function. Change if needed.
77 */
78#define pci_dac_dma_supported(pci_dev, mask) (0)
79
80/* These macros should be used after a pci_map_sg call has been done 75/* These macros should be used after a pci_map_sg call has been done
81 * to get bus addresses of each of the SG entries and their lengths. 76 * to get bus addresses of each of the SG entries and their lengths.
82 * You should only work with the number of sg entries pci_map_sg 77 * You should only work with the number of sg entries pci_map_sg
@@ -104,10 +99,6 @@ extern void pcibios_fixup_irqs(void);
104extern int pciauto_assign_resources(int busno, struct pci_channel *hose); 99extern int pciauto_assign_resources(int busno, struct pci_channel *hose);
105#endif 100#endif
106 101
107static inline void pcibios_add_platform_entries(struct pci_dev *dev)
108{
109}
110
111#endif /* __KERNEL__ */ 102#endif /* __KERNEL__ */
112 103
113/* generic pci stuff */ 104/* generic pci stuff */
diff --git a/include/asm-sh64/pgtable.h b/include/asm-sh64/pgtable.h
index b875482eb592..3488fe32e436 100644
--- a/include/asm-sh64/pgtable.h
+++ b/include/asm-sh64/pgtable.h
@@ -415,22 +415,15 @@ extern void __handle_bad_pmd_kernel(pmd_t * pmd);
415/* 415/*
416 * The following have defined behavior only work if pte_present() is true. 416 * The following have defined behavior only work if pte_present() is true.
417 */ 417 */
418static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_READ; }
419static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXECUTE; }
420static inline int pte_dirty(pte_t pte){ return pte_val(pte) & _PAGE_DIRTY; } 418static inline int pte_dirty(pte_t pte){ return pte_val(pte) & _PAGE_DIRTY; }
421static inline int pte_young(pte_t pte){ return pte_val(pte) & _PAGE_ACCESSED; } 419static inline int pte_young(pte_t pte){ return pte_val(pte) & _PAGE_ACCESSED; }
422static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 420static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
423static inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_WRITE; } 421static inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_WRITE; }
424 422
425static inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_READ)); return pte; }
426static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; } 423static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; }
427static inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_EXECUTE)); return pte; }
428static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } 424static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
429static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } 425static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; }
430
431static inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_READ)); return pte; }
432static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_WRITE)); return pte; } 426static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_WRITE)); return pte; }
433static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_EXECUTE)); return pte; }
434static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } 427static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
435static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } 428static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
436static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } 429static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; }
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h
index ea3adc600b41..1a5197f369b2 100644
--- a/include/asm-sh64/unistd.h
+++ b/include/asm-sh64/unistd.h
@@ -374,10 +374,11 @@
374#define __NR_signalfd 349 374#define __NR_signalfd 349
375#define __NR_timerfd 350 375#define __NR_timerfd 350
376#define __NR_eventfd 351 376#define __NR_eventfd 351
377#define __NR_fallocate 352
377 378
378#ifdef __KERNEL__ 379#ifdef __KERNEL__
379 380
380#define NR_syscalls 352 381#define NR_syscalls 353
381 382
382#define __ARCH_WANT_IPC_PARSE_VERSION 383#define __ARCH_WANT_IPC_PARSE_VERSION
383#define __ARCH_WANT_OLD_READDIR 384#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-sparc/a.out.h b/include/asm-sparc/a.out.h
index 9090060a23e6..917e04250696 100644
--- a/include/asm-sparc/a.out.h
+++ b/include/asm-sparc/a.out.h
@@ -92,6 +92,7 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */
92#include <asm/page.h> 92#include <asm/page.h>
93 93
94#define STACK_TOP (PAGE_OFFSET - PAGE_SIZE) 94#define STACK_TOP (PAGE_OFFSET - PAGE_SIZE)
95#define STACK_TOP_MAX STACK_TOP
95 96
96#endif /* __KERNEL__ */ 97#endif /* __KERNEL__ */
97 98
diff --git a/include/asm-sparc/device.h b/include/asm-sparc/device.h
index d8f9872b0e2d..4a56d84d69c4 100644
--- a/include/asm-sparc/device.h
+++ b/include/asm-sparc/device.h
@@ -3,5 +3,17 @@
3 * 3 *
4 * This file is released under the GPLv2 4 * This file is released under the GPLv2
5 */ 5 */
6#include <asm-generic/device.h> 6#ifndef _ASM_SPARC_DEVICE_H
7#define _ASM_SPARC_DEVICE_H
8
9struct device_node;
10struct of_device;
11
12struct dev_archdata {
13 struct device_node *prom_node;
14 struct of_device *op;
15};
16
17#endif /* _ASM_SPARC_DEVICE_H */
18
7 19
diff --git a/include/asm-sparc/fb.h b/include/asm-sparc/fb.h
new file mode 100644
index 000000000000..c73ca081e1f5
--- /dev/null
+++ b/include/asm-sparc/fb.h
@@ -0,0 +1,21 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4#include <asm/prom.h>
5
6#define fb_pgprotect(...) do {} while (0)
7
8static inline int fb_is_primary_device(struct fb_info *info)
9{
10 struct device *dev = info->device;
11 struct device_node *node;
12
13 node = dev->archdata.prom_node;
14 if (node &&
15 node == of_console_device)
16 return 1;
17
18 return 0;
19}
20
21#endif /* _ASM_FB_H_ */
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h
index ff520ea97473..afb88a5973f0 100644
--- a/include/asm-sparc/irq.h
+++ b/include/asm-sparc/irq.h
@@ -7,178 +7,16 @@
7#ifndef _SPARC_IRQ_H 7#ifndef _SPARC_IRQ_H
8#define _SPARC_IRQ_H 8#define _SPARC_IRQ_H
9 9
10#include <linux/linkage.h>
11#include <linux/threads.h> /* For NR_CPUS */
12#include <linux/interrupt.h> 10#include <linux/interrupt.h>
13 11
14#include <asm/system.h> /* For SUN4M_NCPUS */
15#include <asm/btfixup.h>
16
17#define __irq_ino(irq) irq
18#define __irq_pil(irq) irq
19
20#define NR_IRQS 16 12#define NR_IRQS 16
21 13
22#define irq_canonicalize(irq) (irq) 14#define irq_canonicalize(irq) (irq)
23 15
24/* Dave Redman (djhr@tadpole.co.uk) 16extern void disable_irq_nosync(unsigned int irq);
25 * changed these to function pointers.. it saves cycles and will allow 17extern void disable_irq(unsigned int irq);
26 * the irq dependencies to be split into different files at a later date 18extern void enable_irq(unsigned int irq);
27 * sun4c_irq.c, sun4m_irq.c etc so we could reduce the kernel size.
28 * Jakub Jelinek (jj@sunsite.mff.cuni.cz)
29 * Changed these to btfixup entities... It saves cycles :)
30 */
31BTFIXUPDEF_CALL(void, disable_irq, unsigned int)
32BTFIXUPDEF_CALL(void, enable_irq, unsigned int)
33BTFIXUPDEF_CALL(void, disable_pil_irq, unsigned int)
34BTFIXUPDEF_CALL(void, enable_pil_irq, unsigned int)
35BTFIXUPDEF_CALL(void, clear_clock_irq, void)
36BTFIXUPDEF_CALL(void, clear_profile_irq, int)
37BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int)
38
39static inline void disable_irq_nosync(unsigned int irq)
40{
41 BTFIXUP_CALL(disable_irq)(irq);
42}
43
44static inline void disable_irq(unsigned int irq)
45{
46 BTFIXUP_CALL(disable_irq)(irq);
47}
48
49static inline void enable_irq(unsigned int irq)
50{
51 BTFIXUP_CALL(enable_irq)(irq);
52}
53
54static inline void disable_pil_irq(unsigned int irq)
55{
56 BTFIXUP_CALL(disable_pil_irq)(irq);
57}
58
59static inline void enable_pil_irq(unsigned int irq)
60{
61 BTFIXUP_CALL(enable_pil_irq)(irq);
62}
63
64static inline void clear_clock_irq(void)
65{
66 BTFIXUP_CALL(clear_clock_irq)();
67}
68
69static inline void clear_profile_irq(int irq)
70{
71 BTFIXUP_CALL(clear_profile_irq)(irq);
72}
73
74static inline void load_profile_irq(int cpu, int limit)
75{
76 BTFIXUP_CALL(load_profile_irq)(cpu, limit);
77}
78
79extern void (*sparc_init_timers)(irq_handler_t lvl10_irq);
80extern void claim_ticker14(irq_handler_t irq_handler,
81 int irq,
82 unsigned int timeout);
83
84#ifdef CONFIG_SMP
85BTFIXUPDEF_CALL(void, set_cpu_int, int, int)
86BTFIXUPDEF_CALL(void, clear_cpu_int, int, int)
87BTFIXUPDEF_CALL(void, set_irq_udt, int)
88
89#define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level)
90#define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level)
91#define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu)
92#endif
93 19
94extern int request_fast_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, __const__ char *devname); 20extern int request_fast_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, __const__ char *devname);
95 21
96/* On the sun4m, just like the timers, we have both per-cpu and master
97 * interrupt registers.
98 */
99
100/* These registers are used for sending/receiving irqs from/to
101 * different cpu's.
102 */
103struct sun4m_intreg_percpu {
104 unsigned int tbt; /* Interrupts still pending for this cpu. */
105
106 /* These next two registers are WRITE-ONLY and are only
107 * "on bit" sensitive, "off bits" written have NO affect.
108 */
109 unsigned int clear; /* Clear this cpus irqs here. */
110 unsigned int set; /* Set this cpus irqs here. */
111 unsigned char space[PAGE_SIZE - 12];
112};
113
114/*
115 * djhr
116 * Actually the clear and set fields in this struct are misleading..
117 * according to the SLAVIO manual (and the same applies for the SEC)
118 * the clear field clears bits in the mask which will ENABLE that IRQ
119 * the set field sets bits in the mask to DISABLE the IRQ.
120 *
121 * Also the undirected_xx address in the SLAVIO is defined as
122 * RESERVED and write only..
123 *
124 * DAVEM_NOTE: The SLAVIO only specifies behavior on uniprocessor
125 * sun4m machines, for MP the layout makes more sense.
126 */
127struct sun4m_intregs {
128 struct sun4m_intreg_percpu cpu_intregs[SUN4M_NCPUS];
129 unsigned int tbt; /* IRQ's that are still pending. */
130 unsigned int irqs; /* Master IRQ bits. */
131
132 /* Again, like the above, two these registers are WRITE-ONLY. */
133 unsigned int clear; /* Clear master IRQ's by setting bits here. */
134 unsigned int set; /* Set master IRQ's by setting bits here. */
135
136 /* This register is both READ and WRITE. */
137 unsigned int undirected_target; /* Which cpu gets undirected irqs. */
138};
139
140extern struct sun4m_intregs *sun4m_interrupts;
141
142/*
143 * Bit field defines for the interrupt registers on various
144 * Sparc machines.
145 */
146
147/* The sun4c interrupt register. */
148#define SUN4C_INT_ENABLE 0x01 /* Allow interrupts. */
149#define SUN4C_INT_E14 0x80 /* Enable level 14 IRQ. */
150#define SUN4C_INT_E10 0x20 /* Enable level 10 IRQ. */
151#define SUN4C_INT_E8 0x10 /* Enable level 8 IRQ. */
152#define SUN4C_INT_E6 0x08 /* Enable level 6 IRQ. */
153#define SUN4C_INT_E4 0x04 /* Enable level 4 IRQ. */
154#define SUN4C_INT_E1 0x02 /* Enable level 1 IRQ. */
155
156/* Dave Redman (djhr@tadpole.co.uk)
157 * The sun4m interrupt registers.
158 */
159#define SUN4M_INT_ENABLE 0x80000000
160#define SUN4M_INT_E14 0x00000080
161#define SUN4M_INT_E10 0x00080000
162
163#define SUN4M_HARD_INT(x) (0x000000001 << (x))
164#define SUN4M_SOFT_INT(x) (0x000010000 << (x))
165
166#define SUN4M_INT_MASKALL 0x80000000 /* mask all interrupts */
167#define SUN4M_INT_MODULE_ERR 0x40000000 /* module error */
168#define SUN4M_INT_M2S_WRITE 0x20000000 /* write buffer error */
169#define SUN4M_INT_ECC 0x10000000 /* ecc memory error */
170#define SUN4M_INT_FLOPPY 0x00400000 /* floppy disk */
171#define SUN4M_INT_MODULE 0x00200000 /* module interrupt */
172#define SUN4M_INT_VIDEO 0x00100000 /* onboard video */
173#define SUN4M_INT_REALTIME 0x00080000 /* system timer */
174#define SUN4M_INT_SCSI 0x00040000 /* onboard scsi */
175#define SUN4M_INT_AUDIO 0x00020000 /* audio/isdn */
176#define SUN4M_INT_ETHERNET 0x00010000 /* onboard ethernet */
177#define SUN4M_INT_SERIAL 0x00008000 /* serial ports */
178#define SUN4M_INT_KBDMS 0x00004000 /* keyboard/mouse */
179#define SUN4M_INT_SBUSBITS 0x00003F80 /* sbus int bits */
180
181#define SUN4M_INT_SBUS(x) (1 << (x+7))
182#define SUN4M_INT_VME(x) (1 << (x))
183
184#endif 22#endif
diff --git a/include/asm-sparc/of_device.h b/include/asm-sparc/of_device.h
index 7cb00c1b09c6..e5f5aedc2293 100644
--- a/include/asm-sparc/of_device.h
+++ b/include/asm-sparc/of_device.h
@@ -3,13 +3,9 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/of.h>
6#include <linux/mod_devicetable.h> 7#include <linux/mod_devicetable.h>
7#include <asm/openprom.h> 8#include <asm/openprom.h>
8#include <asm/prom.h>
9
10extern struct bus_type ebus_bus_type;
11extern struct bus_type sbus_bus_type;
12extern struct bus_type of_bus_type;
13 9
14/* 10/*
15 * The of_device is a kind of "base class" that is a superset of 11 * The of_device is a kind of "base class" that is a superset of
@@ -30,50 +26,13 @@ struct of_device
30 int portid; 26 int portid;
31 int clock_freq; 27 int clock_freq;
32}; 28};
33#define to_of_device(d) container_of(d, struct of_device, dev)
34 29
35extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 30extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
36extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 31extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
37 32
38extern struct of_device *of_find_device_by_node(struct device_node *); 33/* These are just here during the transition */
39 34#include <linux/of_device.h>
40extern const struct of_device_id *of_match_device( 35#include <linux/of_platform.h>
41 const struct of_device_id *matches, const struct of_device *dev);
42
43extern struct of_device *of_dev_get(struct of_device *dev);
44extern void of_dev_put(struct of_device *dev);
45
46/*
47 * An of_platform_driver driver is attached to a basic of_device on
48 * the ISA, EBUS, and SBUS busses on sparc64.
49 */
50struct of_platform_driver
51{
52 char *name;
53 struct of_device_id *match_table;
54 struct module *owner;
55
56 int (*probe)(struct of_device* dev, const struct of_device_id *match);
57 int (*remove)(struct of_device* dev);
58
59 int (*suspend)(struct of_device* dev, pm_message_t state);
60 int (*resume)(struct of_device* dev);
61 int (*shutdown)(struct of_device* dev);
62
63 struct device_driver driver;
64};
65#define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver)
66
67extern int of_register_driver(struct of_platform_driver *drv,
68 struct bus_type *bus);
69extern void of_unregister_driver(struct of_platform_driver *drv);
70extern int of_device_register(struct of_device *ofdev);
71extern void of_device_unregister(struct of_device *ofdev);
72extern struct of_device *of_platform_device_create(struct device_node *np,
73 const char *bus_id,
74 struct device *parent,
75 struct bus_type *bus);
76extern void of_release_dev(struct device *dev);
77 36
78#endif /* __KERNEL__ */ 37#endif /* __KERNEL__ */
79#endif /* _ASM_SPARC_OF_DEVICE_H */ 38#endif /* _ASM_SPARC_OF_DEVICE_H */
diff --git a/include/asm-sparc/of_platform.h b/include/asm-sparc/of_platform.h
new file mode 100644
index 000000000000..64a230064ef2
--- /dev/null
+++ b/include/asm-sparc/of_platform.h
@@ -0,0 +1,32 @@
1#ifndef _ASM_SPARC_OF_PLATFORM_H
2#define _ASM_SPARC_OF_PLATFORM_H
3/*
4 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
5 * <benh@kernel.crashing.org>
6 * Modified for Sparc by merging parts of asm-sparc/of_device.h
7 * by Stephen Rothwell
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 *
14 */
15
16/* This is just here during the transition */
17#include <linux/of_platform.h>
18
19extern struct bus_type ebus_bus_type;
20extern struct bus_type sbus_bus_type;
21extern struct bus_type of_platform_bus_type;
22#define of_bus_type of_platform_bus_type /* for compatibility */
23
24extern int of_register_driver(struct of_platform_driver *drv,
25 struct bus_type *bus);
26extern void of_unregister_driver(struct of_platform_driver *drv);
27extern struct of_device *of_platform_device_create(struct device_node *np,
28 const char *bus_id,
29 struct device *parent,
30 struct bus_type *bus);
31
32#endif /* _ASM_SPARC_OF_PLATFORM_H */
diff --git a/include/asm-sparc/oplib.h b/include/asm-sparc/oplib.h
index 91691e52c058..17ba82ee220a 100644
--- a/include/asm-sparc/oplib.h
+++ b/include/asm-sparc/oplib.h
@@ -158,32 +158,6 @@ extern void prom_putchar(char character);
158extern void prom_printf(char *fmt, ...); 158extern void prom_printf(char *fmt, ...);
159extern void prom_write(const char *buf, unsigned int len); 159extern void prom_write(const char *buf, unsigned int len);
160 160
161/* Query for input device type */
162
163enum prom_input_device {
164 PROMDEV_IKBD, /* input from keyboard */
165 PROMDEV_ITTYA, /* input from ttya */
166 PROMDEV_ITTYB, /* input from ttyb */
167 PROMDEV_IRSC, /* input from rsc */
168 PROMDEV_IVCONS, /* input from virtual-console */
169 PROMDEV_I_UNK,
170};
171
172extern enum prom_input_device prom_query_input_device(void);
173
174/* Query for output device type */
175
176enum prom_output_device {
177 PROMDEV_OSCREEN, /* to screen */
178 PROMDEV_OTTYA, /* to ttya */
179 PROMDEV_OTTYB, /* to ttyb */
180 PROMDEV_ORSC, /* to rsc */
181 PROMDEV_OVCONS, /* to virtual-console */
182 PROMDEV_O_UNK,
183};
184
185extern enum prom_output_device prom_query_output_device(void);
186
187/* Multiprocessor operations... */ 161/* Multiprocessor operations... */
188 162
189/* Start the CPU with the given device tree node, context table, and context 163/* Start the CPU with the given device tree node, context table, and context
diff --git a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h
index a750c688408b..b93b6c79e08f 100644
--- a/include/asm-sparc/pci.h
+++ b/include/asm-sparc/pci.h
@@ -142,8 +142,6 @@ static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
142 return 1; 142 return 1;
143} 143}
144 144
145#define pci_dac_dma_supported(dev, mask) (0)
146
147#ifdef CONFIG_PCI 145#ifdef CONFIG_PCI
148static inline void pci_dma_burst_advice(struct pci_dev *pdev, 146static inline void pci_dma_burst_advice(struct pci_dev *pdev,
149 enum pci_dma_burst_strategy *strat, 147 enum pci_dma_burst_strategy *strat,
@@ -154,10 +152,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
154} 152}
155#endif 153#endif
156 154
157static inline void pcibios_add_platform_entries(struct pci_dev *dev)
158{
159}
160
161#define PCI_DMA_ERROR_CODE (~(dma_addr_t)0x0) 155#define PCI_DMA_ERROR_CODE (~(dma_addr_t)0x0)
162 156
163static inline int pci_dma_mapping_error(dma_addr_t dma_addr) 157static inline int pci_dma_mapping_error(dma_addr_t dma_addr)
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index 4f0a5ba0d6a0..2cc235b74d94 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -46,7 +46,6 @@ BTFIXUPDEF_SIMM13(user_ptrs_per_pgd)
46#define pgd_ERROR(e) __builtin_trap() 46#define pgd_ERROR(e) __builtin_trap()
47 47
48BTFIXUPDEF_INT(page_none) 48BTFIXUPDEF_INT(page_none)
49BTFIXUPDEF_INT(page_shared)
50BTFIXUPDEF_INT(page_copy) 49BTFIXUPDEF_INT(page_copy)
51BTFIXUPDEF_INT(page_readonly) 50BTFIXUPDEF_INT(page_readonly)
52BTFIXUPDEF_INT(page_kernel) 51BTFIXUPDEF_INT(page_kernel)
@@ -66,7 +65,7 @@ BTFIXUPDEF_INT(page_kernel)
66#define PTE_SIZE (PTRS_PER_PTE*4) 65#define PTE_SIZE (PTRS_PER_PTE*4)
67 66
68#define PAGE_NONE __pgprot(BTFIXUP_INT(page_none)) 67#define PAGE_NONE __pgprot(BTFIXUP_INT(page_none))
69#define PAGE_SHARED __pgprot(BTFIXUP_INT(page_shared)) 68extern pgprot_t PAGE_SHARED;
70#define PAGE_COPY __pgprot(BTFIXUP_INT(page_copy)) 69#define PAGE_COPY __pgprot(BTFIXUP_INT(page_copy))
71#define PAGE_READONLY __pgprot(BTFIXUP_INT(page_readonly)) 70#define PAGE_READONLY __pgprot(BTFIXUP_INT(page_readonly))
72 71
@@ -151,7 +150,6 @@ BTFIXUPDEF_CALL_CONST(unsigned long, pgd_page_vaddr, pgd_t)
151BTFIXUPDEF_SETHI(none_mask) 150BTFIXUPDEF_SETHI(none_mask)
152BTFIXUPDEF_CALL_CONST(int, pte_present, pte_t) 151BTFIXUPDEF_CALL_CONST(int, pte_present, pte_t)
153BTFIXUPDEF_CALL(void, pte_clear, pte_t *) 152BTFIXUPDEF_CALL(void, pte_clear, pte_t *)
154BTFIXUPDEF_CALL(int, pte_read, pte_t)
155 153
156static inline int pte_none(pte_t pte) 154static inline int pte_none(pte_t pte)
157{ 155{
@@ -160,7 +158,6 @@ static inline int pte_none(pte_t pte)
160 158
161#define pte_present(pte) BTFIXUP_CALL(pte_present)(pte) 159#define pte_present(pte) BTFIXUP_CALL(pte_present)(pte)
162#define pte_clear(mm,addr,pte) BTFIXUP_CALL(pte_clear)(pte) 160#define pte_clear(mm,addr,pte) BTFIXUP_CALL(pte_clear)(pte)
163#define pte_read(pte) BTFIXUP_CALL(pte_read)(pte)
164 161
165BTFIXUPDEF_CALL_CONST(int, pmd_bad, pmd_t) 162BTFIXUPDEF_CALL_CONST(int, pmd_bad, pmd_t)
166BTFIXUPDEF_CALL_CONST(int, pmd_present, pmd_t) 163BTFIXUPDEF_CALL_CONST(int, pmd_present, pmd_t)
@@ -446,6 +443,17 @@ extern int io_remap_pfn_range(struct vm_area_struct *vma,
446#define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4)) 443#define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4))
447#define GET_PFN(pfn) (pfn & 0x0fffffffUL) 444#define GET_PFN(pfn) (pfn & 0x0fffffffUL)
448 445
446#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
447#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
448({ \
449 int __changed = !pte_same(*(__ptep), __entry); \
450 if (__changed) { \
451 set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \
452 flush_tlb_page(__vma, __address); \
453 } \
454 (sparc_cpu_model == sun4c) || __changed; \
455})
456
449#include <asm-generic/pgtable.h> 457#include <asm-generic/pgtable.h>
450 458
451#endif /* !(__ASSEMBLY__) */ 459#endif /* !(__ASSEMBLY__) */
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index 9ea105ebe2ff..350676c589f9 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -2,7 +2,6 @@
2#define _SPARC_PROM_H 2#define _SPARC_PROM_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5
6/* 5/*
7 * Definitions for talking to the Open Firmware PROM on 6 * Definitions for talking to the Open Firmware PROM on
8 * Power Macintosh computers. 7 * Power Macintosh computers.
@@ -17,11 +16,17 @@
17 * as published by the Free Software Foundation; either version 16 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version. 17 * 2 of the License, or (at your option) any later version.
19 */ 18 */
20
21#include <linux/types.h> 19#include <linux/types.h>
22#include <linux/proc_fs.h> 20#include <linux/proc_fs.h>
23#include <asm/atomic.h> 21#include <asm/atomic.h>
24 22
23#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
24#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
25
26#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
27#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
28#define of_node_cmp(s1, s2) strcmp((s1), (s2))
29
25typedef u32 phandle; 30typedef u32 phandle;
26typedef u32 ihandle; 31typedef u32 ihandle;
27 32
@@ -55,53 +60,34 @@ struct device_node {
55 unsigned int unique_id; 60 unsigned int unique_id;
56}; 61};
57 62
58/* flag descriptions */
59#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
60
61#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) 63#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
62#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) 64#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
63 65
64#define OF_BAD_ADDR ((u64)-1)
65
66static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
67{
68 dn->pde = de;
69}
70
71extern struct device_node *of_find_node_by_name(struct device_node *from,
72 const char *name);
73#define for_each_node_by_name(dn, name) \
74 for (dn = of_find_node_by_name(NULL, name); dn; \
75 dn = of_find_node_by_name(dn, name))
76extern struct device_node *of_find_node_by_type(struct device_node *from,
77 const char *type);
78#define for_each_node_by_type(dn, type) \
79 for (dn = of_find_node_by_type(NULL, type); dn; \
80 dn = of_find_node_by_type(dn, type))
81extern struct device_node *of_find_compatible_node(struct device_node *from,
82 const char *type, const char *compat);
83extern struct device_node *of_find_node_by_path(const char *path);
84extern struct device_node *of_find_node_by_phandle(phandle handle);
85extern struct device_node *of_get_parent(const struct device_node *node);
86extern struct device_node *of_get_next_child(const struct device_node *node,
87 struct device_node *prev);
88extern struct property *of_find_property(const struct device_node *np,
89 const char *name,
90 int *lenp);
91extern int of_device_is_compatible(const struct device_node *device,
92 const char *);
93extern const void *of_get_property(const struct device_node *node,
94 const char *name,
95 int *lenp);
96#define get_property(node,name,lenp) of_get_property(node,name,lenp)
97extern int of_set_property(struct device_node *node, const char *name, void *val, int len); 66extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
98extern int of_getintprop_default(struct device_node *np, 67extern int of_getintprop_default(struct device_node *np,
99 const char *name, 68 const char *name,
100 int def); 69 int def);
101extern int of_n_addr_cells(struct device_node *np);
102extern int of_n_size_cells(struct device_node *np);
103 70
104extern void prom_build_devicetree(void); 71extern void prom_build_devicetree(void);
105 72
73/* Dummy ref counting routines - to be implemented later */
74static inline struct device_node *of_node_get(struct device_node *node)
75{
76 return node;
77}
78static inline void of_node_put(struct device_node *node)
79{
80}
81
82/*
83 * NB: This is here while we transition from using asm/prom.h
84 * to linux/of.h
85 */
86#include <linux/of.h>
87
88extern struct device_node *of_console_device;
89extern char *of_console_path;
90extern char *of_console_options;
91
106#endif /* __KERNEL__ */ 92#endif /* __KERNEL__ */
107#endif /* _SPARC_PROM_H */ 93#endif /* _SPARC_PROM_H */
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index 8b4e23b3bb38..d1a2572e3f55 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -165,16 +165,6 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
165 } while(0) 165 } while(0)
166 166
167/* 167/*
168 * On SMP systems, when the scheduler does migration-cost autodetection,
169 * it needs a way to flush as much of the CPU's caches as possible.
170 *
171 * TODO: fill this in!
172 */
173static inline void sched_cacheflush(void)
174{
175}
176
177/*
178 * Changing the IRQ level on the Sparc. 168 * Changing the IRQ level on the Sparc.
179 */ 169 */
180extern void local_irq_restore(unsigned long); 170extern void local_irq_restore(unsigned long);
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 64471bcd96f9..029b3e0d5e4c 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -1,4 +1,3 @@
1/* $Id: unistd.h,v 1.74 2002/02/08 03:57:18 davem Exp $ */
2#ifndef _SPARC_UNISTD_H 1#ifndef _SPARC_UNISTD_H
3#define _SPARC_UNISTD_H 2#define _SPARC_UNISTD_H
4 3
@@ -9,7 +8,7 @@
9 * think of right now to force the arguments into fixed registers 8 * think of right now to force the arguments into fixed registers
10 * before the trap into the system call with gcc 'asm' statements. 9 * before the trap into the system call with gcc 'asm' statements.
11 * 10 *
12 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 11 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
13 * 12 *
14 * SunOS compatibility based upon preliminary work which is: 13 * SunOS compatibility based upon preliminary work which is:
15 * 14 *
@@ -330,8 +329,9 @@
330#define __NR_signalfd 311 329#define __NR_signalfd 311
331#define __NR_timerfd 312 330#define __NR_timerfd 312
332#define __NR_eventfd 313 331#define __NR_eventfd 313
332#define __NR_fallocate 314
333 333
334#define NR_SYSCALLS 314 334#define NR_SYSCALLS 315
335 335
336#ifdef __KERNEL__ 336#ifdef __KERNEL__
337#define __ARCH_WANT_IPC_PARSE_VERSION 337#define __ARCH_WANT_IPC_PARSE_VERSION
diff --git a/include/asm-sparc64/a.out.h b/include/asm-sparc64/a.out.h
index eb3b8e90b279..902e07f89a42 100644
--- a/include/asm-sparc64/a.out.h
+++ b/include/asm-sparc64/a.out.h
@@ -101,6 +101,8 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */
101#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ 101#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \
102 STACK_TOP32 : STACK_TOP64) 102 STACK_TOP32 : STACK_TOP64)
103 103
104#define STACK_TOP_MAX STACK_TOP64
105
104#endif 106#endif
105 107
106#endif /* !(__ASSEMBLY__) */ 108#endif /* !(__ASSEMBLY__) */
diff --git a/include/asm-sparc64/bugs.h b/include/asm-sparc64/bugs.h
index bf39d86c0c9e..11ade6841971 100644
--- a/include/asm-sparc64/bugs.h
+++ b/include/asm-sparc64/bugs.h
@@ -4,12 +4,7 @@
4 */ 4 */
5#include <asm/sstate.h> 5#include <asm/sstate.h>
6 6
7extern unsigned long loops_per_jiffy;
8
9static void __init check_bugs(void) 7static void __init check_bugs(void)
10{ 8{
11#ifndef CONFIG_SMP
12 cpu_data(0).udelay_val = loops_per_jiffy;
13#endif
14 sstate_running(); 9 sstate_running();
15} 10}
diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h
index 36511ca51416..01fe6682b405 100644
--- a/include/asm-sparc64/compat.h
+++ b/include/asm-sparc64/compat.h
@@ -31,8 +31,10 @@ typedef s32 compat_timer_t;
31 31
32typedef s32 compat_int_t; 32typedef s32 compat_int_t;
33typedef s32 compat_long_t; 33typedef s32 compat_long_t;
34typedef s64 compat_s64;
34typedef u32 compat_uint_t; 35typedef u32 compat_uint_t;
35typedef u32 compat_ulong_t; 36typedef u32 compat_ulong_t;
37typedef u64 compat_u64;
36 38
37struct compat_timespec { 39struct compat_timespec {
38 compat_time_t tv_sec; 40 compat_time_t tv_sec;
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h
index 03c385de7619..98a6e609163e 100644
--- a/include/asm-sparc64/cpudata.h
+++ b/include/asm-sparc64/cpudata.h
@@ -19,7 +19,7 @@ typedef struct {
19 unsigned int __softirq_pending; /* must be 1st, see rtrap.S */ 19 unsigned int __softirq_pending; /* must be 1st, see rtrap.S */
20 unsigned int __pad0; 20 unsigned int __pad0;
21 unsigned long clock_tick; /* %tick's per second */ 21 unsigned long clock_tick; /* %tick's per second */
22 unsigned long udelay_val; 22 unsigned long __pad;
23 unsigned int __pad1; 23 unsigned int __pad1;
24 unsigned int __pad2; 24 unsigned int __pad2;
25 25
@@ -31,7 +31,7 @@ typedef struct {
31 unsigned int ecache_size; 31 unsigned int ecache_size;
32 unsigned int ecache_line_size; 32 unsigned int ecache_line_size;
33 int core_id; 33 int core_id;
34 unsigned int __pad3; 34 int proc_id;
35} cpuinfo_sparc; 35} cpuinfo_sparc;
36 36
37DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data); 37DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);
@@ -80,7 +80,8 @@ struct trap_per_cpu {
80 unsigned int dev_mondo_qmask; 80 unsigned int dev_mondo_qmask;
81 unsigned int resum_qmask; 81 unsigned int resum_qmask;
82 unsigned int nonresum_qmask; 82 unsigned int nonresum_qmask;
83 unsigned int __pad2[3]; 83 unsigned int __pad2[1];
84 void *hdesc;
84} __attribute__((aligned(64))); 85} __attribute__((aligned(64)));
85extern struct trap_per_cpu trap_block[NR_CPUS]; 86extern struct trap_per_cpu trap_block[NR_CPUS];
86extern void init_cur_cpu_trap(struct thread_info *); 87extern void init_cur_cpu_trap(struct thread_info *);
diff --git a/include/asm-sparc64/delay.h b/include/asm-sparc64/delay.h
index a4aae6f80627..a77aa622d762 100644
--- a/include/asm-sparc64/delay.h
+++ b/include/asm-sparc64/delay.h
@@ -1,37 +1,17 @@
1/* delay.h: Linux delay routines on sparc64. 1/* delay.h: Linux delay routines on sparc64.
2 * 2 *
3 * Copyright (C) 1996, 2004 David S. Miller (davem@davemloft.net). 3 * Copyright (C) 1996, 2004, 2007 David S. Miller (davem@davemloft.net).
4 *
5 * Based heavily upon x86 variant which is:
6 * Copyright (C) 1993 Linus Torvalds
7 *
8 * Delay routines calling functions in arch/sparc64/lib/delay.c
9 */ 4 */
10 5
11#ifndef __SPARC64_DELAY_H 6#ifndef _SPARC64_DELAY_H
12#define __SPARC64_DELAY_H 7#define _SPARC64_DELAY_H
13
14#include <linux/param.h>
15#include <asm/cpudata.h>
16 8
17#ifndef __ASSEMBLY__ 9#ifndef __ASSEMBLY__
18 10
19extern void __bad_udelay(void);
20extern void __bad_ndelay(void);
21
22extern void __udelay(unsigned long usecs);
23extern void __ndelay(unsigned long nsecs);
24extern void __const_udelay(unsigned long usecs);
25extern void __delay(unsigned long loops); 11extern void __delay(unsigned long loops);
26 12extern void udelay(unsigned long usecs);
27#define udelay(n) (__builtin_constant_p(n) ? \ 13#define mdelay(n) udelay((n) * 1000)
28 ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \
29 __udelay(n))
30
31#define ndelay(n) (__builtin_constant_p(n) ? \
32 ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
33 __ndelay(n))
34 14
35#endif /* !__ASSEMBLY__ */ 15#endif /* !__ASSEMBLY__ */
36 16
37#endif /* defined(__SPARC64_DELAY_H) */ 17#endif /* _SPARC64_DELAY_H */
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h
index 9329429fb7f6..c58ec1661df8 100644
--- a/include/asm-sparc64/dma-mapping.h
+++ b/include/asm-sparc64/dma-mapping.h
@@ -15,8 +15,7 @@
15static inline int 15static inline int
16dma_supported(struct device *dev, u64 mask) 16dma_supported(struct device *dev, u64 mask)
17{ 17{
18 BUG_ON(dev->bus != &pci_bus_type && 18 BUG_ON(dev->bus != &pci_bus_type);
19 dev->bus != &ebus_bus_type);
20 19
21 return pci_dma_supported(to_pci_dev(dev), mask); 20 return pci_dma_supported(to_pci_dev(dev), mask);
22} 21}
@@ -24,8 +23,7 @@ dma_supported(struct device *dev, u64 mask)
24static inline int 23static inline int
25dma_set_mask(struct device *dev, u64 dma_mask) 24dma_set_mask(struct device *dev, u64 dma_mask)
26{ 25{
27 BUG_ON(dev->bus != &pci_bus_type && 26 BUG_ON(dev->bus != &pci_bus_type);
28 dev->bus != &ebus_bus_type);
29 27
30 return pci_set_dma_mask(to_pci_dev(dev), dma_mask); 28 return pci_set_dma_mask(to_pci_dev(dev), dma_mask);
31} 29}
@@ -34,8 +32,7 @@ static inline void *
34dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 32dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
35 gfp_t flag) 33 gfp_t flag)
36{ 34{
37 BUG_ON(dev->bus != &pci_bus_type && 35 BUG_ON(dev->bus != &pci_bus_type);
38 dev->bus != &ebus_bus_type);
39 36
40 return pci_iommu_ops->alloc_consistent(to_pci_dev(dev), size, dma_handle, flag); 37 return pci_iommu_ops->alloc_consistent(to_pci_dev(dev), size, dma_handle, flag);
41} 38}
@@ -44,8 +41,7 @@ static inline void
44dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, 41dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
45 dma_addr_t dma_handle) 42 dma_addr_t dma_handle)
46{ 43{
47 BUG_ON(dev->bus != &pci_bus_type && 44 BUG_ON(dev->bus != &pci_bus_type);
48 dev->bus != &ebus_bus_type);
49 45
50 pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); 46 pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle);
51} 47}
@@ -54,8 +50,7 @@ static inline dma_addr_t
54dma_map_single(struct device *dev, void *cpu_addr, size_t size, 50dma_map_single(struct device *dev, void *cpu_addr, size_t size,
55 enum dma_data_direction direction) 51 enum dma_data_direction direction)
56{ 52{
57 BUG_ON(dev->bus != &pci_bus_type && 53 BUG_ON(dev->bus != &pci_bus_type);
58 dev->bus != &ebus_bus_type);
59 54
60 return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction); 55 return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction);
61} 56}
@@ -64,8 +59,7 @@ static inline void
64dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, 59dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
65 enum dma_data_direction direction) 60 enum dma_data_direction direction)
66{ 61{
67 BUG_ON(dev->bus != &pci_bus_type && 62 BUG_ON(dev->bus != &pci_bus_type);
68 dev->bus != &ebus_bus_type);
69 63
70 pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); 64 pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction);
71} 65}
@@ -75,8 +69,7 @@ dma_map_page(struct device *dev, struct page *page,
75 unsigned long offset, size_t size, 69 unsigned long offset, size_t size,
76 enum dma_data_direction direction) 70 enum dma_data_direction direction)
77{ 71{
78 BUG_ON(dev->bus != &pci_bus_type && 72 BUG_ON(dev->bus != &pci_bus_type);
79 dev->bus != &ebus_bus_type);
80 73
81 return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction); 74 return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction);
82} 75}
@@ -85,8 +78,7 @@ static inline void
85dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, 78dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
86 enum dma_data_direction direction) 79 enum dma_data_direction direction)
87{ 80{
88 BUG_ON(dev->bus != &pci_bus_type && 81 BUG_ON(dev->bus != &pci_bus_type);
89 dev->bus != &ebus_bus_type);
90 82
91 pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); 83 pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction);
92} 84}
@@ -95,8 +87,7 @@ static inline int
95dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 87dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
96 enum dma_data_direction direction) 88 enum dma_data_direction direction)
97{ 89{
98 BUG_ON(dev->bus != &pci_bus_type && 90 BUG_ON(dev->bus != &pci_bus_type);
99 dev->bus != &ebus_bus_type);
100 91
101 return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); 92 return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction);
102} 93}
@@ -105,8 +96,7 @@ static inline void
105dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, 96dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
106 enum dma_data_direction direction) 97 enum dma_data_direction direction)
107{ 98{
108 BUG_ON(dev->bus != &pci_bus_type && 99 BUG_ON(dev->bus != &pci_bus_type);
109 dev->bus != &ebus_bus_type);
110 100
111 pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); 101 pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction);
112} 102}
@@ -115,8 +105,7 @@ static inline void
115dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, 105dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
116 enum dma_data_direction direction) 106 enum dma_data_direction direction)
117{ 107{
118 BUG_ON(dev->bus != &pci_bus_type && 108 BUG_ON(dev->bus != &pci_bus_type);
119 dev->bus != &ebus_bus_type);
120 109
121 pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle, 110 pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle,
122 size, (int)direction); 111 size, (int)direction);
@@ -126,8 +115,7 @@ static inline void
126dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, 115dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
127 enum dma_data_direction direction) 116 enum dma_data_direction direction)
128{ 117{
129 BUG_ON(dev->bus != &pci_bus_type && 118 BUG_ON(dev->bus != &pci_bus_type);
130 dev->bus != &ebus_bus_type);
131 119
132 pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle, 120 pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle,
133 size, (int)direction); 121 size, (int)direction);
@@ -137,8 +125,7 @@ static inline void
137dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, 125dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
138 enum dma_data_direction direction) 126 enum dma_data_direction direction)
139{ 127{
140 BUG_ON(dev->bus != &pci_bus_type && 128 BUG_ON(dev->bus != &pci_bus_type);
141 dev->bus != &ebus_bus_type);
142 129
143 pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction); 130 pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction);
144} 131}
@@ -147,8 +134,7 @@ static inline void
147dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, 134dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
148 enum dma_data_direction direction) 135 enum dma_data_direction direction)
149{ 136{
150 BUG_ON(dev->bus != &pci_bus_type && 137 BUG_ON(dev->bus != &pci_bus_type);
151 dev->bus != &ebus_bus_type);
152 138
153 pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction); 139 pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction);
154} 140}
@@ -162,6 +148,22 @@ dma_mapping_error(dma_addr_t dma_addr)
162#else 148#else
163 149
164struct device; 150struct device;
151struct page;
152struct scatterlist;
153
154static inline int
155dma_supported(struct device *dev, u64 mask)
156{
157 BUG();
158 return 0;
159}
160
161static inline int
162dma_set_mask(struct device *dev, u64 dma_mask)
163{
164 BUG();
165 return 0;
166}
165 167
166static inline void *dma_alloc_coherent(struct device *dev, size_t size, 168static inline void *dma_alloc_coherent(struct device *dev, size_t size,
167 dma_addr_t *dma_handle, gfp_t flag) 169 dma_addr_t *dma_handle, gfp_t flag)
@@ -176,6 +178,52 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
176 BUG(); 178 BUG();
177} 179}
178 180
181static inline dma_addr_t
182dma_map_single(struct device *dev, void *cpu_addr, size_t size,
183 enum dma_data_direction direction)
184{
185 BUG();
186 return 0;
187}
188
189static inline void
190dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
191 enum dma_data_direction direction)
192{
193 BUG();
194}
195
196static inline dma_addr_t
197dma_map_page(struct device *dev, struct page *page,
198 unsigned long offset, size_t size,
199 enum dma_data_direction direction)
200{
201 BUG();
202 return 0;
203}
204
205static inline void
206dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
207 enum dma_data_direction direction)
208{
209 BUG();
210}
211
212static inline int
213dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
214 enum dma_data_direction direction)
215{
216 BUG();
217 return 0;
218}
219
220static inline void
221dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
222 enum dma_data_direction direction)
223{
224 BUG();
225}
226
179static inline void 227static inline void
180dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, 228dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
181 enum dma_data_direction direction) 229 enum dma_data_direction direction)
@@ -190,6 +238,27 @@ dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t siz
190 BUG(); 238 BUG();
191} 239}
192 240
241static inline void
242dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
243 enum dma_data_direction direction)
244{
245 BUG();
246}
247
248static inline void
249dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
250 enum dma_data_direction direction)
251{
252 BUG();
253}
254
255static inline int
256dma_mapping_error(dma_addr_t dma_addr)
257{
258 BUG();
259 return 0;
260}
261
193#endif /* PCI */ 262#endif /* PCI */
194 263
195 264
diff --git a/include/asm-sparc64/fb.h b/include/asm-sparc64/fb.h
new file mode 100644
index 000000000000..389012e5fbad
--- /dev/null
+++ b/include/asm-sparc64/fb.h
@@ -0,0 +1,27 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4#include <linux/fs.h>
5#include <asm/page.h>
6#include <asm/prom.h>
7
8static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
9 unsigned long off)
10{
11 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
12}
13
14static inline int fb_is_primary_device(struct fb_info *info)
15{
16 struct device *dev = info->device;
17 struct device_node *node;
18
19 node = dev->archdata.prom_node;
20 if (node &&
21 node == of_console_device)
22 return 1;
23
24 return 0;
25}
26
27#endif /* _ASM_FB_H_ */
diff --git a/include/asm-sparc64/hvtramp.h b/include/asm-sparc64/hvtramp.h
new file mode 100644
index 000000000000..c7dd6ad056df
--- /dev/null
+++ b/include/asm-sparc64/hvtramp.h
@@ -0,0 +1,37 @@
1#ifndef _SPARC64_HVTRAP_H
2#define _SPARC64_HVTRAP_H
3
4#ifndef __ASSEMBLY__
5
6#include <linux/types.h>
7
8struct hvtramp_mapping {
9 __u64 vaddr;
10 __u64 tte;
11};
12
13struct hvtramp_descr {
14 __u32 cpu;
15 __u32 num_mappings;
16 __u64 fault_info_va;
17 __u64 fault_info_pa;
18 __u64 thread_reg;
19 struct hvtramp_mapping maps[2];
20};
21
22extern void hv_cpu_startup(unsigned long hvdescr_pa);
23
24#endif
25
26#define HVTRAMP_DESCR_CPU 0x00
27#define HVTRAMP_DESCR_NUM_MAPPINGS 0x04
28#define HVTRAMP_DESCR_FAULT_INFO_VA 0x08
29#define HVTRAMP_DESCR_FAULT_INFO_PA 0x10
30#define HVTRAMP_DESCR_THREAD_REG 0x18
31#define HVTRAMP_DESCR_MAPS 0x20
32
33#define HVTRAMP_MAPPING_VADDR 0x00
34#define HVTRAMP_MAPPING_TTE 0x08
35#define HVTRAMP_MAPPING_SIZE 0x10
36
37#endif /* _SPARC64_HVTRAP_H */
diff --git a/include/asm-sparc64/hypervisor.h b/include/asm-sparc64/hypervisor.h
index 4a43075a0619..524d49835dfd 100644
--- a/include/asm-sparc64/hypervisor.h
+++ b/include/asm-sparc64/hypervisor.h
@@ -98,7 +98,7 @@
98#define HV_FAST_MACH_EXIT 0x00 98#define HV_FAST_MACH_EXIT 0x00
99 99
100#ifndef __ASSEMBLY__ 100#ifndef __ASSEMBLY__
101extern void sun4v_mach_exit(unsigned long exit_core); 101extern void sun4v_mach_exit(unsigned long exit_code);
102#endif 102#endif
103 103
104/* Domain services. */ 104/* Domain services. */
@@ -2615,8 +2615,9 @@ struct ldc_mtable_entry {
2615/* ldc_revoke() 2615/* ldc_revoke()
2616 * TRAP: HV_FAST_TRAP 2616 * TRAP: HV_FAST_TRAP
2617 * FUNCTION: HV_FAST_LDC_REVOKE 2617 * FUNCTION: HV_FAST_LDC_REVOKE
2618 * ARG0: cookie 2618 * ARG0: channel ID
2619 * ARG1: ldc_mtable_entry cookie 2619 * ARG1: cookie
2620 * ARG2: ldc_mtable_entry cookie
2620 * RET0: status 2621 * RET0: status
2621 */ 2622 */
2622#define HV_FAST_LDC_REVOKE 0xef 2623#define HV_FAST_LDC_REVOKE 0xef
@@ -2663,7 +2664,8 @@ extern unsigned long sun4v_ldc_mapin(unsigned long channel,
2663 unsigned long *ra, 2664 unsigned long *ra,
2664 unsigned long *perm); 2665 unsigned long *perm);
2665extern unsigned long sun4v_ldc_unmap(unsigned long ra); 2666extern unsigned long sun4v_ldc_unmap(unsigned long ra);
2666extern unsigned long sun4v_ldc_revoke(unsigned long cookie, 2667extern unsigned long sun4v_ldc_revoke(unsigned long channel,
2668 unsigned long cookie,
2667 unsigned long mte_cookie); 2669 unsigned long mte_cookie);
2668#endif 2670#endif
2669 2671
@@ -2798,6 +2800,11 @@ struct hv_mmu_statistics {
2798 */ 2800 */
2799#define HV_FAST_MMUSTAT_INFO 0x103 2801#define HV_FAST_MMUSTAT_INFO 0x103
2800 2802
2803#ifndef __ASSEMBLY__
2804extern unsigned long sun4v_mmustat_conf(unsigned long ra, unsigned long *orig_ra);
2805extern unsigned long sun4v_mmustat_info(unsigned long *ra);
2806#endif
2807
2801/* NCS crypto services */ 2808/* NCS crypto services */
2802 2809
2803/* ncs_request() sub-function numbers */ 2810/* ncs_request() sub-function numbers */
diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h
index ad595b679842..9565a892801e 100644
--- a/include/asm-sparc64/io.h
+++ b/include/asm-sparc64/io.h
@@ -14,11 +14,6 @@
14#define __SLOW_DOWN_IO do { } while (0) 14#define __SLOW_DOWN_IO do { } while (0)
15#define SLOW_DOWN_IO do { } while (0) 15#define SLOW_DOWN_IO do { } while (0)
16 16
17extern unsigned long virt_to_bus_not_defined_use_pci_map(volatile void *addr);
18#define virt_to_bus virt_to_bus_not_defined_use_pci_map
19extern unsigned long bus_to_virt_not_defined_use_pci_map(volatile void *addr);
20#define bus_to_virt bus_to_virt_not_defined_use_pci_map
21
22/* BIO layer definitions. */ 17/* BIO layer definitions. */
23extern unsigned long kern_base, kern_size; 18extern unsigned long kern_base, kern_size;
24#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) 19#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
index 5d233b42fe13..e6c436ef9356 100644
--- a/include/asm-sparc64/irq.h
+++ b/include/asm-sparc64/irq.h
@@ -46,12 +46,15 @@ extern void irq_install_pre_handler(int virt_irq,
46#define irq_canonicalize(irq) (irq) 46#define irq_canonicalize(irq) (irq)
47extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap); 47extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap);
48extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino); 48extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino);
49extern unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino);
49extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p, 50extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p,
50 unsigned int msi_devino_start, 51 unsigned int msi_devino_start,
51 unsigned int msi_devino_end); 52 unsigned int msi_devino_end);
52extern void sun4v_destroy_msi(unsigned int virt_irq); 53extern void sun4v_destroy_msi(unsigned int virt_irq);
53extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); 54extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
54 55
56extern void fixup_irqs(void);
57
55static __inline__ void set_softint(unsigned long bits) 58static __inline__ void set_softint(unsigned long bits)
56{ 59{
57 __asm__ __volatile__("wr %0, 0x0, %%set_softint" 60 __asm__ __volatile__("wr %0, 0x0, %%set_softint"
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h
index a331b7b0dff2..7f6774dca5f4 100644
--- a/include/asm-sparc64/kprobes.h
+++ b/include/asm-sparc64/kprobes.h
@@ -10,7 +10,6 @@ typedef u32 kprobe_opcode_t;
10#define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */ 10#define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */
11#define MAX_INSN_SIZE 2 11#define MAX_INSN_SIZE 2
12 12
13#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
14#define arch_remove_kprobe(p) do {} while (0) 13#define arch_remove_kprobe(p) do {} while (0)
15#define ARCH_INACTIVE_KPROBE_COUNT 0 14#define ARCH_INACTIVE_KPROBE_COUNT 0
16 15
diff --git a/include/asm-sparc64/ldc.h b/include/asm-sparc64/ldc.h
new file mode 100644
index 000000000000..bdb524a7b814
--- /dev/null
+++ b/include/asm-sparc64/ldc.h
@@ -0,0 +1,138 @@
1#ifndef _SPARC64_LDC_H
2#define _SPARC64_LDC_H
3
4#include <asm/hypervisor.h>
5
6extern int ldom_domaining_enabled;
7extern void ldom_set_var(const char *var, const char *value);
8extern void ldom_reboot(const char *boot_command);
9extern void ldom_power_off(void);
10
11/* The event handler will be evoked when link state changes
12 * or data becomes available on the receive side.
13 *
14 * For non-RAW links, if the LDC_EVENT_RESET event arrives the
15 * driver should reset all of it's internal state and reinvoke
16 * ldc_connect() to try and bring the link up again.
17 *
18 * For RAW links, ldc_connect() is not used. Instead the driver
19 * just waits for the LDC_EVENT_UP event.
20 */
21struct ldc_channel_config {
22 void (*event)(void *arg, int event);
23
24 u32 mtu;
25 unsigned int rx_irq;
26 unsigned int tx_irq;
27 u8 mode;
28#define LDC_MODE_RAW 0x00
29#define LDC_MODE_UNRELIABLE 0x01
30#define LDC_MODE_RESERVED 0x02
31#define LDC_MODE_STREAM 0x03
32
33 u8 debug;
34#define LDC_DEBUG_HS 0x01
35#define LDC_DEBUG_STATE 0x02
36#define LDC_DEBUG_RX 0x04
37#define LDC_DEBUG_TX 0x08
38#define LDC_DEBUG_DATA 0x10
39};
40
41#define LDC_EVENT_RESET 0x01
42#define LDC_EVENT_UP 0x02
43#define LDC_EVENT_DATA_READY 0x04
44
45#define LDC_STATE_INVALID 0x00
46#define LDC_STATE_INIT 0x01
47#define LDC_STATE_BOUND 0x02
48#define LDC_STATE_READY 0x03
49#define LDC_STATE_CONNECTED 0x04
50
51struct ldc_channel;
52
53/* Allocate state for a channel. */
54extern struct ldc_channel *ldc_alloc(unsigned long id,
55 const struct ldc_channel_config *cfgp,
56 void *event_arg);
57
58/* Shut down and free state for a channel. */
59extern void ldc_free(struct ldc_channel *lp);
60
61/* Register TX and RX queues of the link with the hypervisor. */
62extern int ldc_bind(struct ldc_channel *lp, const char *name);
63
64/* For non-RAW protocols we need to complete a handshake before
65 * communication can proceed. ldc_connect() does that, if the
66 * handshake completes successfully, an LDC_EVENT_UP event will
67 * be sent up to the driver.
68 */
69extern int ldc_connect(struct ldc_channel *lp);
70extern int ldc_disconnect(struct ldc_channel *lp);
71
72extern int ldc_state(struct ldc_channel *lp);
73
74/* Read and write operations. Only valid when the link is up. */
75extern int ldc_write(struct ldc_channel *lp, const void *buf,
76 unsigned int size);
77extern int ldc_read(struct ldc_channel *lp, void *buf, unsigned int size);
78
79#define LDC_MAP_SHADOW 0x01
80#define LDC_MAP_DIRECT 0x02
81#define LDC_MAP_IO 0x04
82#define LDC_MAP_R 0x08
83#define LDC_MAP_W 0x10
84#define LDC_MAP_X 0x20
85#define LDC_MAP_RW (LDC_MAP_R | LDC_MAP_W)
86#define LDC_MAP_RWX (LDC_MAP_R | LDC_MAP_W | LDC_MAP_X)
87#define LDC_MAP_ALL 0x03f
88
89struct ldc_trans_cookie {
90 u64 cookie_addr;
91 u64 cookie_size;
92};
93
94struct scatterlist;
95extern int ldc_map_sg(struct ldc_channel *lp,
96 struct scatterlist *sg, int num_sg,
97 struct ldc_trans_cookie *cookies, int ncookies,
98 unsigned int map_perm);
99
100extern int ldc_map_single(struct ldc_channel *lp,
101 void *buf, unsigned int len,
102 struct ldc_trans_cookie *cookies, int ncookies,
103 unsigned int map_perm);
104
105extern void ldc_unmap(struct ldc_channel *lp, struct ldc_trans_cookie *cookies,
106 int ncookies);
107
108extern int ldc_copy(struct ldc_channel *lp, int copy_dir,
109 void *buf, unsigned int len, unsigned long offset,
110 struct ldc_trans_cookie *cookies, int ncookies);
111
112static inline int ldc_get_dring_entry(struct ldc_channel *lp,
113 void *buf, unsigned int len,
114 unsigned long offset,
115 struct ldc_trans_cookie *cookies,
116 int ncookies)
117{
118 return ldc_copy(lp, LDC_COPY_IN, buf, len, offset, cookies, ncookies);
119}
120
121static inline int ldc_put_dring_entry(struct ldc_channel *lp,
122 void *buf, unsigned int len,
123 unsigned long offset,
124 struct ldc_trans_cookie *cookies,
125 int ncookies)
126{
127 return ldc_copy(lp, LDC_COPY_OUT, buf, len, offset, cookies, ncookies);
128}
129
130extern void *ldc_alloc_exp_dring(struct ldc_channel *lp, unsigned int len,
131 struct ldc_trans_cookie *cookies,
132 int *ncookies, unsigned int map_perm);
133
134extern void ldc_free_exp_dring(struct ldc_channel *lp, void *buf,
135 unsigned int len,
136 struct ldc_trans_cookie *cookies, int ncookies);
137
138#endif /* _SPARC64_LDC_H */
diff --git a/include/asm-sparc64/mdesc.h b/include/asm-sparc64/mdesc.h
index 124eb8ca2378..1acc7272e537 100644
--- a/include/asm-sparc64/mdesc.h
+++ b/include/asm-sparc64/mdesc.h
@@ -2,37 +2,76 @@
2#define _SPARC64_MDESC_H 2#define _SPARC64_MDESC_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/cpumask.h>
5#include <asm/prom.h> 6#include <asm/prom.h>
6 7
7struct mdesc_node; 8struct mdesc_handle;
8struct mdesc_arc { 9
9 const char *name; 10/* Machine description operations are to be surrounded by grab and
10 struct mdesc_node *arc; 11 * release calls. The mdesc_handle returned from the grab is
11}; 12 * the first argument to all of the operational calls that work
13 * on mdescs.
14 */
15extern struct mdesc_handle *mdesc_grab(void);
16extern void mdesc_release(struct mdesc_handle *);
17
18#define MDESC_NODE_NULL (~(u64)0)
19
20extern u64 mdesc_node_by_name(struct mdesc_handle *handle,
21 u64 from_node, const char *name);
22#define mdesc_for_each_node_by_name(__hdl, __node, __name) \
23 for (__node = mdesc_node_by_name(__hdl, MDESC_NODE_NULL, __name); \
24 (__node) != MDESC_NODE_NULL; \
25 __node = mdesc_node_by_name(__hdl, __node, __name))
26
27/* Access to property values returned from mdesc_get_property() are
28 * only valid inside of a mdesc_grab()/mdesc_release() sequence.
29 * Once mdesc_release() is called, the memory backed up by these
30 * pointers may reference freed up memory.
31 *
32 * Therefore callers must make copies of any property values
33 * they need.
34 *
35 * These same rules apply to mdesc_node_name().
36 */
37extern const void *mdesc_get_property(struct mdesc_handle *handle,
38 u64 node, const char *name, int *lenp);
39extern const char *mdesc_node_name(struct mdesc_handle *hp, u64 node);
40
41/* MD arc iteration, the standard sequence is:
42 *
43 * unsigned long arc;
44 * mdesc_for_each_arc(arc, handle, node, MDESC_ARC_TYPE_{FWD,BACK}) {
45 * unsigned long target = mdesc_arc_target(handle, arc);
46 * ...
47 * }
48 */
12 49
13struct mdesc_node { 50#define MDESC_ARC_TYPE_FWD "fwd"
14 const char *name; 51#define MDESC_ARC_TYPE_BACK "back"
15 u64 node; 52
16 unsigned int unique_id; 53extern u64 mdesc_next_arc(struct mdesc_handle *handle, u64 from,
17 unsigned int num_arcs; 54 const char *arc_type);
18 struct property *properties; 55#define mdesc_for_each_arc(__arc, __hdl, __node, __type) \
19 struct mdesc_node *hash_next; 56 for (__arc = mdesc_next_arc(__hdl, __node, __type); \
20 struct mdesc_node *allnodes_next; 57 (__arc) != MDESC_NODE_NULL; \
21 struct mdesc_arc arcs[0]; 58 __arc = mdesc_next_arc(__hdl, __arc, __type))
59
60extern u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc);
61
62extern void mdesc_update(void);
63
64struct mdesc_notifier_client {
65 void (*add)(struct mdesc_handle *handle, u64 node);
66 void (*remove)(struct mdesc_handle *handle, u64 node);
67
68 const char *node_name;
69 struct mdesc_notifier_client *next;
22}; 70};
23 71
24extern struct mdesc_node *md_find_node_by_name(struct mdesc_node *from, 72extern void mdesc_register_notifier(struct mdesc_notifier_client *client);
25 const char *name); 73
26#define md_for_each_node_by_name(__mn, __name) \ 74extern void mdesc_fill_in_cpu_data(cpumask_t mask);
27 for (__mn = md_find_node_by_name(NULL, __name); __mn; \
28 __mn = md_find_node_by_name(__mn, __name))
29
30extern struct property *md_find_property(const struct mdesc_node *mp,
31 const char *name,
32 int *lenp);
33extern const void *md_get_property(const struct mdesc_node *mp,
34 const char *name,
35 int *lenp);
36 75
37extern void sun4v_mdesc_init(void); 76extern void sun4v_mdesc_init(void);
38 77
diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h
index 8d129032013e..9fc225ed5500 100644
--- a/include/asm-sparc64/mmu_context.h
+++ b/include/asm-sparc64/mmu_context.h
@@ -76,6 +76,9 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str
76 unsigned long ctx_valid, flags; 76 unsigned long ctx_valid, flags;
77 int cpu; 77 int cpu;
78 78
79 if (unlikely(mm == &init_mm))
80 return;
81
79 spin_lock_irqsave(&mm->context.lock, flags); 82 spin_lock_irqsave(&mm->context.lock, flags);
80 ctx_valid = CTX_VALID(mm->context); 83 ctx_valid = CTX_VALID(mm->context);
81 if (!ctx_valid) 84 if (!ctx_valid)
diff --git a/include/asm-sparc64/of_device.h b/include/asm-sparc64/of_device.h
index 60e9173c9acb..46d69b3223c5 100644
--- a/include/asm-sparc64/of_device.h
+++ b/include/asm-sparc64/of_device.h
@@ -3,14 +3,9 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/of.h>
6#include <linux/mod_devicetable.h> 7#include <linux/mod_devicetable.h>
7#include <asm/openprom.h> 8#include <asm/openprom.h>
8#include <asm/prom.h>
9
10extern struct bus_type isa_bus_type;
11extern struct bus_type ebus_bus_type;
12extern struct bus_type sbus_bus_type;
13extern struct bus_type of_bus_type;
14 9
15/* 10/*
16 * The of_device is a kind of "base class" that is a superset of 11 * The of_device is a kind of "base class" that is a superset of
@@ -31,50 +26,13 @@ struct of_device
31 int portid; 26 int portid;
32 int clock_freq; 27 int clock_freq;
33}; 28};
34#define to_of_device(d) container_of(d, struct of_device, dev)
35 29
36extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 30extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
37extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 31extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
38 32
39extern struct of_device *of_find_device_by_node(struct device_node *); 33/* These are just here during the transition */
40 34#include <linux/of_device.h>
41extern const struct of_device_id *of_match_device( 35#include <linux/of_platform.h>
42 const struct of_device_id *matches, const struct of_device *dev);
43
44extern struct of_device *of_dev_get(struct of_device *dev);
45extern void of_dev_put(struct of_device *dev);
46
47/*
48 * An of_platform_driver driver is attached to a basic of_device on
49 * the ISA, EBUS, and SBUS busses on sparc64.
50 */
51struct of_platform_driver
52{
53 char *name;
54 struct of_device_id *match_table;
55 struct module *owner;
56
57 int (*probe)(struct of_device* dev, const struct of_device_id *match);
58 int (*remove)(struct of_device* dev);
59
60 int (*suspend)(struct of_device* dev, pm_message_t state);
61 int (*resume)(struct of_device* dev);
62 int (*shutdown)(struct of_device* dev);
63
64 struct device_driver driver;
65};
66#define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver)
67
68extern int of_register_driver(struct of_platform_driver *drv,
69 struct bus_type *bus);
70extern void of_unregister_driver(struct of_platform_driver *drv);
71extern int of_device_register(struct of_device *ofdev);
72extern void of_device_unregister(struct of_device *ofdev);
73extern struct of_device *of_platform_device_create(struct device_node *np,
74 const char *bus_id,
75 struct device *parent,
76 struct bus_type *bus);
77extern void of_release_dev(struct device *dev);
78 36
79#endif /* __KERNEL__ */ 37#endif /* __KERNEL__ */
80#endif /* _ASM_SPARC64_OF_DEVICE_H */ 38#endif /* _ASM_SPARC64_OF_DEVICE_H */
diff --git a/include/asm-sparc64/of_platform.h b/include/asm-sparc64/of_platform.h
new file mode 100644
index 000000000000..f7c1f17c7d52
--- /dev/null
+++ b/include/asm-sparc64/of_platform.h
@@ -0,0 +1,33 @@
1#ifndef _ASM_SPARC64_OF_PLATFORM_H
2#define _ASM_SPARC64_OF_PLATFORM_H
3/*
4 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
5 * <benh@kernel.crashing.org>
6 * Modified for Sparc by merging parts of asm-sparc/of_device.h
7 * by Stephen Rothwell
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 *
14 */
15
16/* This is just here during the transition */
17#include <linux/of_platform.h>
18
19extern struct bus_type isa_bus_type;
20extern struct bus_type ebus_bus_type;
21extern struct bus_type sbus_bus_type;
22extern struct bus_type of_platform_bus_type;
23#define of_bus_type of_platform_bus_type /* for compatibility */
24
25extern int of_register_driver(struct of_platform_driver *drv,
26 struct bus_type *bus);
27extern void of_unregister_driver(struct of_platform_driver *drv);
28extern struct of_device *of_platform_device_create(struct device_node *np,
29 const char *bus_id,
30 struct device *parent,
31 struct bus_type *bus);
32
33#endif /* _ASM_SPARC64_OF_PLATFORM_H */
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h
index 992f9f7a476c..3f23c5dc5f21 100644
--- a/include/asm-sparc64/oplib.h
+++ b/include/asm-sparc64/oplib.h
@@ -140,32 +140,6 @@ extern void prom_putchar(char character);
140extern void prom_printf(const char *fmt, ...); 140extern void prom_printf(const char *fmt, ...);
141extern void prom_write(const char *buf, unsigned int len); 141extern void prom_write(const char *buf, unsigned int len);
142 142
143/* Query for input device type */
144
145enum prom_input_device {
146 PROMDEV_IKBD, /* input from keyboard */
147 PROMDEV_ITTYA, /* input from ttya */
148 PROMDEV_ITTYB, /* input from ttyb */
149 PROMDEV_IRSC, /* input from rsc */
150 PROMDEV_IVCONS, /* input from virtual-console */
151 PROMDEV_I_UNK,
152};
153
154extern enum prom_input_device prom_query_input_device(void);
155
156/* Query for output device type */
157
158enum prom_output_device {
159 PROMDEV_OSCREEN, /* to screen */
160 PROMDEV_OTTYA, /* to ttya */
161 PROMDEV_OTTYB, /* to ttyb */
162 PROMDEV_ORSC, /* to rsc */
163 PROMDEV_OVCONS, /* to virtual-console */
164 PROMDEV_O_UNK,
165};
166
167extern enum prom_output_device prom_query_output_device(void);
168
169/* Multiprocessor operations... */ 143/* Multiprocessor operations... */
170#ifdef CONFIG_SMP 144#ifdef CONFIG_SMP
171/* Start the CPU with the given device tree node at the passed program 145/* Start the CPU with the given device tree node at the passed program
@@ -319,6 +293,8 @@ extern int prom_inst2pkg(int);
319extern int prom_service_exists(const char *service_name); 293extern int prom_service_exists(const char *service_name);
320extern void prom_sun4v_guest_soft_state(void); 294extern void prom_sun4v_guest_soft_state(void);
321 295
296extern int prom_ihandle2path(int handle, char *buffer, int bufsize);
297
322/* Client interface level routines. */ 298/* Client interface level routines. */
323extern void prom_set_trap_table(unsigned long tba); 299extern void prom_set_trap_table(unsigned long tba);
324extern void prom_set_trap_table_sun4v(unsigned long tba, unsigned long mmfsa); 300extern void prom_set_trap_table_sun4v(unsigned long tba, unsigned long mmfsa);
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h
index 6340a5253a34..600afe5ae2e3 100644
--- a/include/asm-sparc64/parport.h
+++ b/include/asm-sparc64/parport.h
@@ -8,8 +8,9 @@
8#define _ASM_SPARC64_PARPORT_H 1 8#define _ASM_SPARC64_PARPORT_H 1
9 9
10#include <asm/ebus.h> 10#include <asm/ebus.h>
11#include <asm/isa.h>
12#include <asm/ns87303.h> 11#include <asm/ns87303.h>
12#include <asm/of_device.h>
13#include <asm/prom.h>
13 14
14#define PARPORT_PC_MAX_PORTS PARPORT_MAX 15#define PARPORT_PC_MAX_PORTS PARPORT_MAX
15 16
@@ -35,8 +36,12 @@ static struct sparc_ebus_info {
35 unsigned int addr; 36 unsigned int addr;
36 unsigned int count; 37 unsigned int count;
37 int lock; 38 int lock;
39
40 struct parport *port;
38} sparc_ebus_dmas[PARPORT_PC_MAX_PORTS]; 41} sparc_ebus_dmas[PARPORT_PC_MAX_PORTS];
39 42
43static DECLARE_BITMAP(dma_slot_map, PARPORT_PC_MAX_PORTS);
44
40static __inline__ int request_dma(unsigned int dmanr, const char *device_id) 45static __inline__ int request_dma(unsigned int dmanr, const char *device_id)
41{ 46{
42 if (dmanr >= PARPORT_PC_MAX_PORTS) 47 if (dmanr >= PARPORT_PC_MAX_PORTS)
@@ -98,116 +103,145 @@ static __inline__ unsigned int get_dma_residue(unsigned int dmanr)
98 return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info); 103 return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info);
99} 104}
100 105
101static int ebus_ecpp_p(struct linux_ebus_device *edev) 106static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id *match)
102{ 107{
103 if (!strcmp(edev->prom_node->name, "ecpp")) 108 unsigned long base = op->resource[0].start;
104 return 1; 109 unsigned long config = op->resource[1].start;
105 if (!strcmp(edev->prom_node->name, "parallel")) { 110 unsigned long d_base = op->resource[2].start;
106 const char *compat; 111 unsigned long d_len;
107 112 struct device_node *parent;
108 compat = of_get_property(edev->prom_node, 113 struct parport *p;
109 "compatible", NULL); 114 int slot, err;
110 if (compat && 115
111 (!strcmp(compat, "ecpp") || 116 parent = op->node->parent;
112 !strcmp(compat, "ns87317-ecpp") || 117 if (!strcmp(parent->name, "dma")) {
113 !strcmp(compat + 13, "ecpp"))) 118 p = parport_pc_probe_port(base, base + 0x400,
114 return 1; 119 op->irqs[0], PARPORT_DMA_NOFIFO,
120 op->dev.parent);
121 if (!p)
122 return -ENOMEM;
123 dev_set_drvdata(&op->dev, p);
124 return 0;
115 } 125 }
126
127 for (slot = 0; slot < PARPORT_PC_MAX_PORTS; slot++) {
128 if (!test_and_set_bit(slot, dma_slot_map))
129 break;
130 }
131 err = -ENODEV;
132 if (slot >= PARPORT_PC_MAX_PORTS)
133 goto out_err;
134
135 spin_lock_init(&sparc_ebus_dmas[slot].info.lock);
136
137 d_len = (op->resource[2].end - d_base) + 1UL;
138 sparc_ebus_dmas[slot].info.regs =
139 of_ioremap(&op->resource[2], 0, d_len, "ECPP DMA");
140
141 if (!sparc_ebus_dmas[slot].info.regs)
142 goto out_clear_map;
143
144 sparc_ebus_dmas[slot].info.flags = 0;
145 sparc_ebus_dmas[slot].info.callback = NULL;
146 sparc_ebus_dmas[slot].info.client_cookie = NULL;
147 sparc_ebus_dmas[slot].info.irq = 0xdeadbeef;
148 strcpy(sparc_ebus_dmas[slot].info.name, "parport");
149 if (ebus_dma_register(&sparc_ebus_dmas[slot].info))
150 goto out_unmap_regs;
151
152 ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 1);
153
154 /* Configure IRQ to Push Pull, Level Low */
155 /* Enable ECP, set bit 2 of the CTR first */
156 outb(0x04, base + 0x02);
157 ns87303_modify(config, PCR,
158 PCR_EPP_ENABLE |
159 PCR_IRQ_ODRAIN,
160 PCR_ECP_ENABLE |
161 PCR_ECP_CLK_ENA |
162 PCR_IRQ_POLAR);
163
164 /* CTR bit 5 controls direction of port */
165 ns87303_modify(config, PTR,
166 0, PTR_LPT_REG_DIR);
167
168 p = parport_pc_probe_port(base, base + 0x400,
169 op->irqs[0],
170 slot,
171 op->dev.parent);
172 err = -ENOMEM;
173 if (!p)
174 goto out_disable_irq;
175
176 dev_set_drvdata(&op->dev, p);
177
116 return 0; 178 return 0;
179
180out_disable_irq:
181 ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 0);
182 ebus_dma_unregister(&sparc_ebus_dmas[slot].info);
183
184out_unmap_regs:
185 of_iounmap(&op->resource[2], sparc_ebus_dmas[slot].info.regs, d_len);
186
187out_clear_map:
188 clear_bit(slot, dma_slot_map);
189
190out_err:
191 return err;
117} 192}
118 193
119static int parport_isa_probe(int count) 194static int __devexit ecpp_remove(struct of_device *op)
120{ 195{
121 struct sparc_isa_bridge *isa_br; 196 struct parport *p = dev_get_drvdata(&op->dev);
122 struct sparc_isa_device *isa_dev; 197 int slot = p->dma;
123 198
124 for_each_isa(isa_br) { 199 parport_pc_unregister_port(p);
125 for_each_isadev(isa_dev, isa_br) { 200
126 struct sparc_isa_device *child; 201 if (slot != PARPORT_DMA_NOFIFO) {
127 unsigned long base; 202 unsigned long d_base = op->resource[2].start;
128 203 unsigned long d_len;
129 if (strcmp(isa_dev->prom_node->name, "dma")) 204
130 continue; 205 d_len = (op->resource[2].end - d_base) + 1UL;
131 206
132 child = isa_dev->child; 207 ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 0);
133 while (child) { 208 ebus_dma_unregister(&sparc_ebus_dmas[slot].info);
134 if (!strcmp(child->prom_node->name, "parallel")) 209 of_iounmap(&op->resource[2],
135 break; 210 sparc_ebus_dmas[slot].info.regs,
136 child = child->next; 211 d_len);
137 } 212 clear_bit(slot, dma_slot_map);
138 if (!child)
139 continue;
140
141 base = child->resource.start;
142
143 /* No DMA, see commentary in
144 * asm-sparc64/floppy.h:isa_floppy_init()
145 */
146 if (parport_pc_probe_port(base, base + 0x400,
147 child->irq, PARPORT_DMA_NOFIFO,
148 child->bus->self))
149 count++;
150 }
151 } 213 }
152 214
153 return count; 215 return 0;
154} 216}
155 217
156static int parport_pc_find_nonpci_ports (int autoirq, int autodma) 218static struct of_device_id ecpp_match[] = {
219 {
220 .name = "ecpp",
221 },
222 {
223 .name = "parallel",
224 .compatible = "ecpp",
225 },
226 {
227 .name = "parallel",
228 .compatible = "ns87317-ecpp",
229 },
230 {},
231};
232
233static struct of_platform_driver ecpp_driver = {
234 .name = "ecpp",
235 .match_table = ecpp_match,
236 .probe = ecpp_probe,
237 .remove = __devexit_p(ecpp_remove),
238};
239
240static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
157{ 241{
158 struct linux_ebus *ebus; 242 of_register_driver(&ecpp_driver, &of_bus_type);
159 struct linux_ebus_device *edev;
160 int count = 0;
161
162 for_each_ebus(ebus) {
163 for_each_ebusdev(edev, ebus) {
164 if (ebus_ecpp_p(edev)) {
165 unsigned long base = edev->resource[0].start;
166 unsigned long config = edev->resource[1].start;
167 unsigned long d_base = edev->resource[2].start;
168 unsigned long d_len;
169
170 spin_lock_init(&sparc_ebus_dmas[count].info.lock);
171 d_len = (edev->resource[2].end -
172 d_base) + 1;
173 sparc_ebus_dmas[count].info.regs =
174 ioremap(d_base, d_len);
175 if (!sparc_ebus_dmas[count].info.regs)
176 continue;
177 sparc_ebus_dmas[count].info.flags = 0;
178 sparc_ebus_dmas[count].info.callback = NULL;
179 sparc_ebus_dmas[count].info.client_cookie = NULL;
180 sparc_ebus_dmas[count].info.irq = 0xdeadbeef;
181 strcpy(sparc_ebus_dmas[count].info.name, "parport");
182 if (ebus_dma_register(&sparc_ebus_dmas[count].info))
183 continue;
184 ebus_dma_irq_enable(&sparc_ebus_dmas[count].info, 1);
185
186 /* Configure IRQ to Push Pull, Level Low */
187 /* Enable ECP, set bit 2 of the CTR first */
188 outb(0x04, base + 0x02);
189 ns87303_modify(config, PCR,
190 PCR_EPP_ENABLE |
191 PCR_IRQ_ODRAIN,
192 PCR_ECP_ENABLE |
193 PCR_ECP_CLK_ENA |
194 PCR_IRQ_POLAR);
195
196 /* CTR bit 5 controls direction of port */
197 ns87303_modify(config, PTR,
198 0, PTR_LPT_REG_DIR);
199
200 if (parport_pc_probe_port(base, base + 0x400,
201 edev->irqs[0],
202 count, ebus->self))
203 count++;
204 }
205 }
206 }
207 243
208 count = parport_isa_probe(count); 244 return 0;
209
210 return count;
211} 245}
212 246
213#endif /* !(_ASM_SPARC64_PARPORT_H */ 247#endif /* !(_ASM_SPARC64_PARPORT_H */
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
index 47cea16e1bad..e11ac100f043 100644
--- a/include/asm-sparc64/pci.h
+++ b/include/asm-sparc64/pci.h
@@ -206,49 +206,6 @@ extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask);
206#define PCI64_REQUIRED_MASK (~(dma64_addr_t)0) 206#define PCI64_REQUIRED_MASK (~(dma64_addr_t)0)
207#define PCI64_ADDR_BASE 0xfffc000000000000UL 207#define PCI64_ADDR_BASE 0xfffc000000000000UL
208 208
209/* Usage of the pci_dac_foo interfaces is only valid if this
210 * test passes.
211 */
212#define pci_dac_dma_supported(pci_dev, mask) \
213 ((((mask) & PCI64_REQUIRED_MASK) == PCI64_REQUIRED_MASK) ? 1 : 0)
214
215static inline dma64_addr_t
216pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page, unsigned long offset, int direction)
217{
218 return (PCI64_ADDR_BASE +
219 __pa(page_address(page)) + offset);
220}
221
222static inline struct page *
223pci_dac_dma_to_page(struct pci_dev *pdev, dma64_addr_t dma_addr)
224{
225 unsigned long paddr = (dma_addr & PAGE_MASK) - PCI64_ADDR_BASE;
226
227 return virt_to_page(__va(paddr));
228}
229
230static inline unsigned long
231pci_dac_dma_to_offset(struct pci_dev *pdev, dma64_addr_t dma_addr)
232{
233 return (dma_addr & ~PAGE_MASK);
234}
235
236static inline void
237pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
238{
239 /* DAC cycle addressing does not make use of the
240 * PCI controller's streaming cache, so nothing to do.
241 */
242}
243
244static inline void
245pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
246{
247 /* DAC cycle addressing does not make use of the
248 * PCI controller's streaming cache, so nothing to do.
249 */
250}
251
252#define PCI_DMA_ERROR_CODE (~(dma_addr_t)0x0) 209#define PCI_DMA_ERROR_CODE (~(dma_addr_t)0x0)
253 210
254static inline int pci_dma_mapping_error(dma_addr_t dma_addr) 211static inline int pci_dma_mapping_error(dma_addr_t dma_addr)
@@ -303,10 +260,6 @@ pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
303 260
304extern struct resource *pcibios_select_root(struct pci_dev *, struct resource *); 261extern struct resource *pcibios_select_root(struct pci_dev *, struct resource *);
305 262
306static inline void pcibios_add_platform_entries(struct pci_dev *dev)
307{
308}
309
310static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 263static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
311{ 264{
312 return PCI_IRQ_NONE; 265 return PCI_IRQ_NONE;
diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h
index 88db872ce2f8..caf8750792ff 100644
--- a/include/asm-sparc64/percpu.h
+++ b/include/asm-sparc64/percpu.h
@@ -18,6 +18,11 @@ extern unsigned long __per_cpu_shift;
18#define DEFINE_PER_CPU(type, name) \ 18#define DEFINE_PER_CPU(type, name) \
19 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name 19 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
20 20
21#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
22 __attribute__((__section__(".data.percpu.shared_aligned"))) \
23 __typeof__(type) per_cpu__##name \
24 ____cacheline_aligned_in_smp
25
21register unsigned long __local_per_cpu_offset asm("g5"); 26register unsigned long __local_per_cpu_offset asm("g5");
22 27
23/* var is in discarded region: offset to particular copy we want */ 28/* var is in discarded region: offset to particular copy we want */
@@ -38,6 +43,8 @@ do { \
38#define real_setup_per_cpu_areas() do { } while (0) 43#define real_setup_per_cpu_areas() do { } while (0)
39#define DEFINE_PER_CPU(type, name) \ 44#define DEFINE_PER_CPU(type, name) \
40 __typeof__(type) per_cpu__##name 45 __typeof__(type) per_cpu__##name
46#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
47 DEFINE_PER_CPU(type, name)
41 48
42#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) 49#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var))
43#define __get_cpu_var(var) per_cpu__##var 50#define __get_cpu_var(var) per_cpu__##var
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index 9e80ad43b29c..0393380d754a 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -573,24 +573,6 @@ static inline unsigned long pte_exec(pte_t pte)
573 return (pte_val(pte) & mask); 573 return (pte_val(pte) & mask);
574} 574}
575 575
576static inline unsigned long pte_read(pte_t pte)
577{
578 unsigned long mask;
579
580 __asm__ __volatile__(
581 "\n661: mov %1, %0\n"
582 " nop\n"
583 " .section .sun4v_2insn_patch, \"ax\"\n"
584 " .word 661b\n"
585 " sethi %%uhi(%2), %0\n"
586 " sllx %0, 32, %0\n"
587 " .previous\n"
588 : "=r" (mask)
589 : "i" (_PAGE_READ_4U), "i" (_PAGE_READ_4V));
590
591 return (pte_val(pte) & mask);
592}
593
594static inline unsigned long pte_file(pte_t pte) 576static inline unsigned long pte_file(pte_t pte)
595{ 577{
596 unsigned long val = pte_val(pte); 578 unsigned long val = pte_val(pte);
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index b4df3042add0..31dcb92fbae0 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -2,7 +2,6 @@
2#define _SPARC64_PROM_H 2#define _SPARC64_PROM_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5
6/* 5/*
7 * Definitions for talking to the Open Firmware PROM on 6 * Definitions for talking to the Open Firmware PROM on
8 * Power Macintosh computers. 7 * Power Macintosh computers.
@@ -17,11 +16,17 @@
17 * as published by the Free Software Foundation; either version 16 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version. 17 * 2 of the License, or (at your option) any later version.
19 */ 18 */
20
21#include <linux/types.h> 19#include <linux/types.h>
22#include <linux/proc_fs.h> 20#include <linux/proc_fs.h>
23#include <asm/atomic.h> 21#include <asm/atomic.h>
24 22
23#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
24#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
25
26#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
27#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
28#define of_node_cmp(s1, s2) strcmp((s1), (s2))
29
25typedef u32 phandle; 30typedef u32 phandle;
26typedef u32 ihandle; 31typedef u32 ihandle;
27 32
@@ -63,54 +68,35 @@ struct of_irq_controller {
63 void *data; 68 void *data;
64}; 69};
65 70
66/* flag descriptions */
67#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
68
69#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) 71#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
70#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) 72#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
71 73
72#define OF_BAD_ADDR ((u64)-1)
73
74static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
75{
76 dn->pde = de;
77}
78
79extern struct device_node *of_find_node_by_name(struct device_node *from,
80 const char *name);
81#define for_each_node_by_name(dn, name) \
82 for (dn = of_find_node_by_name(NULL, name); dn; \
83 dn = of_find_node_by_name(dn, name))
84extern struct device_node *of_find_node_by_type(struct device_node *from,
85 const char *type);
86#define for_each_node_by_type(dn, type) \
87 for (dn = of_find_node_by_type(NULL, type); dn; \
88 dn = of_find_node_by_type(dn, type))
89extern struct device_node *of_find_compatible_node(struct device_node *from,
90 const char *type, const char *compat);
91extern struct device_node *of_find_node_by_path(const char *path);
92extern struct device_node *of_find_node_by_phandle(phandle handle);
93extern struct device_node *of_find_node_by_cpuid(int cpuid); 74extern struct device_node *of_find_node_by_cpuid(int cpuid);
94extern struct device_node *of_get_parent(const struct device_node *node);
95extern struct device_node *of_get_next_child(const struct device_node *node,
96 struct device_node *prev);
97extern struct property *of_find_property(const struct device_node *np,
98 const char *name,
99 int *lenp);
100extern int of_device_is_compatible(const struct device_node *device,
101 const char *);
102extern const void *of_get_property(const struct device_node *node,
103 const char *name,
104 int *lenp);
105#define get_property(node,name,lenp) of_get_property(node,name,lenp)
106extern int of_set_property(struct device_node *node, const char *name, void *val, int len); 75extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
107extern int of_getintprop_default(struct device_node *np, 76extern int of_getintprop_default(struct device_node *np,
108 const char *name, 77 const char *name,
109 int def); 78 int def);
110extern int of_n_addr_cells(struct device_node *np);
111extern int of_n_size_cells(struct device_node *np);
112 79
113extern void prom_build_devicetree(void); 80extern void prom_build_devicetree(void);
114 81
82/* Dummy ref counting routines - to be implemented later */
83static inline struct device_node *of_node_get(struct device_node *node)
84{
85 return node;
86}
87static inline void of_node_put(struct device_node *node)
88{
89}
90
91/*
92 * NB: This is here while we transition from using asm/prom.h
93 * to linux/of.h
94 */
95#include <linux/of.h>
96
97extern struct device_node *of_console_device;
98extern char *of_console_path;
99extern char *of_console_options;
100
115#endif /* __KERNEL__ */ 101#endif /* __KERNEL__ */
116#endif /* _SPARC64_PROM_H */ 102#endif /* _SPARC64_PROM_H */
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h
index f76e1492add5..e8a96a31761b 100644
--- a/include/asm-sparc64/smp.h
+++ b/include/asm-sparc64/smp.h
@@ -29,10 +29,9 @@
29#include <asm/bitops.h> 29#include <asm/bitops.h>
30#include <asm/atomic.h> 30#include <asm/atomic.h>
31 31
32extern cpumask_t phys_cpu_present_map;
33#define cpu_possible_map phys_cpu_present_map
34
35extern cpumask_t cpu_sibling_map[NR_CPUS]; 32extern cpumask_t cpu_sibling_map[NR_CPUS];
33extern cpumask_t cpu_core_map[NR_CPUS];
34extern int sparc64_multi_core;
36 35
37/* 36/*
38 * General functions that each host system must provide. 37 * General functions that each host system must provide.
@@ -42,7 +41,12 @@ extern int hard_smp_processor_id(void);
42#define raw_smp_processor_id() (current_thread_info()->cpu) 41#define raw_smp_processor_id() (current_thread_info()->cpu)
43 42
44extern void smp_fill_in_sib_core_maps(void); 43extern void smp_fill_in_sib_core_maps(void);
45extern unsigned char boot_cpu_id; 44extern void cpu_play_dead(void);
45
46#ifdef CONFIG_HOTPLUG_CPU
47extern int __cpu_disable(void);
48extern void __cpu_die(unsigned int cpu);
49#endif
46 50
47#endif /* !(__ASSEMBLY__) */ 51#endif /* !(__ASSEMBLY__) */
48 52
@@ -50,7 +54,6 @@ extern unsigned char boot_cpu_id;
50 54
51#define hard_smp_processor_id() 0 55#define hard_smp_processor_id() 0
52#define smp_fill_in_sib_core_maps() do { } while (0) 56#define smp_fill_in_sib_core_maps() do { } while (0)
53#define boot_cpu_id (0)
54 57
55#endif /* !(CONFIG_SMP) */ 58#endif /* !(CONFIG_SMP) */
56 59
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 8ba380ec6daa..64891cb10f05 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -115,14 +115,8 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
115#ifndef __ASSEMBLY__ 115#ifndef __ASSEMBLY__
116 116
117extern void sun_do_break(void); 117extern void sun_do_break(void);
118extern int serial_console;
119extern int stop_a_enabled; 118extern int stop_a_enabled;
120 119
121static __inline__ int con_is_present(void)
122{
123 return serial_console ? 0 : 1;
124}
125
126extern void synchronize_user_stack(void); 120extern void synchronize_user_stack(void);
127 121
128extern void __flushw_user(void); 122extern void __flushw_user(void);
@@ -204,16 +198,6 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \
204 } \ 198 } \
205} while(0) 199} while(0)
206 200
207/*
208 * On SMP systems, when the scheduler does migration-cost autodetection,
209 * it needs a way to flush as much of the CPU's caches as possible.
210 *
211 * TODO: fill this in!
212 */
213static inline void sched_cacheflush(void)
214{
215}
216
217static inline unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val) 201static inline unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val)
218{ 202{
219 unsigned long tmp1, tmp2; 203 unsigned long tmp1, tmp2;
diff --git a/include/asm-sparc64/tlb.h b/include/asm-sparc64/tlb.h
index 7af1e1109c49..349d1d3e9c27 100644
--- a/include/asm-sparc64/tlb.h
+++ b/include/asm-sparc64/tlb.h
@@ -2,6 +2,7 @@
2#define _SPARC64_TLB_H 2#define _SPARC64_TLB_H
3 3
4#include <linux/swap.h> 4#include <linux/swap.h>
5#include <linux/pagemap.h>
5#include <asm/pgalloc.h> 6#include <asm/pgalloc.h>
6#include <asm/tlbflush.h> 7#include <asm/tlbflush.h>
7#include <asm/mmu_context.h> 8#include <asm/mmu_context.h>
diff --git a/include/asm-sparc64/topology.h b/include/asm-sparc64/topology.h
index e0d450d600ec..290ac75f385b 100644
--- a/include/asm-sparc64/topology.h
+++ b/include/asm-sparc64/topology.h
@@ -1,12 +1,17 @@
1#ifndef _ASM_SPARC64_TOPOLOGY_H 1#ifndef _ASM_SPARC64_TOPOLOGY_H
2#define _ASM_SPARC64_TOPOLOGY_H 2#define _ASM_SPARC64_TOPOLOGY_H
3 3
4#include <asm/spitfire.h> 4#ifdef CONFIG_SMP
5#define smt_capable() (tlb_type == hypervisor) 5#define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id)
6#define topology_core_id(cpu) (cpu_data(cpu).core_id)
7#define topology_core_siblings(cpu) (cpu_core_map[cpu])
8#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu])
9#define mc_capable() (sparc64_multi_core)
10#define smt_capable() (sparc64_multi_core)
11#endif /* CONFIG_SMP */
6 12
7#include <asm-generic/topology.h> 13#include <asm-generic/topology.h>
8 14
9#define topology_core_id(cpu) (cpu_data(cpu).core_id) 15#define cpu_coregroup_map(cpu) (cpu_core_map[cpu])
10#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu])
11 16
12#endif /* _ASM_SPARC64_TOPOLOGY_H */ 17#endif /* _ASM_SPARC64_TOPOLOGY_H */
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 53e96ed9c024..cb751b4d0f56 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -1,4 +1,3 @@
1/* $Id: unistd.h,v 1.50 2002/02/08 03:57:18 davem Exp $ */
2#ifndef _SPARC64_UNISTD_H 1#ifndef _SPARC64_UNISTD_H
3#define _SPARC64_UNISTD_H 2#define _SPARC64_UNISTD_H
4 3
@@ -9,7 +8,7 @@
9 * think of right now to force the arguments into fixed registers 8 * think of right now to force the arguments into fixed registers
10 * before the trap into the system call with gcc 'asm' statements. 9 * before the trap into the system call with gcc 'asm' statements.
11 * 10 *
12 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 11 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
13 * 12 *
14 * SunOS compatibility based upon preliminary work which is: 13 * SunOS compatibility based upon preliminary work which is:
15 * 14 *
@@ -332,8 +331,9 @@
332#define __NR_signalfd 311 331#define __NR_signalfd 311
333#define __NR_timerfd 312 332#define __NR_timerfd 312
334#define __NR_eventfd 313 333#define __NR_eventfd 313
334#define __NR_fallocate 314
335 335
336#define NR_SYSCALLS 314 336#define NR_SYSCALLS 315
337 337
338#ifdef __KERNEL__ 338#ifdef __KERNEL__
339/* sysconf options, for SunOS compatibility */ 339/* sysconf options, for SunOS compatibility */
diff --git a/include/asm-sparc64/vio.h b/include/asm-sparc64/vio.h
new file mode 100644
index 000000000000..f7417e91b170
--- /dev/null
+++ b/include/asm-sparc64/vio.h
@@ -0,0 +1,406 @@
1#ifndef _SPARC64_VIO_H
2#define _SPARC64_VIO_H
3
4#include <linux/kernel.h>
5#include <linux/device.h>
6#include <linux/mod_devicetable.h>
7#include <linux/timer.h>
8#include <linux/spinlock.h>
9#include <linux/completion.h>
10#include <linux/list.h>
11
12#include <asm/ldc.h>
13#include <asm/mdesc.h>
14
15struct vio_msg_tag {
16 u8 type;
17#define VIO_TYPE_CTRL 0x01
18#define VIO_TYPE_DATA 0x02
19#define VIO_TYPE_ERR 0x04
20
21 u8 stype;
22#define VIO_SUBTYPE_INFO 0x01
23#define VIO_SUBTYPE_ACK 0x02
24#define VIO_SUBTYPE_NACK 0x04
25
26 u16 stype_env;
27#define VIO_VER_INFO 0x0001
28#define VIO_ATTR_INFO 0x0002
29#define VIO_DRING_REG 0x0003
30#define VIO_DRING_UNREG 0x0004
31#define VIO_RDX 0x0005
32#define VIO_PKT_DATA 0x0040
33#define VIO_DESC_DATA 0x0041
34#define VIO_DRING_DATA 0x0042
35#define VNET_MCAST_INFO 0x0101
36
37 u32 sid;
38};
39
40struct vio_rdx {
41 struct vio_msg_tag tag;
42 u64 resv[6];
43};
44
45struct vio_ver_info {
46 struct vio_msg_tag tag;
47 u16 major;
48 u16 minor;
49 u8 dev_class;
50#define VDEV_NETWORK 0x01
51#define VDEV_NETWORK_SWITCH 0x02
52#define VDEV_DISK 0x03
53#define VDEV_DISK_SERVER 0x04
54
55 u8 resv1[3];
56 u64 resv2[5];
57};
58
59struct vio_dring_register {
60 struct vio_msg_tag tag;
61 u64 dring_ident;
62 u32 num_descr;
63 u32 descr_size;
64 u16 options;
65#define VIO_TX_DRING 0x0001
66#define VIO_RX_DRING 0x0002
67 u16 resv;
68 u32 num_cookies;
69 struct ldc_trans_cookie cookies[0];
70};
71
72struct vio_dring_unregister {
73 struct vio_msg_tag tag;
74 u64 dring_ident;
75 u64 resv[5];
76};
77
78/* Data transfer modes */
79#define VIO_PKT_MODE 0x01 /* Packet based transfer */
80#define VIO_DESC_MODE 0x02 /* In-band descriptors */
81#define VIO_DRING_MODE 0x03 /* Descriptor rings */
82
83struct vio_dring_data {
84 struct vio_msg_tag tag;
85 u64 seq;
86 u64 dring_ident;
87 u32 start_idx;
88 u32 end_idx;
89 u8 state;
90#define VIO_DRING_ACTIVE 0x01
91#define VIO_DRING_STOPPED 0x02
92
93 u8 __pad1;
94 u16 __pad2;
95 u32 __pad3;
96 u64 __par4[2];
97};
98
99struct vio_dring_hdr {
100 u8 state;
101#define VIO_DESC_FREE 0x01
102#define VIO_DESC_READY 0x02
103#define VIO_DESC_ACCEPTED 0x03
104#define VIO_DESC_DONE 0x04
105 u8 ack;
106#define VIO_ACK_ENABLE 0x01
107#define VIO_ACK_DISABLE 0x00
108
109 u16 __pad1;
110 u32 __pad2;
111};
112
113/* VIO disk specific structures and defines */
114struct vio_disk_attr_info {
115 struct vio_msg_tag tag;
116 u8 xfer_mode;
117 u8 vdisk_type;
118#define VD_DISK_TYPE_SLICE 0x01 /* Slice in block device */
119#define VD_DISK_TYPE_DISK 0x02 /* Entire block device */
120 u16 resv1;
121 u32 vdisk_block_size;
122 u64 operations;
123 u64 vdisk_size;
124 u64 max_xfer_size;
125 u64 resv2[2];
126};
127
128struct vio_disk_desc {
129 struct vio_dring_hdr hdr;
130 u64 req_id;
131 u8 operation;
132#define VD_OP_BREAD 0x01 /* Block read */
133#define VD_OP_BWRITE 0x02 /* Block write */
134#define VD_OP_FLUSH 0x03 /* Flush disk contents */
135#define VD_OP_GET_WCE 0x04 /* Get write-cache status */
136#define VD_OP_SET_WCE 0x05 /* Enable/disable write-cache */
137#define VD_OP_GET_VTOC 0x06 /* Get VTOC */
138#define VD_OP_SET_VTOC 0x07 /* Set VTOC */
139#define VD_OP_GET_DISKGEOM 0x08 /* Get disk geometry */
140#define VD_OP_SET_DISKGEOM 0x09 /* Set disk geometry */
141#define VD_OP_SCSICMD 0x0a /* SCSI control command */
142#define VD_OP_GET_DEVID 0x0b /* Get device ID */
143#define VD_OP_GET_EFI 0x0c /* Get EFI */
144#define VD_OP_SET_EFI 0x0d /* Set EFI */
145 u8 slice;
146 u16 resv1;
147 u32 status;
148 u64 offset;
149 u64 size;
150 u32 ncookies;
151 u32 resv2;
152 struct ldc_trans_cookie cookies[0];
153};
154
155#define VIO_DISK_VNAME_LEN 8
156#define VIO_DISK_ALABEL_LEN 128
157#define VIO_DISK_NUM_PART 8
158
159struct vio_disk_vtoc {
160 u8 volume_name[VIO_DISK_VNAME_LEN];
161 u16 sector_size;
162 u16 num_partitions;
163 u8 ascii_label[VIO_DISK_ALABEL_LEN];
164 struct {
165 u16 id;
166 u16 perm_flags;
167 u32 resv;
168 u64 start_block;
169 u64 num_blocks;
170 } partitions[VIO_DISK_NUM_PART];
171};
172
173struct vio_disk_geom {
174 u16 num_cyl; /* Num data cylinders */
175 u16 alt_cyl; /* Num alternate cylinders */
176 u16 beg_cyl; /* Cyl off of fixed head area */
177 u16 num_hd; /* Num heads */
178 u16 num_sec; /* Num sectors */
179 u16 ifact; /* Interleave factor */
180 u16 apc; /* Alts per cylinder (SCSI) */
181 u16 rpm; /* Revolutions per minute */
182 u16 phy_cyl; /* Num physical cylinders */
183 u16 wr_skip; /* Num sects to skip, writes */
184 u16 rd_skip; /* Num sects to skip, writes */
185};
186
187struct vio_disk_devid {
188 u16 resv;
189 u16 type;
190 u32 len;
191 char id[0];
192};
193
194struct vio_disk_efi {
195 u64 lba;
196 u64 len;
197 char data[0];
198};
199
200/* VIO net specific structures and defines */
201struct vio_net_attr_info {
202 struct vio_msg_tag tag;
203 u8 xfer_mode;
204 u8 addr_type;
205#define VNET_ADDR_ETHERMAC 0x01
206 u16 ack_freq;
207 u32 resv1;
208 u64 addr;
209 u64 mtu;
210 u64 resv2[3];
211};
212
213#define VNET_NUM_MCAST 7
214
215struct vio_net_mcast_info {
216 struct vio_msg_tag tag;
217 u8 set;
218 u8 count;
219 u8 mcast_addr[VNET_NUM_MCAST * 6];
220 u32 resv;
221};
222
223struct vio_net_desc {
224 struct vio_dring_hdr hdr;
225 u32 size;
226 u32 ncookies;
227 struct ldc_trans_cookie cookies[0];
228};
229
230#define VIO_MAX_RING_COOKIES 24
231
232struct vio_dring_state {
233 u64 ident;
234 void *base;
235 u64 snd_nxt;
236 u64 rcv_nxt;
237 u32 entry_size;
238 u32 num_entries;
239 u32 prod;
240 u32 cons;
241 u32 pending;
242 int ncookies;
243 struct ldc_trans_cookie cookies[VIO_MAX_RING_COOKIES];
244};
245
246static inline void *vio_dring_cur(struct vio_dring_state *dr)
247{
248 return dr->base + (dr->entry_size * dr->prod);
249}
250
251static inline void *vio_dring_entry(struct vio_dring_state *dr,
252 unsigned int index)
253{
254 return dr->base + (dr->entry_size * index);
255}
256
257static inline u32 vio_dring_avail(struct vio_dring_state *dr,
258 unsigned int ring_size)
259{
260 /* Ensure build-time power-of-2. */
261 BUILD_BUG_ON(ring_size & (ring_size - 1));
262
263 return (dr->pending -
264 ((dr->prod - dr->cons) & (ring_size - 1)));
265}
266
267#define VIO_MAX_TYPE_LEN 32
268#define VIO_MAX_COMPAT_LEN 64
269
270struct vio_dev {
271 u64 mp;
272 struct device_node *dp;
273
274 char type[VIO_MAX_TYPE_LEN];
275 char compat[VIO_MAX_COMPAT_LEN];
276 int compat_len;
277
278 u64 dev_no;
279
280 unsigned long channel_id;
281
282 unsigned int tx_irq;
283 unsigned int rx_irq;
284
285 struct device dev;
286};
287
288struct vio_driver {
289 struct list_head node;
290 const struct vio_device_id *id_table;
291 int (*probe)(struct vio_dev *dev, const struct vio_device_id *id);
292 int (*remove)(struct vio_dev *dev);
293 void (*shutdown)(struct vio_dev *dev);
294 unsigned long driver_data;
295 struct device_driver driver;
296};
297
298struct vio_version {
299 u16 major;
300 u16 minor;
301};
302
303struct vio_driver_state;
304struct vio_driver_ops {
305 int (*send_attr)(struct vio_driver_state *vio);
306 int (*handle_attr)(struct vio_driver_state *vio, void *pkt);
307 void (*handshake_complete)(struct vio_driver_state *vio);
308};
309
310struct vio_completion {
311 struct completion com;
312 int err;
313 int waiting_for;
314};
315
316struct vio_driver_state {
317 /* Protects VIO handshake and, optionally, driver private state. */
318 spinlock_t lock;
319
320 struct ldc_channel *lp;
321
322 u32 _peer_sid;
323 u32 _local_sid;
324 struct vio_dring_state drings[2];
325#define VIO_DRIVER_TX_RING 0
326#define VIO_DRIVER_RX_RING 1
327
328 u8 hs_state;
329#define VIO_HS_INVALID 0x00
330#define VIO_HS_GOTVERS 0x01
331#define VIO_HS_GOT_ATTR 0x04
332#define VIO_HS_SENT_DREG 0x08
333#define VIO_HS_SENT_RDX 0x10
334#define VIO_HS_GOT_RDX_ACK 0x20
335#define VIO_HS_GOT_RDX 0x40
336#define VIO_HS_SENT_RDX_ACK 0x80
337#define VIO_HS_COMPLETE (VIO_HS_GOT_RDX_ACK | VIO_HS_SENT_RDX_ACK)
338
339 u8 dev_class;
340
341 u8 dr_state;
342#define VIO_DR_STATE_TXREG 0x01
343#define VIO_DR_STATE_RXREG 0x02
344#define VIO_DR_STATE_TXREQ 0x10
345#define VIO_DR_STATE_RXREQ 0x20
346
347 u8 debug;
348#define VIO_DEBUG_HS 0x01
349#define VIO_DEBUG_DATA 0x02
350
351 void *desc_buf;
352 unsigned int desc_buf_len;
353
354 struct vio_completion *cmp;
355
356 struct vio_dev *vdev;
357
358 struct timer_list timer;
359
360 struct vio_version ver;
361
362 struct vio_version *ver_table;
363 int ver_table_entries;
364
365 char *name;
366
367 struct vio_driver_ops *ops;
368};
369
370#define viodbg(TYPE, f, a...) \
371do { if (vio->debug & VIO_DEBUG_##TYPE) \
372 printk(KERN_INFO "vio: ID[%lu] " f, \
373 vio->vdev->channel_id, ## a); \
374} while (0)
375
376extern int vio_register_driver(struct vio_driver *drv);
377extern void vio_unregister_driver(struct vio_driver *drv);
378
379static inline struct vio_driver *to_vio_driver(struct device_driver *drv)
380{
381 return container_of(drv, struct vio_driver, driver);
382}
383
384static inline struct vio_dev *to_vio_dev(struct device *dev)
385{
386 return container_of(dev, struct vio_dev, dev);
387}
388
389extern int vio_ldc_send(struct vio_driver_state *vio, void *data, int len);
390extern void vio_link_state_change(struct vio_driver_state *vio, int event);
391extern void vio_conn_reset(struct vio_driver_state *vio);
392extern int vio_control_pkt_engine(struct vio_driver_state *vio, void *pkt);
393extern int vio_validate_sid(struct vio_driver_state *vio,
394 struct vio_msg_tag *tp);
395extern u32 vio_send_sid(struct vio_driver_state *vio);
396extern int vio_ldc_alloc(struct vio_driver_state *vio,
397 struct ldc_channel_config *base_cfg, void *event_arg);
398extern void vio_ldc_free(struct vio_driver_state *vio);
399extern int vio_driver_init(struct vio_driver_state *vio, struct vio_dev *vdev,
400 u8 dev_class, struct vio_version *ver_table,
401 int ver_table_size, struct vio_driver_ops *ops,
402 char *name);
403
404extern void vio_port_up(struct vio_driver_state *vio);
405
406#endif /* _SPARC64_VIO_H */
diff --git a/include/asm-um/a.out.h b/include/asm-um/a.out.h
index 50cee7b296f4..78bc9eed26b2 100644
--- a/include/asm-um/a.out.h
+++ b/include/asm-um/a.out.h
@@ -5,6 +5,7 @@
5#include "choose-mode.h" 5#include "choose-mode.h"
6 6
7#undef STACK_TOP 7#undef STACK_TOP
8#undef STACK_TOP_MAX
8 9
9extern unsigned long stacksizelim; 10extern unsigned long stacksizelim;
10 11
@@ -16,4 +17,6 @@ extern int honeypot;
16#define STACK_TOP \ 17#define STACK_TOP \
17 CHOOSE_MODE((honeypot ? host_task_size : task_size), task_size) 18 CHOOSE_MODE((honeypot ? host_task_size : task_size), task_size)
18 19
20#define STACK_TOP_MAX STACK_TOP
21
19#endif 22#endif
diff --git a/include/asm-um/bug.h b/include/asm-um/bug.h
index 3357c5e2468e..9e33b864c359 100644
--- a/include/asm-um/bug.h
+++ b/include/asm-um/bug.h
@@ -1,6 +1,6 @@
1#ifndef __UM_BUG_H 1#ifndef __UM_BUG_H
2#define __UM_BUG_H 2#define __UM_BUG_H
3 3
4#include <asm/arch/bug.h> 4#include <asm-generic/bug.h>
5 5
6#endif 6#endif
diff --git a/include/asm-um/common.lds.S b/include/asm-um/common.lds.S
index f5de80c31e88..e3f010bd12b3 100644
--- a/include/asm-um/common.lds.S
+++ b/include/asm-um/common.lds.S
@@ -20,6 +20,8 @@
20 __ex_table : { *(__ex_table) } 20 __ex_table : { *(__ex_table) }
21 __stop___ex_table = .; 21 __stop___ex_table = .;
22 22
23 BUG_TABLE
24
23 __uml_setup_start = .; 25 __uml_setup_start = .;
24 .uml.setup.init : { *(.uml.setup.init) } 26 .uml.setup.init : { *(.uml.setup.init) }
25 __uml_setup_end = .; 27 __uml_setup_end = .;
diff --git a/include/asm-um/paravirt.h b/include/asm-um/paravirt.h
new file mode 100644
index 000000000000..9d6aaad80b5f
--- /dev/null
+++ b/include/asm-um/paravirt.h
@@ -0,0 +1,6 @@
1#ifndef __UM_PARAVIRT_H
2#define __UM_PARAVIRT_H
3
4#include "asm/arch/paravirt.h"
5
6#endif
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h
index 1b1090a91a58..830fc6e5d49d 100644
--- a/include/asm-um/pgtable.h
+++ b/include/asm-um/pgtable.h
@@ -175,12 +175,6 @@ static inline int pte_none(pte_t pte)
175 * The following only work if pte_present() is true. 175 * The following only work if pte_present() is true.
176 * Undefined behaviour if not.. 176 * Undefined behaviour if not..
177 */ 177 */
178static inline int pte_user(pte_t pte)
179{
180 return((pte_get_bits(pte, _PAGE_USER)) &&
181 !(pte_get_bits(pte, _PAGE_PROTNONE)));
182}
183
184static inline int pte_read(pte_t pte) 178static inline int pte_read(pte_t pte)
185{ 179{
186 return((pte_get_bits(pte, _PAGE_USER)) && 180 return((pte_get_bits(pte, _PAGE_USER)) &&
@@ -238,18 +232,6 @@ static inline pte_t pte_mknewprot(pte_t pte)
238 return(pte); 232 return(pte);
239} 233}
240 234
241static inline pte_t pte_rdprotect(pte_t pte)
242{
243 pte_clear_bits(pte, _PAGE_USER);
244 return(pte_mknewprot(pte));
245}
246
247static inline pte_t pte_exprotect(pte_t pte)
248{
249 pte_clear_bits(pte, _PAGE_USER);
250 return(pte_mknewprot(pte));
251}
252
253static inline pte_t pte_mkclean(pte_t pte) 235static inline pte_t pte_mkclean(pte_t pte)
254{ 236{
255 pte_clear_bits(pte, _PAGE_DIRTY); 237 pte_clear_bits(pte, _PAGE_DIRTY);
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h
index 18a13ba74605..6e5fd5c892d0 100644
--- a/include/asm-um/thread_info.h
+++ b/include/asm-um/thread_info.h
@@ -52,10 +52,21 @@ static inline struct thread_info *current_thread_info(void)
52 return ti; 52 return ti;
53} 53}
54 54
55#ifdef CONFIG_DEBUG_STACK_USAGE
56
57#define alloc_thread_info(tsk) \
58 ((struct thread_info *) __get_free_pages(GFP_KERNEL | __GFP_ZERO, \
59 CONFIG_KERNEL_STACK_ORDER))
60#else
61
55/* thread information allocation */ 62/* thread information allocation */
56#define alloc_thread_info(tsk) \ 63#define alloc_thread_info(tsk) \
57 ((struct thread_info *) kmalloc(THREAD_SIZE, GFP_KERNEL)) 64 ((struct thread_info *) __get_free_pages(GFP_KERNEL, \
58#define free_thread_info(ti) kfree(ti) 65 CONFIG_KERNEL_STACK_ORDER))
66#endif
67
68#define free_thread_info(ti) \
69 free_pages((unsigned long)(ti),CONFIG_KERNEL_STACK_ORDER)
59 70
60#endif 71#endif
61 72
diff --git a/include/asm-v850/fb.h b/include/asm-v850/fb.h
new file mode 100644
index 000000000000..c7df38030992
--- /dev/null
+++ b/include/asm-v850/fb.h
@@ -0,0 +1,12 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/include/asm-v850/ioctls.h b/include/asm-v850/ioctls.h
index 05c0dc9ce1ea..5313abd5f388 100644
--- a/include/asm-v850/ioctls.h
+++ b/include/asm-v850/ioctls.h
@@ -46,6 +46,10 @@
46#define TIOCSBRK 0x5427 /* BSD compatibility */ 46#define TIOCSBRK 0x5427 /* BSD compatibility */
47#define TIOCCBRK 0x5428 /* BSD compatibility */ 47#define TIOCCBRK 0x5428 /* BSD compatibility */
48#define TIOCGSID 0x5429 /* Return the session ID of FD */ 48#define TIOCGSID 0x5429 /* Return the session ID of FD */
49#define TCGETS2 _IOR('T',0x2A, struct termios2)
50#define TCSETS2 _IOW('T',0x2B, struct termios2)
51#define TCSETSW2 _IOW('T',0x2C, struct termios2)
52#define TCSETSF2 _IOW('T',0x2D, struct termios2)
49#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 53#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
50#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 54#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
51 55
diff --git a/include/asm-v850/pci.h b/include/asm-v850/pci.h
index 4581826e1cac..de2a7d0a81cc 100644
--- a/include/asm-v850/pci.h
+++ b/include/asm-v850/pci.h
@@ -116,8 +116,4 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
116extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); 116extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
117extern void pci_iounmap (struct pci_dev *dev, void __iomem *addr); 117extern void pci_iounmap (struct pci_dev *dev, void __iomem *addr);
118 118
119static inline void pcibios_add_platform_entries(struct pci_dev *dev)
120{
121}
122
123#endif /* __V850_PCI_H__ */ 119#endif /* __V850_PCI_H__ */
diff --git a/include/asm-v850/rte_cb.h b/include/asm-v850/rte_cb.h
index 9f7f02cb0391..e85d261b79bf 100644
--- a/include/asm-v850/rte_cb.h
+++ b/include/asm-v850/rte_cb.h
@@ -64,7 +64,6 @@
64/* As we don't really support PCI DMA to cpu memory, and use bounce-buffers 64/* As we don't really support PCI DMA to cpu memory, and use bounce-buffers
65 instead, perversely enough, this becomes always true! */ 65 instead, perversely enough, this becomes always true! */
66# define pci_dma_supported(dev, mask) 1 66# define pci_dma_supported(dev, mask) 1
67# define pci_dac_dma_supported(dev, mask) 0
68# define pcibios_assign_all_busses() 1 67# define pcibios_assign_all_busses() 1
69 68
70#endif /* CONFIG_RTE_MB_A_PCI */ 69#endif /* CONFIG_RTE_MB_A_PCI */
diff --git a/include/asm-v850/termbits.h b/include/asm-v850/termbits.h
index f3b433032089..295d7bf69451 100644
--- a/include/asm-v850/termbits.h
+++ b/include/asm-v850/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct termios2 {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20struct ktermios { 31struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */ 32 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */ 33 tcflag_t c_oflag; /* output mode flags */
@@ -130,6 +141,7 @@ struct ktermios {
130#define HUPCL 0002000 141#define HUPCL 0002000
131#define CLOCAL 0004000 142#define CLOCAL 0004000
132#define CBAUDEX 0010000 143#define CBAUDEX 0010000
144#define BOTHER 0010000
133#define B57600 0010001 145#define B57600 0010001
134#define B115200 0010002 146#define B115200 0010002
135#define B230400 0010003 147#define B230400 0010003
@@ -145,10 +157,12 @@ struct ktermios {
145#define B3000000 0010015 157#define B3000000 0010015
146#define B3500000 0010016 158#define B3500000 0010016
147#define B4000000 0010017 159#define B4000000 0010017
148#define CIBAUD 002003600000 /* input baud rate (not used) */ 160#define CIBAUD 002003600000 /* input baud rate */
149#define CMSPAR 010000000000 /* mark or space (stick) parity */ 161#define CMSPAR 010000000000 /* mark or space (stick) parity */
150#define CRTSCTS 020000000000 /* flow control */ 162#define CRTSCTS 020000000000 /* flow control */
151 163
164#define IBSHIFT 16 /* Shifr from CBAUD to CIBAUD */
165
152/* c_lflag bits */ 166/* c_lflag bits */
153#define ISIG 0000001 167#define ISIG 0000001
154#define ICANON 0000002 168#define ICANON 0000002
diff --git a/include/asm-v850/termios.h b/include/asm-v850/termios.h
index c2c2b1d58776..fcd171838d9c 100644
--- a/include/asm-v850/termios.h
+++ b/include/asm-v850/termios.h
@@ -80,8 +80,10 @@ struct termio {
80 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 80 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
81}) 81})
82 82
83#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) 83#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
84#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) 84#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
85#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
86#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
85 87
86#endif /* __KERNEL__ */ 88#endif /* __KERNEL__ */
87 89
diff --git a/include/asm-x86_64/a.out.h b/include/asm-x86_64/a.out.h
index 7255cde06538..e789300e41a5 100644
--- a/include/asm-x86_64/a.out.h
+++ b/include/asm-x86_64/a.out.h
@@ -21,7 +21,8 @@ struct exec
21 21
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23#include <linux/thread_info.h> 23#include <linux/thread_info.h>
24#define STACK_TOP TASK_SIZE 24#define STACK_TOP TASK_SIZE
25#define STACK_TOP_MAX TASK_SIZE64
25#endif 26#endif
26 27
27#endif /* __A_OUT_GNU_H__ */ 28#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index a29f05087a31..1da8f49c0fe2 100644
--- a/include/asm-x86_64/acpi.h
+++ b/include/asm-x86_64/acpi.h
@@ -29,6 +29,7 @@
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30 30
31#include <acpi/pdc_intel.h> 31#include <acpi/pdc_intel.h>
32#include <asm/numa.h>
32 33
33#define COMPILER_DEPENDENT_INT64 long long 34#define COMPILER_DEPENDENT_INT64 long long
34#define COMPILER_DEPENDENT_UINT64 unsigned long long 35#define COMPILER_DEPENDENT_UINT64 unsigned long long
@@ -141,6 +142,16 @@ extern int acpi_pci_disabled;
141extern int acpi_skip_timer_override; 142extern int acpi_skip_timer_override;
142extern int acpi_use_timer_override; 143extern int acpi_use_timer_override;
143 144
145#ifdef CONFIG_ACPI_NUMA
146extern void __init acpi_fake_nodes(const struct bootnode *fake_nodes,
147 int num_nodes);
148#else
149static inline void acpi_fake_nodes(const struct bootnode *fake_nodes,
150 int num_nodes)
151{
152}
153#endif
154
144#endif /*__KERNEL__*/ 155#endif /*__KERNEL__*/
145 156
146#endif /*_ASM_ACPI_H*/ 157#endif /*_ASM_ACPI_H*/
diff --git a/include/asm-x86_64/alternative.h b/include/asm-x86_64/alternative.h
index a09427640764..eea7aecfac78 100644
--- a/include/asm-x86_64/alternative.h
+++ b/include/asm-x86_64/alternative.h
@@ -5,6 +5,41 @@
5 5
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/stddef.h> 7#include <linux/stddef.h>
8
9/*
10 * Alternative inline assembly for SMP.
11 *
12 * The LOCK_PREFIX macro defined here replaces the LOCK and
13 * LOCK_PREFIX macros used everywhere in the source tree.
14 *
15 * SMP alternatives use the same data structures as the other
16 * alternatives and the X86_FEATURE_UP flag to indicate the case of a
17 * UP system running a SMP kernel. The existing apply_alternatives()
18 * works fine for patching a SMP kernel for UP.
19 *
20 * The SMP alternative tables can be kept after boot and contain both
21 * UP and SMP versions of the instructions to allow switching back to
22 * SMP at runtime, when hotplugging in a new CPU, which is especially
23 * useful in virtualized environments.
24 *
25 * The very common lock prefix is handled as special case in a
26 * separate table which is a pure address list without replacement ptr
27 * and size information. That keeps the table sizes small.
28 */
29
30#ifdef CONFIG_SMP
31#define LOCK_PREFIX \
32 ".section .smp_locks,\"a\"\n" \
33 " .align 8\n" \
34 " .quad 661f\n" /* address */ \
35 ".previous\n" \
36 "661:\n\tlock; "
37
38#else /* ! CONFIG_SMP */
39#define LOCK_PREFIX ""
40#endif
41
42/* This must be included *after* the definition of LOCK_PREFIX */
8#include <asm/cpufeature.h> 43#include <asm/cpufeature.h>
9 44
10struct alt_instr { 45struct alt_instr {
@@ -108,39 +143,6 @@ static inline void alternatives_smp_switch(int smp) {}
108 */ 143 */
109#define ASM_OUTPUT2(a, b) a, b 144#define ASM_OUTPUT2(a, b) a, b
110 145
111/*
112 * Alternative inline assembly for SMP.
113 *
114 * The LOCK_PREFIX macro defined here replaces the LOCK and
115 * LOCK_PREFIX macros used everywhere in the source tree.
116 *
117 * SMP alternatives use the same data structures as the other
118 * alternatives and the X86_FEATURE_UP flag to indicate the case of a
119 * UP system running a SMP kernel. The existing apply_alternatives()
120 * works fine for patching a SMP kernel for UP.
121 *
122 * The SMP alternative tables can be kept after boot and contain both
123 * UP and SMP versions of the instructions to allow switching back to
124 * SMP at runtime, when hotplugging in a new CPU, which is especially
125 * useful in virtualized environments.
126 *
127 * The very common lock prefix is handled as special case in a
128 * separate table which is a pure address list without replacement ptr
129 * and size information. That keeps the table sizes small.
130 */
131
132#ifdef CONFIG_SMP
133#define LOCK_PREFIX \
134 ".section .smp_locks,\"a\"\n" \
135 " .align 8\n" \
136 " .quad 661f\n" /* address */ \
137 ".previous\n" \
138 "661:\n\tlock; "
139
140#else /* ! CONFIG_SMP */
141#define LOCK_PREFIX ""
142#endif
143
144struct paravirt_patch; 146struct paravirt_patch;
145#ifdef CONFIG_PARAVIRT 147#ifdef CONFIG_PARAVIRT
146void apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end); 148void apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end);
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h
index 45e9fca1febc..85125ef3c414 100644
--- a/include/asm-x86_64/apic.h
+++ b/include/asm-x86_64/apic.h
@@ -83,8 +83,10 @@ extern void disable_APIC_timer(void);
83extern void enable_APIC_timer(void); 83extern void enable_APIC_timer(void);
84extern void setup_apic_routing(void); 84extern void setup_apic_routing(void);
85 85
86extern void setup_APIC_extened_lvt(unsigned char lvt_off, unsigned char vector, 86extern void setup_APIC_extended_lvt(unsigned char lvt_off, unsigned char vector,
87 unsigned char msg_type, unsigned char mask); 87 unsigned char msg_type, unsigned char mask);
88
89extern int apic_is_clustered_box(void);
88 90
89#define K8_APIC_EXT_LVT_BASE 0x500 91#define K8_APIC_EXT_LVT_BASE 0x500
90#define K8_APIC_EXT_INT_MSG_FIX 0x0 92#define K8_APIC_EXT_INT_MSG_FIX 0x0
diff --git a/include/asm-x86_64/auxvec.h b/include/asm-x86_64/auxvec.h
index 2403c4cfced2..1d5ab0d03950 100644
--- a/include/asm-x86_64/auxvec.h
+++ b/include/asm-x86_64/auxvec.h
@@ -1,4 +1,6 @@
1#ifndef __ASM_X86_64_AUXVEC_H 1#ifndef __ASM_X86_64_AUXVEC_H
2#define __ASM_X86_64_AUXVEC_H 2#define __ASM_X86_64_AUXVEC_H
3 3
4#define AT_SYSINFO_EHDR 33
5
4#endif 6#endif
diff --git a/include/asm-x86_64/boot.h b/include/asm-x86_64/boot.h
index 96b228e6e79c..3c46cea8db7f 100644
--- a/include/asm-x86_64/boot.h
+++ b/include/asm-x86_64/boot.h
@@ -1,15 +1 @@
1#ifndef _LINUX_BOOT_H #include <asm-i386/boot.h>
2#define _LINUX_BOOT_H
3
4/* Don't touch these, unless you really know what you're doing. */
5#define DEF_INITSEG 0x9000
6#define DEF_SYSSEG 0x1000
7#define DEF_SETUPSEG 0x9020
8#define DEF_SYSSIZE 0x7F00
9
10/* Internal svga startup constants */
11#define NORMAL_VGA 0xffff /* 80x25 mode */
12#define EXTENDED_VGA 0xfffe /* 80x50 mode */
13#define ASK_VGA 0xfffd /* ask for it at bootup */
14
15#endif
diff --git a/include/asm-x86_64/bootparam.h b/include/asm-x86_64/bootparam.h
new file mode 100644
index 000000000000..aa82e5238d82
--- /dev/null
+++ b/include/asm-x86_64/bootparam.h
@@ -0,0 +1 @@
#include <asm-i386/bootparam.h>
diff --git a/include/asm-x86_64/calgary.h b/include/asm-x86_64/calgary.h
index 4d5747a0923c..67f60406e2d8 100644
--- a/include/asm-x86_64/calgary.h
+++ b/include/asm-x86_64/calgary.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Derived from include/asm-powerpc/iommu.h 2 * Derived from include/asm-powerpc/iommu.h
3 * 3 *
4 * Copyright (C) IBM Corporation, 2006 4 * Copyright IBM Corporation, 2006-2007
5 * 5 *
6 * Author: Jon Mason <jdmason@us.ibm.com> 6 * Author: Jon Mason <jdmason@us.ibm.com>
7 * Author: Muli Ben-Yehuda <muli@il.ibm.com> 7 * Author: Muli Ben-Yehuda <muli@il.ibm.com>
@@ -31,6 +31,7 @@
31#include <asm/types.h> 31#include <asm/types.h>
32 32
33struct iommu_table { 33struct iommu_table {
34 struct cal_chipset_ops *chip_ops; /* chipset specific funcs */
34 unsigned long it_base; /* mapped address of tce table */ 35 unsigned long it_base; /* mapped address of tce table */
35 unsigned long it_hint; /* Hint for next alloc */ 36 unsigned long it_hint; /* Hint for next alloc */
36 unsigned long *it_map; /* A simple allocation bitmap for now */ 37 unsigned long *it_map; /* A simple allocation bitmap for now */
@@ -42,6 +43,12 @@ struct iommu_table {
42 unsigned char it_busno; /* Bus number this table belongs to */ 43 unsigned char it_busno; /* Bus number this table belongs to */
43}; 44};
44 45
46struct cal_chipset_ops {
47 void (*handle_quirks)(struct iommu_table *tbl, struct pci_dev *dev);
48 void (*tce_cache_blast)(struct iommu_table *tbl);
49 void (*dump_error_regs)(struct iommu_table *tbl);
50};
51
45#define TCE_TABLE_SIZE_UNSPECIFIED ~0 52#define TCE_TABLE_SIZE_UNSPECIFIED ~0
46#define TCE_TABLE_SIZE_64K 0 53#define TCE_TABLE_SIZE_64K 0
47#define TCE_TABLE_SIZE_128K 1 54#define TCE_TABLE_SIZE_128K 1
diff --git a/include/asm-x86_64/compat.h b/include/asm-x86_64/compat.h
index b37ab8218ef0..53cb96b68a62 100644
--- a/include/asm-x86_64/compat.h
+++ b/include/asm-x86_64/compat.h
@@ -33,8 +33,10 @@ typedef s32 compat_key_t;
33 33
34typedef s32 compat_int_t; 34typedef s32 compat_int_t;
35typedef s32 compat_long_t; 35typedef s32 compat_long_t;
36typedef s64 __attribute__((aligned(4))) compat_s64;
36typedef u32 compat_uint_t; 37typedef u32 compat_uint_t;
37typedef u32 compat_ulong_t; 38typedef u32 compat_ulong_t;
39typedef u64 __attribute__((aligned(4))) compat_u64;
38 40
39struct compat_timespec { 41struct compat_timespec {
40 compat_time_t tv_sec; 42 compat_time_t tv_sec;
diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h
index 0b3c686139f1..8baefc3beb2e 100644
--- a/include/asm-x86_64/cpufeature.h
+++ b/include/asm-x86_64/cpufeature.h
@@ -7,115 +7,24 @@
7#ifndef __ASM_X8664_CPUFEATURE_H 7#ifndef __ASM_X8664_CPUFEATURE_H
8#define __ASM_X8664_CPUFEATURE_H 8#define __ASM_X8664_CPUFEATURE_H
9 9
10#define NCAPINTS 7 /* N 32-bit words worth of info */ 10#include <asm-i386/cpufeature.h>
11 11
12/* Intel-defined CPU features, CPUID level 0x00000001, word 0 */ 12#undef cpu_has_vme
13#define X86_FEATURE_FPU (0*32+ 0) /* Onboard FPU */
14#define X86_FEATURE_VME (0*32+ 1) /* Virtual Mode Extensions */
15#define X86_FEATURE_DE (0*32+ 2) /* Debugging Extensions */
16#define X86_FEATURE_PSE (0*32+ 3) /* Page Size Extensions */
17#define X86_FEATURE_TSC (0*32+ 4) /* Time Stamp Counter */
18#define X86_FEATURE_MSR (0*32+ 5) /* Model-Specific Registers, RDMSR, WRMSR */
19#define X86_FEATURE_PAE (0*32+ 6) /* Physical Address Extensions */
20#define X86_FEATURE_MCE (0*32+ 7) /* Machine Check Architecture */
21#define X86_FEATURE_CX8 (0*32+ 8) /* CMPXCHG8 instruction */
22#define X86_FEATURE_APIC (0*32+ 9) /* Onboard APIC */
23#define X86_FEATURE_SEP (0*32+11) /* SYSENTER/SYSEXIT */
24#define X86_FEATURE_MTRR (0*32+12) /* Memory Type Range Registers */
25#define X86_FEATURE_PGE (0*32+13) /* Page Global Enable */
26#define X86_FEATURE_MCA (0*32+14) /* Machine Check Architecture */
27#define X86_FEATURE_CMOV (0*32+15) /* CMOV instruction (FCMOVCC and FCOMI too if FPU present) */
28#define X86_FEATURE_PAT (0*32+16) /* Page Attribute Table */
29#define X86_FEATURE_PSE36 (0*32+17) /* 36-bit PSEs */
30#define X86_FEATURE_PN (0*32+18) /* Processor serial number */
31#define X86_FEATURE_CLFLSH (0*32+19) /* Supports the CLFLUSH instruction */
32#define X86_FEATURE_DS (0*32+21) /* Debug Store */
33#define X86_FEATURE_ACPI (0*32+22) /* ACPI via MSR */
34#define X86_FEATURE_MMX (0*32+23) /* Multimedia Extensions */
35#define X86_FEATURE_FXSR (0*32+24) /* FXSAVE and FXRSTOR instructions (fast save and restore */
36 /* of FPU context), and CR4.OSFXSR available */
37#define X86_FEATURE_XMM (0*32+25) /* Streaming SIMD Extensions */
38#define X86_FEATURE_XMM2 (0*32+26) /* Streaming SIMD Extensions-2 */
39#define X86_FEATURE_SELFSNOOP (0*32+27) /* CPU self snoop */
40#define X86_FEATURE_HT (0*32+28) /* Hyper-Threading */
41#define X86_FEATURE_ACC (0*32+29) /* Automatic clock control */
42#define X86_FEATURE_IA64 (0*32+30) /* IA-64 processor */
43
44/* AMD-defined CPU features, CPUID level 0x80000001, word 1 */
45/* Don't duplicate feature flags which are redundant with Intel! */
46#define X86_FEATURE_SYSCALL (1*32+11) /* SYSCALL/SYSRET */
47#define X86_FEATURE_MMXEXT (1*32+22) /* AMD MMX extensions */
48#define X86_FEATURE_FXSR_OPT (1*32+25) /* FXSR optimizations */
49#define X86_FEATURE_RDTSCP (1*32+27) /* RDTSCP */
50#define X86_FEATURE_LM (1*32+29) /* Long Mode (x86-64) */
51#define X86_FEATURE_3DNOWEXT (1*32+30) /* AMD 3DNow! extensions */
52#define X86_FEATURE_3DNOW (1*32+31) /* 3DNow! */
53
54/* Transmeta-defined CPU features, CPUID level 0x80860001, word 2 */
55#define X86_FEATURE_RECOVERY (2*32+ 0) /* CPU in recovery mode */
56#define X86_FEATURE_LONGRUN (2*32+ 1) /* Longrun power control */
57#define X86_FEATURE_LRTI (2*32+ 3) /* LongRun table interface */
58
59/* Other features, Linux-defined mapping, word 3 */
60/* This range is used for feature bits which conflict or are synthesized */
61#define X86_FEATURE_CXMMX (3*32+ 0) /* Cyrix MMX extensions */
62#define X86_FEATURE_K6_MTRR (3*32+ 1) /* AMD K6 nonstandard MTRRs */
63#define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */
64#define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */
65#define X86_FEATURE_REP_GOOD (3*32+ 4) /* rep microcode works well on this CPU */
66#define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */
67#define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */
68#define X86_FEATURE_FXSAVE_LEAK (3*32+7) /* FIP/FOP/FDP leaks through FXSAVE */
69#define X86_FEATURE_UP (3*32+8) /* SMP kernel running on UP */
70#define X86_FEATURE_ARCH_PERFMON (3*32+9) /* Intel Architectural PerfMon */
71#define X86_FEATURE_PEBS (3*32+10) /* Precise-Event Based Sampling */
72#define X86_FEATURE_BTS (3*32+11) /* Branch Trace Store */
73
74/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
75#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */
76#define X86_FEATURE_MWAIT (4*32+ 3) /* Monitor/Mwait support */
77#define X86_FEATURE_DSCPL (4*32+ 4) /* CPL Qualified Debug Store */
78#define X86_FEATURE_EST (4*32+ 7) /* Enhanced SpeedStep */
79#define X86_FEATURE_TM2 (4*32+ 8) /* Thermal Monitor 2 */
80#define X86_FEATURE_CID (4*32+10) /* Context ID */
81#define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */
82#define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */
83
84/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
85#define X86_FEATURE_XSTORE (5*32+ 2) /* on-CPU RNG present (xstore insn) */
86#define X86_FEATURE_XSTORE_EN (5*32+ 3) /* on-CPU RNG enabled */
87#define X86_FEATURE_XCRYPT (5*32+ 6) /* on-CPU crypto (xcrypt insn) */
88#define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */
89
90/* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */
91#define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */
92#define X86_FEATURE_CMP_LEGACY (6*32+ 1) /* If yes HyperThreading not valid */
93
94#define cpu_has(c, bit) test_bit(bit, (c)->x86_capability)
95#define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability)
96
97#define cpu_has_fpu 1
98#define cpu_has_vme 0 13#define cpu_has_vme 0
99#define cpu_has_de 1 14
100#define cpu_has_pse 1 15#undef cpu_has_pae
101#define cpu_has_tsc 1
102#define cpu_has_pae ___BUG___ 16#define cpu_has_pae ___BUG___
103#define cpu_has_pge 1 17
104#define cpu_has_apic boot_cpu_has(X86_FEATURE_APIC) 18#undef cpu_has_mp
105#define cpu_has_mtrr 1
106#define cpu_has_mmx 1
107#define cpu_has_fxsr 1
108#define cpu_has_xmm 1
109#define cpu_has_xmm2 1
110#define cpu_has_xmm3 boot_cpu_has(X86_FEATURE_XMM3)
111#define cpu_has_ht boot_cpu_has(X86_FEATURE_HT)
112#define cpu_has_mp 1 /* XXX */ 19#define cpu_has_mp 1 /* XXX */
20
21#undef cpu_has_k6_mtrr
113#define cpu_has_k6_mtrr 0 22#define cpu_has_k6_mtrr 0
23
24#undef cpu_has_cyrix_arr
114#define cpu_has_cyrix_arr 0 25#define cpu_has_cyrix_arr 0
26
27#undef cpu_has_centaur_mcr
115#define cpu_has_centaur_mcr 0 28#define cpu_has_centaur_mcr 0
116#define cpu_has_clflush boot_cpu_has(X86_FEATURE_CLFLSH)
117#define cpu_has_ds boot_cpu_has(X86_FEATURE_DS)
118#define cpu_has_pebs boot_cpu_has(X86_FEATURE_PEBS)
119#define cpu_has_bts boot_cpu_has(X86_FEATURE_BTS)
120 29
121#endif /* __ASM_X8664_CPUFEATURE_H */ 30#endif /* __ASM_X8664_CPUFEATURE_H */
diff --git a/include/asm-x86_64/dmi.h b/include/asm-x86_64/dmi.h
index 93b2b15d4325..d02e32e3c3f0 100644
--- a/include/asm-x86_64/dmi.h
+++ b/include/asm-x86_64/dmi.h
@@ -3,15 +3,12 @@
3 3
4#include <asm/io.h> 4#include <asm/io.h>
5 5
6extern void *dmi_ioremap(unsigned long addr, unsigned long size);
7extern void dmi_iounmap(void *addr, unsigned long size);
8
9#define DMI_MAX_DATA 2048 6#define DMI_MAX_DATA 2048
10 7
11extern int dmi_alloc_index; 8extern int dmi_alloc_index;
12extern char dmi_alloc_data[DMI_MAX_DATA]; 9extern char dmi_alloc_data[DMI_MAX_DATA];
13 10
14/* This is so early that there is no good way to allocate dynamic memory. 11/* This is so early that there is no good way to allocate dynamic memory.
15 Allocate data in an BSS array. */ 12 Allocate data in an BSS array. */
16static inline void *dmi_alloc(unsigned len) 13static inline void *dmi_alloc(unsigned len)
17{ 14{
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h
index 6216fa3f2802..3486e701bd86 100644
--- a/include/asm-x86_64/e820.h
+++ b/include/asm-x86_64/e820.h
@@ -11,8 +11,6 @@
11#ifndef __E820_HEADER 11#ifndef __E820_HEADER
12#define __E820_HEADER 12#define __E820_HEADER
13 13
14#include <linux/mmzone.h>
15
16#define E820MAP 0x2d0 /* our map */ 14#define E820MAP 0x2d0 /* our map */
17#define E820MAX 128 /* number of entries in E820MAP */ 15#define E820MAX 128 /* number of entries in E820MAP */
18#define E820NR 0x1e8 /* # entries in E820MAP */ 16#define E820NR 0x1e8 /* # entries in E820MAP */
@@ -30,7 +28,7 @@ struct e820entry {
30} __attribute__((packed)); 28} __attribute__((packed));
31 29
32struct e820map { 30struct e820map {
33 int nr_map; 31 u32 nr_map;
34 struct e820entry map[E820MAX]; 32 struct e820entry map[E820MAX];
35}; 33};
36 34
diff --git a/include/asm-x86_64/elf.h b/include/asm-x86_64/elf.h
index 6d24ea7c4d9d..b4fbe47f6ccd 100644
--- a/include/asm-x86_64/elf.h
+++ b/include/asm-x86_64/elf.h
@@ -162,6 +162,19 @@ extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
162/* 1GB for 64bit, 8MB for 32bit */ 162/* 1GB for 64bit, 8MB for 32bit */
163#define STACK_RND_MASK (test_thread_flag(TIF_IA32) ? 0x7ff : 0x3fffff) 163#define STACK_RND_MASK (test_thread_flag(TIF_IA32) ? 0x7ff : 0x3fffff)
164 164
165
166#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
167struct linux_binprm;
168extern int arch_setup_additional_pages(struct linux_binprm *bprm,
169 int executable_stack);
170
171extern int vdso_enabled;
172
173#define ARCH_DLINFO \
174do if (vdso_enabled) { \
175 NEW_AUX_ENT(AT_SYSINFO_EHDR,(unsigned long)current->mm->context.vdso);\
176} while (0)
177
165#endif 178#endif
166 179
167#endif 180#endif
diff --git a/include/asm-x86_64/fb.h b/include/asm-x86_64/fb.h
new file mode 100644
index 000000000000..60548e651d12
--- /dev/null
+++ b/include/asm-x86_64/fb.h
@@ -0,0 +1,19 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4#include <linux/fs.h>
5#include <asm/page.h>
6
7static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
8 unsigned long off)
9{
10 if (boot_cpu_data.x86 > 3)
11 pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
12}
13
14static inline int fb_is_primary_device(struct fb_info *info)
15{
16 return 0;
17}
18
19#endif /* _ASM_FB_H_ */
diff --git a/include/asm-x86_64/fixmap.h b/include/asm-x86_64/fixmap.h
index e90e1677531b..cdfbe4a6ae6f 100644
--- a/include/asm-x86_64/fixmap.h
+++ b/include/asm-x86_64/fixmap.h
@@ -22,9 +22,9 @@
22 * compile time, but to set the physical address only 22 * compile time, but to set the physical address only
23 * in the boot process. 23 * in the boot process.
24 * 24 *
25 * these 'compile-time allocated' memory buffers are 25 * These 'compile-time allocated' memory buffers are
26 * fixed-size 4k pages. (or larger if used with an increment 26 * fixed-size 4k pages (or larger if used with an increment
27 * highger than 1) use fixmap_set(idx,phys) to associate 27 * higher than 1). Use set_fixmap(idx,phys) to associate
28 * physical memory with fixmap indices. 28 * physical memory with fixmap indices.
29 * 29 *
30 * TLB entries of such buffers will not be flushed across 30 * TLB entries of such buffers will not be flushed across
@@ -35,6 +35,8 @@ enum fixed_addresses {
35 VSYSCALL_LAST_PAGE, 35 VSYSCALL_LAST_PAGE,
36 VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1, 36 VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1,
37 VSYSCALL_HPET, 37 VSYSCALL_HPET,
38 FIX_DBGP_BASE,
39 FIX_EARLYCON_MEM_BASE,
38 FIX_HPET_BASE, 40 FIX_HPET_BASE,
39 FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ 41 FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
40 FIX_IO_APIC_BASE_0, 42 FIX_IO_APIC_BASE_0,
@@ -84,7 +86,7 @@ static __always_inline unsigned long fix_to_virt(const unsigned int idx)
84 if (idx >= __end_of_fixed_addresses) 86 if (idx >= __end_of_fixed_addresses)
85 __this_fixmap_does_not_exist(); 87 __this_fixmap_does_not_exist();
86 88
87 return __fix_to_virt(idx); 89 return __fix_to_virt(idx);
88} 90}
89 91
90#endif 92#endif
diff --git a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h
index 59a66f084611..79bb950f82c5 100644
--- a/include/asm-x86_64/hpet.h
+++ b/include/asm-x86_64/hpet.h
@@ -1,78 +1,18 @@
1#ifndef _ASM_X8664_HPET_H 1#ifndef _ASM_X8664_HPET_H
2#define _ASM_X8664_HPET_H 1 2#define _ASM_X8664_HPET_H 1
3 3
4/* 4#include <asm-i386/hpet.h>
5 * Documentation on HPET can be found at:
6 * http://www.intel.com/ial/home/sp/pcmmspec.htm
7 * ftp://download.intel.com/ial/home/sp/mmts098.pdf
8 */
9
10#define HPET_MMAP_SIZE 1024
11
12#define HPET_ID 0x000
13#define HPET_PERIOD 0x004
14#define HPET_CFG 0x010
15#define HPET_STATUS 0x020
16#define HPET_COUNTER 0x0f0
17#define HPET_Tn_OFFSET 0x20
18#define HPET_Tn_CFG(n) (0x100 + (n) * HPET_Tn_OFFSET)
19#define HPET_Tn_ROUTE(n) (0x104 + (n) * HPET_Tn_OFFSET)
20#define HPET_Tn_CMP(n) (0x108 + (n) * HPET_Tn_OFFSET)
21#define HPET_T0_CFG HPET_Tn_CFG(0)
22#define HPET_T0_CMP HPET_Tn_CMP(0)
23#define HPET_T1_CFG HPET_Tn_CFG(1)
24#define HPET_T1_CMP HPET_Tn_CMP(1)
25
26#define HPET_ID_VENDOR 0xffff0000
27#define HPET_ID_LEGSUP 0x00008000
28#define HPET_ID_64BIT 0x00002000
29#define HPET_ID_NUMBER 0x00001f00
30#define HPET_ID_REV 0x000000ff
31#define HPET_ID_NUMBER_SHIFT 8
32
33#define HPET_ID_VENDOR_SHIFT 16
34#define HPET_ID_VENDOR_8086 0x8086
35
36#define HPET_CFG_ENABLE 0x001
37#define HPET_CFG_LEGACY 0x002
38#define HPET_LEGACY_8254 2
39#define HPET_LEGACY_RTC 8
40
41#define HPET_TN_LEVEL 0x0002
42#define HPET_TN_ENABLE 0x0004
43#define HPET_TN_PERIODIC 0x0008
44#define HPET_TN_PERIODIC_CAP 0x0010
45#define HPET_TN_64BIT_CAP 0x0020
46#define HPET_TN_SETVAL 0x0040
47#define HPET_TN_32BIT 0x0100
48#define HPET_TN_ROUTE 0x3e00
49#define HPET_TN_FSB 0x4000
50#define HPET_TN_FSB_CAP 0x8000
51
52#define HPET_TN_ROUTE_SHIFT 9
53 5
54#define HPET_TICK_RATE (HZ * 100000UL) 6#define HPET_TICK_RATE (HZ * 100000UL)
55 7
56extern int is_hpet_enabled(void);
57extern int hpet_rtc_timer_init(void); 8extern int hpet_rtc_timer_init(void);
58extern int apic_is_clustered_box(void);
59extern int hpet_arch_init(void); 9extern int hpet_arch_init(void);
60extern int hpet_timer_stop_set_go(unsigned long tick); 10extern int hpet_timer_stop_set_go(unsigned long tick);
61extern int hpet_reenable(void); 11extern int hpet_reenable(void);
62extern unsigned int hpet_calibrate_tsc(void); 12extern unsigned int hpet_calibrate_tsc(void);
63 13
64extern int hpet_use_timer; 14extern int hpet_use_timer;
65extern unsigned long hpet_address;
66extern unsigned long hpet_period; 15extern unsigned long hpet_period;
67extern unsigned long hpet_tick; 16extern unsigned long hpet_tick;
68 17
69#ifdef CONFIG_HPET_EMULATE_RTC
70extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask);
71extern int hpet_set_rtc_irq_bit(unsigned long bit_mask);
72extern int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec);
73extern int hpet_set_periodic_freq(unsigned long freq);
74extern int hpet_rtc_dropped_irq(void);
75extern int hpet_rtc_timer_init(void);
76#endif /* CONFIG_HPET_EMULATE_RTC */
77
78#endif 18#endif
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
index 6153ae5df2e8..09dfc18a6dd0 100644
--- a/include/asm-x86_64/hw_irq.h
+++ b/include/asm-x86_64/hw_irq.h
@@ -95,6 +95,26 @@
95 95
96 96
97#ifndef __ASSEMBLY__ 97#ifndef __ASSEMBLY__
98
99/* Interrupt handlers registered during init_IRQ */
100void apic_timer_interrupt(void);
101void spurious_interrupt(void);
102void error_interrupt(void);
103void reschedule_interrupt(void);
104void call_function_interrupt(void);
105void irq_move_cleanup_interrupt(void);
106void invalidate_interrupt0(void);
107void invalidate_interrupt1(void);
108void invalidate_interrupt2(void);
109void invalidate_interrupt3(void);
110void invalidate_interrupt4(void);
111void invalidate_interrupt5(void);
112void invalidate_interrupt6(void);
113void invalidate_interrupt7(void);
114void thermal_interrupt(void);
115void threshold_interrupt(void);
116void i8254_timer_resume(void);
117
98typedef int vector_irq_t[NR_VECTORS]; 118typedef int vector_irq_t[NR_VECTORS];
99DECLARE_PER_CPU(vector_irq_t, vector_irq); 119DECLARE_PER_CPU(vector_irq_t, vector_irq);
100extern void __setup_vector_irq(int cpu); 120extern void __setup_vector_irq(int cpu);
diff --git a/include/asm-x86_64/i8253.h b/include/asm-x86_64/i8253.h
new file mode 100644
index 000000000000..015d8df07690
--- /dev/null
+++ b/include/asm-x86_64/i8253.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_I8253_H__
2#define __ASM_I8253_H__
3
4extern spinlock_t i8253_lock;
5
6#endif /* __ASM_I8253_H__ */
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h
index de2cd9a2303a..7475095c5061 100644
--- a/include/asm-x86_64/io.h
+++ b/include/asm-x86_64/io.h
@@ -144,6 +144,7 @@ extern void early_iounmap(void *addr, unsigned long size);
144 */ 144 */
145extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); 145extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size);
146extern void iounmap(volatile void __iomem *addr); 146extern void iounmap(volatile void __iomem *addr);
147extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);
147 148
148/* 149/*
149 * ISA I/O bus memory addresses are 1:1 with the physical address. 150 * ISA I/O bus memory addresses are 1:1 with the physical address.
diff --git a/include/asm-x86_64/iommu.h b/include/asm-x86_64/iommu.h
new file mode 100644
index 000000000000..5af471f228ee
--- /dev/null
+++ b/include/asm-x86_64/iommu.h
@@ -0,0 +1,29 @@
1#ifndef _ASM_X8664_IOMMU_H
2#define _ASM_X8664_IOMMU_H 1
3
4extern void pci_iommu_shutdown(void);
5extern void no_iommu_init(void);
6extern int force_iommu, no_iommu;
7extern int iommu_detected;
8#ifdef CONFIG_IOMMU
9extern void gart_iommu_init(void);
10extern void gart_iommu_shutdown(void);
11extern void __init gart_parse_options(char *);
12extern void iommu_hole_init(void);
13extern int fallback_aper_order;
14extern int fallback_aper_force;
15extern int iommu_aperture;
16extern int iommu_aperture_allowed;
17extern int iommu_aperture_disabled;
18extern int fix_aperture;
19#else
20#define iommu_aperture 0
21#define iommu_aperture_allowed 0
22
23static inline void gart_iommu_shutdown(void)
24{
25}
26
27#endif
28
29#endif
diff --git a/include/asm-x86_64/kprobes.h b/include/asm-x86_64/kprobes.h
index cf5317898fb0..7db825403e01 100644
--- a/include/asm-x86_64/kprobes.h
+++ b/include/asm-x86_64/kprobes.h
@@ -41,7 +41,6 @@ typedef u8 kprobe_opcode_t;
41 ? (MAX_STACK_SIZE) \ 41 ? (MAX_STACK_SIZE) \
42 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 42 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
43 43
44#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
45#define ARCH_SUPPORTS_KRETPROBES 44#define ARCH_SUPPORTS_KRETPROBES
46#define ARCH_INACTIVE_KPROBE_COUNT 1 45#define ARCH_INACTIVE_KPROBE_COUNT 1
47 46
diff --git a/include/asm-x86_64/mce.h b/include/asm-x86_64/mce.h
index 177e92b4019b..556be5563e30 100644
--- a/include/asm-x86_64/mce.h
+++ b/include/asm-x86_64/mce.h
@@ -105,6 +105,8 @@ extern atomic_t mce_entry;
105 105
106extern void do_machine_check(struct pt_regs *, long); 106extern void do_machine_check(struct pt_regs *, long);
107 107
108extern int mce_notify_user(void);
109
108#endif 110#endif
109 111
110#endif 112#endif
diff --git a/include/asm-x86_64/mmu.h b/include/asm-x86_64/mmu.h
index 5dc6ed79859a..d2cd4a9d984d 100644
--- a/include/asm-x86_64/mmu.h
+++ b/include/asm-x86_64/mmu.h
@@ -15,6 +15,7 @@ typedef struct {
15 rwlock_t ldtlock; 15 rwlock_t ldtlock;
16 int size; 16 int size;
17 struct semaphore sem; 17 struct semaphore sem;
18 void *vdso;
18} mm_context_t; 19} mm_context_t;
19 20
20#endif 21#endif
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index e327c830da0c..88adf1afb0a2 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -48,7 +48,8 @@ void copy_page(void *, void *);
48#define clear_user_page(page, vaddr, pg) clear_page(page) 48#define clear_user_page(page, vaddr, pg) clear_page(page)
49#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 49#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
50 50
51#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) 51#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
52 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
52#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 53#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
53/* 54/*
54 * These are used to make use of C type-checking.. 55 * These are used to make use of C type-checking..
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h
index 49c5e9280598..88926eb44f5c 100644
--- a/include/asm-x86_64/pci.h
+++ b/include/asm-x86_64/pci.h
@@ -5,6 +5,25 @@
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7 7
8struct pci_sysdata {
9 int node; /* NUMA node */
10 void* iommu; /* IOMMU private data */
11};
12
13#ifdef CONFIG_CALGARY_IOMMU
14static inline void* pci_iommu(struct pci_bus *bus)
15{
16 struct pci_sysdata *sd = bus->sysdata;
17 return sd->iommu;
18}
19
20static inline void set_pci_iommu(struct pci_bus *bus, void *val)
21{
22 struct pci_sysdata *sd = bus->sysdata;
23 sd->iommu = val;
24}
25#endif /* CONFIG_CALGARY_IOMMU */
26
8#include <linux/mm.h> /* for struct page */ 27#include <linux/mm.h> /* for struct page */
9 28
10/* Can be used to override the logic in pci_scan_bus for skipping 29/* Can be used to override the logic in pci_scan_bus for skipping
@@ -54,14 +73,6 @@ extern int iommu_setup(char *opt);
54 73
55#if defined(CONFIG_IOMMU) || defined(CONFIG_CALGARY_IOMMU) 74#if defined(CONFIG_IOMMU) || defined(CONFIG_CALGARY_IOMMU)
56 75
57/*
58 * x86-64 always supports DAC, but sometimes it is useful to force
59 * devices through the IOMMU to get automatic sg list merging.
60 * Optional right now.
61 */
62extern int iommu_sac_force;
63#define pci_dac_dma_supported(pci_dev, mask) (!iommu_sac_force)
64
65#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ 76#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
66 dma_addr_t ADDR_NAME; 77 dma_addr_t ADDR_NAME;
67#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ 78#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
@@ -78,8 +89,6 @@ extern int iommu_sac_force;
78#else 89#else
79/* No IOMMU */ 90/* No IOMMU */
80 91
81#define pci_dac_dma_supported(pci_dev, mask) 1
82
83#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) 92#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
84#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) 93#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
85#define pci_unmap_addr(PTR, ADDR_NAME) (0) 94#define pci_unmap_addr(PTR, ADDR_NAME) (0)
@@ -91,36 +100,6 @@ extern int iommu_sac_force;
91 100
92#include <asm-generic/pci-dma-compat.h> 101#include <asm-generic/pci-dma-compat.h>
93 102
94static inline dma64_addr_t
95pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page, unsigned long offset, int direction)
96{
97 return ((dma64_addr_t) page_to_phys(page) +
98 (dma64_addr_t) offset);
99}
100
101static inline struct page *
102pci_dac_dma_to_page(struct pci_dev *pdev, dma64_addr_t dma_addr)
103{
104 return virt_to_page(__va(dma_addr));
105}
106
107static inline unsigned long
108pci_dac_dma_to_offset(struct pci_dev *pdev, dma64_addr_t dma_addr)
109{
110 return (dma_addr & ~PAGE_MASK);
111}
112
113static inline void
114pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
115{
116}
117
118static inline void
119pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
120{
121 flush_write_buffers();
122}
123
124#ifdef CONFIG_PCI 103#ifdef CONFIG_PCI
125static inline void pci_dma_burst_advice(struct pci_dev *pdev, 104static inline void pci_dma_burst_advice(struct pci_dev *pdev,
126 enum pci_dma_burst_strategy *strat, 105 enum pci_dma_burst_strategy *strat,
@@ -135,10 +114,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
135extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 114extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
136 enum pci_mmap_state mmap_state, int write_combine); 115 enum pci_mmap_state mmap_state, int write_combine);
137 116
138static inline void pcibios_add_platform_entries(struct pci_dev *dev)
139{
140}
141
142#endif /* __KERNEL__ */ 117#endif /* __KERNEL__ */
143 118
144/* generic pci stuff */ 119/* generic pci stuff */
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h
index c6fbb67eac90..5abd48270101 100644
--- a/include/asm-x86_64/percpu.h
+++ b/include/asm-x86_64/percpu.h
@@ -20,6 +20,11 @@
20#define DEFINE_PER_CPU(type, name) \ 20#define DEFINE_PER_CPU(type, name) \
21 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name 21 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
22 22
23#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
24 __attribute__((__section__(".data.percpu.shared_aligned"))) \
25 __typeof__(type) per_cpu__##name \
26 ____cacheline_internodealigned_in_smp
27
23/* var is in discarded region: offset to particular copy we want */ 28/* var is in discarded region: offset to particular copy we want */
24#define per_cpu(var, cpu) (*({ \ 29#define per_cpu(var, cpu) (*({ \
25 extern int simple_identifier_##var(void); \ 30 extern int simple_identifier_##var(void); \
@@ -46,6 +51,8 @@ extern void setup_per_cpu_areas(void);
46 51
47#define DEFINE_PER_CPU(type, name) \ 52#define DEFINE_PER_CPU(type, name) \
48 __typeof__(type) per_cpu__##name 53 __typeof__(type) per_cpu__##name
54#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
55 DEFINE_PER_CPU(type, name)
49 56
50#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 57#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
51#define __get_cpu_var(var) per_cpu__##var 58#define __get_cpu_var(var) per_cpu__##var
diff --git a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h
index 8bb564687860..b467be6d367f 100644
--- a/include/asm-x86_64/pgalloc.h
+++ b/include/asm-x86_64/pgalloc.h
@@ -4,6 +4,10 @@
4#include <asm/pda.h> 4#include <asm/pda.h>
5#include <linux/threads.h> 5#include <linux/threads.h>
6#include <linux/mm.h> 6#include <linux/mm.h>
7#include <linux/quicklist.h>
8
9#define QUICK_PGD 0 /* We preserve special mappings over free */
10#define QUICK_PT 1 /* Other page table pages that are zero on free */
7 11
8#define pmd_populate_kernel(mm, pmd, pte) \ 12#define pmd_populate_kernel(mm, pmd, pte) \
9 set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte))) 13 set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte)))
@@ -20,23 +24,23 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p
20static inline void pmd_free(pmd_t *pmd) 24static inline void pmd_free(pmd_t *pmd)
21{ 25{
22 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); 26 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
23 free_page((unsigned long)pmd); 27 quicklist_free(QUICK_PT, NULL, pmd);
24} 28}
25 29
26static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr) 30static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
27{ 31{
28 return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 32 return (pmd_t *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, NULL);
29} 33}
30 34
31static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) 35static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
32{ 36{
33 return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 37 return (pud_t *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, NULL);
34} 38}
35 39
36static inline void pud_free (pud_t *pud) 40static inline void pud_free (pud_t *pud)
37{ 41{
38 BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); 42 BUG_ON((unsigned long)pud & (PAGE_SIZE-1));
39 free_page((unsigned long)pud); 43 quicklist_free(QUICK_PT, NULL, pud);
40} 44}
41 45
42static inline void pgd_list_add(pgd_t *pgd) 46static inline void pgd_list_add(pgd_t *pgd)
@@ -57,41 +61,57 @@ static inline void pgd_list_del(pgd_t *pgd)
57 spin_unlock(&pgd_lock); 61 spin_unlock(&pgd_lock);
58} 62}
59 63
60static inline pgd_t *pgd_alloc(struct mm_struct *mm) 64static inline void pgd_ctor(void *x)
61{ 65{
62 unsigned boundary; 66 unsigned boundary;
63 pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); 67 pgd_t *pgd = x;
64 if (!pgd) 68 struct page *page = virt_to_page(pgd);
65 return NULL; 69
66 pgd_list_add(pgd);
67 /* 70 /*
68 * Copy kernel pointers in from init. 71 * Copy kernel pointers in from init.
69 * Could keep a freelist or slab cache of those because the kernel
70 * part never changes.
71 */ 72 */
72 boundary = pgd_index(__PAGE_OFFSET); 73 boundary = pgd_index(__PAGE_OFFSET);
73 memset(pgd, 0, boundary * sizeof(pgd_t));
74 memcpy(pgd + boundary, 74 memcpy(pgd + boundary,
75 init_level4_pgt + boundary, 75 init_level4_pgt + boundary,
76 (PTRS_PER_PGD - boundary) * sizeof(pgd_t)); 76 (PTRS_PER_PGD - boundary) * sizeof(pgd_t));
77
78 spin_lock(&pgd_lock);
79 list_add(&page->lru, &pgd_list);
80 spin_unlock(&pgd_lock);
81}
82
83static inline void pgd_dtor(void *x)
84{
85 pgd_t *pgd = x;
86 struct page *page = virt_to_page(pgd);
87
88 spin_lock(&pgd_lock);
89 list_del(&page->lru);
90 spin_unlock(&pgd_lock);
91}
92
93static inline pgd_t *pgd_alloc(struct mm_struct *mm)
94{
95 pgd_t *pgd = (pgd_t *)quicklist_alloc(QUICK_PGD,
96 GFP_KERNEL|__GFP_REPEAT, pgd_ctor);
77 return pgd; 97 return pgd;
78} 98}
79 99
80static inline void pgd_free(pgd_t *pgd) 100static inline void pgd_free(pgd_t *pgd)
81{ 101{
82 BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); 102 BUG_ON((unsigned long)pgd & (PAGE_SIZE-1));
83 pgd_list_del(pgd); 103 quicklist_free(QUICK_PGD, pgd_dtor, pgd);
84 free_page((unsigned long)pgd);
85} 104}
86 105
87static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) 106static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
88{ 107{
89 return (pte_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 108 return (pte_t *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, NULL);
90} 109}
91 110
92static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) 111static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
93{ 112{
94 void *p = (void *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 113 void *p = (void *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, NULL);
114
95 if (!p) 115 if (!p)
96 return NULL; 116 return NULL;
97 return virt_to_page(p); 117 return virt_to_page(p);
@@ -103,17 +123,22 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add
103static inline void pte_free_kernel(pte_t *pte) 123static inline void pte_free_kernel(pte_t *pte)
104{ 124{
105 BUG_ON((unsigned long)pte & (PAGE_SIZE-1)); 125 BUG_ON((unsigned long)pte & (PAGE_SIZE-1));
106 free_page((unsigned long)pte); 126 quicklist_free(QUICK_PT, NULL, pte);
107} 127}
108 128
109static inline void pte_free(struct page *pte) 129static inline void pte_free(struct page *pte)
110{ 130{
111 __free_page(pte); 131 quicklist_free_page(QUICK_PT, NULL, pte);
112} 132}
113 133
114#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) 134#define __pte_free_tlb(tlb,pte) quicklist_free_page(QUICK_PT, NULL,(pte))
115 135
116#define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) 136#define __pmd_free_tlb(tlb,x) quicklist_free(QUICK_PT, NULL, (x))
117#define __pud_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) 137#define __pud_free_tlb(tlb,x) quicklist_free(QUICK_PT, NULL, (x))
118 138
139static inline void check_pgt_cache(void)
140{
141 quicklist_trim(QUICK_PGD, pgd_dtor, 25, 16);
142 quicklist_trim(QUICK_PT, NULL, 25, 16);
143}
119#endif /* _X86_64_PGALLOC_H */ 144#endif /* _X86_64_PGALLOC_H */
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 08b9831f2e14..60cff1e4f7a3 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -266,21 +266,15 @@ static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
266 * Undefined behaviour if not.. 266 * Undefined behaviour if not..
267 */ 267 */
268#define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT) 268#define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT)
269static inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
270static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
271static inline int pte_exec(pte_t pte) { return !(pte_val(pte) & _PAGE_NX); }
272static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } 269static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
273static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 270static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
274static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } 271static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
275static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 272static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
276static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_PSE; } 273static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_PSE; }
277 274
278static inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
279static inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
280static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } 275static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
281static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } 276static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; }
282static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; } 277static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; }
283static inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; }
284static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_NX)); return pte; } 278static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_NX)); return pte; }
285static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } 279static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
286static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } 280static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
@@ -290,13 +284,6 @@ static inline pte_t pte_clrhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) &
290 284
291struct vm_area_struct; 285struct vm_area_struct;
292 286
293static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
294{
295 if (!pte_dirty(*ptep))
296 return 0;
297 return test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte);
298}
299
300static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) 287static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
301{ 288{
302 if (!pte_young(*ptep)) 289 if (!pte_young(*ptep))
@@ -395,12 +382,14 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
395 * bit at the same time. */ 382 * bit at the same time. */
396#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 383#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
397#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ 384#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
398 do { \ 385({ \
399 if (__dirty) { \ 386 int __changed = !pte_same(*(__ptep), __entry); \
400 set_pte(__ptep, __entry); \ 387 if (__changed && __dirty) { \
401 flush_tlb_page(__vma, __address); \ 388 set_pte(__ptep, __entry); \
402 } \ 389 flush_tlb_page(__vma, __address); \
403 } while (0) 390 } \
391 __changed; \
392})
404 393
405/* Encode and de-code a swap entry */ 394/* Encode and de-code a swap entry */
406#define __swp_type(x) (((x).val >> 1) & 0x3f) 395#define __swp_type(x) (((x).val >> 1) & 0x3f)
@@ -420,7 +409,6 @@ extern int kern_addr_valid(unsigned long addr);
420#define HAVE_ARCH_UNMAPPED_AREA 409#define HAVE_ARCH_UNMAPPED_AREA
421 410
422#define pgtable_cache_init() do { } while (0) 411#define pgtable_cache_init() do { } while (0)
423#define check_pgt_cache() do { } while (0)
424 412
425#define PAGE_AGP PAGE_KERNEL_NOCACHE 413#define PAGE_AGP PAGE_KERNEL_NOCACHE
426#define HAVE_PAGE_AGP 1 414#define HAVE_PAGE_AGP 1
@@ -431,7 +419,6 @@ extern int kern_addr_valid(unsigned long addr);
431 (((o) & (1UL << (__VIRTUAL_MASK_SHIFT-1))) ? ((o) | (~__VIRTUAL_MASK)) : (o)) 419 (((o) & (1UL << (__VIRTUAL_MASK_SHIFT-1))) ? ((o) | (~__VIRTUAL_MASK)) : (o))
432 420
433#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 421#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
434#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
435#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 422#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
436#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL 423#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
437#define __HAVE_ARCH_PTEP_SET_WRPROTECT 424#define __HAVE_ARCH_PTEP_SET_WRPROTECT
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index 461ffe4c1fcc..a1645bbc03bd 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -83,7 +83,6 @@ struct cpuinfo_x86 {
83#define X86_VENDOR_UMC 3 83#define X86_VENDOR_UMC 3
84#define X86_VENDOR_NEXGEN 4 84#define X86_VENDOR_NEXGEN 4
85#define X86_VENDOR_CENTAUR 5 85#define X86_VENDOR_CENTAUR 5
86#define X86_VENDOR_RISE 6
87#define X86_VENDOR_TRANSMETA 7 86#define X86_VENDOR_TRANSMETA 7
88#define X86_VENDOR_NUM 8 87#define X86_VENDOR_NUM 8
89#define X86_VENDOR_UNKNOWN 0xff 88#define X86_VENDOR_UNKNOWN 0xff
@@ -100,6 +99,7 @@ extern char ignore_irq13;
100 99
101extern void identify_cpu(struct cpuinfo_x86 *); 100extern void identify_cpu(struct cpuinfo_x86 *);
102extern void print_cpu_info(struct cpuinfo_x86 *); 101extern void print_cpu_info(struct cpuinfo_x86 *);
102extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c);
103extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); 103extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
104extern unsigned short num_cache_leaves; 104extern unsigned short num_cache_leaves;
105 105
@@ -368,8 +368,6 @@ static inline void sync_core(void)
368 asm volatile("cpuid" : "=a" (tmp) : "0" (1) : "ebx","ecx","edx","memory"); 368 asm volatile("cpuid" : "=a" (tmp) : "0" (1) : "ebx","ecx","edx","memory");
369} 369}
370 370
371#define cpu_has_fpu 1
372
373#define ARCH_HAS_PREFETCH 371#define ARCH_HAS_PREFETCH
374static inline void prefetch(void *x) 372static inline void prefetch(void *x)
375{ 373{
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h
index 85255db1e82d..d6e3225549c0 100644
--- a/include/asm-x86_64/proto.h
+++ b/include/asm-x86_64/proto.h
@@ -85,24 +85,6 @@ extern int exception_trace;
85extern unsigned cpu_khz; 85extern unsigned cpu_khz;
86extern unsigned tsc_khz; 86extern unsigned tsc_khz;
87 87
88extern void no_iommu_init(void);
89extern int force_iommu, no_iommu;
90extern int iommu_detected;
91#ifdef CONFIG_IOMMU
92extern void gart_iommu_init(void);
93extern void __init gart_parse_options(char *);
94extern void iommu_hole_init(void);
95extern int fallback_aper_order;
96extern int fallback_aper_force;
97extern int iommu_aperture;
98extern int iommu_aperture_allowed;
99extern int iommu_aperture_disabled;
100extern int fix_aperture;
101#else
102#define iommu_aperture 0
103#define iommu_aperture_allowed 0
104#endif
105
106extern int reboot_force; 88extern int reboot_force;
107extern int notsc_setup(char *); 89extern int notsc_setup(char *);
108 90
diff --git a/include/asm-x86_64/ptrace.h b/include/asm-x86_64/ptrace.h
index 5ea84dbb1e9c..7f166ccb0606 100644
--- a/include/asm-x86_64/ptrace.h
+++ b/include/asm-x86_64/ptrace.h
@@ -1,6 +1,7 @@
1#ifndef _X86_64_PTRACE_H 1#ifndef _X86_64_PTRACE_H
2#define _X86_64_PTRACE_H 2#define _X86_64_PTRACE_H
3 3
4#include <linux/compiler.h> /* For __user */
4#include <asm/ptrace-abi.h> 5#include <asm/ptrace-abi.h>
5 6
6#ifndef __ASSEMBLY__ 7#ifndef __ASSEMBLY__
diff --git a/include/asm-x86_64/required-features.h b/include/asm-x86_64/required-features.h
new file mode 100644
index 000000000000..e80d5761b00a
--- /dev/null
+++ b/include/asm-x86_64/required-features.h
@@ -0,0 +1,46 @@
1#ifndef _ASM_REQUIRED_FEATURES_H
2#define _ASM_REQUIRED_FEATURES_H 1
3
4/* Define minimum CPUID feature set for kernel These bits are checked
5 really early to actually display a visible error message before the
6 kernel dies. Make sure to assign features to the proper mask!
7
8 The real information is in arch/x86_64/Kconfig.cpu, this just converts
9 the CONFIGs into a bitmask */
10
11/* x86-64 baseline features */
12#define NEED_FPU (1<<(X86_FEATURE_FPU & 31))
13#define NEED_PSE (1<<(X86_FEATURE_PSE & 31))
14#define NEED_MSR (1<<(X86_FEATURE_MSR & 31))
15#define NEED_PAE (1<<(X86_FEATURE_PAE & 31))
16#define NEED_CX8 (1<<(X86_FEATURE_CX8 & 31))
17#define NEED_PGE (1<<(X86_FEATURE_PGE & 31))
18#define NEED_FXSR (1<<(X86_FEATURE_FXSR & 31))
19#define NEED_CMOV (1<<(X86_FEATURE_CMOV & 31))
20#define NEED_XMM (1<<(X86_FEATURE_XMM & 31))
21#define NEED_XMM2 (1<<(X86_FEATURE_XMM2 & 31))
22
23#define REQUIRED_MASK0 (NEED_FPU|NEED_PSE|NEED_MSR|NEED_PAE|\
24 NEED_CX8|NEED_PGE|NEED_FXSR|NEED_CMOV|\
25 NEED_XMM|NEED_XMM2)
26#define SSE_MASK (NEED_XMM|NEED_XMM2)
27
28/* x86-64 baseline features */
29#define NEED_LM (1<<(X86_FEATURE_LM & 31))
30
31#ifdef CONFIG_X86_USE_3DNOW
32# define NEED_3DNOW (1<<(X86_FEATURE_3DNOW & 31))
33#else
34# define NEED_3DNOW 0
35#endif
36
37#define REQUIRED_MASK1 (NEED_LM|NEED_3DNOW)
38
39#define REQUIRED_MASK2 0
40#define REQUIRED_MASK3 0
41#define REQUIRED_MASK4 0
42#define REQUIRED_MASK5 0
43#define REQUIRED_MASK6 0
44#define REQUIRED_MASK7 0
45
46#endif
diff --git a/include/asm-x86_64/resume-trace.h b/include/asm-x86_64/resume-trace.h
new file mode 100644
index 000000000000..34bf998fdf62
--- /dev/null
+++ b/include/asm-x86_64/resume-trace.h
@@ -0,0 +1,13 @@
1#define TRACE_RESUME(user) do { \
2 if (pm_trace_enabled) { \
3 void *tracedata; \
4 asm volatile("movq $1f,%0\n" \
5 ".section .tracedata,\"a\"\n" \
6 "1:\t.word %c1\n" \
7 "\t.quad %c2\n" \
8 ".previous" \
9 :"=r" (tracedata) \
10 : "i" (__LINE__), "i" (__FILE__)); \
11 generate_resume_trace(tracedata, user); \
12 } \
13} while (0)
diff --git a/include/asm-x86_64/segment.h b/include/asm-x86_64/segment.h
index adf2bf1e187c..04b8ab21328f 100644
--- a/include/asm-x86_64/segment.h
+++ b/include/asm-x86_64/segment.h
@@ -3,6 +3,14 @@
3 3
4#include <asm/cache.h> 4#include <asm/cache.h>
5 5
6/* Simple and small GDT entries for booting only */
7
8#define GDT_ENTRY_BOOT_CS 2
9#define __BOOT_CS (GDT_ENTRY_BOOT_CS * 8)
10
11#define GDT_ENTRY_BOOT_DS (GDT_ENTRY_BOOT_CS + 1)
12#define __BOOT_DS (GDT_ENTRY_BOOT_DS * 8)
13
6#define __KERNEL_CS 0x10 14#define __KERNEL_CS 0x10
7#define __KERNEL_DS 0x18 15#define __KERNEL_DS 0x18
8 16
diff --git a/include/asm-x86_64/string.h b/include/asm-x86_64/string.h
index 9505d9f4bead..e583da7918fb 100644
--- a/include/asm-x86_64/string.h
+++ b/include/asm-x86_64/string.h
@@ -29,6 +29,9 @@ return (to);
29 function. */ 29 function. */
30 30
31#define __HAVE_ARCH_MEMCPY 1 31#define __HAVE_ARCH_MEMCPY 1
32#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
33extern void *memcpy(void *to, const void *from, size_t len);
34#else
32extern void *__memcpy(void *to, const void *from, size_t len); 35extern void *__memcpy(void *to, const void *from, size_t len);
33#define memcpy(dst,src,len) \ 36#define memcpy(dst,src,len) \
34 ({ size_t __len = (len); \ 37 ({ size_t __len = (len); \
@@ -38,7 +41,7 @@ extern void *__memcpy(void *to, const void *from, size_t len);
38 else \ 41 else \
39 __ret = __builtin_memcpy((dst),(src),__len); \ 42 __ret = __builtin_memcpy((dst),(src),__len); \
40 __ret; }) 43 __ret; })
41 44#endif
42 45
43#define __HAVE_ARCH_MEMSET 46#define __HAVE_ARCH_MEMSET
44void *memset(void *s, int c, size_t n); 47void *memset(void *s, int c, size_t n);
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h
index ead9f9a56234..6313d33a0686 100644
--- a/include/asm-x86_64/system.h
+++ b/include/asm-x86_64/system.h
@@ -109,16 +109,7 @@ static inline void write_cr4(unsigned long val)
109#define stts() write_cr0(8 | read_cr0()) 109#define stts() write_cr0(8 | read_cr0())
110 110
111#define wbinvd() \ 111#define wbinvd() \
112 __asm__ __volatile__ ("wbinvd": : :"memory"); 112 __asm__ __volatile__ ("wbinvd": : :"memory")
113
114/*
115 * On SMP systems, when the scheduler does migration-cost autodetection,
116 * it needs a way to flush as much of the CPU's caches as possible.
117 */
118static inline void sched_cacheflush(void)
119{
120 wbinvd();
121}
122 113
123#endif /* __KERNEL__ */ 114#endif /* __KERNEL__ */
124 115
diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h
index 10bb5a8ed688..33c72ef15a0c 100644
--- a/include/asm-x86_64/thread_info.h
+++ b/include/asm-x86_64/thread_info.h
@@ -115,6 +115,7 @@ static inline struct thread_info *stack_thread_info(void)
115#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ 115#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
116#define TIF_SECCOMP 8 /* secure computing */ 116#define TIF_SECCOMP 8 /* secure computing */
117#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */ 117#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */
118#define TIF_MCE_NOTIFY 10 /* notify userspace of an MCE */
118/* 16 free */ 119/* 16 free */
119#define TIF_IA32 17 /* 32bit process */ 120#define TIF_IA32 17 /* 32bit process */
120#define TIF_FORK 18 /* ret_from_fork */ 121#define TIF_FORK 18 /* ret_from_fork */
@@ -133,6 +134,7 @@ static inline struct thread_info *stack_thread_info(void)
133#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 134#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
134#define _TIF_SECCOMP (1<<TIF_SECCOMP) 135#define _TIF_SECCOMP (1<<TIF_SECCOMP)
135#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 136#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
137#define _TIF_MCE_NOTIFY (1<<TIF_MCE_NOTIFY)
136#define _TIF_IA32 (1<<TIF_IA32) 138#define _TIF_IA32 (1<<TIF_IA32)
137#define _TIF_FORK (1<<TIF_FORK) 139#define _TIF_FORK (1<<TIF_FORK)
138#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) 140#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
diff --git a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h
index f6527e1b6c1c..6ed21f44d308 100644
--- a/include/asm-x86_64/timex.h
+++ b/include/asm-x86_64/timex.h
@@ -9,7 +9,6 @@
9#include <asm/8253pit.h> 9#include <asm/8253pit.h>
10#include <asm/msr.h> 10#include <asm/msr.h>
11#include <asm/vsyscall.h> 11#include <asm/vsyscall.h>
12#include <asm/hpet.h>
13#include <asm/system.h> 12#include <asm/system.h>
14#include <asm/processor.h> 13#include <asm/processor.h>
15#include <asm/tsc.h> 14#include <asm/tsc.h>
diff --git a/include/asm-x86_64/tlbflush.h b/include/asm-x86_64/tlbflush.h
index 8516225a8389..888eb4abdd07 100644
--- a/include/asm-x86_64/tlbflush.h
+++ b/include/asm-x86_64/tlbflush.h
@@ -92,7 +92,11 @@ static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long st
92 92
93#endif 93#endif
94 94
95#define flush_tlb_kernel_range(start, end) flush_tlb_all() 95static inline void flush_tlb_kernel_range(unsigned long start,
96 unsigned long end)
97{
98 flush_tlb_all();
99}
96 100
97static inline void flush_tlb_pgtables(struct mm_struct *mm, 101static inline void flush_tlb_pgtables(struct mm_struct *mm,
98 unsigned long start, unsigned long end) 102 unsigned long start, unsigned long end)
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index 4fd6fb23953e..36e52fba7960 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -22,7 +22,7 @@ extern int __node_distance(int, int);
22#define parent_node(node) (node) 22#define parent_node(node) (node)
23#define node_to_first_cpu(node) (first_cpu(node_to_cpumask[node])) 23#define node_to_first_cpu(node) (first_cpu(node_to_cpumask[node]))
24#define node_to_cpumask(node) (node_to_cpumask[node]) 24#define node_to_cpumask(node) (node_to_cpumask[node])
25#define pcibus_to_node(bus) ((long)(bus->sysdata)) 25#define pcibus_to_node(bus) ((struct pci_sysdata *)((bus)->sysdata))->node
26#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus)); 26#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus));
27 27
28#define numa_node_id() read_pda(nodenumber) 28#define numa_node_id() read_pda(nodenumber)
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index ae1ed05f2814..fc4e73f5f1fa 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -626,10 +626,12 @@ __SYSCALL(__NR_utimensat, sys_utimensat)
626__SYSCALL(__NR_epoll_pwait, sys_epoll_pwait) 626__SYSCALL(__NR_epoll_pwait, sys_epoll_pwait)
627#define __NR_signalfd 282 627#define __NR_signalfd 282
628__SYSCALL(__NR_signalfd, sys_signalfd) 628__SYSCALL(__NR_signalfd, sys_signalfd)
629#define __NR_timerfd 282 629#define __NR_timerfd 283
630__SYSCALL(__NR_timerfd, sys_timerfd) 630__SYSCALL(__NR_timerfd, sys_timerfd)
631#define __NR_eventfd 283 631#define __NR_eventfd 284
632__SYSCALL(__NR_eventfd, sys_eventfd) 632__SYSCALL(__NR_eventfd, sys_eventfd)
633#define __NR_fallocate 285
634__SYSCALL(__NR_fallocate, sys_fallocate)
633 635
634#ifndef __NO_STUBS 636#ifndef __NO_STUBS
635#define __ARCH_WANT_OLD_READDIR 637#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-x86_64/vgtod.h b/include/asm-x86_64/vgtod.h
new file mode 100644
index 000000000000..3301f0929342
--- /dev/null
+++ b/include/asm-x86_64/vgtod.h
@@ -0,0 +1,29 @@
1#ifndef _ASM_VGTOD_H
2#define _ASM_VGTOD_H 1
3
4#include <asm/vsyscall.h>
5#include <linux/clocksource.h>
6
7struct vsyscall_gtod_data {
8 seqlock_t lock;
9
10 /* open coded 'struct timespec' */
11 time_t wall_time_sec;
12 u32 wall_time_nsec;
13
14 int sysctl_enabled;
15 struct timezone sys_tz;
16 struct { /* extract of a clocksource struct */
17 cycle_t (*vread)(void);
18 cycle_t cycle_last;
19 cycle_t mask;
20 u32 mult;
21 u32 shift;
22 } clock;
23 struct timespec wall_to_monotonic;
24};
25extern struct vsyscall_gtod_data __vsyscall_gtod_data
26__section_vsyscall_gtod_data;
27extern struct vsyscall_gtod_data vsyscall_gtod_data;
28
29#endif
diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h
index 82b4afe65c91..3b8ceb4af2cf 100644
--- a/include/asm-x86_64/vsyscall.h
+++ b/include/asm-x86_64/vsyscall.h
@@ -22,6 +22,8 @@ enum vsyscall_num {
22/* Definitions for CONFIG_GENERIC_TIME definitions */ 22/* Definitions for CONFIG_GENERIC_TIME definitions */
23#define __section_vsyscall_gtod_data __attribute__ \ 23#define __section_vsyscall_gtod_data __attribute__ \
24 ((unused, __section__ (".vsyscall_gtod_data"),aligned(16))) 24 ((unused, __section__ (".vsyscall_gtod_data"),aligned(16)))
25#define __section_vsyscall_clock __attribute__ \
26 ((unused, __section__ (".vsyscall_clock"),aligned(16)))
25#define __vsyscall_fn __attribute__ ((unused,__section__(".vsyscall_fn"))) 27#define __vsyscall_fn __attribute__ ((unused,__section__(".vsyscall_fn")))
26 28
27#define VGETCPU_RDTSCP 1 29#define VGETCPU_RDTSCP 1
@@ -36,7 +38,6 @@ extern volatile unsigned long __jiffies;
36/* kernel space (writeable) */ 38/* kernel space (writeable) */
37extern int vgetcpu_mode; 39extern int vgetcpu_mode;
38extern struct timezone sys_tz; 40extern struct timezone sys_tz;
39extern struct vsyscall_gtod_data_t vsyscall_gtod_data;
40 41
41#endif /* __KERNEL__ */ 42#endif /* __KERNEL__ */
42 43
diff --git a/include/asm-xtensa/a.out.h b/include/asm-xtensa/a.out.h
index ffc4dcfd6ac1..05a2f67c6768 100644
--- a/include/asm-xtensa/a.out.h
+++ b/include/asm-xtensa/a.out.h
@@ -17,6 +17,7 @@
17/* Note: the kernel needs the a.out definitions, even if only ELF is used. */ 17/* Note: the kernel needs the a.out definitions, even if only ELF is used. */
18 18
19#define STACK_TOP TASK_SIZE 19#define STACK_TOP TASK_SIZE
20#define STACK_TOP_MAX STACK_TOP
20 21
21struct exec 22struct exec
22{ 23{
diff --git a/include/asm-xtensa/bitops.h b/include/asm-xtensa/bitops.h
index d815649617aa..1c1e0d933eea 100644
--- a/include/asm-xtensa/bitops.h
+++ b/include/asm-xtensa/bitops.h
@@ -7,7 +7,7 @@
7 * License. See the file "COPYING" in the main directory of this archive 7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details. 8 * for more details.
9 * 9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc. 10 * Copyright (C) 2001 - 2007 Tensilica Inc.
11 */ 11 */
12 12
13#ifndef _XTENSA_BITOPS_H 13#ifndef _XTENSA_BITOPS_H
@@ -31,53 +31,30 @@
31 31
32#if XCHAL_HAVE_NSA 32#if XCHAL_HAVE_NSA
33 33
34static __inline__ int __cntlz (unsigned long x) 34static inline unsigned long __cntlz (unsigned long x)
35{ 35{
36 int lz; 36 int lz;
37 asm ("nsau %0, %1" : "=r" (lz) : "r" (x)); 37 asm ("nsau %0, %1" : "=r" (lz) : "r" (x));
38 return 31 - lz; 38 return lz;
39} 39}
40 40
41#else
42
43static __inline__ int __cntlz (unsigned long x)
44{
45 unsigned long sum, x1, x2, x4, x8, x16;
46 x1 = x & 0xAAAAAAAA;
47 x2 = x & 0xCCCCCCCC;
48 x4 = x & 0xF0F0F0F0;
49 x8 = x & 0xFF00FF00;
50 x16 = x & 0xFFFF0000;
51 sum = x2 ? 2 : 0;
52 sum += (x16 != 0) * 16;
53 sum += (x8 != 0) * 8;
54 sum += (x4 != 0) * 4;
55 sum += (x1 != 0);
56
57 return sum;
58}
59
60#endif
61
62/* 41/*
63 * ffz: Find first zero in word. Undefined if no zero exists. 42 * ffz: Find first zero in word. Undefined if no zero exists.
64 * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1). 43 * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
65 */ 44 */
66 45
67static __inline__ int ffz(unsigned long x) 46static inline int ffz(unsigned long x)
68{ 47{
69 if ((x = ~x) == 0) 48 return 31 - __cntlz(~x & -~x);
70 return 32;
71 return __cntlz(x & -x);
72} 49}
73 50
74/* 51/*
75 * __ffs: Find first bit set in word. Return 0 for bit 0 52 * __ffs: Find first bit set in word. Return 0 for bit 0
76 */ 53 */
77 54
78static __inline__ int __ffs(unsigned long x) 55static inline int __ffs(unsigned long x)
79{ 56{
80 return __cntlz(x & -x); 57 return 31 - __cntlz(x & -x);
81} 58}
82 59
83/* 60/*
@@ -86,9 +63,9 @@ static __inline__ int __ffs(unsigned long x)
86 * differs in spirit from the above ffz (man ffs). 63 * differs in spirit from the above ffz (man ffs).
87 */ 64 */
88 65
89static __inline__ int ffs(unsigned long x) 66static inline int ffs(unsigned long x)
90{ 67{
91 return __cntlz(x & -x) + 1; 68 return 32 - __cntlz(x & -x);
92} 69}
93 70
94/* 71/*
@@ -96,20 +73,36 @@ static __inline__ int ffs(unsigned long x)
96 * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. 73 * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
97 */ 74 */
98 75
99static __inline__ int fls (unsigned int x) 76static inline int fls (unsigned int x)
100{ 77{
101 return __cntlz(x); 78 return 32 - __cntlz(x);
102} 79}
80
81#else
82
83/* Use the generic implementation if we don't have the nsa/nsau instructions. */
84
85# include <asm-generic/bitops/ffs.h>
86# include <asm-generic/bitops/__ffs.h>
87# include <asm-generic/bitops/ffz.h>
88# include <asm-generic/bitops/fls.h>
89
90#endif
91
103#include <asm-generic/bitops/fls64.h> 92#include <asm-generic/bitops/fls64.h>
104#include <asm-generic/bitops/find.h> 93#include <asm-generic/bitops/find.h>
105#include <asm-generic/bitops/ext2-non-atomic.h> 94#include <asm-generic/bitops/ext2-non-atomic.h>
106 95
107#ifdef __XTENSA_EL__ 96#ifdef __XTENSA_EL__
108# define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit((nr),(addr)) 97# define ext2_set_bit_atomic(lock,nr,addr) \
109# define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr),(addr)) 98 test_and_set_bit((nr), (unsigned long*)(addr))
99# define ext2_clear_bit_atomic(lock,nr,addr) \
100 test_and_clear_bit((nr), (unsigned long*)(addr))
110#elif defined(__XTENSA_EB__) 101#elif defined(__XTENSA_EB__)
111# define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit((nr) ^ 0x18, (addr)) 102# define ext2_set_bit_atomic(lock,nr,addr) \
112# define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr)^0x18,(addr)) 103 test_and_set_bit((nr) ^ 0x18, (unsigned long*)(addr))
104# define ext2_clear_bit_atomic(lock,nr,addr) \
105 test_and_clear_bit((nr) ^ 0x18, (unsigned long*)(addr))
113#else 106#else
114# error processor byte order undefined! 107# error processor byte order undefined!
115#endif 108#endif
diff --git a/include/asm-xtensa/byteorder.h b/include/asm-xtensa/byteorder.h
index 0f540a5f4c01..765edf17a9a4 100644
--- a/include/asm-xtensa/byteorder.h
+++ b/include/asm-xtensa/byteorder.h
@@ -12,6 +12,7 @@
12#define _XTENSA_BYTEORDER_H 12#define _XTENSA_BYTEORDER_H
13 13
14#include <asm/types.h> 14#include <asm/types.h>
15#include <linux/compiler.h>
15 16
16static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x) 17static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
17{ 18{
@@ -78,4 +79,4 @@ static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x)
78# error processor byte order undefined! 79# error processor byte order undefined!
79#endif 80#endif
80 81
81#endif /* __ASM_XTENSA_BYTEORDER_H */ 82#endif /* _XTENSA_BYTEORDER_H */
diff --git a/include/asm-xtensa/coprocessor.h b/include/asm-xtensa/coprocessor.h
index bd09ec02d57f..aa2121034558 100644
--- a/include/asm-xtensa/coprocessor.h
+++ b/include/asm-xtensa/coprocessor.h
@@ -64,6 +64,7 @@ typedef struct {
64# define COPROCESSOR_INFO_SIZE 8 64# define COPROCESSOR_INFO_SIZE 8
65# endif 65# endif
66#endif 66#endif
67#endif /* XCHAL_HAVE_CP */
67 68
68 69
69#ifndef __ASSEMBLY__ 70#ifndef __ASSEMBLY__
@@ -74,8 +75,11 @@ extern void save_coprocessor_registers(void*, int);
74# else 75# else
75# define release_coprocessors(task) 76# define release_coprocessors(task)
76# endif 77# endif
77#endif
78 78
79#endif 79typedef unsigned char cp_state_t[XTENSA_CP_EXTRA_SIZE]
80 __attribute__ ((aligned (XTENSA_CP_EXTRA_ALIGN)));
81
82#endif /* !__ASSEMBLY__ */
83
80 84
81#endif /* _XTENSA_COPROCESSOR_H */ 85#endif /* _XTENSA_COPROCESSOR_H */
diff --git a/include/asm-xtensa/div64.h b/include/asm-xtensa/div64.h
index 20965e3af1dd..f35678cb0a9b 100644
--- a/include/asm-xtensa/div64.h
+++ b/include/asm-xtensa/div64.h
@@ -5,21 +5,12 @@
5 * License. See the file "COPYING" in the main directory of this archive 5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details. 6 * for more details.
7 * 7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc. 8 * Copyright (C) 2001 - 2007 Tensilica Inc.
9 */ 9 */
10 10
11#ifndef _XTENSA_DIV64_H 11#ifndef _XTENSA_DIV64_H
12#define _XTENSA_DIV64_H 12#define _XTENSA_DIV64_H
13 13
14#include <linux/types.h> 14#include <asm-generic/div64.h>
15 15
16#define do_div(n,base) ({ \ 16#endif /* _XTENSA_DIV64_H */
17 int __res = n % ((unsigned int) base); \
18 n /= (unsigned int) base; \
19 __res; })
20
21static inline uint64_t div64_64(uint64_t dividend, uint64_t divisor)
22{
23 return dividend / divisor;
24}
25#endif
diff --git a/include/asm-xtensa/elf.h b/include/asm-xtensa/elf.h
index f0f9fd8560a5..1569b53cec91 100644
--- a/include/asm-xtensa/elf.h
+++ b/include/asm-xtensa/elf.h
@@ -13,7 +13,6 @@
13#ifndef _XTENSA_ELF_H 13#ifndef _XTENSA_ELF_H
14#define _XTENSA_ELF_H 14#define _XTENSA_ELF_H
15 15
16#include <asm/variant/core.h>
17#include <asm/ptrace.h> 16#include <asm/ptrace.h>
18 17
19/* Xtensa processor ELF architecture-magic number */ 18/* Xtensa processor ELF architecture-magic number */
@@ -49,7 +48,7 @@ typedef struct {
49 elf_greg_t lcount; 48 elf_greg_t lcount;
50 elf_greg_t sar; 49 elf_greg_t sar;
51 elf_greg_t syscall; 50 elf_greg_t syscall;
52 elf_greg_t ar[XCHAL_NUM_AREGS]; 51 elf_greg_t ar[64];
53} xtensa_gregset_t; 52} xtensa_gregset_t;
54 53
55#define ELF_NGREG (sizeof(xtensa_gregset_t) / sizeof(elf_greg_t)) 54#define ELF_NGREG (sizeof(xtensa_gregset_t) / sizeof(elf_greg_t))
diff --git a/include/asm-xtensa/fb.h b/include/asm-xtensa/fb.h
new file mode 100644
index 000000000000..c7df38030992
--- /dev/null
+++ b/include/asm-xtensa/fb.h
@@ -0,0 +1,12 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h
index 0609fc691b72..46ab12db5739 100644
--- a/include/asm-xtensa/fcntl.h
+++ b/include/asm-xtensa/fcntl.h
@@ -1,99 +1 @@
1/* #include <asm-generic/fcntl.h>
2 * include/asm-xtensa/fcntl.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1995, 1996, 1997, 1998 by Ralf Baechle
9 * Copyright (C) 2001 - 2005 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_FCNTL_H
13#define _XTENSA_FCNTL_H
14
15/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
16 located on an ext2 file system */
17#define O_ACCMODE 0003
18#define O_RDONLY 00
19#define O_WRONLY 01
20#define O_RDWR 02
21#define O_CREAT 0100 /* not fcntl */
22#define O_EXCL 0200 /* not fcntl */
23#define O_NOCTTY 0400 /* not fcntl */
24#define O_TRUNC 01000 /* not fcntl */
25#define O_APPEND 02000
26#define O_NONBLOCK 04000
27#define O_NDELAY O_NONBLOCK
28#define O_SYNC 010000
29#define FASYNC 020000 /* fcntl, for BSD compatibility */
30#define O_DIRECT 040000 /* direct disk access hint */
31#define O_LARGEFILE 0100000
32#define O_DIRECTORY 0200000 /* must be a directory */
33#define O_NOFOLLOW 0400000 /* don't follow links */
34#define O_NOATIME 01000000
35
36#define F_DUPFD 0 /* dup */
37#define F_GETFD 1 /* get close_on_exec */
38#define F_SETFD 2 /* set/clear close_on_exec */
39#define F_GETFL 3 /* get file->f_flags */
40#define F_SETFL 4 /* set file->f_flags */
41#define F_GETLK 5
42#define F_SETLK 6
43#define F_SETLKW 7
44
45#define F_SETOWN 8 /* for sockets. */
46#define F_GETOWN 9 /* for sockets. */
47#define F_SETSIG 10 /* for sockets. */
48#define F_GETSIG 11 /* for sockets. */
49
50#define F_GETLK64 12 /* using 'struct flock64' */
51#define F_SETLK64 13
52#define F_SETLKW64 14
53
54/* for F_[GET|SET]FL */
55#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
56
57/* for posix fcntl() and lockf() */
58#define F_RDLCK 0
59#define F_WRLCK 1
60#define F_UNLCK 2
61
62/* for old implementation of bsd flock () */
63#define F_EXLCK 4 /* or 3 */
64#define F_SHLCK 8 /* or 4 */
65
66/* for leases */
67#define F_INPROGRESS 16
68
69/* operations for bsd flock(), also used by the kernel implementation */
70#define LOCK_SH 1 /* shared lock */
71#define LOCK_EX 2 /* exclusive lock */
72#define LOCK_NB 4 /* or'd with one of the above to prevent
73 blocking */
74#define LOCK_UN 8 /* remove lock */
75
76#define LOCK_MAND 32 /* This is a mandatory flock */
77#define LOCK_READ 64 /* ... Which allows concurrent read operations */
78#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
79#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
80
81struct flock {
82 short l_type;
83 short l_whence;
84 off_t l_start;
85 off_t l_len;
86 pid_t l_pid;
87};
88
89struct flock64 {
90 short l_type;
91 short l_whence;
92 loff_t l_start;
93 loff_t l_len;
94 pid_t l_pid;
95};
96
97#define F_LINUX_SPECIFIC_BASE 1024
98
99#endif /* _XTENSA_FCNTL_H */
diff --git a/include/asm-xtensa/mmu_context.h b/include/asm-xtensa/mmu_context.h
index 92f948392ebc..c0fd8e5b4513 100644
--- a/include/asm-xtensa/mmu_context.h
+++ b/include/asm-xtensa/mmu_context.h
@@ -14,6 +14,7 @@
14#define _XTENSA_MMU_CONTEXT_H 14#define _XTENSA_MMU_CONTEXT_H
15 15
16#include <linux/stringify.h> 16#include <linux/stringify.h>
17#include <linux/sched.h>
17 18
18#include <asm/pgtable.h> 19#include <asm/pgtable.h>
19#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
diff --git a/include/asm-xtensa/page.h b/include/asm-xtensa/page.h
index c631d006194b..1213cde75438 100644
--- a/include/asm-xtensa/page.h
+++ b/include/asm-xtensa/page.h
@@ -131,6 +131,6 @@ void copy_user_page(void *to,void* from,unsigned long vaddr,struct page* page);
131#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 131#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
132 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 132 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
133 133
134#endif /* __KERNEL__ */
135#include <asm-generic/memory_model.h> 134#include <asm-generic/memory_model.h>
135#endif /* __KERNEL__ */
136#endif /* _XTENSA_PAGE_H */ 136#endif /* _XTENSA_PAGE_H */
diff --git a/include/asm-xtensa/param.h b/include/asm-xtensa/param.h
index 6f281392e3f8..ce3a336cad07 100644
--- a/include/asm-xtensa/param.h
+++ b/include/asm-xtensa/param.h
@@ -11,15 +11,13 @@
11#ifndef _XTENSA_PARAM_H 11#ifndef _XTENSA_PARAM_H
12#define _XTENSA_PARAM_H 12#define _XTENSA_PARAM_H
13 13
14#include <asm/variant/core.h>
15
16#ifdef __KERNEL__ 14#ifdef __KERNEL__
17# define HZ 100 /* internal timer frequency */ 15# define HZ 100 /* internal timer frequency */
18# define USER_HZ 100 /* for user interfaces in "ticks" */ 16# define USER_HZ 100 /* for user interfaces in "ticks" */
19# define CLOCKS_PER_SEC (USER_HZ) /* frequnzy at which times() counts */ 17# define CLOCKS_PER_SEC (USER_HZ) /* frequnzy at which times() counts */
20#endif 18#endif
21 19
22#define EXEC_PAGESIZE (1 << XCHAL_MMU_MIN_PTE_PAGE_SIZE) 20#define EXEC_PAGESIZE 4096
23 21
24#ifndef NGROUPS 22#ifndef NGROUPS
25#define NGROUPS 32 23#define NGROUPS 32
diff --git a/include/asm-xtensa/pci.h b/include/asm-xtensa/pci.h
index 24eb7fc25da8..66410acf18b4 100644
--- a/include/asm-xtensa/pci.h
+++ b/include/asm-xtensa/pci.h
@@ -64,9 +64,6 @@ struct pci_dev;
64#define pci_ubnmap_len(PTR, LEN_NAME) (0) 64#define pci_ubnmap_len(PTR, LEN_NAME) (0)
65#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) 65#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
66 66
67/* We cannot access memory above 4GB */
68#define pci_dac_dma_supported(pci_dev, mask) (0)
69
70/* Map a range of PCI memory or I/O space for a device into user space */ 67/* Map a range of PCI memory or I/O space for a device into user space */
71int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, 68int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
72 enum pci_mmap_state mmap_state, int write_combine); 69 enum pci_mmap_state mmap_state, int write_combine);
@@ -74,10 +71,6 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
74/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ 71/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */
75#define HAVE_PCI_MMAP 1 72#define HAVE_PCI_MMAP 1
76 73
77static inline void pcibios_add_platform_entries(struct pci_dev *dev)
78{
79}
80
81#endif /* __KERNEL__ */ 74#endif /* __KERNEL__ */
82 75
83/* Implement the pci_ DMA API in terms of the generic device dma_ one */ 76/* Implement the pci_ DMA API in terms of the generic device dma_ one */
diff --git a/include/asm-xtensa/pgtable.h b/include/asm-xtensa/pgtable.h
index 2d4b5db6ea63..06850f3b26a7 100644
--- a/include/asm-xtensa/pgtable.h
+++ b/include/asm-xtensa/pgtable.h
@@ -197,16 +197,13 @@ extern pgd_t swapper_pg_dir[PAGE_SIZE/sizeof(pgd_t)];
197 197
198/* Note: We use the _PAGE_USER bit to indicate write-protect kernel memory */ 198/* Note: We use the _PAGE_USER bit to indicate write-protect kernel memory */
199 199
200static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
201static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } 200static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
202static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } 201static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
203static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 202static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
204static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 203static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
205static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~(_PAGE_RW | _PAGE_WRENABLE); return pte; } 204static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~(_PAGE_RW | _PAGE_WRENABLE); return pte; }
206static inline pte_t pte_rdprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_USER; return pte; }
207static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; } 205static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
208static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } 206static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
209static inline pte_t pte_mkread(pte_t pte) { pte_val(pte) |= _PAGE_USER; return pte; }
210static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; } 207static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; }
211static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; } 208static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; }
212static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_RW; return pte; } 209static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_RW; return pte; }
@@ -270,17 +267,6 @@ ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr,
270 return 1; 267 return 1;
271} 268}
272 269
273static inline int
274ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr,
275 pte_t *ptep)
276{
277 pte_t pte = *ptep;
278 if (!pte_dirty(pte))
279 return 0;
280 update_pte(ptep, pte_mkclean(pte));
281 return 1;
282}
283
284static inline pte_t 270static inline pte_t
285ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 271ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
286{ 272{
@@ -421,7 +407,6 @@ typedef pte_t *pte_addr_t;
421#endif /* !defined (__ASSEMBLY__) */ 407#endif /* !defined (__ASSEMBLY__) */
422 408
423#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 409#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
424#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
425#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 410#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
426#define __HAVE_ARCH_PTEP_SET_WRPROTECT 411#define __HAVE_ARCH_PTEP_SET_WRPROTECT
427#define __HAVE_ARCH_PTEP_MKDIRTY 412#define __HAVE_ARCH_PTEP_MKDIRTY
diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h
index 1b7fe363fad1..77ff02d307bb 100644
--- a/include/asm-xtensa/ptrace.h
+++ b/include/asm-xtensa/ptrace.h
@@ -11,8 +11,6 @@
11#ifndef _XTENSA_PTRACE_H 11#ifndef _XTENSA_PTRACE_H
12#define _XTENSA_PTRACE_H 12#define _XTENSA_PTRACE_H
13 13
14#include <asm/variant/core.h>
15
16/* 14/*
17 * Kernel stack 15 * Kernel stack
18 * 16 *
@@ -101,7 +99,8 @@ struct pt_regs {
101 unsigned long windowbase; /* 48 */ 99 unsigned long windowbase; /* 48 */
102 unsigned long windowstart; /* 52 */ 100 unsigned long windowstart; /* 52 */
103 unsigned long syscall; /* 56 */ 101 unsigned long syscall; /* 56 */
104 int reserved[2]; /* 64 */ 102 unsigned long icountlevel; /* 60 */
103 int reserved[1]; /* 64 */
105 104
106 /* Make sure the areg field is 16 bytes aligned. */ 105 /* Make sure the areg field is 16 bytes aligned. */
107 int align[0] __attribute__ ((aligned(16))); 106 int align[0] __attribute__ ((aligned(16)));
@@ -113,6 +112,9 @@ struct pt_regs {
113}; 112};
114 113
115#ifdef __KERNEL__ 114#ifdef __KERNEL__
115
116#include <asm/variant/core.h>
117
116# define task_pt_regs(tsk) ((struct pt_regs*) \ 118# define task_pt_regs(tsk) ((struct pt_regs*) \
117 (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1) 119 (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1)
118# define user_mode(regs) (((regs)->ps & 0x00000020)!=0) 120# define user_mode(regs) (((regs)->ps & 0x00000020)!=0)
diff --git a/include/asm-xtensa/shmparam.h b/include/asm-xtensa/shmparam.h
index d3b65bfa71c3..c8cc16c3da9e 100644
--- a/include/asm-xtensa/shmparam.h
+++ b/include/asm-xtensa/shmparam.h
@@ -9,8 +9,6 @@
9#ifndef _XTENSA_SHMPARAM_H 9#ifndef _XTENSA_SHMPARAM_H
10#define _XTENSA_SHMPARAM_H 10#define _XTENSA_SHMPARAM_H
11 11
12#include <asm/processor.h>
13
14/* 12/*
15 * Xtensa can have variable size caches, and if 13 * Xtensa can have variable size caches, and if
16 * the size of single way is larger than the page size, 14 * the size of single way is larger than the page size,
diff --git a/include/asm-xtensa/sigcontext.h b/include/asm-xtensa/sigcontext.h
index a75177291418..e3381cee5059 100644
--- a/include/asm-xtensa/sigcontext.h
+++ b/include/asm-xtensa/sigcontext.h
@@ -5,21 +5,12 @@
5 * License. See the file "COPYING" in the main directory of this archive 5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details. 6 * for more details.
7 * 7 *
8 * Copyright (C) 2001 - 2003 Tensilica Inc. 8 * Copyright (C) 2001 - 2007 Tensilica Inc.
9 */ 9 */
10 10
11#ifndef _XTENSA_SIGCONTEXT_H 11#ifndef _XTENSA_SIGCONTEXT_H
12#define _XTENSA_SIGCONTEXT_H 12#define _XTENSA_SIGCONTEXT_H
13 13
14#define _ASMLANGUAGE
15#include <asm/processor.h>
16#include <asm/coprocessor.h>
17
18
19struct _cpstate {
20 unsigned char _cpstate[XTENSA_CP_EXTRA_SIZE];
21} __attribute__ ((aligned (XTENSA_CP_EXTRA_ALIGN)));
22
23 14
24struct sigcontext { 15struct sigcontext {
25 unsigned long oldmask; 16 unsigned long oldmask;
@@ -27,18 +18,13 @@ struct sigcontext {
27 /* CPU registers */ 18 /* CPU registers */
28 unsigned long sc_pc; 19 unsigned long sc_pc;
29 unsigned long sc_ps; 20 unsigned long sc_ps;
30 unsigned long sc_wmask;
31 unsigned long sc_windowbase;
32 unsigned long sc_windowstart;
33 unsigned long sc_lbeg; 21 unsigned long sc_lbeg;
34 unsigned long sc_lend; 22 unsigned long sc_lend;
35 unsigned long sc_lcount; 23 unsigned long sc_lcount;
36 unsigned long sc_sar; 24 unsigned long sc_sar;
37 unsigned long sc_depc; 25 unsigned long sc_acclo;
38 unsigned long sc_dareg0; 26 unsigned long sc_acchi;
39 unsigned long sc_treg[4]; 27 unsigned long sc_a[16];
40 unsigned long sc_areg[XCHAL_NUM_AREGS];
41 struct _cpstate *sc_cpstate;
42}; 28};
43 29
44#endif /* __ASM_XTENSA_SIGCONTEXT_H */ 30#endif /* _XTENSA_SIGCONTEXT_H */
diff --git a/include/asm-xtensa/termbits.h b/include/asm-xtensa/termbits.h
index 057b9a3d8f83..9972c25ec86f 100644
--- a/include/asm-xtensa/termbits.h
+++ b/include/asm-xtensa/termbits.h
@@ -30,6 +30,17 @@ struct termios {
30 cc_t c_cc[NCCS]; /* control characters */ 30 cc_t c_cc[NCCS]; /* control characters */
31}; 31};
32 32
33struct termios2 {
34 tcflag_t c_iflag; /* input mode flags */
35 tcflag_t c_oflag; /* output mode flags */
36 tcflag_t c_cflag; /* control mode flags */
37 tcflag_t c_lflag; /* local mode flags */
38 cc_t c_line; /* line discipline */
39 cc_t c_cc[NCCS]; /* control characters */
40 speed_t c_ispeed; /* input speed */
41 speed_t c_ospeed; /* output speed */
42};
43
33struct ktermios { 44struct ktermios {
34 tcflag_t c_iflag; /* input mode flags */ 45 tcflag_t c_iflag; /* input mode flags */
35 tcflag_t c_oflag; /* output mode flags */ 46 tcflag_t c_oflag; /* output mode flags */
diff --git a/include/asm-xtensa/thread_info.h b/include/asm-xtensa/thread_info.h
index 5ae34ab71597..3fa29799b435 100644
--- a/include/asm-xtensa/thread_info.h
+++ b/include/asm-xtensa/thread_info.h
@@ -116,6 +116,7 @@ static inline struct thread_info *current_thread_info(void)
116#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ 116#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */
117#define TIF_IRET 5 /* return with iret */ 117#define TIF_IRET 5 /* return with iret */
118#define TIF_MEMDIE 6 118#define TIF_MEMDIE 6
119#define TIF_RESTORE_SIGMASK 7 /* restore signal mask in do_signal() */
119#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 120#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
120 121
121#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 122#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -125,6 +126,7 @@ static inline struct thread_info *current_thread_info(void)
125#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) 126#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
126#define _TIF_IRET (1<<TIF_IRET) 127#define _TIF_IRET (1<<TIF_IRET)
127#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 128#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
129#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
128 130
129#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ 131#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
130#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ 132#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
diff --git a/include/asm-xtensa/unistd.h b/include/asm-xtensa/unistd.h
index 8a7fb6964ce1..9bd34024431c 100644
--- a/include/asm-xtensa/unistd.h
+++ b/include/asm-xtensa/unistd.h
@@ -485,8 +485,8 @@ __SYSCALL(217, sys_sched_get_priority_min, 1)
485__SYSCALL(218, sys_sched_rr_get_interval, 2) 485__SYSCALL(218, sys_sched_rr_get_interval, 2)
486#define __NR_sched_yield 219 486#define __NR_sched_yield 219
487__SYSCALL(219, sys_sched_yield, 0) 487__SYSCALL(219, sys_sched_yield, 0)
488#define __NR_sigreturn 222 488#define __NR_available222 222
489__SYSCALL(222, xtensa_sigreturn, 0) 489__SYSCALL(222, sys_ni_syscall, 0)
490 490
491/* Signal Handling */ 491/* Signal Handling */
492 492
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index f317c270d4bf..bcf875e844fe 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -49,6 +49,7 @@ header-y += consolemap.h
49header-y += const.h 49header-y += const.h
50header-y += cycx_cfm.h 50header-y += cycx_cfm.h
51header-y += dlm_device.h 51header-y += dlm_device.h
52header-y += dlm_netlink.h
52header-y += dm-ioctl.h 53header-y += dm-ioctl.h
53header-y += dn.h 54header-y += dn.h
54header-y += dqblk_v1.h 55header-y += dqblk_v1.h
@@ -90,7 +91,6 @@ header-y += in6.h
90header-y += in_route.h 91header-y += in_route.h
91header-y += ioctl.h 92header-y += ioctl.h
92header-y += ipmi_msgdefs.h 93header-y += ipmi_msgdefs.h
93header-y += ip_mp_alg.h
94header-y += ipsec.h 94header-y += ipsec.h
95header-y += ipx.h 95header-y += ipx.h
96header-y += irda.h 96header-y += irda.h
@@ -225,6 +225,7 @@ unifdef-y += if_fddi.h
225unifdef-y += if_frad.h 225unifdef-y += if_frad.h
226unifdef-y += if_ltalk.h 226unifdef-y += if_ltalk.h
227unifdef-y += if_link.h 227unifdef-y += if_link.h
228unifdef-y += if_pppol2tp.h
228unifdef-y += if_pppox.h 229unifdef-y += if_pppox.h
229unifdef-y += if_shaper.h 230unifdef-y += if_shaper.h
230unifdef-y += if_tr.h 231unifdef-y += if_tr.h
@@ -246,7 +247,6 @@ unifdef-y += isdn.h
246unifdef-y += isdnif.h 247unifdef-y += isdnif.h
247unifdef-y += isdn_divertif.h 248unifdef-y += isdn_divertif.h
248unifdef-y += isdn_ppp.h 249unifdef-y += isdn_ppp.h
249unifdef-y += isicom.h
250unifdef-y += jbd.h 250unifdef-y += jbd.h
251unifdef-y += joystick.h 251unifdef-y += joystick.h
252unifdef-y += kdev_t.h 252unifdef-y += kdev_t.h
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index fccd8b548d93..d5680cd7746a 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -88,10 +88,8 @@ int acpi_table_parse (char *id, acpi_table_handler handler);
88int __init acpi_table_parse_entries(char *id, unsigned long table_size, 88int __init acpi_table_parse_entries(char *id, unsigned long table_size,
89 int entry_id, acpi_table_entry_handler handler, unsigned int max_entries); 89 int entry_id, acpi_table_entry_handler handler, unsigned int max_entries);
90int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries); 90int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries);
91int acpi_table_parse_srat (enum acpi_srat_type id, acpi_table_entry_handler handler, unsigned int max_entries);
92int acpi_parse_mcfg (struct acpi_table_header *header); 91int acpi_parse_mcfg (struct acpi_table_header *header);
93void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); 92void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
94void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
95 93
96/* the following four functions are architecture-dependent */ 94/* the following four functions are architecture-dependent */
97#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT 95#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
@@ -122,7 +120,7 @@ extern struct acpi_mcfg_allocation *pci_mmcfg_config;
122extern int pci_mmcfg_config_num; 120extern int pci_mmcfg_config_num;
123 121
124extern int sbf_port; 122extern int sbf_port;
125extern unsigned long acpi_video_flags; 123extern unsigned long acpi_realmode_flags;
126 124
127#else /* !CONFIG_ACPI */ 125#else /* !CONFIG_ACPI */
128 126
@@ -233,6 +231,9 @@ extern int acpi_paddr_to_node(u64 start_addr, u64 size);
233 231
234extern int pnpacpi_disabled; 232extern int pnpacpi_disabled;
235 233
234#define PXM_INVAL (-1)
235#define NID_INVAL (-1)
236
236#else /* CONFIG_ACPI */ 237#else /* CONFIG_ACPI */
237 238
238static inline int acpi_boot_init(void) 239static inline int acpi_boot_init(void)
diff --git a/include/linux/aer.h b/include/linux/aer.h
index 402e178b38eb..509656286e53 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -13,11 +13,13 @@ extern int pci_enable_pcie_error_reporting(struct pci_dev *dev);
13extern int pci_find_aer_capability(struct pci_dev *dev); 13extern int pci_find_aer_capability(struct pci_dev *dev);
14extern int pci_disable_pcie_error_reporting(struct pci_dev *dev); 14extern int pci_disable_pcie_error_reporting(struct pci_dev *dev);
15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); 15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
16extern int pci_cleanup_aer_correct_error_status(struct pci_dev *dev);
16#else 17#else
17#define pci_enable_pcie_error_reporting(dev) do { } while (0) 18#define pci_enable_pcie_error_reporting(dev) (-EINVAL)
18#define pci_find_aer_capability(dev) do { } while (0) 19#define pci_find_aer_capability(dev) (0)
19#define pci_disable_pcie_error_reporting(dev) do { } while (0) 20#define pci_disable_pcie_error_reporting(dev) (-EINVAL)
20#define pci_cleanup_aer_uncorrect_error_status(dev) do { } while (0) 21#define pci_cleanup_aer_uncorrect_error_status(dev) (-EINVAL)
22#define pci_cleanup_aer_correct_error_status(dev) (-EINVAL)
21#endif 23#endif
22 24
23#endif //_AER_H_ 25#endif //_AER_H_
diff --git a/include/linux/aio.h b/include/linux/aio.h
index b903fc02bdb7..d10e608f232d 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -86,7 +86,7 @@ struct kioctx;
86 */ 86 */
87struct kiocb { 87struct kiocb {
88 struct list_head ki_run_list; 88 struct list_head ki_run_list;
89 long ki_flags; 89 unsigned long ki_flags;
90 int ki_users; 90 int ki_users;
91 unsigned ki_key; /* id of this request */ 91 unsigned ki_key; /* id of this request */
92 92
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h
new file mode 100644
index 000000000000..bdca3f1b3213
--- /dev/null
+++ b/include/linux/async_tx.h
@@ -0,0 +1,150 @@
1/*
2 * Copyright © 2006, Intel Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as 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 for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16 *
17 */
18#ifndef _ASYNC_TX_H_
19#define _ASYNC_TX_H_
20#include <linux/dmaengine.h>
21#include <linux/spinlock.h>
22#include <linux/interrupt.h>
23
24/**
25 * dma_chan_ref - object used to manage dma channels received from the
26 * dmaengine core.
27 * @chan - the channel being tracked
28 * @node - node for the channel to be placed on async_tx_master_list
29 * @rcu - for list_del_rcu
30 * @count - number of times this channel is listed in the pool
31 * (for channels with multiple capabiities)
32 */
33struct dma_chan_ref {
34 struct dma_chan *chan;
35 struct list_head node;
36 struct rcu_head rcu;
37 atomic_t count;
38};
39
40/**
41 * async_tx_flags - modifiers for the async_* calls
42 * @ASYNC_TX_XOR_ZERO_DST: this flag must be used for xor operations where the
43 * the destination address is not a source. The asynchronous case handles this
44 * implicitly, the synchronous case needs to zero the destination block.
45 * @ASYNC_TX_XOR_DROP_DST: this flag must be used if the destination address is
46 * also one of the source addresses. In the synchronous case the destination
47 * address is an implied source, whereas the asynchronous case it must be listed
48 * as a source. The destination address must be the first address in the source
49 * array.
50 * @ASYNC_TX_ASSUME_COHERENT: skip cache maintenance operations
51 * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a
52 * dependency chain
53 * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining.
54 */
55enum async_tx_flags {
56 ASYNC_TX_XOR_ZERO_DST = (1 << 0),
57 ASYNC_TX_XOR_DROP_DST = (1 << 1),
58 ASYNC_TX_ASSUME_COHERENT = (1 << 2),
59 ASYNC_TX_ACK = (1 << 3),
60 ASYNC_TX_DEP_ACK = (1 << 4),
61};
62
63#ifdef CONFIG_DMA_ENGINE
64void async_tx_issue_pending_all(void);
65enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
66void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx);
67struct dma_chan *
68async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
69 enum dma_transaction_type tx_type);
70#else
71static inline void async_tx_issue_pending_all(void)
72{
73 do { } while (0);
74}
75
76static inline enum dma_status
77dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
78{
79 return DMA_SUCCESS;
80}
81
82static inline void
83async_tx_run_dependencies(struct dma_async_tx_descriptor *tx,
84 struct dma_chan *host_chan)
85{
86 do { } while (0);
87}
88
89static inline struct dma_chan *
90async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
91 enum dma_transaction_type tx_type)
92{
93 return NULL;
94}
95#endif
96
97/**
98 * async_tx_sync_epilog - actions to take if an operation is run synchronously
99 * @flags: async_tx flags
100 * @depend_tx: transaction depends on depend_tx
101 * @cb_fn: function to call when the transaction completes
102 * @cb_fn_param: parameter to pass to the callback routine
103 */
104static inline void
105async_tx_sync_epilog(unsigned long flags,
106 struct dma_async_tx_descriptor *depend_tx,
107 dma_async_tx_callback cb_fn, void *cb_fn_param)
108{
109 if (cb_fn)
110 cb_fn(cb_fn_param);
111
112 if (depend_tx && (flags & ASYNC_TX_DEP_ACK))
113 async_tx_ack(depend_tx);
114}
115
116void
117async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx,
118 enum async_tx_flags flags, struct dma_async_tx_descriptor *depend_tx,
119 dma_async_tx_callback cb_fn, void *cb_fn_param);
120
121struct dma_async_tx_descriptor *
122async_xor(struct page *dest, struct page **src_list, unsigned int offset,
123 int src_cnt, size_t len, enum async_tx_flags flags,
124 struct dma_async_tx_descriptor *depend_tx,
125 dma_async_tx_callback cb_fn, void *cb_fn_param);
126
127struct dma_async_tx_descriptor *
128async_xor_zero_sum(struct page *dest, struct page **src_list,
129 unsigned int offset, int src_cnt, size_t len,
130 u32 *result, enum async_tx_flags flags,
131 struct dma_async_tx_descriptor *depend_tx,
132 dma_async_tx_callback cb_fn, void *cb_fn_param);
133
134struct dma_async_tx_descriptor *
135async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
136 unsigned int src_offset, size_t len, enum async_tx_flags flags,
137 struct dma_async_tx_descriptor *depend_tx,
138 dma_async_tx_callback cb_fn, void *cb_fn_param);
139
140struct dma_async_tx_descriptor *
141async_memset(struct page *dest, int val, unsigned int offset,
142 size_t len, enum async_tx_flags flags,
143 struct dma_async_tx_descriptor *depend_tx,
144 dma_async_tx_callback cb_fn, void *cb_fn_param);
145
146struct dma_async_tx_descriptor *
147async_trigger_callback(enum async_tx_flags flags,
148 struct dma_async_tx_descriptor *depend_tx,
149 dma_async_tx_callback cb_fn, void *cb_fn_param);
150#endif /* _ASYNC_TX_H_ */
diff --git a/include/linux/ata.h b/include/linux/ata.h
index edb31bfff68f..23a22df039d8 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -64,6 +64,15 @@ enum {
64 ATA_ID_PROD_LEN = 40, 64 ATA_ID_PROD_LEN = 40,
65 65
66 ATA_PCI_CTL_OFS = 2, 66 ATA_PCI_CTL_OFS = 2,
67
68 ATA_PIO0 = (1 << 0),
69 ATA_PIO1 = ATA_PIO0 | (1 << 1),
70 ATA_PIO2 = ATA_PIO1 | (1 << 2),
71 ATA_PIO3 = ATA_PIO2 | (1 << 3),
72 ATA_PIO4 = ATA_PIO3 | (1 << 4),
73 ATA_PIO5 = ATA_PIO4 | (1 << 5),
74 ATA_PIO6 = ATA_PIO5 | (1 << 6),
75
67 ATA_UDMA0 = (1 << 0), 76 ATA_UDMA0 = (1 << 0),
68 ATA_UDMA1 = ATA_UDMA0 | (1 << 1), 77 ATA_UDMA1 = ATA_UDMA0 | (1 << 1),
69 ATA_UDMA2 = ATA_UDMA1 | (1 << 2), 78 ATA_UDMA2 = ATA_UDMA1 | (1 << 2),
@@ -126,6 +135,7 @@ enum {
126 ATA_REG_IRQ = ATA_REG_NSECT, 135 ATA_REG_IRQ = ATA_REG_NSECT,
127 136
128 /* ATA device commands */ 137 /* ATA device commands */
138 ATA_CMD_DEV_RESET = 0x08, /* ATAPI device reset */
129 ATA_CMD_CHK_POWER = 0xE5, /* check power mode */ 139 ATA_CMD_CHK_POWER = 0xE5, /* check power mode */
130 ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */ 140 ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */
131 ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ 141 ATA_CMD_IDLE = 0xE3, /* place in idle power mode */
@@ -151,6 +161,7 @@ enum {
151 ATA_CMD_WRITE_MULTI_EXT = 0x39, 161 ATA_CMD_WRITE_MULTI_EXT = 0x39,
152 ATA_CMD_WRITE_MULTI_FUA_EXT = 0xCE, 162 ATA_CMD_WRITE_MULTI_FUA_EXT = 0xCE,
153 ATA_CMD_SET_FEATURES = 0xEF, 163 ATA_CMD_SET_FEATURES = 0xEF,
164 ATA_CMD_SET_MULTI = 0xC6,
154 ATA_CMD_PACKET = 0xA0, 165 ATA_CMD_PACKET = 0xA0,
155 ATA_CMD_VERIFY = 0x40, 166 ATA_CMD_VERIFY = 0x40,
156 ATA_CMD_VERIFY_EXT = 0x42, 167 ATA_CMD_VERIFY_EXT = 0x42,
@@ -162,6 +173,8 @@ enum {
162 ATA_CMD_SET_MAX = 0xF9, 173 ATA_CMD_SET_MAX = 0xF9,
163 ATA_CMD_SET_MAX_EXT = 0x37, 174 ATA_CMD_SET_MAX_EXT = 0x37,
164 ATA_CMD_READ_LOG_EXT = 0x2f, 175 ATA_CMD_READ_LOG_EXT = 0x2f,
176 ATA_CMD_PMP_READ = 0xE4,
177 ATA_CMD_PMP_WRITE = 0xE8,
165 178
166 /* READ_LOG_EXT pages */ 179 /* READ_LOG_EXT pages */
167 ATA_LOG_SATA_NCQ = 0x10, 180 ATA_LOG_SATA_NCQ = 0x10,
@@ -210,6 +223,28 @@ enum {
210 0=to device, 1=to host */ 223 0=to device, 1=to host */
211 ATAPI_CDB_LEN = 16, 224 ATAPI_CDB_LEN = 16,
212 225
226 /* PMP stuff */
227 SATA_PMP_MAX_PORTS = 15,
228 SATA_PMP_CTRL_PORT = 15,
229
230 SATA_PMP_GSCR_DWORDS = 128,
231 SATA_PMP_GSCR_PROD_ID = 0,
232 SATA_PMP_GSCR_REV = 1,
233 SATA_PMP_GSCR_PORT_INFO = 2,
234 SATA_PMP_GSCR_ERROR = 32,
235 SATA_PMP_GSCR_ERROR_EN = 33,
236 SATA_PMP_GSCR_FEAT = 64,
237 SATA_PMP_GSCR_FEAT_EN = 96,
238
239 SATA_PMP_PSCR_STATUS = 0,
240 SATA_PMP_PSCR_ERROR = 1,
241 SATA_PMP_PSCR_CONTROL = 2,
242
243 SATA_PMP_FEAT_BIST = (1 << 0),
244 SATA_PMP_FEAT_PMREQ = (1 << 1),
245 SATA_PMP_FEAT_DYNSSC = (1 << 2),
246 SATA_PMP_FEAT_NOTIFY = (1 << 3),
247
213 /* cable types */ 248 /* cable types */
214 ATA_CBL_NONE = 0, 249 ATA_CBL_NONE = 0,
215 ATA_CBL_PATA40 = 1, 250 ATA_CBL_PATA40 = 1,
@@ -249,7 +284,7 @@ enum ata_tf_protocols {
249 /* ATA taskfile protocols */ 284 /* ATA taskfile protocols */
250 ATA_PROT_UNKNOWN, /* unknown/invalid */ 285 ATA_PROT_UNKNOWN, /* unknown/invalid */
251 ATA_PROT_NODATA, /* no data */ 286 ATA_PROT_NODATA, /* no data */
252 ATA_PROT_PIO, /* PIO single sector */ 287 ATA_PROT_PIO, /* PIO data xfer */
253 ATA_PROT_DMA, /* DMA */ 288 ATA_PROT_DMA, /* DMA */
254 ATA_PROT_NCQ, /* NCQ */ 289 ATA_PROT_NCQ, /* NCQ */
255 ATA_PROT_ATAPI, /* packet command, PIO data xfer*/ 290 ATA_PROT_ATAPI, /* packet command, PIO data xfer*/
@@ -416,4 +451,9 @@ static inline int lba_48_ok(u64 block, u32 n_block)
416 return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536); 451 return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536);
417} 452}
418 453
454#define sata_pmp_gscr_vendor(gscr) ((gscr)[SATA_PMP_GSCR_PROD_ID] & 0xffff)
455#define sata_pmp_gscr_devid(gscr) ((gscr)[SATA_PMP_GSCR_PROD_ID] >> 16)
456#define sata_pmp_gscr_rev(gscr) (((gscr)[SATA_PMP_GSCR_REV] >> 8) & 0xff)
457#define sata_pmp_gscr_ports(gscr) ((gscr)[SATA_PMP_GSCR_PORT_INFO] & 0xf)
458
419#endif /* __LINUX_ATA_H__ */ 459#endif /* __LINUX_ATA_H__ */
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h
index 93bfb0beb62a..8ff274933948 100644
--- a/include/linux/attribute_container.h
+++ b/include/linux/attribute_container.h
@@ -12,7 +12,6 @@
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/klist.h> 14#include <linux/klist.h>
15#include <linux/spinlock.h>
16 15
17struct attribute_container { 16struct attribute_container {
18 struct list_head node; 17 struct list_head node;
diff --git a/include/linux/audit.h b/include/linux/audit.h
index fccc6e50298a..8ca7ca0b47f0 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -63,9 +63,12 @@
63#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */ 63#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */
64#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */ 64#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */
65#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */ 65#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */
66#define AUDIT_TTY_GET 1014 /* Get TTY auditing status */
67#define AUDIT_TTY_SET 1015 /* Set TTY auditing status */
66 68
67#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */ 69#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */
68#define AUDIT_USER_AVC 1107 /* We filter this differently */ 70#define AUDIT_USER_AVC 1107 /* We filter this differently */
71#define AUDIT_USER_TTY 1124 /* Non-ICANON TTY input meaning */
69#define AUDIT_LAST_USER_MSG 1199 72#define AUDIT_LAST_USER_MSG 1199
70#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */ 73#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */
71#define AUDIT_LAST_USER_MSG2 2999 74#define AUDIT_LAST_USER_MSG2 2999
@@ -92,6 +95,7 @@
92#define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */ 95#define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */
93#define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */ 96#define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */
94#define AUDIT_OBJ_PID 1318 /* ptrace target */ 97#define AUDIT_OBJ_PID 1318 /* ptrace target */
98#define AUDIT_TTY 1319 /* Input on an administrative TTY */
95 99
96#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 100#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
97#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ 101#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
@@ -289,6 +293,10 @@ struct audit_status {
289 __u32 backlog; /* messages waiting in queue */ 293 __u32 backlog; /* messages waiting in queue */
290}; 294};
291 295
296struct audit_tty_status {
297 __u32 enabled; /* 1 = enabled, 0 = disabled */
298};
299
292/* audit_rule_data supports filter rules with both integer and string 300/* audit_rule_data supports filter rules with both integer and string
293 * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and 301 * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and
294 * AUDIT_LIST_RULES requests. 302 * AUDIT_LIST_RULES requests.
@@ -515,11 +523,13 @@ extern void audit_log_d_path(struct audit_buffer *ab,
515 const char *prefix, 523 const char *prefix,
516 struct dentry *dentry, 524 struct dentry *dentry,
517 struct vfsmount *vfsmnt); 525 struct vfsmount *vfsmnt);
526extern void audit_log_lost(const char *message);
518 /* Private API (for audit.c only) */ 527 /* Private API (for audit.c only) */
519extern int audit_filter_user(struct netlink_skb_parms *cb, int type); 528extern int audit_filter_user(struct netlink_skb_parms *cb, int type);
520extern int audit_filter_type(int type); 529extern int audit_filter_type(int type);
521extern int audit_receive_filter(int type, int pid, int uid, int seq, 530extern int audit_receive_filter(int type, int pid, int uid, int seq,
522 void *data, size_t datasz, uid_t loginuid, u32 sid); 531 void *data, size_t datasz, uid_t loginuid, u32 sid);
532extern int audit_enabled;
523#else 533#else
524#define audit_log(c,g,t,f,...) do { ; } while (0) 534#define audit_log(c,g,t,f,...) do { ; } while (0)
525#define audit_log_start(c,g,t) ({ NULL; }) 535#define audit_log_start(c,g,t) ({ NULL; })
@@ -530,6 +540,7 @@ extern int audit_receive_filter(int type, int pid, int uid, int seq,
530#define audit_log_untrustedstring(a,s) do { ; } while (0) 540#define audit_log_untrustedstring(a,s) do { ; } while (0)
531#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) 541#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0)
532#define audit_log_d_path(b,p,d,v) do { ; } while (0) 542#define audit_log_d_path(b,p,d,v) do { ; } while (0)
543#define audit_enabled 0
533#endif 544#endif
534#endif 545#endif
535#endif 546#endif
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index f2542c24b328..7011d6255593 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -93,7 +93,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
93void clear_bdi_congested(struct backing_dev_info *bdi, int rw); 93void clear_bdi_congested(struct backing_dev_info *bdi, int rw);
94void set_bdi_congested(struct backing_dev_info *bdi, int rw); 94void set_bdi_congested(struct backing_dev_info *bdi, int rw);
95long congestion_wait(int rw, long timeout); 95long congestion_wait(int rw, long timeout);
96long congestion_wait_interruptible(int rw, long timeout);
97void congestion_end(int rw); 96void congestion_end(int rw);
98 97
99#define bdi_cap_writeback_dirty(bdi) \ 98#define bdi_cap_writeback_dirty(bdi) \
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index e1a708337be3..91c8c07fe8b7 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -6,11 +6,13 @@
6struct pt_regs; 6struct pt_regs;
7 7
8/* 8/*
9 * MAX_ARG_PAGES defines the number of pages allocated for arguments 9 * These are the maximum length and maximum number of strings passed to the
10 * and envelope for the new program. 32 should suffice, this gives 10 * execve() system call. MAX_ARG_STRLEN is essentially random but serves to
11 * a maximum env+arg of 128kB w/4KB pages! 11 * prevent the kernel from being unduly impacted by misaddressed pointers.
12 * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
12 */ 13 */
13#define MAX_ARG_PAGES 32 14#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
15#define MAX_ARG_STRINGS 0x7FFFFFFF
14 16
15/* sizeof(linux_binprm->buf) */ 17/* sizeof(linux_binprm->buf) */
16#define BINPRM_BUF_SIZE 128 18#define BINPRM_BUF_SIZE 128
@@ -24,7 +26,12 @@ struct pt_regs;
24 */ 26 */
25struct linux_binprm{ 27struct linux_binprm{
26 char buf[BINPRM_BUF_SIZE]; 28 char buf[BINPRM_BUF_SIZE];
29#ifdef CONFIG_MMU
30 struct vm_area_struct *vma;
31#else
32# define MAX_ARG_PAGES 32
27 struct page *page[MAX_ARG_PAGES]; 33 struct page *page[MAX_ARG_PAGES];
34#endif
28 struct mm_struct *mm; 35 struct mm_struct *mm;
29 unsigned long p; /* current top of mem */ 36 unsigned long p; /* current top of mem */
30 int sh_bang; 37 int sh_bang;
@@ -40,6 +47,7 @@ struct linux_binprm{
40 unsigned interp_flags; 47 unsigned interp_flags;
41 unsigned interp_data; 48 unsigned interp_data;
42 unsigned long loader, exec; 49 unsigned long loader, exec;
50 unsigned long argv_len;
43}; 51};
44 52
45#define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0 53#define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0
@@ -68,7 +76,7 @@ extern int register_binfmt(struct linux_binfmt *);
68extern int unregister_binfmt(struct linux_binfmt *); 76extern int unregister_binfmt(struct linux_binfmt *);
69 77
70extern int prepare_binprm(struct linux_binprm *); 78extern int prepare_binprm(struct linux_binprm *);
71extern void remove_arg_zero(struct linux_binprm *); 79extern int __must_check remove_arg_zero(struct linux_binprm *);
72extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); 80extern int search_binary_handler(struct linux_binprm *,struct pt_regs *);
73extern int flush_old_exec(struct linux_binprm * bprm); 81extern int flush_old_exec(struct linux_binprm * bprm);
74 82
@@ -85,6 +93,7 @@ extern int suid_dumpable;
85extern int setup_arg_pages(struct linux_binprm * bprm, 93extern int setup_arg_pages(struct linux_binprm * bprm,
86 unsigned long stack_top, 94 unsigned long stack_top,
87 int executable_stack); 95 int executable_stack);
96extern int bprm_mm_init(struct linux_binprm *bprm);
88extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); 97extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
89extern void compute_creds(struct linux_binprm *binprm); 98extern void compute_creds(struct linux_binprm *binprm);
90extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); 99extern int do_coredump(long signr, int exit_code, struct pt_regs * regs);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index db5b00a792f5..f78965fc6426 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -14,6 +14,7 @@
14#include <linux/bio.h> 14#include <linux/bio.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/stringify.h> 16#include <linux/stringify.h>
17#include <linux/bsg.h>
17 18
18#include <asm/scatterlist.h> 19#include <asm/scatterlist.h>
19 20
@@ -41,6 +42,8 @@ struct elevator_queue;
41typedef struct elevator_queue elevator_t; 42typedef struct elevator_queue elevator_t;
42struct request_pm_state; 43struct request_pm_state;
43struct blk_trace; 44struct blk_trace;
45struct request;
46struct sg_io_hdr;
44 47
45#define BLKDEV_MIN_RQ 4 48#define BLKDEV_MIN_RQ 4
46#define BLKDEV_MAX_RQ 128 /* Default maximum */ 49#define BLKDEV_MAX_RQ 128 /* Default maximum */
@@ -314,6 +317,9 @@ struct request {
314 */ 317 */
315 rq_end_io_fn *end_io; 318 rq_end_io_fn *end_io;
316 void *end_io_data; 319 void *end_io_data;
320
321 /* for bidi */
322 struct request *next_rq;
317}; 323};
318 324
319/* 325/*
@@ -468,6 +474,10 @@ struct request_queue
468 unsigned int bi_size; 474 unsigned int bi_size;
469 475
470 struct mutex sysfs_lock; 476 struct mutex sysfs_lock;
477
478#if defined(CONFIG_BLK_DEV_BSG)
479 struct bsg_class_device bsg_dev;
480#endif
471}; 481};
472 482
473#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 483#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
@@ -479,6 +489,7 @@ struct request_queue
479#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ 489#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */
480#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ 490#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */
481#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ 491#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */
492#define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */
482 493
483enum { 494enum {
484 /* 495 /*
@@ -543,6 +554,7 @@ enum {
543#define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) 554#define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED)
544#define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) 555#define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER)
545#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) 556#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA)
557#define blk_bidi_rq(rq) ((rq)->next_rq != NULL)
546 558
547#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) 559#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
548 560
@@ -607,7 +619,12 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn;
607#define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT) 619#define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT)
608#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD) 620#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD)
609 621
610#ifdef CONFIG_MMU 622/*
623 * default timeout for SG_IO if none specified
624 */
625#define BLK_DEFAULT_SG_TIMEOUT (60 * HZ)
626
627#ifdef CONFIG_BOUNCE
611extern int init_emergency_isa_pool(void); 628extern int init_emergency_isa_pool(void);
612extern void blk_queue_bounce(request_queue_t *q, struct bio **bio); 629extern void blk_queue_bounce(request_queue_t *q, struct bio **bio);
613#else 630#else
@@ -637,7 +654,8 @@ extern void blk_requeue_request(request_queue_t *, struct request *);
637extern void blk_plug_device(request_queue_t *); 654extern void blk_plug_device(request_queue_t *);
638extern int blk_remove_plug(request_queue_t *); 655extern int blk_remove_plug(request_queue_t *);
639extern void blk_recount_segments(request_queue_t *, struct bio *); 656extern void blk_recount_segments(request_queue_t *, struct bio *);
640extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); 657extern int scsi_cmd_ioctl(struct file *, struct request_queue *,
658 struct gendisk *, unsigned int, void __user *);
641extern int sg_scsi_ioctl(struct file *, struct request_queue *, 659extern int sg_scsi_ioctl(struct file *, struct request_queue *,
642 struct gendisk *, struct scsi_ioctl_command __user *); 660 struct gendisk *, struct scsi_ioctl_command __user *);
643 661
@@ -680,6 +698,12 @@ extern int blk_execute_rq(request_queue_t *, struct gendisk *,
680 struct request *, int); 698 struct request *, int);
681extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, 699extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *,
682 struct request *, int, rq_end_io_fn *); 700 struct request *, int, rq_end_io_fn *);
701extern int blk_fill_sghdr_rq(request_queue_t *, struct request *,
702 struct sg_io_hdr *, int);
703extern int blk_unmap_sghdr_rq(struct request *, struct sg_io_hdr *);
704extern int blk_complete_sghdr_rq(struct request *, struct sg_io_hdr *,
705 struct bio *);
706extern int blk_verify_command(unsigned char *, int);
683 707
684static inline request_queue_t *bdev_get_queue(struct block_device *bdev) 708static inline request_queue_t *bdev_get_queue(struct block_device *bdev)
685{ 709{
@@ -868,11 +892,6 @@ void kblockd_flush_work(struct work_struct *work);
868 */ 892 */
869#define buffer_heads_over_limit 0 893#define buffer_heads_over_limit 0
870 894
871static inline long blk_congestion_wait(int rw, long timeout)
872{
873 return io_schedule_timeout(timeout);
874}
875
876static inline long nr_blockdev_pages(void) 895static inline long nr_blockdev_pages(void)
877{ 896{
878 return 0; 897 return 0;
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
new file mode 100644
index 000000000000..8547b10c388b
--- /dev/null
+++ b/include/linux/bsg.h
@@ -0,0 +1,69 @@
1#ifndef BSG_H
2#define BSG_H
3
4#define BSG_PROTOCOL_SCSI 0
5
6#define BSG_SUB_PROTOCOL_SCSI_CMD 0
7#define BSG_SUB_PROTOCOL_SCSI_TMF 1
8#define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2
9
10struct sg_io_v4 {
11 __s32 guard; /* [i] 'Q' to differentiate from v3 */
12 __u32 protocol; /* [i] 0 -> SCSI , .... */
13 __u32 subprotocol; /* [i] 0 -> SCSI command, 1 -> SCSI task
14 management function, .... */
15
16 __u32 request_len; /* [i] in bytes */
17 __u64 request; /* [i], [*i] {SCSI: cdb} */
18 __u32 request_attr; /* [i] {SCSI: task attribute} */
19 __u32 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
20 __u32 request_priority; /* [i] {SCSI: task priority} */
21 __u32 max_response_len; /* [i] in bytes */
22 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */
23
24 /* "din_" for data in (from device); "dout_" for data out (to device) */
25 __u32 dout_xfer_len; /* [i] bytes to be transferred to device */
26 __u32 din_xfer_len; /* [i] bytes to be transferred from device */
27 __u64 dout_xferp; /* [i], [*i] */
28 __u64 din_xferp; /* [i], [*o] */
29
30 __u32 timeout; /* [i] units: millisecond */
31 __u32 flags; /* [i] bit mask */
32 __u64 usr_ptr; /* [i->o] unused internally */
33 __u32 spare_in; /* [i] */
34
35 __u32 driver_status; /* [o] 0 -> ok */
36 __u32 transport_status; /* [o] 0 -> ok */
37 __u32 device_status; /* [o] {SCSI: command completion status} */
38 __u32 retry_delay; /* [o] {SCSI: status auxiliary information} */
39 __u32 info; /* [o] additional information */
40 __u32 duration; /* [o] time to complete, in milliseconds */
41 __u32 response_len; /* [o] bytes of response actually written */
42 __s32 din_resid; /* [o] actual_din_xfer_len - din_xfer_len */
43 __u32 generated_tag; /* [o] {SCSI: task tag that transport chose} */
44 __u32 spare_out; /* [o] */
45
46 __u32 padding;
47};
48
49#ifdef __KERNEL__
50
51#if defined(CONFIG_BLK_DEV_BSG)
52struct bsg_class_device {
53 struct class_device *class_dev;
54 struct device *dev;
55 int minor;
56 struct list_head list;
57 struct request_queue *queue;
58};
59
60extern int bsg_register_queue(struct request_queue *, const char *);
61extern void bsg_unregister_queue(struct request_queue *);
62#else
63#define bsg_register_queue(disk, name) (0)
64#define bsg_unregister_queue(disk) do { } while (0)
65#endif
66
67#endif /* __KERNEL__ */
68
69#endif
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 5c6e12853a9b..35cadad84b14 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -209,6 +209,8 @@ int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*,
209int generic_cont_expand(struct inode *inode, loff_t size); 209int generic_cont_expand(struct inode *inode, loff_t size);
210int generic_cont_expand_simple(struct inode *inode, loff_t size); 210int generic_cont_expand_simple(struct inode *inode, loff_t size);
211int block_commit_write(struct page *page, unsigned from, unsigned to); 211int block_commit_write(struct page *page, unsigned from, unsigned to);
212int block_page_mkwrite(struct vm_area_struct *vma, struct page *page,
213 get_block_t get_block);
212void block_sync_page(struct page *); 214void block_sync_page(struct page *);
213sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); 215sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *);
214int generic_commit_write(struct file *, struct page *, unsigned, unsigned); 216int generic_commit_write(struct file *, struct page *, unsigned, unsigned);
diff --git a/include/linux/bug.h b/include/linux/bug.h
index 42aa0a54b6f4..54398d2c6d8d 100644
--- a/include/linux/bug.h
+++ b/include/linux/bug.h
@@ -10,6 +10,8 @@ enum bug_trap_type {
10 BUG_TRAP_TYPE_BUG = 2, 10 BUG_TRAP_TYPE_BUG = 2,
11}; 11};
12 12
13struct pt_regs;
14
13#ifdef CONFIG_GENERIC_BUG 15#ifdef CONFIG_GENERIC_BUG
14#include <asm-generic/bug.h> 16#include <asm-generic/bug.h>
15 17
@@ -20,7 +22,7 @@ static inline int is_warning_bug(const struct bug_entry *bug)
20 22
21const struct bug_entry *find_bug(unsigned long bugaddr); 23const struct bug_entry *find_bug(unsigned long bugaddr);
22 24
23enum bug_trap_type report_bug(unsigned long bug_addr); 25enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs);
24 26
25int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, 27int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
26 struct module *); 28 struct module *);
@@ -31,7 +33,8 @@ int is_valid_bugaddr(unsigned long addr);
31 33
32#else /* !CONFIG_GENERIC_BUG */ 34#else /* !CONFIG_GENERIC_BUG */
33 35
34static inline enum bug_trap_type report_bug(unsigned long bug_addr) 36static inline enum bug_trap_type report_bug(unsigned long bug_addr,
37 struct pt_regs *regs)
35{ 38{
36 return BUG_TRAP_TYPE_BUG; 39 return BUG_TRAP_TYPE_BUG;
37} 40}
diff --git a/include/linux/capability.h b/include/linux/capability.h
index bbf8df7de28f..2dfa58555934 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -44,7 +44,6 @@ typedef struct __user_cap_data_struct {
44 44
45#ifdef __KERNEL__ 45#ifdef __KERNEL__
46 46
47#include <linux/spinlock.h>
48#include <asm/current.h> 47#include <asm/current.h>
49 48
50/* #define STRICT_CAP_T_TYPECHECKS */ 49/* #define STRICT_CAP_T_TYPECHECKS */
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
index f50f04bdbc16..2b641b176e7f 100644
--- a/include/linux/cdrom.h
+++ b/include/linux/cdrom.h
@@ -414,8 +414,8 @@ struct cdrom_generic_command
414#define CDO_CHECK_TYPE 0x10 /* check type on open for data */ 414#define CDO_CHECK_TYPE 0x10 /* check type on open for data */
415 415
416/* Special codes used when specifying changer slots. */ 416/* Special codes used when specifying changer slots. */
417#define CDSL_NONE ((int) (~0U>>1)-1) 417#define CDSL_NONE (INT_MAX-1)
418#define CDSL_CURRENT ((int) (~0U>>1)) 418#define CDSL_CURRENT INT_MAX
419 419
420/* For partition based multisession access. IDE can handle 64 partitions 420/* For partition based multisession access. IDE can handle 64 partitions
421 * per drive - SCSI CD-ROM's use minors to differentiate between the 421 * per drive - SCSI CD-ROM's use minors to differentiate between the
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 8486e78f7335..e0bd46eb2414 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -23,6 +23,7 @@ enum clock_event_mode {
23 CLOCK_EVT_MODE_SHUTDOWN, 23 CLOCK_EVT_MODE_SHUTDOWN,
24 CLOCK_EVT_MODE_PERIODIC, 24 CLOCK_EVT_MODE_PERIODIC,
25 CLOCK_EVT_MODE_ONESHOT, 25 CLOCK_EVT_MODE_ONESHOT,
26 CLOCK_EVT_MODE_RESUME,
26}; 27};
27 28
28/* Clock event notification values */ 29/* Clock event notification values */
@@ -119,10 +120,6 @@ extern void clockevents_register_device(struct clock_event_device *dev);
119 120
120extern void clockevents_exchange_device(struct clock_event_device *old, 121extern void clockevents_exchange_device(struct clock_event_device *old,
121 struct clock_event_device *new); 122 struct clock_event_device *new);
122extern
123struct clock_event_device *clockevents_request_device(unsigned int features,
124 cpumask_t cpumask);
125extern void clockevents_release_device(struct clock_event_device *dev);
126extern void clockevents_set_mode(struct clock_event_device *dev, 123extern void clockevents_set_mode(struct clock_event_device *dev,
127 enum clock_event_mode mode); 124 enum clock_event_mode mode);
128extern int clockevents_register_notifier(struct notifier_block *nb); 125extern int clockevents_register_notifier(struct notifier_block *nb);
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index bf297b03a4e4..16ea3374dddf 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -67,6 +67,12 @@ struct clocksource {
67 unsigned long flags; 67 unsigned long flags;
68 cycle_t (*vread)(void); 68 cycle_t (*vread)(void);
69 void (*resume)(void); 69 void (*resume)(void);
70#ifdef CONFIG_IA64
71 void *fsys_mmio; /* used by fsyscall asm code */
72#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr))
73#else
74#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0)
75#endif
70 76
71 /* timekeeping specific data, ignore */ 77 /* timekeeping specific data, ignore */
72 cycle_t cycle_interval; 78 cycle_t cycle_interval;
diff --git a/include/linux/cobalt-nvram.h b/include/linux/cobalt-nvram.h
deleted file mode 100644
index ea429562ff36..000000000000
--- a/include/linux/cobalt-nvram.h
+++ /dev/null
@@ -1,109 +0,0 @@
1/*
2 * $Id: cobalt-nvram.h,v 1.20 2001/10/17 23:16:55 thockin Exp $
3 * cobalt-nvram.h : defines for the various fields in the cobalt NVRAM
4 *
5 * Copyright 2001,2002 Sun Microsystems, Inc.
6 */
7
8#ifndef COBALT_NVRAM_H
9#define COBALT_NVRAM_H
10
11#include <linux/nvram.h>
12
13#define COBT_CMOS_INFO_MAX 0x7f /* top address allowed */
14#define COBT_CMOS_BIOS_DRIVE_INFO 0x12 /* drive info would go here */
15
16#define COBT_CMOS_CKS_START NVRAM_OFFSET(0x0e)
17#define COBT_CMOS_CKS_END NVRAM_OFFSET(0x7f)
18
19/* flag bytes - 16 flags for now, leave room for more */
20#define COBT_CMOS_FLAG_BYTE_0 NVRAM_OFFSET(0x10)
21#define COBT_CMOS_FLAG_BYTE_1 NVRAM_OFFSET(0x11)
22
23/* flags in flag bytes - up to 16 */
24#define COBT_CMOS_FLAG_MIN 0x0001
25#define COBT_CMOS_CONSOLE_FLAG 0x0001 /* console on/off */
26#define COBT_CMOS_DEBUG_FLAG 0x0002 /* ROM debug messages */
27#define COBT_CMOS_AUTO_PROMPT_FLAG 0x0004 /* boot to ROM prompt? */
28#define COBT_CMOS_CLEAN_BOOT_FLAG 0x0008 /* set by a clean shutdown */
29#define COBT_CMOS_HW_NOPROBE_FLAG 0x0010 /* go easy on the probing */
30#define COBT_CMOS_SYSFAULT_FLAG 0x0020 /* system fault detected */
31#define COBT_CMOS_OOPSPANIC_FLAG 0x0040 /* panic on oops */
32#define COBT_CMOS_DELAY_CACHE_FLAG 0x0080 /* delay cache initialization */
33#define COBT_CMOS_NOLOGO_FLAG 0x0100 /* hide "C" logo @ boot */
34#define COBT_CMOS_VERSION_FLAG 0x0200 /* the version field is valid */
35#define COBT_CMOS_FLAG_MAX 0x0200
36
37/* leave byte 0x12 blank - Linux looks for drive info here */
38
39/* CMOS structure version, valid if COBT_CMOS_VERSION_FLAG is true */
40#define COBT_CMOS_VERSION NVRAM_OFFSET(0x13)
41#define COBT_CMOS_VER_BTOCODE 1 /* min. version needed for btocode */
42
43/* index of default boot method */
44#define COBT_CMOS_BOOT_METHOD NVRAM_OFFSET(0x20)
45#define COBT_CMOS_BOOT_METHOD_DISK 0
46#define COBT_CMOS_BOOT_METHOD_ROM 1
47#define COBT_CMOS_BOOT_METHOD_NET 2
48
49#define COBT_CMOS_BOOT_DEV_MIN NVRAM_OFFSET(0x21)
50/* major #, minor # of first through fourth boot device */
51#define COBT_CMOS_BOOT_DEV0_MAJ NVRAM_OFFSET(0x21)
52#define COBT_CMOS_BOOT_DEV0_MIN NVRAM_OFFSET(0x22)
53#define COBT_CMOS_BOOT_DEV1_MAJ NVRAM_OFFSET(0x23)
54#define COBT_CMOS_BOOT_DEV1_MIN NVRAM_OFFSET(0x24)
55#define COBT_CMOS_BOOT_DEV2_MAJ NVRAM_OFFSET(0x25)
56#define COBT_CMOS_BOOT_DEV2_MIN NVRAM_OFFSET(0x26)
57#define COBT_CMOS_BOOT_DEV3_MAJ NVRAM_OFFSET(0x27)
58#define COBT_CMOS_BOOT_DEV3_MIN NVRAM_OFFSET(0x28)
59#define COBT_CMOS_BOOT_DEV_MAX NVRAM_OFFSET(0x28)
60
61/* checksum of bytes 0xe-0x7f */
62#define COBT_CMOS_CHECKSUM NVRAM_OFFSET(0x2e)
63
64/* running uptime counter, units of 5 minutes (32 bits =~ 41000 years) */
65#define COBT_CMOS_UPTIME_0 NVRAM_OFFSET(0x30)
66#define COBT_CMOS_UPTIME_1 NVRAM_OFFSET(0x31)
67#define COBT_CMOS_UPTIME_2 NVRAM_OFFSET(0x32)
68#define COBT_CMOS_UPTIME_3 NVRAM_OFFSET(0x33)
69
70/* count of successful boots (32 bits) */
71#define COBT_CMOS_BOOTCOUNT_0 NVRAM_OFFSET(0x38)
72#define COBT_CMOS_BOOTCOUNT_1 NVRAM_OFFSET(0x39)
73#define COBT_CMOS_BOOTCOUNT_2 NVRAM_OFFSET(0x3a)
74#define COBT_CMOS_BOOTCOUNT_3 NVRAM_OFFSET(0x3b)
75
76/* 13 bytes: system serial number, same as on the back of the system */
77#define COBT_CMOS_SYS_SERNUM_LEN 13
78#define COBT_CMOS_SYS_SERNUM_0 NVRAM_OFFSET(0x40)
79#define COBT_CMOS_SYS_SERNUM_1 NVRAM_OFFSET(0x41)
80#define COBT_CMOS_SYS_SERNUM_2 NVRAM_OFFSET(0x42)
81#define COBT_CMOS_SYS_SERNUM_3 NVRAM_OFFSET(0x43)
82#define COBT_CMOS_SYS_SERNUM_4 NVRAM_OFFSET(0x44)
83#define COBT_CMOS_SYS_SERNUM_5 NVRAM_OFFSET(0x45)
84#define COBT_CMOS_SYS_SERNUM_6 NVRAM_OFFSET(0x46)
85#define COBT_CMOS_SYS_SERNUM_7 NVRAM_OFFSET(0x47)
86#define COBT_CMOS_SYS_SERNUM_8 NVRAM_OFFSET(0x48)
87#define COBT_CMOS_SYS_SERNUM_9 NVRAM_OFFSET(0x49)
88#define COBT_CMOS_SYS_SERNUM_10 NVRAM_OFFSET(0x4a)
89#define COBT_CMOS_SYS_SERNUM_11 NVRAM_OFFSET(0x4b)
90#define COBT_CMOS_SYS_SERNUM_12 NVRAM_OFFSET(0x4c)
91/* checksum for serial num - 1 byte */
92#define COBT_CMOS_SYS_SERNUM_CSUM NVRAM_OFFSET(0x4f)
93
94#define COBT_CMOS_ROM_REV_MAJ NVRAM_OFFSET(0x50)
95#define COBT_CMOS_ROM_REV_MIN NVRAM_OFFSET(0x51)
96#define COBT_CMOS_ROM_REV_REV NVRAM_OFFSET(0x52)
97
98#define COBT_CMOS_BTO_CODE_0 NVRAM_OFFSET(0x53)
99#define COBT_CMOS_BTO_CODE_1 NVRAM_OFFSET(0x54)
100#define COBT_CMOS_BTO_CODE_2 NVRAM_OFFSET(0x55)
101#define COBT_CMOS_BTO_CODE_3 NVRAM_OFFSET(0x56)
102
103#define COBT_CMOS_BTO_IP_CSUM NVRAM_OFFSET(0x57)
104#define COBT_CMOS_BTO_IP_0 NVRAM_OFFSET(0x58)
105#define COBT_CMOS_BTO_IP_1 NVRAM_OFFSET(0x59)
106#define COBT_CMOS_BTO_IP_2 NVRAM_OFFSET(0x5a)
107#define COBT_CMOS_BTO_IP_3 NVRAM_OFFSET(0x5b)
108
109#endif /* COBALT_NVRAM_H */
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index e4ac016ad272..1c47a34aa794 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -36,16 +36,12 @@ extern const struct file_operations coda_ioctl_operations;
36 36
37/* operations shared over more than one file */ 37/* operations shared over more than one file */
38int coda_open(struct inode *i, struct file *f); 38int coda_open(struct inode *i, struct file *f);
39int coda_flush(struct file *f, fl_owner_t id);
40int coda_release(struct inode *i, struct file *f); 39int coda_release(struct inode *i, struct file *f);
41int coda_permission(struct inode *inode, int mask, struct nameidata *nd); 40int coda_permission(struct inode *inode, int mask, struct nameidata *nd);
42int coda_revalidate_inode(struct dentry *); 41int coda_revalidate_inode(struct dentry *);
43int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); 42int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *);
44int coda_setattr(struct dentry *, struct iattr *); 43int coda_setattr(struct dentry *, struct iattr *);
45 44
46/* global variables */
47extern int coda_fake_statfs;
48
49/* this file: heloers */ 45/* this file: heloers */
50static __inline__ struct CodaFid *coda_i2f(struct inode *); 46static __inline__ struct CodaFid *coda_i2f(struct inode *);
51static __inline__ char *coda_i2s(struct inode *); 47static __inline__ char *coda_i2s(struct inode *);
diff --git a/include/linux/coda_proc.h b/include/linux/coda_proc.h
deleted file mode 100644
index 0dc1b0458e75..000000000000
--- a/include/linux/coda_proc.h
+++ /dev/null
@@ -1,76 +0,0 @@
1/*
2 * coda_statis.h
3 *
4 * CODA operation statistics
5 *
6 * (c) March, 1998
7 * by Michihiro Kuramochi, Zhenyu Xia and Zhanyong Wan
8 * zhanyong.wan@yale.edu
9 *
10 */
11
12#ifndef _CODA_PROC_H
13#define _CODA_PROC_H
14
15void coda_sysctl_init(void);
16void coda_sysctl_clean(void);
17
18#include <linux/sysctl.h>
19#include <linux/coda_fs_i.h>
20#include <linux/coda.h>
21
22/* these four files are presented to show the result of the statistics:
23 *
24 * /proc/fs/coda/vfs_stats
25 * cache_inv_stats
26 *
27 * these four files are presented to reset the statistics to 0:
28 *
29 * /proc/sys/coda/vfs_stats
30 * cache_inv_stats
31 */
32
33/* VFS operation statistics */
34struct coda_vfs_stats
35{
36 /* file operations */
37 int open;
38 int flush;
39 int release;
40 int fsync;
41
42 /* dir operations */
43 int readdir;
44
45 /* inode operations */
46 int create;
47 int lookup;
48 int link;
49 int unlink;
50 int symlink;
51 int mkdir;
52 int rmdir;
53 int rename;
54 int permission;
55
56 /* symlink operatoins*/
57 int follow_link;
58 int readlink;
59};
60
61/* cache invalidation statistics */
62struct coda_cache_inv_stats
63{
64 int flush;
65 int purge_user;
66 int zap_dir;
67 int zap_file;
68 int zap_vnode;
69 int purge_fid;
70 int replace;
71};
72
73/* these global variables hold the actual statistics data */
74extern struct coda_vfs_stats coda_vfs_stat;
75
76#endif /* _CODA_PROC_H */
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index b541bb3d1f4b..07ae8f846055 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -8,11 +8,6 @@
8 8
9struct kstatfs; 9struct kstatfs;
10 10
11struct coda_sb_info
12{
13 struct venus_comm *sbi_vcomm;
14};
15
16/* communication pending/processing queues */ 11/* communication pending/processing queues */
17struct venus_comm { 12struct venus_comm {
18 u_long vc_seq; 13 u_long vc_seq;
@@ -24,9 +19,9 @@ struct venus_comm {
24}; 19};
25 20
26 21
27static inline struct coda_sb_info *coda_sbp(struct super_block *sb) 22static inline struct venus_comm *coda_vcp(struct super_block *sb)
28{ 23{
29 return ((struct coda_sb_info *)((sb)->s_fs_info)); 24 return (struct venus_comm *)((sb)->s_fs_info);
30} 25}
31 26
32 27
@@ -38,9 +33,6 @@ int venus_setattr(struct super_block *, struct CodaFid *, struct coda_vattr *);
38int venus_lookup(struct super_block *sb, struct CodaFid *fid, 33int venus_lookup(struct super_block *sb, struct CodaFid *fid,
39 const char *name, int length, int *type, 34 const char *name, int length, int *type,
40 struct CodaFid *resfid); 35 struct CodaFid *resfid);
41int venus_store(struct super_block *sb, struct CodaFid *fid, int flags,
42 vuid_t uid);
43int venus_release(struct super_block *sb, struct CodaFid *fid, int flags);
44int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, 36int venus_close(struct super_block *sb, struct CodaFid *fid, int flags,
45 vuid_t uid); 37 vuid_t uid);
46int venus_open(struct super_block *sb, struct CodaFid *fid, int flags, 38int venus_open(struct super_block *sb, struct CodaFid *fid, int flags,
@@ -74,8 +66,6 @@ int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
74 66
75 67
76/* messages between coda filesystem in kernel and Venus */ 68/* messages between coda filesystem in kernel and Venus */
77extern int coda_hard;
78extern unsigned long coda_timeout;
79struct upc_req { 69struct upc_req {
80 struct list_head uc_chain; 70 struct list_head uc_chain;
81 caddr_t uc_data; 71 caddr_t uc_data;
@@ -85,7 +75,6 @@ struct upc_req {
85 u_short uc_opcode; /* copied from data to save lookup */ 75 u_short uc_opcode; /* copied from data to save lookup */
86 int uc_unique; 76 int uc_unique;
87 wait_queue_head_t uc_sleep; /* process' wait queue */ 77 wait_queue_head_t uc_sleep; /* process' wait queue */
88 unsigned long uc_posttime;
89}; 78};
90 79
91#define REQ_ASYNC 0x1 80#define REQ_ASYNC 0x1
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index a03e9398a6c2..14f7494280f0 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -23,3 +23,21 @@
23 * code 23 * code
24 */ 24 */
25#define uninitialized_var(x) x = x 25#define uninitialized_var(x) x = x
26
27#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 3)
28/* Mark functions as cold. gcc will assume any path leading to a call
29 to them will be unlikely. This means a lot of manual unlikely()s
30 are unnecessary now for any paths leading to the usual suspects
31 like BUG(), printk(), panic() etc. [but let's keep them for now for
32 older compilers]
33
34 Early snapshots of gcc 4.3 don't support this and we can't detect this
35 in the preprocessor, but we can live with this because they're unreleased.
36 Maketime probing would be overkill here.
37
38 gcc also has a __attribute__((__hot__)) to move hot functions into
39 a special section, but I don't see any sense in this right now in
40 the kernel context */
41#define __cold __attribute__((__cold__))
42
43#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 8287a72bb6a9..12a1291855e2 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -174,4 +174,13 @@ extern void __chk_io_ptr(const void __iomem *);
174# define __attribute_const__ /* unimplemented */ 174# define __attribute_const__ /* unimplemented */
175#endif 175#endif
176 176
177/*
178 * Tell gcc if a function is cold. The compiler will assume any path
179 * directly leading to the call is unlikely.
180 */
181
182#ifndef __cold
183#define __cold
184#endif
185
177#endif /* __LINUX_COMPILER_H */ 186#endif /* __LINUX_COMPILER_H */
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index fef6f3d0a4a7..8c6967f3fb11 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -40,9 +40,9 @@
40#include <linux/types.h> 40#include <linux/types.h>
41#include <linux/list.h> 41#include <linux/list.h>
42#include <linux/kref.h> 42#include <linux/kref.h>
43#include <linux/mutex.h>
43 44
44#include <asm/atomic.h> 45#include <asm/atomic.h>
45#include <asm/semaphore.h>
46 46
47#define CONFIGFS_ITEM_NAME_LEN 20 47#define CONFIGFS_ITEM_NAME_LEN 20
48 48
@@ -75,7 +75,6 @@ extern void config_item_init(struct config_item *);
75extern void config_item_init_type_name(struct config_item *item, 75extern void config_item_init_type_name(struct config_item *item,
76 const char *name, 76 const char *name,
77 struct config_item_type *type); 77 struct config_item_type *type);
78extern void config_item_cleanup(struct config_item *);
79 78
80extern struct config_item * config_item_get(struct config_item *); 79extern struct config_item * config_item_get(struct config_item *);
81extern void config_item_put(struct config_item *); 80extern void config_item_put(struct config_item *);
@@ -87,12 +86,10 @@ struct config_item_type {
87 struct configfs_attribute **ct_attrs; 86 struct configfs_attribute **ct_attrs;
88}; 87};
89 88
90
91/** 89/**
92 * group - a group of config_items of a specific type, belonging 90 * group - a group of config_items of a specific type, belonging
93 * to a specific subsystem. 91 * to a specific subsystem.
94 */ 92 */
95
96struct config_group { 93struct config_group {
97 struct config_item cg_item; 94 struct config_item cg_item;
98 struct list_head cg_children; 95 struct list_head cg_children;
@@ -100,13 +97,11 @@ struct config_group {
100 struct config_group **default_groups; 97 struct config_group **default_groups;
101}; 98};
102 99
103
104extern void config_group_init(struct config_group *group); 100extern void config_group_init(struct config_group *group);
105extern void config_group_init_type_name(struct config_group *group, 101extern void config_group_init_type_name(struct config_group *group,
106 const char *name, 102 const char *name,
107 struct config_item_type *type); 103 struct config_item_type *type);
108 104
109
110static inline struct config_group *to_config_group(struct config_item *item) 105static inline struct config_group *to_config_group(struct config_item *item)
111{ 106{
112 return item ? container_of(item,struct config_group,cg_item) : NULL; 107 return item ? container_of(item,struct config_group,cg_item) : NULL;
@@ -122,7 +117,8 @@ static inline void config_group_put(struct config_group *group)
122 config_item_put(&group->cg_item); 117 config_item_put(&group->cg_item);
123} 118}
124 119
125extern struct config_item *config_group_find_obj(struct config_group *, const char *); 120extern struct config_item *config_group_find_item(struct config_group *,
121 const char *);
126 122
127 123
128struct configfs_attribute { 124struct configfs_attribute {
@@ -131,6 +127,22 @@ struct configfs_attribute {
131 mode_t ca_mode; 127 mode_t ca_mode;
132}; 128};
133 129
130/*
131 * Users often need to create attribute structures for their configurable
132 * attributes, containing a configfs_attribute member and function pointers
133 * for the show() and store() operations on that attribute. They can use
134 * this macro (similar to sysfs' __ATTR) to make defining attributes easier.
135 */
136#define __CONFIGFS_ATTR(_name, _mode, _show, _store) \
137{ \
138 .attr = { \
139 .ca_name = __stringify(_name), \
140 .ca_mode = _mode, \
141 .ca_owner = THIS_MODULE, \
142 }, \
143 .show = _show, \
144 .store = _store, \
145}
134 146
135/* 147/*
136 * If allow_link() exists, the item can symlink(2) out to other 148 * If allow_link() exists, the item can symlink(2) out to other
@@ -157,12 +169,13 @@ struct configfs_group_operations {
157 struct config_item *(*make_item)(struct config_group *group, const char *name); 169 struct config_item *(*make_item)(struct config_group *group, const char *name);
158 struct config_group *(*make_group)(struct config_group *group, const char *name); 170 struct config_group *(*make_group)(struct config_group *group, const char *name);
159 int (*commit_item)(struct config_item *item); 171 int (*commit_item)(struct config_item *item);
172 void (*disconnect_notify)(struct config_group *group, struct config_item *item);
160 void (*drop_item)(struct config_group *group, struct config_item *item); 173 void (*drop_item)(struct config_group *group, struct config_item *item);
161}; 174};
162 175
163struct configfs_subsystem { 176struct configfs_subsystem {
164 struct config_group su_group; 177 struct config_group su_group;
165 struct semaphore su_sem; 178 struct mutex su_mutex;
166}; 179};
167 180
168static inline struct configfs_subsystem *to_configfs_subsystem(struct config_group *group) 181static inline struct configfs_subsystem *to_configfs_subsystem(struct config_group *group)
@@ -175,6 +188,11 @@ static inline struct configfs_subsystem *to_configfs_subsystem(struct config_gro
175int configfs_register_subsystem(struct configfs_subsystem *subsys); 188int configfs_register_subsystem(struct configfs_subsystem *subsys);
176void configfs_unregister_subsystem(struct configfs_subsystem *subsys); 189void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
177 190
191/* These functions can sleep and can alloc with GFP_KERNEL */
192/* WARNING: These cannot be called underneath configfs callbacks!! */
193int configfs_depend_item(struct configfs_subsystem *subsys, struct config_item *target);
194void configfs_undepend_item(struct configfs_subsystem *subsys, struct config_item *target);
195
178#endif /* __KERNEL__ */ 196#endif /* __KERNEL__ */
179 197
180#endif /* _CONFIGFS_H_ */ 198#endif /* _CONFIGFS_H_ */
diff --git a/include/linux/console.h b/include/linux/console.h
index 62ef6e11d0d2..56a7bcda49cb 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -15,7 +15,6 @@
15#define _LINUX_CONSOLE_H_ 1 15#define _LINUX_CONSOLE_H_ 1
16 16
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/spinlock.h>
19 18
20struct vc_data; 19struct vc_data;
21struct console_font_op; 20struct console_font_op;
@@ -99,6 +98,7 @@ struct console {
99 struct tty_driver *(*device)(struct console *, int *); 98 struct tty_driver *(*device)(struct console *, int *);
100 void (*unblank)(void); 99 void (*unblank)(void);
101 int (*setup)(struct console *, char *); 100 int (*setup)(struct console *, char *);
101 int (*early_setup)(void);
102 short flags; 102 short flags;
103 short index; 103 short index;
104 int cflag; 104 int cflag;
@@ -107,6 +107,7 @@ struct console {
107}; 107};
108 108
109extern int add_preferred_console(char *name, int idx, char *options); 109extern int add_preferred_console(char *name, int idx, char *options);
110extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options);
110extern void register_console(struct console *); 111extern void register_console(struct console *);
111extern int unregister_console(struct console *); 112extern int unregister_console(struct console *);
112extern struct console *console_drivers; 113extern struct console *console_drivers;
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index a461f76fb004..dc77fed7b285 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -9,6 +9,9 @@
9 * to achieve effects such as fast scrolling by changing the origin. 9 * to achieve effects such as fast scrolling by changing the origin.
10 */ 10 */
11 11
12#ifndef _LINUX_CONSOLE_STRUCT_H
13#define _LINUX_CONSOLE_STRUCT_H
14
12#include <linux/wait.h> 15#include <linux/wait.h>
13#include <linux/vt.h> 16#include <linux/vt.h>
14#include <linux/workqueue.h> 17#include <linux/workqueue.h>
@@ -130,3 +133,5 @@ extern void vc_SAK(struct work_struct *work);
130#define CUR_DEFAULT CUR_UNDERLINE 133#define CUR_DEFAULT CUR_UNDERLINE
131 134
132#define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp) 135#define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp)
136
137#endif /* _LINUX_CONSOLE_STRUCT_H */
diff --git a/include/linux/consolemap.h b/include/linux/consolemap.h
index 82c9a1f11020..06b2768c603f 100644
--- a/include/linux/consolemap.h
+++ b/include/linux/consolemap.h
@@ -8,9 +8,12 @@
8#define IBMPC_MAP 2 8#define IBMPC_MAP 2
9#define USER_MAP 3 9#define USER_MAP 3
10 10
11#include <linux/types.h>
12
11struct vc_data; 13struct vc_data;
12 14
13extern unsigned char inverse_translate(struct vc_data *conp, int glyph); 15extern u16 inverse_translate(struct vc_data *conp, int glyph, int use_unicode);
14extern unsigned short *set_translate(int m, struct vc_data *vc); 16extern unsigned short *set_translate(int m, struct vc_data *vc);
15extern int conv_uni_to_pc(struct vc_data *conp, long ucs); 17extern int conv_uni_to_pc(struct vc_data *conp, long ucs);
18extern u32 conv_8bit_to_uni(unsigned char c);
16void console_map_init(void); 19void console_map_init(void);
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 3b2df2523f1d..c2236bbff412 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -120,7 +120,6 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
120 120
121#define lock_cpu_hotplug() do { } while (0) 121#define lock_cpu_hotplug() do { } while (0)
122#define unlock_cpu_hotplug() do { } while (0) 122#define unlock_cpu_hotplug() do { } while (0)
123#define lock_cpu_hotplug_interruptible() 0
124#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) 123#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0)
125#define register_hotcpu_notifier(nb) do { (void)(nb); } while (0) 124#define register_hotcpu_notifier(nb) do { (void)(nb); } while (0)
126#define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0) 125#define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0)
diff --git a/include/linux/crc7.h b/include/linux/crc7.h
new file mode 100644
index 000000000000..1786e772d5c6
--- /dev/null
+++ b/include/linux/crc7.h
@@ -0,0 +1,14 @@
1#ifndef _LINUX_CRC7_H
2#define _LINUX_CRC7_H
3#include <linux/types.h>
4
5extern const u8 crc7_syndrome_table[256];
6
7static inline u8 crc7_byte(u8 crc, u8 data)
8{
9 return crc7_syndrome_table[(crc << 1) ^ data];
10}
11
12extern u8 crc7(u8 crc, const u8 *buffer, size_t len);
13
14#endif
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 0de7e2ace822..357e8cfedc37 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -295,28 +295,8 @@ struct blkcipher_tfm {
295}; 295};
296 296
297struct cipher_tfm { 297struct cipher_tfm {
298 void *cit_iv;
299 unsigned int cit_ivsize;
300 u32 cit_mode;
301 int (*cit_setkey)(struct crypto_tfm *tfm, 298 int (*cit_setkey)(struct crypto_tfm *tfm,
302 const u8 *key, unsigned int keylen); 299 const u8 *key, unsigned int keylen);
303 int (*cit_encrypt)(struct crypto_tfm *tfm,
304 struct scatterlist *dst,
305 struct scatterlist *src,
306 unsigned int nbytes);
307 int (*cit_encrypt_iv)(struct crypto_tfm *tfm,
308 struct scatterlist *dst,
309 struct scatterlist *src,
310 unsigned int nbytes, u8 *iv);
311 int (*cit_decrypt)(struct crypto_tfm *tfm,
312 struct scatterlist *dst,
313 struct scatterlist *src,
314 unsigned int nbytes);
315 int (*cit_decrypt_iv)(struct crypto_tfm *tfm,
316 struct scatterlist *dst,
317 struct scatterlist *src,
318 unsigned int nbytes, u8 *iv);
319 void (*cit_xor_block)(u8 *dst, const u8 *src);
320 void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); 300 void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
321 void (*cit_decrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); 301 void (*cit_decrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
322}; 302};
diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h
index 0fe7cdf326f7..98c69ab80c84 100644
--- a/include/linux/dcookies.h
+++ b/include/linux/dcookies.h
@@ -12,6 +12,7 @@
12 12
13#ifdef CONFIG_PROFILING 13#ifdef CONFIG_PROFILING
14 14
15#include <linux/dcache.h>
15#include <linux/types.h> 16#include <linux/types.h>
16 17
17struct dcookie_user; 18struct dcookie_user;
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index 5a9c49534d08..104e51e20e14 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -38,6 +38,9 @@ struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
38 38
39void debugfs_remove(struct dentry *dentry); 39void debugfs_remove(struct dentry *dentry);
40 40
41struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
42 struct dentry *new_dir, const char *new_name);
43
41struct dentry *debugfs_create_u8(const char *name, mode_t mode, 44struct dentry *debugfs_create_u8(const char *name, mode_t mode,
42 struct dentry *parent, u8 *value); 45 struct dentry *parent, u8 *value);
43struct dentry *debugfs_create_u16(const char *name, mode_t mode, 46struct dentry *debugfs_create_u16(const char *name, mode_t mode,
@@ -85,6 +88,12 @@ static inline struct dentry *debugfs_create_symlink(const char *name,
85static inline void debugfs_remove(struct dentry *dentry) 88static inline void debugfs_remove(struct dentry *dentry)
86{ } 89{ }
87 90
91static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
92 struct dentry *new_dir, char *new_name)
93{
94 return ERR_PTR(-ENODEV);
95}
96
88static inline struct dentry *debugfs_create_u8(const char *name, mode_t mode, 97static inline struct dentry *debugfs_create_u8(const char *name, mode_t mode,
89 struct dentry *parent, 98 struct dentry *parent,
90 u8 *value) 99 u8 *value)
diff --git a/include/linux/device.h b/include/linux/device.h
index 2e1a2988b7e1..d9f0a57f5a2f 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -238,7 +238,6 @@ extern int __must_check class_device_create_file(struct class_device *,
238 * @devt: for internal use by the driver core only. 238 * @devt: for internal use by the driver core only.
239 * @node: for internal use by the driver core only. 239 * @node: for internal use by the driver core only.
240 * @kobj: for internal use by the driver core only. 240 * @kobj: for internal use by the driver core only.
241 * @devt_attr: for internal use by the driver core only.
242 * @groups: optional additional groups to be created 241 * @groups: optional additional groups to be created
243 * @dev: if set, a symlink to the struct device is created in the sysfs 242 * @dev: if set, a symlink to the struct device is created in the sysfs
244 * directory for this struct class device. 243 * directory for this struct class device.
@@ -263,8 +262,6 @@ struct class_device {
263 struct kobject kobj; 262 struct kobject kobj;
264 struct class * class; /* required */ 263 struct class * class; /* required */
265 dev_t devt; /* dev_t, creates the sysfs "dev" */ 264 dev_t devt; /* dev_t, creates the sysfs "dev" */
266 struct class_device_attribute *devt_attr;
267 struct class_device_attribute uevent_attr;
268 struct device * dev; /* not necessary, but nice to have */ 265 struct device * dev; /* not necessary, but nice to have */
269 void * class_data; /* class-specific data */ 266 void * class_data; /* class-specific data */
270 struct class_device *parent; /* parent of this child device, if there is one */ 267 struct class_device *parent; /* parent of this child device, if there is one */
@@ -419,8 +416,6 @@ struct device {
419 struct device_type *type; 416 struct device_type *type;
420 unsigned is_registered:1; 417 unsigned is_registered:1;
421 unsigned uevent_suppress:1; 418 unsigned uevent_suppress:1;
422 struct device_attribute uevent_attr;
423 struct device_attribute *devt_attr;
424 419
425 struct semaphore sem; /* semaphore to synchronize calls to 420 struct semaphore sem; /* semaphore to synchronize calls to
426 * its driver. 421 * its driver.
@@ -577,6 +572,16 @@ dev_dbg(struct device * dev, const char * fmt, ...)
577} 572}
578#endif 573#endif
579 574
575#ifdef VERBOSE_DEBUG
576#define dev_vdbg dev_dbg
577#else
578static inline int __attribute__ ((format (printf, 2, 3)))
579dev_vdbg(struct device * dev, const char * fmt, ...)
580{
581 return 0;
582}
583#endif
584
580#define dev_err(dev, format, arg...) \ 585#define dev_err(dev, format, arg...) \
581 dev_printk(KERN_ERR , dev , format , ## arg) 586 dev_printk(KERN_ERR , dev , format , ## arg)
582#define dev_info(dev, format, arg...) \ 587#define dev_info(dev, format, arg...) \
diff --git a/include/linux/dlm.h b/include/linux/dlm.h
index 1b1dcb9a40bb..be9d278761e0 100644
--- a/include/linux/dlm.h
+++ b/include/linux/dlm.h
@@ -2,7 +2,7 @@
2******************************************************************************* 2*******************************************************************************
3** 3**
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. 5** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
6** 6**
7** This copyrighted material is made available to anyone wishing to use, 7** This copyrighted material is made available to anyone wishing to use,
8** modify, copy, or redistribute it subject to the terms and conditions 8** modify, copy, or redistribute it subject to the terms and conditions
@@ -85,7 +85,11 @@
85 * Only relevant to locks originating in userspace. A persistent lock will not 85 * Only relevant to locks originating in userspace. A persistent lock will not
86 * be removed if the process holding the lock exits. 86 * be removed if the process holding the lock exits.
87 * 87 *
88 * DLM_LKF_NODLKWT 88 * DLM_LKF_NODLCKWT
89 *
90 * Do not cancel the lock if it gets into conversion deadlock.
91 * Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN.
92 *
89 * DLM_LKF_NODLCKBLK 93 * DLM_LKF_NODLCKBLK
90 * 94 *
91 * net yet implemented 95 * net yet implemented
@@ -149,6 +153,7 @@
149#define DLM_LKF_ALTPR 0x00008000 153#define DLM_LKF_ALTPR 0x00008000
150#define DLM_LKF_ALTCW 0x00010000 154#define DLM_LKF_ALTCW 0x00010000
151#define DLM_LKF_FORCEUNLOCK 0x00020000 155#define DLM_LKF_FORCEUNLOCK 0x00020000
156#define DLM_LKF_TIMEOUT 0x00040000
152 157
153/* 158/*
154 * Some return codes that are not in errno.h 159 * Some return codes that are not in errno.h
@@ -199,11 +204,12 @@ struct dlm_lksb {
199 char * sb_lvbptr; 204 char * sb_lvbptr;
200}; 205};
201 206
207#define DLM_LSFL_NODIR 0x00000001
208#define DLM_LSFL_TIMEWARN 0x00000002
209#define DLM_LSFL_FS 0x00000004
202 210
203#ifdef __KERNEL__ 211#ifdef __KERNEL__
204 212
205#define DLM_LSFL_NODIR 0x00000001
206
207/* 213/*
208 * dlm_new_lockspace 214 * dlm_new_lockspace
209 * 215 *
diff --git a/include/linux/dlm_device.h b/include/linux/dlm_device.h
index c2735cab2ebf..9642277a152a 100644
--- a/include/linux/dlm_device.h
+++ b/include/linux/dlm_device.h
@@ -2,7 +2,7 @@
2******************************************************************************* 2*******************************************************************************
3** 3**
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. 5** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
6** 6**
7** This copyrighted material is made available to anyone wishing to use, 7** This copyrighted material is made available to anyone wishing to use,
8** modify, copy, or redistribute it subject to the terms and conditions 8** modify, copy, or redistribute it subject to the terms and conditions
@@ -18,21 +18,24 @@
18#define DLM_USER_LVB_LEN 32 18#define DLM_USER_LVB_LEN 32
19 19
20/* Version of the device interface */ 20/* Version of the device interface */
21#define DLM_DEVICE_VERSION_MAJOR 5 21#define DLM_DEVICE_VERSION_MAJOR 6
22#define DLM_DEVICE_VERSION_MINOR 1 22#define DLM_DEVICE_VERSION_MINOR 0
23#define DLM_DEVICE_VERSION_PATCH 0 23#define DLM_DEVICE_VERSION_PATCH 0
24 24
25/* struct passed to the lock write */ 25/* struct passed to the lock write */
26struct dlm_lock_params { 26struct dlm_lock_params {
27 __u8 mode; 27 __u8 mode;
28 __u8 namelen; 28 __u8 namelen;
29 __u16 flags; 29 __u16 unused;
30 __u32 flags;
30 __u32 lkid; 31 __u32 lkid;
31 __u32 parent; 32 __u32 parent;
32 void __user *castparam; 33 __u64 xid;
34 __u64 timeout;
35 void __user *castparam;
33 void __user *castaddr; 36 void __user *castaddr;
34 void __user *bastparam; 37 void __user *bastparam;
35 void __user *bastaddr; 38 void __user *bastaddr;
36 struct dlm_lksb __user *lksb; 39 struct dlm_lksb __user *lksb;
37 char lvb[DLM_USER_LVB_LEN]; 40 char lvb[DLM_USER_LVB_LEN];
38 char name[0]; 41 char name[0];
@@ -62,9 +65,15 @@ struct dlm_write_request {
62 } i; 65 } i;
63}; 66};
64 67
68struct dlm_device_version {
69 __u32 version[3];
70};
71
65/* struct read from the "device" fd, 72/* struct read from the "device" fd,
66 consists mainly of userspace pointers for the library to use */ 73 consists mainly of userspace pointers for the library to use */
74
67struct dlm_lock_result { 75struct dlm_lock_result {
76 __u32 version[3];
68 __u32 length; 77 __u32 length;
69 void __user * user_astaddr; 78 void __user * user_astaddr;
70 void __user * user_astparam; 79 void __user * user_astparam;
@@ -83,6 +92,7 @@ struct dlm_lock_result {
83#define DLM_USER_CREATE_LOCKSPACE 4 92#define DLM_USER_CREATE_LOCKSPACE 4
84#define DLM_USER_REMOVE_LOCKSPACE 5 93#define DLM_USER_REMOVE_LOCKSPACE 5
85#define DLM_USER_PURGE 6 94#define DLM_USER_PURGE 6
95#define DLM_USER_DEADLOCK 7
86 96
87/* Arbitrary length restriction */ 97/* Arbitrary length restriction */
88#define MAX_LS_NAME_LEN 64 98#define MAX_LS_NAME_LEN 64
diff --git a/include/linux/dlm_netlink.h b/include/linux/dlm_netlink.h
new file mode 100644
index 000000000000..19276332707a
--- /dev/null
+++ b/include/linux/dlm_netlink.h
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) 2007 Red Hat, Inc. All rights reserved.
3 *
4 * This copyrighted material is made available to anyone wishing to use,
5 * modify, copy, or redistribute it subject to the terms and conditions
6 * of the GNU General Public License v.2.
7 */
8
9#ifndef _DLM_NETLINK_H
10#define _DLM_NETLINK_H
11
12enum {
13 DLM_STATUS_WAITING = 1,
14 DLM_STATUS_GRANTED = 2,
15 DLM_STATUS_CONVERT = 3,
16};
17
18#define DLM_LOCK_DATA_VERSION 1
19
20struct dlm_lock_data {
21 uint16_t version;
22 uint32_t lockspace_id;
23 int nodeid;
24 int ownpid;
25 uint32_t id;
26 uint32_t remid;
27 uint64_t xid;
28 int8_t status;
29 int8_t grmode;
30 int8_t rqmode;
31 unsigned long timestamp;
32 int resource_namelen;
33 char resource_name[DLM_RESNAME_MAXLEN];
34};
35
36enum {
37 DLM_CMD_UNSPEC = 0,
38 DLM_CMD_HELLO, /* user->kernel */
39 DLM_CMD_TIMEOUT, /* kernel->user */
40 __DLM_CMD_MAX,
41};
42
43#define DLM_CMD_MAX (__DLM_CMD_MAX - 1)
44
45enum {
46 DLM_TYPE_UNSPEC = 0,
47 DLM_TYPE_LOCK,
48 __DLM_TYPE_MAX,
49};
50
51#define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1)
52
53#define DLM_GENL_VERSION 0x1
54#define DLM_GENL_NAME "DLM"
55
56#endif /* _DLM_NETLINK_H */
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 9a663c6db16a..2dc21cbeb304 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -31,7 +31,11 @@ static inline int valid_dma_direction(int dma_direction)
31 (dma_direction == DMA_FROM_DEVICE)); 31 (dma_direction == DMA_FROM_DEVICE));
32} 32}
33 33
34#ifdef CONFIG_HAS_DMA
34#include <asm/dma-mapping.h> 35#include <asm/dma-mapping.h>
36#else
37#include <asm-generic/dma-mapping-broken.h>
38#endif
35 39
36/* Backwards compat, remove in 2.7.x */ 40/* Backwards compat, remove in 2.7.x */
37#define dma_sync_single dma_sync_single_for_cpu 41#define dma_sync_single dma_sync_single_for_cpu
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index c94d8f1d62e5..a3b6035b6c86 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -21,29 +21,40 @@
21#ifndef DMAENGINE_H 21#ifndef DMAENGINE_H
22#define DMAENGINE_H 22#define DMAENGINE_H
23 23
24#ifdef CONFIG_DMA_ENGINE
25
26#include <linux/device.h> 24#include <linux/device.h>
27#include <linux/uio.h> 25#include <linux/uio.h>
28#include <linux/kref.h> 26#include <linux/kref.h>
29#include <linux/completion.h> 27#include <linux/completion.h>
30#include <linux/rcupdate.h> 28#include <linux/rcupdate.h>
29#include <linux/dma-mapping.h>
31 30
32/** 31/**
33 * enum dma_event - resource PNP/power managment events 32 * enum dma_state - resource PNP/power managment state
34 * @DMA_RESOURCE_SUSPEND: DMA device going into low power state 33 * @DMA_RESOURCE_SUSPEND: DMA device going into low power state
35 * @DMA_RESOURCE_RESUME: DMA device returning to full power 34 * @DMA_RESOURCE_RESUME: DMA device returning to full power
36 * @DMA_RESOURCE_ADDED: DMA device added to the system 35 * @DMA_RESOURCE_AVAILABLE: DMA device available to the system
37 * @DMA_RESOURCE_REMOVED: DMA device removed from the system 36 * @DMA_RESOURCE_REMOVED: DMA device removed from the system
38 */ 37 */
39enum dma_event { 38enum dma_state {
40 DMA_RESOURCE_SUSPEND, 39 DMA_RESOURCE_SUSPEND,
41 DMA_RESOURCE_RESUME, 40 DMA_RESOURCE_RESUME,
42 DMA_RESOURCE_ADDED, 41 DMA_RESOURCE_AVAILABLE,
43 DMA_RESOURCE_REMOVED, 42 DMA_RESOURCE_REMOVED,
44}; 43};
45 44
46/** 45/**
46 * enum dma_state_client - state of the channel in the client
47 * @DMA_ACK: client would like to use, or was using this channel
48 * @DMA_DUP: client has already seen this channel, or is not using this channel
49 * @DMA_NAK: client does not want to see any more channels
50 */
51enum dma_state_client {
52 DMA_ACK,
53 DMA_DUP,
54 DMA_NAK,
55};
56
57/**
47 * typedef dma_cookie_t - an opaque DMA cookie 58 * typedef dma_cookie_t - an opaque DMA cookie
48 * 59 *
49 * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code 60 * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code
@@ -65,6 +76,31 @@ enum dma_status {
65}; 76};
66 77
67/** 78/**
79 * enum dma_transaction_type - DMA transaction types/indexes
80 */
81enum dma_transaction_type {
82 DMA_MEMCPY,
83 DMA_XOR,
84 DMA_PQ_XOR,
85 DMA_DUAL_XOR,
86 DMA_PQ_UPDATE,
87 DMA_ZERO_SUM,
88 DMA_PQ_ZERO_SUM,
89 DMA_MEMSET,
90 DMA_MEMCPY_CRC32C,
91 DMA_INTERRUPT,
92};
93
94/* last transaction type for creation of the capabilities mask */
95#define DMA_TX_TYPE_END (DMA_INTERRUPT + 1)
96
97/**
98 * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t.
99 * See linux/cpumask.h
100 */
101typedef struct { DECLARE_BITMAP(bits, DMA_TX_TYPE_END); } dma_cap_mask_t;
102
103/**
68 * struct dma_chan_percpu - the per-CPU part of struct dma_chan 104 * struct dma_chan_percpu - the per-CPU part of struct dma_chan
69 * @refcount: local_t used for open-coded "bigref" counting 105 * @refcount: local_t used for open-coded "bigref" counting
70 * @memcpy_count: transaction counter 106 * @memcpy_count: transaction counter
@@ -80,7 +116,6 @@ struct dma_chan_percpu {
80 116
81/** 117/**
82 * struct dma_chan - devices supply DMA channels, clients use them 118 * struct dma_chan - devices supply DMA channels, clients use them
83 * @client: ptr to the client user of this chan, will be %NULL when unused
84 * @device: ptr to the dma device who supplies this channel, always !%NULL 119 * @device: ptr to the dma device who supplies this channel, always !%NULL
85 * @cookie: last cookie value returned to client 120 * @cookie: last cookie value returned to client
86 * @chan_id: channel ID for sysfs 121 * @chan_id: channel ID for sysfs
@@ -88,12 +123,10 @@ struct dma_chan_percpu {
88 * @refcount: kref, used in "bigref" slow-mode 123 * @refcount: kref, used in "bigref" slow-mode
89 * @slow_ref: indicates that the DMA channel is free 124 * @slow_ref: indicates that the DMA channel is free
90 * @rcu: the DMA channel's RCU head 125 * @rcu: the DMA channel's RCU head
91 * @client_node: used to add this to the client chan list
92 * @device_node: used to add this to the device chan list 126 * @device_node: used to add this to the device chan list
93 * @local: per-cpu pointer to a struct dma_chan_percpu 127 * @local: per-cpu pointer to a struct dma_chan_percpu
94 */ 128 */
95struct dma_chan { 129struct dma_chan {
96 struct dma_client *client;
97 struct dma_device *device; 130 struct dma_device *device;
98 dma_cookie_t cookie; 131 dma_cookie_t cookie;
99 132
@@ -105,11 +138,11 @@ struct dma_chan {
105 int slow_ref; 138 int slow_ref;
106 struct rcu_head rcu; 139 struct rcu_head rcu;
107 140
108 struct list_head client_node;
109 struct list_head device_node; 141 struct list_head device_node;
110 struct dma_chan_percpu *local; 142 struct dma_chan_percpu *local;
111}; 143};
112 144
145
113void dma_chan_cleanup(struct kref *kref); 146void dma_chan_cleanup(struct kref *kref);
114 147
115static inline void dma_chan_get(struct dma_chan *chan) 148static inline void dma_chan_get(struct dma_chan *chan)
@@ -134,169 +167,206 @@ static inline void dma_chan_put(struct dma_chan *chan)
134 167
135/* 168/*
136 * typedef dma_event_callback - function pointer to a DMA event callback 169 * typedef dma_event_callback - function pointer to a DMA event callback
170 * For each channel added to the system this routine is called for each client.
171 * If the client would like to use the channel it returns '1' to signal (ack)
172 * the dmaengine core to take out a reference on the channel and its
173 * corresponding device. A client must not 'ack' an available channel more
174 * than once. When a channel is removed all clients are notified. If a client
175 * is using the channel it must 'ack' the removal. A client must not 'ack' a
176 * removed channel more than once.
177 * @client - 'this' pointer for the client context
178 * @chan - channel to be acted upon
179 * @state - available or removed
137 */ 180 */
138typedef void (*dma_event_callback) (struct dma_client *client, 181struct dma_client;
139 struct dma_chan *chan, enum dma_event event); 182typedef enum dma_state_client (*dma_event_callback) (struct dma_client *client,
183 struct dma_chan *chan, enum dma_state state);
140 184
141/** 185/**
142 * struct dma_client - info on the entity making use of DMA services 186 * struct dma_client - info on the entity making use of DMA services
143 * @event_callback: func ptr to call when something happens 187 * @event_callback: func ptr to call when something happens
144 * @chan_count: number of chans allocated 188 * @cap_mask: only return channels that satisfy the requested capabilities
145 * @chans_desired: number of chans requested. Can be +/- chan_count 189 * a value of zero corresponds to any capability
146 * @lock: protects access to the channels list
147 * @channels: the list of DMA channels allocated
148 * @global_node: list_head for global dma_client_list 190 * @global_node: list_head for global dma_client_list
149 */ 191 */
150struct dma_client { 192struct dma_client {
151 dma_event_callback event_callback; 193 dma_event_callback event_callback;
152 unsigned int chan_count; 194 dma_cap_mask_t cap_mask;
153 unsigned int chans_desired;
154
155 spinlock_t lock;
156 struct list_head channels;
157 struct list_head global_node; 195 struct list_head global_node;
158}; 196};
159 197
198typedef void (*dma_async_tx_callback)(void *dma_async_param);
199/**
200 * struct dma_async_tx_descriptor - async transaction descriptor
201 * ---dma generic offload fields---
202 * @cookie: tracking cookie for this transaction, set to -EBUSY if
203 * this tx is sitting on a dependency list
204 * @ack: the descriptor can not be reused until the client acknowledges
205 * receipt, i.e. has has a chance to establish any dependency chains
206 * @phys: physical address of the descriptor
207 * @tx_list: driver common field for operations that require multiple
208 * descriptors
209 * @chan: target channel for this operation
210 * @tx_submit: set the prepared descriptor(s) to be executed by the engine
211 * @tx_set_dest: set a destination address in a hardware descriptor
212 * @tx_set_src: set a source address in a hardware descriptor
213 * @callback: routine to call after this operation is complete
214 * @callback_param: general parameter to pass to the callback routine
215 * ---async_tx api specific fields---
216 * @depend_list: at completion this list of transactions are submitted
217 * @depend_node: allow this transaction to be executed after another
218 * transaction has completed, possibly on another channel
219 * @parent: pointer to the next level up in the dependency chain
220 * @lock: protect the dependency list
221 */
222struct dma_async_tx_descriptor {
223 dma_cookie_t cookie;
224 int ack;
225 dma_addr_t phys;
226 struct list_head tx_list;
227 struct dma_chan *chan;
228 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
229 void (*tx_set_dest)(dma_addr_t addr,
230 struct dma_async_tx_descriptor *tx, int index);
231 void (*tx_set_src)(dma_addr_t addr,
232 struct dma_async_tx_descriptor *tx, int index);
233 dma_async_tx_callback callback;
234 void *callback_param;
235 struct list_head depend_list;
236 struct list_head depend_node;
237 struct dma_async_tx_descriptor *parent;
238 spinlock_t lock;
239};
240
160/** 241/**
161 * struct dma_device - info on the entity supplying DMA services 242 * struct dma_device - info on the entity supplying DMA services
162 * @chancnt: how many DMA channels are supported 243 * @chancnt: how many DMA channels are supported
163 * @channels: the list of struct dma_chan 244 * @channels: the list of struct dma_chan
164 * @global_node: list_head for global dma_device_list 245 * @global_node: list_head for global dma_device_list
246 * @cap_mask: one or more dma_capability flags
247 * @max_xor: maximum number of xor sources, 0 if no capability
165 * @refcount: reference count 248 * @refcount: reference count
166 * @done: IO completion struct 249 * @done: IO completion struct
167 * @dev_id: unique device ID 250 * @dev_id: unique device ID
251 * @dev: struct device reference for dma mapping api
168 * @device_alloc_chan_resources: allocate resources and return the 252 * @device_alloc_chan_resources: allocate resources and return the
169 * number of allocated descriptors 253 * number of allocated descriptors
170 * @device_free_chan_resources: release DMA channel's resources 254 * @device_free_chan_resources: release DMA channel's resources
171 * @device_memcpy_buf_to_buf: memcpy buf pointer to buf pointer 255 * @device_prep_dma_memcpy: prepares a memcpy operation
172 * @device_memcpy_buf_to_pg: memcpy buf pointer to struct page 256 * @device_prep_dma_xor: prepares a xor operation
173 * @device_memcpy_pg_to_pg: memcpy struct page/offset to struct page/offset 257 * @device_prep_dma_zero_sum: prepares a zero_sum operation
174 * @device_memcpy_complete: poll the status of an IOAT DMA transaction 258 * @device_prep_dma_memset: prepares a memset operation
175 * @device_memcpy_issue_pending: push appended descriptors to hardware 259 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation
260 * @device_dependency_added: async_tx notifies the channel about new deps
261 * @device_issue_pending: push pending transactions to hardware
176 */ 262 */
177struct dma_device { 263struct dma_device {
178 264
179 unsigned int chancnt; 265 unsigned int chancnt;
180 struct list_head channels; 266 struct list_head channels;
181 struct list_head global_node; 267 struct list_head global_node;
268 dma_cap_mask_t cap_mask;
269 int max_xor;
182 270
183 struct kref refcount; 271 struct kref refcount;
184 struct completion done; 272 struct completion done;
185 273
186 int dev_id; 274 int dev_id;
275 struct device *dev;
187 276
188 int (*device_alloc_chan_resources)(struct dma_chan *chan); 277 int (*device_alloc_chan_resources)(struct dma_chan *chan);
189 void (*device_free_chan_resources)(struct dma_chan *chan); 278 void (*device_free_chan_resources)(struct dma_chan *chan);
190 dma_cookie_t (*device_memcpy_buf_to_buf)(struct dma_chan *chan, 279
191 void *dest, void *src, size_t len); 280 struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)(
192 dma_cookie_t (*device_memcpy_buf_to_pg)(struct dma_chan *chan, 281 struct dma_chan *chan, size_t len, int int_en);
193 struct page *page, unsigned int offset, void *kdata, 282 struct dma_async_tx_descriptor *(*device_prep_dma_xor)(
194 size_t len); 283 struct dma_chan *chan, unsigned int src_cnt, size_t len,
195 dma_cookie_t (*device_memcpy_pg_to_pg)(struct dma_chan *chan, 284 int int_en);
196 struct page *dest_pg, unsigned int dest_off, 285 struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)(
197 struct page *src_pg, unsigned int src_off, size_t len); 286 struct dma_chan *chan, unsigned int src_cnt, size_t len,
198 enum dma_status (*device_memcpy_complete)(struct dma_chan *chan, 287 u32 *result, int int_en);
288 struct dma_async_tx_descriptor *(*device_prep_dma_memset)(
289 struct dma_chan *chan, int value, size_t len, int int_en);
290 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
291 struct dma_chan *chan);
292
293 void (*device_dependency_added)(struct dma_chan *chan);
294 enum dma_status (*device_is_tx_complete)(struct dma_chan *chan,
199 dma_cookie_t cookie, dma_cookie_t *last, 295 dma_cookie_t cookie, dma_cookie_t *last,
200 dma_cookie_t *used); 296 dma_cookie_t *used);
201 void (*device_memcpy_issue_pending)(struct dma_chan *chan); 297 void (*device_issue_pending)(struct dma_chan *chan);
202}; 298};
203 299
204/* --- public DMA engine API --- */ 300/* --- public DMA engine API --- */
205 301
206struct dma_client *dma_async_client_register(dma_event_callback event_callback); 302void dma_async_client_register(struct dma_client *client);
207void dma_async_client_unregister(struct dma_client *client); 303void dma_async_client_unregister(struct dma_client *client);
208void dma_async_client_chan_request(struct dma_client *client, 304void dma_async_client_chan_request(struct dma_client *client);
209 unsigned int number); 305dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
306 void *dest, void *src, size_t len);
307dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
308 struct page *page, unsigned int offset, void *kdata, size_t len);
309dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan,
310 struct page *dest_pg, unsigned int dest_off, struct page *src_pg,
311 unsigned int src_off, size_t len);
312void dma_async_tx_descriptor_init(struct dma_async_tx_descriptor *tx,
313 struct dma_chan *chan);
210 314
211/** 315static inline void
212 * dma_async_memcpy_buf_to_buf - offloaded copy between virtual addresses 316async_tx_ack(struct dma_async_tx_descriptor *tx)
213 * @chan: DMA channel to offload copy to
214 * @dest: destination address (virtual)
215 * @src: source address (virtual)
216 * @len: length
217 *
218 * Both @dest and @src must be mappable to a bus address according to the
219 * DMA mapping API rules for streaming mappings.
220 * Both @dest and @src must stay memory resident (kernel memory or locked
221 * user space pages).
222 */
223static inline dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
224 void *dest, void *src, size_t len)
225{ 317{
226 int cpu = get_cpu(); 318 tx->ack = 1;
227 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len;
228 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
229 put_cpu();
230
231 return chan->device->device_memcpy_buf_to_buf(chan, dest, src, len);
232} 319}
233 320
234/** 321#define first_dma_cap(mask) __first_dma_cap(&(mask))
235 * dma_async_memcpy_buf_to_pg - offloaded copy from address to page 322static inline int __first_dma_cap(const dma_cap_mask_t *srcp)
236 * @chan: DMA channel to offload copy to
237 * @page: destination page
238 * @offset: offset in page to copy to
239 * @kdata: source address (virtual)
240 * @len: length
241 *
242 * Both @page/@offset and @kdata must be mappable to a bus address according
243 * to the DMA mapping API rules for streaming mappings.
244 * Both @page/@offset and @kdata must stay memory resident (kernel memory or
245 * locked user space pages)
246 */
247static inline dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
248 struct page *page, unsigned int offset, void *kdata, size_t len)
249{ 323{
250 int cpu = get_cpu(); 324 return min_t(int, DMA_TX_TYPE_END,
251 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len; 325 find_first_bit(srcp->bits, DMA_TX_TYPE_END));
252 per_cpu_ptr(chan->local, cpu)->memcpy_count++; 326}
253 put_cpu();
254 327
255 return chan->device->device_memcpy_buf_to_pg(chan, page, offset, 328#define next_dma_cap(n, mask) __next_dma_cap((n), &(mask))
256 kdata, len); 329static inline int __next_dma_cap(int n, const dma_cap_mask_t *srcp)
330{
331 return min_t(int, DMA_TX_TYPE_END,
332 find_next_bit(srcp->bits, DMA_TX_TYPE_END, n+1));
257} 333}
258 334
259/** 335#define dma_cap_set(tx, mask) __dma_cap_set((tx), &(mask))
260 * dma_async_memcpy_pg_to_pg - offloaded copy from page to page 336static inline void
261 * @chan: DMA channel to offload copy to 337__dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp)
262 * @dest_pg: destination page
263 * @dest_off: offset in page to copy to
264 * @src_pg: source page
265 * @src_off: offset in page to copy from
266 * @len: length
267 *
268 * Both @dest_page/@dest_off and @src_page/@src_off must be mappable to a bus
269 * address according to the DMA mapping API rules for streaming mappings.
270 * Both @dest_page/@dest_off and @src_page/@src_off must stay memory resident
271 * (kernel memory or locked user space pages).
272 */
273static inline dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan,
274 struct page *dest_pg, unsigned int dest_off, struct page *src_pg,
275 unsigned int src_off, size_t len)
276{ 338{
277 int cpu = get_cpu(); 339 set_bit(tx_type, dstp->bits);
278 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len; 340}
279 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
280 put_cpu();
281 341
282 return chan->device->device_memcpy_pg_to_pg(chan, dest_pg, dest_off, 342#define dma_has_cap(tx, mask) __dma_has_cap((tx), &(mask))
283 src_pg, src_off, len); 343static inline int
344__dma_has_cap(enum dma_transaction_type tx_type, dma_cap_mask_t *srcp)
345{
346 return test_bit(tx_type, srcp->bits);
284} 347}
285 348
349#define for_each_dma_cap_mask(cap, mask) \
350 for ((cap) = first_dma_cap(mask); \
351 (cap) < DMA_TX_TYPE_END; \
352 (cap) = next_dma_cap((cap), (mask)))
353
286/** 354/**
287 * dma_async_memcpy_issue_pending - flush pending copies to HW 355 * dma_async_issue_pending - flush pending transactions to HW
288 * @chan: target DMA channel 356 * @chan: target DMA channel
289 * 357 *
290 * This allows drivers to push copies to HW in batches, 358 * This allows drivers to push copies to HW in batches,
291 * reducing MMIO writes where possible. 359 * reducing MMIO writes where possible.
292 */ 360 */
293static inline void dma_async_memcpy_issue_pending(struct dma_chan *chan) 361static inline void dma_async_issue_pending(struct dma_chan *chan)
294{ 362{
295 return chan->device->device_memcpy_issue_pending(chan); 363 return chan->device->device_issue_pending(chan);
296} 364}
297 365
366#define dma_async_memcpy_issue_pending(chan) dma_async_issue_pending(chan)
367
298/** 368/**
299 * dma_async_memcpy_complete - poll for transaction completion 369 * dma_async_is_tx_complete - poll for transaction completion
300 * @chan: DMA channel 370 * @chan: DMA channel
301 * @cookie: transaction identifier to check status of 371 * @cookie: transaction identifier to check status of
302 * @last: returns last completed cookie, can be NULL 372 * @last: returns last completed cookie, can be NULL
@@ -306,12 +376,15 @@ static inline void dma_async_memcpy_issue_pending(struct dma_chan *chan)
306 * internal state and can be used with dma_async_is_complete() to check 376 * internal state and can be used with dma_async_is_complete() to check
307 * the status of multiple cookies without re-checking hardware state. 377 * the status of multiple cookies without re-checking hardware state.
308 */ 378 */
309static inline enum dma_status dma_async_memcpy_complete(struct dma_chan *chan, 379static inline enum dma_status dma_async_is_tx_complete(struct dma_chan *chan,
310 dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used) 380 dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used)
311{ 381{
312 return chan->device->device_memcpy_complete(chan, cookie, last, used); 382 return chan->device->device_is_tx_complete(chan, cookie, last, used);
313} 383}
314 384
385#define dma_async_memcpy_complete(chan, cookie, last, used)\
386 dma_async_is_tx_complete(chan, cookie, last, used)
387
315/** 388/**
316 * dma_async_is_complete - test a cookie against chan state 389 * dma_async_is_complete - test a cookie against chan state
317 * @cookie: transaction identifier to test status of 390 * @cookie: transaction identifier to test status of
@@ -334,6 +407,7 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
334 return DMA_IN_PROGRESS; 407 return DMA_IN_PROGRESS;
335} 408}
336 409
410enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
337 411
338/* --- DMA device --- */ 412/* --- DMA device --- */
339 413
@@ -362,5 +436,4 @@ dma_cookie_t dma_memcpy_pg_to_iovec(struct dma_chan *chan, struct iovec *iov,
362 struct dma_pinned_list *pinned_list, struct page *page, 436 struct dma_pinned_list *pinned_list, struct page *page,
363 unsigned int offset, size_t len); 437 unsigned int offset, size_t len);
364 438
365#endif /* CONFIG_DMA_ENGINE */
366#endif /* DMAENGINE_H */ 439#endif /* DMAENGINE_H */
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 904bf3d2d90b..b8ac7b01c45e 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -12,9 +12,17 @@ enum dmi_field {
12 DMI_PRODUCT_NAME, 12 DMI_PRODUCT_NAME,
13 DMI_PRODUCT_VERSION, 13 DMI_PRODUCT_VERSION,
14 DMI_PRODUCT_SERIAL, 14 DMI_PRODUCT_SERIAL,
15 DMI_PRODUCT_UUID,
15 DMI_BOARD_VENDOR, 16 DMI_BOARD_VENDOR,
16 DMI_BOARD_NAME, 17 DMI_BOARD_NAME,
17 DMI_BOARD_VERSION, 18 DMI_BOARD_VERSION,
19 DMI_BOARD_SERIAL,
20 DMI_BOARD_ASSET_TAG,
21 DMI_CHASSIS_VENDOR,
22 DMI_CHASSIS_TYPE,
23 DMI_CHASSIS_VERSION,
24 DMI_CHASSIS_SERIAL,
25 DMI_CHASSIS_ASSET_TAG,
18 DMI_STRING_MAX, 26 DMI_STRING_MAX,
19}; 27};
20 28
diff --git a/include/linux/ds17287rtc.h b/include/linux/ds17287rtc.h
index c281ba42e28f..d85d3f497b96 100644
--- a/include/linux/ds17287rtc.h
+++ b/include/linux/ds17287rtc.h
@@ -11,7 +11,6 @@
11#define __LINUX_DS17287RTC_H 11#define __LINUX_DS17287RTC_H
12 12
13#include <linux/rtc.h> /* get the user-level API */ 13#include <linux/rtc.h> /* get the user-level API */
14#include <linux/spinlock.h> /* spinlock_t */
15#include <linux/mc146818rtc.h> 14#include <linux/mc146818rtc.h>
16 15
17/* Register A */ 16/* Register A */
diff --git a/include/linux/edac.h b/include/linux/edac.h
new file mode 100644
index 000000000000..eab451e69a91
--- /dev/null
+++ b/include/linux/edac.h
@@ -0,0 +1,29 @@
1/*
2 * Generic EDAC defs
3 *
4 * Author: Dave Jiang <djiang@mvista.com>
5 *
6 * 2006-2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 */
12#ifndef _LINUX_EDAC_H_
13#define _LINUX_EDAC_H_
14
15#include <asm/atomic.h>
16
17#define EDAC_OPSTATE_INVAL -1
18#define EDAC_OPSTATE_POLL 0
19#define EDAC_OPSTATE_NMI 1
20#define EDAC_OPSTATE_INT 2
21
22extern int edac_op_state;
23extern int edac_err_assert;
24extern atomic_t edac_handlers;
25
26extern int edac_handler_set(void);
27extern void edac_atomic_assert_error(void);
28
29#endif
diff --git a/include/linux/edd.h b/include/linux/edd.h
index b2b3e68aa512..7b647822d6dc 100644
--- a/include/linux/edd.h
+++ b/include/linux/edd.h
@@ -49,10 +49,6 @@
49#define EDD_MBR_SIG_MAX 16 /* max number of signatures to store */ 49#define EDD_MBR_SIG_MAX 16 /* max number of signatures to store */
50#define EDD_MBR_SIG_NR_BUF 0x1ea /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF 50#define EDD_MBR_SIG_NR_BUF 0x1ea /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF
51 in boot_params - treat this as 1 byte */ 51 in boot_params - treat this as 1 byte */
52#define EDD_CL_EQUALS 0x3d646465 /* "edd=" */
53#define EDD_CL_OFF 0x666f /* "of" for off */
54#define EDD_CL_SKIP 0x6b73 /* "sk" for skipmbr */
55#define EDD_CL_ON 0x6e6f /* "on" for on */
56 52
57#ifndef __ASSEMBLY__ 53#ifndef __ASSEMBLY__
58 54
diff --git a/include/linux/eeprom_93cx6.h b/include/linux/eeprom_93cx6.h
new file mode 100644
index 000000000000..d774b7778c91
--- /dev/null
+++ b/include/linux/eeprom_93cx6.h
@@ -0,0 +1,72 @@
1/*
2 Copyright (C) 2004 - 2006 rt2x00 SourceForge Project
3 <http://rt2x00.serialmonkey.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the
17 Free Software Foundation, Inc.,
18 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21/*
22 Module: eeprom_93cx6
23 Abstract: EEPROM reader datastructures for 93cx6 chipsets.
24 Supported chipsets: 93c46 & 93c66.
25 */
26
27/*
28 * EEPROM operation defines.
29 */
30#define PCI_EEPROM_WIDTH_93C46 6
31#define PCI_EEPROM_WIDTH_93C66 8
32#define PCI_EEPROM_WIDTH_OPCODE 3
33#define PCI_EEPROM_WRITE_OPCODE 0x05
34#define PCI_EEPROM_READ_OPCODE 0x06
35#define PCI_EEPROM_EWDS_OPCODE 0x10
36#define PCI_EEPROM_EWEN_OPCODE 0x13
37
38/**
39 * struct eeprom_93cx6 - control structure for setting the commands
40 * for reading the eeprom data.
41 * @data: private pointer for the driver.
42 * @register_read(struct eeprom_93cx6 *eeprom): handler to
43 * read the eeprom register, this function should set all reg_* fields.
44 * @register_write(struct eeprom_93cx6 *eeprom): handler to
45 * write to the eeprom register by using all reg_* fields.
46 * @width: eeprom width, should be one of the PCI_EEPROM_WIDTH_* defines
47 * @reg_data_in: register field to indicate data input
48 * @reg_data_out: register field to indicate data output
49 * @reg_data_clock: register field to set the data clock
50 * @reg_chip_select: register field to set the chip select
51 *
52 * This structure is used for the communication between the driver
53 * and the eeprom_93cx6 handlers for reading the eeprom.
54 */
55struct eeprom_93cx6 {
56 void *data;
57
58 void (*register_read)(struct eeprom_93cx6 *eeprom);
59 void (*register_write)(struct eeprom_93cx6 *eeprom);
60
61 int width;
62
63 char reg_data_in;
64 char reg_data_out;
65 char reg_data_clock;
66 char reg_chip_select;
67};
68
69extern void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom,
70 const u8 word, u16 *data);
71extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom,
72 const u8 word, __le16 *data, const u16 words);
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index dfed8009ebff..16cb25cbf7c5 100644
--- a/include/linux/efs_fs.h
+++ b/include/linux/efs_fs.h
@@ -45,6 +45,7 @@ extern efs_block_t efs_map_block(struct inode *, efs_block_t);
45extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); 45extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int);
46 46
47extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *); 47extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *);
48extern struct dentry *efs_get_dentry(struct super_block *sb, void *vobjp);
48extern struct dentry *efs_get_parent(struct dentry *); 49extern struct dentry *efs_get_parent(struct dentry *);
49extern int efs_bmap(struct inode *, int); 50extern int efs_bmap(struct inode *, int);
50 51
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h
index 0311bad838b1..5834e843a946 100644
--- a/include/linux/elf-em.h
+++ b/include/linux/elf-em.h
@@ -20,7 +20,8 @@
20#define EM_PARISC 15 /* HPPA */ 20#define EM_PARISC 15 /* HPPA */
21#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ 21#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
22#define EM_PPC 20 /* PowerPC */ 22#define EM_PPC 20 /* PowerPC */
23#define EM_PPC64 21 /* PowerPC64 */ 23#define EM_PPC64 21 /* PowerPC64 */
24#define EM_SPU 23 /* Cell BE SPU */
24#define EM_SH 42 /* SuperH */ 25#define EM_SH 42 /* SuperH */
25#define EM_SPARCV9 43 /* SPARC v9 64-bit */ 26#define EM_SPARCV9 43 /* SPARC v9 64-bit */
26#define EM_IA_64 50 /* HP/Intel IA-64 */ 27#define EM_IA_64 50 /* HP/Intel IA-64 */
diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h
index 9a1e0674e56c..e831759b2fb5 100644
--- a/include/linux/elfnote.h
+++ b/include/linux/elfnote.h
@@ -38,17 +38,25 @@
38 * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two") 38 * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two")
39 * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef) 39 * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef)
40 */ 40 */
41#define ELFNOTE(name, type, desctype, descdata) \ 41#define ELFNOTE_START(name, type, flags) \
42.pushsection .note.name, "",@note ; \ 42.pushsection .note.name, flags,@note ; \
43 .align 4 ; \ 43 .balign 4 ; \
44 .long 2f - 1f /* namesz */ ; \ 44 .long 2f - 1f /* namesz */ ; \
45 .long 4f - 3f /* descsz */ ; \ 45 .long 4484f - 3f /* descsz */ ; \
46 .long type ; \ 46 .long type ; \
471:.asciz #name ; \ 471:.asciz #name ; \
482:.align 4 ; \ 482:.balign 4 ; \
493:desctype descdata ; \ 493:
504:.align 4 ; \ 50
51#define ELFNOTE_END \
524484:.balign 4 ; \
51.popsection ; 53.popsection ;
54
55#define ELFNOTE(name, type, desc) \
56 ELFNOTE_START(name, type, "") \
57 desc ; \
58 ELFNOTE_END
59
52#else /* !__ASSEMBLER__ */ 60#else /* !__ASSEMBLER__ */
53#include <linux/elf.h> 61#include <linux/elf.h>
54/* 62/*
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 071c67abed86..6cdb97365e47 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -39,13 +39,8 @@ extern void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev
39extern int eth_header_cache(struct neighbour *neigh, 39extern int eth_header_cache(struct neighbour *neigh,
40 struct hh_cache *hh); 40 struct hh_cache *hh);
41 41
42extern struct net_device *alloc_etherdev(int sizeof_priv); 42extern struct net_device *alloc_etherdev_mq(int sizeof_priv, unsigned int queue_count);
43static inline void eth_copy_and_sum (struct sk_buff *dest, 43#define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1)
44 const unsigned char *src,
45 int len, int base)
46{
47 memcpy (dest->data, src, len);
48}
49 44
50/** 45/**
51 * is_zero_ether_addr - Determine if give Ethernet address is all zeros. 46 * is_zero_ether_addr - Determine if give Ethernet address is all zeros.
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index f2d248f8cc92..3a632244f31b 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -265,6 +265,7 @@ u32 ethtool_op_get_link(struct net_device *dev);
265u32 ethtool_op_get_tx_csum(struct net_device *dev); 265u32 ethtool_op_get_tx_csum(struct net_device *dev);
266int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); 266int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
267int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data); 267int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
268int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data);
268u32 ethtool_op_get_sg(struct net_device *dev); 269u32 ethtool_op_get_sg(struct net_device *dev);
269int ethtool_op_set_sg(struct net_device *dev, u32 data); 270int ethtool_op_set_sg(struct net_device *dev, u32 data);
270u32 ethtool_op_get_tso(struct net_device *dev); 271u32 ethtool_op_get_tso(struct net_device *dev);
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h
index 0d6ecc60b94d..b489fc6d0b62 100644
--- a/include/linux/eventfd.h
+++ b/include/linux/eventfd.h
@@ -19,7 +19,8 @@ int eventfd_signal(struct file *file, int n);
19#else /* CONFIG_EVENTFD */ 19#else /* CONFIG_EVENTFD */
20 20
21#define eventfd_fget(fd) ERR_PTR(-ENOSYS) 21#define eventfd_fget(fd) ERR_PTR(-ENOSYS)
22#define eventfd_signal(f, n) 0 22static inline int eventfd_signal(struct file *file, int n)
23{ return 0; }
23 24
24#endif /* CONFIG_EVENTFD */ 25#endif /* CONFIG_EVENTFD */
25 26
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
new file mode 100644
index 000000000000..8872fe8392d6
--- /dev/null
+++ b/include/linux/exportfs.h
@@ -0,0 +1,126 @@
1#ifndef LINUX_EXPORTFS_H
2#define LINUX_EXPORTFS_H 1
3
4#include <linux/types.h>
5
6struct dentry;
7struct super_block;
8struct vfsmount;
9
10
11/**
12 * struct export_operations - for nfsd to communicate with file systems
13 * @decode_fh: decode a file handle fragment and return a &struct dentry
14 * @encode_fh: encode a file handle fragment from a dentry
15 * @get_name: find the name for a given inode in a given directory
16 * @get_parent: find the parent of a given directory
17 * @get_dentry: find a dentry for the inode given a file handle sub-fragment
18 * @find_exported_dentry:
19 * set by the exporting module to a standard helper function.
20 *
21 * Description:
22 * The export_operations structure provides a means for nfsd to communicate
23 * with a particular exported file system - particularly enabling nfsd and
24 * the filesystem to co-operate when dealing with file handles.
25 *
26 * export_operations contains two basic operation for dealing with file
27 * handles, decode_fh() and encode_fh(), and allows for some other
28 * operations to be defined which standard helper routines use to get
29 * specific information from the filesystem.
30 *
31 * nfsd encodes information use to determine which filesystem a filehandle
32 * applies to in the initial part of the file handle. The remainder, termed
33 * a file handle fragment, is controlled completely by the filesystem. The
34 * standard helper routines assume that this fragment will contain one or
35 * two sub-fragments, one which identifies the file, and one which may be
36 * used to identify the (a) directory containing the file.
37 *
38 * In some situations, nfsd needs to get a dentry which is connected into a
39 * specific part of the file tree. To allow for this, it passes the
40 * function acceptable() together with a @context which can be used to see
41 * if the dentry is acceptable. As there can be multiple dentrys for a
42 * given file, the filesystem should check each one for acceptability before
43 * looking for the next. As soon as an acceptable one is found, it should
44 * be returned.
45 *
46 * decode_fh:
47 * @decode_fh is given a &struct super_block (@sb), a file handle fragment
48 * (@fh, @fh_len) and an acceptability testing function (@acceptable,
49 * @context). It should return a &struct dentry which refers to the same
50 * file that the file handle fragment refers to, and which passes the
51 * acceptability test. If it cannot, it should return a %NULL pointer if
52 * the file was found but no acceptable &dentries were available, or a
53 * %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or
54 * %ENOMEM).
55 *
56 * encode_fh:
57 * @encode_fh should store in the file handle fragment @fh (using at most
58 * @max_len bytes) information that can be used by @decode_fh to recover the
59 * file refered to by the &struct dentry @de. If the @connectable flag is
60 * set, the encode_fh() should store sufficient information so that a good
61 * attempt can be made to find not only the file but also it's place in the
62 * filesystem. This typically means storing a reference to de->d_parent in
63 * the filehandle fragment. encode_fh() should return the number of bytes
64 * stored or a negative error code such as %-ENOSPC
65 *
66 * get_name:
67 * @get_name should find a name for the given @child in the given @parent
68 * directory. The name should be stored in the @name (with the
69 * understanding that it is already pointing to a a %NAME_MAX+1 sized
70 * buffer. get_name() should return %0 on success, a negative error code
71 * or error. @get_name will be called without @parent->i_mutex held.
72 *
73 * get_parent:
74 * @get_parent should find the parent directory for the given @child which
75 * is also a directory. In the event that it cannot be found, or storage
76 * space cannot be allocated, a %ERR_PTR should be returned.
77 *
78 * get_dentry:
79 * Given a &super_block (@sb) and a pointer to a file-system specific inode
80 * identifier, possibly an inode number, (@inump) get_dentry() should find
81 * the identified inode and return a dentry for that inode. Any suitable
82 * dentry can be returned including, if necessary, a new dentry created with
83 * d_alloc_root. The caller can then find any other extant dentrys by
84 * following the d_alias links. If a new dentry was created using
85 * d_alloc_root, DCACHE_NFSD_DISCONNECTED should be set, and the dentry
86 * should be d_rehash()ed.
87 *
88 * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code
89 * can be returned. The @inump will be whatever was passed to
90 * nfsd_find_fh_dentry() in either the @obj or @parent parameters.
91 *
92 * Locking rules:
93 * get_parent is called with child->d_inode->i_mutex down
94 * get_name is not (which is possibly inconsistent)
95 */
96
97struct export_operations {
98 struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh,
99 int fh_len, int fh_type,
100 int (*acceptable)(void *context, struct dentry *de),
101 void *context);
102 int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len,
103 int connectable);
104 int (*get_name)(struct dentry *parent, char *name,
105 struct dentry *child);
106 struct dentry * (*get_parent)(struct dentry *child);
107 struct dentry * (*get_dentry)(struct super_block *sb, void *inump);
108
109 /* This is set by the exporting module to a standard helper */
110 struct dentry * (*find_exported_dentry)(
111 struct super_block *sb, void *obj, void *parent,
112 int (*acceptable)(void *context, struct dentry *de),
113 void *context);
114};
115
116extern struct dentry *find_exported_dentry(struct super_block *sb, void *obj,
117 void *parent, int (*acceptable)(void *context, struct dentry *de),
118 void *context);
119
120extern int exportfs_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len,
121 int connectable);
122extern struct dentry *exportfs_decode_fh(struct vfsmount *mnt, __u32 *fh,
123 int fh_len, int fileid_type, int (*acceptable)(void *, struct dentry *),
124 void *context);
125
126#endif /* LINUX_EXPORTFS_H */
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h
index 4eda0ed76a48..d149f2959e67 100644
--- a/include/linux/ext2_fs_sb.h
+++ b/include/linux/ext2_fs_sb.h
@@ -33,6 +33,8 @@ struct ext2_sb_info {
33 unsigned long s_gdb_count; /* Number of group descriptor blocks */ 33 unsigned long s_gdb_count; /* Number of group descriptor blocks */
34 unsigned long s_desc_per_block; /* Number of group descriptors per block */ 34 unsigned long s_desc_per_block; /* Number of group descriptors per block */
35 unsigned long s_groups_count; /* Number of groups in the fs */ 35 unsigned long s_groups_count; /* Number of groups in the fs */
36 unsigned long s_overhead_last; /* Last calculated overhead */
37 unsigned long s_blocks_last; /* Last seen block count */
36 struct buffer_head * s_sbh; /* Buffer containing the super block */ 38 struct buffer_head * s_sbh; /* Buffer containing the super block */
37 struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ 39 struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */
38 struct buffer_head ** s_group_desc; 40 struct buffer_head ** s_group_desc;
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h
index f61309c81cc4..d3c08353edf6 100644
--- a/include/linux/ext3_fs_sb.h
+++ b/include/linux/ext3_fs_sb.h
@@ -38,6 +38,8 @@ struct ext3_sb_info {
38 unsigned long s_gdb_count; /* Number of group descriptor blocks */ 38 unsigned long s_gdb_count; /* Number of group descriptor blocks */
39 unsigned long s_desc_per_block; /* Number of group descriptors per block */ 39 unsigned long s_desc_per_block; /* Number of group descriptors per block */
40 unsigned long s_groups_count; /* Number of groups in the fs */ 40 unsigned long s_groups_count; /* Number of groups in the fs */
41 unsigned long s_overhead_last; /* Last calculated overhead */
42 unsigned long s_blocks_last; /* Last seen block count */
41 struct buffer_head * s_sbh; /* Buffer containing the super block */ 43 struct buffer_head * s_sbh; /* Buffer containing the super block */
42 struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */ 44 struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */
43 struct buffer_head ** s_group_desc; 45 struct buffer_head ** s_group_desc;
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index de1f9f78625a..cdee7aaa57aa 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -71,7 +71,7 @@
71/* 71/*
72 * Maximal count of links to a file 72 * Maximal count of links to a file
73 */ 73 */
74#define EXT4_LINK_MAX 32000 74#define EXT4_LINK_MAX 65000
75 75
76/* 76/*
77 * Macro-instructions used to manage several block sizes 77 * Macro-instructions used to manage several block sizes
@@ -102,6 +102,7 @@
102 EXT4_GOOD_OLD_FIRST_INO : \ 102 EXT4_GOOD_OLD_FIRST_INO : \
103 (s)->s_first_ino) 103 (s)->s_first_ino)
104#endif 104#endif
105#define EXT4_BLOCK_ALIGN(size, blkbits) ALIGN((size), (1 << (blkbits)))
105 106
106/* 107/*
107 * Macro-instructions used to manage fragments 108 * Macro-instructions used to manage fragments
@@ -201,6 +202,7 @@ struct ext4_group_desc
201#define EXT4_STATE_JDATA 0x00000001 /* journaled data exists */ 202#define EXT4_STATE_JDATA 0x00000001 /* journaled data exists */
202#define EXT4_STATE_NEW 0x00000002 /* inode is newly created */ 203#define EXT4_STATE_NEW 0x00000002 /* inode is newly created */
203#define EXT4_STATE_XATTR 0x00000004 /* has in-inode xattrs */ 204#define EXT4_STATE_XATTR 0x00000004 /* has in-inode xattrs */
205#define EXT4_STATE_NO_EXPAND 0x00000008 /* No space for expansion */
204 206
205/* Used to pass group descriptor data when online resize is done */ 207/* Used to pass group descriptor data when online resize is done */
206struct ext4_new_group_input { 208struct ext4_new_group_input {
@@ -225,6 +227,11 @@ struct ext4_new_group_data {
225 __u32 free_blocks_count; 227 __u32 free_blocks_count;
226}; 228};
227 229
230/*
231 * Following is used by preallocation code to tell get_blocks() that we
232 * want uninitialzed extents.
233 */
234#define EXT4_CREATE_UNINITIALIZED_EXT 2
228 235
229/* 236/*
230 * ioctl commands 237 * ioctl commands
@@ -237,7 +244,7 @@ struct ext4_new_group_data {
237#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input) 244#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input)
238#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION 245#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION
239#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION 246#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION
240#ifdef CONFIG_JBD_DEBUG 247#ifdef CONFIG_JBD2_DEBUG
241#define EXT4_IOC_WAIT_FOR_READONLY _IOR('f', 99, long) 248#define EXT4_IOC_WAIT_FOR_READONLY _IOR('f', 99, long)
242#endif 249#endif
243#define EXT4_IOC_GETRSVSZ _IOR('f', 5, long) 250#define EXT4_IOC_GETRSVSZ _IOR('f', 5, long)
@@ -253,7 +260,7 @@ struct ext4_new_group_data {
253#define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int) 260#define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int)
254#define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int) 261#define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int)
255#define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int) 262#define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
256#ifdef CONFIG_JBD_DEBUG 263#ifdef CONFIG_JBD2_DEBUG
257#define EXT4_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int) 264#define EXT4_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int)
258#endif 265#endif
259#define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION 266#define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
@@ -282,7 +289,7 @@ struct ext4_inode {
282 __le16 i_uid; /* Low 16 bits of Owner Uid */ 289 __le16 i_uid; /* Low 16 bits of Owner Uid */
283 __le32 i_size; /* Size in bytes */ 290 __le32 i_size; /* Size in bytes */
284 __le32 i_atime; /* Access time */ 291 __le32 i_atime; /* Access time */
285 __le32 i_ctime; /* Creation time */ 292 __le32 i_ctime; /* Inode Change time */
286 __le32 i_mtime; /* Modification time */ 293 __le32 i_mtime; /* Modification time */
287 __le32 i_dtime; /* Deletion Time */ 294 __le32 i_dtime; /* Deletion Time */
288 __le16 i_gid; /* Low 16 bits of Group Id */ 295 __le16 i_gid; /* Low 16 bits of Group Id */
@@ -331,10 +338,85 @@ struct ext4_inode {
331 } osd2; /* OS dependent 2 */ 338 } osd2; /* OS dependent 2 */
332 __le16 i_extra_isize; 339 __le16 i_extra_isize;
333 __le16 i_pad1; 340 __le16 i_pad1;
341 __le32 i_ctime_extra; /* extra Change time (nsec << 2 | epoch) */
342 __le32 i_mtime_extra; /* extra Modification time(nsec << 2 | epoch) */
343 __le32 i_atime_extra; /* extra Access time (nsec << 2 | epoch) */
344 __le32 i_crtime; /* File Creation time */
345 __le32 i_crtime_extra; /* extra FileCreationtime (nsec << 2 | epoch) */
334}; 346};
335 347
336#define i_size_high i_dir_acl 348#define i_size_high i_dir_acl
337 349
350#define EXT4_EPOCH_BITS 2
351#define EXT4_EPOCH_MASK ((1 << EXT4_EPOCH_BITS) - 1)
352#define EXT4_NSEC_MASK (~0UL << EXT4_EPOCH_BITS)
353
354/*
355 * Extended fields will fit into an inode if the filesystem was formatted
356 * with large inodes (-I 256 or larger) and there are not currently any EAs
357 * consuming all of the available space. For new inodes we always reserve
358 * enough space for the kernel's known extended fields, but for inodes
359 * created with an old kernel this might not have been the case. None of
360 * the extended inode fields is critical for correct filesystem operation.
361 * This macro checks if a certain field fits in the inode. Note that
362 * inode-size = GOOD_OLD_INODE_SIZE + i_extra_isize
363 */
364#define EXT4_FITS_IN_INODE(ext4_inode, einode, field) \
365 ((offsetof(typeof(*ext4_inode), field) + \
366 sizeof((ext4_inode)->field)) \
367 <= (EXT4_GOOD_OLD_INODE_SIZE + \
368 (einode)->i_extra_isize)) \
369
370static inline __le32 ext4_encode_extra_time(struct timespec *time)
371{
372 return cpu_to_le32((sizeof(time->tv_sec) > 4 ?
373 time->tv_sec >> 32 : 0) |
374 ((time->tv_nsec << 2) & EXT4_NSEC_MASK));
375}
376
377static inline void ext4_decode_extra_time(struct timespec *time, __le32 extra)
378{
379 if (sizeof(time->tv_sec) > 4)
380 time->tv_sec |= (__u64)(le32_to_cpu(extra) & EXT4_EPOCH_MASK)
381 << 32;
382 time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> 2;
383}
384
385#define EXT4_INODE_SET_XTIME(xtime, inode, raw_inode) \
386do { \
387 (raw_inode)->xtime = cpu_to_le32((inode)->xtime.tv_sec); \
388 if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \
389 (raw_inode)->xtime ## _extra = \
390 ext4_encode_extra_time(&(inode)->xtime); \
391} while (0)
392
393#define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode) \
394do { \
395 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
396 (raw_inode)->xtime = cpu_to_le32((einode)->xtime.tv_sec); \
397 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \
398 (raw_inode)->xtime ## _extra = \
399 ext4_encode_extra_time(&(einode)->xtime); \
400} while (0)
401
402#define EXT4_INODE_GET_XTIME(xtime, inode, raw_inode) \
403do { \
404 (inode)->xtime.tv_sec = (signed)le32_to_cpu((raw_inode)->xtime); \
405 if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \
406 ext4_decode_extra_time(&(inode)->xtime, \
407 raw_inode->xtime ## _extra); \
408} while (0)
409
410#define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \
411do { \
412 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
413 (einode)->xtime.tv_sec = \
414 (signed)le32_to_cpu((raw_inode)->xtime); \
415 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \
416 ext4_decode_extra_time(&(einode)->xtime, \
417 raw_inode->xtime ## _extra); \
418} while (0)
419
338#if defined(__KERNEL__) || defined(__linux__) 420#if defined(__KERNEL__) || defined(__linux__)
339#define i_reserved1 osd1.linux1.l_i_reserved1 421#define i_reserved1 osd1.linux1.l_i_reserved1
340#define i_frag osd2.linux2.l_i_frag 422#define i_frag osd2.linux2.l_i_frag
@@ -533,6 +615,13 @@ static inline struct ext4_inode_info *EXT4_I(struct inode *inode)
533 return container_of(inode, struct ext4_inode_info, vfs_inode); 615 return container_of(inode, struct ext4_inode_info, vfs_inode);
534} 616}
535 617
618static inline struct timespec ext4_current_time(struct inode *inode)
619{
620 return (inode->i_sb->s_time_gran < NSEC_PER_SEC) ?
621 current_fs_time(inode->i_sb) : CURRENT_TIME_SEC;
622}
623
624
536static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) 625static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
537{ 626{
538 return ino == EXT4_ROOT_INO || 627 return ino == EXT4_ROOT_INO ||
@@ -603,6 +692,8 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
603#define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 692#define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
604#define EXT4_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 693#define EXT4_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
605#define EXT4_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 694#define EXT4_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
695#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020
696#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040
606 697
607#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001 698#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001
608#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002 699#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002
@@ -620,6 +711,8 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
620 EXT4_FEATURE_INCOMPAT_64BIT) 711 EXT4_FEATURE_INCOMPAT_64BIT)
621#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ 712#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
622 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ 713 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
714 EXT4_FEATURE_RO_COMPAT_DIR_NLINK | \
715 EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE | \
623 EXT4_FEATURE_RO_COMPAT_BTREE_DIR) 716 EXT4_FEATURE_RO_COMPAT_BTREE_DIR)
624 717
625/* 718/*
@@ -862,6 +955,7 @@ extern int ext4_change_inode_journal_flag(struct inode *, int);
862extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); 955extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *);
863extern void ext4_truncate (struct inode *); 956extern void ext4_truncate (struct inode *);
864extern void ext4_set_inode_flags(struct inode *); 957extern void ext4_set_inode_flags(struct inode *);
958extern void ext4_get_inode_flags(struct ext4_inode_info *);
865extern void ext4_set_aops(struct inode *inode); 959extern void ext4_set_aops(struct inode *inode);
866extern int ext4_writepage_trans_blocks(struct inode *); 960extern int ext4_writepage_trans_blocks(struct inode *);
867extern int ext4_block_truncate_page(handle_t *handle, struct page *page, 961extern int ext4_block_truncate_page(handle_t *handle, struct page *page,
@@ -983,6 +1077,8 @@ extern int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
983extern void ext4_ext_truncate(struct inode *, struct page *); 1077extern void ext4_ext_truncate(struct inode *, struct page *);
984extern void ext4_ext_init(struct super_block *); 1078extern void ext4_ext_init(struct super_block *);
985extern void ext4_ext_release(struct super_block *); 1079extern void ext4_ext_release(struct super_block *);
1080extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset,
1081 loff_t len);
986static inline int 1082static inline int
987ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block, 1083ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block,
988 unsigned long max_blocks, struct buffer_head *bh, 1084 unsigned long max_blocks, struct buffer_head *bh,
diff --git a/include/linux/ext4_fs_extents.h b/include/linux/ext4_fs_extents.h
index acfe59740b03..81406f3655d4 100644
--- a/include/linux/ext4_fs_extents.h
+++ b/include/linux/ext4_fs_extents.h
@@ -141,7 +141,25 @@ typedef int (*ext_prepare_callback)(struct inode *, struct ext4_ext_path *,
141 141
142#define EXT_MAX_BLOCK 0xffffffff 142#define EXT_MAX_BLOCK 0xffffffff
143 143
144#define EXT_MAX_LEN ((1UL << 15) - 1) 144/*
145 * EXT_INIT_MAX_LEN is the maximum number of blocks we can have in an
146 * initialized extent. This is 2^15 and not (2^16 - 1), since we use the
147 * MSB of ee_len field in the extent datastructure to signify if this
148 * particular extent is an initialized extent or an uninitialized (i.e.
149 * preallocated).
150 * EXT_UNINIT_MAX_LEN is the maximum number of blocks we can have in an
151 * uninitialized extent.
152 * If ee_len is <= 0x8000, it is an initialized extent. Otherwise, it is an
153 * uninitialized one. In other words, if MSB of ee_len is set, it is an
154 * uninitialized extent with only one special scenario when ee_len = 0x8000.
155 * In this case we can not have an uninitialized extent of zero length and
156 * thus we make it as a special case of initialized extent with 0x8000 length.
157 * This way we get better extent-to-group alignment for initialized extents.
158 * Hence, the maximum number of blocks we can have in an *initialized*
159 * extent is 2^15 (32768) and in an *uninitialized* extent is 2^15-1 (32767).
160 */
161#define EXT_INIT_MAX_LEN (1UL << 15)
162#define EXT_UNINIT_MAX_LEN (EXT_INIT_MAX_LEN - 1)
145 163
146 164
147#define EXT_FIRST_EXTENT(__hdr__) \ 165#define EXT_FIRST_EXTENT(__hdr__) \
@@ -188,8 +206,31 @@ ext4_ext_invalidate_cache(struct inode *inode)
188 EXT4_I(inode)->i_cached_extent.ec_type = EXT4_EXT_CACHE_NO; 206 EXT4_I(inode)->i_cached_extent.ec_type = EXT4_EXT_CACHE_NO;
189} 207}
190 208
209static inline void ext4_ext_mark_uninitialized(struct ext4_extent *ext)
210{
211 /* We can not have an uninitialized extent of zero length! */
212 BUG_ON((le16_to_cpu(ext->ee_len) & ~EXT_INIT_MAX_LEN) == 0);
213 ext->ee_len |= cpu_to_le16(EXT_INIT_MAX_LEN);
214}
215
216static inline int ext4_ext_is_uninitialized(struct ext4_extent *ext)
217{
218 /* Extent with ee_len of 0x8000 is treated as an initialized extent */
219 return (le16_to_cpu(ext->ee_len) > EXT_INIT_MAX_LEN);
220}
221
222static inline int ext4_ext_get_actual_len(struct ext4_extent *ext)
223{
224 return (le16_to_cpu(ext->ee_len) <= EXT_INIT_MAX_LEN ?
225 le16_to_cpu(ext->ee_len) :
226 (le16_to_cpu(ext->ee_len) - EXT_INIT_MAX_LEN));
227}
228
191extern int ext4_extent_tree_init(handle_t *, struct inode *); 229extern int ext4_extent_tree_init(handle_t *, struct inode *);
192extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *); 230extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *);
231extern int ext4_ext_try_to_merge(struct inode *inode,
232 struct ext4_ext_path *path,
233 struct ext4_extent *);
193extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *); 234extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *);
194extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *); 235extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *);
195extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *); 236extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *);
diff --git a/include/linux/ext4_fs_i.h b/include/linux/ext4_fs_i.h
index 9de494406995..1a511e9905aa 100644
--- a/include/linux/ext4_fs_i.h
+++ b/include/linux/ext4_fs_i.h
@@ -153,6 +153,11 @@ struct ext4_inode_info {
153 153
154 unsigned long i_ext_generation; 154 unsigned long i_ext_generation;
155 struct ext4_ext_cache i_cached_extent; 155 struct ext4_ext_cache i_cached_extent;
156 /*
157 * File creation time. Its function is same as that of
158 * struct timespec i_{a,c,m}time in the generic inode.
159 */
160 struct timespec i_crtime;
156}; 161};
157 162
158#endif /* _LINUX_EXT4_FS_I */ 163#endif /* _LINUX_EXT4_FS_I */
diff --git a/include/linux/ext4_fs_sb.h b/include/linux/ext4_fs_sb.h
index 691a713139ce..1b2ffee12be9 100644
--- a/include/linux/ext4_fs_sb.h
+++ b/include/linux/ext4_fs_sb.h
@@ -39,6 +39,8 @@ struct ext4_sb_info {
39 unsigned long s_gdb_count; /* Number of group descriptor blocks */ 39 unsigned long s_gdb_count; /* Number of group descriptor blocks */
40 unsigned long s_desc_per_block; /* Number of group descriptors per block */ 40 unsigned long s_desc_per_block; /* Number of group descriptors per block */
41 unsigned long s_groups_count; /* Number of groups in the fs */ 41 unsigned long s_groups_count; /* Number of groups in the fs */
42 unsigned long s_overhead_last; /* Last calculated overhead */
43 unsigned long s_blocks_last; /* Last seen block count */
42 struct buffer_head * s_sbh; /* Buffer containing the super block */ 44 struct buffer_head * s_sbh; /* Buffer containing the super block */
43 struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */ 45 struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */
44 struct buffer_head ** s_group_desc; 46 struct buffer_head ** s_group_desc;
@@ -71,7 +73,7 @@ struct ext4_sb_info {
71 struct list_head s_orphan; 73 struct list_head s_orphan;
72 unsigned long s_commit_interval; 74 unsigned long s_commit_interval;
73 struct block_device *journal_bdev; 75 struct block_device *journal_bdev;
74#ifdef CONFIG_JBD_DEBUG 76#ifdef CONFIG_JBD2_DEBUG
75 struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */ 77 struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */
76 wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */ 78 wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */
77#endif 79#endif
@@ -79,6 +81,7 @@ struct ext4_sb_info {
79 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */ 81 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */
80 int s_jquota_fmt; /* Format of quota to use */ 82 int s_jquota_fmt; /* Format of quota to use */
81#endif 83#endif
84 unsigned int s_want_extra_isize; /* New inodes should reserve # bytes */
82 85
83#ifdef EXTENTS_STATS 86#ifdef EXTENTS_STATS
84 /* ext4 extents stats */ 87 /* ext4 extents stats */
diff --git a/include/linux/falloc.h b/include/linux/falloc.h
new file mode 100644
index 000000000000..8e912ab6a072
--- /dev/null
+++ b/include/linux/falloc.h
@@ -0,0 +1,6 @@
1#ifndef _FALLOC_H_
2#define _FALLOC_H_
3
4#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
5
6#endif /* _FALLOC_H_ */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 66226824ab68..cec54106aa87 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -119,6 +119,7 @@ struct dentry;
119#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */ 119#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */
120#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */ 120#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */
121#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */ 121#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */
122#define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */
122#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ 123#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
123#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ 124#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
124#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ 125#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */
@@ -529,6 +530,8 @@ struct fb_cursor_user {
529#define FB_EVENT_CONBLANK 0x0C 530#define FB_EVENT_CONBLANK 0x0C
530/* Get drawing requirements */ 531/* Get drawing requirements */
531#define FB_EVENT_GET_REQ 0x0D 532#define FB_EVENT_GET_REQ 0x0D
533/* Unbind from the console if possible */
534#define FB_EVENT_FB_UNBIND 0x0E
532 535
533struct fb_event { 536struct fb_event {
534 struct fb_info *info; 537 struct fb_info *info;
diff --git a/include/linux/file.h b/include/linux/file.h
index a59001e9ea58..0114fbc78061 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -73,6 +73,7 @@ extern struct file * FASTCALL(fget_light(unsigned int fd, int *fput_needed));
73extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag)); 73extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag));
74extern void put_filp(struct file *); 74extern void put_filp(struct file *);
75extern int get_unused_fd(void); 75extern int get_unused_fd(void);
76extern int get_unused_fd_flags(int flags);
76extern void FASTCALL(put_unused_fd(unsigned int fd)); 77extern void FASTCALL(put_unused_fd(unsigned int fd));
77struct kmem_cache; 78struct kmem_cache;
78 79
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index efbe1fda1a22..1a45d6f41b09 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -30,16 +30,38 @@
30#define FW_CDEV_EVENT_REQUEST 0x02 30#define FW_CDEV_EVENT_REQUEST 0x02
31#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 31#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03
32 32
33/* The 'closure' fields are for user space to use. Data passed in the 33/**
34 * 'closure' field for a request will be returned in the corresponding 34 * struct fw_cdev_event_common - Common part of all fw_cdev_event_ types
35 * event. It's a 64-bit type so that it's a fixed size type big 35 * @closure: For arbitrary use by userspace
36 * enough to hold a pointer on all platforms. */ 36 * @type: Discriminates the fw_cdev_event_ types
37 37 *
38 * This struct may be used to access generic members of all fw_cdev_event_
39 * types regardless of the specific type.
40 *
41 * Data passed in the @closure field for a request will be returned in the
42 * corresponding event. It is big enough to hold a pointer on all platforms.
43 * The ioctl used to set @closure depends on the @type of event.
44 */
38struct fw_cdev_event_common { 45struct fw_cdev_event_common {
39 __u64 closure; 46 __u64 closure;
40 __u32 type; 47 __u32 type;
41}; 48};
42 49
50/**
51 * struct fw_cdev_event_bus_reset - Sent when a bus reset occurred
52 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_GET_INFO ioctl
53 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_BUS_RESET
54 * @node_id: New node ID of this node
55 * @local_node_id: Node ID of the local node, i.e. of the controller
56 * @bm_node_id: Node ID of the bus manager
57 * @irm_node_id: Node ID of the iso resource manager
58 * @root_node_id: Node ID of the root node
59 * @generation: New bus generation
60 *
61 * This event is sent when the bus the device belongs to goes through a bus
62 * reset. It provides information about the new bus configuration, such as
63 * new node ID for this device, new root ID, and others.
64 */
43struct fw_cdev_event_bus_reset { 65struct fw_cdev_event_bus_reset {
44 __u64 closure; 66 __u64 closure;
45 __u32 type; 67 __u32 type;
@@ -51,6 +73,20 @@ struct fw_cdev_event_bus_reset {
51 __u32 generation; 73 __u32 generation;
52}; 74};
53 75
76/**
77 * struct fw_cdev_event_response - Sent when a response packet was received
78 * @closure: See &fw_cdev_event_common;
79 * set by %FW_CDEV_IOC_SEND_REQUEST ioctl
80 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_RESPONSE
81 * @rcode: Response code returned by the remote node
82 * @length: Data length, i.e. the response's payload size in bytes
83 * @data: Payload data, if any
84 *
85 * This event is sent when the stack receives a response to an outgoing request
86 * sent by %FW_CDEV_IOC_SEND_REQUEST ioctl. The payload data for responses
87 * carrying data (read and lock responses) follows immediately and can be
88 * accessed through the @data field.
89 */
54struct fw_cdev_event_response { 90struct fw_cdev_event_response {
55 __u64 closure; 91 __u64 closure;
56 __u32 type; 92 __u32 type;
@@ -59,6 +95,25 @@ struct fw_cdev_event_response {
59 __u32 data[0]; 95 __u32 data[0];
60}; 96};
61 97
98/**
99 * struct fw_cdev_event_request - Sent on incoming request to an address region
100 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl
101 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST
102 * @tcode: Transaction code of the incoming request
103 * @offset: The offset into the 48-bit per-node address space
104 * @handle: Reference to the kernel-side pending request
105 * @length: Data length, i.e. the request's payload size in bytes
106 * @data: Incoming data, if any
107 *
108 * This event is sent when the stack receives an incoming request to an address
109 * region registered using the %FW_CDEV_IOC_ALLOCATE ioctl. The request is
110 * guaranteed to be completely contained in the specified region. Userspace is
111 * responsible for sending the response by %FW_CDEV_IOC_SEND_RESPONSE ioctl,
112 * using the same @handle.
113 *
114 * The payload data for requests carrying data (write and lock requests)
115 * follows immediately and can be accessed through the @data field.
116 */
62struct fw_cdev_event_request { 117struct fw_cdev_event_request {
63 __u64 closure; 118 __u64 closure;
64 __u32 type; 119 __u32 type;
@@ -69,14 +124,39 @@ struct fw_cdev_event_request {
69 __u32 data[0]; 124 __u32 data[0];
70}; 125};
71 126
127/**
128 * struct fw_cdev_event_iso_interrupt - Sent when an iso packet was completed
129 * @closure: See &fw_cdev_event_common;
130 * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl
131 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_ISO_INTERRUPT
132 * @cycle: Cycle counter of the interrupt packet
133 * @header_length: Total length of following headers, in bytes
134 * @header: Stripped headers, if any
135 *
136 * This event is sent when the controller has completed an &fw_cdev_iso_packet
137 * with the %FW_CDEV_ISO_INTERRUPT bit set. In the receive case, the headers
138 * stripped of all packets up until and including the interrupt packet are
139 * returned in the @header field.
140 */
72struct fw_cdev_event_iso_interrupt { 141struct fw_cdev_event_iso_interrupt {
73 __u64 closure; 142 __u64 closure;
74 __u32 type; 143 __u32 type;
75 __u32 cycle; 144 __u32 cycle;
76 __u32 header_length; /* Length in bytes of following headers. */ 145 __u32 header_length;
77 __u32 header[0]; 146 __u32 header[0];
78}; 147};
79 148
149/**
150 * union fw_cdev_event - Convenience union of fw_cdev_event_ types
151 * @common: Valid for all types
152 * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET
153 * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE
154 * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST
155 * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT
156 *
157 * Convenience union for userspace use. Events could be read(2) into a char
158 * buffer and then cast to this union for further processing.
159 */
80union fw_cdev_event { 160union fw_cdev_event {
81 struct fw_cdev_event_common common; 161 struct fw_cdev_event_common common;
82 struct fw_cdev_event_bus_reset bus_reset; 162 struct fw_cdev_event_bus_reset bus_reset;
@@ -105,35 +185,47 @@ union fw_cdev_event {
105 */ 185 */
106#define FW_CDEV_VERSION 1 186#define FW_CDEV_VERSION 1
107 187
188/**
189 * struct fw_cdev_get_info - General purpose information ioctl
190 * @version: The version field is just a running serial number.
191 * We never break backwards compatibility, but may add more
192 * structs and ioctls in later revisions.
193 * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration
194 * ROM will be copied into that user space address. In either
195 * case, @rom_length is updated with the actual length of the
196 * configuration ROM.
197 * @rom: If non-zero, address of a buffer to be filled by a copy of the
198 * local node's configuration ROM
199 * @bus_reset: If non-zero, address of a buffer to be filled by a
200 * &struct fw_cdev_event_bus_reset with the current state
201 * of the bus. This does not cause a bus reset to happen.
202 * @bus_reset_closure: Value of &closure in this and subsequent bus reset events
203 * @card: The index of the card this device belongs to
204 */
108struct fw_cdev_get_info { 205struct fw_cdev_get_info {
109 /* The version field is just a running serial number. We
110 * never break backwards compatibility. Userspace passes in
111 * the version it expects and the kernel passes back the
112 * highest version it can provide. Even if the structs in
113 * this interface are extended in a later version, the kernel
114 * will not copy back more data than what was present in the
115 * interface version userspace expects. */
116 __u32 version; 206 __u32 version;
117
118 /* If non-zero, at most rom_length bytes of config rom will be
119 * copied into that user space address. In either case,
120 * rom_length is updated with the actual length of the config
121 * rom. */
122 __u32 rom_length; 207 __u32 rom_length;
123 __u64 rom; 208 __u64 rom;
124
125 /* If non-zero, a fw_cdev_event_bus_reset struct will be
126 * copied here with the current state of the bus. This does
127 * not cause a bus reset to happen. The value of closure in
128 * this and sub-sequent bus reset events is set to
129 * bus_reset_closure. */
130 __u64 bus_reset; 209 __u64 bus_reset;
131 __u64 bus_reset_closure; 210 __u64 bus_reset_closure;
132
133 /* The index of the card this devices belongs to. */
134 __u32 card; 211 __u32 card;
135}; 212};
136 213
214/**
215 * struct fw_cdev_send_request - Send an asynchronous request packet
216 * @tcode: Transaction code of the request
217 * @length: Length of outgoing payload, in bytes
218 * @offset: 48-bit offset at destination node
219 * @closure: Passed back to userspace in the response event
220 * @data: Userspace pointer to payload
221 * @generation: The bus generation where packet is valid
222 *
223 * Send a request to the device. This ioctl implements all outgoing requests.
224 * Both quadlet and block request specify the payload as a pointer to the data
225 * in the @data field. Once the transaction completes, the kernel writes an
226 * &fw_cdev_event_request event back. The @closure field is passed back to
227 * user space in the response event.
228 */
137struct fw_cdev_send_request { 229struct fw_cdev_send_request {
138 __u32 tcode; 230 __u32 tcode;
139 __u32 length; 231 __u32 length;
@@ -143,6 +235,19 @@ struct fw_cdev_send_request {
143 __u32 generation; 235 __u32 generation;
144}; 236};
145 237
238/**
239 * struct fw_cdev_send_response - Send an asynchronous response packet
240 * @rcode: Response code as determined by the userspace handler
241 * @length: Length of outgoing payload, in bytes
242 * @data: Userspace pointer to payload
243 * @handle: The handle from the &fw_cdev_event_request
244 *
245 * Send a response to an incoming request. By setting up an address range using
246 * the %FW_CDEV_IOC_ALLOCATE ioctl, userspace can listen for incoming requests. An
247 * incoming request will generate an %FW_CDEV_EVENT_REQUEST, and userspace must
248 * send a reply using this ioctl. The event has a handle to the kernel-side
249 * pending transaction, which should be used with this ioctl.
250 */
146struct fw_cdev_send_response { 251struct fw_cdev_send_response {
147 __u32 rcode; 252 __u32 rcode;
148 __u32 length; 253 __u32 length;
@@ -150,6 +255,21 @@ struct fw_cdev_send_response {
150 __u32 handle; 255 __u32 handle;
151}; 256};
152 257
258/**
259 * struct fw_cdev_allocate - Allocate a CSR address range
260 * @offset: Start offset of the address range
261 * @closure: To be passed back to userspace in request events
262 * @length: Length of the address range, in bytes
263 * @handle: Handle to the allocation, written by the kernel
264 *
265 * Allocate an address range in the 48-bit address space on the local node
266 * (the controller). This allows userspace to listen for requests with an
267 * offset within that address range. When the kernel receives a request
268 * within the range, an &fw_cdev_event_request event will be written back.
269 * The @closure field is passed back to userspace in the response event.
270 * The @handle field is an out parameter, returning a handle to the allocated
271 * range to be used for later deallocation of the range.
272 */
153struct fw_cdev_allocate { 273struct fw_cdev_allocate {
154 __u64 offset; 274 __u64 offset;
155 __u64 closure; 275 __u64 closure;
@@ -157,6 +277,11 @@ struct fw_cdev_allocate {
157 __u32 handle; 277 __u32 handle;
158}; 278};
159 279
280/**
281 * struct fw_cdev_deallocate - Free an address range allocation
282 * @handle: Handle to the address range, as returned by the kernel when the
283 * range was allocated
284 */
160struct fw_cdev_deallocate { 285struct fw_cdev_deallocate {
161 __u32 handle; 286 __u32 handle;
162}; 287};
@@ -164,10 +289,41 @@ struct fw_cdev_deallocate {
164#define FW_CDEV_LONG_RESET 0 289#define FW_CDEV_LONG_RESET 0
165#define FW_CDEV_SHORT_RESET 1 290#define FW_CDEV_SHORT_RESET 1
166 291
292/**
293 * struct fw_cdev_initiate_bus_reset - Initiate a bus reset
294 * @type: %FW_CDEV_SHORT_RESET or %FW_CDEV_LONG_RESET
295 *
296 * Initiate a bus reset for the bus this device is on. The bus reset can be
297 * either the original (long) bus reset or the arbitrated (short) bus reset
298 * introduced in 1394a-2000.
299 */
167struct fw_cdev_initiate_bus_reset { 300struct fw_cdev_initiate_bus_reset {
168 __u32 type; 301 __u32 type; /* FW_CDEV_SHORT_RESET or FW_CDEV_LONG_RESET */
169}; 302};
170 303
304/**
305 * struct fw_cdev_add_descriptor - Add contents to the local node's config ROM
306 * @immediate: If non-zero, immediate key to insert before pointer
307 * @key: Upper 8 bits of root directory pointer
308 * @data: Userspace pointer to contents of descriptor block
309 * @length: Length of descriptor block data, in bytes
310 * @handle: Handle to the descriptor, written by the kernel
311 *
312 * Add a descriptor block and optionally a preceding immediate key to the local
313 * node's configuration ROM.
314 *
315 * The @key field specifies the upper 8 bits of the descriptor root directory
316 * pointer and the @data and @length fields specify the contents. The @key
317 * should be of the form 0xXX000000. The offset part of the root directory entry
318 * will be filled in by the kernel.
319 *
320 * If not 0, the @immediate field specifies an immediate key which will be
321 * inserted before the root directory pointer.
322 *
323 * If successful, the kernel adds the descriptor and writes back a handle to the
324 * kernel-side object to be used for later removal of the descriptor block and
325 * immediate key.
326 */
171struct fw_cdev_add_descriptor { 327struct fw_cdev_add_descriptor {
172 __u32 immediate; 328 __u32 immediate;
173 __u32 key; 329 __u32 key;
@@ -176,6 +332,14 @@ struct fw_cdev_add_descriptor {
176 __u32 handle; 332 __u32 handle;
177}; 333};
178 334
335/**
336 * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM
337 * @handle: Handle to the descriptor, as returned by the kernel when the
338 * descriptor was added
339 *
340 * Remove a descriptor block and accompanying immediate key from the local
341 * node's configuration ROM.
342 */
179struct fw_cdev_remove_descriptor { 343struct fw_cdev_remove_descriptor {
180 __u32 handle; 344 __u32 handle;
181}; 345};
@@ -183,12 +347,24 @@ struct fw_cdev_remove_descriptor {
183#define FW_CDEV_ISO_CONTEXT_TRANSMIT 0 347#define FW_CDEV_ISO_CONTEXT_TRANSMIT 0
184#define FW_CDEV_ISO_CONTEXT_RECEIVE 1 348#define FW_CDEV_ISO_CONTEXT_RECEIVE 1
185 349
186#define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1 350/**
187#define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2 351 * struct fw_cdev_create_iso_context - Create a context for isochronous IO
188#define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4 352 * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE
189#define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8 353 * @header_size: Header size to strip for receive contexts
190#define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15 354 * @channel: Channel to bind to
191 355 * @speed: Speed to transmit at
356 * @closure: To be returned in &fw_cdev_event_iso_interrupt
357 * @handle: Handle to context, written back by kernel
358 *
359 * Prior to sending or receiving isochronous I/O, a context must be created.
360 * The context records information about the transmit or receive configuration
361 * and typically maps to an underlying hardware resource. A context is set up
362 * for either sending or receiving. It is bound to a specific isochronous
363 * channel.
364 *
365 * If a context was successfully created, the kernel writes back a handle to the
366 * context, which must be passed in for subsequent operations on that context.
367 */
192struct fw_cdev_create_iso_context { 368struct fw_cdev_create_iso_context {
193 __u32 type; 369 __u32 type;
194 __u32 header_size; 370 __u32 header_size;
@@ -201,15 +377,49 @@ struct fw_cdev_create_iso_context {
201#define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v) 377#define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v)
202#define FW_CDEV_ISO_INTERRUPT (1 << 16) 378#define FW_CDEV_ISO_INTERRUPT (1 << 16)
203#define FW_CDEV_ISO_SKIP (1 << 17) 379#define FW_CDEV_ISO_SKIP (1 << 17)
380#define FW_CDEV_ISO_SYNC (1 << 17)
204#define FW_CDEV_ISO_TAG(v) ((v) << 18) 381#define FW_CDEV_ISO_TAG(v) ((v) << 18)
205#define FW_CDEV_ISO_SY(v) ((v) << 20) 382#define FW_CDEV_ISO_SY(v) ((v) << 20)
206#define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24) 383#define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24)
207 384
385/**
386 * struct fw_cdev_iso_packet - Isochronous packet
387 * @control: Contains the header length (8 uppermost bits), the sy field
388 * (4 bits), the tag field (2 bits), a sync flag (1 bit),
389 * a skip flag (1 bit), an interrupt flag (1 bit), and the
390 * payload length (16 lowermost bits)
391 * @header: Header and payload
392 *
393 * &struct fw_cdev_iso_packet is used to describe isochronous packet queues.
394 *
395 * Use the FW_CDEV_ISO_ macros to fill in @control. The sy and tag fields are
396 * specified by IEEE 1394a and IEC 61883.
397 *
398 * FIXME - finish this documentation
399 */
208struct fw_cdev_iso_packet { 400struct fw_cdev_iso_packet {
209 __u32 control; 401 __u32 control;
210 __u32 header[0]; 402 __u32 header[0];
211}; 403};
212 404
405/**
406 * struct fw_cdev_queue_iso - Queue isochronous packets for I/O
407 * @packets: Userspace pointer to packet data
408 * @data: Pointer into mmap()'ed payload buffer
409 * @size: Size of packet data in bytes
410 * @handle: Isochronous context handle
411 *
412 * Queue a number of isochronous packets for reception or transmission.
413 * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs,
414 * which describe how to transmit from or receive into a contiguous region
415 * of a mmap()'ed payload buffer. As part of the packet descriptors,
416 * a series of headers can be supplied, which will be prepended to the
417 * payload during DMA.
418 *
419 * The kernel may or may not queue all packets, but will write back updated
420 * values of the @packets, @data and @size fields, so the ioctl can be
421 * resubmitted easily.
422 */
213struct fw_cdev_queue_iso { 423struct fw_cdev_queue_iso {
214 __u64 packets; 424 __u64 packets;
215 __u64 data; 425 __u64 data;
@@ -217,6 +427,23 @@ struct fw_cdev_queue_iso {
217 __u32 handle; 427 __u32 handle;
218}; 428};
219 429
430#define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1
431#define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2
432#define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4
433#define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8
434#define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15
435
436/**
437 * struct fw_cdev_start_iso - Start an isochronous transmission or reception
438 * @cycle: Cycle in which to start I/O. If @cycle is greater than or
439 * equal to 0, the I/O will start on that cycle.
440 * @sync: Determines the value to wait for for receive packets that have
441 * the %FW_CDEV_ISO_SYNC bit set
442 * @tags: Tag filter bit mask. Only valid for isochronous reception.
443 * Determines the tag values for which packets will be accepted.
444 * Use FW_CDEV_ISO_CONTEXT_MATCH_ macros to set @tags.
445 * @handle: Isochronous context handle within which to transmit or receive
446 */
220struct fw_cdev_start_iso { 447struct fw_cdev_start_iso {
221 __s32 cycle; 448 __s32 cycle;
222 __u32 sync; 449 __u32 sync;
@@ -224,6 +451,10 @@ struct fw_cdev_start_iso {
224 __u32 handle; 451 __u32 handle;
225}; 452};
226 453
454/**
455 * struct fw_cdev_stop_iso - Stop an isochronous transmission or reception
456 * @handle: Handle of isochronous context to stop
457 */
227struct fw_cdev_stop_iso { 458struct fw_cdev_stop_iso {
228 __u32 handle; 459 __u32 handle;
229}; 460};
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 4631086f5060..c8e02de737f6 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -1,5 +1,8 @@
1/* Freezer declarations */ 1/* Freezer declarations */
2 2
3#ifndef FREEZER_H_INCLUDED
4#define FREEZER_H_INCLUDED
5
3#include <linux/sched.h> 6#include <linux/sched.h>
4 7
5#ifdef CONFIG_PM 8#ifdef CONFIG_PM
@@ -22,7 +25,7 @@ static inline int freezing(struct task_struct *p)
22/* 25/*
23 * Request that a process be frozen 26 * Request that a process be frozen
24 */ 27 */
25static inline void freeze(struct task_struct *p) 28static inline void set_freeze_flag(struct task_struct *p)
26{ 29{
27 set_tsk_thread_flag(p, TIF_FREEZE); 30 set_tsk_thread_flag(p, TIF_FREEZE);
28} 31}
@@ -30,7 +33,7 @@ static inline void freeze(struct task_struct *p)
30/* 33/*
31 * Sometimes we may need to cancel the previous 'freeze' request 34 * Sometimes we may need to cancel the previous 'freeze' request
32 */ 35 */
33static inline void do_not_freeze(struct task_struct *p) 36static inline void clear_freeze_flag(struct task_struct *p)
34{ 37{
35 clear_tsk_thread_flag(p, TIF_FREEZE); 38 clear_tsk_thread_flag(p, TIF_FREEZE);
36} 39}
@@ -53,7 +56,7 @@ static inline int thaw_process(struct task_struct *p)
53 wake_up_process(p); 56 wake_up_process(p);
54 return 1; 57 return 1;
55 } 58 }
56 clear_tsk_thread_flag(p, TIF_FREEZE); 59 clear_freeze_flag(p);
57 task_unlock(p); 60 task_unlock(p);
58 return 0; 61 return 0;
59} 62}
@@ -115,10 +118,19 @@ static inline int freezer_should_skip(struct task_struct *p)
115 return !!(p->flags & PF_FREEZER_SKIP); 118 return !!(p->flags & PF_FREEZER_SKIP);
116} 119}
117 120
121/*
122 * Tell the freezer that the current task should be frozen by it
123 */
124static inline void set_freezable(void)
125{
126 current->flags &= ~PF_NOFREEZE;
127}
128
118#else 129#else
119static inline int frozen(struct task_struct *p) { return 0; } 130static inline int frozen(struct task_struct *p) { return 0; }
120static inline int freezing(struct task_struct *p) { return 0; } 131static inline int freezing(struct task_struct *p) { return 0; }
121static inline void freeze(struct task_struct *p) { BUG(); } 132static inline void set_freeze_flag(struct task_struct *p) {}
133static inline void clear_freeze_flag(struct task_struct *p) {}
122static inline int thaw_process(struct task_struct *p) { return 1; } 134static inline int thaw_process(struct task_struct *p) { return 1; }
123 135
124static inline void refrigerator(void) {} 136static inline void refrigerator(void) {}
@@ -130,4 +142,7 @@ static inline int try_to_freeze(void) { return 0; }
130static inline void freezer_do_not_count(void) {} 142static inline void freezer_do_not_count(void) {}
131static inline void freezer_count(void) {} 143static inline void freezer_count(void) {}
132static inline int freezer_should_skip(struct task_struct *p) { return 0; } 144static inline int freezer_should_skip(struct task_struct *p) { return 0; }
145static inline void set_freezable(void) {}
133#endif 146#endif
147
148#endif /* FREEZER_H_INCLUDED */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7cf0c54a46a7..d33beadd9a43 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -44,7 +44,7 @@ extern int get_max_files(void);
44struct inodes_stat_t { 44struct inodes_stat_t {
45 int nr_inodes; 45 int nr_inodes;
46 int nr_unused; 46 int nr_unused;
47 int dummy[5]; 47 int dummy[5]; /* padding for sysctl ABI compatibility */
48}; 48};
49extern struct inodes_stat_t inodes_stat; 49extern struct inodes_stat_t inodes_stat;
50 50
@@ -283,11 +283,14 @@ extern int dir_notify_enable;
283#include <linux/init.h> 283#include <linux/init.h>
284#include <linux/pid.h> 284#include <linux/pid.h>
285#include <linux/mutex.h> 285#include <linux/mutex.h>
286#include <linux/sysctl.h>
287#include <linux/capability.h>
286 288
287#include <asm/atomic.h> 289#include <asm/atomic.h>
288#include <asm/semaphore.h> 290#include <asm/semaphore.h>
289#include <asm/byteorder.h> 291#include <asm/byteorder.h>
290 292
293struct export_operations;
291struct hd_geometry; 294struct hd_geometry;
292struct iovec; 295struct iovec;
293struct nameidata; 296struct nameidata;
@@ -694,20 +697,26 @@ struct fown_struct {
694 * Track a single file's readahead state 697 * Track a single file's readahead state
695 */ 698 */
696struct file_ra_state { 699struct file_ra_state {
697 unsigned long start; /* Current window */ 700 pgoff_t start; /* where readahead started */
698 unsigned long size; 701 unsigned long size; /* # of readahead pages */
699 unsigned long flags; /* ra flags RA_FLAG_xxx*/ 702 unsigned long async_size; /* do asynchronous readahead when
700 unsigned long cache_hit; /* cache hit count*/ 703 there are only # of pages ahead */
701 unsigned long prev_index; /* Cache last read() position */ 704
702 unsigned long ahead_start; /* Ahead window */
703 unsigned long ahead_size;
704 unsigned long ra_pages; /* Maximum readahead window */ 705 unsigned long ra_pages; /* Maximum readahead window */
705 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */ 706 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */
706 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */ 707 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */
708 unsigned long prev_index; /* Cache last read() position */
707 unsigned int prev_offset; /* Offset where last read() ended in a page */ 709 unsigned int prev_offset; /* Offset where last read() ended in a page */
708}; 710};
709#define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */ 711
710#define RA_FLAG_INCACHE 0x02 /* file is already in cache */ 712/*
713 * Check if @index falls in the readahead windows.
714 */
715static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index)
716{
717 return (index >= ra->start &&
718 index < ra->start + ra->size);
719}
711 720
712struct file { 721struct file {
713 /* 722 /*
@@ -820,6 +829,10 @@ struct file_lock {
820 union { 829 union {
821 struct nfs_lock_info nfs_fl; 830 struct nfs_lock_info nfs_fl;
822 struct nfs4_lock_info nfs4_fl; 831 struct nfs4_lock_info nfs4_fl;
832 struct {
833 struct list_head link; /* link in AFS vnode's pending_locks list */
834 int state; /* state of grant or error if -ve */
835 } afs;
823 } fl_u; 836 } fl_u;
824}; 837};
825 838
@@ -855,7 +868,7 @@ extern void locks_init_lock(struct file_lock *);
855extern void locks_copy_lock(struct file_lock *, struct file_lock *); 868extern void locks_copy_lock(struct file_lock *, struct file_lock *);
856extern void locks_remove_posix(struct file *, fl_owner_t); 869extern void locks_remove_posix(struct file *, fl_owner_t);
857extern void locks_remove_flock(struct file *); 870extern void locks_remove_flock(struct file *);
858extern int posix_test_lock(struct file *, struct file_lock *); 871extern void posix_test_lock(struct file *, struct file_lock *);
859extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); 872extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
860extern int posix_lock_file_wait(struct file *, struct file_lock *); 873extern int posix_lock_file_wait(struct file *, struct file_lock *);
861extern int posix_unblock_lock(struct file *, struct file_lock *); 874extern int posix_unblock_lock(struct file *, struct file_lock *);
@@ -866,6 +879,7 @@ extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
866extern int __break_lease(struct inode *inode, unsigned int flags); 879extern int __break_lease(struct inode *inode, unsigned int flags);
867extern void lease_get_mtime(struct inode *, struct timespec *time); 880extern void lease_get_mtime(struct inode *, struct timespec *time);
868extern int setlease(struct file *, long, struct file_lock **); 881extern int setlease(struct file *, long, struct file_lock **);
882extern int vfs_setlease(struct file *, long, struct file_lock **);
869extern int lease_modify(struct file_lock **, int); 883extern int lease_modify(struct file_lock **, int);
870extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 884extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
871extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 885extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
@@ -938,6 +952,7 @@ struct super_block {
938 struct list_head s_files; 952 struct list_head s_files;
939 953
940 struct block_device *s_bdev; 954 struct block_device *s_bdev;
955 struct mtd_info *s_mtd;
941 struct list_head s_instances; 956 struct list_head s_instances;
942 struct quota_info s_dquot; /* Diskquota specific options */ 957 struct quota_info s_dquot; /* Diskquota specific options */
943 958
@@ -983,6 +998,9 @@ enum {
983#define put_fs_excl() atomic_dec(&current->fs_excl) 998#define put_fs_excl() atomic_dec(&current->fs_excl)
984#define has_fs_excl() atomic_read(&current->fs_excl) 999#define has_fs_excl() atomic_read(&current->fs_excl)
985 1000
1001#define is_owner_or_cap(inode) \
1002 ((current->fsuid == (inode)->i_uid) || capable(CAP_FOWNER))
1003
986/* not quite ready to be deprecated, but... */ 1004/* not quite ready to be deprecated, but... */
987extern void lock_super(struct super_block *); 1005extern void lock_super(struct super_block *);
988extern void unlock_super(struct super_block *); 1006extern void unlock_super(struct super_block *);
@@ -1053,7 +1071,7 @@ struct block_device_operations {
1053}; 1071};
1054 1072
1055/* 1073/*
1056 * "descriptor" for what we're up to with a read for sendfile(). 1074 * "descriptor" for what we're up to with a read.
1057 * This allows us to use the same read code yet 1075 * This allows us to use the same read code yet
1058 * have multiple different users of the data that 1076 * have multiple different users of the data that
1059 * we read from a file. 1077 * we read from a file.
@@ -1104,7 +1122,6 @@ struct file_operations {
1104 int (*aio_fsync) (struct kiocb *, int datasync); 1122 int (*aio_fsync) (struct kiocb *, int datasync);
1105 int (*fasync) (int, struct file *, int); 1123 int (*fasync) (int, struct file *, int);
1106 int (*lock) (struct file *, int, struct file_lock *); 1124 int (*lock) (struct file *, int, struct file_lock *);
1107 ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *);
1108 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); 1125 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
1109 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 1126 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
1110 int (*check_flags)(int); 1127 int (*check_flags)(int);
@@ -1112,6 +1129,7 @@ struct file_operations {
1112 int (*flock) (struct file *, int, struct file_lock *); 1129 int (*flock) (struct file *, int, struct file_lock *);
1113 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); 1130 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1114 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); 1131 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
1132 int (*setlease)(struct file *, long, struct file_lock **);
1115}; 1133};
1116 1134
1117struct inode_operations { 1135struct inode_operations {
@@ -1137,6 +1155,8 @@ struct inode_operations {
1137 ssize_t (*listxattr) (struct dentry *, char *, size_t); 1155 ssize_t (*listxattr) (struct dentry *, char *, size_t);
1138 int (*removexattr) (struct dentry *, const char *); 1156 int (*removexattr) (struct dentry *, const char *);
1139 void (*truncate_range)(struct inode *, loff_t, loff_t); 1157 void (*truncate_range)(struct inode *, loff_t, loff_t);
1158 long (*fallocate)(struct inode *inode, int mode, loff_t offset,
1159 loff_t len);
1140}; 1160};
1141 1161
1142struct seq_file; 1162struct seq_file;
@@ -1210,6 +1230,14 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
1210 __mark_inode_dirty(inode, I_DIRTY_SYNC); 1230 __mark_inode_dirty(inode, I_DIRTY_SYNC);
1211} 1231}
1212 1232
1233/**
1234 * inc_nlink - directly increment an inode's link count
1235 * @inode: inode
1236 *
1237 * This is a low-level filesystem helper to replace any
1238 * direct filesystem manipulation of i_nlink. Currently,
1239 * it is only here for parity with dec_nlink().
1240 */
1213static inline void inc_nlink(struct inode *inode) 1241static inline void inc_nlink(struct inode *inode)
1214{ 1242{
1215 inode->i_nlink++; 1243 inode->i_nlink++;
@@ -1221,11 +1249,30 @@ static inline void inode_inc_link_count(struct inode *inode)
1221 mark_inode_dirty(inode); 1249 mark_inode_dirty(inode);
1222} 1250}
1223 1251
1252/**
1253 * drop_nlink - directly drop an inode's link count
1254 * @inode: inode
1255 *
1256 * This is a low-level filesystem helper to replace any
1257 * direct filesystem manipulation of i_nlink. In cases
1258 * where we are attempting to track writes to the
1259 * filesystem, a decrement to zero means an imminent
1260 * write when the file is truncated and actually unlinked
1261 * on the filesystem.
1262 */
1224static inline void drop_nlink(struct inode *inode) 1263static inline void drop_nlink(struct inode *inode)
1225{ 1264{
1226 inode->i_nlink--; 1265 inode->i_nlink--;
1227} 1266}
1228 1267
1268/**
1269 * clear_nlink - directly zero an inode's link count
1270 * @inode: inode
1271 *
1272 * This is a low-level filesystem helper to replace any
1273 * direct filesystem manipulation of i_nlink. See
1274 * drop_nlink() for why we care about i_nlink hitting zero.
1275 */
1229static inline void clear_nlink(struct inode *inode) 1276static inline void clear_nlink(struct inode *inode)
1230{ 1277{
1231 inode->i_nlink = 0; 1278 inode->i_nlink = 0;
@@ -1246,119 +1293,6 @@ static inline void file_accessed(struct file *file)
1246 1293
1247int sync_inode(struct inode *inode, struct writeback_control *wbc); 1294int sync_inode(struct inode *inode, struct writeback_control *wbc);
1248 1295
1249/**
1250 * struct export_operations - for nfsd to communicate with file systems
1251 * @decode_fh: decode a file handle fragment and return a &struct dentry
1252 * @encode_fh: encode a file handle fragment from a dentry
1253 * @get_name: find the name for a given inode in a given directory
1254 * @get_parent: find the parent of a given directory
1255 * @get_dentry: find a dentry for the inode given a file handle sub-fragment
1256 * @find_exported_dentry:
1257 * set by the exporting module to a standard helper function.
1258 *
1259 * Description:
1260 * The export_operations structure provides a means for nfsd to communicate
1261 * with a particular exported file system - particularly enabling nfsd and
1262 * the filesystem to co-operate when dealing with file handles.
1263 *
1264 * export_operations contains two basic operation for dealing with file
1265 * handles, decode_fh() and encode_fh(), and allows for some other
1266 * operations to be defined which standard helper routines use to get
1267 * specific information from the filesystem.
1268 *
1269 * nfsd encodes information use to determine which filesystem a filehandle
1270 * applies to in the initial part of the file handle. The remainder, termed
1271 * a file handle fragment, is controlled completely by the filesystem. The
1272 * standard helper routines assume that this fragment will contain one or
1273 * two sub-fragments, one which identifies the file, and one which may be
1274 * used to identify the (a) directory containing the file.
1275 *
1276 * In some situations, nfsd needs to get a dentry which is connected into a
1277 * specific part of the file tree. To allow for this, it passes the
1278 * function acceptable() together with a @context which can be used to see
1279 * if the dentry is acceptable. As there can be multiple dentrys for a
1280 * given file, the filesystem should check each one for acceptability before
1281 * looking for the next. As soon as an acceptable one is found, it should
1282 * be returned.
1283 *
1284 * decode_fh:
1285 * @decode_fh is given a &struct super_block (@sb), a file handle fragment
1286 * (@fh, @fh_len) and an acceptability testing function (@acceptable,
1287 * @context). It should return a &struct dentry which refers to the same
1288 * file that the file handle fragment refers to, and which passes the
1289 * acceptability test. If it cannot, it should return a %NULL pointer if
1290 * the file was found but no acceptable &dentries were available, or a
1291 * %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or
1292 * %ENOMEM).
1293 *
1294 * encode_fh:
1295 * @encode_fh should store in the file handle fragment @fh (using at most
1296 * @max_len bytes) information that can be used by @decode_fh to recover the
1297 * file refered to by the &struct dentry @de. If the @connectable flag is
1298 * set, the encode_fh() should store sufficient information so that a good
1299 * attempt can be made to find not only the file but also it's place in the
1300 * filesystem. This typically means storing a reference to de->d_parent in
1301 * the filehandle fragment. encode_fh() should return the number of bytes
1302 * stored or a negative error code such as %-ENOSPC
1303 *
1304 * get_name:
1305 * @get_name should find a name for the given @child in the given @parent
1306 * directory. The name should be stored in the @name (with the
1307 * understanding that it is already pointing to a a %NAME_MAX+1 sized
1308 * buffer. get_name() should return %0 on success, a negative error code
1309 * or error. @get_name will be called without @parent->i_mutex held.
1310 *
1311 * get_parent:
1312 * @get_parent should find the parent directory for the given @child which
1313 * is also a directory. In the event that it cannot be found, or storage
1314 * space cannot be allocated, a %ERR_PTR should be returned.
1315 *
1316 * get_dentry:
1317 * Given a &super_block (@sb) and a pointer to a file-system specific inode
1318 * identifier, possibly an inode number, (@inump) get_dentry() should find
1319 * the identified inode and return a dentry for that inode. Any suitable
1320 * dentry can be returned including, if necessary, a new dentry created with
1321 * d_alloc_root. The caller can then find any other extant dentrys by
1322 * following the d_alias links. If a new dentry was created using
1323 * d_alloc_root, DCACHE_NFSD_DISCONNECTED should be set, and the dentry
1324 * should be d_rehash()ed.
1325 *
1326 * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code
1327 * can be returned. The @inump will be whatever was passed to
1328 * nfsd_find_fh_dentry() in either the @obj or @parent parameters.
1329 *
1330 * Locking rules:
1331 * get_parent is called with child->d_inode->i_mutex down
1332 * get_name is not (which is possibly inconsistent)
1333 */
1334
1335struct export_operations {
1336 struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh, int fh_len, int fh_type,
1337 int (*acceptable)(void *context, struct dentry *de),
1338 void *context);
1339 int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len,
1340 int connectable);
1341
1342 /* the following are only called from the filesystem itself */
1343 int (*get_name)(struct dentry *parent, char *name,
1344 struct dentry *child);
1345 struct dentry * (*get_parent)(struct dentry *child);
1346 struct dentry * (*get_dentry)(struct super_block *sb, void *inump);
1347
1348 /* This is set by the exporting module to a standard helper */
1349 struct dentry * (*find_exported_dentry)(
1350 struct super_block *sb, void *obj, void *parent,
1351 int (*acceptable)(void *context, struct dentry *de),
1352 void *context);
1353
1354
1355};
1356
1357extern struct dentry *
1358find_exported_dentry(struct super_block *sb, void *obj, void *parent,
1359 int (*acceptable)(void *context, struct dentry *de),
1360 void *context);
1361
1362struct file_system_type { 1296struct file_system_type {
1363 const char *name; 1297 const char *name;
1364 int fs_flags; 1298 int fs_flags;
@@ -1495,7 +1429,7 @@ extern void putname(const char *name);
1495 1429
1496#ifdef CONFIG_BLOCK 1430#ifdef CONFIG_BLOCK
1497extern int register_blkdev(unsigned int, const char *); 1431extern int register_blkdev(unsigned int, const char *);
1498extern int unregister_blkdev(unsigned int, const char *); 1432extern void unregister_blkdev(unsigned int, const char *);
1499extern struct block_device *bdget(dev_t); 1433extern struct block_device *bdget(dev_t);
1500extern void bd_set_size(struct block_device *, loff_t size); 1434extern void bd_set_size(struct block_device *, loff_t size);
1501extern void bd_forget(struct inode *inode); 1435extern void bd_forget(struct inode *inode);
@@ -1535,7 +1469,7 @@ extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
1535extern int register_chrdev_region(dev_t, unsigned, const char *); 1469extern int register_chrdev_region(dev_t, unsigned, const char *);
1536extern int register_chrdev(unsigned int, const char *, 1470extern int register_chrdev(unsigned int, const char *,
1537 const struct file_operations *); 1471 const struct file_operations *);
1538extern int unregister_chrdev(unsigned int, const char *); 1472extern void unregister_chrdev(unsigned int, const char *);
1539extern void unregister_chrdev_region(dev_t, unsigned); 1473extern void unregister_chrdev_region(dev_t, unsigned);
1540extern int chrdev_open(struct inode *, struct file *); 1474extern int chrdev_open(struct inode *, struct file *);
1541extern void chrdev_show(struct seq_file *,off_t); 1475extern void chrdev_show(struct seq_file *,off_t);
@@ -1583,6 +1517,9 @@ extern int __invalidate_device(struct block_device *);
1583extern int invalidate_partition(struct gendisk *, int); 1517extern int invalidate_partition(struct gendisk *, int);
1584#endif 1518#endif
1585extern int invalidate_inodes(struct super_block *); 1519extern int invalidate_inodes(struct super_block *);
1520unsigned long __invalidate_mapping_pages(struct address_space *mapping,
1521 pgoff_t start, pgoff_t end,
1522 bool be_atomic);
1586unsigned long invalidate_mapping_pages(struct address_space *mapping, 1523unsigned long invalidate_mapping_pages(struct address_space *mapping,
1587 pgoff_t start, pgoff_t end); 1524 pgoff_t start, pgoff_t end);
1588 1525
@@ -1734,7 +1671,6 @@ extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
1734 unsigned long, loff_t, loff_t *, size_t, ssize_t); 1671 unsigned long, loff_t, loff_t *, size_t, ssize_t);
1735extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); 1672extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
1736extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); 1673extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
1737extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
1738extern void do_generic_mapping_read(struct address_space *mapping, 1674extern void do_generic_mapping_read(struct address_space *mapping,
1739 struct file_ra_state *, struct file *, 1675 struct file_ra_state *, struct file *,
1740 loff_t *, read_descriptor_t *, read_actor_t); 1676 loff_t *, read_descriptor_t *, read_actor_t);
@@ -1764,9 +1700,6 @@ extern int nonseekable_open(struct inode * inode, struct file * filp);
1764#ifdef CONFIG_FS_XIP 1700#ifdef CONFIG_FS_XIP
1765extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len, 1701extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len,
1766 loff_t *ppos); 1702 loff_t *ppos);
1767extern ssize_t xip_file_sendfile(struct file *in_file, loff_t *ppos,
1768 size_t count, read_actor_t actor,
1769 void *target);
1770extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma); 1703extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma);
1771extern ssize_t xip_file_write(struct file *filp, const char __user *buf, 1704extern ssize_t xip_file_write(struct file *filp, const char __user *buf,
1772 size_t len, loff_t *ppos); 1705 size_t len, loff_t *ppos);
@@ -2020,5 +1953,9 @@ static inline void free_secdata(void *secdata)
2020{ } 1953{ }
2021#endif /* CONFIG_SECURITY */ 1954#endif /* CONFIG_SECURITY */
2022 1955
1956int proc_nr_files(ctl_table *table, int write, struct file *filp,
1957 void __user *buffer, size_t *lenp, loff_t *ppos);
1958
1959
2023#endif /* __KERNEL__ */ 1960#endif /* __KERNEL__ */
2024#endif /* _LINUX_FS_H */ 1961#endif /* _LINUX_FS_H */
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 73710d617775..1831b196c70a 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -53,6 +53,7 @@ struct gianfar_platform_data {
53 u32 bus_id; 53 u32 bus_id;
54 u32 phy_id; 54 u32 phy_id;
55 u8 mac_addr[6]; 55 u8 mac_addr[6];
56 phy_interface_t interface;
56}; 57};
57 58
58struct gianfar_mdio_data { 59struct gianfar_mdio_data {
@@ -112,7 +113,7 @@ struct fsl_usb2_platform_data {
112struct fsl_spi_platform_data { 113struct fsl_spi_platform_data {
113 u32 initial_spmode; /* initial SPMODE value */ 114 u32 initial_spmode; /* initial SPMODE value */
114 u16 bus_num; 115 u16 bus_num;
115 116 bool qe_mode;
116 /* board specific information */ 117 /* board specific information */
117 u16 max_chipselect; 118 u16 max_chipselect;
118 void (*activate_cs)(u8 cs, u8 polarity); 119 void (*activate_cs)(u8 cs, u8 polarity);
@@ -120,5 +121,10 @@ struct fsl_spi_platform_data {
120 u32 sysclk; 121 u32 sysclk;
121}; 122};
122 123
124struct mpc8xx_pcmcia_ops {
125 void(*hw_ctrl)(int slot, int enable);
126 int(*voltage_set)(int slot, int vcc, int vpp);
127};
128
123#endif /* _FSL_DEVICE_H_ */ 129#endif /* _FSL_DEVICE_H_ */
124#endif /* __KERNEL__ */ 130#endif /* __KERNEL__ */
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index 534744efe30d..9fbe9d258e22 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -339,7 +339,7 @@ struct fuse_dirent {
339 char name[0]; 339 char name[0];
340}; 340};
341 341
342#define FUSE_NAME_OFFSET ((unsigned) ((struct fuse_dirent *) 0)->name) 342#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
343#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) 343#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
344#define FUSE_DIRENT_SIZE(d) \ 344#define FUSE_DIRENT_SIZE(d) \
345 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) 345 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 899fc7f20edd..99650353adfa 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -17,7 +17,6 @@ union ktime;
17#define FUTEX_LOCK_PI 6 17#define FUTEX_LOCK_PI 6
18#define FUTEX_UNLOCK_PI 7 18#define FUTEX_UNLOCK_PI 7
19#define FUTEX_TRYLOCK_PI 8 19#define FUTEX_TRYLOCK_PI 8
20#define FUTEX_CMP_REQUEUE_PI 9
21 20
22#define FUTEX_PRIVATE_FLAG 128 21#define FUTEX_PRIVATE_FLAG 128
23#define FUTEX_CMD_MASK ~FUTEX_PRIVATE_FLAG 22#define FUTEX_CMD_MASK ~FUTEX_PRIVATE_FLAG
@@ -98,14 +97,9 @@ struct robust_list_head {
98#define FUTEX_OWNER_DIED 0x40000000 97#define FUTEX_OWNER_DIED 0x40000000
99 98
100/* 99/*
101 * Some processes have been requeued on this PI-futex
102 */
103#define FUTEX_WAITER_REQUEUED 0x20000000
104
105/*
106 * The rest of the robust-futex field is for the TID: 100 * The rest of the robust-futex field is for the TID:
107 */ 101 */
108#define FUTEX_TID_MASK 0x0fffffff 102#define FUTEX_TID_MASK 0x3fffffff
109 103
110/* 104/*
111 * This limit protects against a deliberately circular list. 105 * This limit protects against a deliberately circular list.
@@ -139,7 +133,6 @@ handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi);
139#define FUT_OFF_MMSHARED 2 /* We set bit 1 if key has a reference on mm */ 133#define FUT_OFF_MMSHARED 2 /* We set bit 1 if key has a reference on mm */
140 134
141union futex_key { 135union futex_key {
142 u32 __user *uaddr;
143 struct { 136 struct {
144 unsigned long pgoff; 137 unsigned long pgoff;
145 struct inode *inode; 138 struct inode *inode;
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
index f7a93770e1be..7da02c93002b 100644
--- a/include/linux/genetlink.h
+++ b/include/linux/genetlink.h
@@ -39,6 +39,9 @@ enum {
39 CTRL_CMD_NEWOPS, 39 CTRL_CMD_NEWOPS,
40 CTRL_CMD_DELOPS, 40 CTRL_CMD_DELOPS,
41 CTRL_CMD_GETOPS, 41 CTRL_CMD_GETOPS,
42 CTRL_CMD_NEWMCAST_GRP,
43 CTRL_CMD_DELMCAST_GRP,
44 CTRL_CMD_GETMCAST_GRP, /* unused */
42 __CTRL_CMD_MAX, 45 __CTRL_CMD_MAX,
43}; 46};
44 47
@@ -52,6 +55,7 @@ enum {
52 CTRL_ATTR_HDRSIZE, 55 CTRL_ATTR_HDRSIZE,
53 CTRL_ATTR_MAXATTR, 56 CTRL_ATTR_MAXATTR,
54 CTRL_ATTR_OPS, 57 CTRL_ATTR_OPS,
58 CTRL_ATTR_MCAST_GROUPS,
55 __CTRL_ATTR_MAX, 59 __CTRL_ATTR_MAX,
56}; 60};
57 61
@@ -66,4 +70,13 @@ enum {
66 70
67#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1) 71#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
68 72
73enum {
74 CTRL_ATTR_MCAST_GRP_UNSPEC,
75 CTRL_ATTR_MCAST_GRP_NAME,
76 CTRL_ATTR_MCAST_GRP_ID,
77 __CTRL_ATTR_MCAST_GRP_MAX,
78};
79
80#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
81
69#endif /* __LINUX_GENERIC_NETLINK_H */ 82#endif /* __LINUX_GENERIC_NETLINK_H */
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 0d2ef0b082a6..bc68dd9a6d41 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -30,6 +30,9 @@ struct vm_area_struct;
30 * cannot handle allocation failures. 30 * cannot handle allocation failures.
31 * 31 *
32 * __GFP_NORETRY: The VM implementation must not retry indefinitely. 32 * __GFP_NORETRY: The VM implementation must not retry indefinitely.
33 *
34 * __GFP_MOVABLE: Flag that this page will be movable by the page migration
35 * mechanism or reclaimed
33 */ 36 */
34#define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */ 37#define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */
35#define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */ 38#define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */
@@ -45,6 +48,7 @@ struct vm_area_struct;
45#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ 48#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */
46#define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ 49#define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */
47#define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ 50#define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */
51#define __GFP_MOVABLE ((__force gfp_t)0x80000u) /* Page is movable */
48 52
49#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ 53#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */
50#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) 54#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
@@ -53,7 +57,8 @@ struct vm_area_struct;
53#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ 57#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
54 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ 58 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
55 __GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \ 59 __GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \
56 __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE) 60 __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE| \
61 __GFP_MOVABLE)
57 62
58/* This equals 0, but use constants in case they ever change */ 63/* This equals 0, but use constants in case they ever change */
59#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) 64#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH)
@@ -65,6 +70,15 @@ struct vm_area_struct;
65#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) 70#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
66#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ 71#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \
67 __GFP_HIGHMEM) 72 __GFP_HIGHMEM)
73#define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
74 __GFP_HARDWALL | __GFP_HIGHMEM | \
75 __GFP_MOVABLE)
76#define GFP_NOFS_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_MOVABLE)
77#define GFP_USER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
78 __GFP_HARDWALL | __GFP_MOVABLE)
79#define GFP_HIGHUSER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
80 __GFP_HARDWALL | __GFP_HIGHMEM | \
81 __GFP_MOVABLE)
68 82
69#ifdef CONFIG_NUMA 83#ifdef CONFIG_NUMA
70#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) 84#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
@@ -92,6 +106,9 @@ static inline enum zone_type gfp_zone(gfp_t flags)
92 if (flags & __GFP_DMA32) 106 if (flags & __GFP_DMA32)
93 return ZONE_DMA32; 107 return ZONE_DMA32;
94#endif 108#endif
109 if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) ==
110 (__GFP_HIGHMEM | __GFP_MOVABLE))
111 return ZONE_MOVABLE;
95#ifdef CONFIG_HIGHMEM 112#ifdef CONFIG_HIGHMEM
96 if (flags & __GFP_HIGHMEM) 113 if (flags & __GFP_HIGHMEM)
97 return ZONE_HIGHMEM; 114 return ZONE_HIGHMEM;
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index 8b7e4c1e32ae..a44a6a078f0a 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -54,18 +54,6 @@ struct gfs2_inum {
54 __be64 no_addr; 54 __be64 no_addr;
55}; 55};
56 56
57struct gfs2_inum_host {
58 __u64 no_formal_ino;
59 __u64 no_addr;
60};
61
62static inline int gfs2_inum_equal(const struct gfs2_inum_host *ino1,
63 const struct gfs2_inum_host *ino2)
64{
65 return ino1->no_formal_ino == ino2->no_formal_ino &&
66 ino1->no_addr == ino2->no_addr;
67}
68
69/* 57/*
70 * Generic metadata head structure 58 * Generic metadata head structure
71 * Every inplace buffer logged in the journal must start with this. 59 * Every inplace buffer logged in the journal must start with this.
@@ -94,12 +82,6 @@ struct gfs2_meta_header {
94 __be32 __pad1; /* Was incarnation number in gfs1 */ 82 __be32 __pad1; /* Was incarnation number in gfs1 */
95}; 83};
96 84
97struct gfs2_meta_header_host {
98 __u32 mh_magic;
99 __u32 mh_type;
100 __u32 mh_format;
101};
102
103/* 85/*
104 * super-block structure 86 * super-block structure
105 * 87 *
@@ -139,23 +121,6 @@ struct gfs2_sb {
139 /* In gfs1, quota and license dinodes followed */ 121 /* In gfs1, quota and license dinodes followed */
140}; 122};
141 123
142struct gfs2_sb_host {
143 struct gfs2_meta_header_host sb_header;
144
145 __u32 sb_fs_format;
146 __u32 sb_multihost_format;
147
148 __u32 sb_bsize;
149 __u32 sb_bsize_shift;
150
151 struct gfs2_inum_host sb_master_dir; /* Was jindex dinode in gfs1 */
152 struct gfs2_inum_host sb_root_dir;
153
154 char sb_lockproto[GFS2_LOCKNAME_LEN];
155 char sb_locktable[GFS2_LOCKNAME_LEN];
156 /* In gfs1, quota and license dinodes followed */
157};
158
159/* 124/*
160 * resource index structure 125 * resource index structure
161 */ 126 */
@@ -173,14 +138,6 @@ struct gfs2_rindex {
173 __u8 ri_reserved[64]; 138 __u8 ri_reserved[64];
174}; 139};
175 140
176struct gfs2_rindex_host {
177 __u64 ri_addr; /* grp block disk address */
178 __u64 ri_data0; /* first data location */
179 __u32 ri_length; /* length of rgrp header in fs blocks */
180 __u32 ri_data; /* num of data blocks in rgrp */
181 __u32 ri_bitbytes; /* number of bytes in data bitmaps */
182};
183
184/* 141/*
185 * resource group header structure 142 * resource group header structure
186 */ 143 */
@@ -212,13 +169,6 @@ struct gfs2_rgrp {
212 __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */ 169 __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */
213}; 170};
214 171
215struct gfs2_rgrp_host {
216 __u32 rg_flags;
217 __u32 rg_free;
218 __u32 rg_dinodes;
219 __u64 rg_igeneration;
220};
221
222/* 172/*
223 * quota structure 173 * quota structure
224 */ 174 */
@@ -230,12 +180,6 @@ struct gfs2_quota {
230 __u8 qu_reserved[64]; 180 __u8 qu_reserved[64];
231}; 181};
232 182
233struct gfs2_quota_host {
234 __u64 qu_limit;
235 __u64 qu_warn;
236 __u64 qu_value;
237};
238
239/* 183/*
240 * dinode structure 184 * dinode structure
241 */ 185 */
@@ -315,29 +259,11 @@ struct gfs2_dinode {
315 struct gfs2_inum __pad4; /* Unused even in current gfs1 */ 259 struct gfs2_inum __pad4; /* Unused even in current gfs1 */
316 260
317 __be64 di_eattr; /* extended attribute block number */ 261 __be64 di_eattr; /* extended attribute block number */
262 __be32 di_atime_nsec; /* nsec portion of atime */
263 __be32 di_mtime_nsec; /* nsec portion of mtime */
264 __be32 di_ctime_nsec; /* nsec portion of ctime */
318 265
319 __u8 di_reserved[56]; 266 __u8 di_reserved[44];
320};
321
322struct gfs2_dinode_host {
323 __u64 di_size; /* number of bytes in file */
324 __u64 di_blocks; /* number of blocks in file */
325
326 /* This section varies from gfs1. Padding added to align with
327 * remainder of dinode
328 */
329 __u64 di_goal_meta; /* rgrp to alloc from next */
330 __u64 di_goal_data; /* data block goal */
331 __u64 di_generation; /* generation number for NFS */
332
333 __u32 di_flags; /* GFS2_DIF_... */
334 __u16 di_height; /* height of metadata */
335
336 /* These only apply to directories */
337 __u16 di_depth; /* Number of bits in the table */
338 __u32 di_entries; /* The number of entries in the directory */
339
340 __u64 di_eattr; /* extended attribute block number */
341}; 267};
342 268
343/* 269/*
@@ -414,16 +340,6 @@ struct gfs2_log_header {
414 __be32 lh_hash; 340 __be32 lh_hash;
415}; 341};
416 342
417struct gfs2_log_header_host {
418 struct gfs2_meta_header_host lh_header;
419
420 __u64 lh_sequence; /* Sequence number of this transaction */
421 __u32 lh_flags; /* GFS2_LOG_HEAD_... */
422 __u32 lh_tail; /* Block number of log tail */
423 __u32 lh_blkno;
424 __u32 lh_hash;
425};
426
427/* 343/*
428 * Log type descriptor 344 * Log type descriptor
429 */ 345 */
@@ -464,11 +380,6 @@ struct gfs2_inum_range {
464 __be64 ir_length; 380 __be64 ir_length;
465}; 381};
466 382
467struct gfs2_inum_range_host {
468 __u64 ir_start;
469 __u64 ir_length;
470};
471
472/* 383/*
473 * Statfs change 384 * Statfs change
474 * Describes an change to the pool of free and allocated 385 * Describes an change to the pool of free and allocated
@@ -481,12 +392,6 @@ struct gfs2_statfs_change {
481 __be64 sc_dinodes; 392 __be64 sc_dinodes;
482}; 393};
483 394
484struct gfs2_statfs_change_host {
485 __u64 sc_total;
486 __u64 sc_free;
487 __u64 sc_dinodes;
488};
489
490/* 395/*
491 * Quota change 396 * Quota change
492 * Describes an allocation change for a particular 397 * Describes an allocation change for a particular
@@ -501,39 +406,12 @@ struct gfs2_quota_change {
501 __be32 qc_id; 406 __be32 qc_id;
502}; 407};
503 408
504struct gfs2_quota_change_host { 409struct gfs2_quota_lvb {
505 __u64 qc_change; 410 __be32 qb_magic;
506 __u32 qc_flags; /* GFS2_QCF_... */ 411 __u32 __pad;
507 __u32 qc_id; 412 __be64 qb_limit; /* Hard limit of # blocks to alloc */
413 __be64 qb_warn; /* Warn user when alloc is above this # */
414 __be64 qb_value; /* Current # blocks allocated */
508}; 415};
509 416
510#ifdef __KERNEL__
511/* Translation functions */
512
513extern void gfs2_inum_in(struct gfs2_inum_host *no, const void *buf);
514extern void gfs2_inum_out(const struct gfs2_inum_host *no, void *buf);
515extern void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf);
516extern void gfs2_rindex_in(struct gfs2_rindex_host *ri, const void *buf);
517extern void gfs2_rindex_out(const struct gfs2_rindex_host *ri, void *buf);
518extern void gfs2_rgrp_in(struct gfs2_rgrp_host *rg, const void *buf);
519extern void gfs2_rgrp_out(const struct gfs2_rgrp_host *rg, void *buf);
520extern void gfs2_quota_in(struct gfs2_quota_host *qu, const void *buf);
521struct gfs2_inode;
522extern void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf);
523extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, const void *buf);
524extern void gfs2_ea_header_out(const struct gfs2_ea_header *ea, void *buf);
525extern void gfs2_log_header_in(struct gfs2_log_header_host *lh, const void *buf);
526extern void gfs2_inum_range_in(struct gfs2_inum_range_host *ir, const void *buf);
527extern void gfs2_inum_range_out(const struct gfs2_inum_range_host *ir, void *buf);
528extern void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf);
529extern void gfs2_statfs_change_out(const struct gfs2_statfs_change_host *sc, void *buf);
530extern void gfs2_quota_change_in(struct gfs2_quota_change_host *qc, const void *buf);
531
532/* Printing functions */
533
534extern void gfs2_rindex_print(const struct gfs2_rindex_host *ri);
535extern void gfs2_dinode_print(const struct gfs2_inode *ip);
536
537#endif /* __KERNEL__ */
538
539#endif /* __GFS2_ONDISK_DOT_H__ */ 417#endif /* __GFS2_ONDISK_DOT_H__ */
diff --git a/include/linux/gpio_mouse.h b/include/linux/gpio_mouse.h
new file mode 100644
index 000000000000..44ed7aa14d85
--- /dev/null
+++ b/include/linux/gpio_mouse.h
@@ -0,0 +1,61 @@
1/*
2 * Driver for simulating a mouse on GPIO lines.
3 *
4 * Copyright (C) 2007 Atmel Corporation
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef _GPIO_MOUSE_H
12#define _GPIO_MOUSE_H
13
14#define GPIO_MOUSE_POLARITY_ACT_HIGH 0x00
15#define GPIO_MOUSE_POLARITY_ACT_LOW 0x01
16
17#define GPIO_MOUSE_PIN_UP 0
18#define GPIO_MOUSE_PIN_DOWN 1
19#define GPIO_MOUSE_PIN_LEFT 2
20#define GPIO_MOUSE_PIN_RIGHT 3
21#define GPIO_MOUSE_PIN_BLEFT 4
22#define GPIO_MOUSE_PIN_BMIDDLE 5
23#define GPIO_MOUSE_PIN_BRIGHT 6
24#define GPIO_MOUSE_PIN_MAX 7
25
26/**
27 * struct gpio_mouse_platform_data
28 * @scan_ms: integer in ms specifying the scan periode.
29 * @polarity: Pin polarity, active high or low.
30 * @up: GPIO line for up value.
31 * @down: GPIO line for down value.
32 * @left: GPIO line for left value.
33 * @right: GPIO line for right value.
34 * @bleft: GPIO line for left button.
35 * @bmiddle: GPIO line for middle button.
36 * @bright: GPIO line for right button.
37 *
38 * This struct must be added to the platform_device in the board code.
39 * It is used by the gpio_mouse driver to setup GPIO lines and to
40 * calculate mouse movement.
41 */
42struct gpio_mouse_platform_data {
43 int scan_ms;
44 int polarity;
45
46 union {
47 struct {
48 int up;
49 int down;
50 int left;
51 int right;
52
53 int bleft;
54 int bmiddle;
55 int bright;
56 };
57 int pins[GPIO_MOUSE_PIN_MAX];
58 };
59};
60
61#endif /* _GPIO_MOUSE_H */
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 7803014f3a11..8d302298a161 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -79,6 +79,19 @@
79#endif 79#endif
80 80
81#ifdef CONFIG_PREEMPT 81#ifdef CONFIG_PREEMPT
82# define PREEMPT_CHECK_OFFSET 1
83#else
84# define PREEMPT_CHECK_OFFSET 0
85#endif
86
87/*
88 * Check whether we were atomic before we did preempt_disable():
89 * (used by the scheduler)
90 */
91#define in_atomic_preempt_off() \
92 ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)
93
94#ifdef CONFIG_PREEMPT
82# define preemptible() (preempt_count() == 0 && !irqs_disabled()) 95# define preemptible() (preempt_count() == 0 && !irqs_disabled())
83# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) 96# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
84#else 97#else
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 827ee748fd4c..898103b401f1 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -263,19 +263,28 @@ struct hid_item {
263#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 263#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100
264#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 264#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200
265#define HID_QUIRK_MIGHTYMOUSE 0x00000400 265#define HID_QUIRK_MIGHTYMOUSE 0x00000400
266#define HID_QUIRK_CYMOTION 0x00000800 266#define HID_QUIRK_POWERBOOK_HAS_FN 0x00000800
267#define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 267#define HID_QUIRK_POWERBOOK_FN_ON 0x00001000
268#define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 268#define HID_QUIRK_INVERT_HWHEEL 0x00002000
269#define HID_QUIRK_INVERT_HWHEEL 0x00004000 269#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00004000
270#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000 270#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00008000
271#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000 271#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
272#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00020000 272#define HID_QUIRK_IGNORE_MOUSE 0x00020000
273#define HID_QUIRK_IGNORE_MOUSE 0x00040000 273#define HID_QUIRK_SONY_PS3_CONTROLLER 0x00040000
274#define HID_QUIRK_SONY_PS3_CONTROLLER 0x00080000 274#define HID_QUIRK_DUPLICATE_USAGES 0x00080000
275#define HID_QUIRK_LOGITECH_DESCRIPTOR 0x00100000 275#define HID_QUIRK_RESET_LEDS 0x00100000
276#define HID_QUIRK_DUPLICATE_USAGES 0x00200000 276#define HID_QUIRK_HIDINPUT 0x00200000
277#define HID_QUIRK_RESET_LEDS 0x00400000 277#define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000
278#define HID_QUIRK_SWAPPED_MIN_MAX 0x00800000 278#define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000
279
280/*
281 * Separate quirks for runtime report descriptor fixup
282 */
283
284#define HID_QUIRK_RDESC_CYMOTION 0x00000001
285#define HID_QUIRK_RDESC_LOGITECH 0x00000002
286#define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004
287#define HID_QUIRK_RDESC_PETALYNX 0x00000008
279 288
280/* 289/*
281 * This is the global environment of the parser. This information is 290 * This is the global environment of the parser. This information is
@@ -488,6 +497,11 @@ struct hid_descriptor {
488#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) 497#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001))
489 498
490/* HID core API */ 499/* HID core API */
500
501#ifdef CONFIG_HID_DEBUG
502extern int hid_debug;
503#endif
504
491extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); 505extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
492extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); 506extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
493extern int hidinput_connect(struct hid_device *); 507extern int hidinput_connect(struct hid_device *);
@@ -506,6 +520,7 @@ u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct);
506int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks); 520int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks);
507int usbhid_quirks_init(char **quirks_param); 521int usbhid_quirks_init(char **quirks_param);
508void usbhid_quirks_exit(void); 522void usbhid_quirks_exit(void);
523void usbhid_fixup_report_descriptor(const u16, const u16, char *, unsigned, char **);
509 524
510#ifdef CONFIG_HID_FF 525#ifdef CONFIG_HID_FF
511int hid_ff_init(struct hid_device *hid); 526int hid_ff_init(struct hid_device *hid);
@@ -523,14 +538,19 @@ static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; }
523#else 538#else
524static inline int hid_ff_init(struct hid_device *hid) { return -1; } 539static inline int hid_ff_init(struct hid_device *hid) { return -1; }
525#endif 540#endif
526#ifdef DEBUG 541
527#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \ 542#ifdef CONFIG_HID_DEBUG
528 __FILE__ , ## arg) 543#define dbg_hid(format, arg...) if (hid_debug) \
544 printk(KERN_DEBUG "%s: " format ,\
545 __FILE__ , ## arg)
546#define dbg_hid_line(format, arg...) if (hid_debug) \
547 printk(format, ## arg)
529#else 548#else
530#define dbg(format, arg...) do {} while (0) 549#define dbg_hid(format, arg...) do {} while (0)
550#define dbg_hid_line dbg_hid
531#endif 551#endif
532 552
533#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ 553#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
534 __FILE__ , ## arg) 554 __FILE__ , ## arg)
535#endif 555#endif
536 556
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 98e2cce996a4..1fcb0033179e 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -73,10 +73,27 @@ static inline void clear_user_highpage(struct page *page, unsigned long vaddr)
73} 73}
74 74
75#ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 75#ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
76/**
77 * __alloc_zeroed_user_highpage - Allocate a zeroed HIGHMEM page for a VMA with caller-specified movable GFP flags
78 * @movableflags: The GFP flags related to the pages future ability to move like __GFP_MOVABLE
79 * @vma: The VMA the page is to be allocated for
80 * @vaddr: The virtual address the page will be inserted into
81 *
82 * This function will allocate a page for a VMA but the caller is expected
83 * to specify via movableflags whether the page will be movable in the
84 * future or not
85 *
86 * An architecture may override this function by defining
87 * __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE and providing their own
88 * implementation.
89 */
76static inline struct page * 90static inline struct page *
77alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr) 91__alloc_zeroed_user_highpage(gfp_t movableflags,
92 struct vm_area_struct *vma,
93 unsigned long vaddr)
78{ 94{
79 struct page *page = alloc_page_vma(GFP_HIGHUSER, vma, vaddr); 95 struct page *page = alloc_page_vma(GFP_HIGHUSER | movableflags,
96 vma, vaddr);
80 97
81 if (page) 98 if (page)
82 clear_user_highpage(page, vaddr); 99 clear_user_highpage(page, vaddr);
@@ -85,6 +102,21 @@ alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr)
85} 102}
86#endif 103#endif
87 104
105/**
106 * alloc_zeroed_user_highpage_movable - Allocate a zeroed HIGHMEM page for a VMA that the caller knows can move
107 * @vma: The VMA the page is to be allocated for
108 * @vaddr: The virtual address the page will be inserted into
109 *
110 * This function will allocate a page for a VMA that the caller knows will
111 * be able to migrate in the future using move_pages() or reclaimed
112 */
113static inline struct page *
114alloc_zeroed_user_highpage_movable(struct vm_area_struct *vma,
115 unsigned long vaddr)
116{
117 return __alloc_zeroed_user_highpage(__GFP_MOVABLE, vma, vaddr);
118}
119
88static inline void clear_highpage(struct page *page) 120static inline void clear_highpage(struct page *page)
89{ 121{
90 void *kaddr = kmap_atomic(page, KM_USER0); 122 void *kaddr = kmap_atomic(page, KM_USER0);
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 17c29dca8354..540799bc85f8 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -329,12 +329,13 @@ extern void sysrq_timer_list_show(void);
329#ifdef CONFIG_TIMER_STATS 329#ifdef CONFIG_TIMER_STATS
330 330
331extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, 331extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
332 void *timerf, char * comm); 332 void *timerf, char *comm,
333 unsigned int timer_flag);
333 334
334static inline void timer_stats_account_hrtimer(struct hrtimer *timer) 335static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
335{ 336{
336 timer_stats_update_stats(timer, timer->start_pid, timer->start_site, 337 timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
337 timer->function, timer->start_comm); 338 timer->function, timer->start_comm, 0);
338} 339}
339 340
340extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, 341extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer,
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index b4570b62ab85..49b7053043ad 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -15,6 +15,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
15} 15}
16 16
17int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); 17int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
18int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
18int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); 19int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
19int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int); 20int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int);
20void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); 21void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
@@ -29,6 +30,7 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to);
29void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); 30void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
30 31
31extern unsigned long max_huge_pages; 32extern unsigned long max_huge_pages;
33extern unsigned long hugepages_treat_as_movable;
32extern const unsigned long hugetlb_zero, hugetlb_infinity; 34extern const unsigned long hugetlb_zero, hugetlb_infinity;
33extern int sysctl_hugetlb_shm_group; 35extern int sysctl_hugetlb_shm_group;
34 36
@@ -163,7 +165,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
163 165
164extern const struct file_operations hugetlbfs_file_operations; 166extern const struct file_operations hugetlbfs_file_operations;
165extern struct vm_operations_struct hugetlb_vm_ops; 167extern struct vm_operations_struct hugetlb_vm_ops;
166struct file *hugetlb_zero_setup(size_t); 168struct file *hugetlb_file_setup(const char *name, size_t);
167int hugetlb_get_quota(struct address_space *mapping); 169int hugetlb_get_quota(struct address_space *mapping);
168void hugetlb_put_quota(struct address_space *mapping); 170void hugetlb_put_quota(struct address_space *mapping);
169 171
@@ -185,7 +187,7 @@ static inline void set_file_hugepages(struct file *file)
185 187
186#define is_file_hugepages(file) 0 188#define is_file_hugepages(file) 0
187#define set_file_hugepages(file) BUG() 189#define set_file_hugepages(file) BUG()
188#define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS) 190#define hugetlb_file_setup(name,size) ERR_PTR(-ENOSYS)
189 191
190#endif /* !CONFIG_HUGETLBFS */ 192#endif /* !CONFIG_HUGETLBFS */
191 193
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index aa83d4163096..b69014865714 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -115,9 +115,10 @@
115#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ 115#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */
116#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ 116#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
117#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */ 117#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */
118#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */ 118#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */
119#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */ 119#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */
120#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */ 120#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */
121#define I2C_DRIVERID_LM4857 92 /* LM4857 Audio Amplifier */
121 122
122#define I2C_DRIVERID_I2CDEV 900 123#define I2C_DRIVERID_I2CDEV 900
123#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ 124#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
diff --git a/include/linux/i2c-isa.h b/include/linux/i2c-isa.h
deleted file mode 100644
index 67e3598c4cec..000000000000
--- a/include/linux/i2c-isa.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * i2c-isa.h - definitions for the i2c-isa pseudo-i2c-adapter interface
3 *
4 * Copyright (C) 2005 Jean Delvare <khali@linux-fr.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef _LINUX_I2C_ISA_H
22#define _LINUX_I2C_ISA_H
23
24#include <linux/i2c.h>
25
26extern int i2c_isa_add_driver(struct i2c_driver *driver);
27extern int i2c_isa_del_driver(struct i2c_driver *driver);
28
29/* Detect whether we are on the isa bus. This is only useful to hybrid
30 (i2c+isa) drivers. */
31#define i2c_is_isa_adapter(adapptr) \
32 ((adapptr)->id == I2C_HW_ISA)
33#define i2c_is_isa_client(clientptr) \
34 i2c_is_isa_adapter((clientptr)->adapter)
35
36#endif /* _LINUX_I2C_ISA_H */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index cae7d618030c..0c37a737a2b2 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -90,7 +90,7 @@ extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
90 const u8 *values); 90 const u8 *values);
91/* Returns the number of read bytes */ 91/* Returns the number of read bytes */
92extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, 92extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
93 u8 command, u8 *values); 93 u8 command, u8 length, u8 *values);
94extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, 94extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
95 u8 command, u8 length, 95 u8 command, u8 length,
96 const u8 *values); 96 const u8 *values);
@@ -150,15 +150,20 @@ struct i2c_driver {
150 150
151/** 151/**
152 * struct i2c_client - represent an I2C slave device 152 * struct i2c_client - represent an I2C slave device
153 * @flags: I2C_CLIENT_TEN indicates the device uses a ten bit chip address;
154 * I2C_CLIENT_PEC indicates it uses SMBus Packet Error Checking
153 * @addr: Address used on the I2C bus connected to the parent adapter. 155 * @addr: Address used on the I2C bus connected to the parent adapter.
154 * @name: Indicates the type of the device, usually a chip name that's 156 * @name: Indicates the type of the device, usually a chip name that's
155 * generic enough to hide second-sourcing and compatible revisions. 157 * generic enough to hide second-sourcing and compatible revisions.
158 * @adapter: manages the bus segment hosting this I2C device
156 * @dev: Driver model device node for the slave. 159 * @dev: Driver model device node for the slave.
160 * @irq: indicates the IRQ generated by this device (if any)
157 * @driver_name: Identifies new-style driver used with this device; also 161 * @driver_name: Identifies new-style driver used with this device; also
158 * used as the module name for hotplug/coldplug modprobe support. 162 * used as the module name for hotplug/coldplug modprobe support.
159 * 163 *
160 * An i2c_client identifies a single device (i.e. chip) connected to an 164 * An i2c_client identifies a single device (i.e. chip) connected to an
161 * i2c bus. The behaviour is defined by the routines of the driver. 165 * i2c bus. The behaviour exposed to Linux is defined by the driver
166 * managing the device.
162 */ 167 */
163struct i2c_client { 168struct i2c_client {
164 unsigned short flags; /* div., see below */ 169 unsigned short flags; /* div., see below */
@@ -180,7 +185,8 @@ struct i2c_client {
180 185
181static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj) 186static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
182{ 187{
183 return to_i2c_client(container_of(kobj, struct device, kobj)); 188 struct device * const dev = container_of(kobj, struct device, kobj);
189 return to_i2c_client(dev);
184} 190}
185 191
186static inline void *i2c_get_clientdata (struct i2c_client *dev) 192static inline void *i2c_get_clientdata (struct i2c_client *dev)
@@ -201,7 +207,7 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
201 * @addr: stored in i2c_client.addr 207 * @addr: stored in i2c_client.addr
202 * @platform_data: stored in i2c_client.dev.platform_data 208 * @platform_data: stored in i2c_client.dev.platform_data
203 * @irq: stored in i2c_client.irq 209 * @irq: stored in i2c_client.irq
204 210 *
205 * I2C doesn't actually support hardware probing, although controllers and 211 * I2C doesn't actually support hardware probing, although controllers and
206 * devices may be able to use I2C_SMBUS_QUICK to tell whether or not there's 212 * devices may be able to use I2C_SMBUS_QUICK to tell whether or not there's
207 * a device at a given address. Drivers commonly need more information than 213 * a device at a given address. Drivers commonly need more information than
@@ -210,7 +216,7 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
210 * i2c_board_info is used to build tables of information listing I2C devices 216 * i2c_board_info is used to build tables of information listing I2C devices
211 * that are present. This information is used to grow the driver model tree 217 * that are present. This information is used to grow the driver model tree
212 * for "new style" I2C drivers. For mainboards this is done statically using 218 * for "new style" I2C drivers. For mainboards this is done statically using
213 * i2c_register_board_info(), where @bus_num represents an adapter that isn't 219 * i2c_register_board_info(); bus numbers identify adapters that aren't
214 * yet available. For add-on boards, i2c_new_device() does this dynamically 220 * yet available. For add-on boards, i2c_new_device() does this dynamically
215 * with the adapter already known. 221 * with the adapter already known.
216 */ 222 */
@@ -362,7 +368,6 @@ struct i2c_client_address_data {
362 368
363/* The numbers to use to set I2C bus address */ 369/* The numbers to use to set I2C bus address */
364#define ANY_I2C_BUS 0xffff 370#define ANY_I2C_BUS 0xffff
365#define ANY_I2C_ISA_BUS 9191
366 371
367 372
368/* ----- functions exported by i2c.o */ 373/* ----- functions exported by i2c.o */
@@ -518,8 +523,9 @@ union i2c_smbus_data {
518#define I2C_SMBUS_WORD_DATA 3 523#define I2C_SMBUS_WORD_DATA 3
519#define I2C_SMBUS_PROC_CALL 4 524#define I2C_SMBUS_PROC_CALL 4
520#define I2C_SMBUS_BLOCK_DATA 5 525#define I2C_SMBUS_BLOCK_DATA 5
521#define I2C_SMBUS_I2C_BLOCK_DATA 6 526#define I2C_SMBUS_I2C_BLOCK_BROKEN 6
522#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ 527#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
528#define I2C_SMBUS_I2C_BLOCK_DATA 8
523 529
524 530
525/* ----- commands for the ioctl like i2c_command call: 531/* ----- commands for the ioctl like i2c_command call:
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 52f53e2e70c3..9752307d16ba 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -31,6 +31,7 @@
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/workqueue.h> /* work_struct */ 32#include <linux/workqueue.h> /* work_struct */
33#include <linux/mempool.h> 33#include <linux/mempool.h>
34#include <linux/mutex.h>
34 35
35#include <asm/io.h> 36#include <asm/io.h>
36#include <asm/semaphore.h> /* Needed for MUTEX init macros */ 37#include <asm/semaphore.h> /* Needed for MUTEX init macros */
@@ -425,7 +426,7 @@ struct i2o_device {
425 426
426 struct device device; 427 struct device device;
427 428
428 struct semaphore lock; /* device lock */ 429 struct mutex lock; /* device lock */
429}; 430};
430 431
431/* 432/*
@@ -544,7 +545,7 @@ struct i2o_controller {
544 struct i2o_dma hrt; /* HW Resource Table */ 545 struct i2o_dma hrt; /* HW Resource Table */
545 i2o_lct *lct; /* Logical Config Table */ 546 i2o_lct *lct; /* Logical Config Table */
546 struct i2o_dma dlct; /* Temp LCT */ 547 struct i2o_dma dlct; /* Temp LCT */
547 struct semaphore lct_lock; /* Lock for LCT updates */ 548 struct mutex lct_lock; /* Lock for LCT updates */
548 struct i2o_dma status_block; /* IOP status block */ 549 struct i2o_dma status_block; /* IOP status block */
549 550
550 struct i2o_io base; /* controller messaging unit */ 551 struct i2o_io base; /* controller messaging unit */
@@ -945,8 +946,7 @@ static inline int i2o_pool_alloc(struct i2o_pool *pool, const char *name,
945 strcpy(pool->name, name); 946 strcpy(pool->name, name);
946 947
947 pool->slab = 948 pool->slab =
948 kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL, 949 kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL);
949 NULL);
950 if (!pool->slab) 950 if (!pool->slab)
951 goto free_name; 951 goto free_name;
952 952
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 07aba87d369d..5f5daad8bc54 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -25,6 +25,7 @@
25#include <asm/system.h> 25#include <asm/system.h>
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/semaphore.h> 27#include <asm/semaphore.h>
28#include <asm/mutex.h>
28 29
29/****************************************************************************** 30/******************************************************************************
30 * IDE driver configuration options (play with these as desired): 31 * IDE driver configuration options (play with these as desired):
@@ -680,11 +681,17 @@ typedef struct hwif_s {
680 u8 straight8; /* Alan's straight 8 check */ 681 u8 straight8; /* Alan's straight 8 check */
681 u8 bus_state; /* power state of the IDE bus */ 682 u8 bus_state; /* power state of the IDE bus */
682 683
684 u8 host_flags;
685
686 u8 pio_mask;
687
683 u8 atapi_dma; /* host supports atapi_dma */ 688 u8 atapi_dma; /* host supports atapi_dma */
684 u8 ultra_mask; 689 u8 ultra_mask;
685 u8 mwdma_mask; 690 u8 mwdma_mask;
686 u8 swdma_mask; 691 u8 swdma_mask;
687 692
693 u8 cbl; /* cable type */
694
688 hwif_chipset_t chipset; /* sub-module for tuning.. */ 695 hwif_chipset_t chipset; /* sub-module for tuning.. */
689 696
690 struct pci_dev *pci_dev; /* for pci chipsets */ 697 struct pci_dev *pci_dev; /* for pci chipsets */
@@ -735,8 +742,8 @@ typedef struct hwif_s {
735 void (*ide_dma_clear_irq)(ide_drive_t *drive); 742 void (*ide_dma_clear_irq)(ide_drive_t *drive);
736 void (*dma_host_on)(ide_drive_t *drive); 743 void (*dma_host_on)(ide_drive_t *drive);
737 void (*dma_host_off)(ide_drive_t *drive); 744 void (*dma_host_off)(ide_drive_t *drive);
738 int (*ide_dma_lostirq)(ide_drive_t *drive); 745 void (*dma_lost_irq)(ide_drive_t *drive);
739 int (*ide_dma_timeout)(ide_drive_t *drive); 746 void (*dma_timeout)(ide_drive_t *drive);
740 747
741 void (*OUTB)(u8 addr, unsigned long port); 748 void (*OUTB)(u8 addr, unsigned long port);
742 void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); 749 void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port);
@@ -791,7 +798,6 @@ typedef struct hwif_s {
791 unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ 798 unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */
792 unsigned reset : 1; /* reset after probe */ 799 unsigned reset : 1; /* reset after probe */
793 unsigned autodma : 1; /* auto-attempt using DMA at boot */ 800 unsigned autodma : 1; /* auto-attempt using DMA at boot */
794 unsigned udma_four : 1; /* 1=ATA-66 capable, 0=default */
795 unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ 801 unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */
796 unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ 802 unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */
797 unsigned auto_poll : 1; /* supports nop auto-poll */ 803 unsigned auto_poll : 1; /* supports nop auto-poll */
@@ -863,7 +869,7 @@ typedef struct hwgroup_s {
863 869
864typedef struct ide_driver_s ide_driver_t; 870typedef struct ide_driver_s ide_driver_t;
865 871
866extern struct semaphore ide_setting_sem; 872extern struct mutex ide_setting_mtx;
867 873
868int set_io_32bit(ide_drive_t *, int); 874int set_io_32bit(ide_drive_t *, int);
869int set_pio_mode(ide_drive_t *, int); 875int set_pio_mode(ide_drive_t *, int);
@@ -1001,6 +1007,7 @@ struct ide_driver_s {
1001 struct device_driver gen_driver; 1007 struct device_driver gen_driver;
1002 int (*probe)(ide_drive_t *); 1008 int (*probe)(ide_drive_t *);
1003 void (*remove)(ide_drive_t *); 1009 void (*remove)(ide_drive_t *);
1010 void (*resume)(ide_drive_t *);
1004 void (*shutdown)(ide_drive_t *); 1011 void (*shutdown)(ide_drive_t *);
1005#ifdef CONFIG_IDE_PROC_FS 1012#ifdef CONFIG_IDE_PROC_FS
1006 ide_proc_entry_t *proc; 1013 ide_proc_entry_t *proc;
@@ -1241,7 +1248,13 @@ typedef struct ide_pci_enablebit_s {
1241 1248
1242enum { 1249enum {
1243 /* Uses ISA control ports not PCI ones. */ 1250 /* Uses ISA control ports not PCI ones. */
1244 IDEPCI_FLAG_ISA_PORTS = (1 << 0), 1251 IDE_HFLAG_ISA_PORTS = (1 << 0),
1252 /* single port device */
1253 IDE_HFLAG_SINGLE = (1 << 1),
1254 /* don't use legacy PIO blacklist */
1255 IDE_HFLAG_PIO_NO_BLACKLIST = (1 << 2),
1256 /* don't use conservative PIO "downgrade" */
1257 IDE_HFLAG_PIO_NO_DOWNGRADE = (1 << 3),
1245}; 1258};
1246 1259
1247typedef struct ide_pci_device_s { 1260typedef struct ide_pci_device_s {
@@ -1253,13 +1266,13 @@ typedef struct ide_pci_device_s {
1253 void (*init_hwif)(ide_hwif_t *); 1266 void (*init_hwif)(ide_hwif_t *);
1254 void (*init_dma)(ide_hwif_t *, unsigned long); 1267 void (*init_dma)(ide_hwif_t *, unsigned long);
1255 void (*fixup)(ide_hwif_t *); 1268 void (*fixup)(ide_hwif_t *);
1256 u8 channels;
1257 u8 autodma; 1269 u8 autodma;
1258 ide_pci_enablebit_t enablebits[2]; 1270 ide_pci_enablebit_t enablebits[2];
1259 u8 bootable; 1271 u8 bootable;
1260 unsigned int extra; 1272 unsigned int extra;
1261 struct ide_pci_device_s *next; 1273 struct ide_pci_device_s *next;
1262 u8 flags; 1274 u8 host_flags;
1275 u8 pio_mask;
1263 u8 udma_mask; 1276 u8 udma_mask;
1264} ide_pci_device_t; 1277} ide_pci_device_t;
1265 1278
@@ -1303,8 +1316,8 @@ extern int __ide_dma_check(ide_drive_t *);
1303extern int ide_dma_setup(ide_drive_t *); 1316extern int ide_dma_setup(ide_drive_t *);
1304extern void ide_dma_start(ide_drive_t *); 1317extern void ide_dma_start(ide_drive_t *);
1305extern int __ide_dma_end(ide_drive_t *); 1318extern int __ide_dma_end(ide_drive_t *);
1306extern int __ide_dma_lostirq(ide_drive_t *); 1319extern void ide_dma_lost_irq(ide_drive_t *);
1307extern int __ide_dma_timeout(ide_drive_t *); 1320extern void ide_dma_timeout(ide_drive_t *);
1308#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 1321#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
1309 1322
1310#else 1323#else
@@ -1360,6 +1373,11 @@ extern void ide_toggle_bounce(ide_drive_t *drive, int on);
1360extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); 1373extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
1361int ide_use_fast_pio(ide_drive_t *); 1374int ide_use_fast_pio(ide_drive_t *);
1362 1375
1376static inline int ide_dev_has_iordy(struct hd_driveid *id)
1377{
1378 return ((id->field_valid & 2) && (id->capability & 8)) ? 1 : 0;
1379}
1380
1363u8 ide_dump_status(ide_drive_t *, const char *, u8); 1381u8 ide_dump_status(ide_drive_t *, const char *, u8);
1364 1382
1365typedef struct ide_pio_timings_s { 1383typedef struct ide_pio_timings_s {
@@ -1369,23 +1387,17 @@ typedef struct ide_pio_timings_s {
1369 /* active + recovery (+ setup for some chips) */ 1387 /* active + recovery (+ setup for some chips) */
1370} ide_pio_timings_t; 1388} ide_pio_timings_t;
1371 1389
1372typedef struct ide_pio_data_s { 1390unsigned int ide_pio_cycle_time(ide_drive_t *, u8);
1373 u8 pio_mode; 1391u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8);
1374 u8 use_iordy;
1375 u8 overridden;
1376 unsigned int cycle_time;
1377} ide_pio_data_t;
1378
1379extern u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d);
1380extern const ide_pio_timings_t ide_pio_timings[6]; 1392extern const ide_pio_timings_t ide_pio_timings[6];
1381 1393
1382 1394
1383extern spinlock_t ide_lock; 1395extern spinlock_t ide_lock;
1384extern struct semaphore ide_cfg_sem; 1396extern struct mutex ide_cfg_mtx;
1385/* 1397/*
1386 * Structure locking: 1398 * Structure locking:
1387 * 1399 *
1388 * ide_cfg_sem and ide_lock together protect changes to 1400 * ide_cfg_mtx and ide_lock together protect changes to
1389 * ide_hwif_t->{next,hwgroup} 1401 * ide_hwif_t->{next,hwgroup}
1390 * ide_drive_t->next 1402 * ide_drive_t->next
1391 * 1403 *
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 826803449db7..0edda411959c 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -78,9 +78,41 @@ void *idr_find(struct idr *idp, int id);
78int idr_pre_get(struct idr *idp, gfp_t gfp_mask); 78int idr_pre_get(struct idr *idp, gfp_t gfp_mask);
79int idr_get_new(struct idr *idp, void *ptr, int *id); 79int idr_get_new(struct idr *idp, void *ptr, int *id);
80int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); 80int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);
81int idr_for_each(struct idr *idp,
82 int (*fn)(int id, void *p, void *data), void *data);
81void *idr_replace(struct idr *idp, void *ptr, int id); 83void *idr_replace(struct idr *idp, void *ptr, int id);
82void idr_remove(struct idr *idp, int id); 84void idr_remove(struct idr *idp, int id);
85void idr_remove_all(struct idr *idp);
83void idr_destroy(struct idr *idp); 86void idr_destroy(struct idr *idp);
84void idr_init(struct idr *idp); 87void idr_init(struct idr *idp);
85 88
89
90/*
91 * IDA - IDR based id allocator, use when translation from id to
92 * pointer isn't necessary.
93 */
94#define IDA_CHUNK_SIZE 128 /* 128 bytes per chunk */
95#define IDA_BITMAP_LONGS (128 / sizeof(long) - 1)
96#define IDA_BITMAP_BITS (IDA_BITMAP_LONGS * sizeof(long) * 8)
97
98struct ida_bitmap {
99 long nr_busy;
100 unsigned long bitmap[IDA_BITMAP_LONGS];
101};
102
103struct ida {
104 struct idr idr;
105 struct ida_bitmap *free_bitmap;
106};
107
108#define IDA_INIT(name) { .idr = IDR_INIT(name), .free_bitmap = NULL, }
109#define DEFINE_IDA(name) struct ida name = IDA_INIT(name)
110
111int ida_pre_get(struct ida *ida, gfp_t gfp_mask);
112int ida_get_new_above(struct ida *ida, int starting_id, int *p_id);
113int ida_get_new(struct ida *ida, int *p_id);
114void ida_remove(struct ida *ida, int id);
115void ida_destroy(struct ida *ida);
116void ida_init(struct ida *ida);
117
86#endif /* __IDR_H__ */ 118#endif /* __IDR_H__ */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index ecd61e8438a5..272f8c8c90da 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -227,6 +227,17 @@ struct ieee80211_cts {
227#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) 227#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
228#define WLAN_CAPABILITY_DSSS_OFDM (1<<13) 228#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
229 229
230/* 802.11g ERP information element */
231#define WLAN_ERP_NON_ERP_PRESENT (1<<0)
232#define WLAN_ERP_USE_PROTECTION (1<<1)
233#define WLAN_ERP_BARKER_PREAMBLE (1<<2)
234
235/* WLAN_ERP_BARKER_PREAMBLE values */
236enum {
237 WLAN_ERP_PREAMBLE_SHORT = 0,
238 WLAN_ERP_PREAMBLE_LONG = 1,
239};
240
230/* Status codes */ 241/* Status codes */
231enum ieee80211_statuscode { 242enum ieee80211_statuscode {
232 WLAN_STATUS_SUCCESS = 0, 243 WLAN_STATUS_SUCCESS = 0,
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 604c2434f71c..422084d18ce1 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -76,6 +76,8 @@ enum
76#define IFLA_WEIGHT IFLA_WEIGHT 76#define IFLA_WEIGHT IFLA_WEIGHT
77 IFLA_OPERSTATE, 77 IFLA_OPERSTATE,
78 IFLA_LINKMODE, 78 IFLA_LINKMODE,
79 IFLA_LINKINFO,
80#define IFLA_LINKINFO IFLA_LINKINFO
79 __IFLA_MAX 81 __IFLA_MAX
80}; 82};
81 83
@@ -140,4 +142,49 @@ struct ifla_cacheinfo
140 __u32 retrans_time; 142 __u32 retrans_time;
141}; 143};
142 144
145enum
146{
147 IFLA_INFO_UNSPEC,
148 IFLA_INFO_KIND,
149 IFLA_INFO_DATA,
150 IFLA_INFO_XSTATS,
151 __IFLA_INFO_MAX,
152};
153
154#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
155
156/* VLAN section */
157
158enum
159{
160 IFLA_VLAN_UNSPEC,
161 IFLA_VLAN_ID,
162 IFLA_VLAN_FLAGS,
163 IFLA_VLAN_EGRESS_QOS,
164 IFLA_VLAN_INGRESS_QOS,
165 __IFLA_VLAN_MAX,
166};
167
168#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
169
170struct ifla_vlan_flags {
171 __u32 flags;
172 __u32 mask;
173};
174
175enum
176{
177 IFLA_VLAN_QOS_UNSPEC,
178 IFLA_VLAN_QOS_MAPPING,
179 __IFLA_VLAN_QOS_MAX
180};
181
182#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
183
184struct ifla_vlan_qos_mapping
185{
186 __u32 from;
187 __u32 to;
188};
189
143#endif /* _LINUX_IF_LINK_H */ 190#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
new file mode 100644
index 000000000000..0d9d7ea2c1cc
--- /dev/null
+++ b/include/linux/if_macvlan.h
@@ -0,0 +1,9 @@
1#ifndef _LINUX_IF_MACVLAN_H
2#define _LINUX_IF_MACVLAN_H
3
4#ifdef __KERNEL__
5
6extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *);
7
8#endif /* __KERNEL__ */
9#endif /* _LINUX_IF_MACVLAN_H */
diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
index 768372f07caa..0f2f70d4e48c 100644
--- a/include/linux/if_ppp.h
+++ b/include/linux/if_ppp.h
@@ -110,6 +110,21 @@ struct ifpppcstatsreq {
110 struct ppp_comp_stats stats; 110 struct ppp_comp_stats stats;
111}; 111};
112 112
113/* For PPPIOCGL2TPSTATS */
114struct pppol2tp_ioc_stats {
115 __u16 tunnel_id; /* redundant */
116 __u16 session_id; /* if zero, get tunnel stats */
117 __u32 using_ipsec:1; /* valid only for session_id == 0 */
118 aligned_u64 tx_packets;
119 aligned_u64 tx_bytes;
120 aligned_u64 tx_errors;
121 aligned_u64 rx_packets;
122 aligned_u64 rx_bytes;
123 aligned_u64 rx_seq_discards;
124 aligned_u64 rx_oos_packets;
125 aligned_u64 rx_errors;
126};
127
113#define ifr__name b.ifr_ifrn.ifrn_name 128#define ifr__name b.ifr_ifrn.ifrn_name
114#define stats_ptr b.ifr_ifru.ifru_data 129#define stats_ptr b.ifr_ifru.ifru_data
115 130
@@ -146,6 +161,7 @@ struct ifpppcstatsreq {
146#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */ 161#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */
147#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */ 162#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */
148#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */ 163#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */
164#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
149 165
150#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0) 166#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
151#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */ 167#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
new file mode 100644
index 000000000000..516203b6fdeb
--- /dev/null
+++ b/include/linux/if_pppol2tp.h
@@ -0,0 +1,69 @@
1/***************************************************************************
2 * Linux PPP over L2TP (PPPoL2TP) Socket Implementation (RFC 2661)
3 *
4 * This file supplies definitions required by the PPP over L2TP driver
5 * (pppol2tp.c). All version information wrt this file is located in pppol2tp.c
6 *
7 * License:
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 *
13 */
14
15#ifndef __LINUX_IF_PPPOL2TP_H
16#define __LINUX_IF_PPPOL2TP_H
17
18#include <asm/types.h>
19
20#ifdef __KERNEL__
21#include <linux/in.h>
22#endif
23
24/* Structure used to connect() the socket to a particular tunnel UDP
25 * socket.
26 */
27struct pppol2tp_addr
28{
29 pid_t pid; /* pid that owns the fd.
30 * 0 => current */
31 int fd; /* FD of UDP socket to use */
32
33 struct sockaddr_in addr; /* IP address and port to send to */
34
35 __be16 s_tunnel, s_session; /* For matching incoming packets */
36 __be16 d_tunnel, d_session; /* For sending outgoing packets */
37};
38
39/* Socket options:
40 * DEBUG - bitmask of debug message categories
41 * SENDSEQ - 0 => don't send packets with sequence numbers
42 * 1 => send packets with sequence numbers
43 * RECVSEQ - 0 => receive packet sequence numbers are optional
44 * 1 => drop receive packets without sequence numbers
45 * LNSMODE - 0 => act as LAC.
46 * 1 => act as LNS.
47 * REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder.
48 */
49enum {
50 PPPOL2TP_SO_DEBUG = 1,
51 PPPOL2TP_SO_RECVSEQ = 2,
52 PPPOL2TP_SO_SENDSEQ = 3,
53 PPPOL2TP_SO_LNSMODE = 4,
54 PPPOL2TP_SO_REORDERTO = 5,
55};
56
57/* Debug message categories for the DEBUG socket option */
58enum {
59 PPPOL2TP_MSG_DEBUG = (1 << 0), /* verbose debug (if
60 * compiled in) */
61 PPPOL2TP_MSG_CONTROL = (1 << 1), /* userspace - kernel
62 * interface */
63 PPPOL2TP_MSG_SEQ = (1 << 2), /* sequence numbers */
64 PPPOL2TP_MSG_DATA = (1 << 3), /* data packets */
65};
66
67
68
69#endif
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 6f987be60fe2..25652545ba6e 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -27,6 +27,7 @@
27#include <asm/semaphore.h> 27#include <asm/semaphore.h>
28#include <linux/ppp_channel.h> 28#include <linux/ppp_channel.h>
29#endif /* __KERNEL__ */ 29#endif /* __KERNEL__ */
30#include <linux/if_pppol2tp.h>
30 31
31/* For user-space programs to pick up these definitions 32/* For user-space programs to pick up these definitions
32 * which they wouldn't get otherwise without defining __KERNEL__ 33 * which they wouldn't get otherwise without defining __KERNEL__
@@ -50,8 +51,9 @@ struct pppoe_addr{
50 * Protocols supported by AF_PPPOX 51 * Protocols supported by AF_PPPOX
51 */ 52 */
52#define PX_PROTO_OE 0 /* Currently just PPPoE */ 53#define PX_PROTO_OE 0 /* Currently just PPPoE */
53#define PX_MAX_PROTO 1 54#define PX_PROTO_OL2TP 1 /* Now L2TP also */
54 55#define PX_MAX_PROTO 2
56
55struct sockaddr_pppox { 57struct sockaddr_pppox {
56 sa_family_t sa_family; /* address family, AF_PPPOX */ 58 sa_family_t sa_family; /* address family, AF_PPPOX */
57 unsigned int sa_protocol; /* protocol identifier */ 59 unsigned int sa_protocol; /* protocol identifier */
@@ -60,6 +62,16 @@ struct sockaddr_pppox {
60 }sa_addr; 62 }sa_addr;
61}__attribute__ ((packed)); 63}__attribute__ ((packed));
62 64
65/* The use of the above union isn't viable because the size of this
66 * struct must stay fixed over time -- applications use sizeof(struct
67 * sockaddr_pppox) to fill it. We use a protocol specific sockaddr
68 * type instead.
69 */
70struct sockaddr_pppol2tp {
71 sa_family_t sa_family; /* address family, AF_PPPOX */
72 unsigned int sa_protocol; /* protocol identifier */
73 struct pppol2tp_addr pppol2tp;
74}__attribute__ ((packed));
63 75
64/********************************************************************* 76/*********************************************************************
65 * 77 *
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 88aef7b86ef4..42eb6945b93e 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -36,6 +36,7 @@ struct tun_struct {
36 unsigned long flags; 36 unsigned long flags;
37 int attached; 37 int attached;
38 uid_t owner; 38 uid_t owner;
39 gid_t group;
39 40
40 wait_queue_head_t read_wait; 41 wait_queue_head_t read_wait;
41 struct sk_buff_head readq; 42 struct sk_buff_head readq;
@@ -78,6 +79,7 @@ struct tun_struct {
78#define TUNSETPERSIST _IOW('T', 203, int) 79#define TUNSETPERSIST _IOW('T', 203, int)
79#define TUNSETOWNER _IOW('T', 204, int) 80#define TUNSETOWNER _IOW('T', 204, int)
80#define TUNSETLINK _IOW('T', 205, int) 81#define TUNSETLINK _IOW('T', 205, int)
82#define TUNSETGROUP _IOW('T', 206, int)
81 83
82/* TUNSETIFF ifr flags */ 84/* TUNSETIFF ifr flags */
83#define IFF_TUN 0x0001 85#define IFF_TUN 0x0001
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 81e9bc93569b..f8443fdb124a 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -99,7 +99,7 @@ static inline void vlan_group_set_device(struct vlan_group *vg, int vlan_id,
99} 99}
100 100
101struct vlan_priority_tci_mapping { 101struct vlan_priority_tci_mapping {
102 unsigned long priority; 102 u32 priority;
103 unsigned short vlan_qos; /* This should be shifted when first set, so we only do it 103 unsigned short vlan_qos; /* This should be shifted when first set, so we only do it
104 * at provisioning time. 104 * at provisioning time.
105 * ((skb->priority << 13) & 0xE000) 105 * ((skb->priority << 13) & 0xE000)
@@ -112,7 +112,10 @@ struct vlan_dev_info {
112 /** This will be the mapping that correlates skb->priority to 112 /** This will be the mapping that correlates skb->priority to
113 * 3 bits of VLAN QOS tags... 113 * 3 bits of VLAN QOS tags...
114 */ 114 */
115 unsigned long ingress_priority_map[8]; 115 unsigned int nr_ingress_mappings;
116 u32 ingress_priority_map[8];
117
118 unsigned int nr_egress_mappings;
116 struct vlan_priority_tci_mapping *egress_priority_map[16]; /* hash table */ 119 struct vlan_priority_tci_mapping *egress_priority_map[16]; /* hash table */
117 120
118 unsigned short vlan_id; /* The VLAN Identifier for this interface. */ 121 unsigned short vlan_id; /* The VLAN Identifier for this interface. */
@@ -124,14 +127,8 @@ struct vlan_dev_info {
124 * like DHCP that use packet-filtering and don't understand 127 * like DHCP that use packet-filtering and don't understand
125 * 802.1Q 128 * 802.1Q
126 */ 129 */
127 struct dev_mc_list *old_mc_list; /* old multi-cast list for the VLAN interface..
128 * we save this so we can tell what changes were
129 * made, in order to feed the right changes down
130 * to the real hardware...
131 */
132 int old_allmulti; /* similar to above. */
133 int old_promiscuity; /* similar to above. */
134 struct net_device *real_dev; /* the underlying device/interface */ 130 struct net_device *real_dev; /* the underlying device/interface */
131 unsigned char real_dev_addr[ETH_ALEN];
135 struct proc_dir_entry *dent; /* Holds the proc data */ 132 struct proc_dir_entry *dent; /* Holds the proc data */
136 unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */ 133 unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */
137 unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */ 134 unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */
@@ -395,6 +392,10 @@ enum vlan_ioctl_cmds {
395 GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */ 392 GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
396}; 393};
397 394
395enum vlan_flags {
396 VLAN_FLAG_REORDER_HDR = 0x1,
397};
398
398enum vlan_name_types { 399enum vlan_name_types {
399 VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */ 400 VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */
400 VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */ 401 VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index c0f7aec331c2..d83fee2dc643 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -3,35 +3,18 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/bitmap.h>
6#include <linux/if.h> 7#include <linux/if.h>
7#include <linux/netdevice.h> 8#include <linux/netdevice.h>
8#include <linux/rcupdate.h> 9#include <linux/rcupdate.h>
9#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/sysctl.h>
10 12
11struct ipv4_devconf 13struct ipv4_devconf
12{ 14{
13 int accept_redirects;
14 int send_redirects;
15 int secure_redirects;
16 int shared_media;
17 int accept_source_route;
18 int rp_filter;
19 int proxy_arp;
20 int bootp_relay;
21 int log_martians;
22 int forwarding;
23 int mc_forwarding;
24 int tag;
25 int arp_filter;
26 int arp_announce;
27 int arp_ignore;
28 int arp_accept;
29 int medium_id;
30 int no_xfrm;
31 int no_policy;
32 int force_igmp_version;
33 int promote_secondaries;
34 void *sysctl; 15 void *sysctl;
16 int data[__NET_IPV4_CONF_MAX - 1];
17 DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1);
35}; 18};
36 19
37extern struct ipv4_devconf ipv4_devconf; 20extern struct ipv4_devconf ipv4_devconf;
@@ -60,30 +43,70 @@ struct in_device
60 struct rcu_head rcu_head; 43 struct rcu_head rcu_head;
61}; 44};
62 45
63#define IN_DEV_FORWARD(in_dev) ((in_dev)->cnf.forwarding) 46#define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1])
64#define IN_DEV_MFORWARD(in_dev) (ipv4_devconf.mc_forwarding && (in_dev)->cnf.mc_forwarding) 47#define IPV4_DEVCONF_ALL(attr) IPV4_DEVCONF(ipv4_devconf, attr)
65#define IN_DEV_RPFILTER(in_dev) (ipv4_devconf.rp_filter && (in_dev)->cnf.rp_filter) 48
66#define IN_DEV_SOURCE_ROUTE(in_dev) (ipv4_devconf.accept_source_route && (in_dev)->cnf.accept_source_route) 49static inline int ipv4_devconf_get(struct in_device *in_dev, int index)
67#define IN_DEV_BOOTP_RELAY(in_dev) (ipv4_devconf.bootp_relay && (in_dev)->cnf.bootp_relay) 50{
68 51 index--;
69#define IN_DEV_LOG_MARTIANS(in_dev) (ipv4_devconf.log_martians || (in_dev)->cnf.log_martians) 52 return in_dev->cnf.data[index];
70#define IN_DEV_PROXY_ARP(in_dev) (ipv4_devconf.proxy_arp || (in_dev)->cnf.proxy_arp) 53}
71#define IN_DEV_SHARED_MEDIA(in_dev) (ipv4_devconf.shared_media || (in_dev)->cnf.shared_media) 54
72#define IN_DEV_TX_REDIRECTS(in_dev) (ipv4_devconf.send_redirects || (in_dev)->cnf.send_redirects) 55static inline void ipv4_devconf_set(struct in_device *in_dev, int index,
73#define IN_DEV_SEC_REDIRECTS(in_dev) (ipv4_devconf.secure_redirects || (in_dev)->cnf.secure_redirects) 56 int val)
74#define IN_DEV_IDTAG(in_dev) ((in_dev)->cnf.tag) 57{
75#define IN_DEV_MEDIUM_ID(in_dev) ((in_dev)->cnf.medium_id) 58 index--;
76#define IN_DEV_PROMOTE_SECONDARIES(in_dev) (ipv4_devconf.promote_secondaries || (in_dev)->cnf.promote_secondaries) 59 set_bit(index, in_dev->cnf.state);
60 in_dev->cnf.data[index] = val;
61}
62
63static inline void ipv4_devconf_setall(struct in_device *in_dev)
64{
65 bitmap_fill(in_dev->cnf.state, __NET_IPV4_CONF_MAX - 1);
66}
67
68#define IN_DEV_CONF_GET(in_dev, attr) \
69 ipv4_devconf_get((in_dev), NET_IPV4_CONF_ ## attr)
70#define IN_DEV_CONF_SET(in_dev, attr, val) \
71 ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val))
72
73#define IN_DEV_ANDCONF(in_dev, attr) \
74 (IPV4_DEVCONF_ALL(attr) && IN_DEV_CONF_GET((in_dev), attr))
75#define IN_DEV_ORCONF(in_dev, attr) \
76 (IPV4_DEVCONF_ALL(attr) || IN_DEV_CONF_GET((in_dev), attr))
77#define IN_DEV_MAXCONF(in_dev, attr) \
78 (max(IPV4_DEVCONF_ALL(attr), IN_DEV_CONF_GET((in_dev), attr)))
79
80#define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING)
81#define IN_DEV_MFORWARD(in_dev) (IPV4_DEVCONF_ALL(MC_FORWARDING) && \
82 IPV4_DEVCONF((in_dev)->cnf, \
83 MC_FORWARDING))
84#define IN_DEV_RPFILTER(in_dev) IN_DEV_ANDCONF((in_dev), RP_FILTER)
85#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \
86 ACCEPT_SOURCE_ROUTE)
87#define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY)
88
89#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS)
90#define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP)
91#define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA)
92#define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS)
93#define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \
94 SECURE_REDIRECTS)
95#define IN_DEV_IDTAG(in_dev) IN_DEV_CONF_GET(in_dev, TAG)
96#define IN_DEV_MEDIUM_ID(in_dev) IN_DEV_CONF_GET(in_dev, MEDIUM_ID)
97#define IN_DEV_PROMOTE_SECONDARIES(in_dev) \
98 IN_DEV_ORCONF((in_dev), \
99 PROMOTE_SECONDARIES)
77 100
78#define IN_DEV_RX_REDIRECTS(in_dev) \ 101#define IN_DEV_RX_REDIRECTS(in_dev) \
79 ((IN_DEV_FORWARD(in_dev) && \ 102 ((IN_DEV_FORWARD(in_dev) && \
80 (ipv4_devconf.accept_redirects && (in_dev)->cnf.accept_redirects)) \ 103 IN_DEV_ANDCONF((in_dev), ACCEPT_REDIRECTS)) \
81 || (!IN_DEV_FORWARD(in_dev) && \ 104 || (!IN_DEV_FORWARD(in_dev) && \
82 (ipv4_devconf.accept_redirects || (in_dev)->cnf.accept_redirects))) 105 IN_DEV_ORCONF((in_dev), ACCEPT_REDIRECTS)))
83 106
84#define IN_DEV_ARPFILTER(in_dev) (ipv4_devconf.arp_filter || (in_dev)->cnf.arp_filter) 107#define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER)
85#define IN_DEV_ARP_ANNOUNCE(in_dev) (max(ipv4_devconf.arp_announce, (in_dev)->cnf.arp_announce)) 108#define IN_DEV_ARP_ANNOUNCE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_ANNOUNCE)
86#define IN_DEV_ARP_IGNORE(in_dev) (max(ipv4_devconf.arp_ignore, (in_dev)->cnf.arp_ignore)) 109#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE)
87 110
88struct in_ifaddr 111struct in_ifaddr
89{ 112{
@@ -108,7 +131,6 @@ extern struct net_device *ip_dev_find(__be32 addr);
108extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); 131extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b);
109extern int devinet_ioctl(unsigned int cmd, void __user *); 132extern int devinet_ioctl(unsigned int cmd, void __user *);
110extern void devinet_init(void); 133extern void devinet_init(void);
111extern struct in_device *inetdev_init(struct net_device *dev);
112extern struct in_device *inetdev_by_index(int); 134extern struct in_device *inetdev_by_index(int);
113extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); 135extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
114extern __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local, int scope); 136extern __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local, int scope);
diff --git a/include/linux/init.h b/include/linux/init.h
index 56ec4c62eee0..f0d0e3295a9b 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -40,10 +40,10 @@
40 40
41/* These are for everybody (although not all archs will actually 41/* These are for everybody (although not all archs will actually
42 discard it in modules) */ 42 discard it in modules) */
43#define __init __attribute__ ((__section__ (".init.text"))) 43#define __init __attribute__ ((__section__ (".init.text"))) __cold
44#define __initdata __attribute__ ((__section__ (".init.data"))) 44#define __initdata __attribute__ ((__section__ (".init.data")))
45#define __exitdata __attribute__ ((__section__(".exit.data"))) 45#define __exitdata __attribute__ ((__section__(".exit.data")))
46#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) 46#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) __cold
47 47
48/* modpost check for section mismatches during the kernel build. 48/* modpost check for section mismatches during the kernel build.
49 * A section mismatch happens when there are references from a 49 * A section mismatch happens when there are references from a
@@ -59,9 +59,9 @@
59#define __initdata_refok __attribute__ ((__section__ (".data.init.refok"))) 59#define __initdata_refok __attribute__ ((__section__ (".data.init.refok")))
60 60
61#ifdef MODULE 61#ifdef MODULE
62#define __exit __attribute__ ((__section__(".exit.text"))) 62#define __exit __attribute__ ((__section__(".exit.text"))) __cold
63#else 63#else
64#define __exit __attribute_used__ __attribute__ ((__section__(".exit.text"))) 64#define __exit __attribute_used__ __attribute__ ((__section__(".exit.text"))) __cold
65#endif 65#endif
66 66
67/* For assembly routines */ 67/* For assembly routines */
@@ -171,9 +171,6 @@ struct obs_kernel_param {
171#define __setup(str, fn) \ 171#define __setup(str, fn) \
172 __setup_param(str, fn, fn, 0) 172 __setup_param(str, fn, fn, 0)
173 173
174#define __obsolete_setup(str) \
175 __setup_null_param(str, __LINE__)
176
177/* NOTE: fn is as per module_param, not __setup! Emits warning if fn 174/* NOTE: fn is as per module_param, not __setup! Emits warning if fn
178 * returns non-zero. */ 175 * returns non-zero. */
179#define early_param(str, fn) \ 176#define early_param(str, fn) \
@@ -239,7 +236,6 @@ void __init parse_early_param(void);
239#define __setup_param(str, unique_id, fn) /* nothing */ 236#define __setup_param(str, unique_id, fn) /* nothing */
240#define __setup_null_param(str, unique_id) /* nothing */ 237#define __setup_null_param(str, unique_id) /* nothing */
241#define __setup(str, func) /* nothing */ 238#define __setup(str, func) /* nothing */
242#define __obsolete_setup(str) /* nothing */
243#endif 239#endif
244 240
245/* Data marked not to be saved by software suspend */ 241/* Data marked not to be saved by software suspend */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 276ccaa2670c..cab741c2d603 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -8,6 +8,7 @@
8#include <linux/lockdep.h> 8#include <linux/lockdep.h>
9#include <linux/ipc.h> 9#include <linux/ipc.h>
10#include <linux/pid_namespace.h> 10#include <linux/pid_namespace.h>
11#include <linux/user_namespace.h>
11 12
12#define INIT_FDTABLE \ 13#define INIT_FDTABLE \
13{ \ 14{ \
@@ -78,6 +79,7 @@ extern struct nsproxy init_nsproxy;
78 .uts_ns = &init_uts_ns, \ 79 .uts_ns = &init_uts_ns, \
79 .mnt_ns = NULL, \ 80 .mnt_ns = NULL, \
80 INIT_IPC_NS(ipc_ns) \ 81 INIT_IPC_NS(ipc_ns) \
82 .user_ns = &init_user_ns, \
81} 83}
82 84
83#define INIT_SIGHAND(sighand) { \ 85#define INIT_SIGHAND(sighand) { \
diff --git a/include/linux/input.h b/include/linux/input.h
index be2bf3a2b031..e02c6a66b2ba 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -108,6 +108,13 @@ struct input_absinfo {
108 108
109/* 109/*
110 * Keys and buttons 110 * Keys and buttons
111 *
112 * Most of the keys/buttons are modeled after USB HUT 1.12
113 * (see http://www.usb.org/developers/hidpage).
114 * Abbreviations in the comments:
115 * AC - Application Control
116 * AL - Application Launch Button
117 * SC - System Control
111 */ 118 */
112 119
113#define KEY_RESERVED 0 120#define KEY_RESERVED 0
@@ -226,7 +233,7 @@ struct input_absinfo {
226#define KEY_MUTE 113 233#define KEY_MUTE 113
227#define KEY_VOLUMEDOWN 114 234#define KEY_VOLUMEDOWN 114
228#define KEY_VOLUMEUP 115 235#define KEY_VOLUMEUP 115
229#define KEY_POWER 116 236#define KEY_POWER 116 /* SC System Power Down */
230#define KEY_KPEQUAL 117 237#define KEY_KPEQUAL 117
231#define KEY_KPPLUSMINUS 118 238#define KEY_KPPLUSMINUS 118
232#define KEY_PAUSE 119 239#define KEY_PAUSE 119
@@ -240,38 +247,39 @@ struct input_absinfo {
240#define KEY_RIGHTMETA 126 247#define KEY_RIGHTMETA 126
241#define KEY_COMPOSE 127 248#define KEY_COMPOSE 127
242 249
243#define KEY_STOP 128 250#define KEY_STOP 128 /* AC Stop */
244#define KEY_AGAIN 129 251#define KEY_AGAIN 129
245#define KEY_PROPS 130 252#define KEY_PROPS 130 /* AC Properties */
246#define KEY_UNDO 131 253#define KEY_UNDO 131 /* AC Undo */
247#define KEY_FRONT 132 254#define KEY_FRONT 132
248#define KEY_COPY 133 255#define KEY_COPY 133 /* AC Copy */
249#define KEY_OPEN 134 256#define KEY_OPEN 134 /* AC Open */
250#define KEY_PASTE 135 257#define KEY_PASTE 135 /* AC Paste */
251#define KEY_FIND 136 258#define KEY_FIND 136 /* AC Search */
252#define KEY_CUT 137 259#define KEY_CUT 137 /* AC Cut */
253#define KEY_HELP 138 260#define KEY_HELP 138 /* AL Integrated Help Center */
254#define KEY_MENU 139 261#define KEY_MENU 139 /* Menu (show menu) */
255#define KEY_CALC 140 262#define KEY_CALC 140 /* AL Calculator */
256#define KEY_SETUP 141 263#define KEY_SETUP 141
257#define KEY_SLEEP 142 264#define KEY_SLEEP 142 /* SC System Sleep */
258#define KEY_WAKEUP 143 265#define KEY_WAKEUP 143 /* System Wake Up */
259#define KEY_FILE 144 266#define KEY_FILE 144 /* AL Local Machine Browser */
260#define KEY_SENDFILE 145 267#define KEY_SENDFILE 145
261#define KEY_DELETEFILE 146 268#define KEY_DELETEFILE 146
262#define KEY_XFER 147 269#define KEY_XFER 147
263#define KEY_PROG1 148 270#define KEY_PROG1 148
264#define KEY_PROG2 149 271#define KEY_PROG2 149
265#define KEY_WWW 150 272#define KEY_WWW 150 /* AL Internet Browser */
266#define KEY_MSDOS 151 273#define KEY_MSDOS 151
267#define KEY_COFFEE 152 274#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */
275#define KEY_SCREENLOCK KEY_COFFEE
268#define KEY_DIRECTION 153 276#define KEY_DIRECTION 153
269#define KEY_CYCLEWINDOWS 154 277#define KEY_CYCLEWINDOWS 154
270#define KEY_MAIL 155 278#define KEY_MAIL 155
271#define KEY_BOOKMARKS 156 279#define KEY_BOOKMARKS 156 /* AC Bookmarks */
272#define KEY_COMPUTER 157 280#define KEY_COMPUTER 157
273#define KEY_BACK 158 281#define KEY_BACK 158 /* AC Back */
274#define KEY_FORWARD 159 282#define KEY_FORWARD 159 /* AC Forward */
275#define KEY_CLOSECD 160 283#define KEY_CLOSECD 160
276#define KEY_EJECTCD 161 284#define KEY_EJECTCD 161
277#define KEY_EJECTCLOSECD 162 285#define KEY_EJECTCLOSECD 162
@@ -281,20 +289,20 @@ struct input_absinfo {
281#define KEY_STOPCD 166 289#define KEY_STOPCD 166
282#define KEY_RECORD 167 290#define KEY_RECORD 167
283#define KEY_REWIND 168 291#define KEY_REWIND 168
284#define KEY_PHONE 169 292#define KEY_PHONE 169 /* Media Select Telephone */
285#define KEY_ISO 170 293#define KEY_ISO 170
286#define KEY_CONFIG 171 294#define KEY_CONFIG 171 /* AL Consumer Control Configuration */
287#define KEY_HOMEPAGE 172 295#define KEY_HOMEPAGE 172 /* AC Home */
288#define KEY_REFRESH 173 296#define KEY_REFRESH 173 /* AC Refresh */
289#define KEY_EXIT 174 297#define KEY_EXIT 174 /* AC Exit */
290#define KEY_MOVE 175 298#define KEY_MOVE 175
291#define KEY_EDIT 176 299#define KEY_EDIT 176
292#define KEY_SCROLLUP 177 300#define KEY_SCROLLUP 177
293#define KEY_SCROLLDOWN 178 301#define KEY_SCROLLDOWN 178
294#define KEY_KPLEFTPAREN 179 302#define KEY_KPLEFTPAREN 179
295#define KEY_KPRIGHTPAREN 180 303#define KEY_KPRIGHTPAREN 180
296#define KEY_NEW 181 304#define KEY_NEW 181 /* AC New */
297#define KEY_REDO 182 305#define KEY_REDO 182 /* AC Redo/Repeat */
298 306
299#define KEY_F13 183 307#define KEY_F13 183
300#define KEY_F14 184 308#define KEY_F14 184
@@ -314,11 +322,11 @@ struct input_absinfo {
314#define KEY_PROG3 202 322#define KEY_PROG3 202
315#define KEY_PROG4 203 323#define KEY_PROG4 203
316#define KEY_SUSPEND 205 324#define KEY_SUSPEND 205
317#define KEY_CLOSE 206 325#define KEY_CLOSE 206 /* AC Close */
318#define KEY_PLAY 207 326#define KEY_PLAY 207
319#define KEY_FASTFORWARD 208 327#define KEY_FASTFORWARD 208
320#define KEY_BASSBOOST 209 328#define KEY_BASSBOOST 209
321#define KEY_PRINT 210 329#define KEY_PRINT 210 /* AC Print */
322#define KEY_HP 211 330#define KEY_HP 211
323#define KEY_CAMERA 212 331#define KEY_CAMERA 212
324#define KEY_SOUND 213 332#define KEY_SOUND 213
@@ -327,24 +335,25 @@ struct input_absinfo {
327#define KEY_CHAT 216 335#define KEY_CHAT 216
328#define KEY_SEARCH 217 336#define KEY_SEARCH 217
329#define KEY_CONNECT 218 337#define KEY_CONNECT 218
330#define KEY_FINANCE 219 338#define KEY_FINANCE 219 /* AL Checkbook/Finance */
331#define KEY_SPORT 220 339#define KEY_SPORT 220
332#define KEY_SHOP 221 340#define KEY_SHOP 221
333#define KEY_ALTERASE 222 341#define KEY_ALTERASE 222
334#define KEY_CANCEL 223 342#define KEY_CANCEL 223 /* AC Cancel */
335#define KEY_BRIGHTNESSDOWN 224 343#define KEY_BRIGHTNESSDOWN 224
336#define KEY_BRIGHTNESSUP 225 344#define KEY_BRIGHTNESSUP 225
337#define KEY_MEDIA 226 345#define KEY_MEDIA 226
338 346
339#define KEY_SWITCHVIDEOMODE 227 347#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video
348 outputs (Monitor/LCD/TV-out/etc) */
340#define KEY_KBDILLUMTOGGLE 228 349#define KEY_KBDILLUMTOGGLE 228
341#define KEY_KBDILLUMDOWN 229 350#define KEY_KBDILLUMDOWN 229
342#define KEY_KBDILLUMUP 230 351#define KEY_KBDILLUMUP 230
343 352
344#define KEY_SEND 231 353#define KEY_SEND 231 /* AC Send */
345#define KEY_REPLY 232 354#define KEY_REPLY 232 /* AC Reply */
346#define KEY_FORWARDMAIL 233 355#define KEY_FORWARDMAIL 233 /* AC Forward Msg */
347#define KEY_SAVE 234 356#define KEY_SAVE 234 /* AC Save */
348#define KEY_DOCUMENTS 235 357#define KEY_DOCUMENTS 235
349 358
350#define KEY_BATTERY 236 359#define KEY_BATTERY 236
@@ -433,15 +442,15 @@ struct input_absinfo {
433#define KEY_CLEAR 0x163 442#define KEY_CLEAR 0x163
434#define KEY_POWER2 0x164 443#define KEY_POWER2 0x164
435#define KEY_OPTION 0x165 444#define KEY_OPTION 0x165
436#define KEY_INFO 0x166 445#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */
437#define KEY_TIME 0x167 446#define KEY_TIME 0x167
438#define KEY_VENDOR 0x168 447#define KEY_VENDOR 0x168
439#define KEY_ARCHIVE 0x169 448#define KEY_ARCHIVE 0x169
440#define KEY_PROGRAM 0x16a 449#define KEY_PROGRAM 0x16a /* Media Select Program Guide */
441#define KEY_CHANNEL 0x16b 450#define KEY_CHANNEL 0x16b
442#define KEY_FAVORITES 0x16c 451#define KEY_FAVORITES 0x16c
443#define KEY_EPG 0x16d 452#define KEY_EPG 0x16d
444#define KEY_PVR 0x16e 453#define KEY_PVR 0x16e /* Media Select Home */
445#define KEY_MHP 0x16f 454#define KEY_MHP 0x16f
446#define KEY_LANGUAGE 0x170 455#define KEY_LANGUAGE 0x170
447#define KEY_TITLE 0x171 456#define KEY_TITLE 0x171
@@ -451,36 +460,36 @@ struct input_absinfo {
451#define KEY_MODE 0x175 460#define KEY_MODE 0x175
452#define KEY_KEYBOARD 0x176 461#define KEY_KEYBOARD 0x176
453#define KEY_SCREEN 0x177 462#define KEY_SCREEN 0x177
454#define KEY_PC 0x178 463#define KEY_PC 0x178 /* Media Select Computer */
455#define KEY_TV 0x179 464#define KEY_TV 0x179 /* Media Select TV */
456#define KEY_TV2 0x17a 465#define KEY_TV2 0x17a /* Media Select Cable */
457#define KEY_VCR 0x17b 466#define KEY_VCR 0x17b /* Media Select VCR */
458#define KEY_VCR2 0x17c 467#define KEY_VCR2 0x17c /* VCR Plus */
459#define KEY_SAT 0x17d 468#define KEY_SAT 0x17d /* Media Select Satellite */
460#define KEY_SAT2 0x17e 469#define KEY_SAT2 0x17e
461#define KEY_CD 0x17f 470#define KEY_CD 0x17f /* Media Select CD */
462#define KEY_TAPE 0x180 471#define KEY_TAPE 0x180 /* Media Select Tape */
463#define KEY_RADIO 0x181 472#define KEY_RADIO 0x181
464#define KEY_TUNER 0x182 473#define KEY_TUNER 0x182 /* Media Select Tuner */
465#define KEY_PLAYER 0x183 474#define KEY_PLAYER 0x183
466#define KEY_TEXT 0x184 475#define KEY_TEXT 0x184
467#define KEY_DVD 0x185 476#define KEY_DVD 0x185 /* Media Select DVD */
468#define KEY_AUX 0x186 477#define KEY_AUX 0x186
469#define KEY_MP3 0x187 478#define KEY_MP3 0x187
470#define KEY_AUDIO 0x188 479#define KEY_AUDIO 0x188
471#define KEY_VIDEO 0x189 480#define KEY_VIDEO 0x189
472#define KEY_DIRECTORY 0x18a 481#define KEY_DIRECTORY 0x18a
473#define KEY_LIST 0x18b 482#define KEY_LIST 0x18b
474#define KEY_MEMO 0x18c 483#define KEY_MEMO 0x18c /* Media Select Messages */
475#define KEY_CALENDAR 0x18d 484#define KEY_CALENDAR 0x18d
476#define KEY_RED 0x18e 485#define KEY_RED 0x18e
477#define KEY_GREEN 0x18f 486#define KEY_GREEN 0x18f
478#define KEY_YELLOW 0x190 487#define KEY_YELLOW 0x190
479#define KEY_BLUE 0x191 488#define KEY_BLUE 0x191
480#define KEY_CHANNELUP 0x192 489#define KEY_CHANNELUP 0x192 /* Channel Increment */
481#define KEY_CHANNELDOWN 0x193 490#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */
482#define KEY_FIRST 0x194 491#define KEY_FIRST 0x194
483#define KEY_LAST 0x195 492#define KEY_LAST 0x195 /* Recall Last */
484#define KEY_AB 0x196 493#define KEY_AB 0x196
485#define KEY_NEXT 0x197 494#define KEY_NEXT 0x197
486#define KEY_RESTART 0x198 495#define KEY_RESTART 0x198
@@ -491,21 +500,21 @@ struct input_absinfo {
491#define KEY_DIGITS 0x19d 500#define KEY_DIGITS 0x19d
492#define KEY_TEEN 0x19e 501#define KEY_TEEN 0x19e
493#define KEY_TWEN 0x19f 502#define KEY_TWEN 0x19f
494#define KEY_VIDEOPHONE 0x1a0 503#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */
495#define KEY_GAMES 0x1a1 504#define KEY_GAMES 0x1a1 /* Media Select Games */
496#define KEY_ZOOMIN 0x1a2 505#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */
497#define KEY_ZOOMOUT 0x1a3 506#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */
498#define KEY_ZOOMRESET 0x1a4 507#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */
499#define KEY_WORDPROCESSOR 0x1a5 508#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */
500#define KEY_EDITOR 0x1a6 509#define KEY_EDITOR 0x1a6 /* AL Text Editor */
501#define KEY_SPREADSHEET 0x1a7 510#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */
502#define KEY_GRAPHICSEDITOR 0x1a8 511#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */
503#define KEY_PRESENTATION 0x1a9 512#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */
504#define KEY_DATABASE 0x1aa 513#define KEY_DATABASE 0x1aa /* AL Database App */
505#define KEY_NEWS 0x1ab 514#define KEY_NEWS 0x1ab /* AL Newsreader */
506#define KEY_VOICEMAIL 0x1ac 515#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */
507#define KEY_ADDRESSBOOK 0x1ad 516#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */
508#define KEY_MESSENGER 0x1ae 517#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */
509#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ 518#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */
510 519
511#define KEY_DEL_EOL 0x1c0 520#define KEY_DEL_EOL 0x1c0
@@ -603,6 +612,7 @@ struct input_absinfo {
603#define SW_LID 0x00 /* set = lid shut */ 612#define SW_LID 0x00 /* set = lid shut */
604#define SW_TABLET_MODE 0x01 /* set = tablet mode */ 613#define SW_TABLET_MODE 0x01 /* set = tablet mode */
605#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ 614#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */
615#define SW_RADIO 0x03 /* set = radio enabled */
606#define SW_MAX 0x0f 616#define SW_MAX 0x0f
607 617
608/* 618/*
@@ -972,15 +982,15 @@ struct input_dev {
972 struct mutex mutex; /* serializes open and close operations */ 982 struct mutex mutex; /* serializes open and close operations */
973 unsigned int users; 983 unsigned int users;
974 984
975 struct class_device cdev; 985 struct device dev;
976 union { /* temporarily so while we switching to struct device */ 986 union { /* temporarily so while we switching to struct device */
977 struct device *parent; 987 struct device *dev;
978 } dev; 988 } cdev;
979 989
980 struct list_head h_list; 990 struct list_head h_list;
981 struct list_head node; 991 struct list_head node;
982}; 992};
983#define to_input_dev(d) container_of(d, struct input_dev, cdev) 993#define to_input_dev(d) container_of(d, struct input_dev, dev)
984 994
985/* 995/*
986 * Verify that we are in sync with input_device_id mod_devicetable.h #defines 996 * Verify that we are in sync with input_device_id mod_devicetable.h #defines
@@ -1087,22 +1097,22 @@ struct input_handle {
1087 struct list_head h_node; 1097 struct list_head h_node;
1088}; 1098};
1089 1099
1090#define to_dev(n) container_of(n,struct input_dev,node) 1100#define to_dev(n) container_of(n, struct input_dev, node)
1091#define to_handler(n) container_of(n,struct input_handler,node) 1101#define to_handler(n) container_of(n, struct input_handler, node)
1092#define to_handle(n) container_of(n,struct input_handle,d_node) 1102#define to_handle(n) container_of(n, struct input_handle, d_node)
1093#define to_handle_h(n) container_of(n,struct input_handle,h_node) 1103#define to_handle_h(n) container_of(n, struct input_handle, h_node)
1094 1104
1095struct input_dev *input_allocate_device(void); 1105struct input_dev *input_allocate_device(void);
1096void input_free_device(struct input_dev *dev); 1106void input_free_device(struct input_dev *dev);
1097 1107
1098static inline struct input_dev *input_get_device(struct input_dev *dev) 1108static inline struct input_dev *input_get_device(struct input_dev *dev)
1099{ 1109{
1100 return to_input_dev(class_device_get(&dev->cdev)); 1110 return to_input_dev(get_device(&dev->dev));
1101} 1111}
1102 1112
1103static inline void input_put_device(struct input_dev *dev) 1113static inline void input_put_device(struct input_dev *dev)
1104{ 1114{
1105 class_device_put(&dev->cdev); 1115 put_device(&dev->dev);
1106} 1116}
1107 1117
1108static inline void *input_get_drvdata(struct input_dev *dev) 1118static inline void *input_get_drvdata(struct input_dev *dev)
diff --git a/include/linux/io.h b/include/linux/io.h
index 8423dd376514..e3b2dda6c8eb 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -63,32 +63,7 @@ void __iomem * devm_ioremap(struct device *dev, unsigned long offset,
63void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset, 63void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset,
64 unsigned long size); 64 unsigned long size);
65void devm_iounmap(struct device *dev, void __iomem *addr); 65void devm_iounmap(struct device *dev, void __iomem *addr);
66 66int check_signature(const volatile void __iomem *io_addr,
67/** 67 const unsigned char *signature, int length);
68 * check_signature - find BIOS signatures
69 * @io_addr: mmio address to check
70 * @signature: signature block
71 * @length: length of signature
72 *
73 * Perform a signature comparison with the mmio address io_addr. This
74 * address should have been obtained by ioremap.
75 * Returns 1 on a match.
76 */
77
78static inline int check_signature(const volatile void __iomem *io_addr,
79 const unsigned char *signature, int length)
80{
81 int retval = 0;
82 do {
83 if (readb(io_addr) != *signature)
84 goto out;
85 io_addr++;
86 signature++;
87 length--;
88 } while (length);
89 retval = 1;
90out:
91 return retval;
92}
93 68
94#endif /* _LINUX_IO_H */ 69#endif /* _LINUX_IO_H */
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
index 8e2042b9d471..baf29387cab4 100644
--- a/include/linux/ioprio.h
+++ b/include/linux/ioprio.h
@@ -47,8 +47,18 @@ enum {
47#define IOPRIO_NORM (4) 47#define IOPRIO_NORM (4)
48static inline int task_ioprio(struct task_struct *task) 48static inline int task_ioprio(struct task_struct *task)
49{ 49{
50 WARN_ON(!ioprio_valid(task->ioprio)); 50 if (ioprio_valid(task->ioprio))
51 return IOPRIO_PRIO_DATA(task->ioprio); 51 return IOPRIO_PRIO_DATA(task->ioprio);
52
53 return IOPRIO_NORM;
54}
55
56static inline int task_ioprio_class(struct task_struct *task)
57{
58 if (ioprio_valid(task->ioprio))
59 return IOPRIO_PRIO_CLASS(task->ioprio);
60
61 return IOPRIO_CLASS_BE;
52} 62}
53 63
54static inline int task_nice_ioprio(struct task_struct *task) 64static inline int task_nice_ioprio(struct task_struct *task)
diff --git a/include/linux/ip_mp_alg.h b/include/linux/ip_mp_alg.h
deleted file mode 100644
index e234e2008f5d..000000000000
--- a/include/linux/ip_mp_alg.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/* ip_mp_alg.h: IPV4 multipath algorithm support, user-visible values.
2 *
3 * Copyright (C) 2004, 2005 Einar Lueck <elueck@de.ibm.com>
4 * Copyright (C) 2005 David S. Miller <davem@davemloft.net>
5 */
6
7#ifndef _LINUX_IP_MP_ALG_H
8#define _LINUX_IP_MP_ALG_H
9
10enum ip_mp_alg {
11 IP_MP_ALG_NONE,
12 IP_MP_ALG_RR,
13 IP_MP_ALG_DRR,
14 IP_MP_ALG_RANDOM,
15 IP_MP_ALG_WRANDOM,
16 __IP_MP_ALG_MAX
17};
18
19#define IP_MP_ALG_MAX (__IP_MP_ALG_MAX - 1)
20
21#endif /* _LINUX_IP_MP_ALG_H */
22
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 1980867a64a4..3fd3ddd5f0d9 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -52,6 +52,7 @@ struct ipc_perm
52#ifdef __KERNEL__ 52#ifdef __KERNEL__
53 53
54#include <linux/kref.h> 54#include <linux/kref.h>
55#include <linux/spinlock.h>
55 56
56#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ 57#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
57 58
@@ -92,6 +93,7 @@ extern struct ipc_namespace init_ipc_ns;
92 93
93#ifdef CONFIG_SYSVIPC 94#ifdef CONFIG_SYSVIPC
94#define INIT_IPC_NS(ns) .ns = &init_ipc_ns, 95#define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
96extern void free_ipc_ns(struct kref *kref);
95extern struct ipc_namespace *copy_ipcs(unsigned long flags, 97extern struct ipc_namespace *copy_ipcs(unsigned long flags,
96 struct ipc_namespace *ns); 98 struct ipc_namespace *ns);
97#else 99#else
@@ -103,13 +105,9 @@ static inline struct ipc_namespace *copy_ipcs(unsigned long flags,
103} 105}
104#endif 106#endif
105 107
106#ifdef CONFIG_IPC_NS
107extern void free_ipc_ns(struct kref *kref);
108#endif
109
110static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) 108static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
111{ 109{
112#ifdef CONFIG_IPC_NS 110#ifdef CONFIG_SYSVIPC
113 if (ns) 111 if (ns)
114 kref_get(&ns->kref); 112 kref_get(&ns->kref);
115#endif 113#endif
@@ -118,7 +116,7 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
118 116
119static inline void put_ipc_ns(struct ipc_namespace *ns) 117static inline void put_ipc_ns(struct ipc_namespace *ns)
120{ 118{
121#ifdef CONFIG_IPC_NS 119#ifdef CONFIG_SYSVIPC
122 kref_put(&ns->kref, free_ipc_ns); 120 kref_put(&ns->kref, free_ipc_ns);
123#endif 121#endif
124} 122}
@@ -126,5 +124,3 @@ static inline void put_ipc_ns(struct ipc_namespace *ns)
126#endif /* __KERNEL__ */ 124#endif /* __KERNEL__ */
127 125
128#endif /* _LINUX_IPC_H */ 126#endif /* _LINUX_IPC_H */
129
130
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 648bd1f0912d..97983dc9df13 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -27,8 +27,8 @@ struct in6_ifreq {
27 int ifr6_ifindex; 27 int ifr6_ifindex;
28}; 28};
29 29
30#define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */ 30#define IPV6_SRCRT_STRICT 0x01 /* Deprecated; will be removed */
31#define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */ 31#define IPV6_SRCRT_TYPE_0 0 /* Deprecated; will be removed */
32#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */ 32#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */
33 33
34/* 34/*
@@ -247,7 +247,7 @@ struct inet6_skb_parm {
247 __u16 lastopt; 247 __u16 lastopt;
248 __u32 nhoff; 248 __u32 nhoff;
249 __u16 flags; 249 __u16 flags;
250#ifdef CONFIG_IPV6_MIP6 250#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
251 __u16 dsthao; 251 __u16 dsthao;
252#endif 252#endif
253 253
@@ -299,8 +299,8 @@ struct ipv6_pinfo {
299 /* pktoption flags */ 299 /* pktoption flags */
300 union { 300 union {
301 struct { 301 struct {
302 __u16 srcrt:2, 302 __u16 srcrt:1,
303 osrcrt:2, 303 osrcrt:1,
304 rxinfo:1, 304 rxinfo:1,
305 rxoinfo:1, 305 rxoinfo:1,
306 rxhlim:1, 306 rxhlim:1,
diff --git a/include/linux/irda.h b/include/linux/irda.h
index 945ba3110874..28f88ecba344 100644
--- a/include/linux/irda.h
+++ b/include/linux/irda.h
@@ -77,6 +77,7 @@ typedef enum {
77 IRDA_ACT200L_DONGLE = 10, 77 IRDA_ACT200L_DONGLE = 10,
78 IRDA_MA600_DONGLE = 11, 78 IRDA_MA600_DONGLE = 11,
79 IRDA_TOIM3232_DONGLE = 12, 79 IRDA_TOIM3232_DONGLE = 12,
80 IRDA_EP7211_DONGLE = 13,
80} IRDA_DONGLE; 81} IRDA_DONGLE;
81 82
82/* Protocol types to be used for SOCK_DGRAM */ 83/* Protocol types to be used for SOCK_DGRAM */
@@ -216,6 +217,34 @@ struct if_irda_req {
216#define ifr_dtr ifr_ifru.ifru_line.dtr 217#define ifr_dtr ifr_ifru.ifru_line.dtr
217#define ifr_rts ifr_ifru.ifru_line.rts 218#define ifr_rts ifr_ifru.ifru_line.rts
218 219
220
221/* IrDA netlink definitions */
222#define IRDA_NL_NAME "irda"
223#define IRDA_NL_VERSION 1
224
225enum irda_nl_commands {
226 IRDA_NL_CMD_UNSPEC,
227 IRDA_NL_CMD_SET_MODE,
228 IRDA_NL_CMD_GET_MODE,
229
230 __IRDA_NL_CMD_AFTER_LAST
231};
232#define IRDA_NL_CMD_MAX (__IRDA_NL_CMD_AFTER_LAST - 1)
233
234enum nl80211_attrs {
235 IRDA_NL_ATTR_UNSPEC,
236 IRDA_NL_ATTR_IFNAME,
237 IRDA_NL_ATTR_MODE,
238
239 __IRDA_NL_ATTR_AFTER_LAST
240};
241#define IRDA_NL_ATTR_MAX (__IRDA_NL_ATTR_AFTER_LAST - 1)
242
243/* IrDA modes */
244#define IRDA_MODE_PRIMARY 0x1
245#define IRDA_MODE_SECONDARY 0x2
246#define IRDA_MODE_MONITOR 0x4
247
219#endif /* KERNEL_IRDA_H */ 248#endif /* KERNEL_IRDA_H */
220 249
221 250
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 1695054e8c63..44657197fcb0 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -161,6 +161,7 @@ struct irq_desc {
161 unsigned int wake_depth; /* nested wake enables */ 161 unsigned int wake_depth; /* nested wake enables */
162 unsigned int irq_count; /* For detecting broken IRQs */ 162 unsigned int irq_count; /* For detecting broken IRQs */
163 unsigned int irqs_unhandled; 163 unsigned int irqs_unhandled;
164 unsigned long last_unhandled; /* Aging timer for unhandled count */
164 spinlock_t lock; 165 spinlock_t lock;
165#ifdef CONFIG_SMP 166#ifdef CONFIG_SMP
166 cpumask_t affinity; 167 cpumask_t affinity;
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 0e0fedd2039a..260d6d76c5f3 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -50,14 +50,14 @@
50 */ 50 */
51#define JBD_DEFAULT_MAX_COMMIT_AGE 5 51#define JBD_DEFAULT_MAX_COMMIT_AGE 5
52 52
53#ifdef CONFIG_JBD_DEBUG 53#ifdef CONFIG_JBD2_DEBUG
54/* 54/*
55 * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal 55 * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal
56 * consistency checks. By default we don't do this unless 56 * consistency checks. By default we don't do this unless
57 * CONFIG_JBD_DEBUG is on. 57 * CONFIG_JBD2_DEBUG is on.
58 */ 58 */
59#define JBD_EXPENSIVE_CHECKING 59#define JBD_EXPENSIVE_CHECKING
60extern int jbd2_journal_enable_debug; 60extern u8 jbd2_journal_enable_debug;
61 61
62#define jbd_debug(n, f, a...) \ 62#define jbd_debug(n, f, a...) \
63 do { \ 63 do { \
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 12178d2c882b..f73de6fb5c68 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -5,10 +5,11 @@
5#ifndef _LINUX_KALLSYMS_H 5#ifndef _LINUX_KALLSYMS_H
6#define _LINUX_KALLSYMS_H 6#define _LINUX_KALLSYMS_H
7 7
8#include <linux/errno.h>
8 9
9#define KSYM_NAME_LEN 127 10#define KSYM_NAME_LEN 128
10#define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN + \ 11#define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \
11 2*(BITS_PER_LONG*3/10) + MODULE_NAME_LEN + 1) 12 2*(BITS_PER_LONG*3/10) + (MODULE_NAME_LEN - 1) + 1)
12 13
13#ifdef CONFIG_KALLSYMS 14#ifdef CONFIG_KALLSYMS
14/* Lookup the address for a symbol. Returns 0 if not found. */ 15/* Lookup the address for a symbol. Returns 0 if not found. */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 45353d757cd0..4300bb462d29 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -106,7 +106,7 @@ extern int cond_resched(void);
106extern struct atomic_notifier_head panic_notifier_list; 106extern struct atomic_notifier_head panic_notifier_list;
107extern long (*panic_blink)(long time); 107extern long (*panic_blink)(long time);
108NORET_TYPE void panic(const char * fmt, ...) 108NORET_TYPE void panic(const char * fmt, ...)
109 __attribute__ ((NORET_AND format (printf, 1, 2))); 109 __attribute__ ((NORET_AND format (printf, 1, 2))) __cold;
110extern void oops_enter(void); 110extern void oops_enter(void);
111extern void oops_exit(void); 111extern void oops_exit(void);
112extern int oops_may_print(void); 112extern int oops_may_print(void);
@@ -155,14 +155,14 @@ extern void dump_thread(struct pt_regs *regs, struct user *dump);
155asmlinkage int vprintk(const char *fmt, va_list args) 155asmlinkage int vprintk(const char *fmt, va_list args)
156 __attribute__ ((format (printf, 1, 0))); 156 __attribute__ ((format (printf, 1, 0)));
157asmlinkage int printk(const char * fmt, ...) 157asmlinkage int printk(const char * fmt, ...)
158 __attribute__ ((format (printf, 1, 2))); 158 __attribute__ ((format (printf, 1, 2))) __cold;
159#else 159#else
160static inline int vprintk(const char *s, va_list args) 160static inline int vprintk(const char *s, va_list args)
161 __attribute__ ((format (printf, 1, 0))); 161 __attribute__ ((format (printf, 1, 0)));
162static inline int vprintk(const char *s, va_list args) { return 0; } 162static inline int vprintk(const char *s, va_list args) { return 0; }
163static inline int printk(const char *s, ...) 163static inline int printk(const char *s, ...)
164 __attribute__ ((format (printf, 1, 2))); 164 __attribute__ ((format (printf, 1, 2)));
165static inline int printk(const char *s, ...) { return 0; } 165static inline int __cold printk(const char *s, ...) { return 0; }
166#endif 166#endif
167 167
168unsigned long int_sqrt(unsigned long); 168unsigned long int_sqrt(unsigned long);
@@ -210,18 +210,23 @@ extern enum system_states {
210#define TAINT_MACHINE_CHECK (1<<4) 210#define TAINT_MACHINE_CHECK (1<<4)
211#define TAINT_BAD_PAGE (1<<5) 211#define TAINT_BAD_PAGE (1<<5)
212#define TAINT_USER (1<<6) 212#define TAINT_USER (1<<6)
213#define TAINT_DIE (1<<7)
213 214
214extern void dump_stack(void); 215extern void dump_stack(void) __cold;
215 216
216enum { 217enum {
217 DUMP_PREFIX_NONE, 218 DUMP_PREFIX_NONE,
218 DUMP_PREFIX_ADDRESS, 219 DUMP_PREFIX_ADDRESS,
219 DUMP_PREFIX_OFFSET 220 DUMP_PREFIX_OFFSET
220}; 221};
221extern void hex_dump_to_buffer(const void *buf, size_t len, char *linebuf, 222extern void hex_dump_to_buffer(const void *buf, size_t len,
222 size_t linebuflen); 223 int rowsize, int groupsize,
223extern void print_hex_dump(const char *level, int prefix_type, 224 char *linebuf, size_t linebuflen, bool ascii);
224 void *buf, size_t len); 225extern void print_hex_dump(const char *level, const char *prefix_str,
226 int prefix_type, int rowsize, int groupsize,
227 void *buf, size_t len, bool ascii);
228extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
229 void *buf, size_t len);
225#define hex_asc(x) "0123456789abcdef"[x] 230#define hex_asc(x) "0123456789abcdef"[x]
226 231
227#ifdef DEBUG 232#ifdef DEBUG
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h
index aea34e74c496..8c4350a9ed87 100644
--- a/include/linux/kernelcapi.h
+++ b/include/linux/kernelcapi.h
@@ -64,7 +64,7 @@ struct capi20_appl {
64 unsigned long nrecvdatapkt; 64 unsigned long nrecvdatapkt;
65 unsigned long nsentctlpkt; 65 unsigned long nsentctlpkt;
66 unsigned long nsentdatapkt; 66 unsigned long nsentdatapkt;
67 struct semaphore recv_sem; 67 struct mutex recv_mtx;
68 struct sk_buff_head recv_queue; 68 struct sk_buff_head recv_queue;
69 struct work_struct recv_work; 69 struct work_struct recv_work;
70 int release_in_progress; 70 int release_in_progress;
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 10f505c8431d..5dc13848891b 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -36,13 +36,57 @@ static inline int request_module(const char * name, ...) { return -ENOSYS; }
36#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x))) 36#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
37 37
38struct key; 38struct key;
39extern int call_usermodehelper_keys(char *path, char *argv[], char *envp[], 39struct file;
40 struct key *session_keyring, int wait); 40struct subprocess_info;
41
42/* Allocate a subprocess_info structure */
43struct subprocess_info *call_usermodehelper_setup(char *path,
44 char **argv, char **envp);
45
46/* Set various pieces of state into the subprocess_info structure */
47void call_usermodehelper_setkeys(struct subprocess_info *info,
48 struct key *session_keyring);
49int call_usermodehelper_stdinpipe(struct subprocess_info *sub_info,
50 struct file **filp);
51void call_usermodehelper_setcleanup(struct subprocess_info *info,
52 void (*cleanup)(char **argv, char **envp));
53
54enum umh_wait {
55 UMH_NO_WAIT = -1, /* don't wait at all */
56 UMH_WAIT_EXEC = 0, /* wait for the exec, but not the process */
57 UMH_WAIT_PROC = 1, /* wait for the process to complete */
58};
59
60/* Actually execute the sub-process */
61int call_usermodehelper_exec(struct subprocess_info *info, enum umh_wait wait);
62
63/* Free the subprocess_info. This is only needed if you're not going
64 to call call_usermodehelper_exec */
65void call_usermodehelper_freeinfo(struct subprocess_info *info);
41 66
42static inline int 67static inline int
43call_usermodehelper(char *path, char **argv, char **envp, int wait) 68call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait)
44{ 69{
45 return call_usermodehelper_keys(path, argv, envp, NULL, wait); 70 struct subprocess_info *info;
71
72 info = call_usermodehelper_setup(path, argv, envp);
73 if (info == NULL)
74 return -ENOMEM;
75 return call_usermodehelper_exec(info, wait);
76}
77
78static inline int
79call_usermodehelper_keys(char *path, char **argv, char **envp,
80 struct key *session_keyring, enum umh_wait wait)
81{
82 struct subprocess_info *info;
83
84 info = call_usermodehelper_setup(path, argv, envp);
85 if (info == NULL)
86 return -ENOMEM;
87
88 call_usermodehelper_setkeys(info, session_keyring);
89 return call_usermodehelper_exec(info, wait);
46} 90}
47 91
48extern void usermodehelper_init(void); 92extern void usermodehelper_init(void);
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index c288e41ba331..aa2fe22b1baa 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -36,15 +36,24 @@ extern char uevent_helper[];
36/* counter to tag the uevent, read only except for the kobject core */ 36/* counter to tag the uevent, read only except for the kobject core */
37extern u64 uevent_seqnum; 37extern u64 uevent_seqnum;
38 38
39/* the actions here must match the proper string in lib/kobject_uevent.c */ 39/*
40typedef int __bitwise kobject_action_t; 40 * The actions here must match the index to the string array
41 * in lib/kobject_uevent.c
42 *
43 * Do not add new actions here without checking with the driver-core
44 * maintainers. Action strings are not meant to express subsystem
45 * or device specific properties. In most cases you want to send a
46 * kobject_uevent_env(kobj, KOBJ_CHANGE, env) with additional event
47 * specific variables added to the event environment.
48 */
41enum kobject_action { 49enum kobject_action {
42 KOBJ_ADD = (__force kobject_action_t) 0x01, /* exclusive to core */ 50 KOBJ_ADD,
43 KOBJ_REMOVE = (__force kobject_action_t) 0x02, /* exclusive to core */ 51 KOBJ_REMOVE,
44 KOBJ_CHANGE = (__force kobject_action_t) 0x03, /* device state change */ 52 KOBJ_CHANGE,
45 KOBJ_OFFLINE = (__force kobject_action_t) 0x04, /* device offline */ 53 KOBJ_MOVE,
46 KOBJ_ONLINE = (__force kobject_action_t) 0x05, /* device online */ 54 KOBJ_ONLINE,
47 KOBJ_MOVE = (__force kobject_action_t) 0x06, /* device move */ 55 KOBJ_OFFLINE,
56 KOBJ_MAX
48}; 57};
49 58
50struct kobject { 59struct kobject {
@@ -55,7 +64,7 @@ struct kobject {
55 struct kobject * parent; 64 struct kobject * parent;
56 struct kset * kset; 65 struct kset * kset;
57 struct kobj_type * ktype; 66 struct kobj_type * ktype;
58 struct dentry * dentry; 67 struct sysfs_dirent * sd;
59 wait_queue_head_t poll; 68 wait_queue_head_t poll;
60}; 69};
61 70
@@ -71,13 +80,14 @@ extern void kobject_init(struct kobject *);
71extern void kobject_cleanup(struct kobject *); 80extern void kobject_cleanup(struct kobject *);
72 81
73extern int __must_check kobject_add(struct kobject *); 82extern int __must_check kobject_add(struct kobject *);
74extern int __must_check kobject_shadow_add(struct kobject *, struct dentry *); 83extern int __must_check kobject_shadow_add(struct kobject *kobj,
84 struct sysfs_dirent *shadow_parent);
75extern void kobject_del(struct kobject *); 85extern void kobject_del(struct kobject *);
76 86
77extern int __must_check kobject_rename(struct kobject *, const char *new_name); 87extern int __must_check kobject_rename(struct kobject *, const char *new_name);
78extern int __must_check kobject_shadow_rename(struct kobject *kobj, 88extern int __must_check kobject_shadow_rename(struct kobject *kobj,
79 struct dentry *new_parent, 89 struct sysfs_dirent *new_parent,
80 const char *new_name); 90 const char *new_name);
81extern int __must_check kobject_move(struct kobject *, struct kobject *); 91extern int __must_check kobject_move(struct kobject *, struct kobject *);
82 92
83extern int __must_check kobject_register(struct kobject *); 93extern int __must_check kobject_register(struct kobject *);
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 23adf6075ae4..51464d12a4e5 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -116,9 +116,12 @@ struct kprobe {
116 */ 116 */
117struct jprobe { 117struct jprobe {
118 struct kprobe kp; 118 struct kprobe kp;
119 kprobe_opcode_t *entry; /* probe handling code to jump to */ 119 void *entry; /* probe handling code to jump to */
120}; 120};
121 121
122/* For backward compatibility with old code using JPROBE_ENTRY() */
123#define JPROBE_ENTRY(handler) (handler)
124
122DECLARE_PER_CPU(struct kprobe *, current_kprobe); 125DECLARE_PER_CPU(struct kprobe *, current_kprobe);
123DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 126DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
124 127
@@ -211,6 +214,7 @@ int longjmp_break_handler(struct kprobe *, struct pt_regs *);
211int register_jprobe(struct jprobe *p); 214int register_jprobe(struct jprobe *p);
212void unregister_jprobe(struct jprobe *p); 215void unregister_jprobe(struct jprobe *p);
213void jprobe_return(void); 216void jprobe_return(void);
217unsigned long arch_deref_entry_point(void *);
214 218
215int register_kretprobe(struct kretprobe *rp); 219int register_kretprobe(struct kretprobe *rp);
216void unregister_kretprobe(struct kretprobe *rp); 220void unregister_kretprobe(struct kretprobe *rp);
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index c762954bda14..dae7143644fe 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -261,12 +261,34 @@ static inline s64 ktime_to_ns(const ktime_t kt)
261 261
262#endif 262#endif
263 263
264/**
265 * ktime_equal - Compares two ktime_t variables to see if they are equal
266 * @cmp1: comparable1
267 * @cmp2: comparable2
268 *
269 * Compare two ktime_t variables, returns 1 if equal
270 */
271static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
272{
273 return cmp1.tv64 == cmp2.tv64;
274}
275
264static inline s64 ktime_to_us(const ktime_t kt) 276static inline s64 ktime_to_us(const ktime_t kt)
265{ 277{
266 struct timeval tv = ktime_to_timeval(kt); 278 struct timeval tv = ktime_to_timeval(kt);
267 return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec; 279 return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec;
268} 280}
269 281
282static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier)
283{
284 return ktime_to_us(ktime_sub(later, earlier));
285}
286
287static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec)
288{
289 return ktime_add_ns(kt, usec * 1000);
290}
291
270/* 292/*
271 * The resolution of the clocks. The resolution value is returned in 293 * The resolution of the clocks. The resolution value is returned in
272 * the clock_getres() system call to give application programmers an 294 * the clock_getres() system call to give application programmers an
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 88afceffb7cb..494bed7c2fc1 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -13,7 +13,6 @@
13#define __LINUX_LEDS_H_INCLUDED 13#define __LINUX_LEDS_H_INCLUDED
14 14
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/spinlock.h>
17 16
18struct device; 17struct device;
19struct class_device; 18struct class_device;
diff --git a/include/linux/lguest.h b/include/linux/lguest.h
new file mode 100644
index 000000000000..500aace21ca7
--- /dev/null
+++ b/include/linux/lguest.h
@@ -0,0 +1,85 @@
1/* Things the lguest guest needs to know. Note: like all lguest interfaces,
2 * this is subject to wild and random change between versions. */
3#ifndef _ASM_LGUEST_H
4#define _ASM_LGUEST_H
5
6#ifndef __ASSEMBLY__
7#include <asm/irq.h>
8
9#define LHCALL_FLUSH_ASYNC 0
10#define LHCALL_LGUEST_INIT 1
11#define LHCALL_CRASH 2
12#define LHCALL_LOAD_GDT 3
13#define LHCALL_NEW_PGTABLE 4
14#define LHCALL_FLUSH_TLB 5
15#define LHCALL_LOAD_IDT_ENTRY 6
16#define LHCALL_SET_STACK 7
17#define LHCALL_TS 8
18#define LHCALL_SET_CLOCKEVENT 9
19#define LHCALL_HALT 10
20#define LHCALL_GET_WALLCLOCK 11
21#define LHCALL_BIND_DMA 12
22#define LHCALL_SEND_DMA 13
23#define LHCALL_SET_PTE 14
24#define LHCALL_SET_PMD 15
25#define LHCALL_LOAD_TLS 16
26
27#define LG_CLOCK_MIN_DELTA 100UL
28#define LG_CLOCK_MAX_DELTA ULONG_MAX
29
30#define LGUEST_TRAP_ENTRY 0x1F
31
32static inline unsigned long
33hcall(unsigned long call,
34 unsigned long arg1, unsigned long arg2, unsigned long arg3)
35{
36 asm volatile("int $" __stringify(LGUEST_TRAP_ENTRY)
37 : "=a"(call)
38 : "a"(call), "d"(arg1), "b"(arg2), "c"(arg3)
39 : "memory");
40 return call;
41}
42
43void async_hcall(unsigned long call,
44 unsigned long arg1, unsigned long arg2, unsigned long arg3);
45
46/* Can't use our min() macro here: needs to be a constant */
47#define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32)
48
49#define LHCALL_RING_SIZE 64
50struct hcall_ring
51{
52 u32 eax, edx, ebx, ecx;
53};
54
55/* All the good stuff happens here: guest registers it with LGUEST_INIT */
56struct lguest_data
57{
58/* Fields which change during running: */
59 /* 512 == enabled (same as eflags) */
60 unsigned int irq_enabled;
61 /* Interrupts blocked by guest. */
62 DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS);
63
64 /* Virtual address of page fault. */
65 unsigned long cr2;
66
67 /* Async hypercall ring. 0xFF == done, 0 == pending. */
68 u8 hcall_status[LHCALL_RING_SIZE];
69 struct hcall_ring hcalls[LHCALL_RING_SIZE];
70
71/* Fields initialized by the hypervisor at boot: */
72 /* Memory not to try to access */
73 unsigned long reserve_mem;
74 /* ID of this guest (used by network driver to set ethernet address) */
75 u16 guestid;
76 /* KHz for the TSC clock. */
77 u32 tsc_khz;
78
79/* Fields initialized by the guest at boot: */
80 /* Instruction range to suppress interrupts even if enabled */
81 unsigned long noirq_start, noirq_end;
82};
83extern struct lguest_data lguest_data;
84#endif /* __ASSEMBLY__ */
85#endif /* _ASM_LGUEST_H */
diff --git a/include/linux/lguest_bus.h b/include/linux/lguest_bus.h
new file mode 100644
index 000000000000..c9b4e05fee49
--- /dev/null
+++ b/include/linux/lguest_bus.h
@@ -0,0 +1,48 @@
1#ifndef _ASM_LGUEST_DEVICE_H
2#define _ASM_LGUEST_DEVICE_H
3/* Everything you need to know about lguest devices. */
4#include <linux/device.h>
5#include <linux/lguest.h>
6#include <linux/lguest_launcher.h>
7
8struct lguest_device {
9 /* Unique busid, and index into lguest_page->devices[] */
10 unsigned int index;
11
12 struct device dev;
13
14 /* Driver can hang data off here. */
15 void *private;
16};
17
18/* By convention, each device can use irq index+1 if it wants to. */
19static inline int lgdev_irq(const struct lguest_device *dev)
20{
21 return dev->index + 1;
22}
23
24/* dma args must not be vmalloced! */
25void lguest_send_dma(unsigned long key, struct lguest_dma *dma);
26int lguest_bind_dma(unsigned long key, struct lguest_dma *dmas,
27 unsigned int num, u8 irq);
28void lguest_unbind_dma(unsigned long key, struct lguest_dma *dmas);
29
30/* Map the virtual device space */
31void *lguest_map(unsigned long phys_addr, unsigned long pages);
32void lguest_unmap(void *);
33
34struct lguest_driver {
35 const char *name;
36 struct module *owner;
37 u16 device_type;
38 int (*probe)(struct lguest_device *dev);
39 void (*remove)(struct lguest_device *dev);
40
41 struct device_driver drv;
42};
43
44extern int register_lguest_driver(struct lguest_driver *drv);
45extern void unregister_lguest_driver(struct lguest_driver *drv);
46
47extern struct lguest_device_desc *lguest_devices; /* Just past max_pfn */
48#endif /* _ASM_LGUEST_DEVICE_H */
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h
new file mode 100644
index 000000000000..0ba414a40c80
--- /dev/null
+++ b/include/linux/lguest_launcher.h
@@ -0,0 +1,73 @@
1#ifndef _ASM_LGUEST_USER
2#define _ASM_LGUEST_USER
3/* Everything the "lguest" userspace program needs to know. */
4/* They can register up to 32 arrays of lguest_dma. */
5#define LGUEST_MAX_DMA 32
6/* At most we can dma 16 lguest_dma in one op. */
7#define LGUEST_MAX_DMA_SECTIONS 16
8
9/* How many devices? Assume each one wants up to two dma arrays per device. */
10#define LGUEST_MAX_DEVICES (LGUEST_MAX_DMA/2)
11
12struct lguest_dma
13{
14 /* 0 if free to be used, filled by hypervisor. */
15 u32 used_len;
16 unsigned long addr[LGUEST_MAX_DMA_SECTIONS];
17 u16 len[LGUEST_MAX_DMA_SECTIONS];
18};
19
20struct lguest_block_page
21{
22 /* 0 is a read, 1 is a write. */
23 int type;
24 u32 sector; /* Offset in device = sector * 512. */
25 u32 bytes; /* Length expected to be read/written in bytes */
26 /* 0 = pending, 1 = done, 2 = done, error */
27 int result;
28 u32 num_sectors; /* Disk length = num_sectors * 512 */
29};
30
31/* There is a shared page of these. */
32struct lguest_net
33{
34 /* Simply the mac address (with multicast bit meaning promisc). */
35 unsigned char mac[6];
36};
37
38/* Where the Host expects the Guest to SEND_DMA console output to. */
39#define LGUEST_CONSOLE_DMA_KEY 0
40
41/* We have a page of these descriptors in the lguest_device page. */
42struct lguest_device_desc {
43 u16 type;
44#define LGUEST_DEVICE_T_CONSOLE 1
45#define LGUEST_DEVICE_T_NET 2
46#define LGUEST_DEVICE_T_BLOCK 3
47
48 u16 features;
49#define LGUEST_NET_F_NOCSUM 0x4000 /* Don't bother checksumming */
50#define LGUEST_DEVICE_F_RANDOMNESS 0x8000 /* IRQ is fairly random */
51
52 u16 status;
53/* 256 and above are device specific. */
54#define LGUEST_DEVICE_S_ACKNOWLEDGE 1 /* We have seen device. */
55#define LGUEST_DEVICE_S_DRIVER 2 /* We have found a driver */
56#define LGUEST_DEVICE_S_DRIVER_OK 4 /* Driver says OK! */
57#define LGUEST_DEVICE_S_REMOVED 8 /* Device has gone away. */
58#define LGUEST_DEVICE_S_REMOVED_ACK 16 /* Driver has been told. */
59#define LGUEST_DEVICE_S_FAILED 128 /* Something actually failed */
60
61 u16 num_pages;
62 u32 pfn;
63};
64
65/* Write command first word is a request. */
66enum lguest_req
67{
68 LHREQ_INITIALIZE, /* + pfnlimit, pgdir, start, pageoffset */
69 LHREQ_GETDMA, /* + addr (returns &lguest_dma, irq in ->used_len) */
70 LHREQ_IRQ, /* + irq */
71 LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */
72};
73#endif /* _ASM_LGUEST_USER */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 85f7b1bd1482..be5a43928c84 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -116,6 +116,7 @@ static inline struct device *pci_dev_to_dev(struct pci_dev *pdev)
116enum { 116enum {
117 /* various global constants */ 117 /* various global constants */
118 LIBATA_MAX_PRD = ATA_MAX_PRD / 2, 118 LIBATA_MAX_PRD = ATA_MAX_PRD / 2,
119 LIBATA_DUMB_MAX_PRD = ATA_MAX_PRD / 4, /* Worst case */
119 ATA_MAX_PORTS = 8, 120 ATA_MAX_PORTS = 8,
120 ATA_DEF_QUEUE = 1, 121 ATA_DEF_QUEUE = 1,
121 /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ 122 /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */
@@ -136,6 +137,8 @@ enum {
136 ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */ 137 ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */
137 ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ 138 ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */
138 ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */ 139 ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */
140 ATA_DFLAG_ACPI_PENDING = (1 << 5), /* ACPI resume action pending */
141 ATA_DFLAG_ACPI_FAILED = (1 << 6), /* ACPI on devcfg has failed */
139 ATA_DFLAG_CFG_MASK = (1 << 8) - 1, 142 ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
140 143
141 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ 144 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */
@@ -171,7 +174,6 @@ enum {
171 ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H 174 ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H
172 * Register FIS clearing BSY */ 175 * Register FIS clearing BSY */
173 ATA_FLAG_DEBUGMSG = (1 << 13), 176 ATA_FLAG_DEBUGMSG = (1 << 13),
174 ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */
175 ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ 177 ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */
176 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ 178 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */
177 ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ 179 ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */
@@ -194,9 +196,9 @@ enum {
194 ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */ 196 ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */
195 ATA_PFLAG_INITIALIZING = (1 << 7), /* being initialized, don't touch */ 197 ATA_PFLAG_INITIALIZING = (1 << 7), /* being initialized, don't touch */
196 198
197 ATA_PFLAG_FLUSH_PORT_TASK = (1 << 16), /* flush port task */
198 ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ 199 ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */
199 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ 200 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */
201 ATA_PFLAG_GTM_VALID = (1 << 19), /* acpi_gtm data valid */
200 202
201 /* struct ata_queued_cmd flags */ 203 /* struct ata_queued_cmd flags */
202 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ 204 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */
@@ -299,7 +301,6 @@ enum {
299 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ 301 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */
300 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ 302 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */
301 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ 303 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */
302 ATA_HORKAGE_DMA_RW_ONLY = (1 << 4), /* ATAPI DMA for RW only */
303}; 304};
304 305
305enum hsm_task_states { 306enum hsm_task_states {
@@ -322,6 +323,7 @@ enum ata_completion_errors {
322 AC_ERR_INVALID = (1 << 7), /* invalid argument */ 323 AC_ERR_INVALID = (1 << 7), /* invalid argument */
323 AC_ERR_OTHER = (1 << 8), /* unknown */ 324 AC_ERR_OTHER = (1 << 8), /* unknown */
324 AC_ERR_NODEV_HINT = (1 << 9), /* polling device detection hint */ 325 AC_ERR_NODEV_HINT = (1 << 9), /* polling device detection hint */
326 AC_ERR_NCQ = (1 << 10), /* marker for offending NCQ qc */
325}; 327};
326 328
327/* forward declarations */ 329/* forward declarations */
@@ -365,6 +367,9 @@ struct ata_host {
365 void *private_data; 367 void *private_data;
366 const struct ata_port_operations *ops; 368 const struct ata_port_operations *ops;
367 unsigned long flags; 369 unsigned long flags;
370#ifdef CONFIG_ATA_ACPI
371 acpi_handle acpi_handle;
372#endif
368 struct ata_port *simplex_claimed; /* channel owning the DMA */ 373 struct ata_port *simplex_claimed; /* channel owning the DMA */
369 struct ata_port *ports[0]; 374 struct ata_port *ports[0];
370}; 375};
@@ -430,7 +435,11 @@ struct ata_device {
430 struct ata_port *ap; 435 struct ata_port *ap;
431 unsigned int devno; /* 0 or 1 */ 436 unsigned int devno; /* 0 or 1 */
432 unsigned long flags; /* ATA_DFLAG_xxx */ 437 unsigned long flags; /* ATA_DFLAG_xxx */
438 unsigned int horkage; /* List of broken features */
433 struct scsi_device *sdev; /* attached SCSI device */ 439 struct scsi_device *sdev; /* attached SCSI device */
440#ifdef CONFIG_ATA_ACPI
441 acpi_handle acpi_handle;
442#endif
434 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ 443 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
435 u64 n_sectors; /* size of device, if ATA */ 444 u64 n_sectors; /* size of device, if ATA */
436 unsigned int class; /* ATA_DEV_xxx */ 445 unsigned int class; /* ATA_DEV_xxx */
@@ -458,11 +467,6 @@ struct ata_device {
458 /* error history */ 467 /* error history */
459 struct ata_ering ering; 468 struct ata_ering ering;
460 int spdn_cnt; 469 int spdn_cnt;
461 unsigned int horkage; /* List of broken features */
462#ifdef CONFIG_ATA_ACPI
463 /* ACPI objects info */
464 acpi_handle obj_handle;
465#endif
466}; 470};
467 471
468/* Offset into struct ata_device. Fields above it are maintained 472/* Offset into struct ata_device. Fields above it are maintained
@@ -491,6 +495,17 @@ struct ata_eh_context {
491 unsigned int did_probe_mask; 495 unsigned int did_probe_mask;
492}; 496};
493 497
498struct ata_acpi_drive
499{
500 u32 pio;
501 u32 dma;
502} __packed;
503
504struct ata_acpi_gtm {
505 struct ata_acpi_drive drive[2];
506 u32 flags;
507} __packed;
508
494struct ata_port { 509struct ata_port {
495 struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ 510 struct Scsi_Host *scsi_host; /* our co-allocated scsi host */
496 const struct ata_port_operations *ops; 511 const struct ata_port_operations *ops;
@@ -516,6 +531,7 @@ struct ata_port {
516 unsigned int cbl; /* cable type; ATA_CBL_xxx */ 531 unsigned int cbl; /* cable type; ATA_CBL_xxx */
517 unsigned int hw_sata_spd_limit; 532 unsigned int hw_sata_spd_limit;
518 unsigned int sata_spd_limit; /* SATA PHY speed limit */ 533 unsigned int sata_spd_limit; /* SATA PHY speed limit */
534 unsigned int sata_spd; /* current SATA PHY speed */
519 535
520 /* record runtime error info, protected by host lock */ 536 /* record runtime error info, protected by host lock */
521 struct ata_eh_info eh_info; 537 struct ata_eh_info eh_info;
@@ -549,8 +565,15 @@ struct ata_port {
549 pm_message_t pm_mesg; 565 pm_message_t pm_mesg;
550 int *pm_result; 566 int *pm_result;
551 567
568 struct timer_list fastdrain_timer;
569 unsigned long fastdrain_cnt;
570
552 void *private_data; 571 void *private_data;
553 572
573#ifdef CONFIG_ATA_ACPI
574 acpi_handle acpi_handle;
575 struct ata_acpi_gtm acpi_gtm;
576#endif
554 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ 577 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */
555}; 578};
556 579
@@ -601,9 +624,8 @@ struct ata_port_operations {
601 u8 (*irq_on) (struct ata_port *); 624 u8 (*irq_on) (struct ata_port *);
602 u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq); 625 u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq);
603 626
604 u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); 627 int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, u32 *val);
605 void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 628 int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, u32 val);
606 u32 val);
607 629
608 int (*port_suspend) (struct ata_port *ap, pm_message_t mesg); 630 int (*port_suspend) (struct ata_port *ap, pm_message_t mesg);
609 int (*port_resume) (struct ata_port *ap); 631 int (*port_resume) (struct ata_port *ap);
@@ -746,7 +768,8 @@ extern unsigned int ata_dev_try_classify(struct ata_port *, unsigned int, u8 *);
746 */ 768 */
747extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); 769extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
748extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); 770extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
749extern void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp); 771extern void ata_tf_to_fis(const struct ata_taskfile *tf,
772 u8 pmp, int is_cmd, u8 *fis);
750extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); 773extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf);
751extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); 774extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device);
752extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); 775extern void ata_std_dev_select (struct ata_port *ap, unsigned int device);
@@ -754,11 +777,13 @@ extern u8 ata_check_status(struct ata_port *ap);
754extern u8 ata_altstatus(struct ata_port *ap); 777extern u8 ata_altstatus(struct ata_port *ap);
755extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); 778extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf);
756extern int ata_port_start (struct ata_port *ap); 779extern int ata_port_start (struct ata_port *ap);
780extern int ata_sff_port_start (struct ata_port *ap);
757extern irqreturn_t ata_interrupt (int irq, void *dev_instance); 781extern irqreturn_t ata_interrupt (int irq, void *dev_instance);
758extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf, 782extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf,
759 unsigned int buflen, int write_data); 783 unsigned int buflen, int write_data);
760extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf, 784extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf,
761 unsigned int buflen, int write_data); 785 unsigned int buflen, int write_data);
786extern void ata_dumb_qc_prep(struct ata_queued_cmd *qc);
762extern void ata_qc_prep(struct ata_queued_cmd *qc); 787extern void ata_qc_prep(struct ata_queued_cmd *qc);
763extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); 788extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
764extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); 789extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc);
@@ -773,7 +798,6 @@ extern void ata_id_string(const u16 *id, unsigned char *s,
773extern void ata_id_c_string(const u16 *id, unsigned char *s, 798extern void ata_id_c_string(const u16 *id, unsigned char *s,
774 unsigned int ofs, unsigned int len); 799 unsigned int ofs, unsigned int len);
775extern void ata_id_to_dma_mode(struct ata_device *dev, u8 unknown); 800extern void ata_id_to_dma_mode(struct ata_device *dev, u8 unknown);
776extern unsigned long ata_device_blacklisted(const struct ata_device *dev);
777extern void ata_bmdma_setup (struct ata_queued_cmd *qc); 801extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
778extern void ata_bmdma_start (struct ata_queued_cmd *qc); 802extern void ata_bmdma_start (struct ata_queued_cmd *qc);
779extern void ata_bmdma_stop(struct ata_queued_cmd *qc); 803extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
@@ -850,11 +874,11 @@ struct pci_bits {
850 unsigned long val; 874 unsigned long val;
851}; 875};
852 876
853extern int ata_pci_init_native_host(struct ata_host *host); 877extern int ata_pci_init_sff_host(struct ata_host *host);
854extern int ata_pci_init_bmdma(struct ata_host *host); 878extern int ata_pci_init_bmdma(struct ata_host *host);
855extern int ata_pci_prepare_native_host(struct pci_dev *pdev, 879extern int ata_pci_prepare_sff_host(struct pci_dev *pdev,
856 const struct ata_port_info * const * ppi, 880 const struct ata_port_info * const * ppi,
857 struct ata_host **r_host); 881 struct ata_host **r_host);
858extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); 882extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
859extern unsigned long ata_pci_default_filter(struct ata_device *, unsigned long); 883extern unsigned long ata_pci_default_filter(struct ata_device *, unsigned long);
860#endif /* CONFIG_PCI */ 884#endif /* CONFIG_PCI */
@@ -890,27 +914,21 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
890/* 914/*
891 * ata_eh_info helpers 915 * ata_eh_info helpers
892 */ 916 */
893#define ata_ehi_push_desc(ehi, fmt, args...) do { \ 917extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
894 (ehi)->desc_len += scnprintf((ehi)->desc + (ehi)->desc_len, \ 918extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
895 ATA_EH_DESC_LEN - (ehi)->desc_len, \ 919extern void ata_ehi_clear_desc(struct ata_eh_info *ehi);
896 fmt , ##args); \ 920
897} while (0) 921static inline void ata_ehi_schedule_probe(struct ata_eh_info *ehi)
898
899#define ata_ehi_clear_desc(ehi) do { \
900 (ehi)->desc[0] = '\0'; \
901 (ehi)->desc_len = 0; \
902} while (0)
903
904static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi)
905{ 922{
906 ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK; 923 ehi->flags |= ATA_EHI_RESUME_LINK;
907 ehi->action |= ATA_EH_SOFTRESET; 924 ehi->action |= ATA_EH_SOFTRESET;
908 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; 925 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
909} 926}
910 927
911static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) 928static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
912{ 929{
913 __ata_ehi_hotplugged(ehi); 930 ata_ehi_schedule_probe(ehi);
931 ehi->flags |= ATA_EHI_HOTPLUGGED;
914 ehi->err_mask |= AC_ERR_ATA_BUS; 932 ehi->err_mask |= AC_ERR_ATA_BUS;
915} 933}
916 934
@@ -1088,11 +1106,9 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
1088{ 1106{
1089 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); 1107 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
1090 1108
1091 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) { 1109 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ)))
1092 if (ata_msg_warn(ap)) 1110 DPRINTK("ATA: abnormal status 0x%X on port 0x%p\n",
1093 printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%p\n", 1111 status, ap->ioaddr.status_addr);
1094 status, ap->ioaddr.status_addr);
1095 }
1096 1112
1097 return status; 1113 return status;
1098} 1114}
diff --git a/include/linux/limits.h b/include/linux/limits.h
index eaf2e099f125..2d0f94162fb3 100644
--- a/include/linux/limits.h
+++ b/include/linux/limits.h
@@ -5,8 +5,6 @@
5 5
6#define NGROUPS_MAX 65536 /* supplemental group IDs are available */ 6#define NGROUPS_MAX 65536 /* supplemental group IDs are available */
7#define ARG_MAX 131072 /* # bytes of args + environ for exec() */ 7#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
8#define CHILD_MAX 999 /* no limit :-) */
9#define OPEN_MAX 256 /* # open files a process may have */
10#define LINK_MAX 127 /* # links a file may have */ 8#define LINK_MAX 127 /* # links a file may have */
11#define MAX_CANON 255 /* size of the canonical input queue */ 9#define MAX_CANON 255 /* size of the canonical input queue */
12#define MAX_INPUT 255 /* size of the type-ahead buffer */ 10#define MAX_INPUT 255 /* size of the type-ahead buffer */
diff --git a/include/linux/linux_logo.h b/include/linux/linux_logo.h
index 9c01bde5bf1b..08a92969c76e 100644
--- a/include/linux/linux_logo.h
+++ b/include/linux/linux_logo.h
@@ -33,5 +33,13 @@ struct linux_logo {
33}; 33};
34 34
35extern const struct linux_logo *fb_find_logo(int depth); 35extern const struct linux_logo *fb_find_logo(int depth);
36#ifdef CONFIG_FB_LOGO_EXTRA
37extern void fb_append_extra_logo(const struct linux_logo *logo,
38 unsigned int n);
39#else
40static inline void fb_append_extra_logo(const struct linux_logo *logo,
41 unsigned int n)
42{}
43#endif
36 44
37#endif /* _LINUX_LINUX_LOGO_H */ 45#endif /* _LINUX_LINUX_LOGO_H */
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
index 246de1d84a26..6f1637c61e10 100644
--- a/include/linux/lockd/bind.h
+++ b/include/linux/lockd/bind.h
@@ -27,6 +27,7 @@ struct nlmsvc_binding {
27 struct nfs_fh *, 27 struct nfs_fh *,
28 struct file **); 28 struct file **);
29 void (*fclose)(struct file *); 29 void (*fclose)(struct file *);
30 unsigned long (*get_grace_period)(void);
30}; 31};
31 32
32extern struct nlmsvc_binding * nlmsvc_ops; 33extern struct nlmsvc_binding * nlmsvc_ops;
@@ -38,4 +39,12 @@ extern int nlmclnt_proc(struct inode *, int, struct file_lock *);
38extern int lockd_up(int proto); 39extern int lockd_up(int proto);
39extern void lockd_down(void); 40extern void lockd_down(void);
40 41
42unsigned long get_nfs_grace_period(void);
43
44#ifdef CONFIG_NFSD_V4
45unsigned long get_nfs4_grace_period(void);
46#else
47static inline unsigned long get_nfs4_grace_period(void) {return 0;}
48#endif
49
41#endif /* LINUX_LOCKD_BIND_H */ 50#endif /* LINUX_LOCKD_BIND_H */
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 05707e2fccae..e2d1ce36b367 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -39,6 +39,7 @@
39struct nlm_host { 39struct nlm_host {
40 struct hlist_node h_hash; /* doubly linked list */ 40 struct hlist_node h_hash; /* doubly linked list */
41 struct sockaddr_in h_addr; /* peer address */ 41 struct sockaddr_in h_addr; /* peer address */
42 struct sockaddr_in h_saddr; /* our address (optional) */
42 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ 43 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */
43 char * h_name; /* remote hostname */ 44 char * h_name; /* remote hostname */
44 u32 h_version; /* interface version */ 45 u32 h_version; /* interface version */
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 14c937d345cb..0e843bf65877 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -1,7 +1,8 @@
1/* 1/*
2 * Runtime locking correctness validator 2 * Runtime locking correctness validator
3 * 3 *
4 * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> 4 * Copyright (C) 2006,2007 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
5 * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com>
5 * 6 *
6 * see Documentation/lockdep-design.txt for more details. 7 * see Documentation/lockdep-design.txt for more details.
7 */ 8 */
@@ -9,6 +10,7 @@
9#define __LINUX_LOCKDEP_H 10#define __LINUX_LOCKDEP_H
10 11
11struct task_struct; 12struct task_struct;
13struct lockdep_map;
12 14
13#ifdef CONFIG_LOCKDEP 15#ifdef CONFIG_LOCKDEP
14 16
@@ -114,8 +116,44 @@ struct lock_class {
114 116
115 const char *name; 117 const char *name;
116 int name_version; 118 int name_version;
119
120#ifdef CONFIG_LOCK_STAT
121 unsigned long contention_point[4];
122#endif
123};
124
125#ifdef CONFIG_LOCK_STAT
126struct lock_time {
127 s64 min;
128 s64 max;
129 s64 total;
130 unsigned long nr;
131};
132
133enum bounce_type {
134 bounce_acquired_write,
135 bounce_acquired_read,
136 bounce_contended_write,
137 bounce_contended_read,
138 nr_bounce_types,
139
140 bounce_acquired = bounce_acquired_write,
141 bounce_contended = bounce_contended_write,
117}; 142};
118 143
144struct lock_class_stats {
145 unsigned long contention_point[4];
146 struct lock_time read_waittime;
147 struct lock_time write_waittime;
148 struct lock_time read_holdtime;
149 struct lock_time write_holdtime;
150 unsigned long bounces[nr_bounce_types];
151};
152
153struct lock_class_stats lock_stats(struct lock_class *class);
154void clear_lock_stats(struct lock_class *class);
155#endif
156
119/* 157/*
120 * Map the lock object (the lock instance) to the lock-class object. 158 * Map the lock object (the lock instance) to the lock-class object.
121 * This is embedded into specific lock instances: 159 * This is embedded into specific lock instances:
@@ -124,6 +162,9 @@ struct lockdep_map {
124 struct lock_class_key *key; 162 struct lock_class_key *key;
125 struct lock_class *class_cache; 163 struct lock_class *class_cache;
126 const char *name; 164 const char *name;
165#ifdef CONFIG_LOCK_STAT
166 int cpu;
167#endif
127}; 168};
128 169
129/* 170/*
@@ -165,6 +206,10 @@ struct held_lock {
165 unsigned long acquire_ip; 206 unsigned long acquire_ip;
166 struct lockdep_map *instance; 207 struct lockdep_map *instance;
167 208
209#ifdef CONFIG_LOCK_STAT
210 u64 waittime_stamp;
211 u64 holdtime_stamp;
212#endif
168 /* 213 /*
169 * The lock-stack is unified in that the lock chains of interrupt 214 * The lock-stack is unified in that the lock chains of interrupt
170 * contexts nest ontop of process context chains, but we 'separate' 215 * contexts nest ontop of process context chains, but we 'separate'
@@ -281,6 +326,30 @@ struct lock_class_key { };
281 326
282#endif /* !LOCKDEP */ 327#endif /* !LOCKDEP */
283 328
329#ifdef CONFIG_LOCK_STAT
330
331extern void lock_contended(struct lockdep_map *lock, unsigned long ip);
332extern void lock_acquired(struct lockdep_map *lock);
333
334#define LOCK_CONTENDED(_lock, try, lock) \
335do { \
336 if (!try(_lock)) { \
337 lock_contended(&(_lock)->dep_map, _RET_IP_); \
338 lock(_lock); \
339 } \
340 lock_acquired(&(_lock)->dep_map); \
341} while (0)
342
343#else /* CONFIG_LOCK_STAT */
344
345#define lock_contended(lockdep_map, ip) do {} while (0)
346#define lock_acquired(lockdep_map) do {} while (0)
347
348#define LOCK_CONTENDED(_lock, try, lock) \
349 lock(_lock)
350
351#endif /* CONFIG_LOCK_STAT */
352
284#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS) 353#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS)
285extern void early_init_irq_lock_class(void); 354extern void early_init_irq_lock_class(void);
286#else 355#else
diff --git a/include/linux/lzo.h b/include/linux/lzo.h
new file mode 100644
index 000000000000..d793497ec1ca
--- /dev/null
+++ b/include/linux/lzo.h
@@ -0,0 +1,44 @@
1#ifndef __LZO_H__
2#define __LZO_H__
3/*
4 * LZO Public Kernel Interface
5 * A mini subset of the LZO real-time data compression library
6 *
7 * Copyright (C) 1996-2005 Markus F.X.J. Oberhumer <markus@oberhumer.com>
8 *
9 * The full LZO package can be found at:
10 * http://www.oberhumer.com/opensource/lzo/
11 *
12 * Changed for kernel use by:
13 * Nitin Gupta <nitingupta910@gmail.com>
14 * Richard Purdie <rpurdie@openedhand.com>
15 */
16
17#define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *))
18#define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS
19
20#define lzo1x_worst_compress(x) ((x) + ((x) / 16) + 64 + 3)
21
22/* This requires 'workmem' of size LZO1X_1_MEM_COMPRESS */
23int lzo1x_1_compress(const unsigned char *src, size_t src_len,
24 unsigned char *dst, size_t *dst_len, void *wrkmem);
25
26/* safe decompression with overrun testing */
27int lzo1x_decompress_safe(const unsigned char *src, size_t src_len,
28 unsigned char *dst, size_t *dst_len);
29
30/*
31 * Return values (< 0 = Error)
32 */
33#define LZO_E_OK 0
34#define LZO_E_ERROR (-1)
35#define LZO_E_OUT_OF_MEMORY (-2)
36#define LZO_E_NOT_COMPRESSIBLE (-3)
37#define LZO_E_INPUT_OVERRUN (-4)
38#define LZO_E_OUTPUT_OVERRUN (-5)
39#define LZO_E_LOOKBEHIND_OVERRUN (-6)
40#define LZO_E_EOF_NOT_FOUND (-7)
41#define LZO_E_INPUT_NOT_CONSUMED (-8)
42#define LZO_E_NOT_YET_IMPLEMENTED (-9)
43
44#endif
diff --git a/include/linux/magic.h b/include/linux/magic.h
index 9d713c03e3da..36cc20dfd142 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -13,7 +13,6 @@
13#define HPFS_SUPER_MAGIC 0xf995e849 13#define HPFS_SUPER_MAGIC 0xf995e849
14#define ISOFS_SUPER_MAGIC 0x9660 14#define ISOFS_SUPER_MAGIC 0x9660
15#define JFFS2_SUPER_MAGIC 0x72b6 15#define JFFS2_SUPER_MAGIC 0x72b6
16#define KVMFS_SUPER_MAGIC 0x19700426
17#define ANON_INODE_FS_MAGIC 0x09041934 16#define ANON_INODE_FS_MAGIC 0x09041934
18 17
19#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ 18#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
diff --git a/include/linux/major.h b/include/linux/major.h
index 7e7c9093919a..0cb98053537a 100644
--- a/include/linux/major.h
+++ b/include/linux/major.h
@@ -158,6 +158,8 @@
158#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */ 158#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */
159#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */ 159#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */
160 160
161#define XENVBD_MAJOR 202 /* Xen virtual block device */
162
161#define MSR_MAJOR 202 163#define MSR_MAJOR 202
162#define CPUID_MAJOR 203 164#define CPUID_MAJOR 203
163 165
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index daabb3aa1ec6..e147cf50529f 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -159,7 +159,7 @@ extern void mpol_fix_fork_child_flag(struct task_struct *p);
159 159
160extern struct mempolicy default_policy; 160extern struct mempolicy default_policy;
161extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, 161extern struct zonelist *huge_zonelist(struct vm_area_struct *vma,
162 unsigned long addr); 162 unsigned long addr, gfp_t gfp_flags);
163extern unsigned slab_node(struct mempolicy *policy); 163extern unsigned slab_node(struct mempolicy *policy);
164 164
165extern enum zone_type policy_zone; 165extern enum zone_type policy_zone;
@@ -256,9 +256,9 @@ static inline void mpol_fix_fork_child_flag(struct task_struct *p)
256#define set_cpuset_being_rebound(x) do {} while (0) 256#define set_cpuset_being_rebound(x) do {} while (0)
257 257
258static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, 258static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma,
259 unsigned long addr) 259 unsigned long addr, gfp_t gfp_flags)
260{ 260{
261 return NODE_DATA(0)->node_zonelists + gfp_zone(GFP_HIGHUSER); 261 return NODE_DATA(0)->node_zonelists + gfp_zone(gfp_flags);
262} 262}
263 263
264static inline int do_migrate_pages(struct mm_struct *mm, 264static inline int do_migrate_pages(struct mm_struct *mm,
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 4fb552d12f7a..7d1eaa97de13 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -54,6 +54,7 @@ enum {
54 MLX4_CMD_INIT_PORT = 0x9, 54 MLX4_CMD_INIT_PORT = 0x9,
55 MLX4_CMD_CLOSE_PORT = 0xa, 55 MLX4_CMD_CLOSE_PORT = 0xa,
56 MLX4_CMD_QUERY_HCA = 0xb, 56 MLX4_CMD_QUERY_HCA = 0xb,
57 MLX4_CMD_QUERY_PORT = 0x43,
57 MLX4_CMD_SET_PORT = 0xc, 58 MLX4_CMD_SET_PORT = 0xc,
58 MLX4_CMD_ACCESS_DDR = 0x2e, 59 MLX4_CMD_ACCESS_DDR = 0x2e,
59 MLX4_CMD_MAP_ICM = 0xffa, 60 MLX4_CMD_MAP_ICM = 0xffa,
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 8c5f8fd86841..cfb78fb2c046 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -41,6 +41,7 @@
41 41
42enum { 42enum {
43 MLX4_FLAG_MSI_X = 1 << 0, 43 MLX4_FLAG_MSI_X = 1 << 0,
44 MLX4_FLAG_OLD_PORT_CMDS = 1 << 1,
44}; 45};
45 46
46enum { 47enum {
@@ -131,10 +132,10 @@ enum {
131struct mlx4_caps { 132struct mlx4_caps {
132 u64 fw_ver; 133 u64 fw_ver;
133 int num_ports; 134 int num_ports;
134 int vl_cap; 135 int vl_cap[MLX4_MAX_PORTS + 1];
135 int mtu_cap; 136 int mtu_cap[MLX4_MAX_PORTS + 1];
136 int gid_table_len; 137 int gid_table_len[MLX4_MAX_PORTS + 1];
137 int pkey_table_len; 138 int pkey_table_len[MLX4_MAX_PORTS + 1];
138 int local_ca_ack_delay; 139 int local_ca_ack_delay;
139 int num_uars; 140 int num_uars;
140 int bf_reg_size; 141 int bf_reg_size;
@@ -171,10 +172,11 @@ struct mlx4_caps {
171 int num_pds; 172 int num_pds;
172 int reserved_pds; 173 int reserved_pds;
173 int mtt_entry_sz; 174 int mtt_entry_sz;
175 u32 max_msg_sz;
174 u32 page_size_cap; 176 u32 page_size_cap;
175 u32 flags; 177 u32 flags;
176 u16 stat_rate_support; 178 u16 stat_rate_support;
177 u8 port_width_cap; 179 u8 port_width_cap[MLX4_MAX_PORTS + 1];
178}; 180};
179 181
180struct mlx4_buf_list { 182struct mlx4_buf_list {
@@ -321,8 +323,9 @@ int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt,
321 u64 db_rec, struct mlx4_srq *srq); 323 u64 db_rec, struct mlx4_srq *srq);
322void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq); 324void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq);
323int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark); 325int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark);
326int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark);
324 327
325int mlx4_INIT_PORT(struct mlx4_dev *dev, struct mlx4_init_port_param *param, int port); 328int mlx4_INIT_PORT(struct mlx4_dev *dev, int port);
326int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port); 329int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port);
327 330
328int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]); 331int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]);
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 9eeb61adf6a3..3968b943259a 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -269,6 +269,10 @@ struct mlx4_wqe_data_seg {
269 __be64 addr; 269 __be64 addr;
270}; 270};
271 271
272enum {
273 MLX4_INLINE_ALIGN = 64,
274};
275
272struct mlx4_wqe_inline_seg { 276struct mlx4_wqe_inline_seg {
273 __be32 byte_count; 277 __be32 byte_count;
274}; 278};
@@ -278,6 +282,9 @@ int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
278 struct mlx4_qp_context *context, enum mlx4_qp_optpar optpar, 282 struct mlx4_qp_context *context, enum mlx4_qp_optpar optpar,
279 int sqd_event, struct mlx4_qp *qp); 283 int sqd_event, struct mlx4_qp *qp);
280 284
285int mlx4_qp_query(struct mlx4_dev *dev, struct mlx4_qp *qp,
286 struct mlx4_qp_context *context);
287
281static inline struct mlx4_qp *__mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn) 288static inline struct mlx4_qp *__mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn)
282{ 289{
283 return radix_tree_lookup(&dev->qp_table_tree, qpn & (dev->caps.num_qps - 1)); 290 return radix_tree_lookup(&dev->qp_table_tree, qpn & (dev->caps.num_qps - 1));
diff --git a/include/linux/mm.h b/include/linux/mm.h
index e4183c6c7de3..c456c3a1c28e 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2,7 +2,6 @@
2#define _LINUX_MM_H 2#define _LINUX_MM_H
3 3
4#include <linux/errno.h> 4#include <linux/errno.h>
5#include <linux/capability.h>
6 5
7#ifdef __KERNEL__ 6#ifdef __KERNEL__
8 7
@@ -27,7 +26,6 @@ extern unsigned long max_mapnr;
27 26
28extern unsigned long num_physpages; 27extern unsigned long num_physpages;
29extern void * high_memory; 28extern void * high_memory;
30extern unsigned long vmalloc_earlyreserve;
31extern int page_cluster; 29extern int page_cluster;
32 30
33#ifdef CONFIG_SYSCTL 31#ifdef CONFIG_SYSCTL
@@ -170,6 +168,8 @@ extern unsigned int kobjsize(const void *objp);
170#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */ 168#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
171#define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */ 169#define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */
172 170
171#define VM_CAN_NONLINEAR 0x08000000 /* Has ->fault & does nonlinear pages */
172
173#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ 173#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
174#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS 174#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
175#endif 175#endif
@@ -192,6 +192,30 @@ extern unsigned int kobjsize(const void *objp);
192 */ 192 */
193extern pgprot_t protection_map[16]; 193extern pgprot_t protection_map[16];
194 194
195#define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */
196#define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */
197
198
199/*
200 * vm_fault is filled by the the pagefault handler and passed to the vma's
201 * ->fault function. The vma's ->fault is responsible for returning a bitmask
202 * of VM_FAULT_xxx flags that give details about how the fault was handled.
203 *
204 * pgoff should be used in favour of virtual_address, if possible. If pgoff
205 * is used, one may set VM_CAN_NONLINEAR in the vma->vm_flags to get nonlinear
206 * mapping support.
207 */
208struct vm_fault {
209 unsigned int flags; /* FAULT_FLAG_xxx flags */
210 pgoff_t pgoff; /* Logical page offset based on vma */
211 void __user *virtual_address; /* Faulting virtual address */
212
213 struct page *page; /* ->fault handlers should return a
214 * page here, unless VM_FAULT_NOPAGE
215 * is set (which is also implied by
216 * VM_FAULT_ERROR).
217 */
218};
195 219
196/* 220/*
197 * These are the virtual MM functions - opening of an area, closing and 221 * These are the virtual MM functions - opening of an area, closing and
@@ -201,9 +225,11 @@ extern pgprot_t protection_map[16];
201struct vm_operations_struct { 225struct vm_operations_struct {
202 void (*open)(struct vm_area_struct * area); 226 void (*open)(struct vm_area_struct * area);
203 void (*close)(struct vm_area_struct * area); 227 void (*close)(struct vm_area_struct * area);
204 struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); 228 int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);
205 unsigned long (*nopfn)(struct vm_area_struct * area, unsigned long address); 229 struct page *(*nopage)(struct vm_area_struct *area,
206 int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); 230 unsigned long address, int *type);
231 unsigned long (*nopfn)(struct vm_area_struct *area,
232 unsigned long address);
207 233
208 /* notification that a previously read-only page is about to become 234 /* notification that a previously read-only page is about to become
209 * writable, if an error is returned it will cause a SIGBUS */ 235 * writable, if an error is returned it will cause a SIGBUS */
@@ -601,8 +627,13 @@ static inline struct address_space *page_mapping(struct page *page)
601{ 627{
602 struct address_space *mapping = page->mapping; 628 struct address_space *mapping = page->mapping;
603 629
630 VM_BUG_ON(PageSlab(page));
604 if (unlikely(PageSwapCache(page))) 631 if (unlikely(PageSwapCache(page)))
605 mapping = &swapper_space; 632 mapping = &swapper_space;
633#ifdef CONFIG_SLUB
634 else if (unlikely(PageSlab(page)))
635 mapping = NULL;
636#endif
606 else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) 637 else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON))
607 mapping = NULL; 638 mapping = NULL;
608 return mapping; 639 return mapping;
@@ -652,7 +683,6 @@ static inline int page_mapped(struct page *page)
652 */ 683 */
653#define NOPAGE_SIGBUS (NULL) 684#define NOPAGE_SIGBUS (NULL)
654#define NOPAGE_OOM ((struct page *) (-1)) 685#define NOPAGE_OOM ((struct page *) (-1))
655#define NOPAGE_REFAULT ((struct page *) (-2)) /* Return to userspace, rerun */
656 686
657/* 687/*
658 * Error return values for the *_nopfn functions 688 * Error return values for the *_nopfn functions
@@ -666,16 +696,18 @@ static inline int page_mapped(struct page *page)
666 * Used to decide whether a process gets delivered SIGBUS or 696 * Used to decide whether a process gets delivered SIGBUS or
667 * just gets major/minor fault counters bumped up. 697 * just gets major/minor fault counters bumped up.
668 */ 698 */
669#define VM_FAULT_OOM 0x00 699
670#define VM_FAULT_SIGBUS 0x01 700#define VM_FAULT_MINOR 0 /* For backwards compat. Remove me quickly. */
671#define VM_FAULT_MINOR 0x02 701
672#define VM_FAULT_MAJOR 0x03 702#define VM_FAULT_OOM 0x0001
673 703#define VM_FAULT_SIGBUS 0x0002
674/* 704#define VM_FAULT_MAJOR 0x0004
675 * Special case for get_user_pages. 705#define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */
676 * Must be in a distinct bit from the above VM_FAULT_ flags. 706
677 */ 707#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */
678#define VM_FAULT_WRITE 0x10 708#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */
709
710#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS)
679 711
680#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) 712#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
681 713
@@ -759,20 +791,10 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
759 791
760extern int vmtruncate(struct inode * inode, loff_t offset); 792extern int vmtruncate(struct inode * inode, loff_t offset);
761extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); 793extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end);
762extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot);
763extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot);
764 794
765#ifdef CONFIG_MMU 795#ifdef CONFIG_MMU
766extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, 796extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
767 unsigned long address, int write_access); 797 unsigned long address, int write_access);
768
769static inline int handle_mm_fault(struct mm_struct *mm,
770 struct vm_area_struct *vma, unsigned long address,
771 int write_access)
772{
773 return __handle_mm_fault(mm, vma, address, write_access) &
774 (~VM_FAULT_WRITE);
775}
776#else 798#else
777static inline int handle_mm_fault(struct mm_struct *mm, 799static inline int handle_mm_fault(struct mm_struct *mm,
778 struct vm_area_struct *vma, unsigned long address, 800 struct vm_area_struct *vma, unsigned long address,
@@ -786,7 +808,6 @@ static inline int handle_mm_fault(struct mm_struct *mm,
786 808
787extern int make_pages_present(unsigned long addr, unsigned long end); 809extern int make_pages_present(unsigned long addr, unsigned long end);
788extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); 810extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
789void install_arg_page(struct vm_area_struct *, struct page *, unsigned long);
790 811
791int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, 812int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start,
792 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); 813 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas);
@@ -803,32 +824,42 @@ int FASTCALL(set_page_dirty(struct page *page));
803int set_page_dirty_lock(struct page *page); 824int set_page_dirty_lock(struct page *page);
804int clear_page_dirty_for_io(struct page *page); 825int clear_page_dirty_for_io(struct page *page);
805 826
827extern unsigned long move_page_tables(struct vm_area_struct *vma,
828 unsigned long old_addr, struct vm_area_struct *new_vma,
829 unsigned long new_addr, unsigned long len);
806extern unsigned long do_mremap(unsigned long addr, 830extern unsigned long do_mremap(unsigned long addr,
807 unsigned long old_len, unsigned long new_len, 831 unsigned long old_len, unsigned long new_len,
808 unsigned long flags, unsigned long new_addr); 832 unsigned long flags, unsigned long new_addr);
833extern int mprotect_fixup(struct vm_area_struct *vma,
834 struct vm_area_struct **pprev, unsigned long start,
835 unsigned long end, unsigned long newflags);
809 836
810/* 837/*
811 * Prototype to add a shrinker callback for ageable caches. 838 * A callback you can register to apply pressure to ageable caches.
812 *
813 * These functions are passed a count `nr_to_scan' and a gfpmask. They should
814 * scan `nr_to_scan' objects, attempting to free them.
815 * 839 *
816 * The callback must return the number of objects which remain in the cache. 840 * 'shrink' is passed a count 'nr_to_scan' and a 'gfpmask'. It should
841 * look through the least-recently-used 'nr_to_scan' entries and
842 * attempt to free them up. It should return the number of objects
843 * which remain in the cache. If it returns -1, it means it cannot do
844 * any scanning at this time (eg. there is a risk of deadlock).
817 * 845 *
818 * The callback will be passed nr_to_scan == 0 when the VM is querying the 846 * The 'gfpmask' refers to the allocation we are currently trying to
819 * cache size, so a fastpath for that case is appropriate. 847 * fulfil.
820 */ 848 *
821typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask); 849 * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is
822 850 * querying the cache size, so a fastpath for that case is appropriate.
823/*
824 * Add an aging callback. The int is the number of 'seeks' it takes
825 * to recreate one of the objects that these functions age.
826 */ 851 */
852struct shrinker {
853 int (*shrink)(int nr_to_scan, gfp_t gfp_mask);
854 int seeks; /* seeks to recreate an obj */
827 855
828#define DEFAULT_SEEKS 2 856 /* These are for internal use */
829struct shrinker; 857 struct list_head list;
830extern struct shrinker *set_shrinker(int, shrinker_t); 858 long nr; /* objs pending delete */
831extern void remove_shrinker(struct shrinker *shrinker); 859};
860#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
861extern void register_shrinker(struct shrinker *);
862extern void unregister_shrinker(struct shrinker *);
832 863
833/* 864/*
834 * Some shared mappigns will want the pages marked read-only 865 * Some shared mappigns will want the pages marked read-only
@@ -1068,6 +1099,10 @@ extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned lo
1068extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, 1099extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
1069 unsigned long len, unsigned long prot, 1100 unsigned long len, unsigned long prot,
1070 unsigned long flag, unsigned long pgoff); 1101 unsigned long flag, unsigned long pgoff);
1102extern unsigned long mmap_region(struct file *file, unsigned long addr,
1103 unsigned long len, unsigned long flags,
1104 unsigned int vm_flags, unsigned long pgoff,
1105 int accountable);
1071 1106
1072static inline unsigned long do_mmap(struct file *file, unsigned long addr, 1107static inline unsigned long do_mmap(struct file *file, unsigned long addr,
1073 unsigned long len, unsigned long prot, 1108 unsigned long len, unsigned long prot,
@@ -1093,9 +1128,7 @@ extern void truncate_inode_pages_range(struct address_space *,
1093 loff_t lstart, loff_t lend); 1128 loff_t lstart, loff_t lend);
1094 1129
1095/* generic vm_area_ops exported for stackable file systems */ 1130/* generic vm_area_ops exported for stackable file systems */
1096extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *); 1131extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
1097extern int filemap_populate(struct vm_area_struct *, unsigned long,
1098 unsigned long, pgprot_t, unsigned long, int);
1099 1132
1100/* mm/page-writeback.c */ 1133/* mm/page-writeback.c */
1101int write_one_page(struct page *page, int wait); 1134int write_one_page(struct page *page, int wait);
@@ -1110,13 +1143,20 @@ int do_page_cache_readahead(struct address_space *mapping, struct file *filp,
1110 pgoff_t offset, unsigned long nr_to_read); 1143 pgoff_t offset, unsigned long nr_to_read);
1111int force_page_cache_readahead(struct address_space *mapping, struct file *filp, 1144int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
1112 pgoff_t offset, unsigned long nr_to_read); 1145 pgoff_t offset, unsigned long nr_to_read);
1113unsigned long page_cache_readahead(struct address_space *mapping, 1146
1114 struct file_ra_state *ra, 1147void page_cache_sync_readahead(struct address_space *mapping,
1115 struct file *filp, 1148 struct file_ra_state *ra,
1116 pgoff_t offset, 1149 struct file *filp,
1117 unsigned long size); 1150 pgoff_t offset,
1118void handle_ra_miss(struct address_space *mapping, 1151 unsigned long size);
1119 struct file_ra_state *ra, pgoff_t offset); 1152
1153void page_cache_async_readahead(struct address_space *mapping,
1154 struct file_ra_state *ra,
1155 struct file *filp,
1156 struct page *pg,
1157 pgoff_t offset,
1158 unsigned long size);
1159
1120unsigned long max_sane_readahead(unsigned long nr); 1160unsigned long max_sane_readahead(unsigned long nr);
1121 1161
1122/* Do stack extension */ 1162/* Do stack extension */
@@ -1124,6 +1164,8 @@ extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
1124#ifdef CONFIG_IA64 1164#ifdef CONFIG_IA64
1125extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); 1165extern int expand_upwards(struct vm_area_struct *vma, unsigned long address);
1126#endif 1166#endif
1167extern int expand_stack_downwards(struct vm_area_struct *vma,
1168 unsigned long address);
1127 1169
1128/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ 1170/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */
1129extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); 1171extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr);
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index d09b1345a3a1..da8eb8ad9e9b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -24,6 +24,14 @@
24#endif 24#endif
25#define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1)) 25#define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1))
26 26
27/*
28 * PAGE_ALLOC_COSTLY_ORDER is the order at which allocations are deemed
29 * costly to service. That is between allocation orders which should
30 * coelesce naturally under reasonable reclaim pressure and those which
31 * will not.
32 */
33#define PAGE_ALLOC_COSTLY_ORDER 3
34
27struct free_area { 35struct free_area {
28 struct list_head free_list; 36 struct list_head free_list;
29 unsigned long nr_free; 37 unsigned long nr_free;
@@ -146,6 +154,7 @@ enum zone_type {
146 */ 154 */
147 ZONE_HIGHMEM, 155 ZONE_HIGHMEM,
148#endif 156#endif
157 ZONE_MOVABLE,
149 MAX_NR_ZONES 158 MAX_NR_ZONES
150}; 159};
151 160
@@ -167,6 +176,7 @@ enum zone_type {
167 + defined(CONFIG_ZONE_DMA32) \ 176 + defined(CONFIG_ZONE_DMA32) \
168 + 1 \ 177 + 1 \
169 + defined(CONFIG_HIGHMEM) \ 178 + defined(CONFIG_HIGHMEM) \
179 + 1 \
170) 180)
171#if __ZONE_COUNT < 2 181#if __ZONE_COUNT < 2
172#define ZONES_SHIFT 0 182#define ZONES_SHIFT 0
@@ -499,10 +509,22 @@ static inline int populated_zone(struct zone *zone)
499 return (!!zone->present_pages); 509 return (!!zone->present_pages);
500} 510}
501 511
512extern int movable_zone;
513
514static inline int zone_movable_is_highmem(void)
515{
516#if defined(CONFIG_HIGHMEM) && defined(CONFIG_ARCH_POPULATES_NODE_MAP)
517 return movable_zone == ZONE_HIGHMEM;
518#else
519 return 0;
520#endif
521}
522
502static inline int is_highmem_idx(enum zone_type idx) 523static inline int is_highmem_idx(enum zone_type idx)
503{ 524{
504#ifdef CONFIG_HIGHMEM 525#ifdef CONFIG_HIGHMEM
505 return (idx == ZONE_HIGHMEM); 526 return (idx == ZONE_HIGHMEM ||
527 (idx == ZONE_MOVABLE && zone_movable_is_highmem()));
506#else 528#else
507 return 0; 529 return 0;
508#endif 530#endif
@@ -522,7 +544,9 @@ static inline int is_normal_idx(enum zone_type idx)
522static inline int is_highmem(struct zone *zone) 544static inline int is_highmem(struct zone *zone)
523{ 545{
524#ifdef CONFIG_HIGHMEM 546#ifdef CONFIG_HIGHMEM
525 return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM; 547 int zone_idx = zone - zone->zone_pgdat->node_zones;
548 return zone_idx == ZONE_HIGHMEM ||
549 (zone_idx == ZONE_MOVABLE && zone_movable_is_highmem());
526#else 550#else
527 return 0; 551 return 0;
528#endif 552#endif
@@ -566,6 +590,11 @@ int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int,
566int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, 590int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int,
567 struct file *, void __user *, size_t *, loff_t *); 591 struct file *, void __user *, size_t *, loff_t *);
568 592
593extern int numa_zonelist_order_handler(struct ctl_table *, int,
594 struct file *, void __user *, size_t *, loff_t *);
595extern char numa_zonelist_order[];
596#define NUMA_ZONELIST_ORDER_LEN 16 /* string buffer size */
597
569#include <linux/topology.h> 598#include <linux/topology.h>
570/* Returns the number of the current Node. */ 599/* Returns the number of the current Node. */
571#ifndef numa_node_id 600#ifndef numa_node_id
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index 1fa4d9813b31..8eed44f8ca73 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -14,7 +14,7 @@ struct mnt_namespace {
14 int event; 14 int event;
15}; 15};
16 16
17extern struct mnt_namespace *copy_mnt_ns(int, struct mnt_namespace *, 17extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
18 struct fs_struct *); 18 struct fs_struct *);
19extern void __put_mnt_ns(struct mnt_namespace *ns); 19extern void __put_mnt_ns(struct mnt_namespace *ns);
20 20
diff --git a/include/linux/module.h b/include/linux/module.h
index e6e0f86ef5fc..b6a646cea1cb 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -6,7 +6,6 @@
6 * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996 6 * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
7 * Rewritten again by Rusty Russell, 2002 7 * Rewritten again by Rusty Russell, 2002
8 */ 8 */
9#include <linux/spinlock.h>
10#include <linux/list.h> 9#include <linux/list.h>
11#include <linux/stat.h> 10#include <linux/stat.h>
12#include <linux/compiler.h> 11#include <linux/compiler.h>
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index 0e09c005dda8..f950921523f5 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -146,7 +146,7 @@ struct fat_boot_fsinfo {
146}; 146};
147 147
148struct msdos_dir_entry { 148struct msdos_dir_entry {
149 __u8 name[8],ext[3]; /* name and extension */ 149 __u8 name[MSDOS_NAME];/* name and extension */
150 __u8 attr; /* attribute bits */ 150 __u8 attr; /* attribute bits */
151 __u8 lcase; /* Case for base and extension */ 151 __u8 lcase; /* Case for base and extension */
152 __u8 ctime_cs; /* Creation time, centiseconds (0-199) */ 152 __u8 ctime_cs; /* Creation time, centiseconds (0-199) */
diff --git a/include/linux/mtd/super.h b/include/linux/mtd/super.h
new file mode 100644
index 000000000000..4016dd6fe336
--- /dev/null
+++ b/include/linux/mtd/super.h
@@ -0,0 +1,30 @@
1/* MTD-based superblock handling
2 *
3 * Copyright © 2006 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef __MTD_SUPER_H__
13#define __MTD_SUPER_H__
14
15#ifdef __KERNEL__
16
17#include <linux/mtd/mtd.h>
18#include <linux/fs.h>
19#include <linux/mount.h>
20
21extern int get_sb_mtd(struct file_system_type *fs_type, int flags,
22 const char *dev_name, void *data,
23 int (*fill_super)(struct super_block *, void *, int),
24 struct vfsmount *mnt);
25extern void kill_mtd_super(struct super_block *sb);
26
27
28#endif /* __KERNEL__ */
29
30#endif /* __MTD_SUPER_H__ */
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h
index c6d4ab86b83c..b021b3a2b65a 100644
--- a/include/linux/mv643xx.h
+++ b/include/linux/mv643xx.h
@@ -13,10 +13,6 @@
13#ifndef __ASM_MV643XX_H 13#ifndef __ASM_MV643XX_H
14#define __ASM_MV643XX_H 14#define __ASM_MV643XX_H
15 15
16#ifdef __mips__
17#include <asm/addrspace.h>
18#include <asm/marvell.h>
19#endif
20#include <asm/types.h> 16#include <asm/types.h>
21 17
22/****************************************/ 18/****************************************/
diff --git a/include/linux/namei.h b/include/linux/namei.h
index b7dd24917f0d..6c38efbd810f 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -69,8 +69,8 @@ extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struc
69#define user_path_walk_link(name,nd) \ 69#define user_path_walk_link(name,nd) \
70 __user_walk_fd(AT_FDCWD, name, 0, nd) 70 __user_walk_fd(AT_FDCWD, name, 0, nd)
71extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *)); 71extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
72extern int FASTCALL(path_walk(const char *, struct nameidata *)); 72extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
73extern int FASTCALL(link_path_walk(const char *, struct nameidata *)); 73 const char *, unsigned int, struct nameidata *);
74extern void path_release(struct nameidata *); 74extern void path_release(struct nameidata *);
75extern void path_release_on_umount(struct nameidata *); 75extern void path_release_on_umount(struct nameidata *);
76 76
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 83e39eb054d3..88766e43e121 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -148,8 +148,6 @@ struct ncp_nls_ioctl
148#include <linux/ncp_fs_i.h> 148#include <linux/ncp_fs_i.h>
149#include <linux/ncp_fs_sb.h> 149#include <linux/ncp_fs_sb.h>
150 150
151/* undef because public define in umsdos_fs.h (ncp_fs.h isn't public) */
152#undef PRINTK
153/* define because it is easy to change PRINTK to {*}PRINTK */ 151/* define because it is easy to change PRINTK to {*}PRINTK */
154#define PRINTK(format, args...) printk(KERN_DEBUG format , ## args) 152#define PRINTK(format, args...) printk(KERN_DEBUG format , ## args)
155 153
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3a70f553b28f..4a616d73cc25 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -108,6 +108,14 @@ struct wireless_dev;
108#define MAX_HEADER (LL_MAX_HEADER + 48) 108#define MAX_HEADER (LL_MAX_HEADER + 48)
109#endif 109#endif
110 110
111struct net_device_subqueue
112{
113 /* Give a control state for each queue. This struct may contain
114 * per-queue locks in the future.
115 */
116 unsigned long state;
117};
118
111/* 119/*
112 * Network device statistics. Akin to the 2.0 ether stats but 120 * Network device statistics. Akin to the 2.0 ether stats but
113 * with byte counters. 121 * with byte counters.
@@ -177,19 +185,25 @@ struct netif_rx_stats
177 185
178DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); 186DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat);
179 187
188struct dev_addr_list
189{
190 struct dev_addr_list *next;
191 u8 da_addr[MAX_ADDR_LEN];
192 u8 da_addrlen;
193 u8 da_synced;
194 int da_users;
195 int da_gusers;
196};
180 197
181/* 198/*
182 * We tag multicasts with these structures. 199 * We tag multicasts with these structures.
183 */ 200 */
184 201
185struct dev_mc_list 202#define dev_mc_list dev_addr_list
186{ 203#define dmi_addr da_addr
187 struct dev_mc_list *next; 204#define dmi_addrlen da_addrlen
188 __u8 dmi_addr[MAX_ADDR_LEN]; 205#define dmi_users da_users
189 unsigned char dmi_addrlen; 206#define dmi_gusers da_gusers
190 int dmi_users;
191 int dmi_gusers;
192};
193 207
194struct hh_cache 208struct hh_cache
195{ 209{
@@ -314,9 +328,10 @@ struct net_device
314 /* Net device features */ 328 /* Net device features */
315 unsigned long features; 329 unsigned long features;
316#define NETIF_F_SG 1 /* Scatter/gather IO. */ 330#define NETIF_F_SG 1 /* Scatter/gather IO. */
317#define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */ 331#define NETIF_F_IP_CSUM 2 /* Can checksum TCP/UDP over IPv4. */
318#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ 332#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */
319#define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */ 333#define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */
334#define NETIF_F_IPV6_CSUM 16 /* Can checksum TCP/UDP over IPV6 */
320#define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */ 335#define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */
321#define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */ 336#define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */
322#define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */ 337#define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */
@@ -325,6 +340,7 @@ struct net_device
325#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ 340#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
326#define NETIF_F_GSO 2048 /* Enable software GSO. */ 341#define NETIF_F_GSO 2048 /* Enable software GSO. */
327#define NETIF_F_LLTX 4096 /* LockLess TX */ 342#define NETIF_F_LLTX 4096 /* LockLess TX */
343#define NETIF_F_MULTI_QUEUE 16384 /* Has multiple TX/RX queues */
328 344
329 /* Segmentation offload features */ 345 /* Segmentation offload features */
330#define NETIF_F_GSO_SHIFT 16 346#define NETIF_F_GSO_SHIFT 16
@@ -338,8 +354,11 @@ struct net_device
338 /* List of features with software fallbacks. */ 354 /* List of features with software fallbacks. */
339#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6) 355#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
340 356
357
341#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) 358#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
342#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) 359#define NETIF_F_V4_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM)
360#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
361#define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
343 362
344 struct net_device *next_sched; 363 struct net_device *next_sched;
345 364
@@ -388,7 +407,10 @@ struct net_device
388 unsigned char addr_len; /* hardware address length */ 407 unsigned char addr_len; /* hardware address length */
389 unsigned short dev_id; /* for shared network cards */ 408 unsigned short dev_id; /* for shared network cards */
390 409
391 struct dev_mc_list *mc_list; /* Multicast mac addresses */ 410 struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */
411 int uc_count; /* Number of installed ucasts */
412 int uc_promisc;
413 struct dev_addr_list *mc_list; /* Multicast mac addresses */
392 int mc_count; /* Number of installed mcasts */ 414 int mc_count; /* Number of installed mcasts */
393 int promiscuity; 415 int promiscuity;
394 int allmulti; 416 int allmulti;
@@ -493,6 +515,11 @@ struct net_device
493 void *saddr, 515 void *saddr,
494 unsigned len); 516 unsigned len);
495 int (*rebuild_header)(struct sk_buff *skb); 517 int (*rebuild_header)(struct sk_buff *skb);
518#define HAVE_CHANGE_RX_FLAGS
519 void (*change_rx_flags)(struct net_device *dev,
520 int flags);
521#define HAVE_SET_RX_MODE
522 void (*set_rx_mode)(struct net_device *dev);
496#define HAVE_MULTICAST 523#define HAVE_MULTICAST
497 void (*set_multicast_list)(struct net_device *dev); 524 void (*set_multicast_list)(struct net_device *dev);
498#define HAVE_SET_MAC_ADDR 525#define HAVE_SET_MAC_ADDR
@@ -535,22 +562,29 @@ struct net_device
535 562
536 /* bridge stuff */ 563 /* bridge stuff */
537 struct net_bridge_port *br_port; 564 struct net_bridge_port *br_port;
565 /* macvlan */
566 struct macvlan_port *macvlan_port;
538 567
539 /* class/net/name entry */ 568 /* class/net/name entry */
540 struct device dev; 569 struct device dev;
541 /* space for optional statistics and wireless sysfs groups */ 570 /* space for optional statistics and wireless sysfs groups */
542 struct attribute_group *sysfs_groups[3]; 571 struct attribute_group *sysfs_groups[3];
572
573 /* rtnetlink link ops */
574 const struct rtnl_link_ops *rtnl_link_ops;
575
576 /* The TX queue control structures */
577 unsigned int egress_subqueue_count;
578 struct net_device_subqueue egress_subqueue[1];
543}; 579};
544#define to_net_dev(d) container_of(d, struct net_device, dev) 580#define to_net_dev(d) container_of(d, struct net_device, dev)
545 581
546#define NETDEV_ALIGN 32 582#define NETDEV_ALIGN 32
547#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) 583#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1)
548 584
549static inline void *netdev_priv(struct net_device *dev) 585static inline void *netdev_priv(const struct net_device *dev)
550{ 586{
551 return (char *)dev + ((sizeof(struct net_device) 587 return dev->priv;
552 + NETDEV_ALIGN_CONST)
553 & ~NETDEV_ALIGN_CONST);
554} 588}
555 589
556#define SET_MODULE_OWNER(dev) do { } while (0) 590#define SET_MODULE_OWNER(dev) do { } while (0)
@@ -702,6 +736,62 @@ static inline int netif_running(const struct net_device *dev)
702 return test_bit(__LINK_STATE_START, &dev->state); 736 return test_bit(__LINK_STATE_START, &dev->state);
703} 737}
704 738
739/*
740 * Routines to manage the subqueues on a device. We only need start
741 * stop, and a check if it's stopped. All other device management is
742 * done at the overall netdevice level.
743 * Also test the device if we're multiqueue.
744 */
745static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
746{
747#ifdef CONFIG_NETDEVICES_MULTIQUEUE
748 clear_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state);
749#endif
750}
751
752static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
753{
754#ifdef CONFIG_NETDEVICES_MULTIQUEUE
755#ifdef CONFIG_NETPOLL_TRAP
756 if (netpoll_trap())
757 return;
758#endif
759 set_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state);
760#endif
761}
762
763static inline int netif_subqueue_stopped(const struct net_device *dev,
764 u16 queue_index)
765{
766#ifdef CONFIG_NETDEVICES_MULTIQUEUE
767 return test_bit(__LINK_STATE_XOFF,
768 &dev->egress_subqueue[queue_index].state);
769#else
770 return 0;
771#endif
772}
773
774static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
775{
776#ifdef CONFIG_NETDEVICES_MULTIQUEUE
777#ifdef CONFIG_NETPOLL_TRAP
778 if (netpoll_trap())
779 return;
780#endif
781 if (test_and_clear_bit(__LINK_STATE_XOFF,
782 &dev->egress_subqueue[queue_index].state))
783 __netif_schedule(dev);
784#endif
785}
786
787static inline int netif_is_multiqueue(const struct net_device *dev)
788{
789#ifdef CONFIG_NETDEVICES_MULTIQUEUE
790 return (!!(NETIF_F_MULTI_QUEUE & dev->features));
791#else
792 return 0;
793#endif
794}
705 795
706/* Use this variant when it is known for sure that it 796/* Use this variant when it is known for sure that it
707 * is executing from interrupt context. 797 * is executing from interrupt context.
@@ -992,15 +1082,24 @@ static inline void netif_tx_disable(struct net_device *dev)
992extern void ether_setup(struct net_device *dev); 1082extern void ether_setup(struct net_device *dev);
993 1083
994/* Support for loadable net-drivers */ 1084/* Support for loadable net-drivers */
995extern struct net_device *alloc_netdev(int sizeof_priv, const char *name, 1085extern struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
996 void (*setup)(struct net_device *)); 1086 void (*setup)(struct net_device *),
1087 unsigned int queue_count);
1088#define alloc_netdev(sizeof_priv, name, setup) \
1089 alloc_netdev_mq(sizeof_priv, name, setup, 1)
997extern int register_netdev(struct net_device *dev); 1090extern int register_netdev(struct net_device *dev);
998extern void unregister_netdev(struct net_device *dev); 1091extern void unregister_netdev(struct net_device *dev);
999/* Functions used for multicast support */ 1092/* Functions used for secondary unicast and multicast support */
1000extern void dev_mc_upload(struct net_device *dev); 1093extern void dev_set_rx_mode(struct net_device *dev);
1094extern void __dev_set_rx_mode(struct net_device *dev);
1095extern int dev_unicast_delete(struct net_device *dev, void *addr, int alen);
1096extern int dev_unicast_add(struct net_device *dev, void *addr, int alen);
1001extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); 1097extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all);
1002extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); 1098extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly);
1003extern void dev_mc_discard(struct net_device *dev); 1099extern int dev_mc_sync(struct net_device *to, struct net_device *from);
1100extern void dev_mc_unsync(struct net_device *to, struct net_device *from);
1101extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all);
1102extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly);
1004extern void dev_set_promiscuity(struct net_device *dev, int inc); 1103extern void dev_set_promiscuity(struct net_device *dev, int inc);
1005extern void dev_set_allmulti(struct net_device *dev, int inc); 1104extern void dev_set_allmulti(struct net_device *dev, int inc);
1006extern void netdev_state_change(struct net_device *dev); 1105extern void netdev_state_change(struct net_device *dev);
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 10b5c6275706..0eed0b7ab2df 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -275,7 +275,8 @@ struct nf_queue_handler {
275}; 275};
276extern int nf_register_queue_handler(int pf, 276extern int nf_register_queue_handler(int pf,
277 struct nf_queue_handler *qh); 277 struct nf_queue_handler *qh);
278extern int nf_unregister_queue_handler(int pf); 278extern int nf_unregister_queue_handler(int pf,
279 struct nf_queue_handler *qh);
279extern void nf_unregister_queue_handlers(struct nf_queue_handler *qh); 280extern void nf_unregister_queue_handlers(struct nf_queue_handler *qh);
280extern void nf_reinject(struct sk_buff *skb, 281extern void nf_reinject(struct sk_buff *skb,
281 struct nf_info *info, 282 struct nf_info *info,
diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h
index 9d8144a488cd..c93061f33144 100644
--- a/include/linux/netfilter/nf_conntrack_pptp.h
+++ b/include/linux/netfilter/nf_conntrack_pptp.h
@@ -4,6 +4,8 @@
4 4
5#include <linux/netfilter/nf_conntrack_common.h> 5#include <linux/netfilter/nf_conntrack_common.h>
6 6
7extern const char *pptp_msg_name[];
8
7/* state of the control session */ 9/* state of the control session */
8enum pptp_ctrlsess_state { 10enum pptp_ctrlsess_state {
9 PPTP_SESSION_NONE, /* no session present */ 11 PPTP_SESSION_NONE, /* no session present */
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 7e733a6ba4f6..64f425a855bb 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -141,22 +141,22 @@ struct xt_match
141 /* Arguments changed since 2.6.9, as this must now handle 141 /* Arguments changed since 2.6.9, as this must now handle
142 non-linear skb, using skb_header_pointer and 142 non-linear skb, using skb_header_pointer and
143 skb_ip_make_writable. */ 143 skb_ip_make_writable. */
144 int (*match)(const struct sk_buff *skb, 144 bool (*match)(const struct sk_buff *skb,
145 const struct net_device *in, 145 const struct net_device *in,
146 const struct net_device *out, 146 const struct net_device *out,
147 const struct xt_match *match, 147 const struct xt_match *match,
148 const void *matchinfo, 148 const void *matchinfo,
149 int offset, 149 int offset,
150 unsigned int protoff, 150 unsigned int protoff,
151 int *hotdrop); 151 bool *hotdrop);
152 152
153 /* Called when user tries to insert an entry of this type. */ 153 /* Called when user tries to insert an entry of this type. */
154 /* Should return true or false. */ 154 /* Should return true or false. */
155 int (*checkentry)(const char *tablename, 155 bool (*checkentry)(const char *tablename,
156 const void *ip, 156 const void *ip,
157 const struct xt_match *match, 157 const struct xt_match *match,
158 void *matchinfo, 158 void *matchinfo,
159 unsigned int hook_mask); 159 unsigned int hook_mask);
160 160
161 /* Called when entry of this type deleted. */ 161 /* Called when entry of this type deleted. */
162 void (*destroy)(const struct xt_match *match, void *matchinfo); 162 void (*destroy)(const struct xt_match *match, void *matchinfo);
@@ -202,11 +202,11 @@ struct xt_target
202 hook_mask is a bitmask of hooks from which it can be 202 hook_mask is a bitmask of hooks from which it can be
203 called. */ 203 called. */
204 /* Should return true or false. */ 204 /* Should return true or false. */
205 int (*checkentry)(const char *tablename, 205 bool (*checkentry)(const char *tablename,
206 const void *entry, 206 const void *entry,
207 const struct xt_target *target, 207 const struct xt_target *target,
208 void *targinfo, 208 void *targinfo,
209 unsigned int hook_mask); 209 unsigned int hook_mask);
210 210
211 /* Called when entry of this type deleted. */ 211 /* Called when entry of this type deleted. */
212 void (*destroy)(const struct xt_target *target, void *targinfo); 212 void (*destroy)(const struct xt_target *target, void *targinfo);
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h
new file mode 100644
index 000000000000..90ae8b474cb8
--- /dev/null
+++ b/include/linux/netfilter/xt_connlimit.h
@@ -0,0 +1,17 @@
1#ifndef _XT_CONNLIMIT_H
2#define _XT_CONNLIMIT_H
3
4struct xt_connlimit_data;
5
6struct xt_connlimit_info {
7 union {
8 u_int32_t v4_mask;
9 u_int32_t v6_mask[4];
10 };
11 unsigned int limit, inverse;
12
13 /* this needs to be at the end */
14 struct xt_connlimit_data *data __attribute__((aligned(8)));
15};
16
17#endif /* _XT_CONNLIMIT_H */
diff --git a/include/linux/netfilter/xt_u32.h b/include/linux/netfilter/xt_u32.h
new file mode 100644
index 000000000000..9947f56cdbdd
--- /dev/null
+++ b/include/linux/netfilter/xt_u32.h
@@ -0,0 +1,40 @@
1#ifndef _XT_U32_H
2#define _XT_U32_H 1
3
4enum xt_u32_ops {
5 XT_U32_AND,
6 XT_U32_LEFTSH,
7 XT_U32_RIGHTSH,
8 XT_U32_AT,
9};
10
11struct xt_u32_location_element {
12 u_int32_t number;
13 u_int8_t nextop;
14};
15
16struct xt_u32_value_element {
17 u_int32_t min;
18 u_int32_t max;
19};
20
21/*
22 * Any way to allow for an arbitrary number of elements?
23 * For now, I settle with a limit of 10 each.
24 */
25#define XT_U32_MAXSIZE 10
26
27struct xt_u32_test {
28 struct xt_u32_location_element location[XT_U32_MAXSIZE+1];
29 struct xt_u32_value_element value[XT_U32_MAXSIZE+1];
30 u_int8_t nnums;
31 u_int8_t nvalues;
32};
33
34struct xt_u32 {
35 struct xt_u32_test tests[XT_U32_MAXSIZE+1];
36 u_int8_t ntests;
37 u_int8_t invert;
38};
39
40#endif /* _XT_U32_H */
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 2f46dd728ee1..e992cd6b28f5 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -264,6 +264,26 @@ ipt_get_target(struct ipt_entry *e)
264 __ret; \ 264 __ret; \
265}) 265})
266 266
267/* fn returns 0 to continue iteration */
268#define IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \
269({ \
270 unsigned int __i, __n; \
271 int __ret = 0; \
272 struct ipt_entry *__entry; \
273 \
274 for (__i = 0, __n = 0; __i < (size); \
275 __i += __entry->next_offset, __n++) { \
276 __entry = (void *)(entries) + __i; \
277 if (__n < n) \
278 continue; \
279 \
280 __ret = fn(__entry , ## args); \
281 if (__ret != 0) \
282 break; \
283 } \
284 __ret; \
285})
286
267/* 287/*
268 * Main firewall chains definitions and global var's definitions. 288 * Main firewall chains definitions and global var's definitions.
269 */ 289 */
diff --git a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h b/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
index d9bceedfb3dc..daf50be22c9d 100644
--- a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
+++ b/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
@@ -18,13 +18,13 @@ struct clusterip_config;
18struct ipt_clusterip_tgt_info { 18struct ipt_clusterip_tgt_info {
19 19
20 u_int32_t flags; 20 u_int32_t flags;
21 21
22 /* only relevant for new ones */ 22 /* only relevant for new ones */
23 u_int8_t clustermac[6]; 23 u_int8_t clustermac[6];
24 u_int16_t num_total_nodes; 24 u_int16_t num_total_nodes;
25 u_int16_t num_local_nodes; 25 u_int16_t num_local_nodes;
26 u_int16_t local_nodes[CLUSTERIP_MAX_NODES]; 26 u_int16_t local_nodes[CLUSTERIP_MAX_NODES];
27 enum clusterip_hashmode hash_mode; 27 u_int32_t hash_mode;
28 u_int32_t hash_initval; 28 u_int32_t hash_initval;
29 29
30 struct clusterip_config *config; 30 struct clusterip_config *config;
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h
index 34ab0fb736e2..a92fefc3c7ec 100644
--- a/include/linux/netfilter_ipv4/ipt_iprange.h
+++ b/include/linux/netfilter_ipv4/ipt_iprange.h
@@ -1,6 +1,8 @@
1#ifndef _IPT_IPRANGE_H 1#ifndef _IPT_IPRANGE_H
2#define _IPT_IPRANGE_H 2#define _IPT_IPRANGE_H
3 3
4#include <linux/types.h>
5
4#define IPRANGE_SRC 0x01 /* Match source IP address */ 6#define IPRANGE_SRC 0x01 /* Match source IP address */
5#define IPRANGE_DST 0x02 /* Match destination IP address */ 7#define IPRANGE_DST 0x02 /* Match destination IP address */
6#define IPRANGE_SRC_INV 0x10 /* Negate the condition */ 8#define IPRANGE_SRC_INV 0x10 /* Negate the condition */
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 4686f8342cbd..9a720f05888f 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -44,8 +44,14 @@ struct ip6t_ip6 {
44 char iniface[IFNAMSIZ], outiface[IFNAMSIZ]; 44 char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
45 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; 45 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
46 46
47 /* ARGH, HopByHop uses 0, so can't do 0 = ANY, 47 /* Upper protocol number
48 instead IP6T_F_NOPROTO must be set */ 48 * - The allowed value is 0 (any) or protocol number of last parsable
49 * header, which is 50 (ESP), 59 (No Next Header), 135 (MH), or
50 * the non IPv6 extension headers.
51 * - The protocol numbers of IPv6 extension headers except of ESP and
52 * MH do not match any packets.
53 * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol.
54 */
49 u_int16_t proto; 55 u_int16_t proto;
50 /* TOS to match iff flags & IP6T_F_TOS */ 56 /* TOS to match iff flags & IP6T_F_TOS */
51 u_int8_t tos; 57 u_int8_t tos;
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 2e23353c28a5..83d8239f0cce 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -161,6 +161,8 @@ extern struct sock *netlink_kernel_create(int unit, unsigned int groups,
161 void (*input)(struct sock *sk, int len), 161 void (*input)(struct sock *sk, int len),
162 struct mutex *cb_mutex, 162 struct mutex *cb_mutex,
163 struct module *module); 163 struct module *module);
164extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
165extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group);
164extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 166extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
165extern int netlink_has_listeners(struct sock *sk, unsigned int group); 167extern int netlink_has_listeners(struct sock *sk, unsigned int group);
166extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); 168extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock);
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 7e7f33a38fc0..8726491de154 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -15,6 +15,7 @@
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17 17
18#define NFS4_BITMAP_SIZE 2
18#define NFS4_VERIFIER_SIZE 8 19#define NFS4_VERIFIER_SIZE 8
19#define NFS4_STATEID_SIZE 16 20#define NFS4_STATEID_SIZE 16
20#define NFS4_FHSIZE 128 21#define NFS4_FHSIZE 128
diff --git a/include/linux/nfs4_mount.h b/include/linux/nfs4_mount.h
index 26b4c83f831d..a0dcf6655657 100644
--- a/include/linux/nfs4_mount.h
+++ b/include/linux/nfs4_mount.h
@@ -65,6 +65,7 @@ struct nfs4_mount_data {
65#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */ 65#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
66#define NFS4_MOUNT_NOAC 0x0020 /* 1 */ 66#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
67#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */ 67#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
68#define NFS4_MOUNT_FLAGMASK 0xFFFF 68#define NFS4_MOUNT_UNSHARED 0x8000 /* 1 */
69#define NFS4_MOUNT_FLAGMASK 0x9033
69 70
70#endif 71#endif
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 0543439a97af..9ba4aec37c50 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -30,7 +30,9 @@
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31 31
32#include <linux/in.h> 32#include <linux/in.h>
33#include <linux/kref.h>
33#include <linux/mm.h> 34#include <linux/mm.h>
35#include <linux/namei.h>
34#include <linux/pagemap.h> 36#include <linux/pagemap.h>
35#include <linux/rbtree.h> 37#include <linux/rbtree.h>
36#include <linux/rwsem.h> 38#include <linux/rwsem.h>
@@ -69,9 +71,8 @@ struct nfs_access_entry {
69 71
70struct nfs4_state; 72struct nfs4_state;
71struct nfs_open_context { 73struct nfs_open_context {
72 atomic_t count; 74 struct kref kref;
73 struct vfsmount *vfsmnt; 75 struct path path;
74 struct dentry *dentry;
75 struct rpc_cred *cred; 76 struct rpc_cred *cred;
76 struct nfs4_state *state; 77 struct nfs4_state *state;
77 fl_owner_t lockowner; 78 fl_owner_t lockowner;
@@ -155,13 +156,9 @@ struct nfs_inode {
155 /* 156 /*
156 * This is the list of dirty unwritten pages. 157 * This is the list of dirty unwritten pages.
157 */ 158 */
158 spinlock_t req_lock;
159 struct list_head dirty;
160 struct list_head commit;
161 struct radix_tree_root nfs_page_tree; 159 struct radix_tree_root nfs_page_tree;
162 160
163 unsigned int ndirty, 161 unsigned long ncommit,
164 ncommit,
165 npages; 162 npages;
166 163
167 /* Open contexts for shared mmap writes */ 164 /* Open contexts for shared mmap writes */
@@ -187,6 +184,7 @@ struct nfs_inode {
187#define NFS_INO_INVALID_ACCESS 0x0008 /* cached access cred invalid */ 184#define NFS_INO_INVALID_ACCESS 0x0008 /* cached access cred invalid */
188#define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */ 185#define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */
189#define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */ 186#define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */
187#define NFS_INO_REVAL_FORCED 0x0040 /* force revalidation ignoring a delegation */
190 188
191/* 189/*
192 * Bit offsets in flags field 190 * Bit offsets in flags field
@@ -409,8 +407,8 @@ extern void nfs_release_automount_timer(void);
409/* 407/*
410 * linux/fs/nfs/unlink.c 408 * linux/fs/nfs/unlink.c
411 */ 409 */
412extern int nfs_async_unlink(struct dentry *); 410extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry);
413extern void nfs_complete_unlink(struct dentry *); 411extern void nfs_complete_unlink(struct dentry *dentry, struct inode *);
414 412
415/* 413/*
416 * linux/fs/nfs/write.c 414 * linux/fs/nfs/write.c
@@ -496,21 +494,18 @@ static inline void nfs3_forget_cached_acls(struct inode *inode)
496 494
497/* 495/*
498 * linux/fs/mount_clnt.c 496 * linux/fs/mount_clnt.c
499 * (Used only by nfsroot module)
500 */ 497 */
501extern int nfsroot_mount(struct sockaddr_in *, char *, struct nfs_fh *, 498extern int nfs_mount(struct sockaddr *, size_t, char *, char *,
502 int, int); 499 int, int, struct nfs_fh *);
503 500
504/* 501/*
505 * inline functions 502 * inline functions
506 */ 503 */
507 504
508static inline loff_t 505static inline loff_t nfs_size_to_loff_t(__u64 size)
509nfs_size_to_loff_t(__u64 size)
510{ 506{
511 loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1; 507 if (size > (__u64) OFFSET_MAX - 1)
512 if (size > maxsz) 508 return OFFSET_MAX - 1;
513 return maxsz;
514 return (loff_t) size; 509 return (loff_t) size;
515} 510}
516 511
@@ -557,6 +552,7 @@ extern void * nfs_root_data(void);
557#define NFSDBG_ROOT 0x0080 552#define NFSDBG_ROOT 0x0080
558#define NFSDBG_CALLBACK 0x0100 553#define NFSDBG_CALLBACK 0x0100
559#define NFSDBG_CLIENT 0x0200 554#define NFSDBG_CLIENT 0x0200
555#define NFSDBG_MOUNT 0x0400
560#define NFSDBG_ALL 0xFFFF 556#define NFSDBG_ALL 0xFFFF
561 557
562#ifdef __KERNEL__ 558#ifdef __KERNEL__
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 52b4378311c8..0cac49bc0955 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -16,7 +16,6 @@ struct nfs_client {
16#define NFS_CS_INITING 1 /* busy initialising */ 16#define NFS_CS_INITING 1 /* busy initialising */
17 int cl_nfsversion; /* NFS protocol version */ 17 int cl_nfsversion; /* NFS protocol version */
18 unsigned long cl_res_state; /* NFS resources state */ 18 unsigned long cl_res_state; /* NFS resources state */
19#define NFS_CS_RPCIOD 0 /* - rpciod started */
20#define NFS_CS_CALLBACK 1 /* - callback started */ 19#define NFS_CS_CALLBACK 1 /* - callback started */
21#define NFS_CS_IDMAP 2 /* - idmap started */ 20#define NFS_CS_IDMAP 2 /* - idmap started */
22#define NFS_CS_RENEWD 3 /* - renewd started */ 21#define NFS_CS_RENEWD 3 /* - renewd started */
@@ -35,7 +34,8 @@ struct nfs_client {
35 nfs4_verifier cl_confirm; 34 nfs4_verifier cl_confirm;
36 unsigned long cl_state; 35 unsigned long cl_state;
37 36
38 u32 cl_lockowner_id; 37 struct rb_root cl_openowner_id;
38 struct rb_root cl_lockowner_id;
39 39
40 /* 40 /*
41 * The following rwsem ensures exclusive access to the server 41 * The following rwsem ensures exclusive access to the server
@@ -44,9 +44,7 @@ struct nfs_client {
44 struct rw_semaphore cl_sem; 44 struct rw_semaphore cl_sem;
45 45
46 struct list_head cl_delegations; 46 struct list_head cl_delegations;
47 struct list_head cl_state_owners; 47 struct rb_root cl_state_owners;
48 struct list_head cl_unused;
49 int cl_nunused;
50 spinlock_t cl_lock; 48 spinlock_t cl_lock;
51 49
52 unsigned long cl_lease_time; 50 unsigned long cl_lease_time;
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h
index cc8b9c59acb8..a3ade89a64d2 100644
--- a/include/linux/nfs_mount.h
+++ b/include/linux/nfs_mount.h
@@ -37,7 +37,7 @@ struct nfs_mount_data {
37 int acdirmin; /* 1 */ 37 int acdirmin; /* 1 */
38 int acdirmax; /* 1 */ 38 int acdirmax; /* 1 */
39 struct sockaddr_in addr; /* 1 */ 39 struct sockaddr_in addr; /* 1 */
40 char hostname[256]; /* 1 */ 40 char hostname[NFS_MAXNAMLEN + 1]; /* 1 */
41 int namlen; /* 2 */ 41 int namlen; /* 2 */
42 unsigned int bsize; /* 3 */ 42 unsigned int bsize; /* 3 */
43 struct nfs3_fh root; /* 4 */ 43 struct nfs3_fh root; /* 4 */
@@ -62,6 +62,7 @@ struct nfs_mount_data {
62#define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ 62#define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */
63#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ 63#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
64#define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */ 64#define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */
65#define NFS_MOUNT_UNSHARED 0x8000 /* 5 */
65#define NFS_MOUNT_FLAGMASK 0xFFFF 66#define NFS_MOUNT_FLAGMASK 0xFFFF
66 67
67#endif 68#endif
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index bd193af80162..78e60798d10e 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -16,12 +16,13 @@
16#include <linux/sunrpc/auth.h> 16#include <linux/sunrpc/auth.h>
17#include <linux/nfs_xdr.h> 17#include <linux/nfs_xdr.h>
18 18
19#include <asm/atomic.h> 19#include <linux/kref.h>
20 20
21/* 21/*
22 * Valid flags for the radix tree 22 * Valid flags for the radix tree
23 */ 23 */
24#define NFS_PAGE_TAG_WRITEBACK 0 24#define NFS_PAGE_TAG_LOCKED 0
25#define NFS_PAGE_TAG_COMMIT 1
25 26
26/* 27/*
27 * Valid flags for a dirty buffer 28 * Valid flags for a dirty buffer
@@ -33,8 +34,7 @@
33 34
34struct nfs_inode; 35struct nfs_inode;
35struct nfs_page { 36struct nfs_page {
36 struct list_head wb_list, /* Defines state of page: */ 37 struct list_head wb_list; /* Defines state of page: */
37 *wb_list_head; /* read/write/commit */
38 struct page *wb_page; /* page to read in/write out */ 38 struct page *wb_page; /* page to read in/write out */
39 struct nfs_open_context *wb_context; /* File state context info */ 39 struct nfs_open_context *wb_context; /* File state context info */
40 atomic_t wb_complete; /* i/os we're waiting for */ 40 atomic_t wb_complete; /* i/os we're waiting for */
@@ -42,7 +42,7 @@ struct nfs_page {
42 unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ 42 unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */
43 wb_pgbase, /* Start of page data */ 43 wb_pgbase, /* Start of page data */
44 wb_bytes; /* Length of request */ 44 wb_bytes; /* Length of request */
45 atomic_t wb_count; /* reference count */ 45 struct kref wb_kref; /* reference count */
46 unsigned long wb_flags; 46 unsigned long wb_flags;
47 struct nfs_writeverf wb_verf; /* Commit cookie */ 47 struct nfs_writeverf wb_verf; /* Commit cookie */
48}; 48};
@@ -71,8 +71,8 @@ extern void nfs_clear_request(struct nfs_page *req);
71extern void nfs_release_request(struct nfs_page *req); 71extern void nfs_release_request(struct nfs_page *req);
72 72
73 73
74extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst, 74extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *dst,
75 pgoff_t idx_start, unsigned int npages); 75 pgoff_t idx_start, unsigned int npages, int tag);
76extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, 76extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
77 struct inode *inode, 77 struct inode *inode,
78 int (*doio)(struct inode *, struct list_head *, unsigned int, size_t, int), 78 int (*doio)(struct inode *, struct list_head *, unsigned int, size_t, int),
@@ -84,12 +84,11 @@ extern void nfs_pageio_complete(struct nfs_pageio_descriptor *desc);
84extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t); 84extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t);
85extern int nfs_wait_on_request(struct nfs_page *); 85extern int nfs_wait_on_request(struct nfs_page *);
86extern void nfs_unlock_request(struct nfs_page *req); 86extern void nfs_unlock_request(struct nfs_page *req);
87extern int nfs_set_page_writeback_locked(struct nfs_page *req); 87extern void nfs_clear_page_tag_locked(struct nfs_page *req);
88extern void nfs_clear_page_writeback(struct nfs_page *req);
89 88
90 89
91/* 90/*
92 * Lock the page of an asynchronous request without incrementing the wb_count 91 * Lock the page of an asynchronous request without getting a new reference
93 */ 92 */
94static inline int 93static inline int
95nfs_lock_request_dontget(struct nfs_page *req) 94nfs_lock_request_dontget(struct nfs_page *req)
@@ -98,14 +97,14 @@ nfs_lock_request_dontget(struct nfs_page *req)
98} 97}
99 98
100/* 99/*
101 * Lock the page of an asynchronous request 100 * Lock the page of an asynchronous request and take a reference
102 */ 101 */
103static inline int 102static inline int
104nfs_lock_request(struct nfs_page *req) 103nfs_lock_request(struct nfs_page *req)
105{ 104{
106 if (test_and_set_bit(PG_BUSY, &req->wb_flags)) 105 if (test_and_set_bit(PG_BUSY, &req->wb_flags))
107 return 0; 106 return 0;
108 atomic_inc(&req->wb_count); 107 kref_get(&req->wb_kref);
109 return 1; 108 return 1;
110} 109}
111 110
@@ -118,7 +117,6 @@ static inline void
118nfs_list_add_request(struct nfs_page *req, struct list_head *head) 117nfs_list_add_request(struct nfs_page *req, struct list_head *head)
119{ 118{
120 list_add_tail(&req->wb_list, head); 119 list_add_tail(&req->wb_list, head);
121 req->wb_list_head = head;
122} 120}
123 121
124 122
@@ -132,7 +130,6 @@ nfs_list_remove_request(struct nfs_page *req)
132 if (list_empty(&req->wb_list)) 130 if (list_empty(&req->wb_list))
133 return; 131 return;
134 list_del_init(&req->wb_list); 132 list_del_init(&req->wb_list);
135 req->wb_list_head = NULL;
136} 133}
137 134
138static inline struct nfs_page * 135static inline struct nfs_page *
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 10c26ed0db71..cf74a4db84a5 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -119,7 +119,7 @@ struct nfs_openargs {
119 struct nfs_seqid * seqid; 119 struct nfs_seqid * seqid;
120 int open_flags; 120 int open_flags;
121 __u64 clientid; 121 __u64 clientid;
122 __u32 id; 122 __u64 id;
123 union { 123 union {
124 struct iattr * attrs; /* UNCHECKED, GUARDED */ 124 struct iattr * attrs; /* UNCHECKED, GUARDED */
125 nfs4_verifier verifier; /* EXCLUSIVE */ 125 nfs4_verifier verifier; /* EXCLUSIVE */
@@ -144,6 +144,7 @@ struct nfs_openres {
144 nfs4_stateid delegation; 144 nfs4_stateid delegation;
145 __u32 do_recall; 145 __u32 do_recall;
146 __u64 maxsize; 146 __u64 maxsize;
147 __u32 attrset[NFS4_BITMAP_SIZE];
147}; 148};
148 149
149/* 150/*
@@ -180,7 +181,7 @@ struct nfs_closeres {
180 * */ 181 * */
181struct nfs_lowner { 182struct nfs_lowner {
182 __u64 clientid; 183 __u64 clientid;
183 u32 id; 184 __u64 id;
184}; 185};
185 186
186struct nfs_lock_args { 187struct nfs_lock_args {
@@ -277,6 +278,21 @@ struct nfs_writeres {
277}; 278};
278 279
279/* 280/*
281 * Common arguments to the unlink call
282 */
283struct nfs_removeargs {
284 const struct nfs_fh *fh;
285 struct qstr name;
286 const u32 * bitmask;
287};
288
289struct nfs_removeres {
290 const struct nfs_server *server;
291 struct nfs4_change_info cinfo;
292 struct nfs_fattr dir_attr;
293};
294
295/*
280 * Argument struct for decode_entry function 296 * Argument struct for decode_entry function
281 */ 297 */
282struct nfs_entry { 298struct nfs_entry {
@@ -630,18 +646,6 @@ struct nfs4_readlink {
630 struct page ** pages; /* zero-copy data */ 646 struct page ** pages; /* zero-copy data */
631}; 647};
632 648
633struct nfs4_remove_arg {
634 const struct nfs_fh * fh;
635 const struct qstr * name;
636 const u32 * bitmask;
637};
638
639struct nfs4_remove_res {
640 const struct nfs_server * server;
641 struct nfs4_change_info cinfo;
642 struct nfs_fattr * dir_attr;
643};
644
645struct nfs4_rename_arg { 649struct nfs4_rename_arg {
646 const struct nfs_fh * old_dir; 650 const struct nfs_fh * old_dir;
647 const struct nfs_fh * new_dir; 651 const struct nfs_fh * new_dir;
@@ -787,9 +791,8 @@ struct nfs_rpc_ops {
787 int (*create) (struct inode *, struct dentry *, 791 int (*create) (struct inode *, struct dentry *,
788 struct iattr *, int, struct nameidata *); 792 struct iattr *, int, struct nameidata *);
789 int (*remove) (struct inode *, struct qstr *); 793 int (*remove) (struct inode *, struct qstr *);
790 int (*unlink_setup) (struct rpc_message *, 794 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
791 struct dentry *, struct qstr *); 795 int (*unlink_done) (struct rpc_task *, struct inode *);
792 int (*unlink_done) (struct dentry *, struct rpc_task *);
793 int (*rename) (struct inode *, struct qstr *, 796 int (*rename) (struct inode *, struct qstr *,
794 struct inode *, struct qstr *); 797 struct inode *, struct qstr *);
795 int (*link) (struct inode *, struct inode *, struct qstr *); 798 int (*link) (struct inode *, struct inode *, struct qstr *);
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 9f62d6182d32..5cd192469096 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -42,6 +42,9 @@
42#define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ 42#define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */
43#define NFSEXP_ALLFLAGS 0xFE3F 43#define NFSEXP_ALLFLAGS 0xFE3F
44 44
45/* The flags that may vary depending on security flavor: */
46#define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \
47 | NFSEXP_ALLSQUASH)
45 48
46#ifdef __KERNEL__ 49#ifdef __KERNEL__
47 50
@@ -64,6 +67,19 @@ struct nfsd4_fs_locations {
64 int migrated; 67 int migrated;
65}; 68};
66 69
70/*
71 * We keep an array of pseudoflavors with the export, in order from most
72 * to least preferred. For the forseeable future, we don't expect more
73 * than the eight pseudoflavors null, unix, krb5, krb5i, krb5p, skpm3,
74 * spkm3i, and spkm3p (and using all 8 at once should be rare).
75 */
76#define MAX_SECINFO_LIST 8
77
78struct exp_flavor_info {
79 u32 pseudoflavor;
80 u32 flags;
81};
82
67struct svc_export { 83struct svc_export {
68 struct cache_head h; 84 struct cache_head h;
69 struct auth_domain * ex_client; 85 struct auth_domain * ex_client;
@@ -76,6 +92,8 @@ struct svc_export {
76 int ex_fsid; 92 int ex_fsid;
77 unsigned char * ex_uuid; /* 16 byte fsid */ 93 unsigned char * ex_uuid; /* 16 byte fsid */
78 struct nfsd4_fs_locations ex_fslocs; 94 struct nfsd4_fs_locations ex_fslocs;
95 int ex_nflavors;
96 struct exp_flavor_info ex_flavors[MAX_SECINFO_LIST];
79}; 97};
80 98
81/* an "export key" (expkey) maps a filehandlefragement to an 99/* an "export key" (expkey) maps a filehandlefragement to an
@@ -95,10 +113,11 @@ struct svc_expkey {
95 113
96#define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) 114#define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT))
97#define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) 115#define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC))
98#define EX_RDONLY(exp) ((exp)->ex_flags & NFSEXP_READONLY)
99#define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) 116#define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE)
100#define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) 117#define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
101 118
119int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp);
120__be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp);
102 121
103/* 122/*
104 * Function declarations 123 * Function declarations
@@ -112,13 +131,19 @@ struct svc_export * exp_get_by_name(struct auth_domain *clp,
112 struct vfsmount *mnt, 131 struct vfsmount *mnt,
113 struct dentry *dentry, 132 struct dentry *dentry,
114 struct cache_req *reqp); 133 struct cache_req *reqp);
134struct svc_export * rqst_exp_get_by_name(struct svc_rqst *,
135 struct vfsmount *,
136 struct dentry *);
115struct svc_export * exp_parent(struct auth_domain *clp, 137struct svc_export * exp_parent(struct auth_domain *clp,
116 struct vfsmount *mnt, 138 struct vfsmount *mnt,
117 struct dentry *dentry, 139 struct dentry *dentry,
118 struct cache_req *reqp); 140 struct cache_req *reqp);
141struct svc_export * rqst_exp_parent(struct svc_rqst *,
142 struct vfsmount *mnt,
143 struct dentry *dentry);
119int exp_rootfh(struct auth_domain *, 144int exp_rootfh(struct auth_domain *,
120 char *path, struct knfsd_fh *, int maxsize); 145 char *path, struct knfsd_fh *, int maxsize);
121__be32 exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq); 146__be32 exp_pseudoroot(struct svc_rqst *, struct svc_fh *);
122__be32 nfserrno(int errno); 147__be32 nfserrno(int errno);
123 148
124extern struct cache_detail svc_export_cache; 149extern struct cache_detail svc_export_cache;
@@ -135,6 +160,7 @@ static inline void exp_get(struct svc_export *exp)
135extern struct svc_export * 160extern struct svc_export *
136exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv, 161exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv,
137 struct cache_req *reqp); 162 struct cache_req *reqp);
163struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *);
138 164
139#endif /* __KERNEL__ */ 165#endif /* __KERNEL__ */
140 166
diff --git a/include/linux/nfsd/interface.h b/include/linux/nfsd/interface.h
deleted file mode 100644
index af0979704afb..000000000000
--- a/include/linux/nfsd/interface.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * include/linux/nfsd/interface.h
3 *
4 * defines interface between nfsd and other bits of
5 * the kernel. Particularly filesystems (eventually).
6 *
7 * Copyright (C) 2000 Neil Brown <neilb@cse.unsw.edu.au>
8 */
9
10#ifndef LINUX_NFSD_INTERFACE_H
11#define LINUX_NFSD_INTERFACE_H
12
13#endif /* LINUX_NFSD_INTERFACE_H */
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 72feac581aa3..e452256d3f72 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -22,7 +22,6 @@
22#include <linux/nfsd/export.h> 22#include <linux/nfsd/export.h>
23#include <linux/nfsd/auth.h> 23#include <linux/nfsd/auth.h>
24#include <linux/nfsd/stats.h> 24#include <linux/nfsd/stats.h>
25#include <linux/nfsd/interface.h>
26/* 25/*
27 * nfsd version 26 * nfsd version
28 */ 27 */
@@ -72,6 +71,9 @@ int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
72 struct svc_export **expp); 71 struct svc_export **expp);
73__be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *, 72__be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *,
74 const char *, int, struct svc_fh *); 73 const char *, int, struct svc_fh *);
74__be32 nfsd_lookup_dentry(struct svc_rqst *, struct svc_fh *,
75 const char *, int,
76 struct svc_export **, struct dentry **);
75__be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *, 77__be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *,
76 struct iattr *, int, time_t); 78 struct iattr *, int, time_t);
77#ifdef CONFIG_NFSD_V4 79#ifdef CONFIG_NFSD_V4
@@ -120,7 +122,8 @@ __be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *,
120 struct kstatfs *); 122 struct kstatfs *);
121 123
122int nfsd_notify_change(struct inode *, struct iattr *); 124int nfsd_notify_change(struct inode *, struct iattr *);
123__be32 nfsd_permission(struct svc_export *, struct dentry *, int); 125__be32 nfsd_permission(struct svc_rqst *, struct svc_export *,
126 struct dentry *, int);
124int nfsd_sync_dir(struct dentry *dp); 127int nfsd_sync_dir(struct dentry *dp);
125 128
126#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) 129#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
@@ -149,6 +152,7 @@ extern int nfsd_max_blksize;
149 * NFSv4 State 152 * NFSv4 State
150 */ 153 */
151#ifdef CONFIG_NFSD_V4 154#ifdef CONFIG_NFSD_V4
155extern unsigned int max_delegations;
152void nfs4_state_init(void); 156void nfs4_state_init(void);
153int nfs4_state_start(void); 157int nfs4_state_start(void);
154void nfs4_state_shutdown(void); 158void nfs4_state_shutdown(void);
@@ -236,6 +240,7 @@ void nfsd_lockd_shutdown(void);
236#define nfserr_badname __constant_htonl(NFSERR_BADNAME) 240#define nfserr_badname __constant_htonl(NFSERR_BADNAME)
237#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) 241#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN)
238#define nfserr_locked __constant_htonl(NFSERR_LOCKED) 242#define nfserr_locked __constant_htonl(NFSERR_LOCKED)
243#define nfserr_wrongsec __constant_htonl(NFSERR_WRONGSEC)
239#define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME) 244#define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME)
240 245
241/* error codes for internal use */ 246/* error codes for internal use */
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index ab5c236bd9a7..db348f749376 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -67,7 +67,7 @@ struct nfs4_cb_recall {
67 int cbr_trunc; 67 int cbr_trunc;
68 stateid_t cbr_stateid; 68 stateid_t cbr_stateid;
69 u32 cbr_fhlen; 69 u32 cbr_fhlen;
70 u32 cbr_fhval[NFS4_FHSIZE]; 70 char cbr_fhval[NFS4_FHSIZE];
71 struct nfs4_delegation *cbr_dp; 71 struct nfs4_delegation *cbr_dp;
72}; 72};
73 73
@@ -224,6 +224,7 @@ struct nfs4_file {
224 struct inode *fi_inode; 224 struct inode *fi_inode;
225 u32 fi_id; /* used with stateowner->so_id 225 u32 fi_id; /* used with stateowner->so_id
226 * for stateid_hashtbl hash */ 226 * for stateid_hashtbl hash */
227 bool fi_had_conflict;
227}; 228};
228 229
229/* 230/*
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 09799bcee0ac..1b653267133a 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -293,6 +293,12 @@ struct nfsd4_rename {
293 struct nfsd4_change_info rn_tinfo; /* response */ 293 struct nfsd4_change_info rn_tinfo; /* response */
294}; 294};
295 295
296struct nfsd4_secinfo {
297 u32 si_namelen; /* request */
298 char *si_name; /* request */
299 struct svc_export *si_exp; /* response */
300};
301
296struct nfsd4_setattr { 302struct nfsd4_setattr {
297 stateid_t sa_stateid; /* request */ 303 stateid_t sa_stateid; /* request */
298 u32 sa_bmval[2]; /* request */ 304 u32 sa_bmval[2]; /* request */
@@ -365,6 +371,7 @@ struct nfsd4_op {
365 struct nfsd4_remove remove; 371 struct nfsd4_remove remove;
366 struct nfsd4_rename rename; 372 struct nfsd4_rename rename;
367 clientid_t renew; 373 clientid_t renew;
374 struct nfsd4_secinfo secinfo;
368 struct nfsd4_setattr setattr; 375 struct nfsd4_setattr setattr;
369 struct nfsd4_setclientid setclientid; 376 struct nfsd4_setclientid setclientid;
370 struct nfsd4_setclientid_confirm setclientid_confirm; 377 struct nfsd4_setclientid_confirm setclientid_confirm;
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 9431101bf876..be3f2bb6fcf3 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -196,6 +196,8 @@ extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
196#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ 196#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
197#define CPU_LOCK_ACQUIRE 0x0008 /* Acquire all hotcpu locks */ 197#define CPU_LOCK_ACQUIRE 0x0008 /* Acquire all hotcpu locks */
198#define CPU_LOCK_RELEASE 0x0009 /* Release all hotcpu locks */ 198#define CPU_LOCK_RELEASE 0x0009 /* Release all hotcpu locks */
199#define CPU_DYING 0x000A /* CPU (unsigned)v not running any task,
200 * not handling interrupts, soon dead */
199 201
200/* Used for CPU hotplug events occuring while tasks are frozen due to a suspend 202/* Used for CPU hotplug events occuring while tasks are frozen due to a suspend
201 * operation in progress 203 * operation in progress
@@ -208,6 +210,13 @@ extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
208#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) 210#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
209#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) 211#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
210#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) 212#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
213#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
214
215/* Hibernation and suspend events */
216#define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */
217#define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */
218#define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
219#define PM_POST_SUSPEND 0x0004 /* Suspend finished */
211 220
212#endif /* __KERNEL__ */ 221#endif /* __KERNEL__ */
213#endif /* _LINUX_NOTIFIER_H */ 222#endif /* _LINUX_NOTIFIER_H */
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index 189e0dc993ab..ce06188b7a56 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -28,10 +28,11 @@ struct nsproxy {
28 struct ipc_namespace *ipc_ns; 28 struct ipc_namespace *ipc_ns;
29 struct mnt_namespace *mnt_ns; 29 struct mnt_namespace *mnt_ns;
30 struct pid_namespace *pid_ns; 30 struct pid_namespace *pid_ns;
31 struct user_namespace *user_ns;
31}; 32};
32extern struct nsproxy init_nsproxy; 33extern struct nsproxy init_nsproxy;
33 34
34int copy_namespaces(int flags, struct task_struct *tsk); 35int copy_namespaces(unsigned long flags, struct task_struct *tsk);
35void get_task_namespaces(struct task_struct *tsk); 36void get_task_namespaces(struct task_struct *tsk);
36void free_nsproxy(struct nsproxy *ns); 37void free_nsproxy(struct nsproxy *ns);
37int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, 38int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
diff --git a/include/linux/of.h b/include/linux/of.h
new file mode 100644
index 000000000000..47734ffd9745
--- /dev/null
+++ b/include/linux/of.h
@@ -0,0 +1,61 @@
1#ifndef _LINUX_OF_H
2#define _LINUX_OF_H
3/*
4 * Definitions for talking to the Open Firmware PROM on
5 * Power Macintosh and other computers.
6 *
7 * Copyright (C) 1996-2005 Paul Mackerras.
8 *
9 * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
10 * Updates for SPARC64 by David S. Miller
11 * Derived from PowerPC and Sparc prom.h files by Stephen Rothwell, IBM Corp.
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version.
17 */
18#include <linux/types.h>
19
20#include <asm/bitops.h>
21#include <asm/prom.h>
22
23/* flag descriptions */
24#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
25#define OF_DETACHED 2 /* node has been detached from the device tree */
26
27#define OF_BAD_ADDR ((u64)-1)
28
29extern struct device_node *of_find_node_by_name(struct device_node *from,
30 const char *name);
31#define for_each_node_by_name(dn, name) \
32 for (dn = of_find_node_by_name(NULL, name); dn; \
33 dn = of_find_node_by_name(dn, name))
34extern struct device_node *of_find_node_by_type(struct device_node *from,
35 const char *type);
36#define for_each_node_by_type(dn, type) \
37 for (dn = of_find_node_by_type(NULL, type); dn; \
38 dn = of_find_node_by_type(dn, type))
39extern struct device_node *of_find_compatible_node(struct device_node *from,
40 const char *type, const char *compat);
41#define for_each_compatible_node(dn, type, compatible) \
42 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
43 dn = of_find_compatible_node(dn, type, compatible))
44extern struct device_node *of_find_node_by_path(const char *path);
45extern struct device_node *of_find_node_by_phandle(phandle handle);
46extern struct device_node *of_get_parent(const struct device_node *node);
47extern struct device_node *of_get_next_child(const struct device_node *node,
48 struct device_node *prev);
49extern struct property *of_find_property(const struct device_node *np,
50 const char *name,
51 int *lenp);
52extern int of_device_is_compatible(const struct device_node *device,
53 const char *);
54extern const void *of_get_property(const struct device_node *node,
55 const char *name,
56 int *lenp);
57#define get_property(a, b, c) of_get_property((a), (b), (c))
58extern int of_n_addr_cells(struct device_node *np);
59extern int of_n_size_cells(struct device_node *np);
60
61#endif /* _LINUX_OF_H */
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
new file mode 100644
index 000000000000..91bf84b9d144
--- /dev/null
+++ b/include/linux/of_device.h
@@ -0,0 +1,26 @@
1#ifndef _LINUX_OF_DEVICE_H
2#define _LINUX_OF_DEVICE_H
3#ifdef __KERNEL__
4
5#include <linux/device.h>
6#include <linux/of.h>
7#include <linux/mod_devicetable.h>
8
9#include <asm/of_device.h>
10
11#define to_of_device(d) container_of(d, struct of_device, dev)
12
13extern const struct of_device_id *of_match_node(
14 const struct of_device_id *matches, const struct device_node *node);
15extern const struct of_device_id *of_match_device(
16 const struct of_device_id *matches, const struct of_device *dev);
17
18extern struct of_device *of_dev_get(struct of_device *dev);
19extern void of_dev_put(struct of_device *dev);
20
21extern int of_device_register(struct of_device *ofdev);
22extern void of_device_unregister(struct of_device *ofdev);
23extern void of_release_dev(struct device *dev);
24
25#endif /* __KERNEL__ */
26#endif /* _LINUX_OF_DEVICE_H */
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
new file mode 100644
index 000000000000..5fd44e63fb26
--- /dev/null
+++ b/include/linux/of_platform.h
@@ -0,0 +1,57 @@
1#ifndef _LINUX_OF_PLATFORM_H
2#define _LINUX_OF_PLATFORM_H
3/*
4 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
5 * <benh@kernel.crashing.org>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 *
12 */
13
14#include <linux/module.h>
15#include <linux/device.h>
16#include <linux/mod_devicetable.h>
17#include <linux/pm.h>
18#include <linux/of_device.h>
19
20/*
21 * The of_platform_bus_type is a bus type used by drivers that do not
22 * attach to a macio or similar bus but still use OF probing
23 * mechanism
24 */
25extern struct bus_type of_platform_bus_type;
26
27/*
28 * An of_platform_driver driver is attached to a basic of_device on
29 * the "platform bus" (of_platform_bus_type) (or ISA, EBUS and SBUS
30 * busses on sparc).
31 */
32struct of_platform_driver
33{
34 char *name;
35 struct of_device_id *match_table;
36 struct module *owner;
37
38 int (*probe)(struct of_device* dev,
39 const struct of_device_id *match);
40 int (*remove)(struct of_device* dev);
41
42 int (*suspend)(struct of_device* dev, pm_message_t state);
43 int (*resume)(struct of_device* dev);
44 int (*shutdown)(struct of_device* dev);
45
46 struct device_driver driver;
47};
48#define to_of_platform_driver(drv) \
49 container_of(drv,struct of_platform_driver, driver)
50
51#include <asm/of_platform.h>
52
53extern struct of_device *of_find_device_by_node(struct device_node *np);
54
55extern int of_bus_type_init(struct bus_type *bus, const char *name);
56
57#endif /* _LINUX_OF_PLATFORM_H */
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 0d514b252454..041bb31100f4 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -17,6 +17,26 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19 19
20/* Each escaped entry is prefixed by ESCAPE_CODE
21 * then one of the following codes, then the
22 * relevant data.
23 * These #defines live in this file so that arch-specific
24 * buffer sync'ing code can access them.
25 */
26#define ESCAPE_CODE ~0UL
27#define CTX_SWITCH_CODE 1
28#define CPU_SWITCH_CODE 2
29#define COOKIE_SWITCH_CODE 3
30#define KERNEL_ENTER_SWITCH_CODE 4
31#define KERNEL_EXIT_SWITCH_CODE 5
32#define MODULE_LOADED_CODE 6
33#define CTX_TGID_CODE 7
34#define TRACE_BEGIN_CODE 8
35#define TRACE_END_CODE 9
36#define XEN_ENTER_SWITCH_CODE 10
37#define SPU_PROFILING_CODE 11
38#define SPU_CTX_SWITCH_CODE 12
39
20struct super_block; 40struct super_block;
21struct dentry; 41struct dentry;
22struct file_operations; 42struct file_operations;
@@ -35,6 +55,14 @@ struct oprofile_operations {
35 int (*start)(void); 55 int (*start)(void);
36 /* Stop delivering interrupts. */ 56 /* Stop delivering interrupts. */
37 void (*stop)(void); 57 void (*stop)(void);
58 /* Arch-specific buffer sync functions.
59 * Return value = 0: Success
60 * Return value = -1: Failure
61 * Return value = 1: Run generic sync function
62 */
63 int (*sync_start)(void);
64 int (*sync_stop)(void);
65
38 /* Initiate a stack backtrace. Optional. */ 66 /* Initiate a stack backtrace. Optional. */
39 void (*backtrace)(struct pt_regs * const regs, unsigned int depth); 67 void (*backtrace)(struct pt_regs * const regs, unsigned int depth);
40 /* CPU identification string. */ 68 /* CPU identification string. */
@@ -56,6 +84,13 @@ int oprofile_arch_init(struct oprofile_operations * ops);
56void oprofile_arch_exit(void); 84void oprofile_arch_exit(void);
57 85
58/** 86/**
87 * Add data to the event buffer.
88 * The data passed is free-form, but typically consists of
89 * file offsets, dcookies, context information, and ESCAPE codes.
90 */
91void add_event_entry(unsigned long data);
92
93/**
59 * Add a sample. This may be called from any context. Pass 94 * Add a sample. This may be called from any context. Pass
60 * smp_processor_id() as cpu. 95 * smp_processor_id() as cpu.
61 */ 96 */
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index ae2d79f2107e..209d3a47f50f 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -90,8 +90,12 @@
90#define PG_reclaim 17 /* To be reclaimed asap */ 90#define PG_reclaim 17 /* To be reclaimed asap */
91#define PG_buddy 19 /* Page is free, on buddy lists */ 91#define PG_buddy 19 /* Page is free, on buddy lists */
92 92
93/* PG_readahead is only used for file reads; PG_reclaim is only for writes */
94#define PG_readahead PG_reclaim /* Reminder to do async read-ahead */
95
93/* PG_owner_priv_1 users should have descriptive aliases */ 96/* PG_owner_priv_1 users should have descriptive aliases */
94#define PG_checked PG_owner_priv_1 /* Used by some filesystems */ 97#define PG_checked PG_owner_priv_1 /* Used by some filesystems */
98#define PG_pinned PG_owner_priv_1 /* Xen pinned pagetable */
95 99
96#if (BITS_PER_LONG > 32) 100#if (BITS_PER_LONG > 32)
97/* 101/*
@@ -170,6 +174,10 @@ static inline void SetPageUptodate(struct page *page)
170#define SetPageChecked(page) set_bit(PG_checked, &(page)->flags) 174#define SetPageChecked(page) set_bit(PG_checked, &(page)->flags)
171#define ClearPageChecked(page) clear_bit(PG_checked, &(page)->flags) 175#define ClearPageChecked(page) clear_bit(PG_checked, &(page)->flags)
172 176
177#define PagePinned(page) test_bit(PG_pinned, &(page)->flags)
178#define SetPagePinned(page) set_bit(PG_pinned, &(page)->flags)
179#define ClearPagePinned(page) clear_bit(PG_pinned, &(page)->flags)
180
173#define PageReserved(page) test_bit(PG_reserved, &(page)->flags) 181#define PageReserved(page) test_bit(PG_reserved, &(page)->flags)
174#define SetPageReserved(page) set_bit(PG_reserved, &(page)->flags) 182#define SetPageReserved(page) set_bit(PG_reserved, &(page)->flags)
175#define ClearPageReserved(page) clear_bit(PG_reserved, &(page)->flags) 183#define ClearPageReserved(page) clear_bit(PG_reserved, &(page)->flags)
@@ -181,37 +189,15 @@ static inline void SetPageUptodate(struct page *page)
181#define __SetPagePrivate(page) __set_bit(PG_private, &(page)->flags) 189#define __SetPagePrivate(page) __set_bit(PG_private, &(page)->flags)
182#define __ClearPagePrivate(page) __clear_bit(PG_private, &(page)->flags) 190#define __ClearPagePrivate(page) __clear_bit(PG_private, &(page)->flags)
183 191
192/*
193 * Only test-and-set exist for PG_writeback. The unconditional operators are
194 * risky: they bypass page accounting.
195 */
184#define PageWriteback(page) test_bit(PG_writeback, &(page)->flags) 196#define PageWriteback(page) test_bit(PG_writeback, &(page)->flags)
185#define SetPageWriteback(page) \ 197#define TestSetPageWriteback(page) test_and_set_bit(PG_writeback, \
186 do { \ 198 &(page)->flags)
187 if (!test_and_set_bit(PG_writeback, \ 199#define TestClearPageWriteback(page) test_and_clear_bit(PG_writeback, \
188 &(page)->flags)) \ 200 &(page)->flags)
189 inc_zone_page_state(page, NR_WRITEBACK); \
190 } while (0)
191#define TestSetPageWriteback(page) \
192 ({ \
193 int ret; \
194 ret = test_and_set_bit(PG_writeback, \
195 &(page)->flags); \
196 if (!ret) \
197 inc_zone_page_state(page, NR_WRITEBACK); \
198 ret; \
199 })
200#define ClearPageWriteback(page) \
201 do { \
202 if (test_and_clear_bit(PG_writeback, \
203 &(page)->flags)) \
204 dec_zone_page_state(page, NR_WRITEBACK); \
205 } while (0)
206#define TestClearPageWriteback(page) \
207 ({ \
208 int ret; \
209 ret = test_and_clear_bit(PG_writeback, \
210 &(page)->flags); \
211 if (ret) \
212 dec_zone_page_state(page, NR_WRITEBACK); \
213 ret; \
214 })
215 201
216#define PageBuddy(page) test_bit(PG_buddy, &(page)->flags) 202#define PageBuddy(page) test_bit(PG_buddy, &(page)->flags)
217#define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags) 203#define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags)
@@ -221,6 +207,10 @@ static inline void SetPageUptodate(struct page *page)
221#define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags) 207#define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags)
222#define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags) 208#define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags)
223 209
210#define PageReadahead(page) test_bit(PG_readahead, &(page)->flags)
211#define SetPageReadahead(page) set_bit(PG_readahead, &(page)->flags)
212#define ClearPageReadahead(page) clear_bit(PG_readahead, &(page)->flags)
213
224#define PageReclaim(page) test_bit(PG_reclaim, &(page)->flags) 214#define PageReclaim(page) test_bit(PG_reclaim, &(page)->flags)
225#define SetPageReclaim(page) set_bit(PG_reclaim, &(page)->flags) 215#define SetPageReclaim(page) set_bit(PG_reclaim, &(page)->flags)
226#define ClearPageReclaim(page) clear_bit(PG_reclaim, &(page)->flags) 216#define ClearPageReclaim(page) clear_bit(PG_reclaim, &(page)->flags)
diff --git a/include/linux/pata_platform.h b/include/linux/pata_platform.h
index 2d5fd647e0e9..5799e8d50623 100644
--- a/include/linux/pata_platform.h
+++ b/include/linux/pata_platform.h
@@ -8,6 +8,11 @@ struct pata_platform_info {
8 * spacing used by ata_std_ports(). 8 * spacing used by ata_std_ports().
9 */ 9 */
10 unsigned int ioport_shift; 10 unsigned int ioport_shift;
11 /*
12 * Indicate platform specific irq types and initial
13 * IRQ flags when call request_irq()
14 */
15 unsigned int irq_flags;
11}; 16};
12 17
13#endif /* __LINUX_PATA_PLATFORM_H */ 18#endif /* __LINUX_PATA_PLATFORM_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index fbf3766dac1e..5e84f2e8d54c 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -111,7 +111,8 @@ enum pcie_reset_state {
111 111
112typedef unsigned short __bitwise pci_bus_flags_t; 112typedef unsigned short __bitwise pci_bus_flags_t;
113enum pci_bus_flags { 113enum pci_bus_flags {
114 PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, 114 PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1,
115 PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2,
115}; 116};
116 117
117struct pci_cap_saved_state { 118struct pci_cap_saved_state {
@@ -138,6 +139,7 @@ struct pci_dev {
138 unsigned short subsystem_vendor; 139 unsigned short subsystem_vendor;
139 unsigned short subsystem_device; 140 unsigned short subsystem_device;
140 unsigned int class; /* 3 bytes: (base,sub,prog-if) */ 141 unsigned int class; /* 3 bytes: (base,sub,prog-if) */
142 u8 revision; /* PCI revision, low byte of class word */
141 u8 hdr_type; /* PCI header type (`multi' flag masked out) */ 143 u8 hdr_type; /* PCI header type (`multi' flag masked out) */
142 u8 rom_base_reg; /* which config register controls the ROM */ 144 u8 rom_base_reg; /* which config register controls the ROM */
143 u8 pin; /* which interrupt pin this device uses */ 145 u8 pin; /* which interrupt pin this device uses */
@@ -313,7 +315,7 @@ struct pci_dynids {
313 315
314/* ---------------------------------------------------------------- */ 316/* ---------------------------------------------------------------- */
315/** PCI Error Recovery System (PCI-ERS). If a PCI device driver provides 317/** PCI Error Recovery System (PCI-ERS). If a PCI device driver provides
316 * a set fof callbacks in struct pci_error_handlers, then that device driver 318 * a set of callbacks in struct pci_error_handlers, then that device driver
317 * will be notified of PCI bus errors, and will be driven to recovery 319 * will be notified of PCI bus errors, and will be driven to recovery
318 * when an error occurs. 320 * when an error occurs.
319 */ 321 */
@@ -370,7 +372,6 @@ struct pci_driver {
370 int (*suspend_late) (struct pci_dev *dev, pm_message_t state); 372 int (*suspend_late) (struct pci_dev *dev, pm_message_t state);
371 int (*resume_early) (struct pci_dev *dev); 373 int (*resume_early) (struct pci_dev *dev);
372 int (*resume) (struct pci_dev *dev); /* Device woken up */ 374 int (*resume) (struct pci_dev *dev); /* Device woken up */
373 int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */
374 void (*shutdown) (struct pci_dev *dev); 375 void (*shutdown) (struct pci_dev *dev);
375 376
376 struct pci_error_handlers *err_handler; 377 struct pci_error_handlers *err_handler;
@@ -431,6 +432,8 @@ extern struct bus_type pci_bus_type;
431 * code, or pci core code. */ 432 * code, or pci core code. */
432extern struct list_head pci_root_buses; /* list of all known PCI buses */ 433extern struct list_head pci_root_buses; /* list of all known PCI buses */
433extern struct list_head pci_devices; /* list of all devices */ 434extern struct list_head pci_devices; /* list of all devices */
435/* Some device drivers need know if pci is initiated */
436extern int no_pci_devices(void);
434 437
435void pcibios_fixup_bus(struct pci_bus *); 438void pcibios_fixup_bus(struct pci_bus *);
436int __must_check pcibios_enable_device(struct pci_dev *, int mask); 439int __must_check pcibios_enable_device(struct pci_dev *, int mask);
@@ -475,7 +478,7 @@ extern void pci_sort_breadthfirst(void);
475/* Generic PCI functions exported to card drivers */ 478/* Generic PCI functions exported to card drivers */
476 479
477struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from); 480struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from);
478struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); 481struct pci_dev __deprecated *pci_find_slot (unsigned int bus, unsigned int devfn);
479int pci_find_capability (struct pci_dev *dev, int cap); 482int pci_find_capability (struct pci_dev *dev, int cap);
480int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 483int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
481int pci_find_ext_capability (struct pci_dev *dev, int cap); 484int pci_find_ext_capability (struct pci_dev *dev, int cap);
@@ -544,11 +547,16 @@ void pci_set_master(struct pci_dev *dev);
544int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); 547int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state);
545#define HAVE_PCI_SET_MWI 548#define HAVE_PCI_SET_MWI
546int __must_check pci_set_mwi(struct pci_dev *dev); 549int __must_check pci_set_mwi(struct pci_dev *dev);
550int pci_try_set_mwi(struct pci_dev *dev);
547void pci_clear_mwi(struct pci_dev *dev); 551void pci_clear_mwi(struct pci_dev *dev);
548void pci_intx(struct pci_dev *dev, int enable); 552void pci_intx(struct pci_dev *dev, int enable);
549void pci_msi_off(struct pci_dev *dev); 553void pci_msi_off(struct pci_dev *dev);
550int pci_set_dma_mask(struct pci_dev *dev, u64 mask); 554int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
551int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); 555int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
556int pcix_get_max_mmrbc(struct pci_dev *dev);
557int pcix_get_mmrbc(struct pci_dev *dev);
558int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
559int pcie_set_readrq(struct pci_dev *dev, int rq);
552void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); 560void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
553int __must_check pci_assign_resource(struct pci_dev *dev, int i); 561int __must_check pci_assign_resource(struct pci_dev *dev, int i);
554int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i); 562int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i);
@@ -560,6 +568,7 @@ void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size);
560void __iomem __must_check *pci_map_rom_copy(struct pci_dev *pdev, size_t *size); 568void __iomem __must_check *pci_map_rom_copy(struct pci_dev *pdev, size_t *size);
561void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); 569void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom);
562void pci_remove_rom(struct pci_dev *pdev); 570void pci_remove_rom(struct pci_dev *pdev);
571size_t pci_get_rom_size(void __iomem *rom, size_t size);
563 572
564/* Power management related routines */ 573/* Power management related routines */
565int pci_save_state(struct pci_dev *dev); 574int pci_save_state(struct pci_dev *dev);
@@ -717,6 +726,7 @@ static inline struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *
717{ return NULL; } 726{ return NULL; }
718 727
719#define pci_dev_present(ids) (0) 728#define pci_dev_present(ids) (0)
729#define no_pci_devices() (1)
720#define pci_find_present(ids) (NULL) 730#define pci_find_present(ids) (NULL)
721#define pci_dev_put(dev) do { } while (0) 731#define pci_dev_put(dev) do { } while (0)
722 732
@@ -748,6 +758,17 @@ static inline void pci_release_regions(struct pci_dev *dev) { }
748static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } 758static inline void pci_block_user_cfg_access(struct pci_dev *dev) { }
749static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { } 759static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { }
750 760
761static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
762{ return NULL; }
763
764static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
765 unsigned int devfn)
766{ return NULL; }
767
768static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
769 unsigned int devfn)
770{ return NULL; }
771
751#endif /* CONFIG_PCI */ 772#endif /* CONFIG_PCI */
752 773
753/* Include architecture-dependent settings and functions */ 774/* Include architecture-dependent settings and functions */
@@ -865,5 +886,7 @@ extern int pci_pci_problems;
865extern unsigned long pci_cardbus_io_size; 886extern unsigned long pci_cardbus_io_size;
866extern unsigned long pci_cardbus_mem_size; 887extern unsigned long pci_cardbus_mem_size;
867 888
889extern int pcibios_add_platform_entries(struct pci_dev *dev);
890
868#endif /* __KERNEL__ */ 891#endif /* __KERNEL__ */
869#endif /* LINUX_PCI_H */ 892#endif /* LINUX_PCI_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 6a115cffea34..b15c6498fe67 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -133,6 +133,9 @@
133 133
134/* Vendors and devices. Sort key: vendor first, device next. */ 134/* Vendors and devices. Sort key: vendor first, device next. */
135 135
136#define PCI_VENDOR_ID_TTTECH 0x0357
137#define PCI_DEVICE_ID_TTTECH_MC322 0x000a
138
136#define PCI_VENDOR_ID_DYNALINK 0x0675 139#define PCI_VENDOR_ID_DYNALINK 0x0675
137#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702 140#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702
138 141
@@ -371,6 +374,7 @@
371#define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385 374#define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385
372#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c 375#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c
373#define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 376#define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390
377#define PCI_DEVICE_ID_ATI_IXP700_SMBUS 0x4395
374#define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c 378#define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c
375 379
376#define PCI_VENDOR_ID_VLSI 0x1004 380#define PCI_VENDOR_ID_VLSI 0x1004
@@ -475,6 +479,9 @@
475#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE 0x0361 479#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE 0x0361
476#define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 480#define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252
477 481
482#define PCI_VENDOR_ID_UNISYS 0x1018
483#define PCI_DEVICE_ID_UNISYS_DMA_DIRECTOR 0x001C
484
478#define PCI_VENDOR_ID_COMPEX2 0x101a /* pci.ids says "AT&T GIS (NCR)" */ 485#define PCI_VENDOR_ID_COMPEX2 0x101a /* pci.ids says "AT&T GIS (NCR)" */
479#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005 486#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005
480 487
@@ -488,6 +495,8 @@
488 495
489#define PCI_VENDOR_ID_AMD 0x1022 496#define PCI_VENDOR_ID_AMD 0x1022
490#define PCI_DEVICE_ID_AMD_K8_NB 0x1100 497#define PCI_DEVICE_ID_AMD_K8_NB 0x1100
498#define PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP 0x1101
499#define PCI_DEVICE_ID_AMD_K8_NB_MEMCTL 0x1102
491#define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 500#define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103
492#define PCI_DEVICE_ID_AMD_LANCE 0x2000 501#define PCI_DEVICE_ID_AMD_LANCE 0x2000
493#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 502#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001
@@ -661,6 +670,7 @@
661#define PCI_DEVICE_ID_SI_965 0x0965 670#define PCI_DEVICE_ID_SI_965 0x0965
662#define PCI_DEVICE_ID_SI_966 0x0966 671#define PCI_DEVICE_ID_SI_966 0x0966
663#define PCI_DEVICE_ID_SI_968 0x0968 672#define PCI_DEVICE_ID_SI_968 0x0968
673#define PCI_DEVICE_ID_SI_1180 0x1180
664#define PCI_DEVICE_ID_SI_5511 0x5511 674#define PCI_DEVICE_ID_SI_5511 0x5511
665#define PCI_DEVICE_ID_SI_5513 0x5513 675#define PCI_DEVICE_ID_SI_5513 0x5513
666#define PCI_DEVICE_ID_SI_5517 0x5517 676#define PCI_DEVICE_ID_SI_5517 0x5517
@@ -731,7 +741,6 @@
731#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 741#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
732#define PCI_DEVICE_ID_ELSA_QS3000 0x3000 742#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
733 743
734
735#define PCI_VENDOR_ID_BUSLOGIC 0x104B 744#define PCI_VENDOR_ID_BUSLOGIC 0x104B
736#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 745#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140
737#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040 746#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040
@@ -777,7 +786,6 @@
777 786
778#define PCI_VENDOR_ID_SONY 0x104d 787#define PCI_VENDOR_ID_SONY 0x104d
779 788
780
781/* Winbond have two vendor IDs! See 0x10ad as well */ 789/* Winbond have two vendor IDs! See 0x10ad as well */
782#define PCI_VENDOR_ID_WINBOND2 0x1050 790#define PCI_VENDOR_ID_WINBOND2 0x1050
783#define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a 791#define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a
@@ -815,7 +823,6 @@
815#define PCI_DEVICE_ID_PROMISE_20276 0x5275 823#define PCI_DEVICE_ID_PROMISE_20276 0x5275
816#define PCI_DEVICE_ID_PROMISE_20277 0x7275 824#define PCI_DEVICE_ID_PROMISE_20277 0x7275
817 825
818
819#define PCI_VENDOR_ID_UMC 0x1060 826#define PCI_VENDOR_ID_UMC 0x1060
820#define PCI_DEVICE_ID_UMC_UM8673F 0x0101 827#define PCI_DEVICE_ID_UMC_UM8673F 0x0101
821#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a 828#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a
@@ -831,7 +838,6 @@
831#define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56 838#define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56
832#define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166 839#define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166
833 840
834
835#define PCI_VENDOR_ID_APPLE 0x106b 841#define PCI_VENDOR_ID_APPLE 0x106b
836#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001 842#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001
837#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e 843#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e
@@ -867,7 +873,6 @@
867#define PCI_DEVICE_ID_YAMAHA_744 0x0010 873#define PCI_DEVICE_ID_YAMAHA_744 0x0010
868#define PCI_DEVICE_ID_YAMAHA_754 0x0012 874#define PCI_DEVICE_ID_YAMAHA_754 0x0012
869 875
870
871#define PCI_VENDOR_ID_QLOGIC 0x1077 876#define PCI_VENDOR_ID_QLOGIC 0x1077
872#define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016 877#define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016
873#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 878#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020
@@ -898,12 +903,9 @@
898#define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103 903#define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103
899#define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104 904#define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104
900 905
901
902
903#define PCI_VENDOR_ID_CONTAQ 0x1080 906#define PCI_VENDOR_ID_CONTAQ 0x1080
904#define PCI_DEVICE_ID_CONTAQ_82C693 0xc693 907#define PCI_DEVICE_ID_CONTAQ_82C693 0xc693
905 908
906
907#define PCI_VENDOR_ID_OLICOM 0x108d 909#define PCI_VENDOR_ID_OLICOM 0x108d
908#define PCI_DEVICE_ID_OLICOM_OC2325 0x0012 910#define PCI_DEVICE_ID_OLICOM_OC2325 0x0012
909#define PCI_DEVICE_ID_OLICOM_OC2183 0x0013 911#define PCI_DEVICE_ID_OLICOM_OC2183 0x0013
@@ -935,23 +937,19 @@
935#define PCI_DEVICE_ID_SII_3112 0x3112 937#define PCI_DEVICE_ID_SII_3112 0x3112
936#define PCI_DEVICE_ID_SII_1210SA 0x0240 938#define PCI_DEVICE_ID_SII_1210SA 0x0240
937 939
938
939#define PCI_VENDOR_ID_BROOKTREE 0x109e 940#define PCI_VENDOR_ID_BROOKTREE 0x109e
940#define PCI_DEVICE_ID_BROOKTREE_878 0x0878 941#define PCI_DEVICE_ID_BROOKTREE_878 0x0878
941#define PCI_DEVICE_ID_BROOKTREE_879 0x0879 942#define PCI_DEVICE_ID_BROOKTREE_879 0x0879
942 943
943
944#define PCI_VENDOR_ID_SGI 0x10a9 944#define PCI_VENDOR_ID_SGI 0x10a9
945#define PCI_DEVICE_ID_SGI_IOC3 0x0003 945#define PCI_DEVICE_ID_SGI_IOC3 0x0003
946#define PCI_DEVICE_ID_SGI_LITHIUM 0x1002
946#define PCI_DEVICE_ID_SGI_IOC4 0x100a 947#define PCI_DEVICE_ID_SGI_IOC4 0x100a
947#define PCI_VENDOR_ID_SGI_LITHIUM 0x1002
948
949 948
950#define PCI_VENDOR_ID_WINBOND 0x10ad 949#define PCI_VENDOR_ID_WINBOND 0x10ad
951#define PCI_DEVICE_ID_WINBOND_82C105 0x0105 950#define PCI_DEVICE_ID_WINBOND_82C105 0x0105
952#define PCI_DEVICE_ID_WINBOND_83C553 0x0565 951#define PCI_DEVICE_ID_WINBOND_83C553 0x0565
953 952
954
955#define PCI_VENDOR_ID_PLX 0x10b5 953#define PCI_VENDOR_ID_PLX 0x10b5
956#define PCI_DEVICE_ID_PLX_R685 0x1030 954#define PCI_DEVICE_ID_PLX_R685 0x1030
957#define PCI_DEVICE_ID_PLX_ROMULUS 0x106a 955#define PCI_DEVICE_ID_PLX_ROMULUS 0x106a
@@ -985,7 +983,6 @@
985#define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909 983#define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909
986#define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a 984#define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a
987 985
988
989#define PCI_VENDOR_ID_AL 0x10b9 986#define PCI_VENDOR_ID_AL 0x10b9
990#define PCI_DEVICE_ID_AL_M1533 0x1533 987#define PCI_DEVICE_ID_AL_M1533 0x1533
991#define PCI_DEVICE_ID_AL_M1535 0x1535 988#define PCI_DEVICE_ID_AL_M1535 0x1535
@@ -1008,18 +1005,14 @@
1008#define PCI_DEVICE_ID_AL_M5451 0x5451 1005#define PCI_DEVICE_ID_AL_M5451 0x5451
1009#define PCI_DEVICE_ID_AL_M7101 0x7101 1006#define PCI_DEVICE_ID_AL_M7101 0x7101
1010 1007
1011
1012
1013#define PCI_VENDOR_ID_NEOMAGIC 0x10c8 1008#define PCI_VENDOR_ID_NEOMAGIC 0x10c8
1014#define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005 1009#define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005
1015#define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006 1010#define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006
1016#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016 1011#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016
1017 1012
1018
1019#define PCI_VENDOR_ID_TCONRAD 0x10da 1013#define PCI_VENDOR_ID_TCONRAD 0x10da
1020#define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508 1014#define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508
1021 1015
1022
1023#define PCI_VENDOR_ID_NVIDIA 0x10de 1016#define PCI_VENDOR_ID_NVIDIA 0x10de
1024#define PCI_DEVICE_ID_NVIDIA_TNT 0x0020 1017#define PCI_DEVICE_ID_NVIDIA_TNT 0x0020
1025#define PCI_DEVICE_ID_NVIDIA_TNT2 0x0028 1018#define PCI_DEVICE_ID_NVIDIA_TNT2 0x0028
@@ -1233,14 +1226,13 @@
1233#define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E 1226#define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E
1234#define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F 1227#define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F
1235#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 1228#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560
1229#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE 0x056C
1230#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759
1236 1231
1237#define PCI_VENDOR_ID_IMS 0x10e0 1232#define PCI_VENDOR_ID_IMS 0x10e0
1238#define PCI_DEVICE_ID_IMS_TT128 0x9128 1233#define PCI_DEVICE_ID_IMS_TT128 0x9128
1239#define PCI_DEVICE_ID_IMS_TT3D 0x9135 1234#define PCI_DEVICE_ID_IMS_TT3D 0x9135
1240 1235
1241
1242
1243
1244#define PCI_VENDOR_ID_INTERG 0x10ea 1236#define PCI_VENDOR_ID_INTERG 0x10ea
1245#define PCI_DEVICE_ID_INTERG_1682 0x1682 1237#define PCI_DEVICE_ID_INTERG_1682 0x1682
1246#define PCI_DEVICE_ID_INTERG_2000 0x2000 1238#define PCI_DEVICE_ID_INTERG_2000 0x2000
@@ -1259,7 +1251,6 @@
1259#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5 1251#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5
1260#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6 1252#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6
1261 1253
1262
1263#define PCI_VENDOR_ID_INIT 0x1101 1254#define PCI_VENDOR_ID_INIT 0x1101
1264 1255
1265#define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */ 1256#define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */
@@ -1354,7 +1345,6 @@
1354#define PCI_VENDOR_ID_SIEMENS 0x110A 1345#define PCI_VENDOR_ID_SIEMENS 0x110A
1355#define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102 1346#define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102
1356 1347
1357
1358#define PCI_VENDOR_ID_VORTEX 0x1119 1348#define PCI_VENDOR_ID_VORTEX 0x1119
1359#define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000 1349#define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000
1360#define PCI_DEVICE_ID_VORTEX_GDT6000B 0x0001 1350#define PCI_DEVICE_ID_VORTEX_GDT6000B 0x0001
@@ -1380,8 +1370,8 @@
1380#define PCI_VENDOR_ID_EF 0x111a 1370#define PCI_VENDOR_ID_EF 0x111a
1381#define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000 1371#define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000
1382#define PCI_DEVICE_ID_EF_ATM_ASIC 0x0002 1372#define PCI_DEVICE_ID_EF_ATM_ASIC 0x0002
1383#define PCI_VENDOR_ID_EF_ATM_LANAI2 0x0003 1373#define PCI_DEVICE_ID_EF_ATM_LANAI2 0x0003
1384#define PCI_VENDOR_ID_EF_ATM_LANAIHB 0x0005 1374#define PCI_DEVICE_ID_EF_ATM_LANAIHB 0x0005
1385 1375
1386#define PCI_VENDOR_ID_IDT 0x111d 1376#define PCI_VENDOR_ID_IDT 0x111d
1387#define PCI_DEVICE_ID_IDT_IDT77201 0x0001 1377#define PCI_DEVICE_ID_IDT_IDT77201 0x0001
@@ -1389,7 +1379,6 @@
1389#define PCI_VENDOR_ID_FORE 0x1127 1379#define PCI_VENDOR_ID_FORE 0x1127
1390#define PCI_DEVICE_ID_FORE_PCA200E 0x0300 1380#define PCI_DEVICE_ID_FORE_PCA200E 0x0300
1391 1381
1392
1393#define PCI_VENDOR_ID_PHILIPS 0x1131 1382#define PCI_VENDOR_ID_PHILIPS 0x1131
1394#define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146 1383#define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146
1395#define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730 1384#define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730
@@ -1408,7 +1397,6 @@
1408#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 1397#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550
1409 1398
1410 1399
1411
1412#define PCI_VENDOR_ID_SYSKONNECT 0x1148 1400#define PCI_VENDOR_ID_SYSKONNECT 0x1148
1413#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200 1401#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200
1414#define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300 1402#define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300
@@ -1416,7 +1404,6 @@
1416#define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400 1404#define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400
1417#define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500 1405#define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500
1418 1406
1419
1420#define PCI_VENDOR_ID_DIGI 0x114f 1407#define PCI_VENDOR_ID_DIGI 0x114f
1421#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070 1408#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070
1422#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071 1409#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071
@@ -1427,12 +1414,10 @@
1427#define PCI_DEVICE_ID_NEO_2RJ45 0x00CA 1414#define PCI_DEVICE_ID_NEO_2RJ45 0x00CA
1428#define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB 1415#define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB
1429 1416
1430
1431#define PCI_VENDOR_ID_XIRCOM 0x115d 1417#define PCI_VENDOR_ID_XIRCOM 0x115d
1432#define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101 1418#define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101
1433#define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103 1419#define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103
1434 1420
1435
1436#define PCI_VENDOR_ID_SERVERWORKS 0x1166 1421#define PCI_VENDOR_ID_SERVERWORKS 0x1166
1437#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008 1422#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008
1438#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 1423#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009
@@ -1501,7 +1486,6 @@
1501#define PCI_DEVICE_ID_ZEITNET_1221 0x0001 1486#define PCI_DEVICE_ID_ZEITNET_1221 0x0001
1502#define PCI_DEVICE_ID_ZEITNET_1225 0x0002 1487#define PCI_DEVICE_ID_ZEITNET_1225 0x0002
1503 1488
1504
1505#define PCI_VENDOR_ID_FUJITSU_ME 0x119e 1489#define PCI_VENDOR_ID_FUJITSU_ME 0x119e
1506#define PCI_DEVICE_ID_FUJITSU_FS155 0x0001 1490#define PCI_DEVICE_ID_FUJITSU_FS155 0x0001
1507#define PCI_DEVICE_ID_FUJITSU_FS50 0x0003 1491#define PCI_DEVICE_ID_FUJITSU_FS50 0x0003
@@ -1519,28 +1503,23 @@
1519#define PCI_DEVICE_ID_V3_V960 0x0001 1503#define PCI_DEVICE_ID_V3_V960 0x0001
1520#define PCI_DEVICE_ID_V3_V351 0x0002 1504#define PCI_DEVICE_ID_V3_V351 0x0002
1521 1505
1522
1523#define PCI_VENDOR_ID_ATT 0x11c1 1506#define PCI_VENDOR_ID_ATT 0x11c1
1524#define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480 1507#define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480
1525 1508
1526
1527#define PCI_VENDOR_ID_SPECIALIX 0x11cb 1509#define PCI_VENDOR_ID_SPECIALIX 0x11cb
1528#define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000 1510#define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000
1529#define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000 1511#define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000
1530#define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004 1512#define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004
1531 1513
1532
1533#define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4 1514#define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4
1534#define PCI_DEVICE_ID_AD1889JS 0x1889 1515#define PCI_DEVICE_ID_AD1889JS 0x1889
1535 1516
1536
1537#define PCI_DEVICE_ID_SEGA_BBA 0x1234 1517#define PCI_DEVICE_ID_SEGA_BBA 0x1234
1538 1518
1539#define PCI_VENDOR_ID_ZORAN 0x11de 1519#define PCI_VENDOR_ID_ZORAN 0x11de
1540#define PCI_DEVICE_ID_ZORAN_36057 0x6057 1520#define PCI_DEVICE_ID_ZORAN_36057 0x6057
1541#define PCI_DEVICE_ID_ZORAN_36120 0x6120 1521#define PCI_DEVICE_ID_ZORAN_36120 0x6120
1542 1522
1543
1544#define PCI_VENDOR_ID_COMPEX 0x11f6 1523#define PCI_VENDOR_ID_COMPEX 0x11f6
1545#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 1524#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112
1546 1525
@@ -1599,8 +1578,6 @@
1599#define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005 1578#define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005
1600#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009 1579#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009
1601 1580
1602
1603
1604#define PCI_VENDOR_ID_AVM 0x1244 1581#define PCI_VENDOR_ID_AVM 0x1244
1605#define PCI_DEVICE_ID_AVM_B1 0x0700 1582#define PCI_DEVICE_ID_AVM_B1 0x0700
1606#define PCI_DEVICE_ID_AVM_C4 0x0800 1583#define PCI_DEVICE_ID_AVM_C4 0x0800
@@ -1609,7 +1586,6 @@
1609#define PCI_DEVICE_ID_AVM_C2 0x1100 1586#define PCI_DEVICE_ID_AVM_C2 0x1100
1610#define PCI_DEVICE_ID_AVM_T1 0x1200 1587#define PCI_DEVICE_ID_AVM_T1 0x1200
1611 1588
1612
1613#define PCI_VENDOR_ID_STALLION 0x124d 1589#define PCI_VENDOR_ID_STALLION 0x124d
1614 1590
1615/* Allied Telesyn */ 1591/* Allied Telesyn */
@@ -1632,7 +1608,6 @@
1632#define PCI_VENDOR_ID_SATSAGEM 0x1267 1608#define PCI_VENDOR_ID_SATSAGEM 0x1267
1633#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016 1609#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016
1634 1610
1635
1636#define PCI_VENDOR_ID_ENSONIQ 0x1274 1611#define PCI_VENDOR_ID_ENSONIQ 0x1274
1637#define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880 1612#define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880
1638#define PCI_DEVICE_ID_ENSONIQ_ES1370 0x5000 1613#define PCI_DEVICE_ID_ENSONIQ_ES1370 0x5000
@@ -1655,7 +1630,6 @@
1655 1630
1656#define PCI_VENDOR_ID_ALTEON 0x12ae 1631#define PCI_VENDOR_ID_ALTEON 0x12ae
1657 1632
1658
1659#define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4 1633#define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4
1660#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001 1634#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001
1661#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232 0x0002 1635#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232 0x0002
@@ -1686,7 +1660,6 @@
1686#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485 0x0331 1660#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485 0x0331
1687#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485 0x0332 1661#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485 0x0332
1688 1662
1689
1690#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2 1663#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2
1691#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018 1664#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018
1692 1665
@@ -1796,7 +1769,6 @@
1796#define PCI_DEVICE_ID_LMC_SSI 0x0005 1769#define PCI_DEVICE_ID_LMC_SSI 0x0005
1797#define PCI_DEVICE_ID_LMC_T1 0x0006 1770#define PCI_DEVICE_ID_LMC_T1 0x0006
1798 1771
1799
1800#define PCI_VENDOR_ID_NETGEAR 0x1385 1772#define PCI_VENDOR_ID_NETGEAR 0x1385
1801#define PCI_DEVICE_ID_NETGEAR_GA620 0x620a 1773#define PCI_DEVICE_ID_NETGEAR_GA620 0x620a
1802 1774
@@ -1899,6 +1871,8 @@
1899#define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521 1871#define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521
1900#define PCI_DEVICE_ID_OXSEMI_16PCI952PP 0x9523 1872#define PCI_DEVICE_ID_OXSEMI_16PCI952PP 0x9523
1901 1873
1874#define PCI_VENDOR_ID_CHELSIO 0x1425
1875
1902#define PCI_VENDOR_ID_SAMSUNG 0x144d 1876#define PCI_VENDOR_ID_SAMSUNG 0x144d
1903 1877
1904#define PCI_VENDOR_ID_MYRICOM 0x14c1 1878#define PCI_VENDOR_ID_MYRICOM 0x14c1
@@ -1997,6 +1971,7 @@
1997 1971
1998#define PCI_VENDOR_ID_ENE 0x1524 1972#define PCI_VENDOR_ID_ENE 0x1524
1999#define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 1973#define PCI_DEVICE_ID_ENE_CB712_SD 0x0550
1974#define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551
2000#define PCI_DEVICE_ID_ENE_1211 0x1211 1975#define PCI_DEVICE_ID_ENE_1211 0x1211
2001#define PCI_DEVICE_ID_ENE_1225 0x1225 1976#define PCI_DEVICE_ID_ENE_1225 0x1225
2002#define PCI_DEVICE_ID_ENE_1410 0x1410 1977#define PCI_DEVICE_ID_ENE_1410 0x1410
@@ -2006,13 +1981,10 @@
2006#define PCI_DEVICE_ID_ENE_720 0x1421 1981#define PCI_DEVICE_ID_ENE_720 0x1421
2007#define PCI_DEVICE_ID_ENE_722 0x1422 1982#define PCI_DEVICE_ID_ENE_722 0x1422
2008 1983
2009#define PCI_VENDOR_ID_CHELSIO 0x1425
2010
2011#define PCI_SUBVENDOR_ID_PERLE 0x155f 1984#define PCI_SUBVENDOR_ID_PERLE 0x155f
2012#define PCI_SUBDEVICE_ID_PCI_RAS4 0xf001 1985#define PCI_SUBDEVICE_ID_PCI_RAS4 0xf001
2013#define PCI_SUBDEVICE_ID_PCI_RAS8 0xf010 1986#define PCI_SUBDEVICE_ID_PCI_RAS8 0xf010
2014 1987
2015
2016#define PCI_VENDOR_ID_SYBA 0x1592 1988#define PCI_VENDOR_ID_SYBA 0x1592
2017#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 1989#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782
2018#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783 1990#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783
@@ -2031,8 +2003,10 @@
2031#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c 2003#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c
2032#define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 2004#define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274
2033 2005
2034#define PCI_VENDOR_ID_PDC 0x15e9 2006#define PCI_VENDOR_ID_QUICKNET 0x15e2
2007#define PCI_DEVICE_ID_QUICKNET_XJ 0x0500
2035 2008
2009#define PCI_VENDOR_ID_PDC 0x15e9
2036 2010
2037#define PCI_VENDOR_ID_FARSITE 0x1619 2011#define PCI_VENDOR_ID_FARSITE 0x1619
2038#define PCI_DEVICE_ID_FARSITE_T2P 0x0400 2012#define PCI_DEVICE_ID_FARSITE_T2P 0x0400
@@ -2049,6 +2023,8 @@
2049#define PCI_DEVICE_ID_BCM1250_PCI 0x0001 2023#define PCI_DEVICE_ID_BCM1250_PCI 0x0001
2050#define PCI_DEVICE_ID_BCM1250_HT 0x0002 2024#define PCI_DEVICE_ID_BCM1250_HT 0x0002
2051 2025
2026#define PCI_VENDOR_ID_ATHEROS 0x168c
2027
2052#define PCI_VENDOR_ID_NETCELL 0x169c 2028#define PCI_VENDOR_ID_NETCELL 0x169c
2053#define PCI_DEVICE_ID_REVOLUTION 0x0044 2029#define PCI_DEVICE_ID_REVOLUTION 0x0044
2054 2030
@@ -2087,7 +2063,6 @@
2087#define PCI_DEVICE_ID_HERC_WIN 0x5732 2063#define PCI_DEVICE_ID_HERC_WIN 0x5732
2088#define PCI_DEVICE_ID_HERC_UNI 0x5832 2064#define PCI_DEVICE_ID_HERC_UNI 0x5832
2089 2065
2090
2091#define PCI_VENDOR_ID_SITECOM 0x182d 2066#define PCI_VENDOR_ID_SITECOM 0x182d
2092#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 2067#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069
2093 2068
@@ -2123,12 +2098,9 @@
2123#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 2098#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007
2124#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 2099#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009
2125 2100
2126
2127#define PCI_VENDOR_ID_AKS 0x416c 2101#define PCI_VENDOR_ID_AKS 0x416c
2128#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 2102#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100
2129 2103
2130
2131
2132#define PCI_VENDOR_ID_S3 0x5333 2104#define PCI_VENDOR_ID_S3 0x5333
2133#define PCI_DEVICE_ID_S3_TRIO 0x8811 2105#define PCI_DEVICE_ID_S3_TRIO 0x8811
2134#define PCI_DEVICE_ID_S3_868 0x8880 2106#define PCI_DEVICE_ID_S3_868 0x8880
@@ -2140,7 +2112,6 @@
2140#define PCI_VENDOR_ID_DUNORD 0x5544 2112#define PCI_VENDOR_ID_DUNORD 0x5544
2141#define PCI_DEVICE_ID_DUNORD_I3000 0x0001 2113#define PCI_DEVICE_ID_DUNORD_I3000 0x0001
2142 2114
2143
2144#define PCI_VENDOR_ID_DCI 0x6666 2115#define PCI_VENDOR_ID_DCI 0x6666
2145#define PCI_DEVICE_ID_DCI_PCCOM4 0x0001 2116#define PCI_DEVICE_ID_DCI_PCCOM4 0x0001
2146#define PCI_DEVICE_ID_DCI_PCCOM8 0x0002 2117#define PCI_DEVICE_ID_DCI_PCCOM8 0x0002
@@ -2240,6 +2211,7 @@
2240#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 2211#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592
2241#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 2212#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770
2242#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772 2213#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772
2214#define PCI_DEVICE_ID_INTEL_3000_HB 0x2778
2243#define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0 2215#define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0
2244#define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2 2216#define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2
2245#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 2217#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640
@@ -2384,7 +2356,6 @@
2384#define PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN 0x0500 2356#define PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN 0x0500
2385#define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503 2357#define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503
2386 2358
2387
2388#define PCI_VENDOR_ID_HOLTEK 0x9412 2359#define PCI_VENDOR_ID_HOLTEK 0x9412
2389#define PCI_DEVICE_ID_HOLTEK_6565 0x6565 2360#define PCI_DEVICE_ID_HOLTEK_6565 0x6565
2390 2361
@@ -2400,6 +2371,8 @@
2400#define PCI_DEVICE_ID_NETMOS_9845 0x9845 2371#define PCI_DEVICE_ID_NETMOS_9845 0x9845
2401#define PCI_DEVICE_ID_NETMOS_9855 0x9855 2372#define PCI_DEVICE_ID_NETMOS_9855 0x9855
2402 2373
2374#define PCI_VENDOR_ID_3COM_2 0xa727
2375
2403#define PCI_SUBVENDOR_ID_EXSYS 0xd84d 2376#define PCI_SUBVENDOR_ID_EXSYS 0xd84d
2404#define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014 2377#define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014
2405#define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055 2378#define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055
@@ -2408,13 +2381,7 @@
2408#define PCI_DEVICE_ID_TIGERJET_300 0x0001 2381#define PCI_DEVICE_ID_TIGERJET_300 0x0001
2409#define PCI_DEVICE_ID_TIGERJET_100 0x0002 2382#define PCI_DEVICE_ID_TIGERJET_100 0x0002
2410 2383
2411#define PCI_VENDOR_ID_TTTECH 0x0357
2412#define PCI_DEVICE_ID_TTTECH_MC322 0x000A
2413
2414#define PCI_VENDOR_ID_XILINX_RME 0xea60 2384#define PCI_VENDOR_ID_XILINX_RME 0xea60
2415#define PCI_DEVICE_ID_RME_DIGI32 0x9896 2385#define PCI_DEVICE_ID_RME_DIGI32 0x9896
2416#define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 2386#define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897
2417#define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 2387#define PCI_DEVICE_ID_RME_DIGI32_8 0x9898
2418
2419#define PCI_VENDOR_ID_QUICKNET 0x15E2
2420#define PCI_DEVICE_ID_QUICKNET_XJ 0x0500
diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h
new file mode 100644
index 000000000000..1375f15797e7
--- /dev/null
+++ b/include/linux/pda_power.h
@@ -0,0 +1,31 @@
1/*
2 * Common power driver for PDAs and phones with one or two external
3 * power supplies (AC/USB) connected to main and backup batteries,
4 * and optional builtin charger.
5 *
6 * Copyright © 2007 Anton Vorontsov <cbou@mail.ru>
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 __PDA_POWER_H__
14#define __PDA_POWER_H__
15
16#define PDA_POWER_CHARGE_AC (1 << 0)
17#define PDA_POWER_CHARGE_USB (1 << 1)
18
19struct pda_power_pdata {
20 int (*is_ac_online)(void);
21 int (*is_usb_online)(void);
22 void (*set_charge)(int flags);
23
24 char **supplied_to;
25 size_t num_supplicants;
26
27 unsigned int wait_for_status; /* msecs, default is 500 */
28 unsigned int wait_for_charger; /* msecs, default is 500 */
29};
30
31#endif /* __PDA_POWER_H__ */
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index b72be2f79e6a..926adaae0f96 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -1,7 +1,7 @@
1#ifndef __LINUX_PERCPU_H 1#ifndef __LINUX_PERCPU_H
2#define __LINUX_PERCPU_H 2#define __LINUX_PERCPU_H
3 3
4#include <linux/spinlock.h> /* For preempt_disable() */ 4#include <linux/preempt.h>
5#include <linux/slab.h> /* For kmalloc() */ 5#include <linux/slab.h> /* For kmalloc() */
6#include <linux/smp.h> 6#include <linux/smp.h>
7#include <linux/string.h> /* For memset() */ 7#include <linux/string.h> /* For memset() */
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index f5aa593ccf32..3d9f70972cdf 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -8,6 +8,7 @@
8 8
9#include <linux/spinlock.h> 9#include <linux/spinlock.h>
10#include <linux/smp.h> 10#include <linux/smp.h>
11#include <linux/list.h>
11#include <linux/threads.h> 12#include <linux/threads.h>
12#include <linux/percpu.h> 13#include <linux/percpu.h>
13#include <linux/types.h> 14#include <linux/types.h>
@@ -17,6 +18,9 @@
17struct percpu_counter { 18struct percpu_counter {
18 spinlock_t lock; 19 spinlock_t lock;
19 s64 count; 20 s64 count;
21#ifdef CONFIG_HOTPLUG_CPU
22 struct list_head list; /* All percpu_counters are on a list */
23#endif
20 s32 *counters; 24 s32 *counters;
21}; 25};
22 26
@@ -26,18 +30,8 @@ struct percpu_counter {
26#define FBC_BATCH (NR_CPUS*4) 30#define FBC_BATCH (NR_CPUS*4)
27#endif 31#endif
28 32
29static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount) 33void percpu_counter_init(struct percpu_counter *fbc, s64 amount);
30{ 34void percpu_counter_destroy(struct percpu_counter *fbc);
31 spin_lock_init(&fbc->lock);
32 fbc->count = amount;
33 fbc->counters = alloc_percpu(s32);
34}
35
36static inline void percpu_counter_destroy(struct percpu_counter *fbc)
37{
38 free_percpu(fbc->counters);
39}
40
41void percpu_counter_mod(struct percpu_counter *fbc, s32 amount); 35void percpu_counter_mod(struct percpu_counter *fbc, s32 amount);
42s64 percpu_counter_sum(struct percpu_counter *fbc); 36s64 percpu_counter_sum(struct percpu_counter *fbc);
43 37
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index 169c6c24209b..b9a17e08ff0f 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -29,7 +29,7 @@ static inline void get_pid_ns(struct pid_namespace *ns)
29 kref_get(&ns->kref); 29 kref_get(&ns->kref);
30} 30}
31 31
32extern struct pid_namespace *copy_pid_ns(int flags, struct pid_namespace *ns); 32extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns);
33extern void free_pid_ns(struct kref *kref); 33extern void free_pid_ns(struct kref *kref);
34 34
35static inline void put_pid_ns(struct pid_namespace *ns) 35static inline void put_pid_ns(struct pid_namespace *ns)
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 8bcbc54e1b48..8e4120285f72 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -9,48 +9,125 @@
9#define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */ 9#define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */
10#define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */ 10#define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */
11 11
12/**
13 * struct pipe_buffer - a linux kernel pipe buffer
14 * @page: the page containing the data for the pipe buffer
15 * @offset: offset of data inside the @page
16 * @len: length of data inside the @page
17 * @ops: operations associated with this buffer. See @pipe_buf_operations.
18 * @flags: pipe buffer flags. See above.
19 * @private: private data owned by the ops.
20 **/
12struct pipe_buffer { 21struct pipe_buffer {
13 struct page *page; 22 struct page *page;
14 unsigned int offset, len; 23 unsigned int offset, len;
15 const struct pipe_buf_operations *ops; 24 const struct pipe_buf_operations *ops;
16 unsigned int flags; 25 unsigned int flags;
26 unsigned long private;
27};
28
29/**
30 * struct pipe_inode_info - a linux kernel pipe
31 * @wait: reader/writer wait point in case of empty/full pipe
32 * @nrbufs: the number of non-empty pipe buffers in this pipe
33 * @curbuf: the current pipe buffer entry
34 * @tmp_page: cached released page
35 * @readers: number of current readers of this pipe
36 * @writers: number of current writers of this pipe
37 * @waiting_writers: number of writers blocked waiting for room
38 * @r_counter: reader counter
39 * @w_counter: writer counter
40 * @fasync_readers: reader side fasync
41 * @fasync_writers: writer side fasync
42 * @inode: inode this pipe is attached to
43 * @bufs: the circular array of pipe buffers
44 **/
45struct pipe_inode_info {
46 wait_queue_head_t wait;
47 unsigned int nrbufs, curbuf;
48 struct page *tmp_page;
49 unsigned int readers;
50 unsigned int writers;
51 unsigned int waiting_writers;
52 unsigned int r_counter;
53 unsigned int w_counter;
54 struct fasync_struct *fasync_readers;
55 struct fasync_struct *fasync_writers;
56 struct inode *inode;
57 struct pipe_buffer bufs[PIPE_BUFFERS];
17}; 58};
18 59
19/* 60/*
20 * Note on the nesting of these functions: 61 * Note on the nesting of these functions:
21 * 62 *
22 * ->pin() 63 * ->confirm()
23 * ->steal() 64 * ->steal()
24 * ... 65 * ...
25 * ->map() 66 * ->map()
26 * ... 67 * ...
27 * ->unmap() 68 * ->unmap()
28 * 69 *
29 * That is, ->map() must be called on a pinned buffer, same goes for ->steal(). 70 * That is, ->map() must be called on a confirmed buffer,
71 * same goes for ->steal(). See below for the meaning of each
72 * operation. Also see kerneldoc in fs/pipe.c for the pipe
73 * and generic variants of these hooks.
30 */ 74 */
31struct pipe_buf_operations { 75struct pipe_buf_operations {
76 /*
77 * This is set to 1, if the generic pipe read/write may coalesce
78 * data into an existing buffer. If this is set to 0, a new pipe
79 * page segment is always used for new data.
80 */
32 int can_merge; 81 int can_merge;
82
83 /*
84 * ->map() returns a virtual address mapping of the pipe buffer.
85 * The last integer flag reflects whether this should be an atomic
86 * mapping or not. The atomic map is faster, however you can't take
87 * page faults before calling ->unmap() again. So if you need to eg
88 * access user data through copy_to/from_user(), then you must get
89 * a non-atomic map. ->map() uses the KM_USER0 atomic slot for
90 * atomic maps, so you can't map more than one pipe_buffer at once
91 * and you have to be careful if mapping another page as source
92 * or destination for a copy (IOW, it has to use something else
93 * than KM_USER0).
94 */
33 void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int); 95 void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int);
96
97 /*
98 * Undoes ->map(), finishes the virtual mapping of the pipe buffer.
99 */
34 void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *); 100 void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *);
35 int (*pin)(struct pipe_inode_info *, struct pipe_buffer *); 101
102 /*
103 * ->confirm() verifies that the data in the pipe buffer is there
104 * and that the contents are good. If the pages in the pipe belong
105 * to a file system, we may need to wait for IO completion in this
106 * hook. Returns 0 for good, or a negative error value in case of
107 * error.
108 */
109 int (*confirm)(struct pipe_inode_info *, struct pipe_buffer *);
110
111 /*
112 * When the contents of this pipe buffer has been completely
113 * consumed by a reader, ->release() is called.
114 */
36 void (*release)(struct pipe_inode_info *, struct pipe_buffer *); 115 void (*release)(struct pipe_inode_info *, struct pipe_buffer *);
116
117 /*
118 * Attempt to take ownership of the pipe buffer and its contents.
119 * ->steal() returns 0 for success, in which case the contents
120 * of the pipe (the buf->page) is locked and now completely owned
121 * by the caller. The page may then be transferred to a different
122 * mapping, the most often used case is insertion into different
123 * file address space cache.
124 */
37 int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); 125 int (*steal)(struct pipe_inode_info *, struct pipe_buffer *);
38 void (*get)(struct pipe_inode_info *, struct pipe_buffer *);
39};
40 126
41struct pipe_inode_info { 127 /*
42 wait_queue_head_t wait; 128 * Get a reference to the pipe buffer.
43 unsigned int nrbufs, curbuf; 129 */
44 struct page *tmp_page; 130 void (*get)(struct pipe_inode_info *, struct pipe_buffer *);
45 unsigned int readers;
46 unsigned int writers;
47 unsigned int waiting_writers;
48 unsigned int r_counter;
49 unsigned int w_counter;
50 struct fasync_struct *fasync_readers;
51 struct fasync_struct *fasync_writers;
52 struct inode *inode;
53 struct pipe_buffer bufs[PIPE_BUFFERS];
54}; 131};
55 132
56/* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual 133/* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual
@@ -68,39 +145,7 @@ void __free_pipe_info(struct pipe_inode_info *);
68void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int); 145void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int);
69void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *); 146void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *);
70void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); 147void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
71int generic_pipe_buf_pin(struct pipe_inode_info *, struct pipe_buffer *); 148int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
72int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); 149int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
73 150
74/*
75 * splice is tied to pipes as a transport (at least for now), so we'll just
76 * add the splice flags here.
77 */
78#define SPLICE_F_MOVE (0x01) /* move pages instead of copying */
79#define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */
80 /* we may still block on the fd we splice */
81 /* from/to, of course */
82#define SPLICE_F_MORE (0x04) /* expect more data */
83#define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */
84
85/*
86 * Passed to the actors
87 */
88struct splice_desc {
89 unsigned int len, total_len; /* current and remaining length */
90 unsigned int flags; /* splice flags */
91 struct file *file; /* file to read/write */
92 loff_t pos; /* file position */
93};
94
95typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,
96 struct splice_desc *);
97
98extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *,
99 loff_t *, size_t, unsigned int,
100 splice_actor *);
101
102extern ssize_t __splice_from_pipe(struct pipe_inode_info *, struct file *,
103 loff_t *, size_t, unsigned int,
104 splice_actor *);
105
106#endif 151#endif
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index c3f01b3085a4..30b8571e6b34 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -403,16 +403,13 @@ enum
403 * 1..32767 Reserved for ematches inside kernel tree 403 * 1..32767 Reserved for ematches inside kernel tree
404 * 32768..65535 Free to use, not reliable 404 * 32768..65535 Free to use, not reliable
405 */ 405 */
406enum 406#define TCF_EM_CONTAINER 0
407{ 407#define TCF_EM_CMP 1
408 TCF_EM_CONTAINER, 408#define TCF_EM_NBYTE 2
409 TCF_EM_CMP, 409#define TCF_EM_U32 3
410 TCF_EM_NBYTE, 410#define TCF_EM_META 4
411 TCF_EM_U32, 411#define TCF_EM_TEXT 5
412 TCF_EM_META, 412#define TCF_EM_MAX 5
413 TCF_EM_TEXT,
414 __TCF_EM_MAX
415};
416 413
417enum 414enum
418{ 415{
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index d10f35338507..268c51599eb8 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -101,6 +101,15 @@ struct tc_prio_qopt
101 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ 101 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
102}; 102};
103 103
104enum
105{
106 TCA_PRIO_UNSPEC,
107 TCA_PRIO_MQ,
108 __TCA_PRIO_MAX
109};
110
111#define TCA_PRIO_MAX (__TCA_PRIO_MAX - 1)
112
104/* TBF section */ 113/* TBF section */
105 114
106struct tc_tbf_qopt 115struct tc_tbf_qopt
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 87545e0f0b58..ad3cc2eb0d34 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -101,6 +101,7 @@ struct pm_dev
101 */ 101 */
102extern void (*pm_idle)(void); 102extern void (*pm_idle)(void);
103extern void (*pm_power_off)(void); 103extern void (*pm_power_off)(void);
104extern void (*pm_power_off_prepare)(void);
104 105
105typedef int __bitwise suspend_state_t; 106typedef int __bitwise suspend_state_t;
106 107
@@ -110,37 +111,67 @@ typedef int __bitwise suspend_state_t;
110#define PM_SUSPEND_MAX ((__force suspend_state_t) 4) 111#define PM_SUSPEND_MAX ((__force suspend_state_t) 4)
111 112
112/** 113/**
113 * struct pm_ops - Callbacks for managing platform dependent suspend states. 114 * struct pm_ops - Callbacks for managing platform dependent system sleep
114 * @valid: Callback to determine whether the given state can be entered. 115 * states.
115 * Valid states are advertised in /sys/power/state but can still
116 * be rejected by prepare or enter if the conditions aren't right.
117 * There is a %pm_valid_only_mem function available that can be assigned
118 * to this if you only implement mem sleep.
119 * 116 *
120 * @prepare: Prepare the platform for the given suspend state. Can return a 117 * @valid: Callback to determine if given system sleep state is supported by
121 * negative error code if necessary. 118 * the platform.
119 * Valid (ie. supported) states are advertised in /sys/power/state. Note
120 * that it still may be impossible to enter given system sleep state if the
121 * conditions aren't right.
122 * There is the %pm_valid_only_mem function available that can be assigned
123 * to this if the platform only supports mem sleep.
122 * 124 *
123 * @enter: Enter the given suspend state, must be assigned. Can return a 125 * @set_target: Tell the platform which system sleep state is going to be
124 * negative error code if necessary. 126 * entered.
127 * @set_target() is executed right prior to suspending devices. The
128 * information conveyed to the platform code by @set_target() should be
129 * disregarded by the platform as soon as @finish() is executed and if
130 * @prepare() fails. If @set_target() fails (ie. returns nonzero),
131 * @prepare(), @enter() and @finish() will not be called by the PM core.
132 * This callback is optional. However, if it is implemented, the argument
133 * passed to @prepare(), @enter() and @finish() is meaningless and should
134 * be ignored.
125 * 135 *
126 * @finish: Called when the system has left the given state and all devices 136 * @prepare: Prepare the platform for entering the system sleep state indicated
127 * are resumed. The return value is ignored. 137 * by @set_target() or represented by the argument if @set_target() is not
138 * implemented.
139 * @prepare() is called right after devices have been suspended (ie. the
140 * appropriate .suspend() method has been executed for each device) and
141 * before the nonboot CPUs are disabled (it is executed with IRQs enabled).
142 * This callback is optional. It returns 0 on success or a negative
143 * error code otherwise, in which case the system cannot enter the desired
144 * sleep state (@enter() and @finish() will not be called in that case).
145 *
146 * @enter: Enter the system sleep state indicated by @set_target() or
147 * represented by the argument if @set_target() is not implemented.
148 * This callback is mandatory. It returns 0 on success or a negative
149 * error code otherwise, in which case the system cannot enter the desired
150 * sleep state.
151 *
152 * @finish: Called when the system has just left a sleep state, right after
153 * the nonboot CPUs have been enabled and before devices are resumed (it is
154 * executed with IRQs enabled). If @set_target() is not implemented, the
155 * argument represents the sleep state being left.
156 * This callback is optional, but should be implemented by the platforms
157 * that implement @prepare(). If implemented, it is always called after
158 * @enter() (even if @enter() fails).
128 */ 159 */
129struct pm_ops { 160struct pm_ops {
130 int (*valid)(suspend_state_t state); 161 int (*valid)(suspend_state_t state);
162 int (*set_target)(suspend_state_t state);
131 int (*prepare)(suspend_state_t state); 163 int (*prepare)(suspend_state_t state);
132 int (*enter)(suspend_state_t state); 164 int (*enter)(suspend_state_t state);
133 int (*finish)(suspend_state_t state); 165 int (*finish)(suspend_state_t state);
134}; 166};
135 167
168extern struct pm_ops *pm_ops;
169
136/** 170/**
137 * pm_set_ops - set platform dependent power management ops 171 * pm_set_ops - set platform dependent power management ops
138 * @pm_ops: The new power management operations to set. 172 * @pm_ops: The new power management operations to set.
139 */ 173 */
140extern void pm_set_ops(struct pm_ops *pm_ops); 174extern void pm_set_ops(struct pm_ops *pm_ops);
141extern struct pm_ops *pm_ops;
142extern int pm_suspend(suspend_state_t state);
143
144extern int pm_valid_only_mem(suspend_state_t state); 175extern int pm_valid_only_mem(suspend_state_t state);
145 176
146/** 177/**
@@ -161,6 +192,8 @@ extern void arch_suspend_disable_irqs(void);
161 */ 192 */
162extern void arch_suspend_enable_irqs(void); 193extern void arch_suspend_enable_irqs(void);
163 194
195extern int pm_suspend(suspend_state_t state);
196
164/* 197/*
165 * Device power management 198 * Device power management
166 */ 199 */
@@ -235,15 +268,10 @@ struct dev_pm_info {
235 unsigned can_wakeup:1; 268 unsigned can_wakeup:1;
236#ifdef CONFIG_PM 269#ifdef CONFIG_PM
237 unsigned should_wakeup:1; 270 unsigned should_wakeup:1;
238 pm_message_t prev_state;
239 void * saved_state;
240 struct device * pm_parent;
241 struct list_head entry; 271 struct list_head entry;
242#endif 272#endif
243}; 273};
244 274
245extern void device_pm_set_parent(struct device * dev, struct device * parent);
246
247extern int device_power_down(pm_message_t state); 275extern int device_power_down(pm_message_t state);
248extern void device_power_up(void); 276extern void device_power_up(void);
249extern void device_resume(void); 277extern void device_resume(void);
@@ -257,8 +285,6 @@ extern int device_prepare_suspend(pm_message_t state);
257#define device_may_wakeup(dev) \ 285#define device_may_wakeup(dev) \
258 (device_can_wakeup(dev) && (dev)->power.should_wakeup) 286 (device_can_wakeup(dev) && (dev)->power.should_wakeup)
259 287
260extern int dpm_runtime_suspend(struct device *, pm_message_t);
261extern void dpm_runtime_resume(struct device *);
262extern void __suspend_report_result(const char *function, void *fn, int ret); 288extern void __suspend_report_result(const char *function, void *fn, int ret);
263 289
264#define suspend_report_result(fn, ret) \ 290#define suspend_report_result(fn, ret) \
@@ -290,15 +316,6 @@ static inline int device_suspend(pm_message_t state)
290#define device_set_wakeup_enable(dev,val) do{}while(0) 316#define device_set_wakeup_enable(dev,val) do{}while(0)
291#define device_may_wakeup(dev) (0) 317#define device_may_wakeup(dev) (0)
292 318
293static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state)
294{
295 return 0;
296}
297
298static inline void dpm_runtime_resume(struct device * dev)
299{
300}
301
302#define suspend_report_result(fn, ret) do { } while (0) 319#define suspend_report_result(fn, ret) do { } while (0)
303 320
304static inline int call_platform_enable_wakeup(struct device *dev, int is_on) 321static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
new file mode 100644
index 000000000000..606c0957997f
--- /dev/null
+++ b/include/linux/power_supply.h
@@ -0,0 +1,180 @@
1/*
2 * Universal power supply monitor class
3 *
4 * Copyright © 2007 Anton Vorontsov <cbou@mail.ru>
5 * Copyright © 2004 Szabolcs Gyurko
6 * Copyright © 2003 Ian Molton <spyro@f2s.com>
7 *
8 * Modified: 2004, Oct Szabolcs Gyurko
9 *
10 * You may use this code as per GPL version 2
11 */
12
13#ifndef __LINUX_POWER_SUPPLY_H__
14#define __LINUX_POWER_SUPPLY_H__
15
16#include <linux/device.h>
17#include <linux/workqueue.h>
18#include <linux/leds.h>
19
20/*
21 * All voltages, currents, charges, energies, time and temperatures in uV,
22 * µA, µAh, µWh, seconds and tenths of degree Celsius unless otherwise
23 * stated. It's driver's job to convert its raw values to units in which
24 * this class operates.
25 */
26
27/*
28 * For systems where the charger determines the maximum battery capacity
29 * the min and max fields should be used to present these values to user
30 * space. Unused/unknown fields will not appear in sysfs.
31 */
32
33enum {
34 POWER_SUPPLY_STATUS_UNKNOWN = 0,
35 POWER_SUPPLY_STATUS_CHARGING,
36 POWER_SUPPLY_STATUS_DISCHARGING,
37 POWER_SUPPLY_STATUS_NOT_CHARGING,
38 POWER_SUPPLY_STATUS_FULL,
39};
40
41enum {
42 POWER_SUPPLY_HEALTH_UNKNOWN = 0,
43 POWER_SUPPLY_HEALTH_GOOD,
44 POWER_SUPPLY_HEALTH_OVERHEAT,
45 POWER_SUPPLY_HEALTH_DEAD,
46 POWER_SUPPLY_HEALTH_OVERVOLTAGE,
47 POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,
48};
49
50enum {
51 POWER_SUPPLY_TECHNOLOGY_UNKNOWN = 0,
52 POWER_SUPPLY_TECHNOLOGY_NiMH,
53 POWER_SUPPLY_TECHNOLOGY_LION,
54 POWER_SUPPLY_TECHNOLOGY_LIPO,
55 POWER_SUPPLY_TECHNOLOGY_LiFe,
56 POWER_SUPPLY_TECHNOLOGY_NiCd,
57};
58
59enum {
60 POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN = 0,
61 POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL,
62 POWER_SUPPLY_CAPACITY_LEVEL_LOW,
63 POWER_SUPPLY_CAPACITY_LEVEL_NORMAL,
64 POWER_SUPPLY_CAPACITY_LEVEL_HIGH,
65 POWER_SUPPLY_CAPACITY_LEVEL_FULL,
66};
67
68enum power_supply_property {
69 /* Properties of type `int' */
70 POWER_SUPPLY_PROP_STATUS = 0,
71 POWER_SUPPLY_PROP_HEALTH,
72 POWER_SUPPLY_PROP_PRESENT,
73 POWER_SUPPLY_PROP_ONLINE,
74 POWER_SUPPLY_PROP_TECHNOLOGY,
75 POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
76 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
77 POWER_SUPPLY_PROP_VOLTAGE_NOW,
78 POWER_SUPPLY_PROP_VOLTAGE_AVG,
79 POWER_SUPPLY_PROP_CURRENT_NOW,
80 POWER_SUPPLY_PROP_CURRENT_AVG,
81 POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
82 POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN,
83 POWER_SUPPLY_PROP_CHARGE_FULL,
84 POWER_SUPPLY_PROP_CHARGE_EMPTY,
85 POWER_SUPPLY_PROP_CHARGE_NOW,
86 POWER_SUPPLY_PROP_CHARGE_AVG,
87 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
88 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
89 POWER_SUPPLY_PROP_ENERGY_FULL,
90 POWER_SUPPLY_PROP_ENERGY_EMPTY,
91 POWER_SUPPLY_PROP_ENERGY_NOW,
92 POWER_SUPPLY_PROP_ENERGY_AVG,
93 POWER_SUPPLY_PROP_CAPACITY, /* in percents! */
94 POWER_SUPPLY_PROP_CAPACITY_LEVEL,
95 POWER_SUPPLY_PROP_TEMP,
96 POWER_SUPPLY_PROP_TEMP_AMBIENT,
97 POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
98 POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG,
99 POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
100 POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
101 /* Properties of type `const char *' */
102 POWER_SUPPLY_PROP_MODEL_NAME,
103 POWER_SUPPLY_PROP_MANUFACTURER,
104};
105
106enum power_supply_type {
107 POWER_SUPPLY_TYPE_BATTERY = 0,
108 POWER_SUPPLY_TYPE_UPS,
109 POWER_SUPPLY_TYPE_MAINS,
110 POWER_SUPPLY_TYPE_USB,
111};
112
113union power_supply_propval {
114 int intval;
115 const char *strval;
116};
117
118struct power_supply {
119 const char *name;
120 enum power_supply_type type;
121 enum power_supply_property *properties;
122 size_t num_properties;
123
124 char **supplied_to;
125 size_t num_supplicants;
126
127 int (*get_property)(struct power_supply *psy,
128 enum power_supply_property psp,
129 union power_supply_propval *val);
130 void (*external_power_changed)(struct power_supply *psy);
131
132 /* For APM emulation, think legacy userspace. */
133 int use_for_apm;
134
135 /* private */
136 struct device *dev;
137 struct work_struct changed_work;
138
139#ifdef CONFIG_LEDS_TRIGGERS
140 struct led_trigger *charging_full_trig;
141 char *charging_full_trig_name;
142 struct led_trigger *charging_trig;
143 char *charging_trig_name;
144 struct led_trigger *full_trig;
145 char *full_trig_name;
146 struct led_trigger *online_trig;
147 char *online_trig_name;
148#endif
149};
150
151/*
152 * This is recommended structure to specify static power supply parameters.
153 * Generic one, parametrizable for different power supplies. Power supply
154 * class itself does not use it, but that's what implementing most platform
155 * drivers, should try reuse for consistency.
156 */
157
158struct power_supply_info {
159 const char *name;
160 int technology;
161 int voltage_max_design;
162 int voltage_min_design;
163 int charge_full_design;
164 int charge_empty_design;
165 int energy_full_design;
166 int energy_empty_design;
167 int use_for_apm;
168};
169
170extern void power_supply_changed(struct power_supply *psy);
171extern int power_supply_am_i_supplied(struct power_supply *psy);
172
173extern int power_supply_register(struct device *parent,
174 struct power_supply *psy);
175extern void power_supply_unregister(struct power_supply *psy);
176
177/* For APM emulation, think legacy userspace. */
178extern struct class *power_supply_class;
179
180#endif /* __LINUX_POWER_SUPPLY_H__ */
diff --git a/include/linux/prctl.h b/include/linux/prctl.h
index 52a9be41250d..e2eff9079fe9 100644
--- a/include/linux/prctl.h
+++ b/include/linux/prctl.h
@@ -59,4 +59,8 @@
59# define PR_ENDIAN_LITTLE 1 /* True little endian mode */ 59# define PR_ENDIAN_LITTLE 1 /* True little endian mode */
60# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */ 60# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */
61 61
62/* Get/set process seccomp mode */
63#define PR_GET_SECCOMP 21
64#define PR_SET_SECCOMP 22
65
62#endif /* _LINUX_PRCTL_H */ 66#endif /* _LINUX_PRCTL_H */
diff --git a/include/linux/prefetch.h b/include/linux/prefetch.h
index fc86f274147f..1adfe668d031 100644
--- a/include/linux/prefetch.h
+++ b/include/linux/prefetch.h
@@ -27,7 +27,7 @@
27 27
28 prefetch(x) - prefetches the cacheline at "x" for read 28 prefetch(x) - prefetches the cacheline at "x" for read
29 prefetchw(x) - prefetches the cacheline at "x" for write 29 prefetchw(x) - prefetches the cacheline at "x" for write
30 spin_lock_prefetch(x) - prefectches the spinlock *x for taking 30 spin_lock_prefetch(x) - prefetches the spinlock *x for taking
31 31
32 there is also PREFETCH_STRIDE which is the architecure-prefered 32 there is also PREFETCH_STRIDE which is the architecure-prefered
33 "lookahead" size for prefetching streamed operations. 33 "lookahead" size for prefetching streamed operations.
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 3469f96bc8b2..28e3664fdf1b 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -7,6 +7,8 @@
7#include <linux/magic.h> 7#include <linux/magic.h>
8#include <asm/atomic.h> 8#include <asm/atomic.h>
9 9
10struct completion;
11
10/* 12/*
11 * The proc filesystem constants/structures 13 * The proc filesystem constants/structures
12 */ 14 */
@@ -56,6 +58,14 @@ struct proc_dir_entry {
56 gid_t gid; 58 gid_t gid;
57 loff_t size; 59 loff_t size;
58 const struct inode_operations *proc_iops; 60 const struct inode_operations *proc_iops;
61 /*
62 * NULL ->proc_fops means "PDE is going away RSN" or
63 * "PDE is just created". In either case, e.g. ->read_proc won't be
64 * called because it's too late or too early, respectively.
65 *
66 * If you're allocating ->proc_fops dynamically, save a pointer
67 * somewhere.
68 */
59 const struct file_operations *proc_fops; 69 const struct file_operations *proc_fops;
60 get_info_t *get_info; 70 get_info_t *get_info;
61 struct module *owner; 71 struct module *owner;
@@ -66,6 +76,9 @@ struct proc_dir_entry {
66 atomic_t count; /* use count */ 76 atomic_t count; /* use count */
67 int deleted; /* delete flag */ 77 int deleted; /* delete flag */
68 void *set; 78 void *set;
79 int pde_users; /* number of callers into module in progress */
80 spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
81 struct completion *pde_unload_completion;
69}; 82};
70 83
71struct kcore_list { 84struct kcore_list {
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index eeb1976ef7bf..ae8146abd746 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -110,6 +110,8 @@ static inline void ptrace_unlink(struct task_struct *child)
110 __ptrace_unlink(child); 110 __ptrace_unlink(child);
111} 111}
112 112
113int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data);
114int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data);
113 115
114#ifndef force_successful_syscall_return 116#ifndef force_successful_syscall_return
115/* 117/*
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index dd5a05d03d4f..75e17a05540e 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -262,7 +262,7 @@ int bitmap_active(struct bitmap *bitmap);
262 262
263char *file_path(struct file *file, char *buf, int count); 263char *file_path(struct file *file, char *buf, int count);
264void bitmap_print_sb(struct bitmap *bitmap); 264void bitmap_print_sb(struct bitmap *bitmap);
265int bitmap_update_sb(struct bitmap *bitmap); 265void bitmap_update_sb(struct bitmap *bitmap);
266 266
267int bitmap_setallbits(struct bitmap *bitmap); 267int bitmap_setallbits(struct bitmap *bitmap);
268void bitmap_write_all(struct bitmap *bitmap); 268void bitmap_write_all(struct bitmap *bitmap);
@@ -278,8 +278,8 @@ int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int d
278void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); 278void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted);
279void bitmap_close_sync(struct bitmap *bitmap); 279void bitmap_close_sync(struct bitmap *bitmap);
280 280
281int bitmap_unplug(struct bitmap *bitmap); 281void bitmap_unplug(struct bitmap *bitmap);
282int bitmap_daemon_work(struct bitmap *bitmap); 282void bitmap_daemon_work(struct bitmap *bitmap);
283#endif 283#endif
284 284
285#endif 285#endif
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index de72c49747c8..28ac632b42dd 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -51,7 +51,7 @@ struct mdk_rdev_s
51 51
52 sector_t size; /* Device size (in blocks) */ 52 sector_t size; /* Device size (in blocks) */
53 mddev_t *mddev; /* RAID array if running */ 53 mddev_t *mddev; /* RAID array if running */
54 unsigned long last_events; /* IO event timestamp */ 54 long last_events; /* IO event timestamp */
55 55
56 struct block_device *bdev; /* block device handle */ 56 struct block_device *bdev; /* block device handle */
57 57
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
index d8286db60b96..93678f57ccbe 100644
--- a/include/linux/raid/raid5.h
+++ b/include/linux/raid/raid5.h
@@ -116,13 +116,46 @@
116 * attach a request to an active stripe (add_stripe_bh()) 116 * attach a request to an active stripe (add_stripe_bh())
117 * lockdev attach-buffer unlockdev 117 * lockdev attach-buffer unlockdev
118 * handle a stripe (handle_stripe()) 118 * handle a stripe (handle_stripe())
119 * lockstripe clrSTRIPE_HANDLE ... (lockdev check-buffers unlockdev) .. change-state .. record io needed unlockstripe schedule io 119 * lockstripe clrSTRIPE_HANDLE ...
120 * (lockdev check-buffers unlockdev) ..
121 * change-state ..
122 * record io/ops needed unlockstripe schedule io/ops
120 * release an active stripe (release_stripe()) 123 * release an active stripe (release_stripe())
121 * lockdev if (!--cnt) { if STRIPE_HANDLE, add to handle_list else add to inactive-list } unlockdev 124 * lockdev if (!--cnt) { if STRIPE_HANDLE, add to handle_list else add to inactive-list } unlockdev
122 * 125 *
123 * The refcount counts each thread that have activated the stripe, 126 * The refcount counts each thread that have activated the stripe,
124 * plus raid5d if it is handling it, plus one for each active request 127 * plus raid5d if it is handling it, plus one for each active request
125 * on a cached buffer. 128 * on a cached buffer, and plus one if the stripe is undergoing stripe
129 * operations.
130 *
131 * Stripe operations are performed outside the stripe lock,
132 * the stripe operations are:
133 * -copying data between the stripe cache and user application buffers
134 * -computing blocks to save a disk access, or to recover a missing block
135 * -updating the parity on a write operation (reconstruct write and
136 * read-modify-write)
137 * -checking parity correctness
138 * -running i/o to disk
139 * These operations are carried out by raid5_run_ops which uses the async_tx
140 * api to (optionally) offload operations to dedicated hardware engines.
141 * When requesting an operation handle_stripe sets the pending bit for the
142 * operation and increments the count. raid5_run_ops is then run whenever
143 * the count is non-zero.
144 * There are some critical dependencies between the operations that prevent some
145 * from being requested while another is in flight.
146 * 1/ Parity check operations destroy the in cache version of the parity block,
147 * so we prevent parity dependent operations like writes and compute_blocks
148 * from starting while a check is in progress. Some dma engines can perform
149 * the check without damaging the parity block, in these cases the parity
150 * block is re-marked up to date (assuming the check was successful) and is
151 * not re-read from disk.
152 * 2/ When a write operation is requested we immediately lock the affected
153 * blocks, and mark them as not up to date. This causes new read requests
154 * to be held off, as well as parity checks and compute block operations.
155 * 3/ Once a compute block operation has been requested handle_stripe treats
156 * that block as if it is up to date. raid5_run_ops guaruntees that any
157 * operation that is dependent on the compute block result is initiated after
158 * the compute block completes.
126 */ 159 */
127 160
128struct stripe_head { 161struct stripe_head {
@@ -136,15 +169,46 @@ struct stripe_head {
136 spinlock_t lock; 169 spinlock_t lock;
137 int bm_seq; /* sequence number for bitmap flushes */ 170 int bm_seq; /* sequence number for bitmap flushes */
138 int disks; /* disks in stripe */ 171 int disks; /* disks in stripe */
172 /* stripe_operations
173 * @pending - pending ops flags (set for request->issue->complete)
174 * @ack - submitted ops flags (set for issue->complete)
175 * @complete - completed ops flags (set for complete)
176 * @target - STRIPE_OP_COMPUTE_BLK target
177 * @count - raid5_runs_ops is set to run when this is non-zero
178 */
179 struct stripe_operations {
180 unsigned long pending;
181 unsigned long ack;
182 unsigned long complete;
183 int target;
184 int count;
185 u32 zero_sum_result;
186 } ops;
139 struct r5dev { 187 struct r5dev {
140 struct bio req; 188 struct bio req;
141 struct bio_vec vec; 189 struct bio_vec vec;
142 struct page *page; 190 struct page *page;
143 struct bio *toread, *towrite, *written; 191 struct bio *toread, *read, *towrite, *written;
144 sector_t sector; /* sector of this page */ 192 sector_t sector; /* sector of this page */
145 unsigned long flags; 193 unsigned long flags;
146 } dev[1]; /* allocated with extra space depending of RAID geometry */ 194 } dev[1]; /* allocated with extra space depending of RAID geometry */
147}; 195};
196
197/* stripe_head_state - collects and tracks the dynamic state of a stripe_head
198 * for handle_stripe. It is only valid under spin_lock(sh->lock);
199 */
200struct stripe_head_state {
201 int syncing, expanding, expanded;
202 int locked, uptodate, to_read, to_write, failed, written;
203 int to_fill, compute, req_compute, non_overwrite;
204 int failed_num;
205};
206
207/* r6_state - extra state data only relevant to r6 */
208struct r6_state {
209 int p_failed, q_failed, qd_idx, failed_num[2];
210};
211
148/* Flags */ 212/* Flags */
149#define R5_UPTODATE 0 /* page contains current data */ 213#define R5_UPTODATE 0 /* page contains current data */
150#define R5_LOCKED 1 /* IO has been submitted on "req" */ 214#define R5_LOCKED 1 /* IO has been submitted on "req" */
@@ -158,6 +222,15 @@ struct stripe_head {
158#define R5_ReWrite 9 /* have tried to over-write the readerror */ 222#define R5_ReWrite 9 /* have tried to over-write the readerror */
159 223
160#define R5_Expanded 10 /* This block now has post-expand data */ 224#define R5_Expanded 10 /* This block now has post-expand data */
225#define R5_Wantcompute 11 /* compute_block in progress treat as
226 * uptodate
227 */
228#define R5_Wantfill 12 /* dev->toread contains a bio that needs
229 * filling
230 */
231#define R5_Wantprexor 13 /* distinguish blocks ready for rmw from
232 * other "towrites"
233 */
161/* 234/*
162 * Write method 235 * Write method
163 */ 236 */
@@ -180,6 +253,24 @@ struct stripe_head {
180#define STRIPE_EXPAND_SOURCE 10 253#define STRIPE_EXPAND_SOURCE 10
181#define STRIPE_EXPAND_READY 11 254#define STRIPE_EXPAND_READY 11
182/* 255/*
256 * Operations flags (in issue order)
257 */
258#define STRIPE_OP_BIOFILL 0
259#define STRIPE_OP_COMPUTE_BLK 1
260#define STRIPE_OP_PREXOR 2
261#define STRIPE_OP_BIODRAIN 3
262#define STRIPE_OP_POSTXOR 4
263#define STRIPE_OP_CHECK 5
264#define STRIPE_OP_IO 6
265
266/* modifiers to the base operations
267 * STRIPE_OP_MOD_REPAIR_PD - compute the parity block and write it back
268 * STRIPE_OP_MOD_DMA_CHECK - parity is not corrupted by the check
269 */
270#define STRIPE_OP_MOD_REPAIR_PD 7
271#define STRIPE_OP_MOD_DMA_CHECK 8
272
273/*
183 * Plugging: 274 * Plugging:
184 * 275 *
185 * To improve write throughput, we need to delay the handling of some 276 * To improve write throughput, we need to delay the handling of some
diff --git a/include/linux/raid/xor.h b/include/linux/raid/xor.h
index f0d67cbdea40..3e120587eada 100644
--- a/include/linux/raid/xor.h
+++ b/include/linux/raid/xor.h
@@ -3,9 +3,10 @@
3 3
4#include <linux/raid/md.h> 4#include <linux/raid/md.h>
5 5
6#define MAX_XOR_BLOCKS 5 6#define MAX_XOR_BLOCKS 4
7 7
8extern void xor_block(unsigned int count, unsigned int bytes, void **ptr); 8extern void xor_blocks(unsigned int count, unsigned int bytes,
9 void *dest, void **srcs);
9 10
10struct xor_block_template { 11struct xor_block_template {
11 struct xor_block_template *next; 12 struct xor_block_template *next;
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 1dd1c707311f..85ea63f462af 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -67,6 +67,11 @@ extern void kernel_power_off(void);
67 67
68void ctrl_alt_del(void); 68void ctrl_alt_del(void);
69 69
70#define POWEROFF_CMD_PATH_LEN 256
71extern char poweroff_cmd[POWEROFF_CMD_PATH_LEN];
72
73extern int orderly_poweroff(bool force);
74
70/* 75/*
71 * Emergency restart, callable from an interrupt handler. 76 * Emergency restart, callable from an interrupt handler.
72 */ 77 */
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h
index 81e9299ca148..f3f4f28c6960 100644
--- a/include/linux/resume-trace.h
+++ b/include/linux/resume-trace.h
@@ -2,6 +2,7 @@
2#define RESUME_TRACE_H 2#define RESUME_TRACE_H
3 3
4#ifdef CONFIG_PM_TRACE 4#ifdef CONFIG_PM_TRACE
5#include <asm/resume-trace.h>
5 6
6extern int pm_trace_enabled; 7extern int pm_trace_enabled;
7 8
@@ -9,20 +10,10 @@ struct device;
9extern void set_trace_device(struct device *); 10extern void set_trace_device(struct device *);
10extern void generate_resume_trace(void *tracedata, unsigned int user); 11extern void generate_resume_trace(void *tracedata, unsigned int user);
11 12
12#define TRACE_DEVICE(dev) set_trace_device(dev) 13#define TRACE_DEVICE(dev) do { \
13#define TRACE_RESUME(user) do { \ 14 if (pm_trace_enabled) \
14 if (pm_trace_enabled) { \ 15 set_trace_device(dev); \
15 void *tracedata; \ 16 } while(0)
16 asm volatile("movl $1f,%0\n" \
17 ".section .tracedata,\"a\"\n" \
18 "1:\t.word %c1\n" \
19 "\t.long %c2\n" \
20 ".previous" \
21 :"=r" (tracedata) \
22 : "i" (__LINE__), "i" (__FILE__)); \
23 generate_resume_trace(tracedata, user); \
24 } \
25} while (0)
26 17
27#else 18#else
28 19
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 7c1ffbab7865..a8a6ea809da0 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -63,7 +63,7 @@ enum rfkill_state {
63 * This structure represents a RF switch located on a network device. 63 * This structure represents a RF switch located on a network device.
64 */ 64 */
65struct rfkill { 65struct rfkill {
66 char *name; 66 const char *name;
67 enum rfkill_type type; 67 enum rfkill_type type;
68 68
69 enum rfkill_state state; 69 enum rfkill_state state;
diff --git a/include/linux/rtc/m48t59.h b/include/linux/rtc/m48t59.h
new file mode 100644
index 000000000000..e8c7c21ceb1f
--- /dev/null
+++ b/include/linux/rtc/m48t59.h
@@ -0,0 +1,57 @@
1/*
2 * include/linux/rtc/m48t59.h
3 *
4 * Definitions for the platform data of m48t59 RTC chip driver.
5 *
6 * Copyright (c) 2007 Wind River Systems, Inc.
7 *
8 * Mark Zhan <rongkai.zhan@windriver.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#ifndef _LINUX_RTC_M48T59_H_
16#define _LINUX_RTC_M48T59_H_
17
18/*
19 * M48T59 Register Offset
20 */
21#define M48T59_YEAR 0x1fff
22#define M48T59_MONTH 0x1ffe
23#define M48T59_MDAY 0x1ffd /* Day of Month */
24#define M48T59_WDAY 0x1ffc /* Day of Week */
25#define M48T59_WDAY_CB 0x20 /* Century Bit */
26#define M48T59_WDAY_CEB 0x10 /* Century Enable Bit */
27#define M48T59_HOUR 0x1ffb
28#define M48T59_MIN 0x1ffa
29#define M48T59_SEC 0x1ff9
30#define M48T59_CNTL 0x1ff8
31#define M48T59_CNTL_READ 0x40
32#define M48T59_CNTL_WRITE 0x80
33#define M48T59_WATCHDOG 0x1ff7
34#define M48T59_INTR 0x1ff6
35#define M48T59_INTR_AFE 0x80 /* Alarm Interrupt Enable */
36#define M48T59_INTR_ABE 0x20
37#define M48T59_ALARM_DATE 0x1ff5
38#define M48T59_ALARM_HOUR 0x1ff4
39#define M48T59_ALARM_MIN 0x1ff3
40#define M48T59_ALARM_SEC 0x1ff2
41#define M48T59_UNUSED 0x1ff1
42#define M48T59_FLAGS 0x1ff0
43#define M48T59_FLAGS_WDT 0x80 /* watchdog timer expired */
44#define M48T59_FLAGS_AF 0x40 /* alarm */
45#define M48T59_FLAGS_BF 0x10 /* low battery */
46
47#define M48T59_NVRAM_SIZE 0x1ff0
48
49struct m48t59_plat_data {
50 /* The method to access M48T59 registers,
51 * NOTE: The 'ofs' should be 0x00~0x1fff
52 */
53 void (*write_byte)(struct device *dev, u32 ofs, u8 val);
54 unsigned char (*read_byte)(struct device *dev, u32 ofs);
55};
56
57#endif /* _LINUX_RTC_M48T59_H_ */
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 1fae30af91f3..c91476ce314a 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -261,7 +261,7 @@ enum rtattr_type_t
261 RTA_FLOW, 261 RTA_FLOW,
262 RTA_CACHEINFO, 262 RTA_CACHEINFO,
263 RTA_SESSION, 263 RTA_SESSION,
264 RTA_MP_ALGO, 264 RTA_MP_ALGO, /* no longer used */
265 RTA_TABLE, 265 RTA_TABLE,
266 __RTA_MAX 266 __RTA_MAX
267}; 267};
@@ -570,10 +570,16 @@ static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
570} 570}
571 571
572extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len); 572extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len);
573extern int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr,
574 struct rtattr *rta, int len);
573 575
574#define rtattr_parse_nested(tb, max, rta) \ 576#define rtattr_parse_nested(tb, max, rta) \
575 rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) 577 rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta)))
576 578
579#define rtattr_parse_nested_compat(tb, max, rta, data, len) \
580({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \
581 __rtattr_parse_nested_compat(tb, max, rta, len); })
582
577extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); 583extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo);
578extern int rtnl_unicast(struct sk_buff *skb, u32 pid); 584extern int rtnl_unicast(struct sk_buff *skb, u32 pid);
579extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, 585extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group,
@@ -638,6 +644,18 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi
638({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ 644({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
639 (skb)->len; }) 645 (skb)->len; })
640 646
647#define RTA_NEST_COMPAT(skb, type, attrlen, data) \
648({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \
649 RTA_PUT(skb, type, attrlen, data); \
650 RTA_NEST(skb, type); \
651 __start; })
652
653#define RTA_NEST_COMPAT_END(skb, start) \
654({ struct rtattr *__nest = (void *)(start) + NLMSG_ALIGN((start)->rta_len); \
655 (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
656 RTA_NEST_END(skb, __nest); \
657 (skb)->len; })
658
641#define RTA_NEST_CANCEL(skb, start) \ 659#define RTA_NEST_CANCEL(skb, start) \
642({ if (start) \ 660({ if (start) \
643 skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ 661 skb_trim(skb, (unsigned char *) (start) - (skb)->data); \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d58e74b98367..33b9b4841ee7 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -26,6 +26,7 @@
26#define CLONE_STOPPED 0x02000000 /* Start in stopped state */ 26#define CLONE_STOPPED 0x02000000 /* Start in stopped state */
27#define CLONE_NEWUTS 0x04000000 /* New utsname group? */ 27#define CLONE_NEWUTS 0x04000000 /* New utsname group? */
28#define CLONE_NEWIPC 0x08000000 /* New ipcs */ 28#define CLONE_NEWIPC 0x08000000 /* New ipcs */
29#define CLONE_NEWUSER 0x10000000 /* New user namespace */
29 30
30/* 31/*
31 * Scheduling policies 32 * Scheduling policies
@@ -34,6 +35,8 @@
34#define SCHED_FIFO 1 35#define SCHED_FIFO 1
35#define SCHED_RR 2 36#define SCHED_RR 2
36#define SCHED_BATCH 3 37#define SCHED_BATCH 3
38/* SCHED_ISO: reserved but not implemented yet */
39#define SCHED_IDLE 5
37 40
38#ifdef __KERNEL__ 41#ifdef __KERNEL__
39 42
@@ -130,6 +133,26 @@ extern unsigned long nr_active(void);
130extern unsigned long nr_iowait(void); 133extern unsigned long nr_iowait(void);
131extern unsigned long weighted_cpuload(const int cpu); 134extern unsigned long weighted_cpuload(const int cpu);
132 135
136struct seq_file;
137struct cfs_rq;
138#ifdef CONFIG_SCHED_DEBUG
139extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m);
140extern void proc_sched_set_task(struct task_struct *p);
141extern void
142print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq, u64 now);
143#else
144static inline void
145proc_sched_show_task(struct task_struct *p, struct seq_file *m)
146{
147}
148static inline void proc_sched_set_task(struct task_struct *p)
149{
150}
151static inline void
152print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq, u64 now)
153{
154}
155#endif
133 156
134/* 157/*
135 * Task state bitmask. NOTE! These bits are also 158 * Task state bitmask. NOTE! These bits are also
@@ -193,6 +216,7 @@ struct task_struct;
193extern void sched_init(void); 216extern void sched_init(void);
194extern void sched_init_smp(void); 217extern void sched_init_smp(void);
195extern void init_idle(struct task_struct *idle, int cpu); 218extern void init_idle(struct task_struct *idle, int cpu);
219extern void init_idle_bootup_task(struct task_struct *idle);
196 220
197extern cpumask_t nohz_cpu_mask; 221extern cpumask_t nohz_cpu_mask;
198#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 222#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
@@ -264,6 +288,7 @@ extern signed long schedule_timeout_uninterruptible(signed long timeout);
264asmlinkage void schedule(void); 288asmlinkage void schedule(void);
265 289
266struct nsproxy; 290struct nsproxy;
291struct user_namespace;
267 292
268/* Maximum number of active map areas.. This is a random (large) number */ 293/* Maximum number of active map areas.. This is a random (large) number */
269#define DEFAULT_MAX_MAP_COUNT 65536 294#define DEFAULT_MAX_MAP_COUNT 65536
@@ -320,6 +345,27 @@ typedef unsigned long mm_counter_t;
320 (mm)->hiwater_vm = (mm)->total_vm; \ 345 (mm)->hiwater_vm = (mm)->total_vm; \
321} while (0) 346} while (0)
322 347
348extern void set_dumpable(struct mm_struct *mm, int value);
349extern int get_dumpable(struct mm_struct *mm);
350
351/* mm flags */
352/* dumpable bits */
353#define MMF_DUMPABLE 0 /* core dump is permitted */
354#define MMF_DUMP_SECURELY 1 /* core file is readable only by root */
355#define MMF_DUMPABLE_BITS 2
356
357/* coredump filter bits */
358#define MMF_DUMP_ANON_PRIVATE 2
359#define MMF_DUMP_ANON_SHARED 3
360#define MMF_DUMP_MAPPED_PRIVATE 4
361#define MMF_DUMP_MAPPED_SHARED 5
362#define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS
363#define MMF_DUMP_FILTER_BITS 4
364#define MMF_DUMP_FILTER_MASK \
365 (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT)
366#define MMF_DUMP_FILTER_DEFAULT \
367 ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED))
368
323struct mm_struct { 369struct mm_struct {
324 struct vm_area_struct * mmap; /* list of VMAs */ 370 struct vm_area_struct * mmap; /* list of VMAs */
325 struct rb_root mm_rb; 371 struct rb_root mm_rb;
@@ -377,7 +423,7 @@ struct mm_struct {
377 unsigned int token_priority; 423 unsigned int token_priority;
378 unsigned int last_interval; 424 unsigned int last_interval;
379 425
380 unsigned char dumpable:2; 426 unsigned long flags; /* Must use atomic bitops to access the bits */
381 427
382 /* coredumping support */ 428 /* coredumping support */
383 int core_waiters; 429 int core_waiters;
@@ -479,7 +525,7 @@ struct signal_struct {
479 * from jiffies_to_ns(utime + stime) if sched_clock uses something 525 * from jiffies_to_ns(utime + stime) if sched_clock uses something
480 * other than jiffies.) 526 * other than jiffies.)
481 */ 527 */
482 unsigned long long sched_time; 528 unsigned long long sum_sched_runtime;
483 529
484 /* 530 /*
485 * We don't bother to synchronize most readers of this at all, 531 * We don't bother to synchronize most readers of this at all,
@@ -506,6 +552,10 @@ struct signal_struct {
506#ifdef CONFIG_TASKSTATS 552#ifdef CONFIG_TASKSTATS
507 struct taskstats *stats; 553 struct taskstats *stats;
508#endif 554#endif
555#ifdef CONFIG_AUDIT
556 unsigned audit_tty;
557 struct tty_audit_buf *tty_audit_buf;
558#endif
509}; 559};
510 560
511/* Context switch must be unlocked if interrupts are to be enabled */ 561/* Context switch must be unlocked if interrupts are to be enabled */
@@ -521,31 +571,6 @@ struct signal_struct {
521#define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ 571#define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */
522#define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ 572#define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */
523 573
524
525/*
526 * Priority of a process goes from 0..MAX_PRIO-1, valid RT
527 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
528 * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
529 * values are inverted: lower p->prio value means higher priority.
530 *
531 * The MAX_USER_RT_PRIO value allows the actual maximum
532 * RT priority to be separate from the value exported to
533 * user-space. This allows kernel threads to set their
534 * priority to a value higher than any user task. Note:
535 * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO.
536 */
537
538#define MAX_USER_RT_PRIO 100
539#define MAX_RT_PRIO MAX_USER_RT_PRIO
540
541#define MAX_PRIO (MAX_RT_PRIO + 40)
542
543#define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO)
544#define rt_task(p) rt_prio((p)->prio)
545#define batch_task(p) (unlikely((p)->policy == SCHED_BATCH))
546#define is_rt_policy(p) ((p) != SCHED_NORMAL && (p) != SCHED_BATCH)
547#define has_rt_policy(p) unlikely(is_rt_policy((p)->policy))
548
549/* 574/*
550 * Some day this will be a full-fledged user tracking system.. 575 * Some day this will be a full-fledged user tracking system..
551 */ 576 */
@@ -583,13 +608,13 @@ struct reclaim_state;
583#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) 608#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
584struct sched_info { 609struct sched_info {
585 /* cumulative counters */ 610 /* cumulative counters */
586 unsigned long cpu_time, /* time spent on the cpu */ 611 unsigned long pcnt; /* # of times run on this cpu */
587 run_delay, /* time spent waiting on a runqueue */ 612 unsigned long long cpu_time, /* time spent on the cpu */
588 pcnt; /* # of timeslices run on this cpu */ 613 run_delay; /* time spent waiting on a runqueue */
589 614
590 /* timestamps */ 615 /* timestamps */
591 unsigned long last_arrival, /* when we last ran on a cpu */ 616 unsigned long long last_arrival,/* when we last ran on a cpu */
592 last_queued; /* when we were last queued to run */ 617 last_queued; /* when we were last queued to run */
593}; 618};
594#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ 619#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */
595 620
@@ -639,18 +664,24 @@ static inline int sched_info_on(void)
639#endif 664#endif
640} 665}
641 666
642enum idle_type 667enum cpu_idle_type {
643{ 668 CPU_IDLE,
644 SCHED_IDLE, 669 CPU_NOT_IDLE,
645 NOT_IDLE, 670 CPU_NEWLY_IDLE,
646 NEWLY_IDLE, 671 CPU_MAX_IDLE_TYPES
647 MAX_IDLE_TYPES
648}; 672};
649 673
650/* 674/*
651 * sched-domains (multiprocessor balancing) declarations: 675 * sched-domains (multiprocessor balancing) declarations:
652 */ 676 */
653#define SCHED_LOAD_SCALE 128UL /* increase resolution of load */ 677
678/*
679 * Increase resolution of nice-level calculations:
680 */
681#define SCHED_LOAD_SHIFT 10
682#define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT)
683
684#define SCHED_LOAD_SCALE_FUZZ (SCHED_LOAD_SCALE >> 5)
654 685
655#ifdef CONFIG_SMP 686#ifdef CONFIG_SMP
656#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ 687#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */
@@ -719,14 +750,14 @@ struct sched_domain {
719 750
720#ifdef CONFIG_SCHEDSTATS 751#ifdef CONFIG_SCHEDSTATS
721 /* load_balance() stats */ 752 /* load_balance() stats */
722 unsigned long lb_cnt[MAX_IDLE_TYPES]; 753 unsigned long lb_cnt[CPU_MAX_IDLE_TYPES];
723 unsigned long lb_failed[MAX_IDLE_TYPES]; 754 unsigned long lb_failed[CPU_MAX_IDLE_TYPES];
724 unsigned long lb_balanced[MAX_IDLE_TYPES]; 755 unsigned long lb_balanced[CPU_MAX_IDLE_TYPES];
725 unsigned long lb_imbalance[MAX_IDLE_TYPES]; 756 unsigned long lb_imbalance[CPU_MAX_IDLE_TYPES];
726 unsigned long lb_gained[MAX_IDLE_TYPES]; 757 unsigned long lb_gained[CPU_MAX_IDLE_TYPES];
727 unsigned long lb_hot_gained[MAX_IDLE_TYPES]; 758 unsigned long lb_hot_gained[CPU_MAX_IDLE_TYPES];
728 unsigned long lb_nobusyg[MAX_IDLE_TYPES]; 759 unsigned long lb_nobusyg[CPU_MAX_IDLE_TYPES];
729 unsigned long lb_nobusyq[MAX_IDLE_TYPES]; 760 unsigned long lb_nobusyq[CPU_MAX_IDLE_TYPES];
730 761
731 /* Active load balancing */ 762 /* Active load balancing */
732 unsigned long alb_cnt; 763 unsigned long alb_cnt;
@@ -753,12 +784,6 @@ struct sched_domain {
753extern int partition_sched_domains(cpumask_t *partition1, 784extern int partition_sched_domains(cpumask_t *partition1,
754 cpumask_t *partition2); 785 cpumask_t *partition2);
755 786
756/*
757 * Maximum cache size the migration-costs auto-tuning code will
758 * search from:
759 */
760extern unsigned int max_cache_size;
761
762#endif /* CONFIG_SMP */ 787#endif /* CONFIG_SMP */
763 788
764 789
@@ -809,14 +834,86 @@ struct mempolicy;
809struct pipe_inode_info; 834struct pipe_inode_info;
810struct uts_namespace; 835struct uts_namespace;
811 836
812enum sleep_type { 837struct rq;
813 SLEEP_NORMAL, 838struct sched_domain;
814 SLEEP_NONINTERACTIVE, 839
815 SLEEP_INTERACTIVE, 840struct sched_class {
816 SLEEP_INTERRUPTED, 841 struct sched_class *next;
842
843 void (*enqueue_task) (struct rq *rq, struct task_struct *p,
844 int wakeup, u64 now);
845 void (*dequeue_task) (struct rq *rq, struct task_struct *p,
846 int sleep, u64 now);
847 void (*yield_task) (struct rq *rq, struct task_struct *p);
848
849 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p);
850
851 struct task_struct * (*pick_next_task) (struct rq *rq, u64 now);
852 void (*put_prev_task) (struct rq *rq, struct task_struct *p, u64 now);
853
854 int (*load_balance) (struct rq *this_rq, int this_cpu,
855 struct rq *busiest,
856 unsigned long max_nr_move, unsigned long max_load_move,
857 struct sched_domain *sd, enum cpu_idle_type idle,
858 int *all_pinned, unsigned long *total_load_moved);
859
860 void (*set_curr_task) (struct rq *rq);
861 void (*task_tick) (struct rq *rq, struct task_struct *p);
862 void (*task_new) (struct rq *rq, struct task_struct *p);
817}; 863};
818 864
819struct prio_array; 865struct load_weight {
866 unsigned long weight, inv_weight;
867};
868
869/*
870 * CFS stats for a schedulable entity (task, task-group etc)
871 *
872 * Current field usage histogram:
873 *
874 * 4 se->block_start
875 * 4 se->run_node
876 * 4 se->sleep_start
877 * 4 se->sleep_start_fair
878 * 6 se->load.weight
879 * 7 se->delta_fair
880 * 15 se->wait_runtime
881 */
882struct sched_entity {
883 long wait_runtime;
884 unsigned long delta_fair_run;
885 unsigned long delta_fair_sleep;
886 unsigned long delta_exec;
887 s64 fair_key;
888 struct load_weight load; /* for load-balancing */
889 struct rb_node run_node;
890 unsigned int on_rq;
891
892 u64 wait_start_fair;
893 u64 wait_start;
894 u64 exec_start;
895 u64 sleep_start;
896 u64 sleep_start_fair;
897 u64 block_start;
898 u64 sleep_max;
899 u64 block_max;
900 u64 exec_max;
901 u64 wait_max;
902 u64 last_ran;
903
904 u64 sum_exec_runtime;
905 s64 sum_wait_runtime;
906 s64 sum_sleep_runtime;
907 unsigned long wait_runtime_overruns;
908 unsigned long wait_runtime_underruns;
909#ifdef CONFIG_FAIR_GROUP_SCHED
910 struct sched_entity *parent;
911 /* rq on which this entity is (to be) queued: */
912 struct cfs_rq *cfs_rq;
913 /* rq "owned" by this entity/group: */
914 struct cfs_rq *my_q;
915#endif
916};
820 917
821struct task_struct { 918struct task_struct {
822 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ 919 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
@@ -832,23 +929,20 @@ struct task_struct {
832 int oncpu; 929 int oncpu;
833#endif 930#endif
834#endif 931#endif
835 int load_weight; /* for niceness load balancing purposes */ 932
836 int prio, static_prio, normal_prio; 933 int prio, static_prio, normal_prio;
837 struct list_head run_list; 934 struct list_head run_list;
838 struct prio_array *array; 935 struct sched_class *sched_class;
936 struct sched_entity se;
839 937
840 unsigned short ioprio; 938 unsigned short ioprio;
841#ifdef CONFIG_BLK_DEV_IO_TRACE 939#ifdef CONFIG_BLK_DEV_IO_TRACE
842 unsigned int btrace_seq; 940 unsigned int btrace_seq;
843#endif 941#endif
844 unsigned long sleep_avg;
845 unsigned long long timestamp, last_ran;
846 unsigned long long sched_time; /* sched_clock time spent running */
847 enum sleep_type sleep_type;
848 942
849 unsigned int policy; 943 unsigned int policy;
850 cpumask_t cpus_allowed; 944 cpumask_t cpus_allowed;
851 unsigned int time_slice, first_time_slice; 945 unsigned int time_slice;
852 946
853#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) 947#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
854 struct sched_info sched_info; 948 struct sched_info sched_info;
@@ -905,7 +999,8 @@ struct task_struct {
905 unsigned int rt_priority; 999 unsigned int rt_priority;
906 cputime_t utime, stime; 1000 cputime_t utime, stime;
907 unsigned long nvcsw, nivcsw; /* context switch counts */ 1001 unsigned long nvcsw, nivcsw; /* context switch counts */
908 struct timespec start_time; 1002 struct timespec start_time; /* monotonic time */
1003 struct timespec real_start_time; /* boot based time */
909/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ 1004/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
910 unsigned long min_flt, maj_flt; 1005 unsigned long min_flt, maj_flt;
911 1006
@@ -1078,6 +1173,37 @@ struct task_struct {
1078#endif 1173#endif
1079}; 1174};
1080 1175
1176/*
1177 * Priority of a process goes from 0..MAX_PRIO-1, valid RT
1178 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
1179 * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
1180 * values are inverted: lower p->prio value means higher priority.
1181 *
1182 * The MAX_USER_RT_PRIO value allows the actual maximum
1183 * RT priority to be separate from the value exported to
1184 * user-space. This allows kernel threads to set their
1185 * priority to a value higher than any user task. Note:
1186 * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO.
1187 */
1188
1189#define MAX_USER_RT_PRIO 100
1190#define MAX_RT_PRIO MAX_USER_RT_PRIO
1191
1192#define MAX_PRIO (MAX_RT_PRIO + 40)
1193#define DEFAULT_PRIO (MAX_RT_PRIO + 20)
1194
1195static inline int rt_prio(int prio)
1196{
1197 if (unlikely(prio < MAX_RT_PRIO))
1198 return 1;
1199 return 0;
1200}
1201
1202static inline int rt_task(struct task_struct *p)
1203{
1204 return rt_prio(p->prio);
1205}
1206
1081static inline pid_t process_group(struct task_struct *tsk) 1207static inline pid_t process_group(struct task_struct *tsk)
1082{ 1208{
1083 return tsk->signal->pgrp; 1209 return tsk->signal->pgrp;
@@ -1162,6 +1288,7 @@ static inline void put_task_struct(struct task_struct *t)
1162 /* Not implemented yet, only for 486*/ 1288 /* Not implemented yet, only for 486*/
1163#define PF_STARTING 0x00000002 /* being created */ 1289#define PF_STARTING 0x00000002 /* being created */
1164#define PF_EXITING 0x00000004 /* getting shut down */ 1290#define PF_EXITING 0x00000004 /* getting shut down */
1291#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */
1165#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ 1292#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */
1166#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ 1293#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */
1167#define PF_DUMPCORE 0x00000200 /* dumped core */ 1294#define PF_DUMPCORE 0x00000200 /* dumped core */
@@ -1221,8 +1348,15 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1221#endif 1348#endif
1222 1349
1223extern unsigned long long sched_clock(void); 1350extern unsigned long long sched_clock(void);
1351
1352/*
1353 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
1354 * clock constructed from sched_clock():
1355 */
1356extern unsigned long long cpu_clock(int cpu);
1357
1224extern unsigned long long 1358extern unsigned long long
1225current_sched_time(const struct task_struct *current_task); 1359task_sched_runtime(struct task_struct *task);
1226 1360
1227/* sched_exec is called by processes performing an exec */ 1361/* sched_exec is called by processes performing an exec */
1228#ifdef CONFIG_SMP 1362#ifdef CONFIG_SMP
@@ -1231,6 +1365,8 @@ extern void sched_exec(void);
1231#define sched_exec() {} 1365#define sched_exec() {}
1232#endif 1366#endif
1233 1367
1368extern void sched_clock_unstable_event(void);
1369
1234#ifdef CONFIG_HOTPLUG_CPU 1370#ifdef CONFIG_HOTPLUG_CPU
1235extern void idle_task_exit(void); 1371extern void idle_task_exit(void);
1236#else 1372#else
@@ -1239,6 +1375,14 @@ static inline void idle_task_exit(void) {}
1239 1375
1240extern void sched_idle_next(void); 1376extern void sched_idle_next(void);
1241 1377
1378extern unsigned int sysctl_sched_granularity;
1379extern unsigned int sysctl_sched_wakeup_granularity;
1380extern unsigned int sysctl_sched_batch_wakeup_granularity;
1381extern unsigned int sysctl_sched_stat_granularity;
1382extern unsigned int sysctl_sched_runtime_limit;
1383extern unsigned int sysctl_sched_child_runs_first;
1384extern unsigned int sysctl_sched_features;
1385
1242#ifdef CONFIG_RT_MUTEXES 1386#ifdef CONFIG_RT_MUTEXES
1243extern int rt_mutex_getprio(struct task_struct *p); 1387extern int rt_mutex_getprio(struct task_struct *p);
1244extern void rt_mutex_setprio(struct task_struct *p, int prio); 1388extern void rt_mutex_setprio(struct task_struct *p, int prio);
@@ -1294,7 +1438,7 @@ extern struct task_struct *find_task_by_pid_type(int type, int pid);
1294extern void __set_special_pids(pid_t session, pid_t pgrp); 1438extern void __set_special_pids(pid_t session, pid_t pgrp);
1295 1439
1296/* per-UID process charging. */ 1440/* per-UID process charging. */
1297extern struct user_struct * alloc_uid(uid_t); 1441extern struct user_struct * alloc_uid(struct user_namespace *, uid_t);
1298static inline struct user_struct *get_uid(struct user_struct *u) 1442static inline struct user_struct *get_uid(struct user_struct *u)
1299{ 1443{
1300 atomic_inc(&u->__count); 1444 atomic_inc(&u->__count);
@@ -1316,8 +1460,8 @@ extern void FASTCALL(wake_up_new_task(struct task_struct * tsk,
1316#else 1460#else
1317 static inline void kick_process(struct task_struct *tsk) { } 1461 static inline void kick_process(struct task_struct *tsk) { }
1318#endif 1462#endif
1319extern void FASTCALL(sched_fork(struct task_struct * p, int clone_flags)); 1463extern void sched_fork(struct task_struct *p, int clone_flags);
1320extern void FASTCALL(sched_exit(struct task_struct * p)); 1464extern void sched_dead(struct task_struct *p);
1321 1465
1322extern int in_group_p(gid_t); 1466extern int in_group_p(gid_t);
1323extern int in_egroup_p(gid_t); 1467extern int in_egroup_p(gid_t);
@@ -1405,7 +1549,7 @@ extern struct mm_struct * mm_alloc(void);
1405extern void FASTCALL(__mmdrop(struct mm_struct *)); 1549extern void FASTCALL(__mmdrop(struct mm_struct *));
1406static inline void mmdrop(struct mm_struct * mm) 1550static inline void mmdrop(struct mm_struct * mm)
1407{ 1551{
1408 if (atomic_dec_and_test(&mm->mm_count)) 1552 if (unlikely(atomic_dec_and_test(&mm->mm_count)))
1409 __mmdrop(mm); 1553 __mmdrop(mm);
1410} 1554}
1411 1555
@@ -1637,10 +1781,7 @@ static inline unsigned int task_cpu(const struct task_struct *p)
1637 return task_thread_info(p)->cpu; 1781 return task_thread_info(p)->cpu;
1638} 1782}
1639 1783
1640static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) 1784extern void set_task_cpu(struct task_struct *p, unsigned int cpu);
1641{
1642 task_thread_info(p)->cpu = cpu;
1643}
1644 1785
1645#else 1786#else
1646 1787
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
index b02308ee7667..3ee412bc00ec 100644
--- a/include/linux/screen_info.h
+++ b/include/linux/screen_info.h
@@ -10,7 +10,7 @@
10struct screen_info { 10struct screen_info {
11 u8 orig_x; /* 0x00 */ 11 u8 orig_x; /* 0x00 */
12 u8 orig_y; /* 0x01 */ 12 u8 orig_y; /* 0x01 */
13 u16 dontuse1; /* 0x02 -- EXT_MEM_K sits here */ 13 u16 ext_mem_k; /* 0x02 */
14 u16 orig_video_page; /* 0x04 */ 14 u16 orig_video_page; /* 0x04 */
15 u8 orig_video_mode; /* 0x06 */ 15 u8 orig_video_mode; /* 0x06 */
16 u8 orig_video_cols; /* 0x07 */ 16 u8 orig_video_cols; /* 0x07 */
@@ -27,7 +27,7 @@ struct screen_info {
27 u16 lfb_depth; /* 0x16 */ 27 u16 lfb_depth; /* 0x16 */
28 u32 lfb_base; /* 0x18 */ 28 u32 lfb_base; /* 0x18 */
29 u32 lfb_size; /* 0x1c */ 29 u32 lfb_size; /* 0x1c */
30 u16 dontuse2, dontuse3; /* 0x20 -- CL_MAGIC and CL_OFFSET here */ 30 u16 cl_magic, cl_offset; /* 0x20 */
31 u16 lfb_linelength; /* 0x24 */ 31 u16 lfb_linelength; /* 0x24 */
32 u8 red_size; /* 0x26 */ 32 u8 red_size; /* 0x26 */
33 u8 red_pos; /* 0x27 */ 33 u8 red_pos; /* 0x27 */
@@ -42,9 +42,8 @@ struct screen_info {
42 u16 pages; /* 0x32 */ 42 u16 pages; /* 0x32 */
43 u16 vesa_attributes; /* 0x34 */ 43 u16 vesa_attributes; /* 0x34 */
44 u32 capabilities; /* 0x36 */ 44 u32 capabilities; /* 0x36 */
45 /* 0x3a -- 0x3b reserved for future expansion */ 45 u8 _reserved[6]; /* 0x3a */
46 /* 0x3c -- 0x3f micro stack for relocatable kernels */ 46} __attribute__((packed));
47};
48 47
49extern struct screen_info screen_info; 48extern struct screen_info screen_info;
50 49
diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h
index 1a82d30c4b17..d2b058130eb1 100644
--- a/include/linux/scx200_gpio.h
+++ b/include/linux/scx200_gpio.h
@@ -1,5 +1,3 @@
1#include <linux/spinlock.h>
2
3u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear); 1u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear);
4 2
5extern unsigned scx200_gpio_base; 3extern unsigned scx200_gpio_base;
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index 3e8b1cf54303..262a8dccfa81 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -4,8 +4,6 @@
4 4
5#ifdef CONFIG_SECCOMP 5#ifdef CONFIG_SECCOMP
6 6
7#define NR_SECCOMP_MODES 1
8
9#include <linux/thread_info.h> 7#include <linux/thread_info.h>
10#include <asm/seccomp.h> 8#include <asm/seccomp.h>
11 9
@@ -18,20 +16,23 @@ static inline void secure_computing(int this_syscall)
18 __secure_computing(this_syscall); 16 __secure_computing(this_syscall);
19} 17}
20 18
21static inline int has_secure_computing(struct thread_info *ti) 19extern long prctl_get_seccomp(void);
22{ 20extern long prctl_set_seccomp(unsigned long);
23 return unlikely(test_ti_thread_flag(ti, TIF_SECCOMP));
24}
25 21
26#else /* CONFIG_SECCOMP */ 22#else /* CONFIG_SECCOMP */
27 23
28typedef struct { } seccomp_t; 24typedef struct { } seccomp_t;
29 25
30#define secure_computing(x) do { } while (0) 26#define secure_computing(x) do { } while (0)
31/* static inline to preserve typechecking */ 27
32static inline int has_secure_computing(struct thread_info *ti) 28static inline long prctl_get_seccomp(void)
29{
30 return -EINVAL;
31}
32
33static inline long prctl_set_seccomp(unsigned long arg2)
33{ 34{
34 return 0; 35 return -EINVAL;
35} 36}
36 37
37#endif /* CONFIG_SECCOMP */ 38#endif /* CONFIG_SECCOMP */
diff --git a/include/linux/security.h b/include/linux/security.h
index 9eb9e0fe0331..c11dc8aa0351 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -71,6 +71,7 @@ struct xfrm_user_sec_ctx;
71extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); 71extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
72extern int cap_netlink_recv(struct sk_buff *skb, int cap); 72extern int cap_netlink_recv(struct sk_buff *skb, int cap);
73 73
74extern unsigned long mmap_min_addr;
74/* 75/*
75 * Values used in the task_security_ops calls 76 * Values used in the task_security_ops calls
76 */ 77 */
@@ -1241,8 +1242,9 @@ struct security_operations {
1241 int (*file_ioctl) (struct file * file, unsigned int cmd, 1242 int (*file_ioctl) (struct file * file, unsigned int cmd,
1242 unsigned long arg); 1243 unsigned long arg);
1243 int (*file_mmap) (struct file * file, 1244 int (*file_mmap) (struct file * file,
1244 unsigned long reqprot, 1245 unsigned long reqprot, unsigned long prot,
1245 unsigned long prot, unsigned long flags); 1246 unsigned long flags, unsigned long addr,
1247 unsigned long addr_only);
1246 int (*file_mprotect) (struct vm_area_struct * vma, 1248 int (*file_mprotect) (struct vm_area_struct * vma,
1247 unsigned long reqprot, 1249 unsigned long reqprot,
1248 unsigned long prot); 1250 unsigned long prot);
@@ -1814,9 +1816,12 @@ static inline int security_file_ioctl (struct file *file, unsigned int cmd,
1814 1816
1815static inline int security_file_mmap (struct file *file, unsigned long reqprot, 1817static inline int security_file_mmap (struct file *file, unsigned long reqprot,
1816 unsigned long prot, 1818 unsigned long prot,
1817 unsigned long flags) 1819 unsigned long flags,
1820 unsigned long addr,
1821 unsigned long addr_only)
1818{ 1822{
1819 return security_ops->file_mmap (file, reqprot, prot, flags); 1823 return security_ops->file_mmap (file, reqprot, prot, flags, addr,
1824 addr_only);
1820} 1825}
1821 1826
1822static inline int security_file_mprotect (struct vm_area_struct *vma, 1827static inline int security_file_mprotect (struct vm_area_struct *vma,
@@ -2489,7 +2494,9 @@ static inline int security_file_ioctl (struct file *file, unsigned int cmd,
2489 2494
2490static inline int security_file_mmap (struct file *file, unsigned long reqprot, 2495static inline int security_file_mmap (struct file *file, unsigned long reqprot,
2491 unsigned long prot, 2496 unsigned long prot,
2492 unsigned long flags) 2497 unsigned long flags,
2498 unsigned long addr,
2499 unsigned long addr_only)
2493{ 2500{
2494 return 0; 2501 return 0;
2495} 2502}
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 3e3cccbb1cac..83783ab0f552 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -50,5 +50,16 @@ int seq_release_private(struct inode *, struct file *);
50 50
51#define SEQ_START_TOKEN ((void *)1) 51#define SEQ_START_TOKEN ((void *)1)
52 52
53/*
54 * Helpers for iteration over list_head-s in seq_files
55 */
56
57extern struct list_head *seq_list_start(struct list_head *head,
58 loff_t pos);
59extern struct list_head *seq_list_start_head(struct list_head *head,
60 loff_t pos);
61extern struct list_head *seq_list_next(void *v, struct list_head *head,
62 loff_t *ppos);
63
53#endif 64#endif
54#endif 65#endif
diff --git a/include/linux/serial.h b/include/linux/serial.h
index 33fc8cb8ddfb..deb714314fb1 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -177,11 +177,5 @@ struct serial_icounter_struct {
177#ifdef __KERNEL__ 177#ifdef __KERNEL__
178#include <linux/compiler.h> 178#include <linux/compiler.h>
179 179
180/* Allow architectures to override entries in serial8250_ports[] at run time: */
181struct uart_port; /* forward declaration */
182extern int early_serial_setup(struct uart_port *port);
183extern int early_serial_console_init(char *options);
184extern int serial8250_start_console(struct uart_port *port, char *options);
185
186#endif /* __KERNEL__ */ 180#endif /* __KERNEL__ */
187#endif /* _LINUX_SERIAL_H */ 181#endif /* _LINUX_SERIAL_H */
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 71310d80c09a..8518fa2a6f89 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -60,4 +60,10 @@ void serial8250_unregister_port(int line);
60void serial8250_suspend_port(int line); 60void serial8250_suspend_port(int line);
61void serial8250_resume_port(int line); 61void serial8250_resume_port(int line);
62 62
63extern int early_serial_setup(struct uart_port *port);
64
65extern int serial8250_find_port(struct uart_port *p);
66extern int serial8250_find_port_for_earlycon(void);
67extern int setup_early_serial8250_console(char *cmdline);
68
63#endif 69#endif
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 7f2c99d66e9d..773d8d8828ad 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -62,8 +62,9 @@
62/* NEC v850. */ 62/* NEC v850. */
63#define PORT_V850E_UART 40 63#define PORT_V850E_UART 40
64 64
65/* DZ */ 65/* DEC */
66#define PORT_DZ 47 66#define PORT_DZ 46
67#define PORT_ZS 47
67 68
68/* Parisc type numbers. */ 69/* Parisc type numbers. */
69#define PORT_MUX 48 70#define PORT_MUX 48
@@ -142,6 +143,9 @@
142/* Micrel KS8695 */ 143/* Micrel KS8695 */
143#define PORT_KS8695 76 144#define PORT_KS8695 76
144 145
146/* Broadcom SB1250, etc. SOC */
147#define PORT_SB1250_DUART 77
148
145 149
146#ifdef __KERNEL__ 150#ifdef __KERNEL__
147 151
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 1ebf0455e224..9f3825014674 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -209,5 +209,7 @@ static inline void serio_unpin_driver(struct serio *serio)
209#define SERIO_PENMOUNT 0x31 209#define SERIO_PENMOUNT 0x31
210#define SERIO_TOUCHRIGHT 0x32 210#define SERIO_TOUCHRIGHT 0x32
211#define SERIO_TOUCHWIN 0x33 211#define SERIO_TOUCHWIN 0x33
212#define SERIO_TAOSEVM 0x34
213#define SERIO_FUJITSU 0x35
212 214
213#endif 215#endif
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 9a5eac508e5e..ea91abe740da 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -6,7 +6,6 @@
6 6
7#ifdef __KERNEL__ 7#ifdef __KERNEL__
8#include <linux/list.h> 8#include <linux/list.h>
9#include <linux/spinlock.h>
10 9
11/* 10/*
12 * Real Time signals may be queued. 11 * Real Time signals may be queued.
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e7367c74e1bb..ce256438e619 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -65,13 +65,20 @@
65 * is able to produce some skb->csum, it MUST use COMPLETE, 65 * is able to produce some skb->csum, it MUST use COMPLETE,
66 * not UNNECESSARY. 66 * not UNNECESSARY.
67 * 67 *
68 * PARTIAL: identical to the case for output below. This may occur
69 * on a packet received directly from another Linux OS, e.g.,
70 * a virtualised Linux kernel on the same host. The packet can
71 * be treated in the same way as UNNECESSARY except that on
72 * output (i.e., forwarding) the checksum must be filled in
73 * by the OS or the hardware.
74 *
68 * B. Checksumming on output. 75 * B. Checksumming on output.
69 * 76 *
70 * NONE: skb is checksummed by protocol or csum is not required. 77 * NONE: skb is checksummed by protocol or csum is not required.
71 * 78 *
72 * PARTIAL: device is required to csum packet as seen by hard_start_xmit 79 * PARTIAL: device is required to csum packet as seen by hard_start_xmit
73 * from skb->transport_header to the end and to record the checksum 80 * from skb->csum_start to the end and to record the checksum
74 * at skb->transport_header + skb->csum. 81 * at skb->csum_start + skb->csum_offset.
75 * 82 *
76 * Device must show its capabilities in dev->features, set 83 * Device must show its capabilities in dev->features, set
77 * at device setup time. 84 * at device setup time.
@@ -82,6 +89,7 @@
82 * TCP/UDP over IPv4. Sigh. Vendors like this 89 * TCP/UDP over IPv4. Sigh. Vendors like this
83 * way by an unknown reason. Though, see comment above 90 * way by an unknown reason. Though, see comment above
84 * about CHECKSUM_UNNECESSARY. 8) 91 * about CHECKSUM_UNNECESSARY. 8)
92 * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead.
85 * 93 *
86 * Any questions? No questions, good. --ANK 94 * Any questions? No questions, good. --ANK
87 */ 95 */
@@ -147,8 +155,8 @@ struct skb_shared_info {
147 155
148/* We divide dataref into two halves. The higher 16 bits hold references 156/* We divide dataref into two halves. The higher 16 bits hold references
149 * to the payload part of skb->data. The lower 16 bits hold references to 157 * to the payload part of skb->data. The lower 16 bits hold references to
150 * the entire skb->data. It is up to the users of the skb to agree on 158 * the entire skb->data. A clone of a headerless skb holds the length of
151 * where the payload starts. 159 * the header in skb->hdr_len.
152 * 160 *
153 * All users must obey the rule that the skb->data reference count must be 161 * All users must obey the rule that the skb->data reference count must be
154 * greater than or equal to the payload reference count. 162 * greater than or equal to the payload reference count.
@@ -196,7 +204,6 @@ typedef unsigned char *sk_buff_data_t;
196 * @sk: Socket we are owned by 204 * @sk: Socket we are owned by
197 * @tstamp: Time we arrived 205 * @tstamp: Time we arrived
198 * @dev: Device we arrived on/are leaving by 206 * @dev: Device we arrived on/are leaving by
199 * @iif: ifindex of device we arrived on
200 * @transport_header: Transport layer header 207 * @transport_header: Transport layer header
201 * @network_header: Network layer header 208 * @network_header: Network layer header
202 * @mac_header: Link layer header 209 * @mac_header: Link layer header
@@ -206,6 +213,7 @@ typedef unsigned char *sk_buff_data_t;
206 * @len: Length of actual data 213 * @len: Length of actual data
207 * @data_len: Data length 214 * @data_len: Data length
208 * @mac_len: Length of link layer header 215 * @mac_len: Length of link layer header
216 * @hdr_len: writable header length of cloned skb
209 * @csum: Checksum (must include start/offset pair) 217 * @csum: Checksum (must include start/offset pair)
210 * @csum_start: Offset from skb->head where checksumming should start 218 * @csum_start: Offset from skb->head where checksumming should start
211 * @csum_offset: Offset from csum_start where checksum should be stored 219 * @csum_offset: Offset from csum_start where checksum should be stored
@@ -227,9 +235,12 @@ typedef unsigned char *sk_buff_data_t;
227 * @mark: Generic packet mark 235 * @mark: Generic packet mark
228 * @nfct: Associated connection, if any 236 * @nfct: Associated connection, if any
229 * @ipvs_property: skbuff is owned by ipvs 237 * @ipvs_property: skbuff is owned by ipvs
238 * @nf_trace: netfilter packet trace flag
230 * @nfctinfo: Relationship of this skb to the connection 239 * @nfctinfo: Relationship of this skb to the connection
231 * @nfct_reasm: netfilter conntrack re-assembly pointer 240 * @nfct_reasm: netfilter conntrack re-assembly pointer
232 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 241 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
242 * @iif: ifindex of device we arrived on
243 * @queue_mapping: Queue mapping for multiqueue devices
233 * @tc_index: Traffic control index 244 * @tc_index: Traffic control index
234 * @tc_verd: traffic control verdict 245 * @tc_verd: traffic control verdict
235 * @dma_cookie: a cookie to one of several possible DMA operations 246 * @dma_cookie: a cookie to one of several possible DMA operations
@@ -245,8 +256,6 @@ struct sk_buff {
245 struct sock *sk; 256 struct sock *sk;
246 ktime_t tstamp; 257 ktime_t tstamp;
247 struct net_device *dev; 258 struct net_device *dev;
248 int iif;
249 /* 4 byte hole on 64 bit*/
250 259
251 struct dst_entry *dst; 260 struct dst_entry *dst;
252 struct sec_path *sp; 261 struct sec_path *sp;
@@ -260,8 +269,9 @@ struct sk_buff {
260 char cb[48]; 269 char cb[48];
261 270
262 unsigned int len, 271 unsigned int len,
263 data_len, 272 data_len;
264 mac_len; 273 __u16 mac_len,
274 hdr_len;
265 union { 275 union {
266 __wsum csum; 276 __wsum csum;
267 struct { 277 struct {
@@ -277,7 +287,8 @@ struct sk_buff {
277 nfctinfo:3; 287 nfctinfo:3;
278 __u8 pkt_type:3, 288 __u8 pkt_type:3,
279 fclone:2, 289 fclone:2,
280 ipvs_property:1; 290 ipvs_property:1,
291 nf_trace:1;
281 __be16 protocol; 292 __be16 protocol;
282 293
283 void (*destructor)(struct sk_buff *skb); 294 void (*destructor)(struct sk_buff *skb);
@@ -288,12 +299,18 @@ struct sk_buff {
288#ifdef CONFIG_BRIDGE_NETFILTER 299#ifdef CONFIG_BRIDGE_NETFILTER
289 struct nf_bridge_info *nf_bridge; 300 struct nf_bridge_info *nf_bridge;
290#endif 301#endif
302
303 int iif;
304 __u16 queue_mapping;
305
291#ifdef CONFIG_NET_SCHED 306#ifdef CONFIG_NET_SCHED
292 __u16 tc_index; /* traffic control index */ 307 __u16 tc_index; /* traffic control index */
293#ifdef CONFIG_NET_CLS_ACT 308#ifdef CONFIG_NET_CLS_ACT
294 __u16 tc_verd; /* traffic control verdict */ 309 __u16 tc_verd; /* traffic control verdict */
295#endif 310#endif
296#endif 311#endif
312 /* 2 byte hole */
313
297#ifdef CONFIG_NET_DMA 314#ifdef CONFIG_NET_DMA
298 dma_cookie_t dma_cookie; 315 dma_cookie_t dma_cookie;
299#endif 316#endif
@@ -1322,6 +1339,20 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
1322} 1339}
1323 1340
1324/** 1341/**
1342 * skb_clone_writable - is the header of a clone writable
1343 * @skb: buffer to check
1344 * @len: length up to which to write
1345 *
1346 * Returns true if modifying the header part of the cloned buffer
1347 * does not requires the data to be copied.
1348 */
1349static inline int skb_clone_writable(struct sk_buff *skb, int len)
1350{
1351 return !skb_header_cloned(skb) &&
1352 skb_headroom(skb) + len <= skb->hdr_len;
1353}
1354
1355/**
1325 * skb_cow - copy header of skb when it is required 1356 * skb_cow - copy header of skb when it is required
1326 * @skb: buffer to cow 1357 * @skb: buffer to cow
1327 * @headroom: needed headroom 1358 * @headroom: needed headroom
@@ -1579,6 +1610,10 @@ static inline ktime_t net_timedelta(ktime_t t)
1579 return ktime_sub(ktime_get_real(), t); 1610 return ktime_sub(ktime_get_real(), t);
1580} 1611}
1581 1612
1613static inline ktime_t net_invalid_timestamp(void)
1614{
1615 return ktime_set(0, 0);
1616}
1582 1617
1583extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); 1618extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len);
1584extern __sum16 __skb_checksum_complete(struct sk_buff *skb); 1619extern __sum16 __skb_checksum_complete(struct sk_buff *skb);
@@ -1604,7 +1639,7 @@ static inline int skb_csum_unnecessary(const struct sk_buff *skb)
1604 * if skb->ip_summed is CHECKSUM_UNNECESSARY which indicates that the 1639 * if skb->ip_summed is CHECKSUM_UNNECESSARY which indicates that the
1605 * hardware has already verified the correctness of the checksum. 1640 * hardware has already verified the correctness of the checksum.
1606 */ 1641 */
1607static inline unsigned int skb_checksum_complete(struct sk_buff *skb) 1642static inline __sum16 skb_checksum_complete(struct sk_buff *skb)
1608{ 1643{
1609 return skb_csum_unnecessary(skb) ? 1644 return skb_csum_unnecessary(skb) ?
1610 0 : __skb_checksum_complete(skb); 1645 0 : __skb_checksum_complete(skb);
@@ -1705,6 +1740,20 @@ static inline void skb_init_secmark(struct sk_buff *skb)
1705{ } 1740{ }
1706#endif 1741#endif
1707 1742
1743static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
1744{
1745#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1746 skb->queue_mapping = queue_mapping;
1747#endif
1748}
1749
1750static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from)
1751{
1752#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1753 to->queue_mapping = from->queue_mapping;
1754#endif
1755}
1756
1708static inline int skb_is_gso(const struct sk_buff *skb) 1757static inline int skb_is_gso(const struct sk_buff *skb)
1709{ 1758{
1710 return skb_shinfo(skb)->gso_size; 1759 return skb_shinfo(skb)->gso_size;
diff --git a/include/linux/slab.h b/include/linux/slab.h
index a015236cc572..d859354b9e51 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -14,8 +14,6 @@
14#include <linux/gfp.h> 14#include <linux/gfp.h>
15#include <linux/types.h> 15#include <linux/types.h>
16 16
17typedef struct kmem_cache kmem_cache_t __deprecated;
18
19/* 17/*
20 * Flags to pass to kmem_cache_create(). 18 * Flags to pass to kmem_cache_create().
21 * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set. 19 * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set.
@@ -33,6 +31,19 @@ typedef struct kmem_cache kmem_cache_t __deprecated;
33#define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ 31#define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */
34 32
35/* 33/*
34 * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests.
35 *
36 * Dereferencing ZERO_SIZE_PTR will lead to a distinct access fault.
37 *
38 * ZERO_SIZE_PTR can be passed to kfree though in the same way that NULL can.
39 * Both make kfree a no-op.
40 */
41#define ZERO_SIZE_PTR ((void *)16)
42
43#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= \
44 (unsigned long)ZERO_SIZE_PTR)
45
46/*
36 * struct kmem_cache related prototypes 47 * struct kmem_cache related prototypes
37 */ 48 */
38void __init kmem_cache_init(void); 49void __init kmem_cache_init(void);
@@ -40,12 +51,9 @@ int slab_is_available(void);
40 51
41struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, 52struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
42 unsigned long, 53 unsigned long,
43 void (*)(void *, struct kmem_cache *, unsigned long),
44 void (*)(void *, struct kmem_cache *, unsigned long)); 54 void (*)(void *, struct kmem_cache *, unsigned long));
45void kmem_cache_destroy(struct kmem_cache *); 55void kmem_cache_destroy(struct kmem_cache *);
46int kmem_cache_shrink(struct kmem_cache *); 56int kmem_cache_shrink(struct kmem_cache *);
47void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
48void *kmem_cache_zalloc(struct kmem_cache *, gfp_t);
49void kmem_cache_free(struct kmem_cache *, void *); 57void kmem_cache_free(struct kmem_cache *, void *);
50unsigned int kmem_cache_size(struct kmem_cache *); 58unsigned int kmem_cache_size(struct kmem_cache *);
51const char *kmem_cache_name(struct kmem_cache *); 59const char *kmem_cache_name(struct kmem_cache *);
@@ -61,17 +69,7 @@ int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
61 */ 69 */
62#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\ 70#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\
63 sizeof(struct __struct), __alignof__(struct __struct),\ 71 sizeof(struct __struct), __alignof__(struct __struct),\
64 (__flags), NULL, NULL) 72 (__flags), NULL)
65
66#ifdef CONFIG_NUMA
67extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
68#else
69static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
70 gfp_t flags, int node)
71{
72 return kmem_cache_alloc(cachep, flags);
73}
74#endif
75 73
76/* 74/*
77 * The largest kmalloc size supported by the slab allocators is 75 * The largest kmalloc size supported by the slab allocators is
@@ -82,8 +80,8 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
82 * to do various tricks to work around compiler limitations in order to 80 * to do various tricks to work around compiler limitations in order to
83 * ensure proper constant folding. 81 * ensure proper constant folding.
84 */ 82 */
85#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT) <= 25 ? \ 83#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT - 1) <= 25 ? \
86 (MAX_ORDER + PAGE_SHIFT) : 25) 84 (MAX_ORDER + PAGE_SHIFT - 1) : 25)
87 85
88#define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH) 86#define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH)
89#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT) 87#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT)
@@ -91,59 +89,50 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
91/* 89/*
92 * Common kmalloc functions provided by all allocators 90 * Common kmalloc functions provided by all allocators
93 */ 91 */
94void *__kmalloc(size_t, gfp_t);
95void *__kzalloc(size_t, gfp_t);
96void * __must_check krealloc(const void *, size_t, gfp_t); 92void * __must_check krealloc(const void *, size_t, gfp_t);
97void kfree(const void *); 93void kfree(const void *);
98size_t ksize(const void *); 94size_t ksize(const void *);
99 95
100/**
101 * kcalloc - allocate memory for an array. The memory is set to zero.
102 * @n: number of elements.
103 * @size: element size.
104 * @flags: the type of memory to allocate.
105 */
106static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
107{
108 if (n != 0 && size > ULONG_MAX / n)
109 return NULL;
110 return __kzalloc(n * size, flags);
111}
112
113/* 96/*
114 * Allocator specific definitions. These are mainly used to establish optimized 97 * Allocator specific definitions. These are mainly used to establish optimized
115 * ways to convert kmalloc() calls to kmem_cache_alloc() invocations by selecting 98 * ways to convert kmalloc() calls to kmem_cache_alloc() invocations by
116 * the appropriate general cache at compile time. 99 * selecting the appropriate general cache at compile time.
100 *
101 * Allocators must define at least:
102 *
103 * kmem_cache_alloc()
104 * __kmalloc()
105 * kmalloc()
106 *
107 * Those wishing to support NUMA must also define:
108 *
109 * kmem_cache_alloc_node()
110 * kmalloc_node()
111 *
112 * See each allocator definition file for additional comments and
113 * implementation notes.
117 */ 114 */
118
119#if defined(CONFIG_SLAB) || defined(CONFIG_SLUB)
120#ifdef CONFIG_SLUB 115#ifdef CONFIG_SLUB
121#include <linux/slub_def.h> 116#include <linux/slub_def.h>
117#elif defined(CONFIG_SLOB)
118#include <linux/slob_def.h>
122#else 119#else
123#include <linux/slab_def.h> 120#include <linux/slab_def.h>
124#endif /* !CONFIG_SLUB */ 121#endif
125#else
126
127/*
128 * Fallback definitions for an allocator not wanting to provide
129 * its own optimized kmalloc definitions (like SLOB).
130 */
131 122
132/** 123/**
133 * kmalloc - allocate memory 124 * kcalloc - allocate memory for an array. The memory is set to zero.
134 * @size: how many bytes of memory are required. 125 * @n: number of elements.
126 * @size: element size.
135 * @flags: the type of memory to allocate. 127 * @flags: the type of memory to allocate.
136 * 128 *
137 * kmalloc is the normal method of allocating memory
138 * in the kernel.
139 *
140 * The @flags argument may be one of: 129 * The @flags argument may be one of:
141 * 130 *
142 * %GFP_USER - Allocate memory on behalf of user. May sleep. 131 * %GFP_USER - Allocate memory on behalf of user. May sleep.
143 * 132 *
144 * %GFP_KERNEL - Allocate normal kernel ram. May sleep. 133 * %GFP_KERNEL - Allocate normal kernel ram. May sleep.
145 * 134 *
146 * %GFP_ATOMIC - Allocation will not sleep. 135 * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools.
147 * For example, use this inside interrupt handlers. 136 * For example, use this inside interrupt handlers.
148 * 137 *
149 * %GFP_HIGHUSER - Allocate pages from high memory. 138 * %GFP_HIGHUSER - Allocate pages from high memory.
@@ -152,18 +141,22 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
152 * 141 *
153 * %GFP_NOFS - Do not make any fs calls while trying to get memory. 142 * %GFP_NOFS - Do not make any fs calls while trying to get memory.
154 * 143 *
144 * %GFP_NOWAIT - Allocation will not sleep.
145 *
146 * %GFP_THISNODE - Allocate node-local memory only.
147 *
148 * %GFP_DMA - Allocation suitable for DMA.
149 * Should only be used for kmalloc() caches. Otherwise, use a
150 * slab created with SLAB_DMA.
151 *
155 * Also it is possible to set different flags by OR'ing 152 * Also it is possible to set different flags by OR'ing
156 * in one or more of the following additional @flags: 153 * in one or more of the following additional @flags:
157 * 154 *
158 * %__GFP_COLD - Request cache-cold pages instead of 155 * %__GFP_COLD - Request cache-cold pages instead of
159 * trying to return cache-warm pages. 156 * trying to return cache-warm pages.
160 * 157 *
161 * %__GFP_DMA - Request memory from the DMA-capable zone.
162 *
163 * %__GFP_HIGH - This allocation has high priority and may use emergency pools. 158 * %__GFP_HIGH - This allocation has high priority and may use emergency pools.
164 * 159 *
165 * %__GFP_HIGHMEM - Allocated memory may be from highmem.
166 *
167 * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail 160 * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail
168 * (think twice before using). 161 * (think twice before using).
169 * 162 *
@@ -173,24 +166,29 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
173 * %__GFP_NOWARN - If allocation fails, don't issue any warnings. 166 * %__GFP_NOWARN - If allocation fails, don't issue any warnings.
174 * 167 *
175 * %__GFP_REPEAT - If allocation fails initially, try once more before failing. 168 * %__GFP_REPEAT - If allocation fails initially, try once more before failing.
169 *
170 * There are other flags available as well, but these are not intended
171 * for general use, and so are not documented here. For a full list of
172 * potential flags, always refer to linux/gfp.h.
176 */ 173 */
177static inline void *kmalloc(size_t size, gfp_t flags) 174static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
178{ 175{
179 return __kmalloc(size, flags); 176 if (n != 0 && size > ULONG_MAX / n)
177 return NULL;
178 return __kmalloc(n * size, flags | __GFP_ZERO);
180} 179}
181 180
181#if !defined(CONFIG_NUMA) && !defined(CONFIG_SLOB)
182/** 182/**
183 * kzalloc - allocate memory. The memory is set to zero. 183 * kmalloc_node - allocate memory from a specific node
184 * @size: how many bytes of memory are required. 184 * @size: how many bytes of memory are required.
185 * @flags: the type of memory to allocate (see kmalloc). 185 * @flags: the type of memory to allocate (see kcalloc).
186 * @node: node to allocate from.
187 *
188 * kmalloc() for non-local nodes, used to allocate from a specific node
189 * if available. Equivalent to kmalloc() in the non-NUMA single-node
190 * case.
186 */ 191 */
187static inline void *kzalloc(size_t size, gfp_t flags)
188{
189 return __kzalloc(size, flags);
190}
191#endif
192
193#ifndef CONFIG_NUMA
194static inline void *kmalloc_node(size_t size, gfp_t flags, int node) 192static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
195{ 193{
196 return kmalloc(size, flags); 194 return kmalloc(size, flags);
@@ -200,7 +198,15 @@ static inline void *__kmalloc_node(size_t size, gfp_t flags, int node)
200{ 198{
201 return __kmalloc(size, flags); 199 return __kmalloc(size, flags);
202} 200}
203#endif /* !CONFIG_NUMA */ 201
202void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
203
204static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
205 gfp_t flags, int node)
206{
207 return kmem_cache_alloc(cachep, flags);
208}
209#endif /* !CONFIG_NUMA && !CONFIG_SLOB */
204 210
205/* 211/*
206 * kmalloc_track_caller is a special version of kmalloc that records the 212 * kmalloc_track_caller is a special version of kmalloc that records the
@@ -245,6 +251,23 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *);
245 251
246#endif /* DEBUG_SLAB */ 252#endif /* DEBUG_SLAB */
247 253
254/*
255 * Shortcuts
256 */
257static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags)
258{
259 return kmem_cache_alloc(k, flags | __GFP_ZERO);
260}
261
262/**
263 * kzalloc - allocate memory. The memory is set to zero.
264 * @size: how many bytes of memory are required.
265 * @flags: the type of memory to allocate (see kmalloc).
266 */
267static inline void *kzalloc(size_t size, gfp_t flags)
268{
269 return kmalloc(size, flags | __GFP_ZERO);
270}
271
248#endif /* __KERNEL__ */ 272#endif /* __KERNEL__ */
249#endif /* _LINUX_SLAB_H */ 273#endif /* _LINUX_SLAB_H */
250
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 8d81a60518e4..32bdc2ffd715 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -25,10 +25,17 @@ struct cache_sizes {
25}; 25};
26extern struct cache_sizes malloc_sizes[]; 26extern struct cache_sizes malloc_sizes[];
27 27
28void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
29void *__kmalloc(size_t size, gfp_t flags);
30
28static inline void *kmalloc(size_t size, gfp_t flags) 31static inline void *kmalloc(size_t size, gfp_t flags)
29{ 32{
30 if (__builtin_constant_p(size)) { 33 if (__builtin_constant_p(size)) {
31 int i = 0; 34 int i = 0;
35
36 if (!size)
37 return ZERO_SIZE_PTR;
38
32#define CACHE(x) \ 39#define CACHE(x) \
33 if (size <= x) \ 40 if (size <= x) \
34 goto found; \ 41 goto found; \
@@ -51,39 +58,18 @@ found:
51 return __kmalloc(size, flags); 58 return __kmalloc(size, flags);
52} 59}
53 60
54static inline void *kzalloc(size_t size, gfp_t flags)
55{
56 if (__builtin_constant_p(size)) {
57 int i = 0;
58#define CACHE(x) \
59 if (size <= x) \
60 goto found; \
61 else \
62 i++;
63#include "kmalloc_sizes.h"
64#undef CACHE
65 {
66 extern void __you_cannot_kzalloc_that_much(void);
67 __you_cannot_kzalloc_that_much();
68 }
69found:
70#ifdef CONFIG_ZONE_DMA
71 if (flags & GFP_DMA)
72 return kmem_cache_zalloc(malloc_sizes[i].cs_dmacachep,
73 flags);
74#endif
75 return kmem_cache_zalloc(malloc_sizes[i].cs_cachep, flags);
76 }
77 return __kzalloc(size, flags);
78}
79
80#ifdef CONFIG_NUMA 61#ifdef CONFIG_NUMA
81extern void *__kmalloc_node(size_t size, gfp_t flags, int node); 62extern void *__kmalloc_node(size_t size, gfp_t flags, int node);
63extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
82 64
83static inline void *kmalloc_node(size_t size, gfp_t flags, int node) 65static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
84{ 66{
85 if (__builtin_constant_p(size)) { 67 if (__builtin_constant_p(size)) {
86 int i = 0; 68 int i = 0;
69
70 if (!size)
71 return ZERO_SIZE_PTR;
72
87#define CACHE(x) \ 73#define CACHE(x) \
88 if (size <= x) \ 74 if (size <= x) \
89 goto found; \ 75 goto found; \
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h
new file mode 100644
index 000000000000..59a3fa476ab9
--- /dev/null
+++ b/include/linux/slob_def.h
@@ -0,0 +1,36 @@
1#ifndef __LINUX_SLOB_DEF_H
2#define __LINUX_SLOB_DEF_H
3
4void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
5
6static inline void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags)
7{
8 return kmem_cache_alloc_node(cachep, flags, -1);
9}
10
11void *__kmalloc_node(size_t size, gfp_t flags, int node);
12
13static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
14{
15 return __kmalloc_node(size, flags, node);
16}
17
18/**
19 * kmalloc - allocate memory
20 * @size: how many bytes of memory are required.
21 * @flags: the type of memory to allocate (see kcalloc).
22 *
23 * kmalloc is the normal method of allocating memory
24 * in the kernel.
25 */
26static inline void *kmalloc(size_t size, gfp_t flags)
27{
28 return __kmalloc_node(size, flags, -1);
29}
30
31static inline void *__kmalloc(size_t size, gfp_t flags)
32{
33 return kmalloc(size, flags);
34}
35
36#endif /* __LINUX_SLOB_DEF_H */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 0764c829d967..124270df8734 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -16,7 +16,9 @@ struct kmem_cache_node {
16 unsigned long nr_partial; 16 unsigned long nr_partial;
17 atomic_long_t nr_slabs; 17 atomic_long_t nr_slabs;
18 struct list_head partial; 18 struct list_head partial;
19#ifdef CONFIG_SLUB_DEBUG
19 struct list_head full; 20 struct list_head full;
21#endif
20}; 22};
21 23
22/* 24/*
@@ -28,7 +30,7 @@ struct kmem_cache {
28 int size; /* The size of an object including meta data */ 30 int size; /* The size of an object including meta data */
29 int objsize; /* The size of an object without meta data */ 31 int objsize; /* The size of an object without meta data */
30 int offset; /* Free pointer offset. */ 32 int offset; /* Free pointer offset. */
31 unsigned int order; 33 int order;
32 34
33 /* 35 /*
34 * Avoid an extra cache line for UP, SMP and for the node local to 36 * Avoid an extra cache line for UP, SMP and for the node local to
@@ -44,7 +46,9 @@ struct kmem_cache {
44 int align; /* Alignment */ 46 int align; /* Alignment */
45 const char *name; /* Name (only for display!) */ 47 const char *name; /* Name (only for display!) */
46 struct list_head list; /* List of slab caches */ 48 struct list_head list; /* List of slab caches */
49#ifdef CONFIG_SLUB_DEBUG
47 struct kobject kobj; /* For sysfs */ 50 struct kobject kobj; /* For sysfs */
51#endif
48 52
49#ifdef CONFIG_NUMA 53#ifdef CONFIG_NUMA
50 int defrag_ratio; 54 int defrag_ratio;
@@ -56,7 +60,13 @@ struct kmem_cache {
56/* 60/*
57 * Kmalloc subsystem. 61 * Kmalloc subsystem.
58 */ 62 */
59#define KMALLOC_SHIFT_LOW 3 63#if defined(ARCH_KMALLOC_MINALIGN) && ARCH_KMALLOC_MINALIGN > 8
64#define KMALLOC_MIN_SIZE ARCH_KMALLOC_MINALIGN
65#else
66#define KMALLOC_MIN_SIZE 8
67#endif
68
69#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE)
60 70
61/* 71/*
62 * We keep the general caches in an array of slab caches that are used for 72 * We keep the general caches in an array of slab caches that are used for
@@ -70,15 +80,15 @@ extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
70 */ 80 */
71static inline int kmalloc_index(size_t size) 81static inline int kmalloc_index(size_t size)
72{ 82{
73 /* 83 if (!size)
74 * We should return 0 if size == 0 but we use the smallest object 84 return 0;
75 * here for SLAB legacy reasons.
76 */
77 WARN_ON_ONCE(size == 0);
78 85
79 if (size > KMALLOC_MAX_SIZE) 86 if (size > KMALLOC_MAX_SIZE)
80 return -1; 87 return -1;
81 88
89 if (size <= KMALLOC_MIN_SIZE)
90 return KMALLOC_SHIFT_LOW;
91
82 if (size > 64 && size <= 96) 92 if (size > 64 && size <= 96)
83 return 1; 93 return 1;
84 if (size > 128 && size <= 192) 94 if (size > 128 && size <= 192)
@@ -150,37 +160,28 @@ static inline struct kmem_cache *kmalloc_slab(size_t size)
150#define SLUB_DMA __GFP_DMA 160#define SLUB_DMA __GFP_DMA
151#else 161#else
152/* Disable DMA functionality */ 162/* Disable DMA functionality */
153#define SLUB_DMA 0 163#define SLUB_DMA (__force gfp_t)0
154#endif 164#endif
155 165
166void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
167void *__kmalloc(size_t size, gfp_t flags);
168
156static inline void *kmalloc(size_t size, gfp_t flags) 169static inline void *kmalloc(size_t size, gfp_t flags)
157{ 170{
158 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { 171 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
159 struct kmem_cache *s = kmalloc_slab(size); 172 struct kmem_cache *s = kmalloc_slab(size);
160 173
161 if (!s) 174 if (!s)
162 return NULL; 175 return ZERO_SIZE_PTR;
163 176
164 return kmem_cache_alloc(s, flags); 177 return kmem_cache_alloc(s, flags);
165 } else 178 } else
166 return __kmalloc(size, flags); 179 return __kmalloc(size, flags);
167} 180}
168 181
169static inline void *kzalloc(size_t size, gfp_t flags)
170{
171 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
172 struct kmem_cache *s = kmalloc_slab(size);
173
174 if (!s)
175 return NULL;
176
177 return kmem_cache_zalloc(s, flags);
178 } else
179 return __kzalloc(size, flags);
180}
181
182#ifdef CONFIG_NUMA 182#ifdef CONFIG_NUMA
183extern void *__kmalloc_node(size_t size, gfp_t flags, int node); 183void *__kmalloc_node(size_t size, gfp_t flags, int node);
184void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
184 185
185static inline void *kmalloc_node(size_t size, gfp_t flags, int node) 186static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
186{ 187{
@@ -188,7 +189,7 @@ static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
188 struct kmem_cache *s = kmalloc_slab(size); 189 struct kmem_cache *s = kmalloc_slab(size);
189 190
190 if (!s) 191 if (!s)
191 return NULL; 192 return ZERO_SIZE_PTR;
192 193
193 return kmem_cache_alloc_node(s, flags, node); 194 return kmem_cache_alloc_node(s, flags, node);
194 } else 195 } else
diff --git a/include/linux/sm501-regs.h b/include/linux/sm501-regs.h
index cc9be4a11861..014e73b31fc0 100644
--- a/include/linux/sm501-regs.h
+++ b/include/linux/sm501-regs.h
@@ -64,6 +64,11 @@
64#define SM501_DEBUG_CONTROL (0x000034) 64#define SM501_DEBUG_CONTROL (0x000034)
65 65
66/* power management */ 66/* power management */
67#define SM501_POWERMODE_P2X_SRC (1<<29)
68#define SM501_POWERMODE_V2X_SRC (1<<20)
69#define SM501_POWERMODE_M_SRC (1<<12)
70#define SM501_POWERMODE_M1_SRC (1<<4)
71
67#define SM501_CURRENT_GATE (0x000038) 72#define SM501_CURRENT_GATE (0x000038)
68#define SM501_CURRENT_CLOCK (0x00003C) 73#define SM501_CURRENT_CLOCK (0x00003C)
69#define SM501_POWER_MODE_0_GATE (0x000040) 74#define SM501_POWER_MODE_0_GATE (0x000040)
@@ -104,6 +109,9 @@
104#define SM501_DEVICEID (0x000060) 109#define SM501_DEVICEID (0x000060)
105/* 0x050100A0 */ 110/* 0x050100A0 */
106 111
112#define SM501_DEVICEID_SM501 (0x05010000)
113#define SM501_DEVICEID_IDMASK (0xffff0000)
114
107#define SM501_PLLCLOCK_COUNT (0x000064) 115#define SM501_PLLCLOCK_COUNT (0x000064)
108#define SM501_MISC_TIMING (0x000068) 116#define SM501_MISC_TIMING (0x000068)
109#define SM501_CURRENT_SDRAM_CLOCK (0x00006C) 117#define SM501_CURRENT_SDRAM_CLOCK (0x00006C)
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 96ac21f8dd73..259a13c3bd98 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -99,11 +99,14 @@ static inline int up_smp_call_function(void)
99static inline void smp_send_reschedule(int cpu) { } 99static inline void smp_send_reschedule(int cpu) { }
100#define num_booting_cpus() 1 100#define num_booting_cpus() 1
101#define smp_prepare_boot_cpu() do {} while (0) 101#define smp_prepare_boot_cpu() do {} while (0)
102static inline int smp_call_function_single(int cpuid, void (*func) (void *info), 102#define smp_call_function_single(cpuid, func, info, retry, wait) \
103 void *info, int retry, int wait) 103({ \
104{ 104 WARN_ON(cpuid != 0); \
105 return -EBUSY; 105 local_irq_disable(); \
106} 106 (func)(info); \
107 local_irq_enable(); \
108 0; \
109})
107 110
108#endif /* !SMP */ 111#endif /* !SMP */
109 112
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h
index cf715a40d833..58962c51dee1 100644
--- a/include/linux/smp_lock.h
+++ b/include/linux/smp_lock.h
@@ -3,7 +3,6 @@
3 3
4#ifdef CONFIG_LOCK_KERNEL 4#ifdef CONFIG_LOCK_KERNEL
5#include <linux/sched.h> 5#include <linux/sched.h>
6#include <linux/spinlock.h>
7 6
8#define kernel_locked() (current->lock_depth >= 0) 7#define kernel_locked() (current->lock_depth >= 0)
9 8
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 6e7c9483a6a6..f852e1afd65a 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -253,6 +253,9 @@ struct ucred {
253 253
254#define MSG_EOF MSG_FIN 254#define MSG_EOF MSG_FIN
255 255
256#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file
257 descriptor received through
258 SCM_RIGHTS */
256#if defined(CONFIG_COMPAT) 259#if defined(CONFIG_COMPAT)
257#define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */ 260#define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */
258#else 261#else
@@ -287,6 +290,7 @@ struct ucred {
287#define SOL_NETLINK 270 290#define SOL_NETLINK 270
288#define SOL_TIPC 271 291#define SOL_TIPC 271
289#define SOL_RXRPC 272 292#define SOL_RXRPC 272
293#define SOL_PPPOL2TP 273
290 294
291/* IPX options */ 295/* IPX options */
292#define IPX_TYPE 1 296#define IPX_TYPE 1
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h
index 34d4b075f7b8..40c7b5d993b9 100644
--- a/include/linux/sonypi.h
+++ b/include/linux/sonypi.h
@@ -153,8 +153,6 @@
153#define SONYPI_COMMAND_GETCAMERAROMVERSION 18 /* obsolete */ 153#define SONYPI_COMMAND_GETCAMERAROMVERSION 18 /* obsolete */
154#define SONYPI_COMMAND_GETCAMERAREVISION 19 /* obsolete */ 154#define SONYPI_COMMAND_GETCAMERAREVISION 19 /* obsolete */
155 155
156int sonypi_camera_command(int command, u8 value);
157
158#endif /* __KERNEL__ */ 156#endif /* __KERNEL__ */
159 157
160#endif /* _SONYPI_H_ */ 158#endif /* _SONYPI_H_ */
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index 3387e44dfd13..334d31411629 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -16,6 +16,20 @@ struct ads7846_platform_data {
16 u16 vref_delay_usecs; /* 0 for external vref; etc */ 16 u16 vref_delay_usecs; /* 0 for external vref; etc */
17 int keep_vref_on:1; /* set to keep vref on for differential 17 int keep_vref_on:1; /* set to keep vref on for differential
18 * measurements as well */ 18 * measurements as well */
19
20 /* Settling time of the analog signals; a function of Vcc and the
21 * capacitance on the X/Y drivers. If set to non-zero, two samples
22 * are taken with settle_delay us apart, and the second one is used.
23 * ~150 uSec with 0.01uF caps.
24 */
25 u16 settle_delay_usecs;
26
27 /* If set to non-zero, after samples are taken this delay is applied
28 * and penirq is rechecked, to help avoid false events. This value
29 * is affected by the material used to build the touch layer.
30 */
31 u16 penirq_recheck_delay_usecs;
32
19 u16 x_plate_ohms; 33 u16 x_plate_ohms;
20 u16 y_plate_ohms; 34 u16 y_plate_ohms;
21 35
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index b6bedc3ee95c..302b81d1d117 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -76,6 +76,7 @@ struct spi_device {
76#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) 76#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
77#define SPI_CS_HIGH 0x04 /* chipselect active high? */ 77#define SPI_CS_HIGH 0x04 /* chipselect active high? */
78#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ 78#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */
79#define SPI_3WIRE 0x10 /* SI/SO signals shared */
79 u8 bits_per_word; 80 u8 bits_per_word;
80 int irq; 81 int irq;
81 void *controller_state; 82 void *controller_state;
@@ -341,9 +342,14 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
341 * chip transactions together. 342 * chip transactions together.
342 * 343 *
343 * (ii) When the transfer is the last one in the message, the chip may 344 * (ii) When the transfer is the last one in the message, the chip may
344 * stay selected until the next transfer. This is purely a performance 345 * stay selected until the next transfer. On multi-device SPI busses
345 * hint; the controller driver may need to select a different device 346 * with nothing blocking messages going to other devices, this is just
346 * for the next message. 347 * a performance hint; starting a message to another device deselects
348 * this one. But in other cases, this can be used to ensure correctness.
349 * Some devices need protocol transactions to be built from a series of
350 * spi_message submissions, where the content of one message is determined
351 * by the results of previous messages and where the whole transaction
352 * ends when the chipselect goes intactive.
347 * 353 *
348 * The code that submits an spi_message (and its spi_transfers) 354 * The code that submits an spi_message (and its spi_transfers)
349 * to the lower layers is responsible for managing its memory. 355 * to the lower layers is responsible for managing its memory.
@@ -480,14 +486,15 @@ static inline void spi_message_free(struct spi_message *m)
480/** 486/**
481 * spi_setup - setup SPI mode and clock rate 487 * spi_setup - setup SPI mode and clock rate
482 * @spi: the device whose settings are being modified 488 * @spi: the device whose settings are being modified
483 * Context: can sleep 489 * Context: can sleep, and no requests are queued to the device
484 * 490 *
485 * SPI protocol drivers may need to update the transfer mode if the 491 * SPI protocol drivers may need to update the transfer mode if the
486 * device doesn't work with the mode 0 default. They may likewise need 492 * device doesn't work with its default. They may likewise need
487 * to update clock rates or word sizes from initial values. This function 493 * to update clock rates or word sizes from initial values. This function
488 * changes those settings, and must be called from a context that can sleep. 494 * changes those settings, and must be called from a context that can sleep.
489 * The changes take effect the next time the device is selected and data 495 * Except for SPI_CS_HIGH, which takes effect immediately, the changes take
490 * is transferred to or from it. 496 * effect the next time the device is selected and data is transferred to
497 * or from it. When this function returns, the spi device is deselected.
491 * 498 *
492 * Note that this call will fail if the protocol driver specifies an option 499 * Note that this call will fail if the protocol driver specifies an option
493 * that the underlying controller or its driver does not support. For 500 * that the underlying controller or its driver does not support. For
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h
index 9dbca629dcfb..b8db32cea1de 100644
--- a/include/linux/spi/spi_bitbang.h
+++ b/include/linux/spi/spi_bitbang.h
@@ -26,6 +26,7 @@ struct spi_bitbang {
26 struct list_head queue; 26 struct list_head queue;
27 u8 busy; 27 u8 busy;
28 u8 use_dma; 28 u8 use_dma;
29 u8 flags; /* extra spi->mode support */
29 30
30 struct spi_master *master; 31 struct spi_master *master;
31 32
diff --git a/include/linux/spi/tle62x0.h b/include/linux/spi/tle62x0.h
new file mode 100644
index 000000000000..60b59187e590
--- /dev/null
+++ b/include/linux/spi/tle62x0.h
@@ -0,0 +1,24 @@
1/*
2 * tle62x0.h - platform glue to Infineon TLE62x0 driver chips
3 *
4 * Copyright 2007 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19*/
20
21struct tle62x0_pdata {
22 unsigned int init_state;
23 unsigned int gpio_count;
24};
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index a946176db638..c376f3b36c89 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -282,6 +282,13 @@ do { \
282 1 : ({ local_irq_restore(flags); 0; }); \ 282 1 : ({ local_irq_restore(flags); 0; }); \
283}) 283})
284 284
285#define write_trylock_irqsave(lock, flags) \
286({ \
287 local_irq_save(flags); \
288 write_trylock(lock) ? \
289 1 : ({ local_irq_restore(flags); 0; }); \
290})
291
285/* 292/*
286 * Locks two spinlocks l1 and l2. 293 * Locks two spinlocks l1 and l2.
287 * l1_first indicates if spinlock l1 should be taken first. 294 * l1_first indicates if spinlock l1 should be taken first.
diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h
index 210549ba4ef4..f6a3a951b79e 100644
--- a/include/linux/spinlock_types.h
+++ b/include/linux/spinlock_types.h
@@ -9,14 +9,14 @@
9 * Released under the General Public License (GPL). 9 * Released under the General Public License (GPL).
10 */ 10 */
11 11
12#include <linux/lockdep.h>
13
14#if defined(CONFIG_SMP) 12#if defined(CONFIG_SMP)
15# include <asm/spinlock_types.h> 13# include <asm/spinlock_types.h>
16#else 14#else
17# include <linux/spinlock_types_up.h> 15# include <linux/spinlock_types_up.h>
18#endif 16#endif
19 17
18#include <linux/lockdep.h>
19
20typedef struct { 20typedef struct {
21 raw_spinlock_t raw_lock; 21 raw_spinlock_t raw_lock;
22#if defined(CONFIG_PREEMPT) && defined(CONFIG_SMP) 22#if defined(CONFIG_PREEMPT) && defined(CONFIG_SMP)
diff --git a/include/linux/spinlock_types_up.h b/include/linux/spinlock_types_up.h
index 27644af20b7c..04135b0e198e 100644
--- a/include/linux/spinlock_types_up.h
+++ b/include/linux/spinlock_types_up.h
@@ -12,14 +12,10 @@
12 * Released under the General Public License (GPL). 12 * Released under the General Public License (GPL).
13 */ 13 */
14 14
15#if defined(CONFIG_DEBUG_SPINLOCK) || \ 15#ifdef CONFIG_DEBUG_SPINLOCK
16 defined(CONFIG_DEBUG_LOCK_ALLOC)
17 16
18typedef struct { 17typedef struct {
19 volatile unsigned int slock; 18 volatile unsigned int slock;
20#ifdef CONFIG_DEBUG_LOCK_ALLOC
21 struct lockdep_map dep_map;
22#endif
23} raw_spinlock_t; 19} raw_spinlock_t;
24 20
25#define __RAW_SPIN_LOCK_UNLOCKED { 1 } 21#define __RAW_SPIN_LOCK_UNLOCKED { 1 }
@@ -34,9 +30,6 @@ typedef struct { } raw_spinlock_t;
34 30
35typedef struct { 31typedef struct {
36 /* no debug version on UP */ 32 /* no debug version on UP */
37#ifdef CONFIG_DEBUG_LOCK_ALLOC
38 struct lockdep_map dep_map;
39#endif
40} raw_rwlock_t; 33} raw_rwlock_t;
41 34
42#define __RAW_RW_LOCK_UNLOCKED { } 35#define __RAW_RW_LOCK_UNLOCKED { }
diff --git a/include/linux/splice.h b/include/linux/splice.h
new file mode 100644
index 000000000000..33e447f98a54
--- /dev/null
+++ b/include/linux/splice.h
@@ -0,0 +1,73 @@
1/*
2 * Function declerations and data structures related to the splice
3 * implementation.
4 *
5 * Copyright (C) 2007 Jens Axboe <jens.axboe@oracle.com>
6 *
7 */
8#ifndef SPLICE_H
9#define SPLICE_H
10
11#include <linux/pipe_fs_i.h>
12
13/*
14 * splice is tied to pipes as a transport (at least for now), so we'll just
15 * add the splice flags here.
16 */
17#define SPLICE_F_MOVE (0x01) /* move pages instead of copying */
18#define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */
19 /* we may still block on the fd we splice */
20 /* from/to, of course */
21#define SPLICE_F_MORE (0x04) /* expect more data */
22#define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */
23
24/*
25 * Passed to the actors
26 */
27struct splice_desc {
28 unsigned int len, total_len; /* current and remaining length */
29 unsigned int flags; /* splice flags */
30 /*
31 * actor() private data
32 */
33 union {
34 void __user *userptr; /* memory to write to */
35 struct file *file; /* file to read/write */
36 void *data; /* cookie */
37 } u;
38 loff_t pos; /* file position */
39};
40
41struct partial_page {
42 unsigned int offset;
43 unsigned int len;
44 unsigned long private;
45};
46
47/*
48 * Passed to splice_to_pipe
49 */
50struct splice_pipe_desc {
51 struct page **pages; /* page map */
52 struct partial_page *partial; /* pages[] may not be contig */
53 int nr_pages; /* number of pages in map */
54 unsigned int flags; /* splice flags */
55 const struct pipe_buf_operations *ops;/* ops associated with output pipe */
56};
57
58typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,
59 struct splice_desc *);
60typedef int (splice_direct_actor)(struct pipe_inode_info *,
61 struct splice_desc *);
62
63extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *,
64 loff_t *, size_t, unsigned int,
65 splice_actor *);
66extern ssize_t __splice_from_pipe(struct pipe_inode_info *,
67 struct splice_desc *, splice_actor *);
68extern ssize_t splice_to_pipe(struct pipe_inode_info *,
69 struct splice_pipe_desc *);
70extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *,
71 splice_direct_actor *);
72
73#endif
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index 1d2b084c0185..e7fa657d0c49 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -13,7 +13,7 @@ extern void save_stack_trace(struct stack_trace *trace);
13extern void print_stack_trace(struct stack_trace *trace, int spaces); 13extern void print_stack_trace(struct stack_trace *trace, int spaces);
14#else 14#else
15# define save_stack_trace(trace) do { } while (0) 15# define save_stack_trace(trace) do { } while (0)
16# define print_stack_trace(trace) do { } while (0) 16# define print_stack_trace(trace, spaces) do { } while (0)
17#endif 17#endif
18 18
19#endif 19#endif
diff --git a/include/linux/string.h b/include/linux/string.h
index 7f2eb6a477f9..836062b7582a 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -105,8 +105,12 @@ extern void * memchr(const void *,int,__kernel_size_t);
105#endif 105#endif
106 106
107extern char *kstrdup(const char *s, gfp_t gfp); 107extern char *kstrdup(const char *s, gfp_t gfp);
108extern char *kstrndup(const char *s, size_t len, gfp_t gfp);
108extern void *kmemdup(const void *src, size_t len, gfp_t gfp); 109extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
109 110
111extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
112extern void argv_free(char **argv);
113
110#ifdef __cplusplus 114#ifdef __cplusplus
111} 115}
112#endif 116#endif
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 534cdc7be58d..7a69ca3bebaf 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -16,6 +16,7 @@
16#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
17 17
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19#include <linux/rcupdate.h>
19 20
20/* size of the nodename buffer */ 21/* size of the nodename buffer */
21#define UNX_MAXNODENAME 32 22#define UNX_MAXNODENAME 32
@@ -30,22 +31,28 @@ struct auth_cred {
30/* 31/*
31 * Client user credentials 32 * Client user credentials
32 */ 33 */
34struct rpc_auth;
35struct rpc_credops;
33struct rpc_cred { 36struct rpc_cred {
34 struct hlist_node cr_hash; /* hash chain */ 37 struct hlist_node cr_hash; /* hash chain */
35 struct rpc_credops * cr_ops; 38 struct list_head cr_lru; /* lru garbage collection */
36 unsigned long cr_expire; /* when to gc */ 39 struct rcu_head cr_rcu;
37 atomic_t cr_count; /* ref count */ 40 struct rpc_auth * cr_auth;
38 unsigned short cr_flags; /* various flags */ 41 const struct rpc_credops *cr_ops;
39#ifdef RPC_DEBUG 42#ifdef RPC_DEBUG
40 unsigned long cr_magic; /* 0x0f4aa4f0 */ 43 unsigned long cr_magic; /* 0x0f4aa4f0 */
41#endif 44#endif
45 unsigned long cr_expire; /* when to gc */
46 unsigned long cr_flags; /* various flags */
47 atomic_t cr_count; /* ref count */
42 48
43 uid_t cr_uid; 49 uid_t cr_uid;
44 50
45 /* per-flavor data */ 51 /* per-flavor data */
46}; 52};
47#define RPCAUTH_CRED_NEW 0x0001 53#define RPCAUTH_CRED_NEW 0
48#define RPCAUTH_CRED_UPTODATE 0x0002 54#define RPCAUTH_CRED_UPTODATE 1
55#define RPCAUTH_CRED_HASHED 2
49 56
50#define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 57#define RPCAUTH_CRED_MAGIC 0x0f4aa4f0
51 58
@@ -56,10 +63,10 @@ struct rpc_cred {
56#define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1) 63#define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1)
57struct rpc_cred_cache { 64struct rpc_cred_cache {
58 struct hlist_head hashtable[RPC_CREDCACHE_NR]; 65 struct hlist_head hashtable[RPC_CREDCACHE_NR];
59 unsigned long nextgc; /* next garbage collection */ 66 spinlock_t lock;
60 unsigned long expire; /* cache expiry interval */
61}; 67};
62 68
69struct rpc_authops;
63struct rpc_auth { 70struct rpc_auth {
64 unsigned int au_cslack; /* call cred size estimate */ 71 unsigned int au_cslack; /* call cred size estimate */
65 /* guess at number of u32's auth adds before 72 /* guess at number of u32's auth adds before
@@ -69,7 +76,7 @@ struct rpc_auth {
69 unsigned int au_verfsize; 76 unsigned int au_verfsize;
70 77
71 unsigned int au_flags; /* various flags */ 78 unsigned int au_flags; /* various flags */
72 struct rpc_authops * au_ops; /* operations */ 79 const struct rpc_authops *au_ops; /* operations */
73 rpc_authflavor_t au_flavor; /* pseudoflavor (note may 80 rpc_authflavor_t au_flavor; /* pseudoflavor (note may
74 * differ from the flavor in 81 * differ from the flavor in
75 * au_ops->au_flavor in gss 82 * au_ops->au_flavor in gss
@@ -115,17 +122,19 @@ struct rpc_credops {
115 void *, __be32 *, void *); 122 void *, __be32 *, void *);
116}; 123};
117 124
118extern struct rpc_authops authunix_ops; 125extern const struct rpc_authops authunix_ops;
119extern struct rpc_authops authnull_ops; 126extern const struct rpc_authops authnull_ops;
120#ifdef CONFIG_SUNRPC_SECURE 127
121extern struct rpc_authops authdes_ops; 128void __init rpc_init_authunix(void);
122#endif 129void __init rpcauth_init_module(void);
130void __exit rpcauth_remove_module(void);
123 131
124int rpcauth_register(struct rpc_authops *); 132int rpcauth_register(const struct rpc_authops *);
125int rpcauth_unregister(struct rpc_authops *); 133int rpcauth_unregister(const struct rpc_authops *);
126struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); 134struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *);
127void rpcauth_destroy(struct rpc_auth *); 135void rpcauth_release(struct rpc_auth *);
128struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); 136struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int);
137void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *);
129struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); 138struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int);
130struct rpc_cred * rpcauth_bindcred(struct rpc_task *); 139struct rpc_cred * rpcauth_bindcred(struct rpc_task *);
131void rpcauth_holdcred(struct rpc_task *); 140void rpcauth_holdcred(struct rpc_task *);
@@ -138,8 +147,9 @@ int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp,
138int rpcauth_refreshcred(struct rpc_task *); 147int rpcauth_refreshcred(struct rpc_task *);
139void rpcauth_invalcred(struct rpc_task *); 148void rpcauth_invalcred(struct rpc_task *);
140int rpcauth_uptodatecred(struct rpc_task *); 149int rpcauth_uptodatecred(struct rpc_task *);
141int rpcauth_init_credcache(struct rpc_auth *, unsigned long); 150int rpcauth_init_credcache(struct rpc_auth *);
142void rpcauth_free_credcache(struct rpc_auth *); 151void rpcauth_destroy_credcache(struct rpc_auth *);
152void rpcauth_clear_credcache(struct rpc_cred_cache *);
143 153
144static inline 154static inline
145struct rpc_cred * get_rpccred(struct rpc_cred *cred) 155struct rpc_cred * get_rpccred(struct rpc_cred *cred)
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h
index 2db2fbf34947..67658e17a375 100644
--- a/include/linux/sunrpc/auth_gss.h
+++ b/include/linux/sunrpc/auth_gss.h
@@ -75,6 +75,7 @@ struct gss_cl_ctx {
75 struct xdr_netobj gc_wire_ctx; 75 struct xdr_netobj gc_wire_ctx;
76 u32 gc_win; 76 u32 gc_win;
77 unsigned long gc_expiry; 77 unsigned long gc_expiry;
78 struct rcu_head gc_rcu;
78}; 79};
79 80
80struct gss_upcall_msg; 81struct gss_upcall_msg;
@@ -85,11 +86,6 @@ struct gss_cred {
85 struct gss_upcall_msg *gc_upcall; 86 struct gss_upcall_msg *gc_upcall;
86}; 87};
87 88
88#define gc_uid gc_base.cr_uid
89#define gc_count gc_base.cr_count
90#define gc_flags gc_base.cr_flags
91#define gc_expire gc_base.cr_expire
92
93#endif /* __KERNEL__ */ 89#endif /* __KERNEL__ */
94#endif /* _LINUX_SUNRPC_AUTH_GSS_H */ 90#endif /* _LINUX_SUNRPC_AUTH_GSS_H */
95 91
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 66611423c8ee..c0d9d14983b3 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -24,8 +24,10 @@ struct rpc_inode;
24 * The high-level client handle 24 * The high-level client handle
25 */ 25 */
26struct rpc_clnt { 26struct rpc_clnt {
27 atomic_t cl_count; /* Number of clones */ 27 struct kref cl_kref; /* Number of references */
28 atomic_t cl_users; /* number of references */ 28 struct list_head cl_clients; /* Global list of clients */
29 struct list_head cl_tasks; /* List of tasks */
30 spinlock_t cl_lock; /* spinlock */
29 struct rpc_xprt * cl_xprt; /* transport */ 31 struct rpc_xprt * cl_xprt; /* transport */
30 struct rpc_procinfo * cl_procinfo; /* procedure info */ 32 struct rpc_procinfo * cl_procinfo; /* procedure info */
31 u32 cl_prog, /* RPC program number */ 33 u32 cl_prog, /* RPC program number */
@@ -41,9 +43,7 @@ struct rpc_clnt {
41 unsigned int cl_softrtry : 1,/* soft timeouts */ 43 unsigned int cl_softrtry : 1,/* soft timeouts */
42 cl_intr : 1,/* interruptible */ 44 cl_intr : 1,/* interruptible */
43 cl_discrtry : 1,/* disconnect before retry */ 45 cl_discrtry : 1,/* disconnect before retry */
44 cl_autobind : 1,/* use getport() */ 46 cl_autobind : 1;/* use getport() */
45 cl_oneshot : 1,/* dispose after use */
46 cl_dead : 1;/* abandoned */
47 47
48 struct rpc_rtt * cl_rtt; /* RTO estimator data */ 48 struct rpc_rtt * cl_rtt; /* RTO estimator data */
49 49
@@ -98,6 +98,7 @@ struct rpc_create_args {
98 int protocol; 98 int protocol;
99 struct sockaddr *address; 99 struct sockaddr *address;
100 size_t addrsize; 100 size_t addrsize;
101 struct sockaddr *saddress;
101 struct rpc_timeout *timeout; 102 struct rpc_timeout *timeout;
102 char *servername; 103 char *servername;
103 struct rpc_program *program; 104 struct rpc_program *program;
@@ -110,20 +111,20 @@ struct rpc_create_args {
110#define RPC_CLNT_CREATE_HARDRTRY (1UL << 0) 111#define RPC_CLNT_CREATE_HARDRTRY (1UL << 0)
111#define RPC_CLNT_CREATE_INTR (1UL << 1) 112#define RPC_CLNT_CREATE_INTR (1UL << 1)
112#define RPC_CLNT_CREATE_AUTOBIND (1UL << 2) 113#define RPC_CLNT_CREATE_AUTOBIND (1UL << 2)
113#define RPC_CLNT_CREATE_ONESHOT (1UL << 3) 114#define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 3)
114#define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 4) 115#define RPC_CLNT_CREATE_NOPING (1UL << 4)
115#define RPC_CLNT_CREATE_NOPING (1UL << 5) 116#define RPC_CLNT_CREATE_DISCRTRY (1UL << 5)
116#define RPC_CLNT_CREATE_DISCRTRY (1UL << 6)
117 117
118struct rpc_clnt *rpc_create(struct rpc_create_args *args); 118struct rpc_clnt *rpc_create(struct rpc_create_args *args);
119struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, 119struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
120 struct rpc_program *, int); 120 struct rpc_program *, int);
121struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); 121struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
122int rpc_shutdown_client(struct rpc_clnt *); 122void rpc_shutdown_client(struct rpc_clnt *);
123int rpc_destroy_client(struct rpc_clnt *);
124void rpc_release_client(struct rpc_clnt *); 123void rpc_release_client(struct rpc_clnt *);
124
125int rpcb_register(u32, u32, int, unsigned short, int *); 125int rpcb_register(u32, u32, int, unsigned short, int *);
126void rpcb_getport(struct rpc_task *); 126int rpcb_getport_sync(struct sockaddr_in *, __u32, __u32, int);
127void rpcb_getport_async(struct rpc_task *);
127 128
128void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); 129void rpc_call_setup(struct rpc_task *, struct rpc_message *, int);
129 130
@@ -132,20 +133,16 @@ int rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg,
132 void *calldata); 133 void *calldata);
133int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, 134int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg,
134 int flags); 135 int flags);
136struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred,
137 int flags);
135void rpc_restart_call(struct rpc_task *); 138void rpc_restart_call(struct rpc_task *);
136void rpc_clnt_sigmask(struct rpc_clnt *clnt, sigset_t *oldset); 139void rpc_clnt_sigmask(struct rpc_clnt *clnt, sigset_t *oldset);
137void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset); 140void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset);
138void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); 141void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
139size_t rpc_max_payload(struct rpc_clnt *); 142size_t rpc_max_payload(struct rpc_clnt *);
140void rpc_force_rebind(struct rpc_clnt *); 143void rpc_force_rebind(struct rpc_clnt *);
141int rpc_ping(struct rpc_clnt *clnt, int flags);
142size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); 144size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t);
143char * rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); 145char * rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
144 146
145/*
146 * Helper function for NFSroot support
147 */
148int rpcb_getport_external(struct sockaddr_in *, __u32, __u32, int);
149
150#endif /* __KERNEL__ */ 147#endif /* __KERNEL__ */
151#endif /* _LINUX_SUNRPC_CLNT_H */ 148#endif /* _LINUX_SUNRPC_CLNT_H */
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 5eca9e442051..459c5fc11d51 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -58,6 +58,7 @@ u32 gss_unwrap(
58u32 gss_delete_sec_context( 58u32 gss_delete_sec_context(
59 struct gss_ctx **ctx_id); 59 struct gss_ctx **ctx_id);
60 60
61u32 gss_svc_to_pseudoflavor(struct gss_api_mech *, u32 service);
61u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); 62u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor);
62char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); 63char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service);
63 64
@@ -77,7 +78,7 @@ struct gss_api_mech {
77 struct module *gm_owner; 78 struct module *gm_owner;
78 struct xdr_netobj gm_oid; 79 struct xdr_netobj gm_oid;
79 char *gm_name; 80 char *gm_name;
80 struct gss_api_ops *gm_ops; 81 const struct gss_api_ops *gm_ops;
81 /* pseudoflavors supported by this mechanism: */ 82 /* pseudoflavors supported by this mechanism: */
82 int gm_pf_num; 83 int gm_pf_num;
83 struct pf_desc * gm_pfs; 84 struct pf_desc * gm_pfs;
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index ad293760f6eb..51b977a4ca20 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -23,9 +23,11 @@ struct rpc_inode {
23 void *private; 23 void *private;
24 struct list_head pipe; 24 struct list_head pipe;
25 struct list_head in_upcall; 25 struct list_head in_upcall;
26 struct list_head in_downcall;
26 int pipelen; 27 int pipelen;
27 int nreaders; 28 int nreaders;
28 int nwriters; 29 int nwriters;
30 int nkern_readwriters;
29 wait_queue_head_t waitq; 31 wait_queue_head_t waitq;
30#define RPC_PIPE_WAIT_FOR_OPEN 1 32#define RPC_PIPE_WAIT_FOR_OPEN 1
31 int flags; 33 int flags;
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 2047fb202a13..8ea077db0099 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -98,7 +98,6 @@ struct rpc_task {
98 unsigned short tk_pid; /* debugging aid */ 98 unsigned short tk_pid; /* debugging aid */
99#endif 99#endif
100}; 100};
101#define tk_auth tk_client->cl_auth
102#define tk_xprt tk_client->cl_xprt 101#define tk_xprt tk_client->cl_xprt
103 102
104/* support walking a list of tasks on a wait queue */ 103/* support walking a list of tasks on a wait queue */
@@ -110,11 +109,6 @@ struct rpc_task {
110 if (!list_empty(head) && \ 109 if (!list_empty(head) && \
111 ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1)) 110 ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1))
112 111
113/* .. and walking list of all tasks */
114#define alltask_for_each(task, pos, head) \
115 list_for_each(pos, head) \
116 if ((task=list_entry(pos, struct rpc_task, tk_task)),1)
117
118typedef void (*rpc_action)(struct rpc_task *); 112typedef void (*rpc_action)(struct rpc_task *);
119 113
120struct rpc_call_ops { 114struct rpc_call_ops {
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 4a7ae8ab6eb8..8531a70da73d 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -212,6 +212,7 @@ struct svc_rqst {
212 struct svc_pool * rq_pool; /* thread pool */ 212 struct svc_pool * rq_pool; /* thread pool */
213 struct svc_procedure * rq_procinfo; /* procedure info */ 213 struct svc_procedure * rq_procinfo; /* procedure info */
214 struct auth_ops * rq_authop; /* authentication flavour */ 214 struct auth_ops * rq_authop; /* authentication flavour */
215 u32 rq_flavor; /* pseudoflavor */
215 struct svc_cred rq_cred; /* auth info */ 216 struct svc_cred rq_cred; /* auth info */
216 struct sk_buff * rq_skbuff; /* fast recv inet buffer */ 217 struct sk_buff * rq_skbuff; /* fast recv inet buffer */
217 struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */ 218 struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */
@@ -248,12 +249,13 @@ struct svc_rqst {
248 */ 249 */
249 /* Catering to nfsd */ 250 /* Catering to nfsd */
250 struct auth_domain * rq_client; /* RPC peer info */ 251 struct auth_domain * rq_client; /* RPC peer info */
252 struct auth_domain * rq_gssclient; /* "gss/"-style peer info */
251 struct svc_cacherep * rq_cacherep; /* cache info */ 253 struct svc_cacherep * rq_cacherep; /* cache info */
252 struct knfsd_fh * rq_reffh; /* Referrence filehandle, used to 254 struct knfsd_fh * rq_reffh; /* Referrence filehandle, used to
253 * determine what device number 255 * determine what device number
254 * to report (real or virtual) 256 * to report (real or virtual)
255 */ 257 */
256 int rq_sendfile_ok; /* turned off in gss privacy 258 int rq_splice_ok; /* turned off in gss privacy
257 * to prevent encrypting page 259 * to prevent encrypting page
258 * cache pages */ 260 * cache pages */
259 wait_queue_head_t rq_wait; /* synchronization */ 261 wait_queue_head_t rq_wait; /* synchronization */
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
index de92619b0826..22e1ef8e200e 100644
--- a/include/linux/sunrpc/svcauth.h
+++ b/include/linux/sunrpc/svcauth.h
@@ -127,6 +127,7 @@ extern struct auth_domain *auth_unix_lookup(struct in_addr addr);
127extern int auth_unix_forget_old(struct auth_domain *dom); 127extern int auth_unix_forget_old(struct auth_domain *dom);
128extern void svcauth_unix_purge(void); 128extern void svcauth_unix_purge(void);
129extern void svcauth_unix_info_release(void *); 129extern void svcauth_unix_info_release(void *);
130extern int svcauth_unix_set_client(struct svc_rqst *rqstp);
130 131
131static inline unsigned long hash_str(char *name, int bits) 132static inline unsigned long hash_str(char *name, int bits)
132{ 133{
diff --git a/include/linux/sunrpc/svcauth_gss.h b/include/linux/sunrpc/svcauth_gss.h
index 5a5db16ab660..417a1def56db 100644
--- a/include/linux/sunrpc/svcauth_gss.h
+++ b/include/linux/sunrpc/svcauth_gss.h
@@ -22,6 +22,7 @@
22int gss_svc_init(void); 22int gss_svc_init(void);
23void gss_svc_shutdown(void); 23void gss_svc_shutdown(void);
24int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name); 24int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name);
25u32 svcauth_gss_flavor(struct auth_domain *dom);
25 26
26#endif /* __KERNEL__ */ 27#endif /* __KERNEL__ */
27#endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */ 28#endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index e21dd93ac4b7..a53e0fa855d2 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -59,6 +59,7 @@ struct svc_sock {
59 /* cache of various info for TCP sockets */ 59 /* cache of various info for TCP sockets */
60 void *sk_info_authunix; 60 void *sk_info_authunix;
61 61
62 struct sockaddr_storage sk_local; /* local address */
62 struct sockaddr_storage sk_remote; /* remote peer's address */ 63 struct sockaddr_storage sk_remote; /* remote peer's address */
63 int sk_remotelen; /* length of address */ 64 int sk_remotelen; /* length of address */
64}; 65};
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 9e340fa23c06..c6b53d181bfa 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -12,6 +12,7 @@
12#include <linux/uio.h> 12#include <linux/uio.h>
13#include <asm/byteorder.h> 13#include <asm/byteorder.h>
14#include <linux/scatterlist.h> 14#include <linux/scatterlist.h>
15#include <linux/smp_lock.h>
15 16
16/* 17/*
17 * Buffer adjustment 18 * Buffer adjustment
@@ -36,6 +37,21 @@ struct xdr_netobj {
36typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); 37typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj);
37 38
38/* 39/*
40 * We're still requiring the BKL in the xdr code until it's been
41 * more carefully audited, at which point this wrapper will become
42 * unnecessary.
43 */
44static inline int rpc_call_xdrproc(kxdrproc_t xdrproc, void *rqstp, __be32 *data, void *obj)
45{
46 int ret;
47
48 lock_kernel();
49 ret = xdrproc(rqstp, data, obj);
50 unlock_kernel();
51 return ret;
52}
53
54/*
39 * Basic structure for transmission/reception of a client XDR message. 55 * Basic structure for transmission/reception of a client XDR message.
40 * Features a header (for a linear buffer containing RPC headers 56 * Features a header (for a linear buffer containing RPC headers
41 * and the data payload for short messages), and then an array of 57 * and the data payload for short messages), and then an array of
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 34f7590506fa..d11cedd14f0f 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -17,6 +17,8 @@
17#include <linux/sunrpc/xdr.h> 17#include <linux/sunrpc/xdr.h>
18#include <linux/sunrpc/msg_prot.h> 18#include <linux/sunrpc/msg_prot.h>
19 19
20#ifdef __KERNEL__
21
20extern unsigned int xprt_udp_slot_table_entries; 22extern unsigned int xprt_udp_slot_table_entries;
21extern unsigned int xprt_tcp_slot_table_entries; 23extern unsigned int xprt_tcp_slot_table_entries;
22 24
@@ -194,7 +196,13 @@ struct rpc_xprt {
194 char * address_strings[RPC_DISPLAY_MAX]; 196 char * address_strings[RPC_DISPLAY_MAX];
195}; 197};
196 198
197#ifdef __KERNEL__ 199struct rpc_xprtsock_create {
200 int proto; /* IPPROTO_UDP or IPPROTO_TCP */
201 struct sockaddr * srcaddr; /* optional local address */
202 struct sockaddr * dstaddr; /* remote peer address */
203 size_t addrlen;
204 struct rpc_timeout * timeout; /* optional timeout parameters */
205};
198 206
199/* 207/*
200 * Transport operations used by ULPs 208 * Transport operations used by ULPs
@@ -204,7 +212,7 @@ void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long
204/* 212/*
205 * Generic internal transport functions 213 * Generic internal transport functions
206 */ 214 */
207struct rpc_xprt * xprt_create_transport(int proto, struct sockaddr *addr, size_t size, struct rpc_timeout *toparms); 215struct rpc_xprt * xprt_create_transport(struct rpc_xprtsock_create *args);
208void xprt_connect(struct rpc_task *task); 216void xprt_connect(struct rpc_task *task);
209void xprt_reserve(struct rpc_task *task); 217void xprt_reserve(struct rpc_task *task);
210int xprt_reserve_xprt(struct rpc_task *task); 218int xprt_reserve_xprt(struct rpc_task *task);
@@ -242,8 +250,8 @@ void xprt_disconnect(struct rpc_xprt *xprt);
242/* 250/*
243 * Socket transport setup operations 251 * Socket transport setup operations
244 */ 252 */
245struct rpc_xprt * xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to); 253struct rpc_xprt * xs_setup_udp(struct rpc_xprtsock_create *args);
246struct rpc_xprt * xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to); 254struct rpc_xprt * xs_setup_tcp(struct rpc_xprtsock_create *args);
247int init_socket_xprt(void); 255int init_socket_xprt(void);
248void cleanup_socket_xprt(void); 256void cleanup_socket_xprt(void);
249 257
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 9c7cb6430666..e8e6da394c92 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -43,14 +43,19 @@ static inline void pm_restore_console(void) {}
43 * @prepare: prepare system for hibernation 43 * @prepare: prepare system for hibernation
44 * @enter: shut down system after state has been saved to disk 44 * @enter: shut down system after state has been saved to disk
45 * @finish: finish/clean up after state has been reloaded 45 * @finish: finish/clean up after state has been reloaded
46 * @pre_restore: prepare system for the restoration from a hibernation image
47 * @restore_cleanup: clean up after a failing image restoration
46 */ 48 */
47struct hibernation_ops { 49struct hibernation_ops {
48 int (*prepare)(void); 50 int (*prepare)(void);
49 int (*enter)(void); 51 int (*enter)(void);
50 void (*finish)(void); 52 void (*finish)(void);
53 int (*pre_restore)(void);
54 void (*restore_cleanup)(void);
51}; 55};
52 56
53#if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) 57#ifdef CONFIG_PM
58#ifdef CONFIG_SOFTWARE_SUSPEND
54/* kernel/power/snapshot.c */ 59/* kernel/power/snapshot.c */
55extern void __register_nosave_region(unsigned long b, unsigned long e, int km); 60extern void __register_nosave_region(unsigned long b, unsigned long e, int km);
56static inline void register_nosave_region(unsigned long b, unsigned long e) 61static inline void register_nosave_region(unsigned long b, unsigned long e)
@@ -68,16 +73,14 @@ extern unsigned long get_safe_page(gfp_t gfp_mask);
68 73
69extern void hibernation_set_ops(struct hibernation_ops *ops); 74extern void hibernation_set_ops(struct hibernation_ops *ops);
70extern int hibernate(void); 75extern int hibernate(void);
71#else 76#else /* CONFIG_SOFTWARE_SUSPEND */
72static inline void register_nosave_region(unsigned long b, unsigned long e) {}
73static inline void register_nosave_region_late(unsigned long b, unsigned long e) {}
74static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } 77static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
75static inline void swsusp_set_page_free(struct page *p) {} 78static inline void swsusp_set_page_free(struct page *p) {}
76static inline void swsusp_unset_page_free(struct page *p) {} 79static inline void swsusp_unset_page_free(struct page *p) {}
77 80
78static inline void hibernation_set_ops(struct hibernation_ops *ops) {} 81static inline void hibernation_set_ops(struct hibernation_ops *ops) {}
79static inline int hibernate(void) { return -ENOSYS; } 82static inline int hibernate(void) { return -ENOSYS; }
80#endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */ 83#endif /* CONFIG_SOFTWARE_SUSPEND */
81 84
82void save_processor_state(void); 85void save_processor_state(void);
83void restore_processor_state(void); 86void restore_processor_state(void);
@@ -85,4 +88,43 @@ struct saved_context;
85void __save_processor_state(struct saved_context *ctxt); 88void __save_processor_state(struct saved_context *ctxt);
86void __restore_processor_state(struct saved_context *ctxt); 89void __restore_processor_state(struct saved_context *ctxt);
87 90
91/* kernel/power/main.c */
92extern struct blocking_notifier_head pm_chain_head;
93
94static inline int register_pm_notifier(struct notifier_block *nb)
95{
96 return blocking_notifier_chain_register(&pm_chain_head, nb);
97}
98
99static inline int unregister_pm_notifier(struct notifier_block *nb)
100{
101 return blocking_notifier_chain_unregister(&pm_chain_head, nb);
102}
103
104#define pm_notifier(fn, pri) { \
105 static struct notifier_block fn##_nb = \
106 { .notifier_call = fn, .priority = pri }; \
107 register_pm_notifier(&fn##_nb); \
108}
109#else /* CONFIG_PM */
110
111static inline int register_pm_notifier(struct notifier_block *nb)
112{
113 return 0;
114}
115
116static inline int unregister_pm_notifier(struct notifier_block *nb)
117{
118 return 0;
119}
120
121#define pm_notifier(fn, pri) do { (void)(fn); } while (0)
122#endif /* CONFIG_PM */
123
124#if !defined CONFIG_SOFTWARE_SUSPEND || !defined(CONFIG_PM)
125static inline void register_nosave_region(unsigned long b, unsigned long e)
126{
127}
128#endif
129
88#endif /* _LINUX_SWSUSP_H */ 130#endif /* _LINUX_SWSUSP_H */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 006868881346..665f85f2a3af 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -188,7 +188,8 @@ extern int rotate_reclaimable_page(struct page *page);
188extern void swap_setup(void); 188extern void swap_setup(void);
189 189
190/* linux/mm/vmscan.c */ 190/* linux/mm/vmscan.c */
191extern unsigned long try_to_free_pages(struct zone **, gfp_t); 191extern unsigned long try_to_free_pages(struct zone **zones, int order,
192 gfp_t gfp_mask);
192extern unsigned long shrink_all_memory(unsigned long nr_pages); 193extern unsigned long shrink_all_memory(unsigned long nr_pages);
193extern int vm_swappiness; 194extern int vm_swappiness;
194extern int remove_mapping(struct address_space *mapping, struct page *page); 195extern int remove_mapping(struct address_space *mapping, struct page *page);
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index b02070eac422..61def7c8fbb3 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -549,7 +549,7 @@ asmlinkage long sys_inotify_rm_watch(int fd, u32 wd);
549asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, 549asmlinkage long sys_spu_run(int fd, __u32 __user *unpc,
550 __u32 __user *ustatus); 550 __u32 __user *ustatus);
551asmlinkage long sys_spu_create(const char __user *name, 551asmlinkage long sys_spu_create(const char __user *name,
552 unsigned int flags, mode_t mode); 552 unsigned int flags, mode_t mode, int fd);
553 553
554asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode, 554asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode,
555 unsigned dev); 555 unsigned dev);
@@ -598,6 +598,8 @@ asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags);
598 598
599asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, 599asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
600 unsigned int flags); 600 unsigned int flags);
601asmlinkage long sys_sync_file_range2(int fd, unsigned int flags,
602 loff_t offset, loff_t nbytes);
601asmlinkage long sys_get_robust_list(int pid, 603asmlinkage long sys_get_robust_list(int pid,
602 struct robust_list_head __user * __user *head_ptr, 604 struct robust_list_head __user * __user *head_ptr,
603 size_t __user *len_ptr); 605 size_t __user *len_ptr);
@@ -608,6 +610,7 @@ asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemas
608asmlinkage long sys_timerfd(int ufd, int clockid, int flags, 610asmlinkage long sys_timerfd(int ufd, int clockid, int flags,
609 const struct itimerspec __user *utmr); 611 const struct itimerspec __user *utmr);
610asmlinkage long sys_eventfd(unsigned int count); 612asmlinkage long sys_eventfd(unsigned int count);
613asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
611 614
612int kernel_execve(const char *filename, char *const argv[], char *const envp[]); 615int kernel_execve(const char *filename, char *const argv[], char *const envp[]);
613 616
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index e699ab279c2c..e285746588d6 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -101,8 +101,7 @@ struct sysdev_attribute {
101 101
102#define _SYSDEV_ATTR(_name,_mode,_show,_store) \ 102#define _SYSDEV_ATTR(_name,_mode,_show,_store) \
103{ \ 103{ \
104 .attr = { .name = __stringify(_name), .mode = _mode, \ 104 .attr = { .name = __stringify(_name), .mode = _mode }, \
105 .owner = THIS_MODULE }, \
106 .show = _show, \ 105 .show = _show, \
107 .store = _store, \ 106 .store = _store, \
108} 107}
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 7d5d1ec95c2e..be8228e50a27 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -19,10 +19,15 @@ struct kobject;
19struct module; 19struct module;
20struct nameidata; 20struct nameidata;
21struct dentry; 21struct dentry;
22struct sysfs_dirent;
22 23
24/* FIXME
25 * The *owner field is no longer used, but leave around
26 * until the tree gets cleaned up fully.
27 */
23struct attribute { 28struct attribute {
24 const char * name; 29 const char * name;
25 struct module * owner; 30 struct module * owner;
26 mode_t mode; 31 mode_t mode;
27}; 32};
28 33
@@ -39,14 +44,14 @@ struct attribute_group {
39 */ 44 */
40 45
41#define __ATTR(_name,_mode,_show,_store) { \ 46#define __ATTR(_name,_mode,_show,_store) { \
42 .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \ 47 .attr = {.name = __stringify(_name), .mode = _mode }, \
43 .show = _show, \ 48 .show = _show, \
44 .store = _store, \ 49 .store = _store, \
45} 50}
46 51
47#define __ATTR_RO(_name) { \ 52#define __ATTR_RO(_name) { \
48 .attr = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE }, \ 53 .attr = { .name = __stringify(_name), .mode = 0444 }, \
49 .show = _name##_show, \ 54 .show = _name##_show, \
50} 55}
51 56
52#define __ATTR_NULL { .attr = { .name = NULL } } 57#define __ATTR_NULL { .attr = { .name = NULL } }
@@ -59,8 +64,10 @@ struct bin_attribute {
59 struct attribute attr; 64 struct attribute attr;
60 size_t size; 65 size_t size;
61 void *private; 66 void *private;
62 ssize_t (*read)(struct kobject *, char *, loff_t, size_t); 67 ssize_t (*read)(struct kobject *, struct bin_attribute *,
63 ssize_t (*write)(struct kobject *, char *, loff_t, size_t); 68 char *, loff_t, size_t);
69 ssize_t (*write)(struct kobject *, struct bin_attribute *,
70 char *, loff_t, size_t);
64 int (*mmap)(struct kobject *, struct bin_attribute *attr, 71 int (*mmap)(struct kobject *, struct bin_attribute *attr,
65 struct vm_area_struct *vma); 72 struct vm_area_struct *vma);
66}; 73};
@@ -70,12 +77,16 @@ struct sysfs_ops {
70 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); 77 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
71}; 78};
72 79
80#define SYSFS_TYPE_MASK 0x00ff
73#define SYSFS_ROOT 0x0001 81#define SYSFS_ROOT 0x0001
74#define SYSFS_DIR 0x0002 82#define SYSFS_DIR 0x0002
75#define SYSFS_KOBJ_ATTR 0x0004 83#define SYSFS_KOBJ_ATTR 0x0004
76#define SYSFS_KOBJ_BIN_ATTR 0x0008 84#define SYSFS_KOBJ_BIN_ATTR 0x0008
77#define SYSFS_KOBJ_LINK 0x0020 85#define SYSFS_KOBJ_LINK 0x0020
78#define SYSFS_NOT_PINNED (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR | SYSFS_KOBJ_LINK) 86#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK)
87
88#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK
89#define SYSFS_FLAG_REMOVED 0x0100
79 90
80#ifdef CONFIG_SYSFS 91#ifdef CONFIG_SYSFS
81 92
@@ -83,13 +94,14 @@ extern int sysfs_schedule_callback(struct kobject *kobj,
83 void (*func)(void *), void *data, struct module *owner); 94 void (*func)(void *), void *data, struct module *owner);
84 95
85extern int __must_check 96extern int __must_check
86sysfs_create_dir(struct kobject *, struct dentry *); 97sysfs_create_dir(struct kobject *kobj, struct sysfs_dirent *shadow_parent_sd);
87 98
88extern void 99extern void
89sysfs_remove_dir(struct kobject *); 100sysfs_remove_dir(struct kobject *);
90 101
91extern int __must_check 102extern int __must_check
92sysfs_rename_dir(struct kobject *, struct dentry *, const char *new_name); 103sysfs_rename_dir(struct kobject *kobj, struct sysfs_dirent *new_parent_sd,
104 const char *new_name);
93 105
94extern int __must_check 106extern int __must_check
95sysfs_move_dir(struct kobject *, struct kobject *); 107sysfs_move_dir(struct kobject *, struct kobject *);
@@ -129,8 +141,8 @@ void sysfs_notify(struct kobject * k, char *dir, char *attr);
129 141
130extern int sysfs_make_shadowed_dir(struct kobject *kobj, 142extern int sysfs_make_shadowed_dir(struct kobject *kobj,
131 void * (*follow_link)(struct dentry *, struct nameidata *)); 143 void * (*follow_link)(struct dentry *, struct nameidata *));
132extern struct dentry *sysfs_create_shadow_dir(struct kobject *kobj); 144extern struct sysfs_dirent *sysfs_create_shadow_dir(struct kobject *kobj);
133extern void sysfs_remove_shadow_dir(struct dentry *dir); 145extern void sysfs_remove_shadow_dir(struct sysfs_dirent *shadow_sd);
134 146
135extern int __must_check sysfs_init(void); 147extern int __must_check sysfs_init(void);
136 148
@@ -142,7 +154,8 @@ static inline int sysfs_schedule_callback(struct kobject *kobj,
142 return -ENOSYS; 154 return -ENOSYS;
143} 155}
144 156
145static inline int sysfs_create_dir(struct kobject * k, struct dentry *shadow) 157static inline int sysfs_create_dir(struct kobject *kobj,
158 struct sysfs_dirent *shadow_parent_sd)
146{ 159{
147 return 0; 160 return 0;
148} 161}
@@ -152,9 +165,9 @@ static inline void sysfs_remove_dir(struct kobject * k)
152 ; 165 ;
153} 166}
154 167
155static inline int sysfs_rename_dir(struct kobject * k, 168static inline int sysfs_rename_dir(struct kobject *kobj,
156 struct dentry *new_parent, 169 struct sysfs_dirent *new_parent_sd,
157 const char *new_name) 170 const char *new_name)
158{ 171{
159 return 0; 172 return 0;
160} 173}
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
index a46104a28f66..dce1ed204972 100644
--- a/include/linux/taskstats.h
+++ b/include/linux/taskstats.h
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33 33
34#define TASKSTATS_VERSION 4 34#define TASKSTATS_VERSION 5
35#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN 35#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
36 * in linux/sched.h */ 36 * in linux/sched.h */
37 37
@@ -149,6 +149,9 @@ struct taskstats {
149 __u64 read_bytes; /* bytes of read I/O */ 149 __u64 read_bytes; /* bytes of read I/O */
150 __u64 write_bytes; /* bytes of write I/O */ 150 __u64 write_bytes; /* bytes of write I/O */
151 __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */ 151 __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */
152
153 __u64 nvcsw; /* voluntary_ctxt_switches */
154 __u64 nivcsw; /* nonvoluntary_ctxt_switches */
152}; 155};
153 156
154 157
diff --git a/include/linux/time.h b/include/linux/time.h
index dda9be685ab6..e6aea5146e5d 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -4,6 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7# include <linux/cache.h>
7# include <linux/seqlock.h> 8# include <linux/seqlock.h>
8#endif 9#endif
9 10
@@ -36,7 +37,8 @@ struct timezone {
36#define NSEC_PER_SEC 1000000000L 37#define NSEC_PER_SEC 1000000000L
37#define FSEC_PER_SEC 1000000000000000L 38#define FSEC_PER_SEC 1000000000000000L
38 39
39static inline int timespec_equal(struct timespec *a, struct timespec *b) 40static inline int timespec_equal(const struct timespec *a,
41 const struct timespec *b)
40{ 42{
41 return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); 43 return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec);
42} 44}
@@ -93,6 +95,8 @@ extern struct timespec wall_to_monotonic;
93extern seqlock_t xtime_lock __attribute__((weak)); 95extern seqlock_t xtime_lock __attribute__((weak));
94 96
95extern unsigned long read_persistent_clock(void); 97extern unsigned long read_persistent_clock(void);
98extern int update_persistent_clock(struct timespec now);
99extern int no_sync_cmos_clock __read_mostly;
96void timekeeping_init(void); 100void timekeeping_init(void);
97 101
98static inline unsigned long get_seconds(void) 102static inline unsigned long get_seconds(void)
@@ -116,6 +120,8 @@ extern int do_setitimer(int which, struct itimerval *value,
116extern unsigned int alarm_setitimer(unsigned int seconds); 120extern unsigned int alarm_setitimer(unsigned int seconds);
117extern int do_getitimer(int which, struct itimerval *value); 121extern int do_getitimer(int which, struct itimerval *value);
118extern void getnstimeofday(struct timespec *tv); 122extern void getnstimeofday(struct timespec *tv);
123extern void getboottime(struct timespec *ts);
124extern void monotonic_to_bootbased(struct timespec *ts);
119 125
120extern struct timespec timespec_trunc(struct timespec t, unsigned gran); 126extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
121extern int timekeeping_is_continuous(void); 127extern int timekeeping_is_continuous(void);
diff --git a/include/linux/timer.h b/include/linux/timer.h
index c661710d3627..78cf899b4409 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -3,7 +3,6 @@
3 3
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/ktime.h> 5#include <linux/ktime.h>
6#include <linux/spinlock.h>
7#include <linux/stddef.h> 6#include <linux/stddef.h>
8 7
9struct tvec_t_base_s; 8struct tvec_t_base_s;
@@ -91,16 +90,13 @@ extern unsigned long get_next_timer_interrupt(unsigned long now);
91 */ 90 */
92#ifdef CONFIG_TIMER_STATS 91#ifdef CONFIG_TIMER_STATS
93 92
93#define TIMER_STATS_FLAG_DEFERRABLE 0x1
94
94extern void init_timer_stats(void); 95extern void init_timer_stats(void);
95 96
96extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, 97extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
97 void *timerf, char * comm); 98 void *timerf, char *comm,
98 99 unsigned int timer_flag);
99static inline void timer_stats_account_timer(struct timer_list *timer)
100{
101 timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
102 timer->function, timer->start_comm);
103}
104 100
105extern void __timer_stats_timer_set_start_info(struct timer_list *timer, 101extern void __timer_stats_timer_set_start_info(struct timer_list *timer,
106 void *addr); 102 void *addr);
@@ -119,10 +115,6 @@ static inline void init_timer_stats(void)
119{ 115{
120} 116}
121 117
122static inline void timer_stats_account_timer(struct timer_list *timer)
123{
124}
125
126static inline void timer_stats_timer_set_start_info(struct timer_list *timer) 118static inline void timer_stats_timer_set_start_info(struct timer_list *timer)
127{ 119{
128} 120}
diff --git a/include/linux/timex.h b/include/linux/timex.h
index da929dbbea2a..37ac3ff90faf 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -224,66 +224,6 @@ static inline int ntp_synced(void)
224 __x < 0 ? -(-__x >> __s) : __x >> __s; \ 224 __x < 0 ? -(-__x >> __s) : __x >> __s; \
225}) 225})
226 226
227
228#ifdef CONFIG_TIME_INTERPOLATION
229
230#define TIME_SOURCE_CPU 0
231#define TIME_SOURCE_MMIO64 1
232#define TIME_SOURCE_MMIO32 2
233#define TIME_SOURCE_FUNCTION 3
234
235/* For proper operations time_interpolator clocks must run slightly slower
236 * than the standard clock since the interpolator may only correct by having
237 * time jump forward during a tick. A slower clock is usually a side effect
238 * of the integer divide of the nanoseconds in a second by the frequency.
239 * The accuracy of the division can be increased by specifying a shift.
240 * However, this may cause the clock not to be slow enough.
241 * The interpolator will self-tune the clock by slowing down if no
242 * resets occur or speeding up if the time jumps per analysis cycle
243 * become too high.
244 *
245 * Setting jitter compensates for a fluctuating timesource by comparing
246 * to the last value read from the timesource to insure that an earlier value
247 * is not returned by a later call. The price to pay
248 * for the compensation is that the timer routines are not as scalable anymore.
249 */
250
251struct time_interpolator {
252 u16 source; /* time source flags */
253 u8 shift; /* increases accuracy of multiply by shifting. */
254 /* Note that bits may be lost if shift is set too high */
255 u8 jitter; /* if set compensate for fluctuations */
256 u32 nsec_per_cyc; /* set by register_time_interpolator() */
257 void *addr; /* address of counter or function */
258 cycles_t mask; /* mask the valid bits of the counter */
259 unsigned long offset; /* nsec offset at last update of interpolator */
260 u64 last_counter; /* counter value in units of the counter at last update */
261 cycles_t last_cycle; /* Last timer value if TIME_SOURCE_JITTER is set */
262 u64 frequency; /* frequency in counts/second */
263 long drift; /* drift in parts-per-million (or -1) */
264 unsigned long skips; /* skips forward */
265 unsigned long ns_skipped; /* nanoseconds skipped */
266 struct time_interpolator *next;
267};
268
269extern void register_time_interpolator(struct time_interpolator *);
270extern void unregister_time_interpolator(struct time_interpolator *);
271extern void time_interpolator_reset(void);
272extern unsigned long time_interpolator_get_offset(void);
273extern void time_interpolator_update(long delta_nsec);
274
275#else /* !CONFIG_TIME_INTERPOLATION */
276
277static inline void time_interpolator_reset(void)
278{
279}
280
281static inline void time_interpolator_update(long delta_nsec)
282{
283}
284
285#endif /* !CONFIG_TIME_INTERPOLATION */
286
287#define TICK_LENGTH_SHIFT 32 227#define TICK_LENGTH_SHIFT 32
288 228
289#ifdef CONFIG_NO_HZ 229#ifdef CONFIG_NO_HZ
diff --git a/include/linux/topology.h b/include/linux/topology.h
index a9d1f049cc15..d0890a7e5bab 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -50,10 +50,10 @@
50 for_each_online_node(node) \ 50 for_each_online_node(node) \
51 if (nr_cpus_node(node)) 51 if (nr_cpus_node(node))
52 52
53#ifndef node_distance
54/* Conform to ACPI 2.0 SLIT distance definitions */ 53/* Conform to ACPI 2.0 SLIT distance definitions */
55#define LOCAL_DISTANCE 10 54#define LOCAL_DISTANCE 10
56#define REMOTE_DISTANCE 20 55#define REMOTE_DISTANCE 20
56#ifndef node_distance
57#define node_distance(from,to) ((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE) 57#define node_distance(from,to) ((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE)
58#endif 58#endif
59#ifndef RECLAIM_DISTANCE 59#ifndef RECLAIM_DISTANCE
@@ -98,7 +98,7 @@
98 .cache_nice_tries = 0, \ 98 .cache_nice_tries = 0, \
99 .busy_idx = 0, \ 99 .busy_idx = 0, \
100 .idle_idx = 0, \ 100 .idle_idx = 0, \
101 .newidle_idx = 1, \ 101 .newidle_idx = 0, \
102 .wake_idx = 0, \ 102 .wake_idx = 0, \
103 .forkexec_idx = 0, \ 103 .forkexec_idx = 0, \
104 .flags = SD_LOAD_BALANCE \ 104 .flags = SD_LOAD_BALANCE \
@@ -128,14 +128,15 @@
128 .imbalance_pct = 125, \ 128 .imbalance_pct = 125, \
129 .cache_nice_tries = 1, \ 129 .cache_nice_tries = 1, \
130 .busy_idx = 2, \ 130 .busy_idx = 2, \
131 .idle_idx = 1, \ 131 .idle_idx = 0, \
132 .newidle_idx = 2, \ 132 .newidle_idx = 0, \
133 .wake_idx = 1, \ 133 .wake_idx = 1, \
134 .forkexec_idx = 1, \ 134 .forkexec_idx = 1, \
135 .flags = SD_LOAD_BALANCE \ 135 .flags = SD_LOAD_BALANCE \
136 | SD_BALANCE_NEWIDLE \ 136 | SD_BALANCE_NEWIDLE \
137 | SD_BALANCE_EXEC \ 137 | SD_BALANCE_EXEC \
138 | SD_WAKE_AFFINE \ 138 | SD_WAKE_AFFINE \
139 | SD_WAKE_IDLE \
139 | SD_SHARE_PKG_RESOURCES\ 140 | SD_SHARE_PKG_RESOURCES\
140 | BALANCE_FOR_MC_POWER, \ 141 | BALANCE_FOR_MC_POWER, \
141 .last_balance = jiffies, \ 142 .last_balance = jiffies, \
@@ -158,14 +159,15 @@
158 .imbalance_pct = 125, \ 159 .imbalance_pct = 125, \
159 .cache_nice_tries = 1, \ 160 .cache_nice_tries = 1, \
160 .busy_idx = 2, \ 161 .busy_idx = 2, \
161 .idle_idx = 1, \ 162 .idle_idx = 0, \
162 .newidle_idx = 2, \ 163 .newidle_idx = 0, \
163 .wake_idx = 1, \ 164 .wake_idx = 1, \
164 .forkexec_idx = 1, \ 165 .forkexec_idx = 1, \
165 .flags = SD_LOAD_BALANCE \ 166 .flags = SD_LOAD_BALANCE \
166 | SD_BALANCE_NEWIDLE \ 167 | SD_BALANCE_NEWIDLE \
167 | SD_BALANCE_EXEC \ 168 | SD_BALANCE_EXEC \
168 | SD_WAKE_AFFINE \ 169 | SD_WAKE_AFFINE \
170 | SD_WAKE_IDLE \
169 | BALANCE_FOR_PKG_POWER,\ 171 | BALANCE_FOR_PKG_POWER,\
170 .last_balance = jiffies, \ 172 .last_balance = jiffies, \
171 .balance_interval = 1, \ 173 .balance_interval = 1, \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index bb4576085203..691a1748d9d2 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -178,6 +178,7 @@ struct tty_bufhead {
178#define L_IEXTEN(tty) _L_FLAG((tty),IEXTEN) 178#define L_IEXTEN(tty) _L_FLAG((tty),IEXTEN)
179 179
180struct device; 180struct device;
181struct signal_struct;
181/* 182/*
182 * Where all of the state associated with a tty is kept while the tty 183 * Where all of the state associated with a tty is kept while the tty
183 * is open. Since the termios state should be kept even if the tty 184 * is open. Since the termios state should be kept even if the tty
@@ -310,6 +311,7 @@ extern void tty_hangup(struct tty_struct * tty);
310extern void tty_vhangup(struct tty_struct * tty); 311extern void tty_vhangup(struct tty_struct * tty);
311extern void tty_unhangup(struct file *filp); 312extern void tty_unhangup(struct file *filp);
312extern int tty_hung_up_p(struct file * filp); 313extern int tty_hung_up_p(struct file * filp);
314extern int is_tty(struct file *filp);
313extern void do_SAK(struct tty_struct *tty); 315extern void do_SAK(struct tty_struct *tty);
314extern void __do_SAK(struct tty_struct *tty); 316extern void __do_SAK(struct tty_struct *tty);
315extern void disassociate_ctty(int priv); 317extern void disassociate_ctty(int priv);
@@ -338,9 +340,46 @@ extern struct tty_struct *get_current_tty(void);
338 340
339extern struct mutex tty_mutex; 341extern struct mutex tty_mutex;
340 342
343extern void tty_write_unlock(struct tty_struct *tty);
344extern int tty_write_lock(struct tty_struct *tty, int ndelay);
345#define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock))
346
347
348
341/* n_tty.c */ 349/* n_tty.c */
342extern struct tty_ldisc tty_ldisc_N_TTY; 350extern struct tty_ldisc tty_ldisc_N_TTY;
343 351
352/* tty_audit.c */
353#ifdef CONFIG_AUDIT
354extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
355 size_t size);
356extern void tty_audit_exit(void);
357extern void tty_audit_fork(struct signal_struct *sig);
358extern void tty_audit_push(struct tty_struct *tty);
359extern void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid);
360extern void tty_audit_opening(void);
361#else
362static inline void tty_audit_add_data(struct tty_struct *tty,
363 unsigned char *data, size_t size)
364{
365}
366static inline void tty_audit_exit(void)
367{
368}
369static inline void tty_audit_fork(struct signal_struct *sig)
370{
371}
372static inline void tty_audit_push(struct tty_struct *tty)
373{
374}
375static inline void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid)
376{
377}
378static inline void tty_audit_opening(void)
379{
380}
381#endif
382
344/* tty_ioctl.c */ 383/* tty_ioctl.c */
345extern int n_tty_ioctl(struct tty_struct * tty, struct file * file, 384extern int n_tty_ioctl(struct tty_struct * tty, struct file * file,
346 unsigned int cmd, unsigned long arg); 385 unsigned int cmd, unsigned long arg);
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 6de445c31a64..8ec703f462da 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -42,6 +42,7 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
42/* UDP encapsulation types */ 42/* UDP encapsulation types */
43#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ 43#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
44#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ 44#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
45#define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */
45 46
46#ifdef __KERNEL__ 47#ifdef __KERNEL__
47#include <linux/types.h> 48#include <linux/types.h>
@@ -70,6 +71,11 @@ struct udp_sock {
70#define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */ 71#define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */
71#define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */ 72#define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */
72 __u8 pcflag; /* marks socket as UDP-Lite if > 0 */ 73 __u8 pcflag; /* marks socket as UDP-Lite if > 0 */
74 __u8 unused[3];
75 /*
76 * For encapsulation sockets.
77 */
78 int (*encap_rcv)(struct sock *sk, struct sk_buff *skb);
73}; 79};
74 80
75static inline struct udp_sock *udp_sk(const struct sock *sk) 81static inline struct udp_sock *udp_sk(const struct sock *sk)
diff --git a/include/linux/uio.h b/include/linux/uio.h
index 9af8bbcd8963..b7fe13883bdb 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -13,10 +13,6 @@
13 * 2 of the License, or (at your option) any later version. 13 * 2 of the License, or (at your option) any later version.
14 */ 14 */
15 15
16
17/* A word of warning: Our uio structure will clash with the C library one (which is now obsolete). Remove the C
18 library one from sys/uio.h if you have a very old library set */
19
20struct iovec 16struct iovec
21{ 17{
22 void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ 18 void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */
@@ -38,11 +34,6 @@ struct kvec {
38 34
39#define UIO_FASTIOV 8 35#define UIO_FASTIOV 8
40#define UIO_MAXIOV 1024 36#define UIO_MAXIOV 1024
41#if 0
42#define UIO_MAXIOV 16 /* Maximum iovec's in one operation
43 16 matches BSD */
44 /* Beg pardon: BSD has 1024 --ANK */
45#endif
46 37
47/* 38/*
48 * Total number of bytes covered by an iovec. 39 * Total number of bytes covered by an iovec.
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
new file mode 100644
index 000000000000..44c28e94df50
--- /dev/null
+++ b/include/linux/uio_driver.h
@@ -0,0 +1,91 @@
1/*
2 * include/linux/uio_driver.h
3 *
4 * Copyright(C) 2005, Benedikt Spranger <b.spranger@linutronix.de>
5 * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de>
6 * Copyright(C) 2006, Hans J. Koch <hjk@linutronix.de>
7 * Copyright(C) 2006, Greg Kroah-Hartman <greg@kroah.com>
8 *
9 * Userspace IO driver.
10 *
11 * Licensed under the GPLv2 only.
12 */
13
14#ifndef _UIO_DRIVER_H_
15#define _UIO_DRIVER_H_
16
17#include <linux/module.h>
18#include <linux/fs.h>
19#include <linux/interrupt.h>
20
21/**
22 * struct uio_mem - description of a UIO memory region
23 * @kobj: kobject for this mapping
24 * @addr: address of the device's memory
25 * @size: size of IO
26 * @memtype: type of memory addr points to
27 * @internal_addr: ioremap-ped version of addr, for driver internal use
28 */
29struct uio_mem {
30 struct kobject kobj;
31 unsigned long addr;
32 unsigned long size;
33 int memtype;
34 void __iomem *internal_addr;
35};
36
37#define MAX_UIO_MAPS 5
38
39struct uio_device;
40
41/**
42 * struct uio_info - UIO device capabilities
43 * @uio_dev: the UIO device this info belongs to
44 * @name: device name
45 * @version: device driver version
46 * @mem: list of mappable memory regions, size==0 for end of list
47 * @irq: interrupt number or UIO_IRQ_CUSTOM
48 * @irq_flags: flags for request_irq()
49 * @priv: optional private data
50 * @handler: the device's irq handler
51 * @mmap: mmap operation for this uio device
52 * @open: open operation for this uio device
53 * @release: release operation for this uio device
54 */
55struct uio_info {
56 struct uio_device *uio_dev;
57 char *name;
58 char *version;
59 struct uio_mem mem[MAX_UIO_MAPS];
60 long irq;
61 unsigned long irq_flags;
62 void *priv;
63 irqreturn_t (*handler)(int irq, struct uio_info *dev_info);
64 int (*mmap)(struct uio_info *info, struct vm_area_struct *vma);
65 int (*open)(struct uio_info *info, struct inode *inode);
66 int (*release)(struct uio_info *info, struct inode *inode);
67};
68
69extern int __must_check
70 __uio_register_device(struct module *owner,
71 struct device *parent,
72 struct uio_info *info);
73static inline int __must_check
74 uio_register_device(struct device *parent, struct uio_info *info)
75{
76 return __uio_register_device(THIS_MODULE, parent, info);
77}
78extern void uio_unregister_device(struct uio_info *info);
79extern void uio_event_notify(struct uio_info *info);
80
81/* defines for uio_device->irq */
82#define UIO_IRQ_CUSTOM -1
83#define UIO_IRQ_NONE -2
84
85/* defines for uio_device->memtype */
86#define UIO_MEM_NONE 0
87#define UIO_MEM_PHYS 1
88#define UIO_MEM_LOGICAL 2
89#define UIO_MEM_VIRTUAL 3
90
91#endif /* _LINUX_UIO_DRIVER_H_ */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 94bd38a6d947..7a60946df3b6 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -146,6 +146,10 @@ struct usb_interface {
146 * active alternate setting */ 146 * active alternate setting */
147 unsigned num_altsetting; /* number of alternate settings */ 147 unsigned num_altsetting; /* number of alternate settings */
148 148
149 /* If there is an interface association descriptor then it will list
150 * the associated interfaces */
151 struct usb_interface_assoc_descriptor *intf_assoc;
152
149 int minor; /* minor number this interface is 153 int minor; /* minor number this interface is
150 * bound to */ 154 * bound to */
151 enum usb_interface_condition condition; /* state of binding */ 155 enum usb_interface_condition condition; /* state of binding */
@@ -175,6 +179,7 @@ void usb_put_intf(struct usb_interface *intf);
175 179
176/* this maximum is arbitrary */ 180/* this maximum is arbitrary */
177#define USB_MAXINTERFACES 32 181#define USB_MAXINTERFACES 32
182#define USB_MAXIADS USB_MAXINTERFACES/2
178 183
179/** 184/**
180 * struct usb_interface_cache - long-term representation of a device interface 185 * struct usb_interface_cache - long-term representation of a device interface
@@ -245,6 +250,11 @@ struct usb_host_config {
245 struct usb_config_descriptor desc; 250 struct usb_config_descriptor desc;
246 251
247 char *string; /* iConfiguration string, if present */ 252 char *string; /* iConfiguration string, if present */
253
254 /* List of any Interface Association Descriptors in this
255 * configuration. */
256 struct usb_interface_assoc_descriptor *intf_assoc[USB_MAXIADS];
257
248 /* the interfaces associated with this configuration, 258 /* the interfaces associated with this configuration,
249 * stored in no particular order */ 259 * stored in no particular order */
250 struct usb_interface *interface[USB_MAXINTERFACES]; 260 struct usb_interface *interface[USB_MAXINTERFACES];
@@ -403,6 +413,8 @@ struct usb_device {
403 413
404 unsigned auto_pm:1; /* autosuspend/resume in progress */ 414 unsigned auto_pm:1; /* autosuspend/resume in progress */
405 unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ 415 unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */
416 unsigned reset_resume:1; /* needs reset instead of resume */
417 unsigned persist_enabled:1; /* USB_PERSIST enabled for this dev */
406 unsigned autosuspend_disabled:1; /* autosuspend and autoresume */ 418 unsigned autosuspend_disabled:1; /* autosuspend and autoresume */
407 unsigned autoresume_disabled:1; /* disabled by the user */ 419 unsigned autoresume_disabled:1; /* disabled by the user */
408#endif 420#endif
@@ -729,6 +741,22 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor
729 .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) 741 .bcdDevice_lo = (lo), .bcdDevice_hi = (hi)
730 742
731/** 743/**
744 * USB_DEVICE_INTERFACE_PROTOCOL - macro used to describe a usb
745 * device with a specific interface protocol
746 * @vend: the 16 bit USB Vendor ID
747 * @prod: the 16 bit USB Product ID
748 * @pr: bInterfaceProtocol value
749 *
750 * This macro is used to create a struct usb_device_id that matches a
751 * specific interface protocol of devices.
752 */
753#define USB_DEVICE_INTERFACE_PROTOCOL(vend,prod,pr) \
754 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_PROTOCOL, \
755 .idVendor = (vend), \
756 .idProduct = (prod), \
757 .bInterfaceProtocol = (pr)
758
759/**
732 * USB_DEVICE_INFO - macro used to describe a class of usb devices 760 * USB_DEVICE_INFO - macro used to describe a class of usb devices
733 * @cl: bDeviceClass value 761 * @cl: bDeviceClass value
734 * @sc: bDeviceSubClass value 762 * @sc: bDeviceSubClass value
@@ -754,6 +782,28 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor
754 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \ 782 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \
755 .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) 783 .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr)
756 784
785/**
786 * USB_DEVICE_AND_INTERFACE_INFO - macro used to describe a specific usb device
787 * with a class of usb interfaces
788 * @vend: the 16 bit USB Vendor ID
789 * @prod: the 16 bit USB Product ID
790 * @cl: bInterfaceClass value
791 * @sc: bInterfaceSubClass value
792 * @pr: bInterfaceProtocol value
793 *
794 * This macro is used to create a struct usb_device_id that matches a
795 * specific device with a specific class of interfaces.
796 *
797 * This is especially useful when explicitly matching devices that have
798 * vendor specific bDeviceClass values, but standards-compliant interfaces.
799 */
800#define USB_DEVICE_AND_INTERFACE_INFO(vend,prod,cl,sc,pr) \
801 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
802 | USB_DEVICE_ID_MATCH_DEVICE, \
803 .idVendor = (vend), .idProduct = (prod), \
804 .bInterfaceClass = (cl), \
805 .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr)
806
757/* ----------------------------------------------------------------------- */ 807/* ----------------------------------------------------------------------- */
758 808
759/* Stuff for dynamic usb ids */ 809/* Stuff for dynamic usb ids */
@@ -800,10 +850,15 @@ struct usbdrv_wrap {
800 * do (or don't) show up otherwise in the filesystem. 850 * do (or don't) show up otherwise in the filesystem.
801 * @suspend: Called when the device is going to be suspended by the system. 851 * @suspend: Called when the device is going to be suspended by the system.
802 * @resume: Called when the device is being resumed by the system. 852 * @resume: Called when the device is being resumed by the system.
853 * @reset_resume: Called when the suspended device has been reset instead
854 * of being resumed.
803 * @pre_reset: Called by usb_reset_composite_device() when the device 855 * @pre_reset: Called by usb_reset_composite_device() when the device
804 * is about to be reset. 856 * is about to be reset.
805 * @post_reset: Called by usb_reset_composite_device() after the device 857 * @post_reset: Called by usb_reset_composite_device() after the device
806 * has been reset. 858 * has been reset, or in lieu of @resume following a reset-resume
859 * (i.e., the device is reset instead of being resumed, as might
860 * happen if power was lost). The second argument tells which is
861 * the reason.
807 * @id_table: USB drivers use ID table to support hotplugging. 862 * @id_table: USB drivers use ID table to support hotplugging.
808 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set 863 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
809 * or your driver's probe function will never get called. 864 * or your driver's probe function will never get called.
@@ -843,9 +898,10 @@ struct usb_driver {
843 898
844 int (*suspend) (struct usb_interface *intf, pm_message_t message); 899 int (*suspend) (struct usb_interface *intf, pm_message_t message);
845 int (*resume) (struct usb_interface *intf); 900 int (*resume) (struct usb_interface *intf);
901 int (*reset_resume)(struct usb_interface *intf);
846 902
847 void (*pre_reset) (struct usb_interface *intf); 903 int (*pre_reset)(struct usb_interface *intf);
848 void (*post_reset) (struct usb_interface *intf); 904 int (*post_reset)(struct usb_interface *intf);
849 905
850 const struct usb_device_id *id_table; 906 const struct usb_device_id *id_table;
851 907
@@ -948,6 +1004,7 @@ extern int usb_disabled(void);
948#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ 1004#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */
949#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt 1005#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt
950 * needed */ 1006 * needed */
1007#define URB_FREE_BUFFER 0x0100 /* Free transfer buffer with the URB */
951 1008
952struct usb_iso_packet_descriptor { 1009struct usb_iso_packet_descriptor {
953 unsigned int offset; 1010 unsigned int offset;
@@ -958,11 +1015,26 @@ struct usb_iso_packet_descriptor {
958 1015
959struct urb; 1016struct urb;
960 1017
1018struct usb_anchor {
1019 struct list_head urb_list;
1020 wait_queue_head_t wait;
1021 spinlock_t lock;
1022};
1023
1024static inline void init_usb_anchor(struct usb_anchor *anchor)
1025{
1026 INIT_LIST_HEAD(&anchor->urb_list);
1027 init_waitqueue_head(&anchor->wait);
1028 spin_lock_init(&anchor->lock);
1029}
1030
961typedef void (*usb_complete_t)(struct urb *); 1031typedef void (*usb_complete_t)(struct urb *);
962 1032
963/** 1033/**
964 * struct urb - USB Request Block 1034 * struct urb - USB Request Block
965 * @urb_list: For use by current owner of the URB. 1035 * @urb_list: For use by current owner of the URB.
1036 * @anchor_list: membership in the list of an anchor
1037 * @anchor: to anchor URBs to a common mooring
966 * @pipe: Holds endpoint number, direction, type, and more. 1038 * @pipe: Holds endpoint number, direction, type, and more.
967 * Create these values with the eight macros available; 1039 * Create these values with the eight macros available;
968 * usb_{snd,rcv}TYPEpipe(dev,endpoint), where the TYPE is "ctrl" 1040 * usb_{snd,rcv}TYPEpipe(dev,endpoint), where the TYPE is "ctrl"
@@ -1135,6 +1207,8 @@ struct urb
1135 /* public: documented fields in the urb that can be used by drivers */ 1207 /* public: documented fields in the urb that can be used by drivers */
1136 struct list_head urb_list; /* list head for use by the urb's 1208 struct list_head urb_list; /* list head for use by the urb's
1137 * current owner */ 1209 * current owner */
1210 struct list_head anchor_list; /* the URB may be anchored by the driver */
1211 struct usb_anchor *anchor;
1138 struct usb_device *dev; /* (in) pointer to associated device */ 1212 struct usb_device *dev; /* (in) pointer to associated device */
1139 unsigned int pipe; /* (in) pipe information */ 1213 unsigned int pipe; /* (in) pipe information */
1140 int status; /* (return) non-ISO status */ 1214 int status; /* (return) non-ISO status */
@@ -1270,6 +1344,11 @@ extern struct urb *usb_get_urb(struct urb *urb);
1270extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); 1344extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags);
1271extern int usb_unlink_urb(struct urb *urb); 1345extern int usb_unlink_urb(struct urb *urb);
1272extern void usb_kill_urb(struct urb *urb); 1346extern void usb_kill_urb(struct urb *urb);
1347extern void usb_kill_anchored_urbs(struct usb_anchor *anchor);
1348extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor);
1349extern void usb_unanchor_urb(struct urb *urb);
1350extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor,
1351 unsigned int timeout);
1273 1352
1274void *usb_buffer_alloc (struct usb_device *dev, size_t size, 1353void *usb_buffer_alloc (struct usb_device *dev, size_t size,
1275 gfp_t mem_flags, dma_addr_t *dma); 1354 gfp_t mem_flags, dma_addr_t *dma);
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild
index 43f160cfe003..6ce42bf9f743 100644
--- a/include/linux/usb/Kbuild
+++ b/include/linux/usb/Kbuild
@@ -1,5 +1,6 @@
1unifdef-y += audio.h 1unifdef-y += audio.h
2unifdef-y += cdc.h 2unifdef-y += cdc.h
3unifdef-y += ch9.h 3unifdef-y += ch9.h
4unifdef-y += gadgetfs.h
4unifdef-y += midi.h 5unifdef-y += midi.h
5 6
diff --git a/include/linux/usb_gadgetfs.h b/include/linux/usb/gadgetfs.h
index 8086d5a9b94e..e8654c338729 100644
--- a/include/linux/usb_gadgetfs.h
+++ b/include/linux/usb/gadgetfs.h
@@ -1,3 +1,5 @@
1#ifndef __LINUX_USB_GADGETFS_H
2#define __LINUX_USB_GADGETFS_H
1 3
2#include <asm/types.h> 4#include <asm/types.h>
3#include <asm/ioctl.h> 5#include <asm/ioctl.h>
@@ -7,11 +9,12 @@
7/* 9/*
8 * Filesystem based user-mode API to USB Gadget controller hardware 10 * Filesystem based user-mode API to USB Gadget controller hardware
9 * 11 *
10 * Almost everything can be done with only read and write operations, 12 * Other than ep0 operations, most things are done by read() and write()
11 * on endpoint files found in one directory. They are configured by 13 * on endpoint files found in one directory. They are configured by
12 * writing descriptors, and then may be used for normal stream style 14 * writing descriptors, and then may be used for normal stream style
13 * i/o requests. When ep0 is configured, the device can enumerate; 15 * i/o requests. When ep0 is configured, the device can enumerate;
14 * when it's closed, the device disconnects from usb. 16 * when it's closed, the device disconnects from usb. Operations on
17 * ep0 require ioctl() operations.
15 * 18 *
16 * Configuration and device descriptors get written to /dev/gadget/$CHIP, 19 * Configuration and device descriptors get written to /dev/gadget/$CHIP,
17 * which may then be used to read usb_gadgetfs_event structs. The driver 20 * which may then be used to read usb_gadgetfs_event structs. The driver
@@ -21,9 +24,9 @@
21 */ 24 */
22 25
23/* 26/*
24 * Events are delivered on the ep0 file descriptor, if the user mode driver 27 * Events are delivered on the ep0 file descriptor, when the user mode driver
25 * reads from this file descriptor after writing the descriptors. Don't 28 * reads from this file descriptor after writing the descriptors. Don't
26 * stop polling this descriptor, if you write that kind of driver. 29 * stop polling this descriptor.
27 */ 30 */
28 31
29enum usb_gadgetfs_event_type { 32enum usb_gadgetfs_event_type {
@@ -36,8 +39,10 @@ enum usb_gadgetfs_event_type {
36 // and likely more ! 39 // and likely more !
37}; 40};
38 41
42/* NOTE: this structure must stay the same size and layout on
43 * both 32-bit and 64-bit kernels.
44 */
39struct usb_gadgetfs_event { 45struct usb_gadgetfs_event {
40 enum usb_gadgetfs_event_type type;
41 union { 46 union {
42 // NOP, DISCONNECT, SUSPEND: nothing 47 // NOP, DISCONNECT, SUSPEND: nothing
43 // ... some hardware can't report disconnection 48 // ... some hardware can't report disconnection
@@ -46,19 +51,20 @@ struct usb_gadgetfs_event {
46 enum usb_device_speed speed; 51 enum usb_device_speed speed;
47 52
48 // SETUP: packet; DATA phase i/o precedes next event 53 // SETUP: packet; DATA phase i/o precedes next event
49 // (setup.bmRequestType & USB_DIR_IN) flags direction 54 // (setup.bmRequestType & USB_DIR_IN) flags direction
50 // ... includes SET_CONFIGURATION, SET_INTERFACE 55 // ... includes SET_CONFIGURATION, SET_INTERFACE
51 struct usb_ctrlrequest setup; 56 struct usb_ctrlrequest setup;
52 } u; 57 } u;
58 enum usb_gadgetfs_event_type type;
53}; 59};
54 60
55 61
56/* endpoint ioctls */ 62/* endpoint ioctls */
57 63
58/* IN transfers may be reported to the gadget driver as complete 64/* IN transfers may be reported to the gadget driver as complete
59 * when the fifo is loaded, before the host reads the data; 65 * when the fifo is loaded, before the host reads the data;
60 * OUT transfers may be reported to the host's "client" driver as 66 * OUT transfers may be reported to the host's "client" driver as
61 * complete when they're sitting in the FIFO unread. 67 * complete when they're sitting in the FIFO unread.
62 * THIS returns how many bytes are "unclaimed" in the endpoint fifo 68 * THIS returns how many bytes are "unclaimed" in the endpoint fifo
63 * (needed for precise fault handling, when the hardware allows it) 69 * (needed for precise fault handling, when the hardware allows it)
64 */ 70 */
@@ -72,4 +78,4 @@ struct usb_gadgetfs_event {
72 */ 78 */
73#define GADGETFS_CLEAR_HALT _IO('g',3) 79#define GADGETFS_CLEAR_HALT _IO('g',3)
74 80
75 81#endif /* __LINUX_USB_GADGETFS_H */
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
index 6bac8faacbc6..8da374caf582 100644
--- a/include/linux/usb/quirks.h
+++ b/include/linux/usb/quirks.h
@@ -9,3 +9,6 @@
9 9
10/* string descriptors must not be fetched using a 255-byte read */ 10/* string descriptors must not be fetched using a 255-byte read */
11#define USB_QUIRK_STRING_FETCH_255 0x00000002 11#define USB_QUIRK_STRING_FETCH_255 0x00000002
12
13/* device can't resume correctly so reset it instead */
14#define USB_QUIRK_RESET_RESUME 0x00000004
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 32acbae28d24..e8b8928232c8 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -221,6 +221,9 @@ struct usb_serial_driver {
221 int (*port_probe) (struct usb_serial_port *port); 221 int (*port_probe) (struct usb_serial_port *port);
222 int (*port_remove) (struct usb_serial_port *port); 222 int (*port_remove) (struct usb_serial_port *port);
223 223
224 int (*suspend) (struct usb_serial *serial, pm_message_t message);
225 int (*resume) (struct usb_serial *serial);
226
224 /* serial function calls */ 227 /* serial function calls */
225 int (*open) (struct usb_serial_port *port, struct file * filp); 228 int (*open) (struct usb_serial_port *port, struct file * filp);
226 void (*close) (struct usb_serial_port *port, struct file * filp); 229 void (*close) (struct usb_serial_port *port, struct file * filp);
@@ -249,6 +252,9 @@ extern void usb_serial_port_softint(struct usb_serial_port *port);
249extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id); 252extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id);
250extern void usb_serial_disconnect(struct usb_interface *iface); 253extern void usb_serial_disconnect(struct usb_interface *iface);
251 254
255extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message);
256extern int usb_serial_resume(struct usb_interface *intf);
257
252extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest); 258extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest);
253extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit); 259extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit);
254 260
@@ -269,6 +275,7 @@ extern void usb_serial_put(struct usb_serial *serial);
269extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp); 275extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp);
270extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count); 276extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count);
271extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp); 277extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp);
278extern int usb_serial_generic_resume (struct usb_serial *serial);
272extern int usb_serial_generic_write_room (struct usb_serial_port *port); 279extern int usb_serial_generic_write_room (struct usb_serial_port *port);
273extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); 280extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port);
274extern void usb_serial_generic_read_bulk_callback (struct urb *urb); 281extern void usb_serial_generic_read_bulk_callback (struct urb *urb);
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
index e17186dbcdca..4f59b2aa8a9e 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb_gadget.h
@@ -110,13 +110,6 @@ struct usb_ep_ops {
110 gfp_t 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,
114 dma_addr_t *dma, gfp_t gfp_flags);
115 void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma,
116 unsigned bytes);
117 // NOTE: on 2.6, drivers may also use dma_map() and
118 // dma_sync_single_*() to directly manage dma overhead.
119
120 int (*queue) (struct usb_ep *ep, struct usb_request *req, 113 int (*queue) (struct usb_ep *ep, struct usb_request *req,
121 gfp_t gfp_flags); 114 gfp_t gfp_flags);
122 int (*dequeue) (struct usb_ep *ep, struct usb_request *req); 115 int (*dequeue) (struct usb_ep *ep, struct usb_request *req);
@@ -235,47 +228,6 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req)
235} 228}
236 229
237/** 230/**
238 * usb_ep_alloc_buffer - allocate an I/O buffer
239 * @ep:the endpoint associated with the buffer
240 * @len:length of the desired buffer
241 * @dma:pointer to the buffer's DMA address; must be valid
242 * @gfp_flags:GFP_* flags to use
243 *
244 * Returns a new buffer, or null if one could not be allocated.
245 * The buffer is suitably aligned for dma, if that endpoint uses DMA,
246 * and the caller won't have to care about dma-inconsistency
247 * or any hidden "bounce buffer" mechanism. No additional per-request
248 * DMA mapping will be required for such buffers.
249 * Free it later with usb_ep_free_buffer().
250 *
251 * You don't need to use this call to allocate I/O buffers unless you
252 * want to make sure drivers don't incur costs for such "bounce buffer"
253 * copies or per-request DMA mappings.
254 */
255static inline void *
256usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma,
257 gfp_t gfp_flags)
258{
259 return ep->ops->alloc_buffer (ep, len, dma, gfp_flags);
260}
261
262/**
263 * usb_ep_free_buffer - frees an i/o buffer
264 * @ep:the endpoint associated with the buffer
265 * @buf:CPU view address of the buffer
266 * @dma:the buffer's DMA address
267 * @len:length of the buffer
268 *
269 * reverses the effect of usb_ep_alloc_buffer().
270 * caller guarantees the buffer will no longer be accessed
271 */
272static inline void
273usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len)
274{
275 ep->ops->free_buffer (ep, buf, dma, len);
276}
277
278/**
279 * usb_ep_queue - queues (submits) an I/O request to an endpoint. 231 * usb_ep_queue - queues (submits) an I/O request to an endpoint.
280 * @ep:the endpoint associated with the request 232 * @ep:the endpoint associated with the request
281 * @req:the request being submitted 233 * @req:the request being submitted
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
new file mode 100644
index 000000000000..1101b0ce878f
--- /dev/null
+++ b/include/linux/user_namespace.h
@@ -0,0 +1,61 @@
1#ifndef _LINUX_USER_NAMESPACE_H
2#define _LINUX_USER_NAMESPACE_H
3
4#include <linux/kref.h>
5#include <linux/nsproxy.h>
6#include <linux/sched.h>
7#include <linux/err.h>
8
9#define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8)
10#define UIDHASH_SZ (1 << UIDHASH_BITS)
11
12struct user_namespace {
13 struct kref kref;
14 struct list_head uidhash_table[UIDHASH_SZ];
15 struct user_struct *root_user;
16};
17
18extern struct user_namespace init_user_ns;
19
20#ifdef CONFIG_USER_NS
21
22static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
23{
24 if (ns)
25 kref_get(&ns->kref);
26 return ns;
27}
28
29extern struct user_namespace *copy_user_ns(int flags,
30 struct user_namespace *old_ns);
31extern void free_user_ns(struct kref *kref);
32
33static inline void put_user_ns(struct user_namespace *ns)
34{
35 if (ns)
36 kref_put(&ns->kref, free_user_ns);
37}
38
39#else
40
41static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
42{
43 return &init_user_ns;
44}
45
46static inline struct user_namespace *copy_user_ns(int flags,
47 struct user_namespace *old_ns)
48{
49 if (flags & CLONE_NEWUSER)
50 return ERR_PTR(-EINVAL);
51
52 return old_ns;
53}
54
55static inline void put_user_ns(struct user_namespace *ns)
56{
57}
58
59#endif
60
61#endif /* _LINUX_USER_H */
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index f8d3b326e93a..923db99175f2 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -48,26 +48,14 @@ static inline void get_uts_ns(struct uts_namespace *ns)
48 kref_get(&ns->kref); 48 kref_get(&ns->kref);
49} 49}
50 50
51#ifdef CONFIG_UTS_NS 51extern struct uts_namespace *copy_utsname(unsigned long flags,
52extern struct uts_namespace *copy_utsname(int flags, struct uts_namespace *ns); 52 struct uts_namespace *ns);
53extern void free_uts_ns(struct kref *kref); 53extern void free_uts_ns(struct kref *kref);
54 54
55static inline void put_uts_ns(struct uts_namespace *ns) 55static inline void put_uts_ns(struct uts_namespace *ns)
56{ 56{
57 kref_put(&ns->kref, free_uts_ns); 57 kref_put(&ns->kref, free_uts_ns);
58} 58}
59#else
60static inline struct uts_namespace *copy_utsname(int flags,
61 struct uts_namespace *ns)
62{
63 return ns;
64}
65
66static inline void put_uts_ns(struct uts_namespace *ns)
67{
68}
69#endif
70
71static inline struct new_utsname *utsname(void) 59static inline struct new_utsname *utsname(void)
72{ 60{
73 return &current->nsproxy->uts_ns->name; 61 return &current->nsproxy->uts_ns->name;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index e7560389079c..c66c8a3410b9 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -60,6 +60,7 @@
60#include <linux/compiler.h> /* need __user */ 60#include <linux/compiler.h> /* need __user */
61#else 61#else
62#define __user 62#define __user
63#include <sys/time.h>
63#endif 64#endif
64#include <linux/types.h> 65#include <linux/types.h>
65 66
@@ -243,8 +244,7 @@ struct v4l2_capability
243#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ 244#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */
244#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ 245#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
245#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ 246#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
246#define V4L2_CAP_VIDEO_OUTPUT_POS 0x00000200 /* Video output can have x,y coords */ 247#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */
247#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000400 /* Can do video output overlay */
248 248
249#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ 249#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
250#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ 250#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
@@ -616,12 +616,16 @@ struct v4l2_framebuffer
616#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008 616#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
617#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 617#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
618#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 618#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
619#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
620#define V4L2_FBUF_CAP_GLOBAL_INV_ALPHA 0x0080
619/* Flags for the 'flags' field. */ 621/* Flags for the 'flags' field. */
620#define V4L2_FBUF_FLAG_PRIMARY 0x0001 622#define V4L2_FBUF_FLAG_PRIMARY 0x0001
621#define V4L2_FBUF_FLAG_OVERLAY 0x0002 623#define V4L2_FBUF_FLAG_OVERLAY 0x0002
622#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004 624#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
623#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 625#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
624#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 626#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
627#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
628#define V4L2_FBUF_FLAG_GLOBAL_INV_ALPHA 0x0040
625 629
626struct v4l2_clip 630struct v4l2_clip
627{ 631{
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 4b7ee83787c1..89338b468d0d 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -58,6 +58,13 @@ void vmalloc_sync_all(void);
58/* 58/*
59 * Lowlevel-APIs (not for driver use!) 59 * Lowlevel-APIs (not for driver use!)
60 */ 60 */
61
62static inline size_t get_vm_area_size(const struct vm_struct *area)
63{
64 /* return actual size without guard page */
65 return area->size - PAGE_SIZE;
66}
67
61extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); 68extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
62extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, 69extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
63 unsigned long start, unsigned long end); 70 unsigned long start, unsigned long end);
@@ -65,9 +72,14 @@ extern struct vm_struct *get_vm_area_node(unsigned long size,
65 unsigned long flags, int node, 72 unsigned long flags, int node,
66 gfp_t gfp_mask); 73 gfp_t gfp_mask);
67extern struct vm_struct *remove_vm_area(void *addr); 74extern struct vm_struct *remove_vm_area(void *addr);
75
68extern int map_vm_area(struct vm_struct *area, pgprot_t prot, 76extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
69 struct page ***pages); 77 struct page ***pages);
70extern void unmap_vm_area(struct vm_struct *area); 78extern void unmap_kernel_range(unsigned long addr, unsigned long size);
79
80/* Allocate/destroy a 'vmalloc' VM area. */
81extern struct vm_struct *alloc_vm_area(size_t size);
82extern void free_vm_area(struct vm_struct *area);
71 83
72/* 84/*
73 * Internals. Dont't use.. 85 * Internals. Dont't use..
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index d9325cf8a134..75370ec0923e 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -25,7 +25,7 @@
25#define HIGHMEM_ZONE(xx) 25#define HIGHMEM_ZONE(xx)
26#endif 26#endif
27 27
28#define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) 28#define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) , xx##_MOVABLE
29 29
30enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, 30enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
31 FOR_ALL_ZONES(PGALLOC), 31 FOR_ALL_ZONES(PGALLOC),
@@ -170,7 +170,8 @@ static inline unsigned long node_page_state(int node,
170#ifdef CONFIG_HIGHMEM 170#ifdef CONFIG_HIGHMEM
171 zone_page_state(&zones[ZONE_HIGHMEM], item) + 171 zone_page_state(&zones[ZONE_HIGHMEM], item) +
172#endif 172#endif
173 zone_page_state(&zones[ZONE_NORMAL], item); 173 zone_page_state(&zones[ZONE_NORMAL], item) +
174 zone_page_state(&zones[ZONE_MOVABLE], item);
174} 175}
175 176
176extern void zone_statistics(struct zonelist *, struct zone *); 177extern void zone_statistics(struct zonelist *, struct zone *);
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index d961635d0e61..699b7e9864fa 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -75,6 +75,8 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
75int vt_waitactive(int vt); 75int vt_waitactive(int vt);
76void change_console(struct vc_data *new_vc); 76void change_console(struct vc_data *new_vc);
77void reset_vc(struct vc_data *vc); 77void reset_vc(struct vc_data *vc);
78extern int unbind_con_driver(const struct consw *csw, int first, int last,
79 int deflt);
78 80
79/* 81/*
80 * vc_screen.c shares this temporary buffer with the console write code so that 82 * vc_screen.c shares this temporary buffer with the console write code so that
diff --git a/include/linux/wait.h b/include/linux/wait.h
index e820d00e1383..0e686280450b 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -366,15 +366,15 @@ static inline void remove_wait_queue_locked(wait_queue_head_t *q,
366 366
367/* 367/*
368 * These are the old interfaces to sleep waiting for an event. 368 * These are the old interfaces to sleep waiting for an event.
369 * They are racy. DO NOT use them, use the wait_event* interfaces above. 369 * They are racy. DO NOT use them, use the wait_event* interfaces above.
370 * We plan to remove these interfaces during 2.7. 370 * We plan to remove these interfaces.
371 */ 371 */
372extern void FASTCALL(sleep_on(wait_queue_head_t *q)); 372extern void sleep_on(wait_queue_head_t *q);
373extern long FASTCALL(sleep_on_timeout(wait_queue_head_t *q, 373extern long sleep_on_timeout(wait_queue_head_t *q,
374 signed long timeout)); 374 signed long timeout);
375extern void FASTCALL(interruptible_sleep_on(wait_queue_head_t *q)); 375extern void interruptible_sleep_on(wait_queue_head_t *q);
376extern long FASTCALL(interruptible_sleep_on_timeout(wait_queue_head_t *q, 376extern long interruptible_sleep_on_timeout(wait_queue_head_t *q,
377 signed long timeout)); 377 signed long timeout);
378 378
379/* 379/*
380 * Waitqueues which are removed from the waitqueue_head at wakeup time 380 * Waitqueues which are removed from the waitqueue_head at wakeup time
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index ce0719a2cfeb..ce6badc98f6d 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -148,7 +148,7 @@ extern int keventd_up(void);
148extern void init_workqueues(void); 148extern void init_workqueues(void);
149int execute_in_process_context(work_func_t fn, struct execute_work *); 149int execute_in_process_context(work_func_t fn, struct execute_work *);
150 150
151extern void cancel_work_sync(struct work_struct *work); 151extern int cancel_work_sync(struct work_struct *work);
152 152
153/* 153/*
154 * Kill off a pending schedule_delayed_work(). Note that the work callback 154 * Kill off a pending schedule_delayed_work(). Note that the work callback
@@ -166,14 +166,21 @@ static inline int cancel_delayed_work(struct delayed_work *work)
166 return ret; 166 return ret;
167} 167}
168 168
169extern void cancel_rearming_delayed_work(struct delayed_work *work); 169extern int cancel_delayed_work_sync(struct delayed_work *work);
170 170
171/* Obsolete. use cancel_rearming_delayed_work() */ 171/* Obsolete. use cancel_delayed_work_sync() */
172static inline 172static inline
173void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, 173void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq,
174 struct delayed_work *work) 174 struct delayed_work *work)
175{ 175{
176 cancel_rearming_delayed_work(work); 176 cancel_delayed_work_sync(work);
177}
178
179/* Obsolete. use cancel_delayed_work_sync() */
180static inline
181void cancel_rearming_delayed_work(struct delayed_work *work)
182{
183 cancel_delayed_work_sync(work);
177} 184}
178 185
179#endif 186#endif
diff --git a/include/media/saa7146.h b/include/media/saa7146.h
index d3f4f5a38214..67703249b245 100644
--- a/include/media/saa7146.h
+++ b/include/media/saa7146.h
@@ -114,7 +114,7 @@ struct saa7146_dev
114 struct mutex lock; 114 struct mutex lock;
115 115
116 unsigned char __iomem *mem; /* pointer to mapped IO memory */ 116 unsigned char __iomem *mem; /* pointer to mapped IO memory */
117 int revision; /* chip revision; needed for bug-workarounds*/ 117 u32 revision; /* chip revision; needed for bug-workarounds*/
118 118
119 /* pci-device & irq stuff*/ 119 /* pci-device & irq stuff*/
120 char name[32]; 120 char name[32];
@@ -157,8 +157,8 @@ struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc);
157int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt); 157int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt);
158void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt); 158void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt);
159int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, struct scatterlist *list, int length ); 159int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, struct scatterlist *list, int length );
160char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt); 160void *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt);
161void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, char *mem, struct saa7146_pgtable *pt); 161void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, void *mem, struct saa7146_pgtable *pt);
162void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data); 162void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data);
163int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); 163int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop);
164 164
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 6dcf3c45707d..160381c72e4b 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -23,8 +23,6 @@
23#define _TUNER_H 23#define _TUNER_H
24 24
25#include <linux/videodev2.h> 25#include <linux/videodev2.h>
26#include <linux/i2c.h>
27#include <media/tuner-types.h>
28 26
29extern int tuner_debug; 27extern int tuner_debug;
30 28
@@ -124,6 +122,7 @@ extern int tuner_debug;
124#define TUNER_THOMSON_FE6600 72 /* DViCO FusionHDTV DVB-T Hybrid */ 122#define TUNER_THOMSON_FE6600 72 /* DViCO FusionHDTV DVB-T Hybrid */
125#define TUNER_SAMSUNG_TCPG_6121P30A 73 /* Hauppauge PVR-500 PAL */ 123#define TUNER_SAMSUNG_TCPG_6121P30A 73 /* Hauppauge PVR-500 PAL */
126#define TUNER_TDA9887 74 /* This tuner should be used only internally */ 124#define TUNER_TDA9887 74 /* This tuner should be used only internally */
125#define TUNER_TEA5761 75 /* Only FM Radio Tuner */
127 126
128/* tv card specific */ 127/* tv card specific */
129#define TDA9887_PRESENT (1<<0) 128#define TDA9887_PRESENT (1<<0)
@@ -182,74 +181,6 @@ struct tuner_setup {
182 int (*tuner_callback) (void *dev, int command,int arg); 181 int (*tuner_callback) (void *dev, int command,int arg);
183}; 182};
184 183
185struct tuner {
186 /* device */
187 struct i2c_client i2c;
188
189 unsigned int type; /* chip type */
190
191 unsigned int mode;
192 unsigned int mode_mask; /* Combination of allowable modes */
193
194 unsigned int tv_freq; /* keep track of the current settings */
195 unsigned int radio_freq;
196 u16 last_div;
197 unsigned int audmode;
198 v4l2_std_id std;
199
200 int using_v4l2;
201
202 /* used by tda9887 */
203 unsigned int tda9887_config;
204 unsigned char tda9887_data[4];
205
206 /* used by MT2032 */
207 unsigned int xogc;
208 unsigned int radio_if2;
209
210 /* used by tda8290 */
211 unsigned char tda8290_easy_mode;
212 unsigned char tda827x_lpsel;
213 unsigned char tda827x_addr;
214 unsigned char tda827x_ver;
215 unsigned int sgIF;
216
217 unsigned int config;
218 int (*tuner_callback) (void *dev, int command,int arg);
219
220 /* function ptrs */
221 void (*set_tv_freq)(struct i2c_client *c, unsigned int freq);
222 void (*set_radio_freq)(struct i2c_client *c, unsigned int freq);
223 int (*has_signal)(struct i2c_client *c);
224 int (*is_stereo)(struct i2c_client *c);
225 int (*get_afc)(struct i2c_client *c);
226 void (*tuner_status)(struct i2c_client *c);
227 void (*standby)(struct i2c_client *c);
228};
229
230extern unsigned const int tuner_count;
231
232extern int microtune_init(struct i2c_client *c);
233extern int xc3028_init(struct i2c_client *c);
234extern int tda8290_init(struct i2c_client *c);
235extern int tda8290_probe(struct i2c_client *c);
236extern int tea5767_tuner_init(struct i2c_client *c);
237extern int default_tuner_init(struct i2c_client *c);
238extern int tea5767_autodetection(struct i2c_client *c);
239extern int tda9887_tuner_init(struct i2c_client *c);
240
241#define tuner_warn(fmt, arg...) do {\
242 printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
243 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
244#define tuner_info(fmt, arg...) do {\
245 printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
246 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
247#define tuner_dbg(fmt, arg...) do {\
248 extern int tuner_debug; \
249 if (tuner_debug) \
250 printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
251 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
252
253#endif /* __KERNEL__ */ 184#endif /* __KERNEL__ */
254 185
255#endif /* _TUNER_H */ 186#endif /* _TUNER_H */
diff --git a/include/mtd/ubi-header.h b/include/mtd/ubi-header.h
index fa479c71aa34..74efa7763479 100644
--- a/include/mtd/ubi-header.h
+++ b/include/mtd/ubi-header.h
@@ -74,42 +74,13 @@ enum {
74 UBI_COMPAT_REJECT = 5 74 UBI_COMPAT_REJECT = 5
75}; 75};
76 76
77/*
78 * ubi16_t/ubi32_t/ubi64_t - 16, 32, and 64-bit integers used in UBI on-flash
79 * data structures.
80 */
81typedef struct {
82 uint16_t int16;
83} __attribute__ ((packed)) ubi16_t;
84
85typedef struct {
86 uint32_t int32;
87} __attribute__ ((packed)) ubi32_t;
88
89typedef struct {
90 uint64_t int64;
91} __attribute__ ((packed)) ubi64_t;
92
93/*
94 * In this implementation of UBI uses the big-endian format for on-flash
95 * integers. The below are the corresponding conversion macros.
96 */
97#define cpu_to_ubi16(x) ((ubi16_t){__cpu_to_be16(x)})
98#define ubi16_to_cpu(x) ((uint16_t)__be16_to_cpu((x).int16))
99
100#define cpu_to_ubi32(x) ((ubi32_t){__cpu_to_be32(x)})
101#define ubi32_to_cpu(x) ((uint32_t)__be32_to_cpu((x).int32))
102
103#define cpu_to_ubi64(x) ((ubi64_t){__cpu_to_be64(x)})
104#define ubi64_to_cpu(x) ((uint64_t)__be64_to_cpu((x).int64))
105
106/* Sizes of UBI headers */ 77/* Sizes of UBI headers */
107#define UBI_EC_HDR_SIZE sizeof(struct ubi_ec_hdr) 78#define UBI_EC_HDR_SIZE sizeof(struct ubi_ec_hdr)
108#define UBI_VID_HDR_SIZE sizeof(struct ubi_vid_hdr) 79#define UBI_VID_HDR_SIZE sizeof(struct ubi_vid_hdr)
109 80
110/* Sizes of UBI headers without the ending CRC */ 81/* Sizes of UBI headers without the ending CRC */
111#define UBI_EC_HDR_SIZE_CRC (UBI_EC_HDR_SIZE - sizeof(ubi32_t)) 82#define UBI_EC_HDR_SIZE_CRC (UBI_EC_HDR_SIZE - sizeof(__be32))
112#define UBI_VID_HDR_SIZE_CRC (UBI_VID_HDR_SIZE - sizeof(ubi32_t)) 83#define UBI_VID_HDR_SIZE_CRC (UBI_VID_HDR_SIZE - sizeof(__be32))
113 84
114/** 85/**
115 * struct ubi_ec_hdr - UBI erase counter header. 86 * struct ubi_ec_hdr - UBI erase counter header.
@@ -137,14 +108,14 @@ typedef struct {
137 * eraseblocks. 108 * eraseblocks.
138 */ 109 */
139struct ubi_ec_hdr { 110struct ubi_ec_hdr {
140 ubi32_t magic; 111 __be32 magic;
141 uint8_t version; 112 __u8 version;
142 uint8_t padding1[3]; 113 __u8 padding1[3];
143 ubi64_t ec; /* Warning: the current limit is 31-bit anyway! */ 114 __be64 ec; /* Warning: the current limit is 31-bit anyway! */
144 ubi32_t vid_hdr_offset; 115 __be32 vid_hdr_offset;
145 ubi32_t data_offset; 116 __be32 data_offset;
146 uint8_t padding2[36]; 117 __u8 padding2[36];
147 ubi32_t hdr_crc; 118 __be32 hdr_crc;
148} __attribute__ ((packed)); 119} __attribute__ ((packed));
149 120
150/** 121/**
@@ -262,22 +233,22 @@ struct ubi_ec_hdr {
262 * software (say, cramfs) on top of the UBI volume. 233 * software (say, cramfs) on top of the UBI volume.
263 */ 234 */
264struct ubi_vid_hdr { 235struct ubi_vid_hdr {
265 ubi32_t magic; 236 __be32 magic;
266 uint8_t version; 237 __u8 version;
267 uint8_t vol_type; 238 __u8 vol_type;
268 uint8_t copy_flag; 239 __u8 copy_flag;
269 uint8_t compat; 240 __u8 compat;
270 ubi32_t vol_id; 241 __be32 vol_id;
271 ubi32_t lnum; 242 __be32 lnum;
272 ubi32_t leb_ver; /* obsolete, to be removed, don't use */ 243 __be32 leb_ver; /* obsolete, to be removed, don't use */
273 ubi32_t data_size; 244 __be32 data_size;
274 ubi32_t used_ebs; 245 __be32 used_ebs;
275 ubi32_t data_pad; 246 __be32 data_pad;
276 ubi32_t data_crc; 247 __be32 data_crc;
277 uint8_t padding1[4]; 248 __u8 padding1[4];
278 ubi64_t sqnum; 249 __be64 sqnum;
279 uint8_t padding2[12]; 250 __u8 padding2[12];
280 ubi32_t hdr_crc; 251 __be32 hdr_crc;
281} __attribute__ ((packed)); 252} __attribute__ ((packed));
282 253
283/* Internal UBI volumes count */ 254/* Internal UBI volumes count */
@@ -306,7 +277,7 @@ struct ubi_vid_hdr {
306#define UBI_VTBL_RECORD_SIZE sizeof(struct ubi_vtbl_record) 277#define UBI_VTBL_RECORD_SIZE sizeof(struct ubi_vtbl_record)
307 278
308/* Size of the volume table record without the ending CRC */ 279/* Size of the volume table record without the ending CRC */
309#define UBI_VTBL_RECORD_SIZE_CRC (UBI_VTBL_RECORD_SIZE - sizeof(ubi32_t)) 280#define UBI_VTBL_RECORD_SIZE_CRC (UBI_VTBL_RECORD_SIZE - sizeof(__be32))
310 281
311/** 282/**
312 * struct ubi_vtbl_record - a record in the volume table. 283 * struct ubi_vtbl_record - a record in the volume table.
@@ -346,15 +317,15 @@ struct ubi_vid_hdr {
346 * Empty records contain all zeroes and the CRC checksum of those zeroes. 317 * Empty records contain all zeroes and the CRC checksum of those zeroes.
347 */ 318 */
348struct ubi_vtbl_record { 319struct ubi_vtbl_record {
349 ubi32_t reserved_pebs; 320 __be32 reserved_pebs;
350 ubi32_t alignment; 321 __be32 alignment;
351 ubi32_t data_pad; 322 __be32 data_pad;
352 uint8_t vol_type; 323 __u8 vol_type;
353 uint8_t upd_marker; 324 __u8 upd_marker;
354 ubi16_t name_len; 325 __be16 name_len;
355 uint8_t name[UBI_VOL_NAME_MAX+1]; 326 __u8 name[UBI_VOL_NAME_MAX+1];
356 uint8_t padding2[24]; 327 __u8 padding2[24];
357 ubi32_t crc; 328 __be32 crc;
358} __attribute__ ((packed)); 329} __attribute__ ((packed));
359 330
360#endif /* !__UBI_HEADER_H__ */ 331#endif /* !__UBI_HEADER_H__ */
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
new file mode 100644
index 000000000000..88884d39f28f
--- /dev/null
+++ b/include/net/9p/9p.h
@@ -0,0 +1,417 @@
1/*
2 * include/net/9p/9p.h
3 *
4 * 9P protocol definitions.
5 *
6 * Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net>
7 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
8 * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to:
21 * Free Software Foundation
22 * 51 Franklin Street, Fifth Floor
23 * Boston, MA 02111-1301 USA
24 *
25 */
26
27#ifndef NET_9P_H
28#define NET_9P_H
29
30#ifdef CONFIG_NET_9P_DEBUG
31
32#define P9_DEBUG_ERROR (1<<0)
33#define P9_DEBUG_9P (1<<2)
34#define P9_DEBUG_VFS (1<<3)
35#define P9_DEBUG_CONV (1<<4)
36#define P9_DEBUG_MUX (1<<5)
37#define P9_DEBUG_TRANS (1<<6)
38#define P9_DEBUG_SLABS (1<<7)
39#define P9_DEBUG_FCALL (1<<8)
40
41extern unsigned int p9_debug_level;
42
43#define P9_DPRINTK(level, format, arg...) \
44do { \
45 if ((p9_debug_level & level) == level) \
46 printk(KERN_NOTICE "-- %s (%d): " \
47 format , __FUNCTION__, current->pid , ## arg); \
48} while (0)
49
50#define PRINT_FCALL_ERROR(s, fcall) P9_DPRINTK(P9_DEBUG_ERROR, \
51 "%s: %.*s\n", s, fcall?fcall->params.rerror.error.len:0, \
52 fcall?fcall->params.rerror.error.str:"");
53
54#else
55#define P9_DPRINTK(level, format, arg...) do { } while (0)
56#define PRINT_FCALL_ERROR(s, fcall) do { } while (0)
57#endif
58
59#define P9_EPRINTK(level, format, arg...) \
60do { \
61 printk(level "9p: %s (%d): " \
62 format , __FUNCTION__, current->pid , ## arg); \
63} while (0)
64
65
66/* Message Types */
67enum {
68 P9_TVERSION = 100,
69 P9_RVERSION,
70 P9_TAUTH = 102,
71 P9_RAUTH,
72 P9_TATTACH = 104,
73 P9_RATTACH,
74 P9_TERROR = 106,
75 P9_RERROR,
76 P9_TFLUSH = 108,
77 P9_RFLUSH,
78 P9_TWALK = 110,
79 P9_RWALK,
80 P9_TOPEN = 112,
81 P9_ROPEN,
82 P9_TCREATE = 114,
83 P9_RCREATE,
84 P9_TREAD = 116,
85 P9_RREAD,
86 P9_TWRITE = 118,
87 P9_RWRITE,
88 P9_TCLUNK = 120,
89 P9_RCLUNK,
90 P9_TREMOVE = 122,
91 P9_RREMOVE,
92 P9_TSTAT = 124,
93 P9_RSTAT,
94 P9_TWSTAT = 126,
95 P9_RWSTAT,
96};
97
98/* open modes */
99enum {
100 P9_OREAD = 0x00,
101 P9_OWRITE = 0x01,
102 P9_ORDWR = 0x02,
103 P9_OEXEC = 0x03,
104 P9_OEXCL = 0x04,
105 P9_OTRUNC = 0x10,
106 P9_OREXEC = 0x20,
107 P9_ORCLOSE = 0x40,
108 P9_OAPPEND = 0x80,
109};
110
111/* permissions */
112enum {
113 P9_DMDIR = 0x80000000,
114 P9_DMAPPEND = 0x40000000,
115 P9_DMEXCL = 0x20000000,
116 P9_DMMOUNT = 0x10000000,
117 P9_DMAUTH = 0x08000000,
118 P9_DMTMP = 0x04000000,
119 P9_DMSYMLINK = 0x02000000,
120 P9_DMLINK = 0x01000000,
121 /* 9P2000.u extensions */
122 P9_DMDEVICE = 0x00800000,
123 P9_DMNAMEDPIPE = 0x00200000,
124 P9_DMSOCKET = 0x00100000,
125 P9_DMSETUID = 0x00080000,
126 P9_DMSETGID = 0x00040000,
127};
128
129/* qid.types */
130enum {
131 P9_QTDIR = 0x80,
132 P9_QTAPPEND = 0x40,
133 P9_QTEXCL = 0x20,
134 P9_QTMOUNT = 0x10,
135 P9_QTAUTH = 0x08,
136 P9_QTTMP = 0x04,
137 P9_QTSYMLINK = 0x02,
138 P9_QTLINK = 0x01,
139 P9_QTFILE = 0x00,
140};
141
142#define P9_NOTAG (u16)(~0)
143#define P9_NOFID (u32)(~0)
144#define P9_MAXWELEM 16
145
146/* ample room for Twrite/Rread header */
147#define P9_IOHDRSZ 24
148
149struct p9_str {
150 u16 len;
151 char *str;
152};
153
154/* qids are the unique ID for a file (like an inode */
155struct p9_qid {
156 u8 type;
157 u32 version;
158 u64 path;
159};
160
161/* Plan 9 file metadata (stat) structure */
162struct p9_stat {
163 u16 size;
164 u16 type;
165 u32 dev;
166 struct p9_qid qid;
167 u32 mode;
168 u32 atime;
169 u32 mtime;
170 u64 length;
171 struct p9_str name;
172 struct p9_str uid;
173 struct p9_str gid;
174 struct p9_str muid;
175 struct p9_str extension; /* 9p2000.u extensions */
176 u32 n_uid; /* 9p2000.u extensions */
177 u32 n_gid; /* 9p2000.u extensions */
178 u32 n_muid; /* 9p2000.u extensions */
179};
180
181/* file metadata (stat) structure used to create Twstat message
182 The is similar to p9_stat, but the strings don't point to
183 the same memory block and should be freed separately
184*/
185struct p9_wstat {
186 u16 size;
187 u16 type;
188 u32 dev;
189 struct p9_qid qid;
190 u32 mode;
191 u32 atime;
192 u32 mtime;
193 u64 length;
194 char *name;
195 char *uid;
196 char *gid;
197 char *muid;
198 char *extension; /* 9p2000.u extensions */
199 u32 n_uid; /* 9p2000.u extensions */
200 u32 n_gid; /* 9p2000.u extensions */
201 u32 n_muid; /* 9p2000.u extensions */
202};
203
204/* Structures for Protocol Operations */
205struct p9_tversion {
206 u32 msize;
207 struct p9_str version;
208};
209
210struct p9_rversion {
211 u32 msize;
212 struct p9_str version;
213};
214
215struct p9_tauth {
216 u32 afid;
217 struct p9_str uname;
218 struct p9_str aname;
219};
220
221struct p9_rauth {
222 struct p9_qid qid;
223};
224
225struct p9_rerror {
226 struct p9_str error;
227 u32 errno; /* 9p2000.u extension */
228};
229
230struct p9_tflush {
231 u16 oldtag;
232};
233
234struct p9_rflush {
235};
236
237struct p9_tattach {
238 u32 fid;
239 u32 afid;
240 struct p9_str uname;
241 struct p9_str aname;
242};
243
244struct p9_rattach {
245 struct p9_qid qid;
246};
247
248struct p9_twalk {
249 u32 fid;
250 u32 newfid;
251 u16 nwname;
252 struct p9_str wnames[16];
253};
254
255struct p9_rwalk {
256 u16 nwqid;
257 struct p9_qid wqids[16];
258};
259
260struct p9_topen {
261 u32 fid;
262 u8 mode;
263};
264
265struct p9_ropen {
266 struct p9_qid qid;
267 u32 iounit;
268};
269
270struct p9_tcreate {
271 u32 fid;
272 struct p9_str name;
273 u32 perm;
274 u8 mode;
275 struct p9_str extension;
276};
277
278struct p9_rcreate {
279 struct p9_qid qid;
280 u32 iounit;
281};
282
283struct p9_tread {
284 u32 fid;
285 u64 offset;
286 u32 count;
287};
288
289struct p9_rread {
290 u32 count;
291 u8 *data;
292};
293
294struct p9_twrite {
295 u32 fid;
296 u64 offset;
297 u32 count;
298 u8 *data;
299};
300
301struct p9_rwrite {
302 u32 count;
303};
304
305struct p9_tclunk {
306 u32 fid;
307};
308
309struct p9_rclunk {
310};
311
312struct p9_tremove {
313 u32 fid;
314};
315
316struct p9_rremove {
317};
318
319struct p9_tstat {
320 u32 fid;
321};
322
323struct p9_rstat {
324 struct p9_stat stat;
325};
326
327struct p9_twstat {
328 u32 fid;
329 struct p9_stat stat;
330};
331
332struct p9_rwstat {
333};
334
335/*
336 * fcall is the primary packet structure
337 *
338 */
339
340struct p9_fcall {
341 u32 size;
342 u8 id;
343 u16 tag;
344 void *sdata;
345
346 union {
347 struct p9_tversion tversion;
348 struct p9_rversion rversion;
349 struct p9_tauth tauth;
350 struct p9_rauth rauth;
351 struct p9_rerror rerror;
352 struct p9_tflush tflush;
353 struct p9_rflush rflush;
354 struct p9_tattach tattach;
355 struct p9_rattach rattach;
356 struct p9_twalk twalk;
357 struct p9_rwalk rwalk;
358 struct p9_topen topen;
359 struct p9_ropen ropen;
360 struct p9_tcreate tcreate;
361 struct p9_rcreate rcreate;
362 struct p9_tread tread;
363 struct p9_rread rread;
364 struct p9_twrite twrite;
365 struct p9_rwrite rwrite;
366 struct p9_tclunk tclunk;
367 struct p9_rclunk rclunk;
368 struct p9_tremove tremove;
369 struct p9_rremove rremove;
370 struct p9_tstat tstat;
371 struct p9_rstat rstat;
372 struct p9_twstat twstat;
373 struct p9_rwstat rwstat;
374 } params;
375};
376
377struct p9_idpool;
378
379int p9_deserialize_stat(void *buf, u32 buflen, struct p9_stat *stat,
380 int dotu);
381int p9_deserialize_fcall(void *buf, u32 buflen, struct p9_fcall *fc, int dotu);
382void p9_set_tag(struct p9_fcall *fc, u16 tag);
383struct p9_fcall *p9_create_tversion(u32 msize, char *version);
384struct p9_fcall *p9_create_tattach(u32 fid, u32 afid, char *uname,
385 char *aname);
386struct p9_fcall *p9_create_tauth(u32 afid, char *uname, char *aname);
387struct p9_fcall *p9_create_tflush(u16 oldtag);
388struct p9_fcall *p9_create_twalk(u32 fid, u32 newfid, u16 nwname,
389 char **wnames);
390struct p9_fcall *p9_create_topen(u32 fid, u8 mode);
391struct p9_fcall *p9_create_tcreate(u32 fid, char *name, u32 perm, u8 mode,
392 char *extension, int dotu);
393struct p9_fcall *p9_create_tread(u32 fid, u64 offset, u32 count);
394struct p9_fcall *p9_create_twrite(u32 fid, u64 offset, u32 count,
395 const char *data);
396struct p9_fcall *p9_create_twrite_u(u32 fid, u64 offset, u32 count,
397 const char __user *data);
398struct p9_fcall *p9_create_tclunk(u32 fid);
399struct p9_fcall *p9_create_tremove(u32 fid);
400struct p9_fcall *p9_create_tstat(u32 fid);
401struct p9_fcall *p9_create_twstat(u32 fid, struct p9_wstat *wstat,
402 int dotu);
403
404int p9_printfcall(char *buf, int buflen, struct p9_fcall *fc, int dotu);
405int p9_errstr2errno(char *errstr, int len);
406
407struct p9_idpool *p9_idpool_create(void);
408void p9_idpool_destroy(struct p9_idpool *);
409int p9_idpool_get(struct p9_idpool *p);
410void p9_idpool_put(int id, struct p9_idpool *p);
411int p9_idpool_check(int id, struct p9_idpool *p);
412
413int p9_error_init(void);
414int p9_errstr2errno(char *, int);
415int __init p9_sysctl_register(void);
416void __exit p9_sysctl_unregister(void);
417#endif /* NET_9P_H */
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
new file mode 100644
index 000000000000..d65ed7c69063
--- /dev/null
+++ b/include/net/9p/client.h
@@ -0,0 +1,80 @@
1/*
2 * include/net/9p/client.h
3 *
4 * 9P Client Definitions
5 *
6 * Copyright (C) 2007 by Latchesar Ionkov <lucho@ionkov.net>
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
10 * as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to:
19 * Free Software Foundation
20 * 51 Franklin Street, Fifth Floor
21 * Boston, MA 02111-1301 USA
22 *
23 */
24
25#ifndef NET_9P_CLIENT_H
26#define NET_9P_CLIENT_H
27
28struct p9_client {
29 spinlock_t lock; /* protect client structure */
30 int msize;
31 unsigned char dotu;
32 struct p9_transport *trans;
33 struct p9_conn *conn;
34
35 struct p9_idpool *fidpool;
36 struct list_head fidlist;
37};
38
39struct p9_fid {
40 struct p9_client *clnt;
41 u32 fid;
42 int mode;
43 struct p9_qid qid;
44 u32 iounit;
45 uid_t uid;
46 void *aux;
47
48 int rdir_fpos;
49 int rdir_pos;
50 struct p9_fcall *rdir_fcall;
51 struct list_head flist;
52 struct list_head dlist; /* list of all fids attached to a dentry */
53};
54
55struct p9_client *p9_client_create(struct p9_transport *trans, int msize,
56 int dotu);
57void p9_client_destroy(struct p9_client *clnt);
58void p9_client_disconnect(struct p9_client *clnt);
59struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
60 char *uname, char *aname);
61struct p9_fid *p9_client_auth(struct p9_client *clnt, char *uname, char *aname);
62struct p9_fid *p9_client_walk(struct p9_fid *oldfid, int nwname, char **wnames,
63 int clone);
64int p9_client_open(struct p9_fid *fid, int mode);
65int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode,
66 char *extension);
67int p9_client_clunk(struct p9_fid *fid);
68int p9_client_remove(struct p9_fid *fid);
69int p9_client_read(struct p9_fid *fid, char *data, u64 offset, u32 count);
70int p9_client_readn(struct p9_fid *fid, char *data, u64 offset, u32 count);
71int p9_client_write(struct p9_fid *fid, char *data, u64 offset, u32 count);
72int p9_client_uread(struct p9_fid *fid, char __user *data, u64 offset,
73 u32 count);
74int p9_client_uwrite(struct p9_fid *fid, const char __user *data, u64 offset,
75 u32 count);
76struct p9_stat *p9_client_stat(struct p9_fid *fid);
77int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst);
78struct p9_stat *p9_client_dirread(struct p9_fid *fid, u64 offset);
79
80#endif /* NET_9P_CLIENT_H */
diff --git a/include/net/9p/conn.h b/include/net/9p/conn.h
new file mode 100644
index 000000000000..583b6a2cb3df
--- /dev/null
+++ b/include/net/9p/conn.h
@@ -0,0 +1,57 @@
1/*
2 * include/net/9p/conn.h
3 *
4 * Connection Definitions
5 *
6 * Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net>
7 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to:
20 * Free Software Foundation
21 * 51 Franklin Street, Fifth Floor
22 * Boston, MA 02111-1301 USA
23 *
24 */
25
26#ifndef NET_9P_CONN_H
27#define NET_9P_CONN_H
28
29#undef P9_NONBLOCK
30
31struct p9_conn;
32struct p9_req;
33
34/**
35 * p9_mux_req_callback - callback function that is called when the
36 * response of a request is received. The callback is called from
37 * a workqueue and shouldn't block.
38 *
39 * @req - request
40 * @a - the pointer that was specified when the request was send to be
41 * passed to the callback
42 */
43typedef void (*p9_conn_req_callback)(struct p9_req *req, void *a);
44
45struct p9_conn *p9_conn_create(struct p9_transport *trans, int msize,
46 unsigned char *dotu);
47void p9_conn_destroy(struct p9_conn *);
48int p9_conn_rpc(struct p9_conn *m, struct p9_fcall *tc, struct p9_fcall **rc);
49
50#ifdef P9_NONBLOCK
51int p9_conn_rpcnb(struct p9_conn *m, struct p9_fcall *tc,
52 p9_conn_req_callback cb, void *a);
53#endif /* P9_NONBLOCK */
54
55void p9_conn_cancel(struct p9_conn *m, int err);
56
57#endif /* NET_9P_CONN_H */
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
new file mode 100644
index 000000000000..462d42279fb0
--- /dev/null
+++ b/include/net/9p/transport.h
@@ -0,0 +1,49 @@
1/*
2 * include/net/9p/transport.h
3 *
4 * Transport Definition
5 *
6 * Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net>
7 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to:
20 * Free Software Foundation
21 * 51 Franklin Street, Fifth Floor
22 * Boston, MA 02111-1301 USA
23 *
24 */
25
26#ifndef NET_9P_TRANSPORT_H
27#define NET_9P_TRANSPORT_H
28
29enum p9_transport_status {
30 Connected,
31 Disconnected,
32 Hung,
33};
34
35struct p9_transport {
36 enum p9_transport_status status;
37 void *priv;
38
39 int (*write) (struct p9_transport *, void *, int);
40 int (*read) (struct p9_transport *, void *, int);
41 void (*close) (struct p9_transport *);
42 unsigned int (*poll)(struct p9_transport *, struct poll_table_struct *);
43};
44
45struct p9_transport *p9_trans_create_tcp(const char *addr, int port);
46struct p9_transport *p9_trans_create_unix(const char *addr);
47struct p9_transport *p9_trans_create_fd(int rfd, int wfd);
48
49#endif /* NET_9P_TRANSPORT_H */
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 8b06c2f3657f..68b4eaf7719d 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -19,7 +19,6 @@ struct tcf_common {
19 struct gnet_stats_basic tcfc_bstats; 19 struct gnet_stats_basic tcfc_bstats;
20 struct gnet_stats_queue tcfc_qstats; 20 struct gnet_stats_queue tcfc_qstats;
21 struct gnet_stats_rate_est tcfc_rate_est; 21 struct gnet_stats_rate_est tcfc_rate_est;
22 spinlock_t *tcfc_stats_lock;
23 spinlock_t tcfc_lock; 22 spinlock_t tcfc_lock;
24}; 23};
25#define tcf_next common.tcfc_next 24#define tcf_next common.tcfc_next
@@ -32,7 +31,6 @@ struct tcf_common {
32#define tcf_bstats common.tcfc_bstats 31#define tcf_bstats common.tcfc_bstats
33#define tcf_qstats common.tcfc_qstats 32#define tcf_qstats common.tcfc_qstats
34#define tcf_rate_est common.tcfc_rate_est 33#define tcf_rate_est common.tcfc_rate_est
35#define tcf_stats_lock common.tcfc_stats_lock
36#define tcf_lock common.tcfc_lock 34#define tcf_lock common.tcfc_lock
37 35
38struct tcf_police { 36struct tcf_police {
@@ -123,34 +121,4 @@ extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, in
123extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); 121extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
124extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *, int); 122extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *, int);
125#endif /* CONFIG_NET_CLS_ACT */ 123#endif /* CONFIG_NET_CLS_ACT */
126
127extern int tcf_police(struct sk_buff *skb, struct tcf_police *p);
128extern void tcf_police_destroy(struct tcf_police *p);
129extern struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est);
130extern int tcf_police_dump(struct sk_buff *skb, struct tcf_police *p);
131extern int tcf_police_dump_stats(struct sk_buff *skb, struct tcf_police *p);
132
133static inline int
134tcf_police_release(struct tcf_police *p, int bind)
135{
136 int ret = 0;
137#ifdef CONFIG_NET_CLS_ACT
138 if (p) {
139 if (bind)
140 p->tcf_bindcnt--;
141
142 p->tcf_refcnt--;
143 if (p->tcf_refcnt <= 0 && !p->tcf_bindcnt) {
144 tcf_police_destroy(p);
145 ret = 1;
146 }
147 }
148#else
149 if (p && --p->tcf_refcnt == 0)
150 tcf_police_destroy(p);
151
152#endif /* CONFIG_NET_CLS_ACT */
153 return ret;
154}
155
156#endif 124#endif
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index f3531d0bcd05..33b593e17441 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -61,7 +61,7 @@ extern int addrconf_set_dstaddr(void __user *arg);
61extern int ipv6_chk_addr(struct in6_addr *addr, 61extern int ipv6_chk_addr(struct in6_addr *addr,
62 struct net_device *dev, 62 struct net_device *dev,
63 int strict); 63 int strict);
64#ifdef CONFIG_IPV6_MIP6 64#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
65extern int ipv6_chk_home_addr(struct in6_addr *addr); 65extern int ipv6_chk_home_addr(struct in6_addr *addr);
66#endif 66#endif
67extern struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, 67extern struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr,
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index c0398f5a8cb9..6de1e9e35c73 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -62,13 +62,11 @@ struct unix_skb_parms {
62#define UNIXCREDS(skb) (&UNIXCB((skb)).creds) 62#define UNIXCREDS(skb) (&UNIXCB((skb)).creds)
63#define UNIXSID(skb) (&UNIXCB((skb)).secid) 63#define UNIXSID(skb) (&UNIXCB((skb)).secid)
64 64
65#define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock) 65#define unix_state_lock(s) spin_lock(&unix_sk(s)->lock)
66#define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock) 66#define unix_state_unlock(s) spin_unlock(&unix_sk(s)->lock)
67#define unix_state_wlock(s) spin_lock(&unix_sk(s)->lock) 67#define unix_state_lock_nested(s) \
68#define unix_state_wlock_nested(s) \
69 spin_lock_nested(&unix_sk(s)->lock, \ 68 spin_lock_nested(&unix_sk(s)->lock, \
70 SINGLE_DEPTH_NESTING) 69 SINGLE_DEPTH_NESTING)
71#define unix_state_wunlock(s) spin_unlock(&unix_sk(s)->lock)
72 70
73#ifdef __KERNEL__ 71#ifdef __KERNEL__
74/* The AF_UNIX socket */ 72/* The AF_UNIX socket */
@@ -81,9 +79,10 @@ struct unix_sock {
81 struct mutex readlock; 79 struct mutex readlock;
82 struct sock *peer; 80 struct sock *peer;
83 struct sock *other; 81 struct sock *other;
84 struct sock *gc_tree; 82 struct list_head link;
85 atomic_t inflight; 83 atomic_t inflight;
86 spinlock_t lock; 84 spinlock_t lock;
85 unsigned int gc_candidate : 1;
87 wait_queue_head_t peer_wait; 86 wait_queue_head_t peer_wait;
88}; 87};
89#define unix_sk(__sk) ((struct unix_sock *)__sk) 88#define unix_sk(__sk) ((struct unix_sock *)__sk)
diff --git a/include/net/ax88796.h b/include/net/ax88796.h
new file mode 100644
index 000000000000..ee786a043b3d
--- /dev/null
+++ b/include/net/ax88796.h
@@ -0,0 +1,27 @@
1/* include/net/ax88796.h
2 *
3 * Copyright 2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10*/
11
12#ifndef __NET_AX88796_PLAT_H
13#define __NET_AX88796_PLAT_H
14
15#define AXFLG_HAS_EEPROM (1<<0)
16#define AXFLG_MAC_FROMDEV (1<<1) /* device already has MAC */
17
18struct ax_plat_data {
19 unsigned int flags;
20 unsigned char wordlength; /* 1 or 2 */
21 unsigned char dcr_val; /* default value for DCR */
22 unsigned char rcr_val; /* default value for RCR */
23 unsigned char gpoc_val; /* default value for GPOC */
24 u32 *reg_offsets; /* register offsets */
25};
26
27#endif /* __NET_AX88796_PLAT_H */
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 93ce272a5d27..ebfb96b41106 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -107,14 +107,14 @@ enum {
107#define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ 107#define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */
108#define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ 108#define HCI_INIT_TIMEOUT (10000) /* 10 seconds */
109 109
110/* HCI Packet types */ 110/* HCI data types */
111#define HCI_COMMAND_PKT 0x01 111#define HCI_COMMAND_PKT 0x01
112#define HCI_ACLDATA_PKT 0x02 112#define HCI_ACLDATA_PKT 0x02
113#define HCI_SCODATA_PKT 0x03 113#define HCI_SCODATA_PKT 0x03
114#define HCI_EVENT_PKT 0x04 114#define HCI_EVENT_PKT 0x04
115#define HCI_VENDOR_PKT 0xff 115#define HCI_VENDOR_PKT 0xff
116 116
117/* HCI Packet types */ 117/* HCI packet types */
118#define HCI_DM1 0x0008 118#define HCI_DM1 0x0008
119#define HCI_DM3 0x0400 119#define HCI_DM3 0x0400
120#define HCI_DM5 0x4000 120#define HCI_DM5 0x4000
@@ -129,6 +129,14 @@ enum {
129#define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) 129#define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3)
130#define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) 130#define ACL_PTYPE_MASK (~SCO_PTYPE_MASK)
131 131
132/* eSCO packet types */
133#define ESCO_HV1 0x0001
134#define ESCO_HV2 0x0002
135#define ESCO_HV3 0x0004
136#define ESCO_EV3 0x0008
137#define ESCO_EV4 0x0010
138#define ESCO_EV5 0x0020
139
132/* ACL flags */ 140/* ACL flags */
133#define ACL_CONT 0x01 141#define ACL_CONT 0x01
134#define ACL_START 0x02 142#define ACL_START 0x02
@@ -138,6 +146,7 @@ enum {
138/* Baseband links */ 146/* Baseband links */
139#define SCO_LINK 0x00 147#define SCO_LINK 0x00
140#define ACL_LINK 0x01 148#define ACL_LINK 0x01
149#define ESCO_LINK 0x02
141 150
142/* LMP features */ 151/* LMP features */
143#define LMP_3SLOT 0x01 152#define LMP_3SLOT 0x01
@@ -162,6 +171,11 @@ enum {
162#define LMP_PSCHEME 0x02 171#define LMP_PSCHEME 0x02
163#define LMP_PCONTROL 0x04 172#define LMP_PCONTROL 0x04
164 173
174#define LMP_ESCO 0x80
175
176#define LMP_EV4 0x01
177#define LMP_EV5 0x02
178
165#define LMP_SNIFF_SUBR 0x02 179#define LMP_SNIFF_SUBR 0x02
166 180
167/* Connection modes */ 181/* Connection modes */
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index c0fc39620f36..8f67c8a7169b 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -78,6 +78,7 @@ struct hci_dev {
78 __u16 voice_setting; 78 __u16 voice_setting;
79 79
80 __u16 pkt_type; 80 __u16 pkt_type;
81 __u16 esco_type;
81 __u16 link_policy; 82 __u16 link_policy;
82 __u16 link_mode; 83 __u16 link_mode;
83 84
@@ -109,6 +110,7 @@ struct hci_dev {
109 struct sk_buff_head cmd_q; 110 struct sk_buff_head cmd_q;
110 111
111 struct sk_buff *sent_cmd; 112 struct sk_buff *sent_cmd;
113 struct sk_buff *reassembly[3];
112 114
113 struct semaphore req_lock; 115 struct semaphore req_lock;
114 wait_queue_head_t req_wait_q; 116 wait_queue_head_t req_wait_q;
@@ -437,6 +439,8 @@ static inline int hci_recv_frame(struct sk_buff *skb)
437 return 0; 439 return 0;
438} 440}
439 441
442int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count);
443
440int hci_register_sysfs(struct hci_dev *hdev); 444int hci_register_sysfs(struct hci_dev *hdev);
441void hci_unregister_sysfs(struct hci_dev *hdev); 445void hci_unregister_sysfs(struct hci_dev *hdev);
442void hci_conn_add_sysfs(struct hci_conn *conn); 446void hci_conn_add_sysfs(struct hci_conn *conn);
@@ -449,6 +453,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
449#define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) 453#define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT)
450#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) 454#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF)
451#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) 455#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
456#define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO)
452 457
453/* ----- HCI protocols ----- */ 458/* ----- HCI protocols ----- */
454struct hci_proto { 459struct hci_proto {
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index 3c563f02907c..25aa575db807 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -323,6 +323,7 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc
323#define RFCOMM_RELEASE_ONHUP 1 323#define RFCOMM_RELEASE_ONHUP 1
324#define RFCOMM_HANGUP_NOW 2 324#define RFCOMM_HANGUP_NOW 2
325#define RFCOMM_TTY_ATTACHED 3 325#define RFCOMM_TTY_ATTACHED 3
326#define RFCOMM_TTY_RELEASED 4
326 327
327struct rfcomm_dev_req { 328struct rfcomm_dev_req {
328 s16 dev_id; 329 s16 dev_id;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 88171f8ce58a..7edaef6b29d6 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -11,6 +11,44 @@
11 * Copyright 2006 Johannes Berg <johannes@sipsolutions.net> 11 * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
12 */ 12 */
13 13
14
15/* Radiotap header iteration
16 * implemented in net/wireless/radiotap.c
17 * docs in Documentation/networking/radiotap-headers.txt
18 */
19/**
20 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
21 * @rtheader: pointer to the radiotap header we are walking through
22 * @max_length: length of radiotap header in cpu byte ordering
23 * @this_arg_index: IEEE80211_RADIOTAP_... index of current arg
24 * @this_arg: pointer to current radiotap arg
25 * @arg_index: internal next argument index
26 * @arg: internal next argument pointer
27 * @next_bitmap: internal pointer to next present u32
28 * @bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
29 */
30
31struct ieee80211_radiotap_iterator {
32 struct ieee80211_radiotap_header *rtheader;
33 int max_length;
34 int this_arg_index;
35 u8 *this_arg;
36
37 int arg_index;
38 u8 *arg;
39 __le32 *next_bitmap;
40 u32 bitmap_shifter;
41};
42
43extern int ieee80211_radiotap_iterator_init(
44 struct ieee80211_radiotap_iterator *iterator,
45 struct ieee80211_radiotap_header *radiotap_header,
46 int max_length);
47
48extern int ieee80211_radiotap_iterator_next(
49 struct ieee80211_radiotap_iterator *iterator);
50
51
14/* from net/wireless.h */ 52/* from net/wireless.h */
15struct wiphy; 53struct wiphy;
16 54
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index 4f90f5554fac..a6bb94530cfd 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -203,12 +203,10 @@ static inline int cipso_v4_cache_add(const struct sk_buff *skb,
203 203
204#ifdef CONFIG_NETLABEL 204#ifdef CONFIG_NETLABEL
205void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway); 205void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway);
206int cipso_v4_socket_setattr(const struct socket *sock, 206int cipso_v4_sock_setattr(struct sock *sk,
207 const struct cipso_v4_doi *doi_def, 207 const struct cipso_v4_doi *doi_def,
208 const struct netlbl_lsm_secattr *secattr); 208 const struct netlbl_lsm_secattr *secattr);
209int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr); 209int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr);
210int cipso_v4_socket_getattr(const struct socket *sock,
211 struct netlbl_lsm_secattr *secattr);
212int cipso_v4_skbuff_getattr(const struct sk_buff *skb, 210int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
213 struct netlbl_lsm_secattr *secattr); 211 struct netlbl_lsm_secattr *secattr);
214int cipso_v4_validate(unsigned char **option); 212int cipso_v4_validate(unsigned char **option);
@@ -220,9 +218,9 @@ static inline void cipso_v4_error(struct sk_buff *skb,
220 return; 218 return;
221} 219}
222 220
223static inline int cipso_v4_socket_setattr(const struct socket *sock, 221static inline int cipso_v4_sock_setattr(struct sock *sk,
224 const struct cipso_v4_doi *doi_def, 222 const struct cipso_v4_doi *doi_def,
225 const struct netlbl_lsm_secattr *secattr) 223 const struct netlbl_lsm_secattr *secattr)
226{ 224{
227 return -ENOSYS; 225 return -ENOSYS;
228} 226}
@@ -233,12 +231,6 @@ static inline int cipso_v4_sock_getattr(struct sock *sk,
233 return -ENOSYS; 231 return -ENOSYS;
234} 232}
235 233
236static inline int cipso_v4_socket_getattr(const struct socket *sock,
237 struct netlbl_lsm_secattr *secattr)
238{
239 return -ENOSYS;
240}
241
242static inline int cipso_v4_skbuff_getattr(const struct sk_buff *skb, 234static inline int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
243 struct netlbl_lsm_secattr *secattr) 235 struct netlbl_lsm_secattr *secattr)
244{ 236{
diff --git a/include/net/dn.h b/include/net/dn.h
index ac4ce9091747..627778384c84 100644
--- a/include/net/dn.h
+++ b/include/net/dn.h
@@ -3,7 +3,6 @@
3 3
4#include <linux/dn.h> 4#include <linux/dn.h>
5#include <net/sock.h> 5#include <net/sock.h>
6#include <net/tcp.h>
7#include <asm/byteorder.h> 6#include <asm/byteorder.h>
8 7
9#define dn_ntohs(x) le16_to_cpu(x) 8#define dn_ntohs(x) le16_to_cpu(x)
diff --git a/include/net/dst.h b/include/net/dst.h
index 82270f9332db..e9ff4a4caef9 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -47,7 +47,6 @@ struct dst_entry
47#define DST_NOXFRM 2 47#define DST_NOXFRM 2
48#define DST_NOPOLICY 4 48#define DST_NOPOLICY 4
49#define DST_NOHASH 8 49#define DST_NOHASH 8
50#define DST_BALANCED 0x10
51 unsigned long expires; 50 unsigned long expires;
52 51
53 unsigned short header_len; /* more space at head required */ 52 unsigned short header_len; /* more space at head required */
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index ed3a8872c6ca..83e41dd15ccd 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -64,7 +64,7 @@ struct fib_rules_ops
64 void (*flush_cache)(void); 64 void (*flush_cache)(void);
65 65
66 int nlgroup; 66 int nlgroup;
67 struct nla_policy *policy; 67 const struct nla_policy *policy;
68 struct list_head *rules_list; 68 struct list_head *rules_list;
69 struct module *owner; 69 struct module *owner;
70}; 70};
diff --git a/include/net/flow.h b/include/net/flow.h
index f3cc1f812619..af59fa5cc1f8 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -67,20 +67,16 @@ struct flowi {
67 67
68 __be32 spi; 68 __be32 spi;
69 69
70#ifdef CONFIG_IPV6_MIP6
71 struct { 70 struct {
72 __u8 type; 71 __u8 type;
73 } mht; 72 } mht;
74#endif
75 } uli_u; 73 } uli_u;
76#define fl_ip_sport uli_u.ports.sport 74#define fl_ip_sport uli_u.ports.sport
77#define fl_ip_dport uli_u.ports.dport 75#define fl_ip_dport uli_u.ports.dport
78#define fl_icmp_type uli_u.icmpt.type 76#define fl_icmp_type uli_u.icmpt.type
79#define fl_icmp_code uli_u.icmpt.code 77#define fl_icmp_code uli_u.icmpt.code
80#define fl_ipsec_spi uli_u.spi 78#define fl_ipsec_spi uli_u.spi
81#ifdef CONFIG_IPV6_MIP6
82#define fl_mh_type uli_u.mht.type 79#define fl_mh_type uli_u.mht.type
83#endif
84 __u32 secid; /* used by xfrm; see secid.txt */ 80 __u32 secid; /* used by xfrm; see secid.txt */
85} __attribute__((__aligned__(BITS_PER_LONG/8))); 81} __attribute__((__aligned__(BITS_PER_LONG/8)));
86 82
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index adff4c898d50..decdda546829 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -5,6 +5,22 @@
5#include <net/netlink.h> 5#include <net/netlink.h>
6 6
7/** 7/**
8 * struct genl_multicast_group - generic netlink multicast group
9 * @name: name of the multicast group, names are per-family
10 * @id: multicast group ID, assigned by the core, to use with
11 * genlmsg_multicast().
12 * @list: list entry for linking
13 * @family: pointer to family, need not be set before registering
14 */
15struct genl_multicast_group
16{
17 struct genl_family *family; /* private */
18 struct list_head list; /* private */
19 char name[GENL_NAMSIZ];
20 u32 id;
21};
22
23/**
8 * struct genl_family - generic netlink family 24 * struct genl_family - generic netlink family
9 * @id: protocol family idenfitier 25 * @id: protocol family idenfitier
10 * @hdrsize: length of user specific header in bytes 26 * @hdrsize: length of user specific header in bytes
@@ -14,6 +30,7 @@
14 * @attrbuf: buffer to store parsed attributes 30 * @attrbuf: buffer to store parsed attributes
15 * @ops_list: list of all assigned operations 31 * @ops_list: list of all assigned operations
16 * @family_list: family list 32 * @family_list: family list
33 * @mcast_groups: multicast groups list
17 */ 34 */
18struct genl_family 35struct genl_family
19{ 36{
@@ -25,6 +42,7 @@ struct genl_family
25 struct nlattr ** attrbuf; /* private */ 42 struct nlattr ** attrbuf; /* private */
26 struct list_head ops_list; /* private */ 43 struct list_head ops_list; /* private */
27 struct list_head family_list; /* private */ 44 struct list_head family_list; /* private */
45 struct list_head mcast_groups; /* private */
28}; 46};
29 47
30/** 48/**
@@ -60,7 +78,7 @@ struct genl_ops
60{ 78{
61 u8 cmd; 79 u8 cmd;
62 unsigned int flags; 80 unsigned int flags;
63 struct nla_policy *policy; 81 const struct nla_policy *policy;
64 int (*doit)(struct sk_buff *skb, 82 int (*doit)(struct sk_buff *skb,
65 struct genl_info *info); 83 struct genl_info *info);
66 int (*dumpit)(struct sk_buff *skb, 84 int (*dumpit)(struct sk_buff *skb,
@@ -73,6 +91,10 @@ extern int genl_register_family(struct genl_family *family);
73extern int genl_unregister_family(struct genl_family *family); 91extern int genl_unregister_family(struct genl_family *family);
74extern int genl_register_ops(struct genl_family *, struct genl_ops *ops); 92extern int genl_register_ops(struct genl_family *, struct genl_ops *ops);
75extern int genl_unregister_ops(struct genl_family *, struct genl_ops *ops); 93extern int genl_unregister_ops(struct genl_family *, struct genl_ops *ops);
94extern int genl_register_mc_group(struct genl_family *family,
95 struct genl_multicast_group *grp);
96extern void genl_unregister_mc_group(struct genl_family *family,
97 struct genl_multicast_group *grp);
76 98
77extern struct sock *genl_sock; 99extern struct sock *genl_sock;
78 100
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 09a2532699b2..47d52b2414db 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -209,9 +209,6 @@ static inline void inet_twsk_put(struct inet_timewait_sock *tw)
209extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, 209extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk,
210 const int state); 210 const int state);
211 211
212extern void __inet_twsk_kill(struct inet_timewait_sock *tw,
213 struct inet_hashinfo *hashinfo);
214
215extern void __inet_twsk_hashdance(struct inet_timewait_sock *tw, 212extern void __inet_twsk_hashdance(struct inet_timewait_sock *tw,
216 struct sock *sk, 213 struct sock *sk,
217 struct inet_hashinfo *hashinfo); 214 struct inet_hashinfo *hashinfo);
diff --git a/include/net/ip.h b/include/net/ip.h
index bb207db03675..abf2820a1125 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -143,6 +143,7 @@ struct ip_reply_arg {
143 __wsum csum; 143 __wsum csum;
144 int csumoffset; /* u16 offset of csum in iov[0].iov_base */ 144 int csumoffset; /* u16 offset of csum in iov[0].iov_base */
145 /* -1 if not needed */ 145 /* -1 if not needed */
146 int bound_dev_if;
146}; 147};
147 148
148void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, 149void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg,
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 5a4a0366c24f..8cadc77c7df4 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -39,7 +39,6 @@ struct fib_config {
39 int fc_mx_len; 39 int fc_mx_len;
40 int fc_mp_len; 40 int fc_mp_len;
41 u32 fc_flow; 41 u32 fc_flow;
42 u32 fc_mp_alg;
43 u32 fc_nlflags; 42 u32 fc_nlflags;
44 struct nl_info fc_nlinfo; 43 struct nl_info fc_nlinfo;
45 }; 44 };
@@ -86,9 +85,6 @@ struct fib_info {
86#ifdef CONFIG_IP_ROUTE_MULTIPATH 85#ifdef CONFIG_IP_ROUTE_MULTIPATH
87 int fib_power; 86 int fib_power;
88#endif 87#endif
89#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
90 u32 fib_mp_alg;
91#endif
92 struct fib_nh fib_nh[0]; 88 struct fib_nh fib_nh[0];
93#define fib_dev fib_nh[0].nh_dev 89#define fib_dev fib_nh[0].nh_dev
94}; 90};
@@ -103,10 +99,6 @@ struct fib_result {
103 unsigned char nh_sel; 99 unsigned char nh_sel;
104 unsigned char type; 100 unsigned char type;
105 unsigned char scope; 101 unsigned char scope;
106#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
107 __be32 network;
108 __be32 netmask;
109#endif
110 struct fib_info *fi; 102 struct fib_info *fi;
111#ifdef CONFIG_IP_MULTIPLE_TABLES 103#ifdef CONFIG_IP_MULTIPLE_TABLES
112 struct fib_rule *r; 104 struct fib_rule *r;
@@ -145,14 +137,6 @@ struct fib_result_nl {
145#define FIB_RES_DEV(res) (FIB_RES_NH(res).nh_dev) 137#define FIB_RES_DEV(res) (FIB_RES_NH(res).nh_dev)
146#define FIB_RES_OIF(res) (FIB_RES_NH(res).nh_oif) 138#define FIB_RES_OIF(res) (FIB_RES_NH(res).nh_oif)
147 139
148#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
149#define FIB_RES_NETWORK(res) ((res).network)
150#define FIB_RES_NETMASK(res) ((res).netmask)
151#else /* CONFIG_IP_ROUTE_MULTIPATH_CACHED */
152#define FIB_RES_NETWORK(res) (0)
153#define FIB_RES_NETMASK(res) (0)
154#endif /* CONFIG_IP_ROUTE_MULTIPATH_WRANDOM */
155
156struct fib_table { 140struct fib_table {
157 struct hlist_node tb_hlist; 141 struct hlist_node tb_hlist;
158 u32 tb_id; 142 u32 tb_id;
@@ -213,7 +197,7 @@ extern void fib_select_default(const struct flowi *flp, struct fib_result *res);
213#endif /* CONFIG_IP_MULTIPLE_TABLES */ 197#endif /* CONFIG_IP_MULTIPLE_TABLES */
214 198
215/* Exported by fib_frontend.c */ 199/* Exported by fib_frontend.c */
216extern struct nla_policy rtm_ipv4_policy[]; 200extern const struct nla_policy rtm_ipv4_policy[];
217extern void ip_fib_init(void); 201extern void ip_fib_init(void);
218extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, 202extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
219 struct net_device *dev, __be32 *spec_dst, u32 *itag); 203 struct net_device *dev, __be32 *spec_dst, u32 *itag);
diff --git a/include/net/ip_mp_alg.h b/include/net/ip_mp_alg.h
deleted file mode 100644
index 25b56571e54b..000000000000
--- a/include/net/ip_mp_alg.h
+++ /dev/null
@@ -1,96 +0,0 @@
1/* ip_mp_alg.h: IPV4 multipath algorithm support.
2 *
3 * Copyright (C) 2004, 2005 Einar Lueck <elueck@de.ibm.com>
4 * Copyright (C) 2005 David S. Miller <davem@davemloft.net>
5 */
6
7#ifndef _NET_IP_MP_ALG_H
8#define _NET_IP_MP_ALG_H
9
10#include <linux/ip_mp_alg.h>
11#include <net/flow.h>
12#include <net/route.h>
13
14struct fib_nh;
15
16struct ip_mp_alg_ops {
17 void (*mp_alg_select_route)(const struct flowi *flp,
18 struct rtable *rth, struct rtable **rp);
19 void (*mp_alg_flush)(void);
20 void (*mp_alg_set_nhinfo)(__be32 network, __be32 netmask,
21 unsigned char prefixlen,
22 const struct fib_nh *nh);
23 void (*mp_alg_remove)(struct rtable *rth);
24};
25
26extern int multipath_alg_register(struct ip_mp_alg_ops *, enum ip_mp_alg);
27extern void multipath_alg_unregister(struct ip_mp_alg_ops *, enum ip_mp_alg);
28
29extern struct ip_mp_alg_ops *ip_mp_alg_table[];
30
31static inline int multipath_select_route(const struct flowi *flp,
32 struct rtable *rth,
33 struct rtable **rp)
34{
35#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
36 struct ip_mp_alg_ops *ops = ip_mp_alg_table[rth->rt_multipath_alg];
37
38 /* mp_alg_select_route _MUST_ be implemented */
39 if (ops && (rth->u.dst.flags & DST_BALANCED)) {
40 ops->mp_alg_select_route(flp, rth, rp);
41 return 1;
42 }
43#endif
44 return 0;
45}
46
47static inline void multipath_flush(void)
48{
49#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
50 int i;
51
52 for (i = IP_MP_ALG_NONE; i <= IP_MP_ALG_MAX; i++) {
53 struct ip_mp_alg_ops *ops = ip_mp_alg_table[i];
54
55 if (ops && ops->mp_alg_flush)
56 ops->mp_alg_flush();
57 }
58#endif
59}
60
61static inline void multipath_set_nhinfo(struct rtable *rth,
62 __be32 network, __be32 netmask,
63 unsigned char prefixlen,
64 const struct fib_nh *nh)
65{
66#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
67 struct ip_mp_alg_ops *ops = ip_mp_alg_table[rth->rt_multipath_alg];
68
69 if (ops && ops->mp_alg_set_nhinfo)
70 ops->mp_alg_set_nhinfo(network, netmask, prefixlen, nh);
71#endif
72}
73
74static inline void multipath_remove(struct rtable *rth)
75{
76#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
77 struct ip_mp_alg_ops *ops = ip_mp_alg_table[rth->rt_multipath_alg];
78
79 if (ops && ops->mp_alg_remove &&
80 (rth->u.dst.flags & DST_BALANCED))
81 ops->mp_alg_remove(rth);
82#endif
83}
84
85static inline int multipath_comparekeys(const struct flowi *flp1,
86 const struct flowi *flp2)
87{
88 return flp1->fl4_dst == flp2->fl4_dst &&
89 flp1->fl4_src == flp2->fl4_src &&
90 flp1->oif == flp2->oif &&
91 flp1->mark == flp2->mark &&
92 !((flp1->fl4_tos ^ flp2->fl4_tos) &
93 (IPTOS_RT_MASK | RTO_ONLINK));
94}
95
96#endif /* _NET_IP_MP_ALG_H */
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 78a0d06d98d5..46b9dce82f6e 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -512,10 +512,6 @@ extern int ipv6_ext_hdr(u8 nexthdr);
512 512
513extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); 513extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type);
514 514
515extern struct ipv6_txoptions * ipv6_invert_rthdr(struct sock *sk,
516 struct ipv6_rt_hdr *hdr);
517
518
519/* 515/*
520 * socket options (ipv6_sockglue.c) 516 * socket options (ipv6_sockglue.c)
521 */ 517 */
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h
index 36bee441aa56..08387553b57e 100644
--- a/include/net/irda/irda.h
+++ b/include/net/irda/irda.h
@@ -125,6 +125,9 @@ extern void irda_sysctl_unregister(void);
125extern int irsock_init(void); 125extern int irsock_init(void);
126extern void irsock_cleanup(void); 126extern void irsock_cleanup(void);
127 127
128extern int irda_nl_register(void);
129extern void irda_nl_unregister(void);
130
128extern int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, 131extern int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
129 struct packet_type *ptype, 132 struct packet_type *ptype,
130 struct net_device *orig_dev); 133 struct net_device *orig_dev);
diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h
index f0248fb8e196..9d0c78ea92f5 100644
--- a/include/net/irda/irlap.h
+++ b/include/net/irda/irlap.h
@@ -208,6 +208,8 @@ struct irlap_cb {
208 int xbofs_delay; /* Nr of XBOF's used to MTT */ 208 int xbofs_delay; /* Nr of XBOF's used to MTT */
209 int bofs_count; /* Negotiated extra BOFs */ 209 int bofs_count; /* Negotiated extra BOFs */
210 int next_bofs; /* Negotiated extra BOFs after next frame */ 210 int next_bofs; /* Negotiated extra BOFs after next frame */
211
212 int mode; /* IrLAP mode (primary, secondary or monitor) */
211}; 213};
212 214
213/* 215/*
@@ -289,4 +291,21 @@ static inline void irlap_clear_disconnect(struct irlap_cb *self)
289 self->disconnect_pending = FALSE; 291 self->disconnect_pending = FALSE;
290} 292}
291 293
294/*
295 * Function irlap_next_state (self, state)
296 *
297 * Switches state and provides debug information
298 *
299 */
300static inline void irlap_next_state(struct irlap_cb *self, IRLAP_STATE state)
301{
302 /*
303 if (!self || self->magic != LAP_MAGIC)
304 return;
305
306 IRDA_DEBUG(4, "next LAP state = %s\n", irlap_state[state]);
307 */
308 self->state = state;
309}
310
292#endif 311#endif
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
index f9bd11be1891..b6c468cd7f5b 100644
--- a/include/net/iucv/af_iucv.h
+++ b/include/net/iucv/af_iucv.h
@@ -60,6 +60,7 @@ struct iucv_sock {
60 char dst_user_id[8]; 60 char dst_user_id[8];
61 char dst_name[8]; 61 char dst_name[8];
62 struct list_head accept_q; 62 struct list_head accept_q;
63 spinlock_t accept_q_lock;
63 struct sock *parent; 64 struct sock *parent;
64 struct iucv_path *path; 65 struct iucv_path *path;
65 struct sk_buff_head send_skb_q; 66 struct sk_buff_head send_skb_q;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index a7f122b79948..c34fd9a6160a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -347,9 +347,16 @@ enum ieee80211_if_types {
347 * @mac_addr: pointer to MAC address of the interface. This pointer is valid 347 * @mac_addr: pointer to MAC address of the interface. This pointer is valid
348 * until the interface is removed (i.e. it cannot be used after 348 * until the interface is removed (i.e. it cannot be used after
349 * remove_interface() callback was called for this interface). 349 * remove_interface() callback was called for this interface).
350 * This pointer will be %NULL for monitor interfaces, be careful.
350 * 351 *
351 * This structure is used in add_interface() and remove_interface() 352 * This structure is used in add_interface() and remove_interface()
352 * callbacks of &struct ieee80211_hw. 353 * callbacks of &struct ieee80211_hw.
354 *
355 * When you allow multiple interfaces to be added to your PHY, take care
356 * that the hardware can actually handle multiple MAC addresses. However,
357 * also take care that when there's no interface left with mac_addr != %NULL
358 * you remove the MAC address from the device to avoid acknowledging packets
359 * in pure monitor mode.
353 */ 360 */
354struct ieee80211_if_init_conf { 361struct ieee80211_if_init_conf {
355 int if_id; 362 int if_id;
@@ -574,10 +581,11 @@ struct ieee80211_ops {
574 * to returning zero. By returning non-zero addition of the interface 581 * to returning zero. By returning non-zero addition of the interface
575 * is inhibited. Unless monitor_during_oper is set, it is guaranteed 582 * is inhibited. Unless monitor_during_oper is set, it is guaranteed
576 * that monitor interfaces and normal interfaces are mutually 583 * that monitor interfaces and normal interfaces are mutually
577 * exclusive. The open() handler is called after add_interface() 584 * exclusive. If assigned, the open() handler is called after
578 * if this is the first device added. At least one of the open() 585 * add_interface() if this is the first device added. The
579 * open() and add_interface() callbacks has to be assigned. If 586 * add_interface() callback has to be assigned because it is the only
580 * add_interface() is NULL, one STA interface is permitted only. */ 587 * way to obtain the requested MAC address for any interface.
588 */
581 int (*add_interface)(struct ieee80211_hw *hw, 589 int (*add_interface)(struct ieee80211_hw *hw,
582 struct ieee80211_if_init_conf *conf); 590 struct ieee80211_if_init_conf *conf);
583 591
@@ -921,12 +929,6 @@ struct sk_buff *
921ieee80211_get_buffered_bc(struct ieee80211_hw *hw, int if_id, 929ieee80211_get_buffered_bc(struct ieee80211_hw *hw, int if_id,
922 struct ieee80211_tx_control *control); 930 struct ieee80211_tx_control *control);
923 931
924/* Low level drivers that have their own MLME and MAC indicate
925 * the aid for an associating station with this call */
926int ieee80211_set_aid_for_sta(struct ieee80211_hw *hw,
927 u8 *peer_address, u16 aid);
928
929
930/* Given an sk_buff with a raw 802.11 header at the data pointer this function 932/* Given an sk_buff with a raw 802.11 header at the data pointer this function
931 * returns the 802.11 header length in bytes (not including encryption 933 * returns the 802.11 header length in bytes (not including encryption
932 * headers). If the data in the sk_buff is too short to contain a valid 802.11 934 * headers). If the data in the sk_buff is too short to contain a valid 802.11
diff --git a/include/net/mip6.h b/include/net/mip6.h
index 68263c6d9996..63272610a24a 100644
--- a/include/net/mip6.h
+++ b/include/net/mip6.h
@@ -54,8 +54,4 @@ struct ip6_mh {
54#define IP6_MH_TYPE_BERROR 7 /* Binding Error */ 54#define IP6_MH_TYPE_BERROR 7 /* Binding Error */
55#define IP6_MH_TYPE_MAX IP6_MH_TYPE_BERROR 55#define IP6_MH_TYPE_MAX IP6_MH_TYPE_BERROR
56 56
57extern int mip6_init(void);
58extern void mip6_fini(void);
59extern int mip6_mh_filter(struct sock *sk, struct sk_buff *skb);
60
61#endif 57#endif
diff --git a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
index 1401ccc051c4..7a671603fca6 100644
--- a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
+++ b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
@@ -9,29 +9,10 @@
9#ifndef _NF_CONNTRACK_IPV4_H 9#ifndef _NF_CONNTRACK_IPV4_H
10#define _NF_CONNTRACK_IPV4_H 10#define _NF_CONNTRACK_IPV4_H
11 11
12#ifdef CONFIG_NF_NAT_NEEDED
13#include <net/netfilter/nf_nat.h>
14#include <linux/netfilter/nf_conntrack_pptp.h>
15
16/* per conntrack: nat application helper private data */
17union nf_conntrack_nat_help {
18 /* insert nat helper private data here */
19 struct nf_nat_pptp nat_pptp_info;
20};
21
22struct nf_conn_nat {
23 struct nf_nat_info info;
24 union nf_conntrack_nat_help help;
25#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \
26 defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE)
27 int masq_index;
28#endif
29};
30#endif /* CONFIG_NF_NAT_NEEDED */
31
32/* Returns new sk_buff, or NULL */ 12/* Returns new sk_buff, or NULL */
33struct sk_buff * 13struct sk_buff *nf_ct_ipv4_ct_gather_frags(struct sk_buff *skb);
34nf_ct_ipv4_ct_gather_frags(struct sk_buff *skb); 14
15extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4;
35 16
36extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4; 17extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4;
37extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; 18extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4;
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
index b4b6049e01fa..5a8965904377 100644
--- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
+++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
@@ -7,7 +7,7 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6;
7extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; 7extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6;
8extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; 8extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6;
9 9
10extern int nf_ct_ipv6_skip_exthdr(struct sk_buff *skb, int start, 10extern int nf_ct_ipv6_skip_exthdr(const struct sk_buff *skb, int start,
11 u8 *nexthdrp, int len); 11 u8 *nexthdrp, int len);
12 12
13extern int nf_ct_frag6_init(void); 13extern int nf_ct_frag6_init(void);
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 4732432f8eb0..810020ec345d 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -82,6 +82,8 @@ struct nf_conn_help {
82 82
83 union nf_conntrack_help help; 83 union nf_conntrack_help help;
84 84
85 struct hlist_head expectations;
86
85 /* Current number of expected connections */ 87 /* Current number of expected connections */
86 unsigned int expecting; 88 unsigned int expecting;
87}; 89};
@@ -117,9 +119,6 @@ struct nf_conn
117 /* Unique ID that identifies this conntrack*/ 119 /* Unique ID that identifies this conntrack*/
118 unsigned int id; 120 unsigned int id;
119 121
120 /* features - nat, helper, ... used by allocating system */
121 u_int32_t features;
122
123#if defined(CONFIG_NF_CONNTRACK_MARK) 122#if defined(CONFIG_NF_CONNTRACK_MARK)
124 u_int32_t mark; 123 u_int32_t mark;
125#endif 124#endif
@@ -131,8 +130,8 @@ struct nf_conn
131 /* Storage reserved for other modules: */ 130 /* Storage reserved for other modules: */
132 union nf_conntrack_proto proto; 131 union nf_conntrack_proto proto;
133 132
134 /* features dynamically at the end: helper, nat (both optional) */ 133 /* Extensions */
135 char data[0]; 134 struct nf_ct_ext *ext;
136}; 135};
137 136
138static inline struct nf_conn * 137static inline struct nf_conn *
@@ -175,6 +174,10 @@ static inline void nf_ct_put(struct nf_conn *ct)
175extern int nf_ct_l3proto_try_module_get(unsigned short l3proto); 174extern int nf_ct_l3proto_try_module_get(unsigned short l3proto);
176extern void nf_ct_l3proto_module_put(unsigned short l3proto); 175extern void nf_ct_l3proto_module_put(unsigned short l3proto);
177 176
177extern struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced);
178extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced,
179 int size);
180
178extern struct nf_conntrack_tuple_hash * 181extern struct nf_conntrack_tuple_hash *
179__nf_conntrack_find(const struct nf_conntrack_tuple *tuple, 182__nf_conntrack_find(const struct nf_conntrack_tuple *tuple,
180 const struct nf_conn *ignored_conntrack); 183 const struct nf_conn *ignored_conntrack);
@@ -183,6 +186,10 @@ extern void nf_conntrack_hash_insert(struct nf_conn *ct);
183 186
184extern void nf_conntrack_flush(void); 187extern void nf_conntrack_flush(void);
185 188
189extern int nf_ct_get_tuplepr(const struct sk_buff *skb,
190 unsigned int nhoff,
191 u_int16_t l3num,
192 struct nf_conntrack_tuple *tuple);
186extern int nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse, 193extern int nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse,
187 const struct nf_conntrack_tuple *orig); 194 const struct nf_conntrack_tuple *orig);
188 195
@@ -216,9 +223,6 @@ extern void nf_conntrack_tcp_update(struct sk_buff *skb,
216 struct nf_conn *conntrack, 223 struct nf_conn *conntrack,
217 int dir); 224 int dir);
218 225
219/* Call me when a conntrack is destroyed. */
220extern void (*nf_conntrack_destroyed)(struct nf_conn *conntrack);
221
222/* Fake conntrack entry for untracked connections */ 226/* Fake conntrack entry for untracked connections */
223extern struct nf_conn nf_conntrack_untracked; 227extern struct nf_conn nf_conntrack_untracked;
224 228
@@ -262,60 +266,10 @@ do { \
262 local_bh_enable(); \ 266 local_bh_enable(); \
263} while (0) 267} while (0)
264 268
265/* no helper, no nat */
266#define NF_CT_F_BASIC 0
267/* for helper */
268#define NF_CT_F_HELP 1
269/* for nat. */
270#define NF_CT_F_NAT 2
271#define NF_CT_F_NUM 4
272
273extern int 269extern int
274nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size); 270nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size);
275extern void 271extern void
276nf_conntrack_unregister_cache(u_int32_t features); 272nf_conntrack_unregister_cache(u_int32_t features);
277 273
278/* valid combinations:
279 * basic: nf_conn, nf_conn .. nf_conn_help
280 * nat: nf_conn .. nf_conn_nat, nf_conn .. nf_conn_nat .. nf_conn help
281 */
282#ifdef CONFIG_NF_NAT_NEEDED
283static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct)
284{
285 unsigned int offset = sizeof(struct nf_conn);
286
287 if (!(ct->features & NF_CT_F_NAT))
288 return NULL;
289
290 offset = ALIGN(offset, __alignof__(struct nf_conn_nat));
291 return (struct nf_conn_nat *) ((void *)ct + offset);
292}
293
294static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct)
295{
296 unsigned int offset = sizeof(struct nf_conn);
297
298 if (!(ct->features & NF_CT_F_HELP))
299 return NULL;
300 if (ct->features & NF_CT_F_NAT) {
301 offset = ALIGN(offset, __alignof__(struct nf_conn_nat));
302 offset += sizeof(struct nf_conn_nat);
303 }
304
305 offset = ALIGN(offset, __alignof__(struct nf_conn_help));
306 return (struct nf_conn_help *) ((void *)ct + offset);
307}
308#else /* No NAT */
309static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct)
310{
311 unsigned int offset = sizeof(struct nf_conn);
312
313 if (!(ct->features & NF_CT_F_HELP))
314 return NULL;
315
316 offset = ALIGN(offset, __alignof__(struct nf_conn_help));
317 return (struct nf_conn_help *) ((void *)ct + offset);
318}
319#endif /* CONFIG_NF_NAT_NEEDED */
320#endif /* __KERNEL__ */ 274#endif /* __KERNEL__ */
321#endif /* _NF_CONNTRACK_H */ 275#endif /* _NF_CONNTRACK_H */
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h
index 9fb906688ffa..4056f5f08da1 100644
--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -30,6 +30,9 @@ extern void nf_conntrack_cleanup(void);
30extern int nf_conntrack_proto_init(void); 30extern int nf_conntrack_proto_init(void);
31extern void nf_conntrack_proto_fini(void); 31extern void nf_conntrack_proto_fini(void);
32 32
33extern int nf_conntrack_helper_init(void);
34extern void nf_conntrack_helper_fini(void);
35
33struct nf_conntrack_l3proto; 36struct nf_conntrack_l3proto;
34extern struct nf_conntrack_l3proto *nf_ct_find_l3proto(u_int16_t pf); 37extern struct nf_conntrack_l3proto *nf_ct_find_l3proto(u_int16_t pf);
35/* Like above, but you already have conntrack read lock. */ 38/* Like above, but you already have conntrack read lock. */
@@ -55,8 +58,7 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
55 58
56/* Find a connection corresponding to a tuple. */ 59/* Find a connection corresponding to a tuple. */
57extern struct nf_conntrack_tuple_hash * 60extern struct nf_conntrack_tuple_hash *
58nf_conntrack_find_get(const struct nf_conntrack_tuple *tuple, 61nf_conntrack_find_get(const struct nf_conntrack_tuple *tuple);
59 const struct nf_conn *ignored_conntrack);
60 62
61extern int __nf_conntrack_confirm(struct sk_buff **pskb); 63extern int __nf_conntrack_confirm(struct sk_buff **pskb);
62 64
@@ -81,9 +83,8 @@ print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple,
81 struct nf_conntrack_l3proto *l3proto, 83 struct nf_conntrack_l3proto *l3proto,
82 struct nf_conntrack_l4proto *proto); 84 struct nf_conntrack_l4proto *proto);
83 85
84extern struct list_head *nf_conntrack_hash; 86extern struct hlist_head *nf_conntrack_hash;
85extern struct list_head nf_conntrack_expect_list;
86extern rwlock_t nf_conntrack_lock ; 87extern rwlock_t nf_conntrack_lock ;
87extern struct list_head unconfirmed; 88extern struct hlist_head unconfirmed;
88 89
89#endif /* _NF_CONNTRACK_CORE_H */ 90#endif /* _NF_CONNTRACK_CORE_H */
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h
index 811c9073c532..f0b9078235c9 100644
--- a/include/net/netfilter/nf_conntrack_ecache.h
+++ b/include/net/netfilter/nf_conntrack_ecache.h
@@ -49,15 +49,15 @@ static inline void nf_conntrack_event(enum ip_conntrack_events event,
49 atomic_notifier_call_chain(&nf_conntrack_chain, event, ct); 49 atomic_notifier_call_chain(&nf_conntrack_chain, event, ct);
50} 50}
51 51
52extern struct atomic_notifier_head nf_conntrack_expect_chain; 52extern struct atomic_notifier_head nf_ct_expect_chain;
53extern int nf_conntrack_expect_register_notifier(struct notifier_block *nb); 53extern int nf_ct_expect_register_notifier(struct notifier_block *nb);
54extern int nf_conntrack_expect_unregister_notifier(struct notifier_block *nb); 54extern int nf_ct_expect_unregister_notifier(struct notifier_block *nb);
55 55
56static inline void 56static inline void
57nf_conntrack_expect_event(enum ip_conntrack_expect_events event, 57nf_ct_expect_event(enum ip_conntrack_expect_events event,
58 struct nf_conntrack_expect *exp) 58 struct nf_conntrack_expect *exp)
59{ 59{
60 atomic_notifier_call_chain(&nf_conntrack_expect_chain, event, exp); 60 atomic_notifier_call_chain(&nf_ct_expect_chain, event, exp);
61} 61}
62 62
63#else /* CONFIG_NF_CONNTRACK_EVENTS */ 63#else /* CONFIG_NF_CONNTRACK_EVENTS */
@@ -67,9 +67,8 @@ static inline void nf_conntrack_event_cache(enum ip_conntrack_events event,
67static inline void nf_conntrack_event(enum ip_conntrack_events event, 67static inline void nf_conntrack_event(enum ip_conntrack_events event,
68 struct nf_conn *ct) {} 68 struct nf_conn *ct) {}
69static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} 69static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {}
70static inline void 70static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event,
71nf_conntrack_expect_event(enum ip_conntrack_expect_events event, 71 struct nf_conntrack_expect *exp) {}
72 struct nf_conntrack_expect *exp) {}
73static inline void nf_ct_event_cache_flush(void) {} 72static inline void nf_ct_event_cache_flush(void) {}
74#endif /* CONFIG_NF_CONNTRACK_EVENTS */ 73#endif /* CONFIG_NF_CONNTRACK_EVENTS */
75 74
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h
index 173c7c1eff23..cae1a0dce365 100644
--- a/include/net/netfilter/nf_conntrack_expect.h
+++ b/include/net/netfilter/nf_conntrack_expect.h
@@ -6,17 +6,21 @@
6#define _NF_CONNTRACK_EXPECT_H 6#define _NF_CONNTRACK_EXPECT_H
7#include <net/netfilter/nf_conntrack.h> 7#include <net/netfilter/nf_conntrack.h>
8 8
9extern struct list_head nf_conntrack_expect_list; 9extern struct hlist_head *nf_ct_expect_hash;
10extern struct kmem_cache *nf_conntrack_expect_cachep; 10extern unsigned int nf_ct_expect_hsize;
11extern const struct file_operations exp_file_ops; 11extern unsigned int nf_ct_expect_max;
12 12
13struct nf_conntrack_expect 13struct nf_conntrack_expect
14{ 14{
15 /* Internal linked list (global expectation list) */ 15 /* Conntrack expectation list member */
16 struct list_head list; 16 struct hlist_node lnode;
17
18 /* Hash member */
19 struct hlist_node hnode;
17 20
18 /* We expect this tuple, with the following mask */ 21 /* We expect this tuple, with the following mask */
19 struct nf_conntrack_tuple tuple, mask; 22 struct nf_conntrack_tuple tuple;
23 struct nf_conntrack_tuple_mask mask;
20 24
21 /* Function to call after setup and insertion */ 25 /* Function to call after setup and insertion */
22 void (*expectfn)(struct nf_conn *new, 26 void (*expectfn)(struct nf_conn *new,
@@ -52,29 +56,31 @@ struct nf_conntrack_expect
52 56
53#define NF_CT_EXPECT_PERMANENT 0x1 57#define NF_CT_EXPECT_PERMANENT 0x1
54 58
59int nf_conntrack_expect_init(void);
60void nf_conntrack_expect_fini(void);
55 61
56struct nf_conntrack_expect * 62struct nf_conntrack_expect *
57__nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple); 63__nf_ct_expect_find(const struct nf_conntrack_tuple *tuple);
58 64
59struct nf_conntrack_expect * 65struct nf_conntrack_expect *
60nf_conntrack_expect_find_get(const struct nf_conntrack_tuple *tuple); 66nf_ct_expect_find_get(const struct nf_conntrack_tuple *tuple);
61 67
62struct nf_conntrack_expect * 68struct nf_conntrack_expect *
63find_expectation(const struct nf_conntrack_tuple *tuple); 69nf_ct_find_expectation(const struct nf_conntrack_tuple *tuple);
64 70
65void nf_ct_unlink_expect(struct nf_conntrack_expect *exp); 71void nf_ct_unlink_expect(struct nf_conntrack_expect *exp);
66void nf_ct_remove_expectations(struct nf_conn *ct); 72void nf_ct_remove_expectations(struct nf_conn *ct);
67void nf_conntrack_unexpect_related(struct nf_conntrack_expect *exp); 73void nf_ct_unexpect_related(struct nf_conntrack_expect *exp);
68 74
69/* Allocate space for an expectation: this is mandatory before calling 75/* Allocate space for an expectation: this is mandatory before calling
70 nf_conntrack_expect_related. You will have to call put afterwards. */ 76 nf_ct_expect_related. You will have to call put afterwards. */
71struct nf_conntrack_expect *nf_conntrack_expect_alloc(struct nf_conn *me); 77struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me);
72void nf_conntrack_expect_init(struct nf_conntrack_expect *, int, 78void nf_ct_expect_init(struct nf_conntrack_expect *, int,
73 union nf_conntrack_address *, 79 union nf_conntrack_address *,
74 union nf_conntrack_address *, 80 union nf_conntrack_address *,
75 u_int8_t, __be16 *, __be16 *); 81 u_int8_t, __be16 *, __be16 *);
76void nf_conntrack_expect_put(struct nf_conntrack_expect *exp); 82void nf_ct_expect_put(struct nf_conntrack_expect *exp);
77int nf_conntrack_expect_related(struct nf_conntrack_expect *expect); 83int nf_ct_expect_related(struct nf_conntrack_expect *expect);
78 84
79#endif /*_NF_CONNTRACK_EXPECT_H*/ 85#endif /*_NF_CONNTRACK_EXPECT_H*/
80 86
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
new file mode 100644
index 000000000000..73b5711faf32
--- /dev/null
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -0,0 +1,85 @@
1#ifndef _NF_CONNTRACK_EXTEND_H
2#define _NF_CONNTRACK_EXTEND_H
3
4#include <net/netfilter/nf_conntrack.h>
5
6enum nf_ct_ext_id
7{
8 NF_CT_EXT_HELPER,
9 NF_CT_EXT_NAT,
10 NF_CT_EXT_NUM,
11};
12
13#define NF_CT_EXT_HELPER_TYPE struct nf_conn_help
14#define NF_CT_EXT_NAT_TYPE struct nf_conn_nat
15
16/* Extensions: optional stuff which isn't permanently in struct. */
17struct nf_ct_ext {
18 u8 offset[NF_CT_EXT_NUM];
19 u8 len;
20 u8 real_len;
21 char data[0];
22};
23
24static inline int nf_ct_ext_exist(const struct nf_conn *ct, u8 id)
25{
26 return (ct->ext && ct->ext->offset[id]);
27}
28
29static inline void *__nf_ct_ext_find(const struct nf_conn *ct, u8 id)
30{
31 if (!nf_ct_ext_exist(ct, id))
32 return NULL;
33
34 return (void *)ct->ext + ct->ext->offset[id];
35}
36#define nf_ct_ext_find(ext, id) \
37 ((id##_TYPE *)__nf_ct_ext_find((ext), (id)))
38
39/* Destroy all relationships */
40extern void __nf_ct_ext_destroy(struct nf_conn *ct);
41static inline void nf_ct_ext_destroy(struct nf_conn *ct)
42{
43 if (ct->ext)
44 __nf_ct_ext_destroy(ct);
45}
46
47/* Free operation. If you want to free a object referred from private area,
48 * please implement __nf_ct_ext_free() and call it.
49 */
50static inline void nf_ct_ext_free(struct nf_conn *ct)
51{
52 if (ct->ext)
53 kfree(ct->ext);
54}
55
56/* Add this type, returns pointer to data or NULL. */
57void *
58__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp);
59#define nf_ct_ext_add(ct, id, gfp) \
60 ((id##_TYPE *)__nf_ct_ext_add((ct), (id), (gfp)))
61
62#define NF_CT_EXT_F_PREALLOC 0x0001
63
64struct nf_ct_ext_type
65{
66 /* Destroys relationships (can be NULL). */
67 void (*destroy)(struct nf_conn *ct);
68 /* Called when realloacted (can be NULL).
69 Contents has already been moved. */
70 void (*move)(struct nf_conn *ct, void *old);
71
72 enum nf_ct_ext_id id;
73
74 unsigned int flags;
75
76 /* Length and min alignment. */
77 u8 len;
78 u8 align;
79 /* initial size of nf_ct_ext. */
80 u8 alloc_size;
81};
82
83int nf_ct_extend_register(struct nf_ct_ext_type *type);
84void nf_ct_extend_unregister(struct nf_ct_ext_type *type);
85#endif /* _NF_CONNTRACK_EXTEND_H */
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h
index 8c72ac9f0ab8..d04f99964d94 100644
--- a/include/net/netfilter/nf_conntrack_helper.h
+++ b/include/net/netfilter/nf_conntrack_helper.h
@@ -10,12 +10,13 @@
10#ifndef _NF_CONNTRACK_HELPER_H 10#ifndef _NF_CONNTRACK_HELPER_H
11#define _NF_CONNTRACK_HELPER_H 11#define _NF_CONNTRACK_HELPER_H
12#include <net/netfilter/nf_conntrack.h> 12#include <net/netfilter/nf_conntrack.h>
13#include <net/netfilter/nf_conntrack_extend.h>
13 14
14struct module; 15struct module;
15 16
16struct nf_conntrack_helper 17struct nf_conntrack_helper
17{ 18{
18 struct list_head list; /* Internal use. */ 19 struct hlist_node hnode; /* Internal use. */
19 20
20 const char *name; /* name of the module */ 21 const char *name; /* name of the module */
21 struct module *me; /* pointer to self */ 22 struct module *me; /* pointer to self */
@@ -23,10 +24,9 @@ struct nf_conntrack_helper
23 * expected connections */ 24 * expected connections */
24 unsigned int timeout; /* timeout for expecteds */ 25 unsigned int timeout; /* timeout for expecteds */
25 26
26 /* Mask of things we will help (compared against server response) */ 27 /* Tuple of things we will help (compared against server response) */
27 struct nf_conntrack_tuple tuple; 28 struct nf_conntrack_tuple tuple;
28 struct nf_conntrack_tuple mask; 29
29
30 /* Function to call when data passes; return verdict, or -1 to 30 /* Function to call when data passes; return verdict, or -1 to
31 invalidate. */ 31 invalidate. */
32 int (*help)(struct sk_buff **pskb, 32 int (*help)(struct sk_buff **pskb,
@@ -52,4 +52,10 @@ extern void nf_ct_helper_put(struct nf_conntrack_helper *helper);
52extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); 52extern int nf_conntrack_helper_register(struct nf_conntrack_helper *);
53extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); 53extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *);
54 54
55extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp);
56
57static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct)
58{
59 return nf_ct_ext_find(ct, NF_CT_EXT_HELPER);
60}
55#endif /*_NF_CONNTRACK_HELPER_H*/ 61#endif /*_NF_CONNTRACK_HELPER_H*/
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h
index 96a58d8e1d3f..3c58a2c4df28 100644
--- a/include/net/netfilter/nf_conntrack_l3proto.h
+++ b/include/net/netfilter/nf_conntrack_l3proto.h
@@ -58,13 +58,11 @@ struct nf_conntrack_l3proto
58 58
59 /* 59 /*
60 * Called before tracking. 60 * Called before tracking.
61 * *dataoff: offset of protocol header (TCP, UDP,...) in *pskb 61 * *dataoff: offset of protocol header (TCP, UDP,...) in skb
62 * *protonum: protocol number 62 * *protonum: protocol number
63 */ 63 */
64 int (*prepare)(struct sk_buff **pskb, unsigned int hooknum, 64 int (*get_l4proto)(const struct sk_buff *skb, unsigned int nhoff,
65 unsigned int *dataoff, u_int8_t *protonum); 65 unsigned int *dataoff, u_int8_t *protonum);
66
67 u_int32_t (*get_features)(const struct nf_conntrack_tuple *tuple);
68 66
69 int (*tuple_to_nfattr)(struct sk_buff *skb, 67 int (*tuple_to_nfattr)(struct sk_buff *skb,
70 const struct nf_conntrack_tuple *t); 68 const struct nf_conntrack_tuple *t);
@@ -91,8 +89,6 @@ extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto);
91extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); 89extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p);
92 90
93/* Existing built-in protocols */ 91/* Existing built-in protocols */
94extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4;
95extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6;
96extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; 92extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic;
97 93
98static inline struct nf_conntrack_l3proto * 94static inline struct nf_conntrack_l3proto *
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index 5d72b16e876f..040dae5f0c9e 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -100,6 +100,14 @@ struct nf_conntrack_tuple
100 } dst; 100 } dst;
101}; 101};
102 102
103struct nf_conntrack_tuple_mask
104{
105 struct {
106 union nf_conntrack_address u3;
107 union nf_conntrack_man_proto u;
108 } src;
109};
110
103/* This is optimized opposed to a memset of the whole structure. Everything we 111/* This is optimized opposed to a memset of the whole structure. Everything we
104 * really care about is the source/destination unions */ 112 * really care about is the source/destination unions */
105#define NF_CT_TUPLE_U_BLANK(tuple) \ 113#define NF_CT_TUPLE_U_BLANK(tuple) \
@@ -112,11 +120,11 @@ struct nf_conntrack_tuple
112 120
113#ifdef __KERNEL__ 121#ifdef __KERNEL__
114 122
115#define NF_CT_DUMP_TUPLE(tp) \ 123#define NF_CT_DUMP_TUPLE(tp) \
116DEBUGP("tuple %p: %u %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", \ 124pr_debug("tuple %p: %u %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", \
117 (tp), (tp)->src.l3num, (tp)->dst.protonum, \ 125 (tp), (tp)->src.l3num, (tp)->dst.protonum, \
118 NIP6(*(struct in6_addr *)(tp)->src.u3.all), ntohs((tp)->src.u.all), \ 126 NIP6(*(struct in6_addr *)(tp)->src.u3.all), ntohs((tp)->src.u.all), \
119 NIP6(*(struct in6_addr *)(tp)->dst.u3.all), ntohs((tp)->dst.u.all)) 127 NIP6(*(struct in6_addr *)(tp)->dst.u3.all), ntohs((tp)->dst.u.all))
120 128
121/* If we're the first tuple, it's the original dir. */ 129/* If we're the first tuple, it's the original dir. */
122#define NF_CT_DIRECTION(h) \ 130#define NF_CT_DIRECTION(h) \
@@ -125,8 +133,7 @@ DEBUGP("tuple %p: %u %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", \
125/* Connections have two entries in the hash table: one for each way */ 133/* Connections have two entries in the hash table: one for each way */
126struct nf_conntrack_tuple_hash 134struct nf_conntrack_tuple_hash
127{ 135{
128 struct list_head list; 136 struct hlist_node hnode;
129
130 struct nf_conntrack_tuple tuple; 137 struct nf_conntrack_tuple tuple;
131}; 138};
132 139
@@ -162,31 +169,44 @@ static inline int nf_ct_tuple_equal(const struct nf_conntrack_tuple *t1,
162 return nf_ct_tuple_src_equal(t1, t2) && nf_ct_tuple_dst_equal(t1, t2); 169 return nf_ct_tuple_src_equal(t1, t2) && nf_ct_tuple_dst_equal(t1, t2);
163} 170}
164 171
172static inline int nf_ct_tuple_mask_equal(const struct nf_conntrack_tuple_mask *m1,
173 const struct nf_conntrack_tuple_mask *m2)
174{
175 return (m1->src.u3.all[0] == m2->src.u3.all[0] &&
176 m1->src.u3.all[1] == m2->src.u3.all[1] &&
177 m1->src.u3.all[2] == m2->src.u3.all[2] &&
178 m1->src.u3.all[3] == m2->src.u3.all[3] &&
179 m1->src.u.all == m2->src.u.all);
180}
181
182static inline int nf_ct_tuple_src_mask_cmp(const struct nf_conntrack_tuple *t1,
183 const struct nf_conntrack_tuple *t2,
184 const struct nf_conntrack_tuple_mask *mask)
185{
186 int count;
187
188 for (count = 0; count < NF_CT_TUPLE_L3SIZE; count++) {
189 if ((t1->src.u3.all[count] ^ t2->src.u3.all[count]) &
190 mask->src.u3.all[count])
191 return 0;
192 }
193
194 if ((t1->src.u.all ^ t2->src.u.all) & mask->src.u.all)
195 return 0;
196
197 if (t1->src.l3num != t2->src.l3num ||
198 t1->dst.protonum != t2->dst.protonum)
199 return 0;
200
201 return 1;
202}
203
165static inline int nf_ct_tuple_mask_cmp(const struct nf_conntrack_tuple *t, 204static inline int nf_ct_tuple_mask_cmp(const struct nf_conntrack_tuple *t,
166 const struct nf_conntrack_tuple *tuple, 205 const struct nf_conntrack_tuple *tuple,
167 const struct nf_conntrack_tuple *mask) 206 const struct nf_conntrack_tuple_mask *mask)
168{ 207{
169 int count = 0; 208 return nf_ct_tuple_src_mask_cmp(t, tuple, mask) &&
170 209 nf_ct_tuple_dst_equal(t, tuple);
171 for (count = 0; count < NF_CT_TUPLE_L3SIZE; count++){
172 if ((t->src.u3.all[count] ^ tuple->src.u3.all[count]) &
173 mask->src.u3.all[count])
174 return 0;
175 }
176
177 for (count = 0; count < NF_CT_TUPLE_L3SIZE; count++){
178 if ((t->dst.u3.all[count] ^ tuple->dst.u3.all[count]) &
179 mask->dst.u3.all[count])
180 return 0;
181 }
182
183 if ((t->src.u.all ^ tuple->src.u.all) & mask->src.u.all ||
184 (t->dst.u.all ^ tuple->dst.u.all) & mask->dst.u.all ||
185 (t->src.l3num ^ tuple->src.l3num) & mask->src.l3num ||
186 (t->dst.protonum ^ tuple->dst.protonum) & mask->dst.protonum)
187 return 0;
188
189 return 1;
190} 210}
191 211
192#endif /* _NF_CONNTRACK_TUPLE_H */ 212#endif /* _NF_CONNTRACK_TUPLE_H */
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index bc57dd7b9b5c..6ae52f7c9f55 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -51,16 +51,31 @@ struct nf_nat_multi_range_compat
51 51
52#ifdef __KERNEL__ 52#ifdef __KERNEL__
53#include <linux/list.h> 53#include <linux/list.h>
54#include <linux/netfilter/nf_conntrack_pptp.h>
55#include <net/netfilter/nf_conntrack_extend.h>
54 56
55/* The structure embedded in the conntrack structure. */ 57/* per conntrack: nat application helper private data */
56struct nf_nat_info 58union nf_conntrack_nat_help
57{ 59{
58 struct list_head bysource; 60 /* insert nat helper private data here */
59 struct nf_nat_seq seq[IP_CT_DIR_MAX]; 61 struct nf_nat_pptp nat_pptp_info;
60}; 62};
61 63
62struct nf_conn; 64struct nf_conn;
63 65
66/* The structure embedded in the conntrack structure. */
67struct nf_conn_nat
68{
69 struct hlist_node bysource;
70 struct nf_nat_seq seq[IP_CT_DIR_MAX];
71 struct nf_conn *ct;
72 union nf_conntrack_nat_help help;
73#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \
74 defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE)
75 int masq_index;
76#endif
77};
78
64/* Set up the info structure to map into this range. */ 79/* Set up the info structure to map into this range. */
65extern unsigned int nf_nat_setup_info(struct nf_conn *ct, 80extern unsigned int nf_nat_setup_info(struct nf_conn *ct,
66 const struct nf_nat_range *range, 81 const struct nf_nat_range *range,
@@ -70,7 +85,10 @@ extern unsigned int nf_nat_setup_info(struct nf_conn *ct,
70extern int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple, 85extern int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple,
71 const struct nf_conn *ignored_conntrack); 86 const struct nf_conn *ignored_conntrack);
72 87
73extern int nf_nat_module_is_loaded; 88static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct)
89{
90 return nf_ct_ext_find(ct, NF_CT_EXT_NAT);
91}
74 92
75#else /* !__KERNEL__: iptables wants this to compile. */ 93#else /* !__KERNEL__: iptables wants this to compile. */
76#define nf_nat_multi_range nf_nat_multi_range_compat 94#define nf_nat_multi_range nf_nat_multi_range_compat
diff --git a/include/net/netfilter/nf_nat_core.h b/include/net/netfilter/nf_nat_core.h
index 9778ffa93440..c3cd127ba4bb 100644
--- a/include/net/netfilter/nf_nat_core.h
+++ b/include/net/netfilter/nf_nat_core.h
@@ -2,6 +2,7 @@
2#define _NF_NAT_CORE_H 2#define _NF_NAT_CORE_H
3#include <linux/list.h> 3#include <linux/list.h>
4#include <net/netfilter/nf_conntrack.h> 4#include <net/netfilter/nf_conntrack.h>
5#include <net/netfilter/nf_nat.h>
5 6
6/* This header used to share core functionality between the standalone 7/* This header used to share core functionality between the standalone
7 NAT module, and the compatibility layer's use of NAT for masquerading. */ 8 NAT module, and the compatibility layer's use of NAT for masquerading. */
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 83da7e1f0d3d..ffbc7f28335a 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -144,10 +144,9 @@ struct netlbl_lsm_secattr {
144}; 144};
145 145
146/* 146/*
147 * LSM security attribute operations 147 * LSM security attribute operations (inline)
148 */ 148 */
149 149
150
151/** 150/**
152 * netlbl_secattr_cache_alloc - Allocate and initialize a secattr cache 151 * netlbl_secattr_cache_alloc - Allocate and initialize a secattr cache
153 * @flags: the memory allocation flags 152 * @flags: the memory allocation flags
@@ -283,6 +282,9 @@ static inline void netlbl_secattr_free(struct netlbl_lsm_secattr *secattr)
283} 282}
284 283
285#ifdef CONFIG_NETLABEL 284#ifdef CONFIG_NETLABEL
285/*
286 * LSM security attribute operations
287 */
286int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap, 288int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap,
287 u32 offset); 289 u32 offset);
288int netlbl_secattr_catmap_walk_rng(struct netlbl_lsm_secattr_catmap *catmap, 290int netlbl_secattr_catmap_walk_rng(struct netlbl_lsm_secattr_catmap *catmap,
@@ -294,6 +296,25 @@ int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap *catmap,
294 u32 start, 296 u32 start,
295 u32 end, 297 u32 end,
296 gfp_t flags); 298 gfp_t flags);
299
300/*
301 * LSM protocol operations
302 */
303int netlbl_enabled(void);
304int netlbl_sock_setattr(struct sock *sk,
305 const struct netlbl_lsm_secattr *secattr);
306int netlbl_sock_getattr(struct sock *sk,
307 struct netlbl_lsm_secattr *secattr);
308int netlbl_skbuff_getattr(const struct sk_buff *skb,
309 struct netlbl_lsm_secattr *secattr);
310void netlbl_skbuff_err(struct sk_buff *skb, int error);
311
312/*
313 * LSM label mapping cache operations
314 */
315void netlbl_cache_invalidate(void);
316int netlbl_cache_add(const struct sk_buff *skb,
317 const struct netlbl_lsm_secattr *secattr);
297#else 318#else
298static inline int netlbl_secattr_catmap_walk( 319static inline int netlbl_secattr_catmap_walk(
299 struct netlbl_lsm_secattr_catmap *catmap, 320 struct netlbl_lsm_secattr_catmap *catmap,
@@ -301,14 +322,12 @@ static inline int netlbl_secattr_catmap_walk(
301{ 322{
302 return -ENOENT; 323 return -ENOENT;
303} 324}
304
305static inline int netlbl_secattr_catmap_walk_rng( 325static inline int netlbl_secattr_catmap_walk_rng(
306 struct netlbl_lsm_secattr_catmap *catmap, 326 struct netlbl_lsm_secattr_catmap *catmap,
307 u32 offset) 327 u32 offset)
308{ 328{
309 return -ENOENT; 329 return -ENOENT;
310} 330}
311
312static inline int netlbl_secattr_catmap_setbit( 331static inline int netlbl_secattr_catmap_setbit(
313 struct netlbl_lsm_secattr_catmap *catmap, 332 struct netlbl_lsm_secattr_catmap *catmap,
314 u32 bit, 333 u32 bit,
@@ -316,7 +335,6 @@ static inline int netlbl_secattr_catmap_setbit(
316{ 335{
317 return 0; 336 return 0;
318} 337}
319
320static inline int netlbl_secattr_catmap_setrng( 338static inline int netlbl_secattr_catmap_setrng(
321 struct netlbl_lsm_secattr_catmap *catmap, 339 struct netlbl_lsm_secattr_catmap *catmap,
322 u32 start, 340 u32 start,
@@ -325,67 +343,33 @@ static inline int netlbl_secattr_catmap_setrng(
325{ 343{
326 return 0; 344 return 0;
327} 345}
328#endif 346static inline int netlbl_enabled(void)
329 347{
330/* 348 return 0;
331 * LSM protocol operations 349}
332 */ 350static inline int netlbl_sock_setattr(struct sock *sk,
333
334#ifdef CONFIG_NETLABEL
335int netlbl_socket_setattr(const struct socket *sock,
336 const struct netlbl_lsm_secattr *secattr);
337int netlbl_sock_getattr(struct sock *sk,
338 struct netlbl_lsm_secattr *secattr);
339int netlbl_socket_getattr(const struct socket *sock,
340 struct netlbl_lsm_secattr *secattr);
341int netlbl_skbuff_getattr(const struct sk_buff *skb,
342 struct netlbl_lsm_secattr *secattr);
343void netlbl_skbuff_err(struct sk_buff *skb, int error);
344#else
345static inline int netlbl_socket_setattr(const struct socket *sock,
346 const struct netlbl_lsm_secattr *secattr) 351 const struct netlbl_lsm_secattr *secattr)
347{ 352{
348 return -ENOSYS; 353 return -ENOSYS;
349} 354}
350
351static inline int netlbl_sock_getattr(struct sock *sk, 355static inline int netlbl_sock_getattr(struct sock *sk,
352 struct netlbl_lsm_secattr *secattr) 356 struct netlbl_lsm_secattr *secattr)
353{ 357{
354 return -ENOSYS; 358 return -ENOSYS;
355} 359}
356
357static inline int netlbl_socket_getattr(const struct socket *sock,
358 struct netlbl_lsm_secattr *secattr)
359{
360 return -ENOSYS;
361}
362
363static inline int netlbl_skbuff_getattr(const struct sk_buff *skb, 360static inline int netlbl_skbuff_getattr(const struct sk_buff *skb,
364 struct netlbl_lsm_secattr *secattr) 361 struct netlbl_lsm_secattr *secattr)
365{ 362{
366 return -ENOSYS; 363 return -ENOSYS;
367} 364}
368
369static inline void netlbl_skbuff_err(struct sk_buff *skb, int error) 365static inline void netlbl_skbuff_err(struct sk_buff *skb, int error)
370{ 366{
371 return; 367 return;
372} 368}
373#endif /* CONFIG_NETLABEL */
374
375/*
376 * LSM label mapping cache operations
377 */
378
379#ifdef CONFIG_NETLABEL
380void netlbl_cache_invalidate(void);
381int netlbl_cache_add(const struct sk_buff *skb,
382 const struct netlbl_lsm_secattr *secattr);
383#else
384static inline void netlbl_cache_invalidate(void) 369static inline void netlbl_cache_invalidate(void)
385{ 370{
386 return; 371 return;
387} 372}
388
389static inline int netlbl_cache_add(const struct sk_buff *skb, 373static inline int netlbl_cache_add(const struct sk_buff *skb,
390 const struct netlbl_lsm_secattr *secattr) 374 const struct netlbl_lsm_secattr *secattr)
391{ 375{
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 0bf325c29aff..d7b824be5422 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -118,6 +118,9 @@
118 * Nested Attributes Construction: 118 * Nested Attributes Construction:
119 * nla_nest_start(skb, type) start a nested attribute 119 * nla_nest_start(skb, type) start a nested attribute
120 * nla_nest_end(skb, nla) finalize a nested attribute 120 * nla_nest_end(skb, nla) finalize a nested attribute
121 * nla_nest_compat_start(skb, type, start a nested compat attribute
122 * len, data)
123 * nla_nest_compat_end(skb, type) finalize a nested compat attribute
121 * nla_nest_cancel(skb, nla) cancel nested attribute construction 124 * nla_nest_cancel(skb, nla) cancel nested attribute construction
122 * 125 *
123 * Attribute Length Calculations: 126 * Attribute Length Calculations:
@@ -152,6 +155,7 @@
152 * nla_find_nested() find attribute in nested attributes 155 * nla_find_nested() find attribute in nested attributes
153 * nla_parse() parse and validate stream of attrs 156 * nla_parse() parse and validate stream of attrs
154 * nla_parse_nested() parse nested attribuets 157 * nla_parse_nested() parse nested attribuets
158 * nla_parse_nested_compat() parse nested compat attributes
155 * nla_for_each_attr() loop over all attributes 159 * nla_for_each_attr() loop over all attributes
156 * nla_for_each_nested() loop over the nested attributes 160 * nla_for_each_nested() loop over the nested attributes
157 *========================================================================= 161 *=========================================================================
@@ -170,6 +174,7 @@ enum {
170 NLA_FLAG, 174 NLA_FLAG,
171 NLA_MSECS, 175 NLA_MSECS,
172 NLA_NESTED, 176 NLA_NESTED,
177 NLA_NESTED_COMPAT,
173 NLA_NUL_STRING, 178 NLA_NUL_STRING,
174 NLA_BINARY, 179 NLA_BINARY,
175 __NLA_TYPE_MAX, 180 __NLA_TYPE_MAX,
@@ -190,6 +195,7 @@ enum {
190 * NLA_NUL_STRING Maximum length of string (excluding NUL) 195 * NLA_NUL_STRING Maximum length of string (excluding NUL)
191 * NLA_FLAG Unused 196 * NLA_FLAG Unused
192 * NLA_BINARY Maximum length of attribute payload 197 * NLA_BINARY Maximum length of attribute payload
198 * NLA_NESTED_COMPAT Exact length of structure payload
193 * All other Exact length of attribute payload 199 * All other Exact length of attribute payload
194 * 200 *
195 * Example: 201 * Example:
@@ -222,10 +228,10 @@ extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb,
222 gfp_t flags); 228 gfp_t flags);
223 229
224extern int nla_validate(struct nlattr *head, int len, int maxtype, 230extern int nla_validate(struct nlattr *head, int len, int maxtype,
225 struct nla_policy *policy); 231 const struct nla_policy *policy);
226extern int nla_parse(struct nlattr *tb[], int maxtype, 232extern int nla_parse(struct nlattr *tb[], int maxtype,
227 struct nlattr *head, int len, 233 struct nlattr *head, int len,
228 struct nla_policy *policy); 234 const struct nla_policy *policy);
229extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); 235extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype);
230extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, 236extern size_t nla_strlcpy(char *dst, const struct nlattr *nla,
231 size_t dstsize); 237 size_t dstsize);
@@ -360,7 +366,7 @@ static inline struct nlmsghdr *nlmsg_next(struct nlmsghdr *nlh, int *remaining)
360 */ 366 */
361static inline int nlmsg_parse(struct nlmsghdr *nlh, int hdrlen, 367static inline int nlmsg_parse(struct nlmsghdr *nlh, int hdrlen,
362 struct nlattr *tb[], int maxtype, 368 struct nlattr *tb[], int maxtype,
363 struct nla_policy *policy) 369 const struct nla_policy *policy)
364{ 370{
365 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) 371 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
366 return -EINVAL; 372 return -EINVAL;
@@ -392,7 +398,7 @@ static inline struct nlattr *nlmsg_find_attr(struct nlmsghdr *nlh,
392 * @policy: validation policy 398 * @policy: validation policy
393 */ 399 */
394static inline int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype, 400static inline int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype,
395 struct nla_policy *policy) 401 const struct nla_policy *policy)
396{ 402{
397 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) 403 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
398 return -EINVAL; 404 return -EINVAL;
@@ -729,10 +735,43 @@ static inline struct nlattr *nla_find_nested(struct nlattr *nla, int attrtype)
729 */ 735 */
730static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, 736static inline int nla_parse_nested(struct nlattr *tb[], int maxtype,
731 struct nlattr *nla, 737 struct nlattr *nla,
732 struct nla_policy *policy) 738 const struct nla_policy *policy)
733{ 739{
734 return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy); 740 return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy);
735} 741}
742
743/**
744 * nla_parse_nested_compat - parse nested compat attributes
745 * @tb: destination array with maxtype+1 elements
746 * @maxtype: maximum attribute type to be expected
747 * @nla: attribute containing the nested attributes
748 * @data: pointer to point to contained structure
749 * @len: length of contained structure
750 * @policy: validation policy
751 *
752 * Parse a nested compat attribute. The compat attribute contains a structure
753 * and optionally a set of nested attributes. On success the data pointer
754 * points to the nested data and tb contains the parsed attributes
755 * (see nla_parse).
756 */
757static inline int __nla_parse_nested_compat(struct nlattr *tb[], int maxtype,
758 struct nlattr *nla,
759 const struct nla_policy *policy,
760 int len)
761{
762 if (nla_len(nla) < len)
763 return -1;
764 if (nla_len(nla) >= NLA_ALIGN(len) + sizeof(struct nlattr))
765 return nla_parse_nested(tb, maxtype,
766 nla_data(nla) + NLA_ALIGN(len),
767 policy);
768 memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
769 return 0;
770}
771
772#define nla_parse_nested_compat(tb, maxtype, nla, policy, data, len) \
773({ data = nla_len(nla) >= len ? nla_data(nla) : NULL; \
774 __nla_parse_nested_compat(tb, maxtype, nla, policy, len); })
736/** 775/**
737 * nla_put_u8 - Add a u16 netlink attribute to a socket buffer 776 * nla_put_u8 - Add a u16 netlink attribute to a socket buffer
738 * @skb: socket buffer to add attribute to 777 * @skb: socket buffer to add attribute to
@@ -965,6 +1004,51 @@ static inline int nla_nest_end(struct sk_buff *skb, struct nlattr *start)
965} 1004}
966 1005
967/** 1006/**
1007 * nla_nest_compat_start - Start a new level of nested compat attributes
1008 * @skb: socket buffer to add attributes to
1009 * @attrtype: attribute type of container
1010 * @attrlen: length of structure
1011 * @data: pointer to structure
1012 *
1013 * Start a nested compat attribute that contains both a structure and
1014 * a set of nested attributes.
1015 *
1016 * Returns the container attribute
1017 */
1018static inline struct nlattr *nla_nest_compat_start(struct sk_buff *skb,
1019 int attrtype, int attrlen,
1020 const void *data)
1021{
1022 struct nlattr *start = (struct nlattr *)skb_tail_pointer(skb);
1023
1024 if (nla_put(skb, attrtype, attrlen, data) < 0)
1025 return NULL;
1026 if (nla_nest_start(skb, attrtype) == NULL) {
1027 nlmsg_trim(skb, start);
1028 return NULL;
1029 }
1030 return start;
1031}
1032
1033/**
1034 * nla_nest_compat_end - Finalize nesting of compat attributes
1035 * @skb: socket buffer the attribtues are stored in
1036 * @start: container attribute
1037 *
1038 * Corrects the container attribute header to include the all
1039 * appeneded attributes.
1040 *
1041 * Returns the total data length of the skb.
1042 */
1043static inline int nla_nest_compat_end(struct sk_buff *skb, struct nlattr *start)
1044{
1045 struct nlattr *nest = (void *)start + NLMSG_ALIGN(start->nla_len);
1046
1047 start->nla_len = skb_tail_pointer(skb) - (unsigned char *)start;
1048 return nla_nest_end(skb, nest);
1049}
1050
1051/**
968 * nla_nest_cancel - Cancel nesting of attributes 1052 * nla_nest_cancel - Cancel nesting of attributes
969 * @skb: socket buffer the message is stored in 1053 * @skb: socket buffer the message is stored in
970 * @start: container attribute 1054 * @start: container attribute
@@ -990,7 +1074,7 @@ static inline int nla_nest_cancel(struct sk_buff *skb, struct nlattr *start)
990 * Returns 0 on success or a negative error code. 1074 * Returns 0 on success or a negative error code.
991 */ 1075 */
992static inline int nla_validate_nested(struct nlattr *start, int maxtype, 1076static inline int nla_validate_nested(struct nlattr *start, int maxtype,
993 struct nla_policy *policy) 1077 const struct nla_policy *policy)
994{ 1078{
995 return nla_validate(nla_data(start), nla_len(start), maxtype, policy); 1079 return nla_validate(nla_data(start), nla_len(start), maxtype, policy);
996} 1080}
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 4129df708079..7968b1d66369 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -65,8 +65,6 @@ struct tcf_exts
65{ 65{
66#ifdef CONFIG_NET_CLS_ACT 66#ifdef CONFIG_NET_CLS_ACT
67 struct tc_action *action; 67 struct tc_action *action;
68#elif defined CONFIG_NET_CLS_POLICE
69 struct tcf_police *police;
70#endif 68#endif
71}; 69};
72 70
@@ -91,8 +89,6 @@ tcf_exts_is_predicative(struct tcf_exts *exts)
91{ 89{
92#ifdef CONFIG_NET_CLS_ACT 90#ifdef CONFIG_NET_CLS_ACT
93 return !!exts->action; 91 return !!exts->action;
94#elif defined CONFIG_NET_CLS_POLICE
95 return !!exts->police;
96#else 92#else
97 return 0; 93 return 0;
98#endif 94#endif
@@ -129,11 +125,7 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
129#ifdef CONFIG_NET_CLS_ACT 125#ifdef CONFIG_NET_CLS_ACT
130 if (exts->action) 126 if (exts->action)
131 return tcf_action_exec(skb, exts->action, res); 127 return tcf_action_exec(skb, exts->action, res);
132#elif defined CONFIG_NET_CLS_POLICE
133 if (exts->police)
134 return tcf_police(skb, exts->police);
135#endif 128#endif
136
137 return 0; 129 return 0;
138} 130}
139 131
@@ -306,6 +298,8 @@ static inline int tcf_em_tree_match(struct sk_buff *skb,
306 return 1; 298 return 1;
307} 299}
308 300
301#define MODULE_ALIAS_TCF_EMATCH(kind) MODULE_ALIAS("ematch-kind-" __stringify(kind))
302
309#else /* CONFIG_NET_EMATCH */ 303#else /* CONFIG_NET_EMATCH */
310 304
311struct tcf_ematch_tree 305struct tcf_ematch_tree
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 5754d53d9efc..9e22526e80e7 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -89,8 +89,10 @@ static inline void qdisc_run(struct net_device *dev)
89 __qdisc_run(dev); 89 __qdisc_run(dev);
90} 90}
91 91
92extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp,
93 struct tcf_result *res);
92extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, 94extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp,
93 struct tcf_result *res); 95 struct tcf_result *res);
94 96
95/* Calculate maximal size of packet seen by hard_start_xmit 97/* Calculate maximal size of packet seen by hard_start_xmit
96 routine of this device. 98 routine of this device.
diff --git a/include/net/rawv6.h b/include/net/rawv6.h
index af8960878ef4..a5819891d525 100644
--- a/include/net/rawv6.h
+++ b/include/net/rawv6.h
@@ -3,6 +3,8 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <net/protocol.h>
7
6#define RAWV6_HTABLE_SIZE MAX_INET_PROTOS 8#define RAWV6_HTABLE_SIZE MAX_INET_PROTOS
7extern struct hlist_head raw_v6_htable[RAWV6_HTABLE_SIZE]; 9extern struct hlist_head raw_v6_htable[RAWV6_HTABLE_SIZE];
8extern rwlock_t raw_v6_lock; 10extern rwlock_t raw_v6_lock;
@@ -23,6 +25,13 @@ extern void rawv6_err(struct sock *sk,
23 int type, int code, 25 int type, int code,
24 int offset, __be32 info); 26 int offset, __be32 info);
25 27
28#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
29int rawv6_mh_filter_register(int (*filter)(struct sock *sock,
30 struct sk_buff *skb));
31int rawv6_mh_filter_unregister(int (*filter)(struct sock *sock,
32 struct sk_buff *skb));
33#endif
34
26#endif 35#endif
27 36
28#endif 37#endif
diff --git a/include/net/route.h b/include/net/route.h
index 749e4dfe5ff3..f7ce6259f86f 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -62,7 +62,6 @@ struct rtable
62 62
63 unsigned rt_flags; 63 unsigned rt_flags;
64 __u16 rt_type; 64 __u16 rt_type;
65 __u16 rt_multipath_alg;
66 65
67 __be32 rt_dst; /* Path destination */ 66 __be32 rt_dst; /* Path destination */
68 __be32 rt_src; /* Path source */ 67 __be32 rt_src; /* Path source */
@@ -136,7 +135,7 @@ static inline void ip_rt_put(struct rtable * rt)
136 135
137#define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) 136#define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3)
138 137
139extern __u8 ip_tos2prio[16]; 138extern const __u8 ip_tos2prio[16];
140 139
141static inline char rt_tos2priority(u8 tos) 140static inline char rt_tos2priority(u8 tos)
142{ 141{
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index 3b3d4745618d..3861c05cdf0f 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -22,4 +22,62 @@ static inline int rtnl_msg_family(struct nlmsghdr *nlh)
22 return AF_UNSPEC; 22 return AF_UNSPEC;
23} 23}
24 24
25/**
26 * struct rtnl_link_ops - rtnetlink link operations
27 *
28 * @list: Used internally
29 * @kind: Identifier
30 * @maxtype: Highest device specific netlink attribute number
31 * @policy: Netlink policy for device specific attribute validation
32 * @validate: Optional validation function for netlink/changelink parameters
33 * @priv_size: sizeof net_device private space
34 * @setup: net_device setup function
35 * @newlink: Function for configuring and registering a new device
36 * @changelink: Function for changing parameters of an existing device
37 * @dellink: Function to remove a device
38 * @get_size: Function to calculate required room for dumping device
39 * specific netlink attributes
40 * @fill_info: Function to dump device specific netlink attributes
41 * @get_xstats_size: Function to calculate required room for dumping devic
42 * specific statistics
43 * @fill_xstats: Function to dump device specific statistics
44 */
45struct rtnl_link_ops {
46 struct list_head list;
47
48 const char *kind;
49
50 size_t priv_size;
51 void (*setup)(struct net_device *dev);
52
53 int maxtype;
54 const struct nla_policy *policy;
55 int (*validate)(struct nlattr *tb[],
56 struct nlattr *data[]);
57
58 int (*newlink)(struct net_device *dev,
59 struct nlattr *tb[],
60 struct nlattr *data[]);
61 int (*changelink)(struct net_device *dev,
62 struct nlattr *tb[],
63 struct nlattr *data[]);
64 void (*dellink)(struct net_device *dev);
65
66 size_t (*get_size)(const struct net_device *dev);
67 int (*fill_info)(struct sk_buff *skb,
68 const struct net_device *dev);
69
70 size_t (*get_xstats_size)(const struct net_device *dev);
71 int (*fill_xstats)(struct sk_buff *skb,
72 const struct net_device *dev);
73};
74
75extern int __rtnl_link_register(struct rtnl_link_ops *ops);
76extern void __rtnl_link_unregister(struct rtnl_link_ops *ops);
77
78extern int rtnl_link_register(struct rtnl_link_ops *ops);
79extern void rtnl_link_unregister(struct rtnl_link_ops *ops);
80
81#define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind)
82
25#endif 83#endif
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 1b8e35197ebe..8a67f24cbe02 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -290,7 +290,7 @@ static inline int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch)
290{ 290{
291 sch->qstats.drops++; 291 sch->qstats.drops++;
292 292
293#ifdef CONFIG_NET_CLS_POLICE 293#ifdef CONFIG_NET_CLS_ACT
294 if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch)) 294 if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch))
295 goto drop; 295 goto drop;
296 296
diff --git a/include/net/scm.h b/include/net/scm.h
index 5637d5e22d5f..423cb1d5ac25 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -8,7 +8,7 @@
8/* Well, we should have at least one descriptor open 8/* Well, we should have at least one descriptor open
9 * to accept passed FDs 8) 9 * to accept passed FDs 8)
10 */ 10 */
11#define SCM_MAX_FD (OPEN_MAX-1) 11#define SCM_MAX_FD 255
12 12
13struct scm_fp_list 13struct scm_fp_list
14{ 14{
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index dda72bf5b9b4..16baef4dab7e 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -503,6 +503,13 @@ static inline int sctp_frag_point(const struct sctp_sock *sp, int pmtu)
503 return frag; 503 return frag;
504} 504}
505 505
506static inline void sctp_assoc_pending_pmtu(struct sctp_association *asoc)
507{
508
509 sctp_assoc_sync_pmtu(asoc);
510 asoc->pmtu_pending = 0;
511}
512
506/* Walk through a list of TLV parameters. Don't trust the 513/* Walk through a list of TLV parameters. Don't trust the
507 * individual parameter lengths and instead depend on 514 * individual parameter lengths and instead depend on
508 * the chunk length to indicate when to stop. Make sure 515 * the chunk length to indicate when to stop. Make sure
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 5e81984b8478..ee4559b11302 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -912,6 +912,9 @@ struct sctp_transport {
912 */ 912 */
913 __u16 pathmaxrxt; 913 __u16 pathmaxrxt;
914 914
915 /* is the Path MTU update pending on this tranport */
916 __u8 pmtu_pending;
917
915 /* PMTU : The current known path MTU. */ 918 /* PMTU : The current known path MTU. */
916 __u32 pathmtu; 919 __u32 pathmtu;
917 920
@@ -1006,6 +1009,7 @@ void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32);
1006void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t); 1009void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t);
1007unsigned long sctp_transport_timeout(struct sctp_transport *); 1010unsigned long sctp_transport_timeout(struct sctp_transport *);
1008void sctp_transport_reset(struct sctp_transport *); 1011void sctp_transport_reset(struct sctp_transport *);
1012void sctp_transport_update_pmtu(struct sctp_transport *, u32);
1009 1013
1010 1014
1011/* This is the structure we use to queue packets as they come into 1015/* This is the structure we use to queue packets as they come into
@@ -1565,6 +1569,9 @@ struct sctp_association {
1565 */ 1569 */
1566 __u16 pathmaxrxt; 1570 __u16 pathmaxrxt;
1567 1571
1572 /* Flag that path mtu update is pending */
1573 __u8 pmtu_pending;
1574
1568 /* Association : The smallest PMTU discovered for all of the 1575 /* Association : The smallest PMTU discovered for all of the
1569 * PMTU : peer's transport addresses. 1576 * PMTU : peer's transport addresses.
1570 */ 1577 */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index a8af9ae00177..8b404b1ef7c8 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -652,8 +652,7 @@ struct tcp_congestion_ops {
652 /* lower bound for congestion window (optional) */ 652 /* lower bound for congestion window (optional) */
653 u32 (*min_cwnd)(const struct sock *sk); 653 u32 (*min_cwnd)(const struct sock *sk);
654 /* do new cwnd calculation (required) */ 654 /* do new cwnd calculation (required) */
655 void (*cong_avoid)(struct sock *sk, u32 ack, 655 void (*cong_avoid)(struct sock *sk, u32 ack, u32 in_flight, int good_ack);
656 u32 rtt, u32 in_flight, int good_ack);
657 /* call before changing ca_state (optional) */ 656 /* call before changing ca_state (optional) */
658 void (*set_state)(struct sock *sk, u8 new_state); 657 void (*set_state)(struct sock *sk, u8 new_state);
659 /* call when cwnd event occurs (optional) */ 658 /* call when cwnd event occurs (optional) */
@@ -684,8 +683,7 @@ extern void tcp_slow_start(struct tcp_sock *tp);
684 683
685extern struct tcp_congestion_ops tcp_init_congestion_ops; 684extern struct tcp_congestion_ops tcp_init_congestion_ops;
686extern u32 tcp_reno_ssthresh(struct sock *sk); 685extern u32 tcp_reno_ssthresh(struct sock *sk);
687extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, 686extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight, int flag);
688 u32 rtt, u32 in_flight, int flag);
689extern u32 tcp_reno_min_cwnd(const struct sock *sk); 687extern u32 tcp_reno_min_cwnd(const struct sock *sk);
690extern struct tcp_congestion_ops tcp_reno; 688extern struct tcp_congestion_ops tcp_reno;
691 689
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h
index 333bba6dc522..cfc4ba46de8f 100644
--- a/include/net/tipc/tipc_port.h
+++ b/include/net/tipc/tipc_port.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports 2 * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports
3 * 3 *
4 * Copyright (c) 1994-2006, Ericsson AB 4 * Copyright (c) 1994-2007, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems 5 * Copyright (c) 2005-2007, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -55,6 +55,7 @@
55 * @conn_unacked: number of unacknowledged messages received from peer port 55 * @conn_unacked: number of unacknowledged messages received from peer port
56 * @published: non-zero if port has one or more associated names 56 * @published: non-zero if port has one or more associated names
57 * @congested: non-zero if cannot send because of link or port congestion 57 * @congested: non-zero if cannot send because of link or port congestion
58 * @max_pkt: maximum packet size "hint" used when building messages sent by port
58 * @ref: unique reference to port in TIPC object registry 59 * @ref: unique reference to port in TIPC object registry
59 * @phdr: preformatted message header used when sending messages 60 * @phdr: preformatted message header used when sending messages
60 */ 61 */
@@ -68,6 +69,7 @@ struct tipc_port {
68 u32 conn_unacked; 69 u32 conn_unacked;
69 int published; 70 int published;
70 u32 congested; 71 u32 congested;
72 u32 max_pkt;
71 u32 ref; 73 u32 ref;
72 struct tipc_msg phdr; 74 struct tipc_msg phdr;
73}; 75};
diff --git a/include/net/udp.h b/include/net/udp.h
index 496f89d45c8b..98755ebaf163 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -119,16 +119,9 @@ static inline void udp_lib_close(struct sock *sk, long timeout)
119} 119}
120 120
121 121
122struct udp_get_port_ops {
123 int (*saddr_cmp)(const struct sock *sk1, const struct sock *sk2);
124 int (*saddr_any)(const struct sock *sk);
125 unsigned int (*hash_port_and_rcv_saddr)(__u16 port,
126 const struct sock *sk);
127};
128
129/* net/ipv4/udp.c */ 122/* net/ipv4/udp.c */
130extern int udp_get_port(struct sock *sk, unsigned short snum, 123extern int udp_get_port(struct sock *sk, unsigned short snum,
131 const struct udp_get_port_ops *ops); 124 int (*saddr_cmp)(const struct sock *, const struct sock *));
132extern void udp_err(struct sk_buff *, u32); 125extern void udp_err(struct sk_buff *, u32);
133 126
134extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, 127extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
diff --git a/include/net/udplite.h b/include/net/udplite.h
index 50b4b424d1ca..635b0eafca95 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -120,5 +120,5 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
120 120
121extern void udplite4_register(void); 121extern void udplite4_register(void);
122extern int udplite_get_port(struct sock *sk, unsigned short snum, 122extern int udplite_get_port(struct sock *sk, unsigned short snum,
123 const struct udp_get_port_ops *ops); 123 int (*scmp)(const struct sock *, const struct sock *));
124#endif /* _UDPLITE_H */ 124#endif /* _UDPLITE_H */
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 90185e8b335e..a5f80bfbaaa4 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -19,9 +19,19 @@
19#include <net/ipv6.h> 19#include <net/ipv6.h>
20#include <net/ip6_fib.h> 20#include <net/ip6_fib.h>
21 21
22#define XFRM_PROTO_ESP 50
23#define XFRM_PROTO_AH 51
24#define XFRM_PROTO_COMP 108
25#define XFRM_PROTO_IPIP 4
26#define XFRM_PROTO_IPV6 41
27#define XFRM_PROTO_ROUTING IPPROTO_ROUTING
28#define XFRM_PROTO_DSTOPTS IPPROTO_DSTOPTS
29
22#define XFRM_ALIGN8(len) (((len) + 7) & ~7) 30#define XFRM_ALIGN8(len) (((len) + 7) & ~7)
23#define MODULE_ALIAS_XFRM_MODE(family, encap) \ 31#define MODULE_ALIAS_XFRM_MODE(family, encap) \
24 MODULE_ALIAS("xfrm-mode-" __stringify(family) "-" __stringify(encap)) 32 MODULE_ALIAS("xfrm-mode-" __stringify(family) "-" __stringify(encap))
33#define MODULE_ALIAS_XFRM_TYPE(family, proto) \
34 MODULE_ALIAS("xfrm-type-" __stringify(family) "-" __stringify(proto))
25 35
26extern struct sock *xfrm_nl; 36extern struct sock *xfrm_nl;
27extern u32 sysctl_xfrm_aevent_etime; 37extern u32 sysctl_xfrm_aevent_etime;
@@ -509,11 +519,9 @@ __be16 xfrm_flowi_sport(struct flowi *fl)
509 case IPPROTO_ICMPV6: 519 case IPPROTO_ICMPV6:
510 port = htons(fl->fl_icmp_type); 520 port = htons(fl->fl_icmp_type);
511 break; 521 break;
512#ifdef CONFIG_IPV6_MIP6
513 case IPPROTO_MH: 522 case IPPROTO_MH:
514 port = htons(fl->fl_mh_type); 523 port = htons(fl->fl_mh_type);
515 break; 524 break;
516#endif
517 default: 525 default:
518 port = 0; /*XXX*/ 526 port = 0; /*XXX*/
519 } 527 }
@@ -577,7 +585,6 @@ static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ct
577struct xfrm_dst 585struct xfrm_dst
578{ 586{
579 union { 587 union {
580 struct xfrm_dst *next;
581 struct dst_entry dst; 588 struct dst_entry dst;
582 struct rtable rt; 589 struct rtable rt;
583 struct rt6_info rt6; 590 struct rt6_info rt6;
@@ -920,6 +927,10 @@ extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t
920 struct flowi *fl, struct xfrm_tmpl *tmpl, 927 struct flowi *fl, struct xfrm_tmpl *tmpl,
921 struct xfrm_policy *pol, int *err, 928 struct xfrm_policy *pol, int *err,
922 unsigned short family); 929 unsigned short family);
930extern struct xfrm_state * xfrm_stateonly_find(xfrm_address_t *daddr,
931 xfrm_address_t *saddr,
932 unsigned short family,
933 u8 mode, u8 proto, u32 reqid);
923extern int xfrm_state_check_expire(struct xfrm_state *x); 934extern int xfrm_state_check_expire(struct xfrm_state *x);
924extern void xfrm_state_insert(struct xfrm_state *x); 935extern void xfrm_state_insert(struct xfrm_state *x);
925extern int xfrm_state_add(struct xfrm_state *x); 936extern int xfrm_state_add(struct xfrm_state *x);
@@ -964,7 +975,7 @@ struct xfrmk_spdinfo {
964 975
965extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); 976extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq);
966extern int xfrm_state_delete(struct xfrm_state *x); 977extern int xfrm_state_delete(struct xfrm_state *x);
967extern void xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); 978extern int xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info);
968extern void xfrm_sad_getinfo(struct xfrmk_sadinfo *si); 979extern void xfrm_sad_getinfo(struct xfrmk_sadinfo *si);
969extern void xfrm_spd_getinfo(struct xfrmk_spdinfo *si); 980extern void xfrm_spd_getinfo(struct xfrmk_spdinfo *si);
970extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq); 981extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq);
@@ -991,7 +1002,7 @@ extern int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb,
991 u8 **prevhdr); 1002 u8 **prevhdr);
992 1003
993#ifdef CONFIG_XFRM 1004#ifdef CONFIG_XFRM
994extern int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type); 1005extern int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb);
995extern int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen); 1006extern int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen);
996extern int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family); 1007extern int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family);
997#else 1008#else
@@ -1000,12 +1011,13 @@ static inline int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optv
1000 return -ENOPROTOOPT; 1011 return -ENOPROTOOPT;
1001} 1012}
1002 1013
1003static inline int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type) 1014static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb)
1004{ 1015{
1005 /* should not happen */ 1016 /* should not happen */
1006 kfree_skb(skb); 1017 kfree_skb(skb);
1007 return 0; 1018 return 0;
1008} 1019}
1020
1009static inline int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family) 1021static inline int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family)
1010{ 1022{
1011 return -EINVAL; 1023 return -EINVAL;
@@ -1020,13 +1032,13 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
1020 struct xfrm_sec_ctx *ctx, int delete, 1032 struct xfrm_sec_ctx *ctx, int delete,
1021 int *err); 1033 int *err);
1022struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err); 1034struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err);
1023void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); 1035int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info);
1024u32 xfrm_get_acqseq(void); 1036u32 xfrm_get_acqseq(void);
1025void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi); 1037void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi);
1026struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, 1038struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto,
1027 xfrm_address_t *daddr, xfrm_address_t *saddr, 1039 xfrm_address_t *daddr, xfrm_address_t *saddr,
1028 int create, unsigned short family); 1040 int create, unsigned short family);
1029extern void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); 1041extern int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info);
1030extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); 1042extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
1031extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst, 1043extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst,
1032 struct flowi *fl, int family, int strict); 1044 struct flowi *fl, int family, int strict);
diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h
index eae7e2e84497..ad6e278ba7f2 100644
--- a/include/pcmcia/ciscode.h
+++ b/include/pcmcia/ciscode.h
@@ -126,4 +126,6 @@
126#define MANFID_POSSIO 0x030c 126#define MANFID_POSSIO 0x030c
127#define PRODID_POSSIO_GCC 0x0003 127#define PRODID_POSSIO_GCC 0x0003
128 128
129#define MANFID_NEC 0x0010
130
129#endif /* _LINUX_CISCODE_H */ 131#endif /* _LINUX_CISCODE_H */
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h
index 5c070176d9ab..12243e80c706 100644
--- a/include/rdma/ib_cm.h
+++ b/include/rdma/ib_cm.h
@@ -385,7 +385,6 @@ struct ib_cm_rep_param {
385 u8 private_data_len; 385 u8 private_data_len;
386 u8 responder_resources; 386 u8 responder_resources;
387 u8 initiator_depth; 387 u8 initiator_depth;
388 u8 target_ack_delay;
389 u8 failover_accepted; 388 u8 failover_accepted;
390 u8 flow_control; 389 u8 flow_control;
391 u8 rnr_retry_count; 390 u8 rnr_retry_count;
diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h
index 739fa4d0e539..30712ddd8a5e 100644
--- a/include/rdma/ib_mad.h
+++ b/include/rdma/ib_mad.h
@@ -111,6 +111,9 @@
111#define IB_QP1_QKEY 0x80010000 111#define IB_QP1_QKEY 0x80010000
112#define IB_QP_SET_QKEY 0x80000000 112#define IB_QP_SET_QKEY 0x80000000
113 113
114#define IB_DEFAULT_PKEY_PARTIAL 0x7FFF
115#define IB_DEFAULT_PKEY_FULL 0xFFFF
116
114enum { 117enum {
115 IB_MGMT_MAD_HDR = 24, 118 IB_MGMT_MAD_HDR = 24,
116 IB_MGMT_MAD_DATA = 232, 119 IB_MGMT_MAD_DATA = 232,
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 55ebf035e620..50e907f42048 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -48,6 +48,7 @@ enum iscsi_uevent_e {
48 ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT = UEVENT_BASE + 14, 48 ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT = UEVENT_BASE + 14,
49 49
50 ISCSI_UEVENT_TGT_DSCVR = UEVENT_BASE + 15, 50 ISCSI_UEVENT_TGT_DSCVR = UEVENT_BASE + 15,
51 ISCSI_UEVENT_SET_HOST_PARAM = UEVENT_BASE + 16,
51 52
52 /* up events */ 53 /* up events */
53 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, 54 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1,
@@ -71,6 +72,8 @@ struct iscsi_uevent {
71 /* messages u -> k */ 72 /* messages u -> k */
72 struct msg_create_session { 73 struct msg_create_session {
73 uint32_t initial_cmdsn; 74 uint32_t initial_cmdsn;
75 uint16_t cmds_max;
76 uint16_t queue_depth;
74 } c_session; 77 } c_session;
75 struct msg_destroy_session { 78 struct msg_destroy_session {
76 uint32_t sid; 79 uint32_t sid;
@@ -136,6 +139,11 @@ struct iscsi_uevent {
136 */ 139 */
137 uint32_t enable; 140 uint32_t enable;
138 } tgt_dscvr; 141 } tgt_dscvr;
142 struct msg_set_host_param {
143 uint32_t host_no;
144 uint32_t param; /* enum iscsi_host_param */
145 uint32_t len;
146 } set_host_param;
139 } u; 147 } u;
140 union { 148 union {
141 /* messages k -> u */ 149 /* messages k -> u */
@@ -223,6 +231,11 @@ enum iscsi_param {
223 ISCSI_PARAM_CONN_PORT, 231 ISCSI_PARAM_CONN_PORT,
224 ISCSI_PARAM_CONN_ADDRESS, 232 ISCSI_PARAM_CONN_ADDRESS,
225 233
234 ISCSI_PARAM_USERNAME,
235 ISCSI_PARAM_USERNAME_IN,
236 ISCSI_PARAM_PASSWORD,
237 ISCSI_PARAM_PASSWORD_IN,
238
226 /* must always be last */ 239 /* must always be last */
227 ISCSI_PARAM_MAX, 240 ISCSI_PARAM_MAX,
228}; 241};
@@ -249,6 +262,24 @@ enum iscsi_param {
249#define ISCSI_SESS_RECOVERY_TMO (1 << ISCSI_PARAM_SESS_RECOVERY_TMO) 262#define ISCSI_SESS_RECOVERY_TMO (1 << ISCSI_PARAM_SESS_RECOVERY_TMO)
250#define ISCSI_CONN_PORT (1 << ISCSI_PARAM_CONN_PORT) 263#define ISCSI_CONN_PORT (1 << ISCSI_PARAM_CONN_PORT)
251#define ISCSI_CONN_ADDRESS (1 << ISCSI_PARAM_CONN_ADDRESS) 264#define ISCSI_CONN_ADDRESS (1 << ISCSI_PARAM_CONN_ADDRESS)
265#define ISCSI_USERNAME (1 << ISCSI_PARAM_USERNAME)
266#define ISCSI_USERNAME_IN (1 << ISCSI_PARAM_USERNAME_IN)
267#define ISCSI_PASSWORD (1 << ISCSI_PARAM_PASSWORD)
268#define ISCSI_PASSWORD_IN (1 << ISCSI_PARAM_PASSWORD_IN)
269
270/* iSCSI HBA params */
271enum iscsi_host_param {
272 ISCSI_HOST_PARAM_HWADDRESS,
273 ISCSI_HOST_PARAM_INITIATOR_NAME,
274 ISCSI_HOST_PARAM_NETDEV_NAME,
275 ISCSI_HOST_PARAM_IPADDRESS,
276 ISCSI_HOST_PARAM_MAX,
277};
278
279#define ISCSI_HOST_HWADDRESS (1 << ISCSI_HOST_PARAM_HWADDRESS)
280#define ISCSI_HOST_INITIATOR_NAME (1 << ISCSI_HOST_PARAM_INITIATOR_NAME)
281#define ISCSI_HOST_NETDEV_NAME (1 << ISCSI_HOST_PARAM_NETDEV_NAME)
282#define ISCSI_HOST_IPADDRESS (1 << ISCSI_HOST_PARAM_IPADDRESS)
252 283
253#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) 284#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle)
254#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) 285#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr)
@@ -272,6 +303,9 @@ enum iscsi_param {
272#define CAP_MULTI_CONN 0x40 303#define CAP_MULTI_CONN 0x40
273#define CAP_TEXT_NEGO 0x80 304#define CAP_TEXT_NEGO 0x80
274#define CAP_MARKERS 0x100 305#define CAP_MARKERS 0x100
306#define CAP_FW_DB 0x200
307#define CAP_SENDTARGETS_OFFLOAD 0x400
308#define CAP_DATA_PATH_OFFLOAD 0x800
275 309
276/* 310/*
277 * These flags describes reason of stop_conn() call 311 * These flags describes reason of stop_conn() call
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index ea0816d4904d..3f631b08a1ab 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -48,9 +48,8 @@ struct iscsi_nopin;
48#define debug_scsi(fmt...) 48#define debug_scsi(fmt...)
49#endif 49#endif
50 50
51#define ISCSI_XMIT_CMDS_MAX 128 /* must be power of 2 */ 51#define ISCSI_DEF_XMIT_CMDS_MAX 128 /* must be power of 2 */
52#define ISCSI_MGMT_CMDS_MAX 32 /* must be power of 2 */ 52#define ISCSI_MGMT_CMDS_MAX 16 /* must be power of 2 */
53#define ISCSI_CONN_MAX 1
54 53
55#define ISCSI_MGMT_ITT_OFFSET 0xa00 54#define ISCSI_MGMT_ITT_OFFSET 0xa00
56 55
@@ -73,6 +72,8 @@ struct iscsi_nopin;
73#define ISCSI_AGE_SHIFT 28 72#define ISCSI_AGE_SHIFT 28
74#define ISCSI_AGE_MASK (0xf << ISCSI_AGE_SHIFT) 73#define ISCSI_AGE_MASK (0xf << ISCSI_AGE_SHIFT)
75 74
75#define ISCSI_ADDRESS_BUF_LEN 64
76
76struct iscsi_mgmt_task { 77struct iscsi_mgmt_task {
77 /* 78 /*
78 * Becuae LLDs allocate their hdr differently, this is a pointer to 79 * Becuae LLDs allocate their hdr differently, this is a pointer to
@@ -80,7 +81,7 @@ struct iscsi_mgmt_task {
80 */ 81 */
81 struct iscsi_hdr *hdr; 82 struct iscsi_hdr *hdr;
82 char *data; /* mgmt payload */ 83 char *data; /* mgmt payload */
83 int data_count; /* counts data to be sent */ 84 unsigned data_count; /* counts data to be sent */
84 uint32_t itt; /* this ITT */ 85 uint32_t itt; /* this ITT */
85 void *dd_data; /* driver/transport data */ 86 void *dd_data; /* driver/transport data */
86 struct list_head running; 87 struct list_head running;
@@ -90,6 +91,7 @@ enum {
90 ISCSI_TASK_COMPLETED, 91 ISCSI_TASK_COMPLETED,
91 ISCSI_TASK_PENDING, 92 ISCSI_TASK_PENDING,
92 ISCSI_TASK_RUNNING, 93 ISCSI_TASK_RUNNING,
94 ISCSI_TASK_ABORTING,
93}; 95};
94 96
95struct iscsi_cmd_task { 97struct iscsi_cmd_task {
@@ -99,16 +101,14 @@ struct iscsi_cmd_task {
99 */ 101 */
100 struct iscsi_cmd *hdr; 102 struct iscsi_cmd *hdr;
101 int itt; /* this ITT */ 103 int itt; /* this ITT */
102 int datasn; /* DataSN */
103 104
104 uint32_t unsol_datasn; 105 uint32_t unsol_datasn;
105 int imm_count; /* imm-data (bytes) */ 106 unsigned imm_count; /* imm-data (bytes) */
106 int unsol_count; /* unsolicited (bytes)*/ 107 unsigned unsol_count; /* unsolicited (bytes)*/
107 /* offset in unsolicited stream (bytes); */ 108 /* offset in unsolicited stream (bytes); */
108 int unsol_offset; 109 unsigned unsol_offset;
109 int data_count; /* remaining Data-Out */ 110 unsigned data_count; /* remaining Data-Out */
110 struct scsi_cmnd *sc; /* associated SCSI cmd*/ 111 struct scsi_cmnd *sc; /* associated SCSI cmd*/
111 int total_length;
112 struct iscsi_conn *conn; /* used connection */ 112 struct iscsi_conn *conn; /* used connection */
113 struct iscsi_mgmt_task *mtask; /* tmf mtask in progr */ 113 struct iscsi_mgmt_task *mtask; /* tmf mtask in progr */
114 114
@@ -152,18 +152,11 @@ struct iscsi_conn {
152 struct iscsi_cmd_task *ctask; /* xmit ctask in progress */ 152 struct iscsi_cmd_task *ctask; /* xmit ctask in progress */
153 153
154 /* xmit */ 154 /* xmit */
155 struct kfifo *immqueue; /* immediate xmit queue */
156 struct kfifo *mgmtqueue; /* mgmt (control) xmit queue */ 155 struct kfifo *mgmtqueue; /* mgmt (control) xmit queue */
157 struct list_head mgmt_run_list; /* list of control tasks */ 156 struct list_head mgmt_run_list; /* list of control tasks */
158 struct list_head xmitqueue; /* data-path cmd queue */ 157 struct list_head xmitqueue; /* data-path cmd queue */
159 struct list_head run_list; /* list of cmds in progress */ 158 struct list_head run_list; /* list of cmds in progress */
160 struct work_struct xmitwork; /* per-conn. xmit workqueue */ 159 struct work_struct xmitwork; /* per-conn. xmit workqueue */
161 /*
162 * serializes connection xmit, access to kfifos:
163 * xmitqueue, immqueue, mgmtqueue
164 */
165 struct mutex xmitmutex;
166
167 unsigned long suspend_tx; /* suspend Tx */ 160 unsigned long suspend_tx; /* suspend Tx */
168 unsigned long suspend_rx; /* suspend Rx */ 161 unsigned long suspend_rx; /* suspend Rx */
169 162
@@ -174,8 +167,8 @@ struct iscsi_conn {
174 int tmabort_state; /* see TMABORT_INITIAL, etc.*/ 167 int tmabort_state; /* see TMABORT_INITIAL, etc.*/
175 168
176 /* negotiated params */ 169 /* negotiated params */
177 int max_recv_dlength; /* initiator_max_recv_dsl*/ 170 unsigned max_recv_dlength; /* initiator_max_recv_dsl*/
178 int max_xmit_dlength; /* target_max_recv_dsl */ 171 unsigned max_xmit_dlength; /* target_max_recv_dsl */
179 int hdrdgst_en; 172 int hdrdgst_en;
180 int datadgst_en; 173 int datadgst_en;
181 int ifmarker_en; 174 int ifmarker_en;
@@ -183,6 +176,12 @@ struct iscsi_conn {
183 /* values userspace uses to id a conn */ 176 /* values userspace uses to id a conn */
184 int persistent_port; 177 int persistent_port;
185 char *persistent_address; 178 char *persistent_address;
179 /* remote portal currently connected to */
180 int portal_port;
181 char portal_address[ISCSI_ADDRESS_BUF_LEN];
182 /* local address */
183 int local_port;
184 char local_address[ISCSI_ADDRESS_BUF_LEN];
186 185
187 /* MIB-statistics */ 186 /* MIB-statistics */
188 uint64_t txdata_octets; 187 uint64_t txdata_octets;
@@ -213,18 +212,25 @@ struct iscsi_session {
213 212
214 /* configuration */ 213 /* configuration */
215 int initial_r2t_en; 214 int initial_r2t_en;
216 int max_r2t; 215 unsigned max_r2t;
217 int imm_data_en; 216 int imm_data_en;
218 int first_burst; 217 unsigned first_burst;
219 int max_burst; 218 unsigned max_burst;
220 int time2wait; 219 int time2wait;
221 int time2retain; 220 int time2retain;
222 int pdu_inorder_en; 221 int pdu_inorder_en;
223 int dataseq_inorder_en; 222 int dataseq_inorder_en;
224 int erl; 223 int erl;
225 int tpgt; 224 int tpgt;
225 char *username;
226 char *username_in;
227 char *password;
228 char *password_in;
226 char *targetname; 229 char *targetname;
227 230 char *initiatorname;
231 /* hw address or netdev iscsi connection is bound to */
232 char *hwaddress;
233 char *netdev;
228 /* control data */ 234 /* control data */
229 struct iscsi_transport *tt; 235 struct iscsi_transport *tt;
230 struct Scsi_Host *host; 236 struct Scsi_Host *host;
@@ -255,12 +261,22 @@ extern int iscsi_eh_host_reset(struct scsi_cmnd *sc);
255extern int iscsi_queuecommand(struct scsi_cmnd *sc, 261extern int iscsi_queuecommand(struct scsi_cmnd *sc,
256 void (*done)(struct scsi_cmnd *)); 262 void (*done)(struct scsi_cmnd *));
257 263
264
265/*
266 * iSCSI host helpers.
267 */
268extern int iscsi_host_set_param(struct Scsi_Host *shost,
269 enum iscsi_host_param param, char *buf,
270 int buflen);
271extern int iscsi_host_get_param(struct Scsi_Host *shost,
272 enum iscsi_host_param param, char *buf);
273
258/* 274/*
259 * session management 275 * session management
260 */ 276 */
261extern struct iscsi_cls_session * 277extern struct iscsi_cls_session *
262iscsi_session_setup(struct iscsi_transport *, struct scsi_transport_template *, 278iscsi_session_setup(struct iscsi_transport *, struct scsi_transport_template *,
263 int, int, uint32_t, uint32_t *); 279 uint16_t, uint16_t, int, int, uint32_t, uint32_t *);
264extern void iscsi_session_teardown(struct iscsi_cls_session *); 280extern void iscsi_session_teardown(struct iscsi_cls_session *);
265extern struct iscsi_session *class_to_transport_session(struct iscsi_cls_session *); 281extern struct iscsi_session *class_to_transport_session(struct iscsi_cls_session *);
266extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *); 282extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *);
@@ -289,8 +305,7 @@ extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
289/* 305/*
290 * pdu and task processing 306 * pdu and task processing
291 */ 307 */
292extern int iscsi_check_assign_cmdsn(struct iscsi_session *, 308extern void iscsi_update_cmdsn(struct iscsi_session *, struct iscsi_nopin *);
293 struct iscsi_nopin *);
294extern void iscsi_prep_unsolicit_data_pdu(struct iscsi_cmd_task *, 309extern void iscsi_prep_unsolicit_data_pdu(struct iscsi_cmd_task *,
295 struct iscsi_data *hdr); 310 struct iscsi_data *hdr);
296extern int iscsi_conn_send_pdu(struct iscsi_cls_conn *, struct iscsi_hdr *, 311extern int iscsi_conn_send_pdu(struct iscsi_cls_conn *, struct iscsi_hdr *,
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index a2e0c1032491..53e170586c26 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -135,4 +135,24 @@ extern void scsi_kunmap_atomic_sg(void *virt);
135extern struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *, gfp_t); 135extern struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *, gfp_t);
136extern void scsi_free_sgtable(struct scatterlist *, int); 136extern void scsi_free_sgtable(struct scatterlist *, int);
137 137
138extern int scsi_dma_map(struct scsi_cmnd *cmd);
139extern void scsi_dma_unmap(struct scsi_cmnd *cmd);
140
141#define scsi_sg_count(cmd) ((cmd)->use_sg)
142#define scsi_sglist(cmd) ((struct scatterlist *)(cmd)->request_buffer)
143#define scsi_bufflen(cmd) ((cmd)->request_bufflen)
144
145static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid)
146{
147 cmd->resid = resid;
148}
149
150static inline int scsi_get_resid(struct scsi_cmnd *cmd)
151{
152 return cmd->resid;
153}
154
155#define scsi_for_each_sg(cmd, sg, nseg, __i) \
156 for (__i = 0, sg = scsi_sglist(cmd); __i < (nseg); __i++, (sg)++)
157
138#endif /* _SCSI_SCSI_CMND_H */ 158#endif /* _SCSI_SCSI_CMND_H */
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 2f3c5b8b1d6a..d5057bc338ff 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -209,7 +209,6 @@ extern struct scsi_device *__scsi_add_device(struct Scsi_Host *,
209extern int scsi_add_device(struct Scsi_Host *host, uint channel, 209extern int scsi_add_device(struct Scsi_Host *host, uint channel,
210 uint target, uint lun); 210 uint target, uint lun);
211extern void scsi_remove_device(struct scsi_device *); 211extern void scsi_remove_device(struct scsi_device *);
212extern int scsi_device_cancel(struct scsi_device *, int);
213 212
214extern int scsi_device_get(struct scsi_device *); 213extern int scsi_device_get(struct scsi_device *);
215extern void scsi_device_put(struct scsi_device *); 214extern void scsi_device_put(struct scsi_device *);
@@ -287,6 +286,7 @@ extern void scsi_target_block(struct device *);
287extern void scsi_target_unblock(struct device *); 286extern void scsi_target_unblock(struct device *);
288extern void scsi_remove_target(struct device *); 287extern void scsi_remove_target(struct device *);
289extern void int_to_scsilun(unsigned int, struct scsi_lun *); 288extern void int_to_scsilun(unsigned int, struct scsi_lun *);
289extern int scsilun_to_int(struct scsi_lun *);
290extern const char *scsi_device_state_name(enum scsi_device_state); 290extern const char *scsi_device_state_name(enum scsi_device_state);
291extern int scsi_is_sdev_device(const struct device *); 291extern int scsi_is_sdev_device(const struct device *);
292extern int scsi_is_target_device(const struct device *); 292extern int scsi_is_target_device(const struct device *);
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 68f461b7a835..ba07cf7c04ba 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -339,12 +339,6 @@ struct scsi_host_template {
339 enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *); 339 enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *);
340 340
341 /* 341 /*
342 * suspend support
343 */
344 int (*resume)(struct scsi_device *);
345 int (*suspend)(struct scsi_device *, pm_message_t state);
346
347 /*
348 * Name of proc directory 342 * Name of proc directory
349 */ 343 */
350 char *proc_name; 344 char *proc_name;
@@ -677,6 +671,10 @@ struct Scsi_Host {
677#define shost_printk(prefix, shost, fmt, a...) \ 671#define shost_printk(prefix, shost, fmt, a...) \
678 dev_printk(prefix, &(shost)->shost_gendev, fmt, ##a) 672 dev_printk(prefix, &(shost)->shost_gendev, fmt, ##a)
679 673
674static inline void *shost_priv(struct Scsi_Host *shost)
675{
676 return (void *)shost->hostdata;
677}
680 678
681int scsi_is_host_device(const struct device *); 679int scsi_is_host_device(const struct device *);
682 680
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 1e797308640a..a0d80bcaa93d 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -1,4 +1,4 @@
1/* 1/*
2 * FiberChannel transport specific attributes exported to sysfs. 2 * FiberChannel transport specific attributes exported to sysfs.
3 * 3 *
4 * Copyright (c) 2003 Silicon Graphics, Inc. All rights reserved. 4 * Copyright (c) 2003 Silicon Graphics, Inc. All rights reserved.
@@ -19,7 +19,7 @@
19 * 19 *
20 * ======== 20 * ========
21 * 21 *
22 * Copyright (C) 2004-2005 James Smart, Emulex Corporation 22 * Copyright (C) 2004-2007 James Smart, Emulex Corporation
23 * Rewrite for host, target, device, and remote port attributes, 23 * Rewrite for host, target, device, and remote port attributes,
24 * statistics, and service functions... 24 * statistics, and service functions...
25 * 25 *
@@ -62,8 +62,10 @@ enum fc_port_type {
62 FC_PORTTYPE_NLPORT, /* (Public) Loop w/ FLPort */ 62 FC_PORTTYPE_NLPORT, /* (Public) Loop w/ FLPort */
63 FC_PORTTYPE_LPORT, /* (Private) Loop w/o FLPort */ 63 FC_PORTTYPE_LPORT, /* (Private) Loop w/o FLPort */
64 FC_PORTTYPE_PTP, /* Point to Point w/ another NPort */ 64 FC_PORTTYPE_PTP, /* Point to Point w/ another NPort */
65 FC_PORTTYPE_NPIV, /* VPORT based on NPIV */
65}; 66};
66 67
68
67/* 69/*
68 * fc_port_state: If you alter this, you also need to alter scsi_transport_fc.c 70 * fc_port_state: If you alter this, you also need to alter scsi_transport_fc.c
69 * (for the ascii descriptions). 71 * (for the ascii descriptions).
@@ -83,7 +85,26 @@ enum fc_port_state {
83}; 85};
84 86
85 87
86/* 88/*
89 * fc_vport_state: If you alter this, you also need to alter
90 * scsi_transport_fc.c (for the ascii descriptions).
91 */
92enum fc_vport_state {
93 FC_VPORT_UNKNOWN,
94 FC_VPORT_ACTIVE,
95 FC_VPORT_DISABLED,
96 FC_VPORT_LINKDOWN,
97 FC_VPORT_INITIALIZING,
98 FC_VPORT_NO_FABRIC_SUPP,
99 FC_VPORT_NO_FABRIC_RSCS,
100 FC_VPORT_FABRIC_LOGOUT,
101 FC_VPORT_FABRIC_REJ_WWN,
102 FC_VPORT_FAILED,
103};
104
105
106
107/*
87 * FC Classes of Service 108 * FC Classes of Service
88 * Note: values are not enumerated, as they can be "or'd" together 109 * Note: values are not enumerated, as they can be "or'd" together
89 * for reporting (e.g. report supported_classes). If you alter this list, 110 * for reporting (e.g. report supported_classes). If you alter this list,
@@ -96,7 +117,7 @@ enum fc_port_state {
96#define FC_COS_CLASS4 0x10 117#define FC_COS_CLASS4 0x10
97#define FC_COS_CLASS6 0x40 118#define FC_COS_CLASS6 0x40
98 119
99/* 120/*
100 * FC Port Speeds 121 * FC Port Speeds
101 * Note: values are not enumerated, as they can be "or'd" together 122 * Note: values are not enumerated, as they can be "or'd" together
102 * for reporting (e.g. report supported_speeds). If you alter this list, 123 * for reporting (e.g. report supported_speeds). If you alter this list,
@@ -124,16 +145,114 @@ enum fc_tgtid_binding_type {
124}; 145};
125 146
126/* 147/*
127 * FC Remote Port Roles 148 * FC Port Roles
128 * Note: values are not enumerated, as they can be "or'd" together 149 * Note: values are not enumerated, as they can be "or'd" together
129 * for reporting (e.g. report roles). If you alter this list, 150 * for reporting (e.g. report roles). If you alter this list,
130 * you also need to alter scsi_transport_fc.c (for the ascii descriptions). 151 * you also need to alter scsi_transport_fc.c (for the ascii descriptions).
131 */ 152 */
132#define FC_RPORT_ROLE_UNKNOWN 0x00 153#define FC_PORT_ROLE_UNKNOWN 0x00
133#define FC_RPORT_ROLE_FCP_TARGET 0x01 154#define FC_PORT_ROLE_FCP_TARGET 0x01
134#define FC_RPORT_ROLE_FCP_INITIATOR 0x02 155#define FC_PORT_ROLE_FCP_INITIATOR 0x02
135#define FC_RPORT_ROLE_IP_PORT 0x04 156#define FC_PORT_ROLE_IP_PORT 0x04
157
158/* The following are for compatibility */
159#define FC_RPORT_ROLE_UNKNOWN FC_PORT_ROLE_UNKNOWN
160#define FC_RPORT_ROLE_FCP_TARGET FC_PORT_ROLE_FCP_TARGET
161#define FC_RPORT_ROLE_FCP_INITIATOR FC_PORT_ROLE_FCP_INITIATOR
162#define FC_RPORT_ROLE_IP_PORT FC_PORT_ROLE_IP_PORT
163
164
165/* Macro for use in defining Virtual Port attributes */
166#define FC_VPORT_ATTR(_name,_mode,_show,_store) \
167struct class_device_attribute class_device_attr_vport_##_name = \
168 __ATTR(_name,_mode,_show,_store)
169
170
171/*
172 * FC Virtual Port Attributes
173 *
174 * This structure exists for each FC port is a virtual FC port. Virtual
175 * ports share the physical link with the Physical port. Each virtual
176 * ports has a unique presense on the SAN, and may be instantiated via
177 * NPIV, Virtual Fabrics, or via additional ALPAs. As the vport is a
178 * unique presense, each vport has it's own view of the fabric,
179 * authentication priviledge, and priorities.
180 *
181 * A virtual port may support 1 or more FC4 roles. Typically it is a
182 * FCP Initiator. It could be a FCP Target, or exist sole for an IP over FC
183 * roles. FC port attributes for the vport will be reported on any
184 * fc_host class object allocated for an FCP Initiator.
185 *
186 * --
187 *
188 * Fixed attributes are not expected to change. The driver is
189 * expected to set these values after receiving the fc_vport structure
190 * via the vport_create() call from the transport.
191 * The transport fully manages all get functions w/o driver interaction.
192 *
193 * Dynamic attributes are expected to change. The driver participates
194 * in all get/set operations via functions provided by the driver.
195 *
196 * Private attributes are transport-managed values. They are fully
197 * managed by the transport w/o driver interaction.
198 */
136 199
200#define FC_VPORT_SYMBOLIC_NAMELEN 64
201struct fc_vport {
202 /* Fixed Attributes */
203
204 /* Dynamic Attributes */
205
206 /* Private (Transport-managed) Attributes */
207 enum fc_vport_state vport_state;
208 enum fc_vport_state vport_last_state;
209 u64 node_name;
210 u64 port_name;
211 u32 roles;
212 u32 vport_id; /* Admin Identifier for the vport */
213 enum fc_port_type vport_type;
214 char symbolic_name[FC_VPORT_SYMBOLIC_NAMELEN];
215
216 /* exported data */
217 void *dd_data; /* Used for driver-specific storage */
218
219 /* internal data */
220 struct Scsi_Host *shost; /* Physical Port Parent */
221 unsigned int channel;
222 u32 number;
223 u8 flags;
224 struct list_head peers;
225 struct device dev;
226 struct work_struct vport_delete_work;
227} __attribute__((aligned(sizeof(unsigned long))));
228
229/* bit field values for struct fc_vport "flags" field: */
230#define FC_VPORT_CREATING 0x01
231#define FC_VPORT_DELETING 0x02
232#define FC_VPORT_DELETED 0x04
233#define FC_VPORT_DEL 0x06 /* Any DELETE state */
234
235#define dev_to_vport(d) \
236 container_of(d, struct fc_vport, dev)
237#define transport_class_to_vport(classdev) \
238 dev_to_vport(classdev->dev)
239#define vport_to_shost(v) \
240 (v->shost)
241#define vport_to_shost_channel(v) \
242 (v->channel)
243#define vport_to_parent(v) \
244 (v->dev.parent)
245
246
247/* Error return codes for vport_create() callback */
248#define VPCERR_UNSUPPORTED -ENOSYS /* no driver/adapter
249 support */
250#define VPCERR_BAD_WWN -ENOTUNIQ /* driver validation
251 of WWNs failed */
252#define VPCERR_NO_FABRIC_SUPP -EOPNOTSUPP /* Fabric connection
253 is loop or the
254 Fabric Port does
255 not support NPIV */
137 256
138/* 257/*
139 * fc_rport_identifiers: This set of data contains all elements 258 * fc_rport_identifiers: This set of data contains all elements
@@ -149,6 +268,7 @@ struct fc_rport_identifiers {
149 u32 roles; 268 u32 roles;
150}; 269};
151 270
271
152/* Macro for use in defining Remote Port attributes */ 272/* Macro for use in defining Remote Port attributes */
153#define FC_RPORT_ATTR(_name,_mode,_show,_store) \ 273#define FC_RPORT_ATTR(_name,_mode,_show,_store) \
154struct class_device_attribute class_device_attr_rport_##_name = \ 274struct class_device_attribute class_device_attr_rport_##_name = \
@@ -278,7 +398,7 @@ struct fc_host_statistics {
278 u64 prim_seq_protocol_err_count; 398 u64 prim_seq_protocol_err_count;
279 u64 invalid_tx_word_count; 399 u64 invalid_tx_word_count;
280 u64 invalid_crc_count; 400 u64 invalid_crc_count;
281 401
282 /* fc4 statistics (only FCP supported currently) */ 402 /* fc4 statistics (only FCP supported currently) */
283 u64 fcp_input_requests; 403 u64 fcp_input_requests;
284 u64 fcp_output_requests; 404 u64 fcp_output_requests;
@@ -343,6 +463,7 @@ struct fc_host_attrs {
343 u8 supported_fc4s[FC_FC4_LIST_SIZE]; 463 u8 supported_fc4s[FC_FC4_LIST_SIZE];
344 u32 supported_speeds; 464 u32 supported_speeds;
345 u32 maxframe_size; 465 u32 maxframe_size;
466 u16 max_npiv_vports;
346 char serial_number[FC_SERIAL_NUMBER_SIZE]; 467 char serial_number[FC_SERIAL_NUMBER_SIZE];
347 468
348 /* Dynamic Attributes */ 469 /* Dynamic Attributes */
@@ -361,8 +482,11 @@ struct fc_host_attrs {
361 /* internal data */ 482 /* internal data */
362 struct list_head rports; 483 struct list_head rports;
363 struct list_head rport_bindings; 484 struct list_head rport_bindings;
485 struct list_head vports;
364 u32 next_rport_number; 486 u32 next_rport_number;
365 u32 next_target_id; 487 u32 next_target_id;
488 u32 next_vport_number;
489 u16 npiv_vports_inuse;
366 490
367 /* work queues for rport state manipulation */ 491 /* work queues for rport state manipulation */
368 char work_q_name[KOBJ_NAME_LEN]; 492 char work_q_name[KOBJ_NAME_LEN];
@@ -388,6 +512,8 @@ struct fc_host_attrs {
388 (((struct fc_host_attrs *)(x)->shost_data)->supported_speeds) 512 (((struct fc_host_attrs *)(x)->shost_data)->supported_speeds)
389#define fc_host_maxframe_size(x) \ 513#define fc_host_maxframe_size(x) \
390 (((struct fc_host_attrs *)(x)->shost_data)->maxframe_size) 514 (((struct fc_host_attrs *)(x)->shost_data)->maxframe_size)
515#define fc_host_max_npiv_vports(x) \
516 (((struct fc_host_attrs *)(x)->shost_data)->max_npiv_vports)
391#define fc_host_serial_number(x) \ 517#define fc_host_serial_number(x) \
392 (((struct fc_host_attrs *)(x)->shost_data)->serial_number) 518 (((struct fc_host_attrs *)(x)->shost_data)->serial_number)
393#define fc_host_port_id(x) \ 519#define fc_host_port_id(x) \
@@ -412,10 +538,16 @@ struct fc_host_attrs {
412 (((struct fc_host_attrs *)(x)->shost_data)->rports) 538 (((struct fc_host_attrs *)(x)->shost_data)->rports)
413#define fc_host_rport_bindings(x) \ 539#define fc_host_rport_bindings(x) \
414 (((struct fc_host_attrs *)(x)->shost_data)->rport_bindings) 540 (((struct fc_host_attrs *)(x)->shost_data)->rport_bindings)
541#define fc_host_vports(x) \
542 (((struct fc_host_attrs *)(x)->shost_data)->vports)
415#define fc_host_next_rport_number(x) \ 543#define fc_host_next_rport_number(x) \
416 (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number) 544 (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number)
417#define fc_host_next_target_id(x) \ 545#define fc_host_next_target_id(x) \
418 (((struct fc_host_attrs *)(x)->shost_data)->next_target_id) 546 (((struct fc_host_attrs *)(x)->shost_data)->next_target_id)
547#define fc_host_next_vport_number(x) \
548 (((struct fc_host_attrs *)(x)->shost_data)->next_vport_number)
549#define fc_host_npiv_vports_inuse(x) \
550 (((struct fc_host_attrs *)(x)->shost_data)->npiv_vports_inuse)
419#define fc_host_work_q_name(x) \ 551#define fc_host_work_q_name(x) \
420 (((struct fc_host_attrs *)(x)->shost_data)->work_q_name) 552 (((struct fc_host_attrs *)(x)->shost_data)->work_q_name)
421#define fc_host_work_q(x) \ 553#define fc_host_work_q(x) \
@@ -452,14 +584,20 @@ struct fc_function_template {
452 void (*dev_loss_tmo_callbk)(struct fc_rport *); 584 void (*dev_loss_tmo_callbk)(struct fc_rport *);
453 void (*terminate_rport_io)(struct fc_rport *); 585 void (*terminate_rport_io)(struct fc_rport *);
454 586
587 void (*set_vport_symbolic_name)(struct fc_vport *);
588 int (*vport_create)(struct fc_vport *, bool);
589 int (*vport_disable)(struct fc_vport *, bool);
590 int (*vport_delete)(struct fc_vport *);
591
455 /* allocation lengths for host-specific data */ 592 /* allocation lengths for host-specific data */
456 u32 dd_fcrport_size; 593 u32 dd_fcrport_size;
594 u32 dd_fcvport_size;
457 595
458 /* 596 /*
459 * The driver sets these to tell the transport class it 597 * The driver sets these to tell the transport class it
460 * wants the attributes displayed in sysfs. If the show_ flag 598 * wants the attributes displayed in sysfs. If the show_ flag
461 * is not set, the attribute will be private to the transport 599 * is not set, the attribute will be private to the transport
462 * class 600 * class
463 */ 601 */
464 602
465 /* remote port fixed attributes */ 603 /* remote port fixed attributes */
@@ -512,7 +650,7 @@ fc_remote_port_chkready(struct fc_rport *rport)
512 650
513 switch (rport->port_state) { 651 switch (rport->port_state) {
514 case FC_PORTSTATE_ONLINE: 652 case FC_PORTSTATE_ONLINE:
515 if (rport->roles & FC_RPORT_ROLE_FCP_TARGET) 653 if (rport->roles & FC_PORT_ROLE_FCP_TARGET)
516 result = 0; 654 result = 0;
517 else if (rport->flags & FC_RPORT_DEVLOSS_PENDING) 655 else if (rport->flags & FC_RPORT_DEVLOSS_PENDING)
518 result = DID_IMM_RETRY << 16; 656 result = DID_IMM_RETRY << 16;
@@ -549,6 +687,27 @@ static inline void u64_to_wwn(u64 inm, u8 *wwn)
549 wwn[7] = inm & 0xff; 687 wwn[7] = inm & 0xff;
550} 688}
551 689
690/**
691 * fc_vport_set_state() - called to set a vport's state. Saves the old state,
692 * excepting the transitory states of initializing and sending the ELS
693 * traffic to instantiate the vport on the link.
694 *
695 * Assumes the driver has surrounded this with the proper locking to ensure
696 * a coherent state change.
697 *
698 * @vport: virtual port whose state is changing
699 * @new_state: new state
700 **/
701static inline void
702fc_vport_set_state(struct fc_vport *vport, enum fc_vport_state new_state)
703{
704 if ((new_state != FC_VPORT_UNKNOWN) &&
705 (new_state != FC_VPORT_INITIALIZING))
706 vport->vport_last_state = vport->vport_state;
707 vport->vport_state = new_state;
708}
709
710
552struct scsi_transport_template *fc_attach_transport( 711struct scsi_transport_template *fc_attach_transport(
553 struct fc_function_template *); 712 struct fc_function_template *);
554void fc_release_transport(struct scsi_transport_template *); 713void fc_release_transport(struct scsi_transport_template *);
@@ -567,5 +726,6 @@ void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number,
567 * be sure to read the Vendor Type and ID formatting requirements 726 * be sure to read the Vendor Type and ID formatting requirements
568 * specified in scsi_netlink.h 727 * specified in scsi_netlink.h
569 */ 728 */
729int fc_vport_terminate(struct fc_vport *vport);
570 730
571#endif /* SCSI_TRANSPORT_FC_H */ 731#endif /* SCSI_TRANSPORT_FC_H */
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index d5c218ddc527..706c0cd36c14 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -79,7 +79,8 @@ struct iscsi_transport {
79 char *name; 79 char *name;
80 unsigned int caps; 80 unsigned int caps;
81 /* LLD sets this to indicate what values it can export to sysfs */ 81 /* LLD sets this to indicate what values it can export to sysfs */
82 unsigned int param_mask; 82 uint64_t param_mask;
83 uint64_t host_param_mask;
83 struct scsi_host_template *host_template; 84 struct scsi_host_template *host_template;
84 /* LLD connection data size */ 85 /* LLD connection data size */
85 int conndata_size; 86 int conndata_size;
@@ -89,7 +90,8 @@ struct iscsi_transport {
89 unsigned int max_conn; 90 unsigned int max_conn;
90 unsigned int max_cmd_len; 91 unsigned int max_cmd_len;
91 struct iscsi_cls_session *(*create_session) (struct iscsi_transport *it, 92 struct iscsi_cls_session *(*create_session) (struct iscsi_transport *it,
92 struct scsi_transport_template *t, uint32_t sn, uint32_t *hn); 93 struct scsi_transport_template *t, uint16_t, uint16_t,
94 uint32_t sn, uint32_t *hn);
93 void (*destroy_session) (struct iscsi_cls_session *session); 95 void (*destroy_session) (struct iscsi_cls_session *session);
94 struct iscsi_cls_conn *(*create_conn) (struct iscsi_cls_session *sess, 96 struct iscsi_cls_conn *(*create_conn) (struct iscsi_cls_session *sess,
95 uint32_t cid); 97 uint32_t cid);
@@ -105,14 +107,18 @@ struct iscsi_transport {
105 enum iscsi_param param, char *buf); 107 enum iscsi_param param, char *buf);
106 int (*get_session_param) (struct iscsi_cls_session *session, 108 int (*get_session_param) (struct iscsi_cls_session *session,
107 enum iscsi_param param, char *buf); 109 enum iscsi_param param, char *buf);
110 int (*get_host_param) (struct Scsi_Host *shost,
111 enum iscsi_host_param param, char *buf);
112 int (*set_host_param) (struct Scsi_Host *shost,
113 enum iscsi_host_param param, char *buf,
114 int buflen);
108 int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, 115 int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
109 char *data, uint32_t data_size); 116 char *data, uint32_t data_size);
110 void (*get_stats) (struct iscsi_cls_conn *conn, 117 void (*get_stats) (struct iscsi_cls_conn *conn,
111 struct iscsi_stats *stats); 118 struct iscsi_stats *stats);
112 void (*init_cmd_task) (struct iscsi_cmd_task *ctask); 119 void (*init_cmd_task) (struct iscsi_cmd_task *ctask);
113 void (*init_mgmt_task) (struct iscsi_conn *conn, 120 void (*init_mgmt_task) (struct iscsi_conn *conn,
114 struct iscsi_mgmt_task *mtask, 121 struct iscsi_mgmt_task *mtask);
115 char *data, uint32_t data_size);
116 int (*xmit_cmd_task) (struct iscsi_conn *conn, 122 int (*xmit_cmd_task) (struct iscsi_conn *conn,
117 struct iscsi_cmd_task *ctask); 123 struct iscsi_cmd_task *ctask);
118 void (*cleanup_cmd_task) (struct iscsi_conn *conn, 124 void (*cleanup_cmd_task) (struct iscsi_conn *conn,
@@ -124,7 +130,7 @@ struct iscsi_transport {
124 uint64_t *ep_handle); 130 uint64_t *ep_handle);
125 int (*ep_poll) (uint64_t ep_handle, int timeout_ms); 131 int (*ep_poll) (uint64_t ep_handle, int timeout_ms);
126 void (*ep_disconnect) (uint64_t ep_handle); 132 void (*ep_disconnect) (uint64_t ep_handle);
127 int (*tgt_dscvr) (enum iscsi_tgt_dscvr type, uint32_t host_no, 133 int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type,
128 uint32_t enable, struct sockaddr *dst_addr); 134 uint32_t enable, struct sockaddr *dst_addr);
129}; 135};
130 136
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h
index aa49dda4f410..fd0a6c46f497 100644
--- a/include/sound/ak4xxx-adda.h
+++ b/include/sound/ak4xxx-adda.h
@@ -43,6 +43,7 @@ struct snd_ak4xxx_ops {
43struct snd_akm4xxx_dac_channel { 43struct snd_akm4xxx_dac_channel {
44 char *name; /* mixer volume name */ 44 char *name; /* mixer volume name */
45 unsigned int num_channels; 45 unsigned int num_channels;
46 char *switch_name; /* mixer switch*/
46}; 47};
47 48
48/* ADC labels and channels */ 49/* ADC labels and channels */
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
index 685928e6f65a..353910ce9755 100644
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -1723,6 +1723,10 @@ struct snd_cs46xx {
1723 struct snd_cs46xx_pcm *playback_pcm; 1723 struct snd_cs46xx_pcm *playback_pcm;
1724 unsigned int play_ctl; 1724 unsigned int play_ctl;
1725#endif 1725#endif
1726
1727#ifdef CONFIG_PM
1728 u32 *saved_regs;
1729#endif
1726}; 1730};
1727 1731
1728int snd_cs46xx_create(struct snd_card *card, 1732int snd_cs46xx_create(struct snd_card *card,
diff --git a/include/sound/cs46xx_dsp_spos.h b/include/sound/cs46xx_dsp_spos.h
index da934def31e9..d9da9e59cf37 100644
--- a/include/sound/cs46xx_dsp_spos.h
+++ b/include/sound/cs46xx_dsp_spos.h
@@ -107,6 +107,7 @@ struct dsp_scb_descriptor {
107 char scb_name[DSP_MAX_SCB_NAME]; 107 char scb_name[DSP_MAX_SCB_NAME];
108 u32 address; 108 u32 address;
109 int index; 109 int index;
110 u32 *data;
110 111
111 struct dsp_scb_descriptor * sub_list_ptr; 112 struct dsp_scb_descriptor * sub_list_ptr;
112 struct dsp_scb_descriptor * next_scb_ptr; 113 struct dsp_scb_descriptor * next_scb_ptr;
@@ -127,6 +128,7 @@ struct dsp_task_descriptor {
127 int size; 128 int size;
128 u32 address; 129 u32 address;
129 int index; 130 int index;
131 u32 *data;
130}; 132};
131 133
132struct dsp_pcm_channel_descriptor { 134struct dsp_pcm_channel_descriptor {
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 23e45a4cf0e4..529d0a564367 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -1120,6 +1120,16 @@
1120/************************************************************************************************/ 1120/************************************************************************************************/
1121/* EMU1010m HANA Destinations */ 1121/* EMU1010m HANA Destinations */
1122/************************************************************************************************/ 1122/************************************************************************************************/
1123/* 32-bit destinations of signal in the Hana FPGA. Destinations are either
1124 * physical outputs of Hana, or outputs going to Alice2 (audigy) for capture
1125 * - 16 x EMU_DST_ALICE2_EMU32_X.
1126 */
1127/* EMU32 = 32-bit serial channel between Alice2 (audigy) and Hana (FPGA) */
1128/* EMU_DST_ALICE2_EMU32_X - data channels from Hana to Alice2 used for capture.
1129 * Which data is fed into a EMU_DST_ALICE2_EMU32_X channel in Hana depends on
1130 * setup of mixer control for each destination - see emumixer.c -
1131 * snd_emu1010_output_enum_ctls[], snd_emu1010_input_enum_ctls[]
1132 */
1123#define EMU_DST_ALICE2_EMU32_0 0x000f /* 16 EMU32 channels to Alice2 +0 to +0xf */ 1133#define EMU_DST_ALICE2_EMU32_0 0x000f /* 16 EMU32 channels to Alice2 +0 to +0xf */
1124#define EMU_DST_ALICE2_EMU32_1 0x0000 /* 16 EMU32 channels to Alice2 +0 to +0xf */ 1134#define EMU_DST_ALICE2_EMU32_1 0x0000 /* 16 EMU32 channels to Alice2 +0 to +0xf */
1125#define EMU_DST_ALICE2_EMU32_2 0x0001 /* 16 EMU32 channels to Alice2 +0 to +0xf */ 1135#define EMU_DST_ALICE2_EMU32_2 0x0001 /* 16 EMU32 channels to Alice2 +0 to +0xf */
@@ -1199,6 +1209,12 @@
1199/************************************************************************************************/ 1209/************************************************************************************************/
1200/* EMU1010m HANA Sources */ 1210/* EMU1010m HANA Sources */
1201/************************************************************************************************/ 1211/************************************************************************************************/
1212/* 32-bit sources of signal in the Hana FPGA. The sources are routed to
1213 * destinations using mixer control for each destination - see emumixer.c
1214 * Sources are either physical inputs of FPGA,
1215 * or outputs from Alice (audigy) - 16 x EMU_SRC_ALICE_EMU32A +
1216 * 16 x EMU_SRC_ALICE_EMU32B
1217 */
1202#define EMU_SRC_SILENCE 0x0000 /* Silence */ 1218#define EMU_SRC_SILENCE 0x0000 /* Silence */
1203#define EMU_SRC_DOCK_MIC_A1 0x0100 /* Audio Dock Mic A, 1st or 48kHz only */ 1219#define EMU_SRC_DOCK_MIC_A1 0x0100 /* Audio Dock Mic A, 1st or 48kHz only */
1204#define EMU_SRC_DOCK_MIC_A2 0x0101 /* Audio Dock Mic A, 2nd or 96kHz */ 1220#define EMU_SRC_DOCK_MIC_A2 0x0101 /* Audio Dock Mic A, 2nd or 96kHz */
diff --git a/include/sound/sb.h b/include/sound/sb.h
index 2dd5c8e5b4fe..3ad854b397d2 100644
--- a/include/sound/sb.h
+++ b/include/sound/sb.h
@@ -38,6 +38,7 @@ enum sb_hw_type {
38 SB_HW_ALS100, /* Avance Logic ALS100 chip */ 38 SB_HW_ALS100, /* Avance Logic ALS100 chip */
39 SB_HW_ALS4000, /* Avance Logic ALS4000 chip */ 39 SB_HW_ALS4000, /* Avance Logic ALS4000 chip */
40 SB_HW_DT019X, /* Diamond Tech. DT-019X / Avance Logic ALS-007 */ 40 SB_HW_DT019X, /* Diamond Tech. DT-019X / Avance Logic ALS-007 */
41 SB_HW_CS5530, /* Cyrix/NatSemi 5530 VSA1 */
41}; 42};
42 43
43#define SB_OPEN_PCM 0x01 44#define SB_OPEN_PCM 0x01
diff --git a/include/sound/version.h b/include/sound/version.h
index 8e5b2f0f5946..6bbcfefd2c38 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h. Generated by alsa/ksync script. */ 1/* include/version.h. Generated by alsa/ksync script. */
2#define CONFIG_SND_VERSION "1.0.14" 2#define CONFIG_SND_VERSION "1.0.14"
3#define CONFIG_SND_DATE " (Thu May 31 09:03:25 2007 UTC)" 3#define CONFIG_SND_DATE " (Fri Jul 20 09:12:58 2007 UTC)"
diff --git a/include/sound/wavefront_fx.h b/include/sound/wavefront_fx.h
deleted file mode 100644
index cec92b141796..000000000000
--- a/include/sound/wavefront_fx.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef __SOUND_WAVEFRONT_FX_H
2#define __SOUND_WAVEFRONT_FX_H
3
4extern int snd_wavefront_fx_detect (snd_wavefront_t *);
5extern void snd_wavefront_fx_ioctl (snd_synth_t *sdev,
6 unsigned int cmd,
7 unsigned long arg);
8
9#endif __SOUND_WAVEFRONT_FX_H
diff --git a/include/video/tgafb.h b/include/video/tgafb.h
index 03d0dbe293a8..7bc5e2c14826 100644
--- a/include/video/tgafb.h
+++ b/include/video/tgafb.h
@@ -216,6 +216,7 @@ struct tga_par {
216 u32 pll_freq; /* pixclock in mhz */ 216 u32 pll_freq; /* pixclock in mhz */
217 u32 bits_per_pixel; /* bits per pixel */ 217 u32 bits_per_pixel; /* bits per pixel */
218 u32 sync_on_green; /* set if sync is on green */ 218 u32 sync_on_green; /* set if sync is on green */
219 u32 palette[16];
219}; 220};
220 221
221 222
diff --git a/include/xen/events.h b/include/xen/events.h
new file mode 100644
index 000000000000..2bde54d29be5
--- /dev/null
+++ b/include/xen/events.h
@@ -0,0 +1,48 @@
1#ifndef _XEN_EVENTS_H
2#define _XEN_EVENTS_H
3
4#include <linux/interrupt.h>
5
6#include <xen/interface/event_channel.h>
7#include <asm/xen/hypercall.h>
8
9enum ipi_vector {
10 XEN_RESCHEDULE_VECTOR,
11 XEN_CALL_FUNCTION_VECTOR,
12
13 XEN_NR_IPIS,
14};
15
16int bind_evtchn_to_irq(unsigned int evtchn);
17int bind_evtchn_to_irqhandler(unsigned int evtchn,
18 irq_handler_t handler,
19 unsigned long irqflags, const char *devname,
20 void *dev_id);
21int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
22 irq_handler_t handler,
23 unsigned long irqflags, const char *devname,
24 void *dev_id);
25int bind_ipi_to_irqhandler(enum ipi_vector ipi,
26 unsigned int cpu,
27 irq_handler_t handler,
28 unsigned long irqflags,
29 const char *devname,
30 void *dev_id);
31
32/*
33 * Common unbind function for all event sources. Takes IRQ to unbind from.
34 * Automatically closes the underlying event channel (even for bindings
35 * made with bind_evtchn_to_irqhandler()).
36 */
37void unbind_from_irqhandler(unsigned int irq, void *dev_id);
38
39void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector);
40
41static inline void notify_remote_via_evtchn(int port)
42{
43 struct evtchn_send send = { .port = port };
44 (void)HYPERVISOR_event_channel_op(EVTCHNOP_send, &send);
45}
46
47extern void notify_remote_via_irq(int irq);
48#endif /* _XEN_EVENTS_H */
diff --git a/include/xen/features.h b/include/xen/features.h
new file mode 100644
index 000000000000..27292d4d2a6a
--- /dev/null
+++ b/include/xen/features.h
@@ -0,0 +1,23 @@
1/******************************************************************************
2 * features.h
3 *
4 * Query the features reported by Xen.
5 *
6 * Copyright (c) 2006, Ian Campbell
7 */
8
9#ifndef __XEN_FEATURES_H__
10#define __XEN_FEATURES_H__
11
12#include <xen/interface/features.h>
13
14void xen_setup_features(void);
15
16extern u8 xen_features[XENFEAT_NR_SUBMAPS * 32];
17
18static inline int xen_feature(int flag)
19{
20 return xen_features[flag];
21}
22
23#endif /* __ASM_XEN_FEATURES_H__ */
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
new file mode 100644
index 000000000000..761c83498e03
--- /dev/null
+++ b/include/xen/grant_table.h
@@ -0,0 +1,107 @@
1/******************************************************************************
2 * grant_table.h
3 *
4 * Two sets of functionality:
5 * 1. Granting foreign access to our memory reservation.
6 * 2. Accessing others' memory reservations via grant references.
7 * (i.e., mechanisms for both sender and recipient of grant references)
8 *
9 * Copyright (c) 2004-2005, K A Fraser
10 * Copyright (c) 2005, Christopher Clark
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License version 2
14 * as published by the Free Software Foundation; or, when distributed
15 * separately from the Linux kernel or incorporated into other
16 * software packages, subject to the following license:
17 *
18 * Permission is hereby granted, free of charge, to any person obtaining a copy
19 * of this source file (the "Software"), to deal in the Software without
20 * restriction, including without limitation the rights to use, copy, modify,
21 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
22 * and to permit persons to whom the Software is furnished to do so, subject to
23 * the following conditions:
24 *
25 * The above copyright notice and this permission notice shall be included in
26 * all copies or substantial portions of the Software.
27 *
28 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
33 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
34 * IN THE SOFTWARE.
35 */
36
37#ifndef __ASM_GNTTAB_H__
38#define __ASM_GNTTAB_H__
39
40#include <asm/xen/hypervisor.h>
41#include <xen/interface/grant_table.h>
42
43/* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */
44#define NR_GRANT_FRAMES 4
45
46struct gnttab_free_callback {
47 struct gnttab_free_callback *next;
48 void (*fn)(void *);
49 void *arg;
50 u16 count;
51};
52
53int gnttab_grant_foreign_access(domid_t domid, unsigned long frame,
54 int readonly);
55
56/*
57 * End access through the given grant reference, iff the grant entry is no
58 * longer in use. Return 1 if the grant entry was freed, 0 if it is still in
59 * use.
60 */
61int gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly);
62
63/*
64 * Eventually end access through the given grant reference, and once that
65 * access has been ended, free the given page too. Access will be ended
66 * immediately iff the grant entry is not in use, otherwise it will happen
67 * some time later. page may be 0, in which case no freeing will occur.
68 */
69void gnttab_end_foreign_access(grant_ref_t ref, int readonly,
70 unsigned long page);
71
72int gnttab_grant_foreign_transfer(domid_t domid, unsigned long pfn);
73
74unsigned long gnttab_end_foreign_transfer_ref(grant_ref_t ref);
75unsigned long gnttab_end_foreign_transfer(grant_ref_t ref);
76
77int gnttab_query_foreign_access(grant_ref_t ref);
78
79/*
80 * operations on reserved batches of grant references
81 */
82int gnttab_alloc_grant_references(u16 count, grant_ref_t *pprivate_head);
83
84void gnttab_free_grant_reference(grant_ref_t ref);
85
86void gnttab_free_grant_references(grant_ref_t head);
87
88int gnttab_empty_grant_references(const grant_ref_t *pprivate_head);
89
90int gnttab_claim_grant_reference(grant_ref_t *pprivate_head);
91
92void gnttab_release_grant_reference(grant_ref_t *private_head,
93 grant_ref_t release);
94
95void gnttab_request_free_callback(struct gnttab_free_callback *callback,
96 void (*fn)(void *), void *arg, u16 count);
97void gnttab_cancel_free_callback(struct gnttab_free_callback *callback);
98
99void gnttab_grant_foreign_access_ref(grant_ref_t ref, domid_t domid,
100 unsigned long frame, int readonly);
101
102void gnttab_grant_foreign_transfer_ref(grant_ref_t, domid_t domid,
103 unsigned long pfn);
104
105#define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr))
106
107#endif /* __ASM_GNTTAB_H__ */
diff --git a/include/xen/hvc-console.h b/include/xen/hvc-console.h
new file mode 100644
index 000000000000..21c0ecfd786d
--- /dev/null
+++ b/include/xen/hvc-console.h
@@ -0,0 +1,6 @@
1#ifndef XEN_HVC_CONSOLE_H
2#define XEN_HVC_CONSOLE_H
3
4extern struct console xenboot_console;
5
6#endif /* XEN_HVC_CONSOLE_H */
diff --git a/include/xen/interface/elfnote.h b/include/xen/interface/elfnote.h
new file mode 100644
index 000000000000..a64d3df5bd95
--- /dev/null
+++ b/include/xen/interface/elfnote.h
@@ -0,0 +1,133 @@
1/******************************************************************************
2 * elfnote.h
3 *
4 * Definitions used for the Xen ELF notes.
5 *
6 * Copyright (c) 2006, Ian Campbell, XenSource Ltd.
7 */
8
9#ifndef __XEN_PUBLIC_ELFNOTE_H__
10#define __XEN_PUBLIC_ELFNOTE_H__
11
12/*
13 * The notes should live in a SHT_NOTE segment and have "Xen" in the
14 * name field.
15 *
16 * Numeric types are either 4 or 8 bytes depending on the content of
17 * the desc field.
18 *
19 * LEGACY indicated the fields in the legacy __xen_guest string which
20 * this a note type replaces.
21 */
22
23/*
24 * NAME=VALUE pair (string).
25 *
26 * LEGACY: FEATURES and PAE
27 */
28#define XEN_ELFNOTE_INFO 0
29
30/*
31 * The virtual address of the entry point (numeric).
32 *
33 * LEGACY: VIRT_ENTRY
34 */
35#define XEN_ELFNOTE_ENTRY 1
36
37/* The virtual address of the hypercall transfer page (numeric).
38 *
39 * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page
40 * number not a virtual address)
41 */
42#define XEN_ELFNOTE_HYPERCALL_PAGE 2
43
44/* The virtual address where the kernel image should be mapped (numeric).
45 *
46 * Defaults to 0.
47 *
48 * LEGACY: VIRT_BASE
49 */
50#define XEN_ELFNOTE_VIRT_BASE 3
51
52/*
53 * The offset of the ELF paddr field from the acutal required
54 * psuedo-physical address (numeric).
55 *
56 * This is used to maintain backwards compatibility with older kernels
57 * which wrote __PAGE_OFFSET into that field. This field defaults to 0
58 * if not present.
59 *
60 * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE)
61 */
62#define XEN_ELFNOTE_PADDR_OFFSET 4
63
64/*
65 * The version of Xen that we work with (string).
66 *
67 * LEGACY: XEN_VER
68 */
69#define XEN_ELFNOTE_XEN_VERSION 5
70
71/*
72 * The name of the guest operating system (string).
73 *
74 * LEGACY: GUEST_OS
75 */
76#define XEN_ELFNOTE_GUEST_OS 6
77
78/*
79 * The version of the guest operating system (string).
80 *
81 * LEGACY: GUEST_VER
82 */
83#define XEN_ELFNOTE_GUEST_VERSION 7
84
85/*
86 * The loader type (string).
87 *
88 * LEGACY: LOADER
89 */
90#define XEN_ELFNOTE_LOADER 8
91
92/*
93 * The kernel supports PAE (x86/32 only, string = "yes" or "no").
94 *
95 * LEGACY: PAE (n.b. The legacy interface included a provision to
96 * indicate 'extended-cr3' support allowing L3 page tables to be
97 * placed above 4G. It is assumed that any kernel new enough to use
98 * these ELF notes will include this and therefore "yes" here is
99 * equivalent to "yes[entended-cr3]" in the __xen_guest interface.
100 */
101#define XEN_ELFNOTE_PAE_MODE 9
102
103/*
104 * The features supported/required by this kernel (string).
105 *
106 * The string must consist of a list of feature names (as given in
107 * features.h, without the "XENFEAT_" prefix) separated by '|'
108 * characters. If a feature is required for the kernel to function
109 * then the feature name must be preceded by a '!' character.
110 *
111 * LEGACY: FEATURES
112 */
113#define XEN_ELFNOTE_FEATURES 10
114
115/*
116 * The kernel requires the symbol table to be loaded (string = "yes" or "no")
117 * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence
118 * of this string as a boolean flag rather than requiring "yes" or
119 * "no".
120 */
121#define XEN_ELFNOTE_BSD_SYMTAB 11
122
123#endif /* __XEN_PUBLIC_ELFNOTE_H__ */
124
125/*
126 * Local variables:
127 * mode: C
128 * c-set-style: "BSD"
129 * c-basic-offset: 4
130 * tab-width: 4
131 * indent-tabs-mode: nil
132 * End:
133 */
diff --git a/include/xen/interface/event_channel.h b/include/xen/interface/event_channel.h
new file mode 100644
index 000000000000..919b5bdcb2bd
--- /dev/null
+++ b/include/xen/interface/event_channel.h
@@ -0,0 +1,195 @@
1/******************************************************************************
2 * event_channel.h
3 *
4 * Event channels between domains.
5 *
6 * Copyright (c) 2003-2004, K A Fraser.
7 */
8
9#ifndef __XEN_PUBLIC_EVENT_CHANNEL_H__
10#define __XEN_PUBLIC_EVENT_CHANNEL_H__
11
12typedef uint32_t evtchn_port_t;
13DEFINE_GUEST_HANDLE(evtchn_port_t);
14
15/*
16 * EVTCHNOP_alloc_unbound: Allocate a port in domain <dom> and mark as
17 * accepting interdomain bindings from domain <remote_dom>. A fresh port
18 * is allocated in <dom> and returned as <port>.
19 * NOTES:
20 * 1. If the caller is unprivileged then <dom> must be DOMID_SELF.
21 * 2. <rdom> may be DOMID_SELF, allowing loopback connections.
22 */
23#define EVTCHNOP_alloc_unbound 6
24struct evtchn_alloc_unbound {
25 /* IN parameters */
26 domid_t dom, remote_dom;
27 /* OUT parameters */
28 evtchn_port_t port;
29};
30
31/*
32 * EVTCHNOP_bind_interdomain: Construct an interdomain event channel between
33 * the calling domain and <remote_dom>. <remote_dom,remote_port> must identify
34 * a port that is unbound and marked as accepting bindings from the calling
35 * domain. A fresh port is allocated in the calling domain and returned as
36 * <local_port>.
37 * NOTES:
38 * 2. <remote_dom> may be DOMID_SELF, allowing loopback connections.
39 */
40#define EVTCHNOP_bind_interdomain 0
41struct evtchn_bind_interdomain {
42 /* IN parameters. */
43 domid_t remote_dom;
44 evtchn_port_t remote_port;
45 /* OUT parameters. */
46 evtchn_port_t local_port;
47};
48
49/*
50 * EVTCHNOP_bind_virq: Bind a local event channel to VIRQ <irq> on specified
51 * vcpu.
52 * NOTES:
53 * 1. A virtual IRQ may be bound to at most one event channel per vcpu.
54 * 2. The allocated event channel is bound to the specified vcpu. The binding
55 * may not be changed.
56 */
57#define EVTCHNOP_bind_virq 1
58struct evtchn_bind_virq {
59 /* IN parameters. */
60 uint32_t virq;
61 uint32_t vcpu;
62 /* OUT parameters. */
63 evtchn_port_t port;
64};
65
66/*
67 * EVTCHNOP_bind_pirq: Bind a local event channel to PIRQ <irq>.
68 * NOTES:
69 * 1. A physical IRQ may be bound to at most one event channel per domain.
70 * 2. Only a sufficiently-privileged domain may bind to a physical IRQ.
71 */
72#define EVTCHNOP_bind_pirq 2
73struct evtchn_bind_pirq {
74 /* IN parameters. */
75 uint32_t pirq;
76#define BIND_PIRQ__WILL_SHARE 1
77 uint32_t flags; /* BIND_PIRQ__* */
78 /* OUT parameters. */
79 evtchn_port_t port;
80};
81
82/*
83 * EVTCHNOP_bind_ipi: Bind a local event channel to receive events.
84 * NOTES:
85 * 1. The allocated event channel is bound to the specified vcpu. The binding
86 * may not be changed.
87 */
88#define EVTCHNOP_bind_ipi 7
89struct evtchn_bind_ipi {
90 uint32_t vcpu;
91 /* OUT parameters. */
92 evtchn_port_t port;
93};
94
95/*
96 * EVTCHNOP_close: Close a local event channel <port>. If the channel is
97 * interdomain then the remote end is placed in the unbound state
98 * (EVTCHNSTAT_unbound), awaiting a new connection.
99 */
100#define EVTCHNOP_close 3
101struct evtchn_close {
102 /* IN parameters. */
103 evtchn_port_t port;
104};
105
106/*
107 * EVTCHNOP_send: Send an event to the remote end of the channel whose local
108 * endpoint is <port>.
109 */
110#define EVTCHNOP_send 4
111struct evtchn_send {
112 /* IN parameters. */
113 evtchn_port_t port;
114};
115
116/*
117 * EVTCHNOP_status: Get the current status of the communication channel which
118 * has an endpoint at <dom, port>.
119 * NOTES:
120 * 1. <dom> may be specified as DOMID_SELF.
121 * 2. Only a sufficiently-privileged domain may obtain the status of an event
122 * channel for which <dom> is not DOMID_SELF.
123 */
124#define EVTCHNOP_status 5
125struct evtchn_status {
126 /* IN parameters */
127 domid_t dom;
128 evtchn_port_t port;
129 /* OUT parameters */
130#define EVTCHNSTAT_closed 0 /* Channel is not in use. */
131#define EVTCHNSTAT_unbound 1 /* Channel is waiting interdom connection.*/
132#define EVTCHNSTAT_interdomain 2 /* Channel is connected to remote domain. */
133#define EVTCHNSTAT_pirq 3 /* Channel is bound to a phys IRQ line. */
134#define EVTCHNSTAT_virq 4 /* Channel is bound to a virtual IRQ line */
135#define EVTCHNSTAT_ipi 5 /* Channel is bound to a virtual IPI line */
136 uint32_t status;
137 uint32_t vcpu; /* VCPU to which this channel is bound. */
138 union {
139 struct {
140 domid_t dom;
141 } unbound; /* EVTCHNSTAT_unbound */
142 struct {
143 domid_t dom;
144 evtchn_port_t port;
145 } interdomain; /* EVTCHNSTAT_interdomain */
146 uint32_t pirq; /* EVTCHNSTAT_pirq */
147 uint32_t virq; /* EVTCHNSTAT_virq */
148 } u;
149};
150
151/*
152 * EVTCHNOP_bind_vcpu: Specify which vcpu a channel should notify when an
153 * event is pending.
154 * NOTES:
155 * 1. IPI- and VIRQ-bound channels always notify the vcpu that initialised
156 * the binding. This binding cannot be changed.
157 * 2. All other channels notify vcpu0 by default. This default is set when
158 * the channel is allocated (a port that is freed and subsequently reused
159 * has its binding reset to vcpu0).
160 */
161#define EVTCHNOP_bind_vcpu 8
162struct evtchn_bind_vcpu {
163 /* IN parameters. */
164 evtchn_port_t port;
165 uint32_t vcpu;
166};
167
168/*
169 * EVTCHNOP_unmask: Unmask the specified local event-channel port and deliver
170 * a notification to the appropriate VCPU if an event is pending.
171 */
172#define EVTCHNOP_unmask 9
173struct evtchn_unmask {
174 /* IN parameters. */
175 evtchn_port_t port;
176};
177
178struct evtchn_op {
179 uint32_t cmd; /* EVTCHNOP_* */
180 union {
181 struct evtchn_alloc_unbound alloc_unbound;
182 struct evtchn_bind_interdomain bind_interdomain;
183 struct evtchn_bind_virq bind_virq;
184 struct evtchn_bind_pirq bind_pirq;
185 struct evtchn_bind_ipi bind_ipi;
186 struct evtchn_close close;
187 struct evtchn_send send;
188 struct evtchn_status status;
189 struct evtchn_bind_vcpu bind_vcpu;
190 struct evtchn_unmask unmask;
191 } u;
192};
193DEFINE_GUEST_HANDLE_STRUCT(evtchn_op);
194
195#endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h
new file mode 100644
index 000000000000..d73228d16488
--- /dev/null
+++ b/include/xen/interface/features.h
@@ -0,0 +1,43 @@
1/******************************************************************************
2 * features.h
3 *
4 * Feature flags, reported by XENVER_get_features.
5 *
6 * Copyright (c) 2006, Keir Fraser <keir@xensource.com>
7 */
8
9#ifndef __XEN_PUBLIC_FEATURES_H__
10#define __XEN_PUBLIC_FEATURES_H__
11
12/*
13 * If set, the guest does not need to write-protect its pagetables, and can
14 * update them via direct writes.
15 */
16#define XENFEAT_writable_page_tables 0
17
18/*
19 * If set, the guest does not need to write-protect its segment descriptor
20 * tables, and can update them via direct writes.
21 */
22#define XENFEAT_writable_descriptor_tables 1
23
24/*
25 * If set, translation between the guest's 'pseudo-physical' address space
26 * and the host's machine address space are handled by the hypervisor. In this
27 * mode the guest does not need to perform phys-to/from-machine translations
28 * when performing page table operations.
29 */
30#define XENFEAT_auto_translated_physmap 2
31
32/* If set, the guest is running in supervisor mode (e.g., x86 ring 0). */
33#define XENFEAT_supervisor_mode_kernel 3
34
35/*
36 * If set, the guest does not need to allocate x86 PAE page directories
37 * below 4GB. This flag is usually implied by auto_translated_physmap.
38 */
39#define XENFEAT_pae_pgdir_above_4gb 4
40
41#define XENFEAT_NR_SUBMAPS 1
42
43#endif /* __XEN_PUBLIC_FEATURES_H__ */
diff --git a/include/xen/interface/grant_table.h b/include/xen/interface/grant_table.h
new file mode 100644
index 000000000000..219049802cf2
--- /dev/null
+++ b/include/xen/interface/grant_table.h
@@ -0,0 +1,375 @@
1/******************************************************************************
2 * grant_table.h
3 *
4 * Interface for granting foreign access to page frames, and receiving
5 * page-ownership transfers.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to
9 * deal in the Software without restriction, including without limitation the
10 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
24 *
25 * Copyright (c) 2004, K A Fraser
26 */
27
28#ifndef __XEN_PUBLIC_GRANT_TABLE_H__
29#define __XEN_PUBLIC_GRANT_TABLE_H__
30
31
32/***********************************
33 * GRANT TABLE REPRESENTATION
34 */
35
36/* Some rough guidelines on accessing and updating grant-table entries
37 * in a concurrency-safe manner. For more information, Linux contains a
38 * reference implementation for guest OSes (arch/xen/kernel/grant_table.c).
39 *
40 * NB. WMB is a no-op on current-generation x86 processors. However, a
41 * compiler barrier will still be required.
42 *
43 * Introducing a valid entry into the grant table:
44 * 1. Write ent->domid.
45 * 2. Write ent->frame:
46 * GTF_permit_access: Frame to which access is permitted.
47 * GTF_accept_transfer: Pseudo-phys frame slot being filled by new
48 * frame, or zero if none.
49 * 3. Write memory barrier (WMB).
50 * 4. Write ent->flags, inc. valid type.
51 *
52 * Invalidating an unused GTF_permit_access entry:
53 * 1. flags = ent->flags.
54 * 2. Observe that !(flags & (GTF_reading|GTF_writing)).
55 * 3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
56 * NB. No need for WMB as reuse of entry is control-dependent on success of
57 * step 3, and all architectures guarantee ordering of ctrl-dep writes.
58 *
59 * Invalidating an in-use GTF_permit_access entry:
60 * This cannot be done directly. Request assistance from the domain controller
61 * which can set a timeout on the use of a grant entry and take necessary
62 * action. (NB. This is not yet implemented!).
63 *
64 * Invalidating an unused GTF_accept_transfer entry:
65 * 1. flags = ent->flags.
66 * 2. Observe that !(flags & GTF_transfer_committed). [*]
67 * 3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
68 * NB. No need for WMB as reuse of entry is control-dependent on success of
69 * step 3, and all architectures guarantee ordering of ctrl-dep writes.
70 * [*] If GTF_transfer_committed is set then the grant entry is 'committed'.
71 * The guest must /not/ modify the grant entry until the address of the
72 * transferred frame is written. It is safe for the guest to spin waiting
73 * for this to occur (detect by observing GTF_transfer_completed in
74 * ent->flags).
75 *
76 * Invalidating a committed GTF_accept_transfer entry:
77 * 1. Wait for (ent->flags & GTF_transfer_completed).
78 *
79 * Changing a GTF_permit_access from writable to read-only:
80 * Use SMP-safe CMPXCHG to set GTF_readonly, while checking !GTF_writing.
81 *
82 * Changing a GTF_permit_access from read-only to writable:
83 * Use SMP-safe bit-setting instruction.
84 */
85
86/*
87 * A grant table comprises a packed array of grant entries in one or more
88 * page frames shared between Xen and a guest.
89 * [XEN]: This field is written by Xen and read by the sharing guest.
90 * [GST]: This field is written by the guest and read by Xen.
91 */
92struct grant_entry {
93 /* GTF_xxx: various type and flag information. [XEN,GST] */
94 uint16_t flags;
95 /* The domain being granted foreign privileges. [GST] */
96 domid_t domid;
97 /*
98 * GTF_permit_access: Frame that @domid is allowed to map and access. [GST]
99 * GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN]
100 */
101 uint32_t frame;
102};
103
104/*
105 * Type of grant entry.
106 * GTF_invalid: This grant entry grants no privileges.
107 * GTF_permit_access: Allow @domid to map/access @frame.
108 * GTF_accept_transfer: Allow @domid to transfer ownership of one page frame
109 * to this guest. Xen writes the page number to @frame.
110 */
111#define GTF_invalid (0U<<0)
112#define GTF_permit_access (1U<<0)
113#define GTF_accept_transfer (2U<<0)
114#define GTF_type_mask (3U<<0)
115
116/*
117 * Subflags for GTF_permit_access.
118 * GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
119 * GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
120 * GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
121 */
122#define _GTF_readonly (2)
123#define GTF_readonly (1U<<_GTF_readonly)
124#define _GTF_reading (3)
125#define GTF_reading (1U<<_GTF_reading)
126#define _GTF_writing (4)
127#define GTF_writing (1U<<_GTF_writing)
128
129/*
130 * Subflags for GTF_accept_transfer:
131 * GTF_transfer_committed: Xen sets this flag to indicate that it is committed
132 * to transferring ownership of a page frame. When a guest sees this flag
133 * it must /not/ modify the grant entry until GTF_transfer_completed is
134 * set by Xen.
135 * GTF_transfer_completed: It is safe for the guest to spin-wait on this flag
136 * after reading GTF_transfer_committed. Xen will always write the frame
137 * address, followed by ORing this flag, in a timely manner.
138 */
139#define _GTF_transfer_committed (2)
140#define GTF_transfer_committed (1U<<_GTF_transfer_committed)
141#define _GTF_transfer_completed (3)
142#define GTF_transfer_completed (1U<<_GTF_transfer_completed)
143
144
145/***********************************
146 * GRANT TABLE QUERIES AND USES
147 */
148
149/*
150 * Reference to a grant entry in a specified domain's grant table.
151 */
152typedef uint32_t grant_ref_t;
153
154/*
155 * Handle to track a mapping created via a grant reference.
156 */
157typedef uint32_t grant_handle_t;
158
159/*
160 * GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
161 * by devices and/or host CPUs. If successful, <handle> is a tracking number
162 * that must be presented later to destroy the mapping(s). On error, <handle>
163 * is a negative status code.
164 * NOTES:
165 * 1. If GNTMAP_device_map is specified then <dev_bus_addr> is the address
166 * via which I/O devices may access the granted frame.
167 * 2. If GNTMAP_host_map is specified then a mapping will be added at
168 * either a host virtual address in the current address space, or at
169 * a PTE at the specified machine address. The type of mapping to
170 * perform is selected through the GNTMAP_contains_pte flag, and the
171 * address is specified in <host_addr>.
172 * 3. Mappings should only be destroyed via GNTTABOP_unmap_grant_ref. If a
173 * host mapping is destroyed by other means then it is *NOT* guaranteed
174 * to be accounted to the correct grant reference!
175 */
176#define GNTTABOP_map_grant_ref 0
177struct gnttab_map_grant_ref {
178 /* IN parameters. */
179 uint64_t host_addr;
180 uint32_t flags; /* GNTMAP_* */
181 grant_ref_t ref;
182 domid_t dom;
183 /* OUT parameters. */
184 int16_t status; /* GNTST_* */
185 grant_handle_t handle;
186 uint64_t dev_bus_addr;
187};
188
189/*
190 * GNTTABOP_unmap_grant_ref: Destroy one or more grant-reference mappings
191 * tracked by <handle>. If <host_addr> or <dev_bus_addr> is zero, that
192 * field is ignored. If non-zero, they must refer to a device/host mapping
193 * that is tracked by <handle>
194 * NOTES:
195 * 1. The call may fail in an undefined manner if either mapping is not
196 * tracked by <handle>.
197 * 3. After executing a batch of unmaps, it is guaranteed that no stale
198 * mappings will remain in the device or host TLBs.
199 */
200#define GNTTABOP_unmap_grant_ref 1
201struct gnttab_unmap_grant_ref {
202 /* IN parameters. */
203 uint64_t host_addr;
204 uint64_t dev_bus_addr;
205 grant_handle_t handle;
206 /* OUT parameters. */
207 int16_t status; /* GNTST_* */
208};
209
210/*
211 * GNTTABOP_setup_table: Set up a grant table for <dom> comprising at least
212 * <nr_frames> pages. The frame addresses are written to the <frame_list>.
213 * Only <nr_frames> addresses are written, even if the table is larger.
214 * NOTES:
215 * 1. <dom> may be specified as DOMID_SELF.
216 * 2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
217 * 3. Xen may not support more than a single grant-table page per domain.
218 */
219#define GNTTABOP_setup_table 2
220struct gnttab_setup_table {
221 /* IN parameters. */
222 domid_t dom;
223 uint32_t nr_frames;
224 /* OUT parameters. */
225 int16_t status; /* GNTST_* */
226 ulong *frame_list;
227};
228
229/*
230 * GNTTABOP_dump_table: Dump the contents of the grant table to the
231 * xen console. Debugging use only.
232 */
233#define GNTTABOP_dump_table 3
234struct gnttab_dump_table {
235 /* IN parameters. */
236 domid_t dom;
237 /* OUT parameters. */
238 int16_t status; /* GNTST_* */
239};
240
241/*
242 * GNTTABOP_transfer_grant_ref: Transfer <frame> to a foreign domain. The
243 * foreign domain has previously registered its interest in the transfer via
244 * <domid, ref>.
245 *
246 * Note that, even if the transfer fails, the specified page no longer belongs
247 * to the calling domain *unless* the error is GNTST_bad_page.
248 */
249#define GNTTABOP_transfer 4
250struct gnttab_transfer {
251 /* IN parameters. */
252 unsigned long mfn;
253 domid_t domid;
254 grant_ref_t ref;
255 /* OUT parameters. */
256 int16_t status;
257};
258
259
260/*
261 * GNTTABOP_copy: Hypervisor based copy
262 * source and destinations can be eithers MFNs or, for foreign domains,
263 * grant references. the foreign domain has to grant read/write access
264 * in its grant table.
265 *
266 * The flags specify what type source and destinations are (either MFN
267 * or grant reference).
268 *
269 * Note that this can also be used to copy data between two domains
270 * via a third party if the source and destination domains had previously
271 * grant appropriate access to their pages to the third party.
272 *
273 * source_offset specifies an offset in the source frame, dest_offset
274 * the offset in the target frame and len specifies the number of
275 * bytes to be copied.
276 */
277
278#define _GNTCOPY_source_gref (0)
279#define GNTCOPY_source_gref (1<<_GNTCOPY_source_gref)
280#define _GNTCOPY_dest_gref (1)
281#define GNTCOPY_dest_gref (1<<_GNTCOPY_dest_gref)
282
283#define GNTTABOP_copy 5
284struct gnttab_copy {
285 /* IN parameters. */
286 struct {
287 union {
288 grant_ref_t ref;
289 unsigned long gmfn;
290 } u;
291 domid_t domid;
292 uint16_t offset;
293 } source, dest;
294 uint16_t len;
295 uint16_t flags; /* GNTCOPY_* */
296 /* OUT parameters. */
297 int16_t status;
298};
299
300/*
301 * GNTTABOP_query_size: Query the current and maximum sizes of the shared
302 * grant table.
303 * NOTES:
304 * 1. <dom> may be specified as DOMID_SELF.
305 * 2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
306 */
307#define GNTTABOP_query_size 6
308struct gnttab_query_size {
309 /* IN parameters. */
310 domid_t dom;
311 /* OUT parameters. */
312 uint32_t nr_frames;
313 uint32_t max_nr_frames;
314 int16_t status; /* GNTST_* */
315};
316
317
318/*
319 * Bitfield values for update_pin_status.flags.
320 */
321 /* Map the grant entry for access by I/O devices. */
322#define _GNTMAP_device_map (0)
323#define GNTMAP_device_map (1<<_GNTMAP_device_map)
324 /* Map the grant entry for access by host CPUs. */
325#define _GNTMAP_host_map (1)
326#define GNTMAP_host_map (1<<_GNTMAP_host_map)
327 /* Accesses to the granted frame will be restricted to read-only access. */
328#define _GNTMAP_readonly (2)
329#define GNTMAP_readonly (1<<_GNTMAP_readonly)
330 /*
331 * GNTMAP_host_map subflag:
332 * 0 => The host mapping is usable only by the guest OS.
333 * 1 => The host mapping is usable by guest OS + current application.
334 */
335#define _GNTMAP_application_map (3)
336#define GNTMAP_application_map (1<<_GNTMAP_application_map)
337
338 /*
339 * GNTMAP_contains_pte subflag:
340 * 0 => This map request contains a host virtual address.
341 * 1 => This map request contains the machine addess of the PTE to update.
342 */
343#define _GNTMAP_contains_pte (4)
344#define GNTMAP_contains_pte (1<<_GNTMAP_contains_pte)
345
346/*
347 * Values for error status returns. All errors are -ve.
348 */
349#define GNTST_okay (0) /* Normal return. */
350#define GNTST_general_error (-1) /* General undefined error. */
351#define GNTST_bad_domain (-2) /* Unrecognsed domain id. */
352#define GNTST_bad_gntref (-3) /* Unrecognised or inappropriate gntref. */
353#define GNTST_bad_handle (-4) /* Unrecognised or inappropriate handle. */
354#define GNTST_bad_virt_addr (-5) /* Inappropriate virtual address to map. */
355#define GNTST_bad_dev_addr (-6) /* Inappropriate device address to unmap.*/
356#define GNTST_no_device_space (-7) /* Out of space in I/O MMU. */
357#define GNTST_permission_denied (-8) /* Not enough privilege for operation. */
358#define GNTST_bad_page (-9) /* Specified page was invalid for op. */
359#define GNTST_bad_copy_arg (-10) /* copy arguments cross page boundary */
360
361#define GNTTABOP_error_msgs { \
362 "okay", \
363 "undefined error", \
364 "unrecognised domain id", \
365 "invalid grant reference", \
366 "invalid mapping handle", \
367 "invalid virtual address", \
368 "invalid device address", \
369 "no spare translation slot in the I/O MMU", \
370 "permission denied", \
371 "bad page", \
372 "copy arguments cross page boundary" \
373}
374
375#endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h
new file mode 100644
index 000000000000..c2d1fa4dc1ee
--- /dev/null
+++ b/include/xen/interface/io/blkif.h
@@ -0,0 +1,94 @@
1/******************************************************************************
2 * blkif.h
3 *
4 * Unified block-device I/O interface for Xen guest OSes.
5 *
6 * Copyright (c) 2003-2004, Keir Fraser
7 */
8
9#ifndef __XEN_PUBLIC_IO_BLKIF_H__
10#define __XEN_PUBLIC_IO_BLKIF_H__
11
12#include "ring.h"
13#include "../grant_table.h"
14
15/*
16 * Front->back notifications: When enqueuing a new request, sending a
17 * notification can be made conditional on req_event (i.e., the generic
18 * hold-off mechanism provided by the ring macros). Backends must set
19 * req_event appropriately (e.g., using RING_FINAL_CHECK_FOR_REQUESTS()).
20 *
21 * Back->front notifications: When enqueuing a new response, sending a
22 * notification can be made conditional on rsp_event (i.e., the generic
23 * hold-off mechanism provided by the ring macros). Frontends must set
24 * rsp_event appropriately (e.g., using RING_FINAL_CHECK_FOR_RESPONSES()).
25 */
26
27typedef uint16_t blkif_vdev_t;
28typedef uint64_t blkif_sector_t;
29
30/*
31 * REQUEST CODES.
32 */
33#define BLKIF_OP_READ 0
34#define BLKIF_OP_WRITE 1
35/*
36 * Recognised only if "feature-barrier" is present in backend xenbus info.
37 * The "feature_barrier" node contains a boolean indicating whether barrier
38 * requests are likely to succeed or fail. Either way, a barrier request
39 * may fail at any time with BLKIF_RSP_EOPNOTSUPP if it is unsupported by
40 * the underlying block-device hardware. The boolean simply indicates whether
41 * or not it is worthwhile for the frontend to attempt barrier requests.
42 * If a backend does not recognise BLKIF_OP_WRITE_BARRIER, it should *not*
43 * create the "feature-barrier" node!
44 */
45#define BLKIF_OP_WRITE_BARRIER 2
46
47/*
48 * Maximum scatter/gather segments per request.
49 * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE.
50 * NB. This could be 12 if the ring indexes weren't stored in the same page.
51 */
52#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
53
54struct blkif_request {
55 uint8_t operation; /* BLKIF_OP_??? */
56 uint8_t nr_segments; /* number of segments */
57 blkif_vdev_t handle; /* only for read/write requests */
58 uint64_t id; /* private guest value, echoed in resp */
59 blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
60 struct blkif_request_segment {
61 grant_ref_t gref; /* reference to I/O buffer frame */
62 /* @first_sect: first sector in frame to transfer (inclusive). */
63 /* @last_sect: last sector in frame to transfer (inclusive). */
64 uint8_t first_sect, last_sect;
65 } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
66};
67
68struct blkif_response {
69 uint64_t id; /* copied from request */
70 uint8_t operation; /* copied from request */
71 int16_t status; /* BLKIF_RSP_??? */
72};
73
74/*
75 * STATUS RETURN CODES.
76 */
77 /* Operation not supported (only happens on barrier writes). */
78#define BLKIF_RSP_EOPNOTSUPP -2
79 /* Operation failed for some unspecified reason (-EIO). */
80#define BLKIF_RSP_ERROR -1
81 /* Operation completed successfully. */
82#define BLKIF_RSP_OKAY 0
83
84/*
85 * Generate blkif ring structures and types.
86 */
87
88DEFINE_RING_TYPES(blkif, struct blkif_request, struct blkif_response);
89
90#define VDISK_CDROM 0x1
91#define VDISK_REMOVABLE 0x2
92#define VDISK_READONLY 0x4
93
94#endif /* __XEN_PUBLIC_IO_BLKIF_H__ */
diff --git a/include/xen/interface/io/console.h b/include/xen/interface/io/console.h
new file mode 100644
index 000000000000..e563de70f784
--- /dev/null
+++ b/include/xen/interface/io/console.h
@@ -0,0 +1,23 @@
1/******************************************************************************
2 * console.h
3 *
4 * Console I/O interface for Xen guest OSes.
5 *
6 * Copyright (c) 2005, Keir Fraser
7 */
8
9#ifndef __XEN_PUBLIC_IO_CONSOLE_H__
10#define __XEN_PUBLIC_IO_CONSOLE_H__
11
12typedef uint32_t XENCONS_RING_IDX;
13
14#define MASK_XENCONS_IDX(idx, ring) ((idx) & (sizeof(ring)-1))
15
16struct xencons_interface {
17 char in[1024];
18 char out[2048];
19 XENCONS_RING_IDX in_cons, in_prod;
20 XENCONS_RING_IDX out_cons, out_prod;
21};
22
23#endif /* __XEN_PUBLIC_IO_CONSOLE_H__ */
diff --git a/include/xen/interface/io/netif.h b/include/xen/interface/io/netif.h
new file mode 100644
index 000000000000..518481c95f18
--- /dev/null
+++ b/include/xen/interface/io/netif.h
@@ -0,0 +1,158 @@
1/******************************************************************************
2 * netif.h
3 *
4 * Unified network-device I/O interface for Xen guest OSes.
5 *
6 * Copyright (c) 2003-2004, Keir Fraser
7 */
8
9#ifndef __XEN_PUBLIC_IO_NETIF_H__
10#define __XEN_PUBLIC_IO_NETIF_H__
11
12#include "ring.h"
13#include "../grant_table.h"
14
15/*
16 * Notifications after enqueuing any type of message should be conditional on
17 * the appropriate req_event or rsp_event field in the shared ring.
18 * If the client sends notification for rx requests then it should specify
19 * feature 'feature-rx-notify' via xenbus. Otherwise the backend will assume
20 * that it cannot safely queue packets (as it may not be kicked to send them).
21 */
22
23/*
24 * This is the 'wire' format for packets:
25 * Request 1: netif_tx_request -- NETTXF_* (any flags)
26 * [Request 2: netif_tx_extra] (only if request 1 has NETTXF_extra_info)
27 * [Request 3: netif_tx_extra] (only if request 2 has XEN_NETIF_EXTRA_MORE)
28 * Request 4: netif_tx_request -- NETTXF_more_data
29 * Request 5: netif_tx_request -- NETTXF_more_data
30 * ...
31 * Request N: netif_tx_request -- 0
32 */
33
34/* Protocol checksum field is blank in the packet (hardware offload)? */
35#define _NETTXF_csum_blank (0)
36#define NETTXF_csum_blank (1U<<_NETTXF_csum_blank)
37
38/* Packet data has been validated against protocol checksum. */
39#define _NETTXF_data_validated (1)
40#define NETTXF_data_validated (1U<<_NETTXF_data_validated)
41
42/* Packet continues in the next request descriptor. */
43#define _NETTXF_more_data (2)
44#define NETTXF_more_data (1U<<_NETTXF_more_data)
45
46/* Packet to be followed by extra descriptor(s). */
47#define _NETTXF_extra_info (3)
48#define NETTXF_extra_info (1U<<_NETTXF_extra_info)
49
50struct xen_netif_tx_request {
51 grant_ref_t gref; /* Reference to buffer page */
52 uint16_t offset; /* Offset within buffer page */
53 uint16_t flags; /* NETTXF_* */
54 uint16_t id; /* Echoed in response message. */
55 uint16_t size; /* Packet size in bytes. */
56};
57
58/* Types of netif_extra_info descriptors. */
59#define XEN_NETIF_EXTRA_TYPE_NONE (0) /* Never used - invalid */
60#define XEN_NETIF_EXTRA_TYPE_GSO (1) /* u.gso */
61#define XEN_NETIF_EXTRA_TYPE_MAX (2)
62
63/* netif_extra_info flags. */
64#define _XEN_NETIF_EXTRA_FLAG_MORE (0)
65#define XEN_NETIF_EXTRA_FLAG_MORE (1U<<_XEN_NETIF_EXTRA_FLAG_MORE)
66
67/* GSO types - only TCPv4 currently supported. */
68#define XEN_NETIF_GSO_TYPE_TCPV4 (1)
69
70/*
71 * This structure needs to fit within both netif_tx_request and
72 * netif_rx_response for compatibility.
73 */
74struct xen_netif_extra_info {
75 uint8_t type; /* XEN_NETIF_EXTRA_TYPE_* */
76 uint8_t flags; /* XEN_NETIF_EXTRA_FLAG_* */
77
78 union {
79 struct {
80 /*
81 * Maximum payload size of each segment. For
82 * example, for TCP this is just the path MSS.
83 */
84 uint16_t size;
85
86 /*
87 * GSO type. This determines the protocol of
88 * the packet and any extra features required
89 * to segment the packet properly.
90 */
91 uint8_t type; /* XEN_NETIF_GSO_TYPE_* */
92
93 /* Future expansion. */
94 uint8_t pad;
95
96 /*
97 * GSO features. This specifies any extra GSO
98 * features required to process this packet,
99 * such as ECN support for TCPv4.
100 */
101 uint16_t features; /* XEN_NETIF_GSO_FEAT_* */
102 } gso;
103
104 uint16_t pad[3];
105 } u;
106};
107
108struct xen_netif_tx_response {
109 uint16_t id;
110 int16_t status; /* NETIF_RSP_* */
111};
112
113struct xen_netif_rx_request {
114 uint16_t id; /* Echoed in response message. */
115 grant_ref_t gref; /* Reference to incoming granted frame */
116};
117
118/* Packet data has been validated against protocol checksum. */
119#define _NETRXF_data_validated (0)
120#define NETRXF_data_validated (1U<<_NETRXF_data_validated)
121
122/* Protocol checksum field is blank in the packet (hardware offload)? */
123#define _NETRXF_csum_blank (1)
124#define NETRXF_csum_blank (1U<<_NETRXF_csum_blank)
125
126/* Packet continues in the next request descriptor. */
127#define _NETRXF_more_data (2)
128#define NETRXF_more_data (1U<<_NETRXF_more_data)
129
130/* Packet to be followed by extra descriptor(s). */
131#define _NETRXF_extra_info (3)
132#define NETRXF_extra_info (1U<<_NETRXF_extra_info)
133
134struct xen_netif_rx_response {
135 uint16_t id;
136 uint16_t offset; /* Offset in page of start of received packet */
137 uint16_t flags; /* NETRXF_* */
138 int16_t status; /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
139};
140
141/*
142 * Generate netif ring structures and types.
143 */
144
145DEFINE_RING_TYPES(xen_netif_tx,
146 struct xen_netif_tx_request,
147 struct xen_netif_tx_response);
148DEFINE_RING_TYPES(xen_netif_rx,
149 struct xen_netif_rx_request,
150 struct xen_netif_rx_response);
151
152#define NETIF_RSP_DROPPED -2
153#define NETIF_RSP_ERROR -1
154#define NETIF_RSP_OKAY 0
155/* No response: used for auxiliary requests (e.g., netif_tx_extra). */
156#define NETIF_RSP_NULL 1
157
158#endif
diff --git a/include/xen/interface/io/ring.h b/include/xen/interface/io/ring.h
new file mode 100644
index 000000000000..e8cbf431c8cc
--- /dev/null
+++ b/include/xen/interface/io/ring.h
@@ -0,0 +1,260 @@
1/******************************************************************************
2 * ring.h
3 *
4 * Shared producer-consumer ring macros.
5 *
6 * Tim Deegan and Andrew Warfield November 2004.
7 */
8
9#ifndef __XEN_PUBLIC_IO_RING_H__
10#define __XEN_PUBLIC_IO_RING_H__
11
12typedef unsigned int RING_IDX;
13
14/* Round a 32-bit unsigned constant down to the nearest power of two. */
15#define __RD2(_x) (((_x) & 0x00000002) ? 0x2 : ((_x) & 0x1))
16#define __RD4(_x) (((_x) & 0x0000000c) ? __RD2((_x)>>2)<<2 : __RD2(_x))
17#define __RD8(_x) (((_x) & 0x000000f0) ? __RD4((_x)>>4)<<4 : __RD4(_x))
18#define __RD16(_x) (((_x) & 0x0000ff00) ? __RD8((_x)>>8)<<8 : __RD8(_x))
19#define __RD32(_x) (((_x) & 0xffff0000) ? __RD16((_x)>>16)<<16 : __RD16(_x))
20
21/*
22 * Calculate size of a shared ring, given the total available space for the
23 * ring and indexes (_sz), and the name tag of the request/response structure.
24 * A ring contains as many entries as will fit, rounded down to the nearest
25 * power of two (so we can mask with (size-1) to loop around).
26 */
27#define __RING_SIZE(_s, _sz) \
28 (__RD32(((_sz) - (long)&(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0])))
29
30/*
31 * Macros to make the correct C datatypes for a new kind of ring.
32 *
33 * To make a new ring datatype, you need to have two message structures,
34 * let's say struct request, and struct response already defined.
35 *
36 * In a header where you want the ring datatype declared, you then do:
37 *
38 * DEFINE_RING_TYPES(mytag, struct request, struct response);
39 *
40 * These expand out to give you a set of types, as you can see below.
41 * The most important of these are:
42 *
43 * struct mytag_sring - The shared ring.
44 * struct mytag_front_ring - The 'front' half of the ring.
45 * struct mytag_back_ring - The 'back' half of the ring.
46 *
47 * To initialize a ring in your code you need to know the location and size
48 * of the shared memory area (PAGE_SIZE, for instance). To initialise
49 * the front half:
50 *
51 * struct mytag_front_ring front_ring;
52 * SHARED_RING_INIT((struct mytag_sring *)shared_page);
53 * FRONT_RING_INIT(&front_ring, (struct mytag_sring *)shared_page,
54 * PAGE_SIZE);
55 *
56 * Initializing the back follows similarly (note that only the front
57 * initializes the shared ring):
58 *
59 * struct mytag_back_ring back_ring;
60 * BACK_RING_INIT(&back_ring, (struct mytag_sring *)shared_page,
61 * PAGE_SIZE);
62 */
63
64#define DEFINE_RING_TYPES(__name, __req_t, __rsp_t) \
65 \
66/* Shared ring entry */ \
67union __name##_sring_entry { \
68 __req_t req; \
69 __rsp_t rsp; \
70}; \
71 \
72/* Shared ring page */ \
73struct __name##_sring { \
74 RING_IDX req_prod, req_event; \
75 RING_IDX rsp_prod, rsp_event; \
76 uint8_t pad[48]; \
77 union __name##_sring_entry ring[1]; /* variable-length */ \
78}; \
79 \
80/* "Front" end's private variables */ \
81struct __name##_front_ring { \
82 RING_IDX req_prod_pvt; \
83 RING_IDX rsp_cons; \
84 unsigned int nr_ents; \
85 struct __name##_sring *sring; \
86}; \
87 \
88/* "Back" end's private variables */ \
89struct __name##_back_ring { \
90 RING_IDX rsp_prod_pvt; \
91 RING_IDX req_cons; \
92 unsigned int nr_ents; \
93 struct __name##_sring *sring; \
94};
95
96/*
97 * Macros for manipulating rings.
98 *
99 * FRONT_RING_whatever works on the "front end" of a ring: here
100 * requests are pushed on to the ring and responses taken off it.
101 *
102 * BACK_RING_whatever works on the "back end" of a ring: here
103 * requests are taken off the ring and responses put on.
104 *
105 * N.B. these macros do NO INTERLOCKS OR FLOW CONTROL.
106 * This is OK in 1-for-1 request-response situations where the
107 * requestor (front end) never has more than RING_SIZE()-1
108 * outstanding requests.
109 */
110
111/* Initialising empty rings */
112#define SHARED_RING_INIT(_s) do { \
113 (_s)->req_prod = (_s)->rsp_prod = 0; \
114 (_s)->req_event = (_s)->rsp_event = 1; \
115 memset((_s)->pad, 0, sizeof((_s)->pad)); \
116} while(0)
117
118#define FRONT_RING_INIT(_r, _s, __size) do { \
119 (_r)->req_prod_pvt = 0; \
120 (_r)->rsp_cons = 0; \
121 (_r)->nr_ents = __RING_SIZE(_s, __size); \
122 (_r)->sring = (_s); \
123} while (0)
124
125#define BACK_RING_INIT(_r, _s, __size) do { \
126 (_r)->rsp_prod_pvt = 0; \
127 (_r)->req_cons = 0; \
128 (_r)->nr_ents = __RING_SIZE(_s, __size); \
129 (_r)->sring = (_s); \
130} while (0)
131
132/* Initialize to existing shared indexes -- for recovery */
133#define FRONT_RING_ATTACH(_r, _s, __size) do { \
134 (_r)->sring = (_s); \
135 (_r)->req_prod_pvt = (_s)->req_prod; \
136 (_r)->rsp_cons = (_s)->rsp_prod; \
137 (_r)->nr_ents = __RING_SIZE(_s, __size); \
138} while (0)
139
140#define BACK_RING_ATTACH(_r, _s, __size) do { \
141 (_r)->sring = (_s); \
142 (_r)->rsp_prod_pvt = (_s)->rsp_prod; \
143 (_r)->req_cons = (_s)->req_prod; \
144 (_r)->nr_ents = __RING_SIZE(_s, __size); \
145} while (0)
146
147/* How big is this ring? */
148#define RING_SIZE(_r) \
149 ((_r)->nr_ents)
150
151/* Number of free requests (for use on front side only). */
152#define RING_FREE_REQUESTS(_r) \
153 (RING_SIZE(_r) - ((_r)->req_prod_pvt - (_r)->rsp_cons))
154
155/* Test if there is an empty slot available on the front ring.
156 * (This is only meaningful from the front. )
157 */
158#define RING_FULL(_r) \
159 (RING_FREE_REQUESTS(_r) == 0)
160
161/* Test if there are outstanding messages to be processed on a ring. */
162#define RING_HAS_UNCONSUMED_RESPONSES(_r) \
163 ((_r)->sring->rsp_prod - (_r)->rsp_cons)
164
165#define RING_HAS_UNCONSUMED_REQUESTS(_r) \
166 ({ \
167 unsigned int req = (_r)->sring->req_prod - (_r)->req_cons; \
168 unsigned int rsp = RING_SIZE(_r) - \
169 ((_r)->req_cons - (_r)->rsp_prod_pvt); \
170 req < rsp ? req : rsp; \
171 })
172
173/* Direct access to individual ring elements, by index. */
174#define RING_GET_REQUEST(_r, _idx) \
175 (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].req))
176
177#define RING_GET_RESPONSE(_r, _idx) \
178 (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].rsp))
179
180/* Loop termination condition: Would the specified index overflow the ring? */
181#define RING_REQUEST_CONS_OVERFLOW(_r, _cons) \
182 (((_cons) - (_r)->rsp_prod_pvt) >= RING_SIZE(_r))
183
184#define RING_PUSH_REQUESTS(_r) do { \
185 wmb(); /* back sees requests /before/ updated producer index */ \
186 (_r)->sring->req_prod = (_r)->req_prod_pvt; \
187} while (0)
188
189#define RING_PUSH_RESPONSES(_r) do { \
190 wmb(); /* front sees responses /before/ updated producer index */ \
191 (_r)->sring->rsp_prod = (_r)->rsp_prod_pvt; \
192} while (0)
193
194/*
195 * Notification hold-off (req_event and rsp_event):
196 *
197 * When queueing requests or responses on a shared ring, it may not always be
198 * necessary to notify the remote end. For example, if requests are in flight
199 * in a backend, the front may be able to queue further requests without
200 * notifying the back (if the back checks for new requests when it queues
201 * responses).
202 *
203 * When enqueuing requests or responses:
204 *
205 * Use RING_PUSH_{REQUESTS,RESPONSES}_AND_CHECK_NOTIFY(). The second argument
206 * is a boolean return value. True indicates that the receiver requires an
207 * asynchronous notification.
208 *
209 * After dequeuing requests or responses (before sleeping the connection):
210 *
211 * Use RING_FINAL_CHECK_FOR_REQUESTS() or RING_FINAL_CHECK_FOR_RESPONSES().
212 * The second argument is a boolean return value. True indicates that there
213 * are pending messages on the ring (i.e., the connection should not be put
214 * to sleep).
215 *
216 * These macros will set the req_event/rsp_event field to trigger a
217 * notification on the very next message that is enqueued. If you want to
218 * create batches of work (i.e., only receive a notification after several
219 * messages have been enqueued) then you will need to create a customised
220 * version of the FINAL_CHECK macro in your own code, which sets the event
221 * field appropriately.
222 */
223
224#define RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(_r, _notify) do { \
225 RING_IDX __old = (_r)->sring->req_prod; \
226 RING_IDX __new = (_r)->req_prod_pvt; \
227 wmb(); /* back sees requests /before/ updated producer index */ \
228 (_r)->sring->req_prod = __new; \
229 mb(); /* back sees new requests /before/ we check req_event */ \
230 (_notify) = ((RING_IDX)(__new - (_r)->sring->req_event) < \
231 (RING_IDX)(__new - __old)); \
232} while (0)
233
234#define RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(_r, _notify) do { \
235 RING_IDX __old = (_r)->sring->rsp_prod; \
236 RING_IDX __new = (_r)->rsp_prod_pvt; \
237 wmb(); /* front sees responses /before/ updated producer index */ \
238 (_r)->sring->rsp_prod = __new; \
239 mb(); /* front sees new responses /before/ we check rsp_event */ \
240 (_notify) = ((RING_IDX)(__new - (_r)->sring->rsp_event) < \
241 (RING_IDX)(__new - __old)); \
242} while (0)
243
244#define RING_FINAL_CHECK_FOR_REQUESTS(_r, _work_to_do) do { \
245 (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \
246 if (_work_to_do) break; \
247 (_r)->sring->req_event = (_r)->req_cons + 1; \
248 mb(); \
249 (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \
250} while (0)
251
252#define RING_FINAL_CHECK_FOR_RESPONSES(_r, _work_to_do) do { \
253 (_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \
254 if (_work_to_do) break; \
255 (_r)->sring->rsp_event = (_r)->rsp_cons + 1; \
256 mb(); \
257 (_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \
258} while (0)
259
260#endif /* __XEN_PUBLIC_IO_RING_H__ */
diff --git a/include/xen/interface/io/xenbus.h b/include/xen/interface/io/xenbus.h
new file mode 100644
index 000000000000..46508c7fa399
--- /dev/null
+++ b/include/xen/interface/io/xenbus.h
@@ -0,0 +1,44 @@
1/*****************************************************************************
2 * xenbus.h
3 *
4 * Xenbus protocol details.
5 *
6 * Copyright (C) 2005 XenSource Ltd.
7 */
8
9#ifndef _XEN_PUBLIC_IO_XENBUS_H
10#define _XEN_PUBLIC_IO_XENBUS_H
11
12/* The state of either end of the Xenbus, i.e. the current communication
13 status of initialisation across the bus. States here imply nothing about
14 the state of the connection between the driver and the kernel's device
15 layers. */
16enum xenbus_state
17{
18 XenbusStateUnknown = 0,
19 XenbusStateInitialising = 1,
20 XenbusStateInitWait = 2, /* Finished early
21 initialisation, but waiting
22 for information from the peer
23 or hotplug scripts. */
24 XenbusStateInitialised = 3, /* Initialised and waiting for a
25 connection from the peer. */
26 XenbusStateConnected = 4,
27 XenbusStateClosing = 5, /* The device is being closed
28 due to an error or an unplug
29 event. */
30 XenbusStateClosed = 6
31
32};
33
34#endif /* _XEN_PUBLIC_IO_XENBUS_H */
35
36/*
37 * Local variables:
38 * c-file-style: "linux"
39 * indent-tabs-mode: t
40 * c-indent-level: 8
41 * c-basic-offset: 8
42 * tab-width: 8
43 * End:
44 */
diff --git a/include/xen/interface/io/xs_wire.h b/include/xen/interface/io/xs_wire.h
new file mode 100644
index 000000000000..99fcffb372d1
--- /dev/null
+++ b/include/xen/interface/io/xs_wire.h
@@ -0,0 +1,87 @@
1/*
2 * Details of the "wire" protocol between Xen Store Daemon and client
3 * library or guest kernel.
4 * Copyright (C) 2005 Rusty Russell IBM Corporation
5 */
6
7#ifndef _XS_WIRE_H
8#define _XS_WIRE_H
9
10enum xsd_sockmsg_type
11{
12 XS_DEBUG,
13 XS_DIRECTORY,
14 XS_READ,
15 XS_GET_PERMS,
16 XS_WATCH,
17 XS_UNWATCH,
18 XS_TRANSACTION_START,
19 XS_TRANSACTION_END,
20 XS_INTRODUCE,
21 XS_RELEASE,
22 XS_GET_DOMAIN_PATH,
23 XS_WRITE,
24 XS_MKDIR,
25 XS_RM,
26 XS_SET_PERMS,
27 XS_WATCH_EVENT,
28 XS_ERROR,
29 XS_IS_DOMAIN_INTRODUCED
30};
31
32#define XS_WRITE_NONE "NONE"
33#define XS_WRITE_CREATE "CREATE"
34#define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
35
36/* We hand errors as strings, for portability. */
37struct xsd_errors
38{
39 int errnum;
40 const char *errstring;
41};
42#define XSD_ERROR(x) { x, #x }
43static struct xsd_errors xsd_errors[] __attribute__((unused)) = {
44 XSD_ERROR(EINVAL),
45 XSD_ERROR(EACCES),
46 XSD_ERROR(EEXIST),
47 XSD_ERROR(EISDIR),
48 XSD_ERROR(ENOENT),
49 XSD_ERROR(ENOMEM),
50 XSD_ERROR(ENOSPC),
51 XSD_ERROR(EIO),
52 XSD_ERROR(ENOTEMPTY),
53 XSD_ERROR(ENOSYS),
54 XSD_ERROR(EROFS),
55 XSD_ERROR(EBUSY),
56 XSD_ERROR(EAGAIN),
57 XSD_ERROR(EISCONN)
58};
59
60struct xsd_sockmsg
61{
62 uint32_t type; /* XS_??? */
63 uint32_t req_id;/* Request identifier, echoed in daemon's response. */
64 uint32_t tx_id; /* Transaction id (0 if not related to a transaction). */
65 uint32_t len; /* Length of data following this. */
66
67 /* Generally followed by nul-terminated string(s). */
68};
69
70enum xs_watch_type
71{
72 XS_WATCH_PATH = 0,
73 XS_WATCH_TOKEN
74};
75
76/* Inter-domain shared memory communications. */
77#define XENSTORE_RING_SIZE 1024
78typedef uint32_t XENSTORE_RING_IDX;
79#define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
80struct xenstore_domain_interface {
81 char req[XENSTORE_RING_SIZE]; /* Requests to xenstore daemon. */
82 char rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
83 XENSTORE_RING_IDX req_cons, req_prod;
84 XENSTORE_RING_IDX rsp_cons, rsp_prod;
85};
86
87#endif /* _XS_WIRE_H */
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h
new file mode 100644
index 000000000000..af36ead16817
--- /dev/null
+++ b/include/xen/interface/memory.h
@@ -0,0 +1,145 @@
1/******************************************************************************
2 * memory.h
3 *
4 * Memory reservation and information.
5 *
6 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
7 */
8
9#ifndef __XEN_PUBLIC_MEMORY_H__
10#define __XEN_PUBLIC_MEMORY_H__
11
12/*
13 * Increase or decrease the specified domain's memory reservation. Returns a
14 * -ve errcode on failure, or the # extents successfully allocated or freed.
15 * arg == addr of struct xen_memory_reservation.
16 */
17#define XENMEM_increase_reservation 0
18#define XENMEM_decrease_reservation 1
19#define XENMEM_populate_physmap 6
20struct xen_memory_reservation {
21
22 /*
23 * XENMEM_increase_reservation:
24 * OUT: MFN (*not* GMFN) bases of extents that were allocated
25 * XENMEM_decrease_reservation:
26 * IN: GMFN bases of extents to free
27 * XENMEM_populate_physmap:
28 * IN: GPFN bases of extents to populate with memory
29 * OUT: GMFN bases of extents that were allocated
30 * (NB. This command also updates the mach_to_phys translation table)
31 */
32 GUEST_HANDLE(ulong) extent_start;
33
34 /* Number of extents, and size/alignment of each (2^extent_order pages). */
35 unsigned long nr_extents;
36 unsigned int extent_order;
37
38 /*
39 * Maximum # bits addressable by the user of the allocated region (e.g.,
40 * I/O devices often have a 32-bit limitation even in 64-bit systems). If
41 * zero then the user has no addressing restriction.
42 * This field is not used by XENMEM_decrease_reservation.
43 */
44 unsigned int address_bits;
45
46 /*
47 * Domain whose reservation is being changed.
48 * Unprivileged domains can specify only DOMID_SELF.
49 */
50 domid_t domid;
51
52};
53DEFINE_GUEST_HANDLE_STRUCT(xen_memory_reservation);
54
55/*
56 * Returns the maximum machine frame number of mapped RAM in this system.
57 * This command always succeeds (it never returns an error code).
58 * arg == NULL.
59 */
60#define XENMEM_maximum_ram_page 2
61
62/*
63 * Returns the current or maximum memory reservation, in pages, of the
64 * specified domain (may be DOMID_SELF). Returns -ve errcode on failure.
65 * arg == addr of domid_t.
66 */
67#define XENMEM_current_reservation 3
68#define XENMEM_maximum_reservation 4
69
70/*
71 * Returns a list of MFN bases of 2MB extents comprising the machine_to_phys
72 * mapping table. Architectures which do not have a m2p table do not implement
73 * this command.
74 * arg == addr of xen_machphys_mfn_list_t.
75 */
76#define XENMEM_machphys_mfn_list 5
77struct xen_machphys_mfn_list {
78 /*
79 * Size of the 'extent_start' array. Fewer entries will be filled if the
80 * machphys table is smaller than max_extents * 2MB.
81 */
82 unsigned int max_extents;
83
84 /*
85 * Pointer to buffer to fill with list of extent starts. If there are
86 * any large discontiguities in the machine address space, 2MB gaps in
87 * the machphys table will be represented by an MFN base of zero.
88 */
89 GUEST_HANDLE(ulong) extent_start;
90
91 /*
92 * Number of extents written to the above array. This will be smaller
93 * than 'max_extents' if the machphys table is smaller than max_e * 2MB.
94 */
95 unsigned int nr_extents;
96};
97DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mfn_list);
98
99/*
100 * Sets the GPFN at which a particular page appears in the specified guest's
101 * pseudophysical address space.
102 * arg == addr of xen_add_to_physmap_t.
103 */
104#define XENMEM_add_to_physmap 7
105struct xen_add_to_physmap {
106 /* Which domain to change the mapping for. */
107 domid_t domid;
108
109 /* Source mapping space. */
110#define XENMAPSPACE_shared_info 0 /* shared info page */
111#define XENMAPSPACE_grant_table 1 /* grant table page */
112 unsigned int space;
113
114 /* Index into source mapping space. */
115 unsigned long idx;
116
117 /* GPFN where the source mapping page should appear. */
118 unsigned long gpfn;
119};
120DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap);
121
122/*
123 * Translates a list of domain-specific GPFNs into MFNs. Returns a -ve error
124 * code on failure. This call only works for auto-translated guests.
125 */
126#define XENMEM_translate_gpfn_list 8
127struct xen_translate_gpfn_list {
128 /* Which domain to translate for? */
129 domid_t domid;
130
131 /* Length of list. */
132 unsigned long nr_gpfns;
133
134 /* List of GPFNs to translate. */
135 GUEST_HANDLE(ulong) gpfn_list;
136
137 /*
138 * Output list to contain MFN translations. May be the same as the input
139 * list (in which case each input GPFN is overwritten with the output MFN).
140 */
141 GUEST_HANDLE(ulong) mfn_list;
142};
143DEFINE_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list);
144
145#endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h
new file mode 100644
index 000000000000..cd6939147cb6
--- /dev/null
+++ b/include/xen/interface/physdev.h
@@ -0,0 +1,145 @@
1/*
2 * Permission is hereby granted, free of charge, to any person obtaining a copy
3 * of this software and associated documentation files (the "Software"), to
4 * deal in the Software without restriction, including without limitation the
5 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6 * sell copies of the Software, and to permit persons to whom the Software is
7 * furnished to do so, subject to the following conditions:
8 *
9 * The above copyright notice and this permission notice shall be included in
10 * all copies or substantial portions of the Software.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18 * DEALINGS IN THE SOFTWARE.
19 */
20
21#ifndef __XEN_PUBLIC_PHYSDEV_H__
22#define __XEN_PUBLIC_PHYSDEV_H__
23
24/*
25 * Prototype for this hypercall is:
26 * int physdev_op(int cmd, void *args)
27 * @cmd == PHYSDEVOP_??? (physdev operation).
28 * @args == Operation-specific extra arguments (NULL if none).
29 */
30
31/*
32 * Notify end-of-interrupt (EOI) for the specified IRQ.
33 * @arg == pointer to physdev_eoi structure.
34 */
35#define PHYSDEVOP_eoi 12
36struct physdev_eoi {
37 /* IN */
38 uint32_t irq;
39};
40
41/*
42 * Query the status of an IRQ line.
43 * @arg == pointer to physdev_irq_status_query structure.
44 */
45#define PHYSDEVOP_irq_status_query 5
46struct physdev_irq_status_query {
47 /* IN */
48 uint32_t irq;
49 /* OUT */
50 uint32_t flags; /* XENIRQSTAT_* */
51};
52
53/* Need to call PHYSDEVOP_eoi when the IRQ has been serviced? */
54#define _XENIRQSTAT_needs_eoi (0)
55#define XENIRQSTAT_needs_eoi (1U<<_XENIRQSTAT_needs_eoi)
56
57/* IRQ shared by multiple guests? */
58#define _XENIRQSTAT_shared (1)
59#define XENIRQSTAT_shared (1U<<_XENIRQSTAT_shared)
60
61/*
62 * Set the current VCPU's I/O privilege level.
63 * @arg == pointer to physdev_set_iopl structure.
64 */
65#define PHYSDEVOP_set_iopl 6
66struct physdev_set_iopl {
67 /* IN */
68 uint32_t iopl;
69};
70
71/*
72 * Set the current VCPU's I/O-port permissions bitmap.
73 * @arg == pointer to physdev_set_iobitmap structure.
74 */
75#define PHYSDEVOP_set_iobitmap 7
76struct physdev_set_iobitmap {
77 /* IN */
78 uint8_t * bitmap;
79 uint32_t nr_ports;
80};
81
82/*
83 * Read or write an IO-APIC register.
84 * @arg == pointer to physdev_apic structure.
85 */
86#define PHYSDEVOP_apic_read 8
87#define PHYSDEVOP_apic_write 9
88struct physdev_apic {
89 /* IN */
90 unsigned long apic_physbase;
91 uint32_t reg;
92 /* IN or OUT */
93 uint32_t value;
94};
95
96/*
97 * Allocate or free a physical upcall vector for the specified IRQ line.
98 * @arg == pointer to physdev_irq structure.
99 */
100#define PHYSDEVOP_alloc_irq_vector 10
101#define PHYSDEVOP_free_irq_vector 11
102struct physdev_irq {
103 /* IN */
104 uint32_t irq;
105 /* IN or OUT */
106 uint32_t vector;
107};
108
109/*
110 * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op()
111 * hypercall since 0x00030202.
112 */
113struct physdev_op {
114 uint32_t cmd;
115 union {
116 struct physdev_irq_status_query irq_status_query;
117 struct physdev_set_iopl set_iopl;
118 struct physdev_set_iobitmap set_iobitmap;
119 struct physdev_apic apic_op;
120 struct physdev_irq irq_op;
121 } u;
122};
123
124/*
125 * Notify that some PIRQ-bound event channels have been unmasked.
126 * ** This command is obsolete since interface version 0x00030202 and is **
127 * ** unsupported by newer versions of Xen. **
128 */
129#define PHYSDEVOP_IRQ_UNMASK_NOTIFY 4
130
131/*
132 * These all-capitals physdev operation names are superceded by the new names
133 * (defined above) since interface version 0x00030202.
134 */
135#define PHYSDEVOP_IRQ_STATUS_QUERY PHYSDEVOP_irq_status_query
136#define PHYSDEVOP_SET_IOPL PHYSDEVOP_set_iopl
137#define PHYSDEVOP_SET_IOBITMAP PHYSDEVOP_set_iobitmap
138#define PHYSDEVOP_APIC_READ PHYSDEVOP_apic_read
139#define PHYSDEVOP_APIC_WRITE PHYSDEVOP_apic_write
140#define PHYSDEVOP_ASSIGN_VECTOR PHYSDEVOP_alloc_irq_vector
141#define PHYSDEVOP_FREE_VECTOR PHYSDEVOP_free_irq_vector
142#define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi
143#define PHYSDEVOP_IRQ_SHARED XENIRQSTAT_shared
144
145#endif /* __XEN_PUBLIC_PHYSDEV_H__ */
diff --git a/include/xen/interface/sched.h b/include/xen/interface/sched.h
new file mode 100644
index 000000000000..5fec575a800a
--- /dev/null
+++ b/include/xen/interface/sched.h
@@ -0,0 +1,77 @@
1/******************************************************************************
2 * sched.h
3 *
4 * Scheduler state interactions
5 *
6 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
7 */
8
9#ifndef __XEN_PUBLIC_SCHED_H__
10#define __XEN_PUBLIC_SCHED_H__
11
12#include "event_channel.h"
13
14/*
15 * The prototype for this hypercall is:
16 * long sched_op_new(int cmd, void *arg)
17 * @cmd == SCHEDOP_??? (scheduler operation).
18 * @arg == Operation-specific extra argument(s), as described below.
19 *
20 * **NOTE**:
21 * Versions of Xen prior to 3.0.2 provide only the following legacy version
22 * of this hypercall, supporting only the commands yield, block and shutdown:
23 * long sched_op(int cmd, unsigned long arg)
24 * @cmd == SCHEDOP_??? (scheduler operation).
25 * @arg == 0 (SCHEDOP_yield and SCHEDOP_block)
26 * == SHUTDOWN_* code (SCHEDOP_shutdown)
27 */
28
29/*
30 * Voluntarily yield the CPU.
31 * @arg == NULL.
32 */
33#define SCHEDOP_yield 0
34
35/*
36 * Block execution of this VCPU until an event is received for processing.
37 * If called with event upcalls masked, this operation will atomically
38 * reenable event delivery and check for pending events before blocking the
39 * VCPU. This avoids a "wakeup waiting" race.
40 * @arg == NULL.
41 */
42#define SCHEDOP_block 1
43
44/*
45 * Halt execution of this domain (all VCPUs) and notify the system controller.
46 * @arg == pointer to sched_shutdown structure.
47 */
48#define SCHEDOP_shutdown 2
49struct sched_shutdown {
50 unsigned int reason; /* SHUTDOWN_* */
51};
52DEFINE_GUEST_HANDLE_STRUCT(sched_shutdown);
53
54/*
55 * Poll a set of event-channel ports. Return when one or more are pending. An
56 * optional timeout may be specified.
57 * @arg == pointer to sched_poll structure.
58 */
59#define SCHEDOP_poll 3
60struct sched_poll {
61 GUEST_HANDLE(evtchn_port_t) ports;
62 unsigned int nr_ports;
63 uint64_t timeout;
64};
65DEFINE_GUEST_HANDLE_STRUCT(sched_poll);
66
67/*
68 * Reason codes for SCHEDOP_shutdown. These may be interpreted by control
69 * software to determine the appropriate action. For the most part, Xen does
70 * not care about the shutdown code.
71 */
72#define SHUTDOWN_poweroff 0 /* Domain exited normally. Clean up and kill. */
73#define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */
74#define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */
75#define SHUTDOWN_crash 3 /* Tell controller we've crashed. */
76
77#endif /* __XEN_PUBLIC_SCHED_H__ */
diff --git a/include/xen/interface/vcpu.h b/include/xen/interface/vcpu.h
new file mode 100644
index 000000000000..ff61ea365997
--- /dev/null
+++ b/include/xen/interface/vcpu.h
@@ -0,0 +1,167 @@
1/******************************************************************************
2 * vcpu.h
3 *
4 * VCPU initialisation, query, and hotplug.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
25 */
26
27#ifndef __XEN_PUBLIC_VCPU_H__
28#define __XEN_PUBLIC_VCPU_H__
29
30/*
31 * Prototype for this hypercall is:
32 * int vcpu_op(int cmd, int vcpuid, void *extra_args)
33 * @cmd == VCPUOP_??? (VCPU operation).
34 * @vcpuid == VCPU to operate on.
35 * @extra_args == Operation-specific extra arguments (NULL if none).
36 */
37
38/*
39 * Initialise a VCPU. Each VCPU can be initialised only once. A
40 * newly-initialised VCPU will not run until it is brought up by VCPUOP_up.
41 *
42 * @extra_arg == pointer to vcpu_guest_context structure containing initial
43 * state for the VCPU.
44 */
45#define VCPUOP_initialise 0
46
47/*
48 * Bring up a VCPU. This makes the VCPU runnable. This operation will fail
49 * if the VCPU has not been initialised (VCPUOP_initialise).
50 */
51#define VCPUOP_up 1
52
53/*
54 * Bring down a VCPU (i.e., make it non-runnable).
55 * There are a few caveats that callers should observe:
56 * 1. This operation may return, and VCPU_is_up may return false, before the
57 * VCPU stops running (i.e., the command is asynchronous). It is a good
58 * idea to ensure that the VCPU has entered a non-critical loop before
59 * bringing it down. Alternatively, this operation is guaranteed
60 * synchronous if invoked by the VCPU itself.
61 * 2. After a VCPU is initialised, there is currently no way to drop all its
62 * references to domain memory. Even a VCPU that is down still holds
63 * memory references via its pagetable base pointer and GDT. It is good
64 * practise to move a VCPU onto an 'idle' or default page table, LDT and
65 * GDT before bringing it down.
66 */
67#define VCPUOP_down 2
68
69/* Returns 1 if the given VCPU is up. */
70#define VCPUOP_is_up 3
71
72/*
73 * Return information about the state and running time of a VCPU.
74 * @extra_arg == pointer to vcpu_runstate_info structure.
75 */
76#define VCPUOP_get_runstate_info 4
77struct vcpu_runstate_info {
78 /* VCPU's current state (RUNSTATE_*). */
79 int state;
80 /* When was current state entered (system time, ns)? */
81 uint64_t state_entry_time;
82 /*
83 * Time spent in each RUNSTATE_* (ns). The sum of these times is
84 * guaranteed not to drift from system time.
85 */
86 uint64_t time[4];
87};
88
89/* VCPU is currently running on a physical CPU. */
90#define RUNSTATE_running 0
91
92/* VCPU is runnable, but not currently scheduled on any physical CPU. */
93#define RUNSTATE_runnable 1
94
95/* VCPU is blocked (a.k.a. idle). It is therefore not runnable. */
96#define RUNSTATE_blocked 2
97
98/*
99 * VCPU is not runnable, but it is not blocked.
100 * This is a 'catch all' state for things like hotplug and pauses by the
101 * system administrator (or for critical sections in the hypervisor).
102 * RUNSTATE_blocked dominates this state (it is the preferred state).
103 */
104#define RUNSTATE_offline 3
105
106/*
107 * Register a shared memory area from which the guest may obtain its own
108 * runstate information without needing to execute a hypercall.
109 * Notes:
110 * 1. The registered address may be virtual or physical, depending on the
111 * platform. The virtual address should be registered on x86 systems.
112 * 2. Only one shared area may be registered per VCPU. The shared area is
113 * updated by the hypervisor each time the VCPU is scheduled. Thus
114 * runstate.state will always be RUNSTATE_running and
115 * runstate.state_entry_time will indicate the system time at which the
116 * VCPU was last scheduled to run.
117 * @extra_arg == pointer to vcpu_register_runstate_memory_area structure.
118 */
119#define VCPUOP_register_runstate_memory_area 5
120struct vcpu_register_runstate_memory_area {
121 union {
122 struct vcpu_runstate_info *v;
123 uint64_t p;
124 } addr;
125};
126
127/*
128 * Set or stop a VCPU's periodic timer. Every VCPU has one periodic timer
129 * which can be set via these commands. Periods smaller than one millisecond
130 * may not be supported.
131 */
132#define VCPUOP_set_periodic_timer 6 /* arg == vcpu_set_periodic_timer_t */
133#define VCPUOP_stop_periodic_timer 7 /* arg == NULL */
134struct vcpu_set_periodic_timer {
135 uint64_t period_ns;
136};
137
138/*
139 * Set or stop a VCPU's single-shot timer. Every VCPU has one single-shot
140 * timer which can be set via these commands.
141 */
142#define VCPUOP_set_singleshot_timer 8 /* arg == vcpu_set_singleshot_timer_t */
143#define VCPUOP_stop_singleshot_timer 9 /* arg == NULL */
144struct vcpu_set_singleshot_timer {
145 uint64_t timeout_abs_ns;
146 uint32_t flags; /* VCPU_SSHOTTMR_??? */
147};
148
149/* Flags to VCPUOP_set_singleshot_timer. */
150 /* Require the timeout to be in the future (return -ETIME if it's passed). */
151#define _VCPU_SSHOTTMR_future (0)
152#define VCPU_SSHOTTMR_future (1U << _VCPU_SSHOTTMR_future)
153
154/*
155 * Register a memory location in the guest address space for the
156 * vcpu_info structure. This allows the guest to place the vcpu_info
157 * structure in a convenient place, such as in a per-cpu data area.
158 * The pointer need not be page aligned, but the structure must not
159 * cross a page boundary.
160 */
161#define VCPUOP_register_vcpu_info 10 /* arg == struct vcpu_info */
162struct vcpu_register_vcpu_info {
163 uint32_t mfn; /* mfn of page to place vcpu_info */
164 uint32_t offset; /* offset within page */
165};
166
167#endif /* __XEN_PUBLIC_VCPU_H__ */
diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h
new file mode 100644
index 000000000000..453235e923f0
--- /dev/null
+++ b/include/xen/interface/version.h
@@ -0,0 +1,60 @@
1/******************************************************************************
2 * version.h
3 *
4 * Xen version, type, and compile information.
5 *
6 * Copyright (c) 2005, Nguyen Anh Quynh <aquynh@gmail.com>
7 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
8 */
9
10#ifndef __XEN_PUBLIC_VERSION_H__
11#define __XEN_PUBLIC_VERSION_H__
12
13/* NB. All ops return zero on success, except XENVER_version. */
14
15/* arg == NULL; returns major:minor (16:16). */
16#define XENVER_version 0
17
18/* arg == xen_extraversion_t. */
19#define XENVER_extraversion 1
20struct xen_extraversion {
21 char extraversion[16];
22};
23#define XEN_EXTRAVERSION_LEN (sizeof(struct xen_extraversion))
24
25/* arg == xen_compile_info_t. */
26#define XENVER_compile_info 2
27struct xen_compile_info {
28 char compiler[64];
29 char compile_by[16];
30 char compile_domain[32];
31 char compile_date[32];
32};
33
34#define XENVER_capabilities 3
35struct xen_capabilities_info {
36 char info[1024];
37};
38#define XEN_CAPABILITIES_INFO_LEN (sizeof(struct xen_capabilities_info))
39
40#define XENVER_changeset 4
41struct xen_changeset_info {
42 char info[64];
43};
44#define XEN_CHANGESET_INFO_LEN (sizeof(struct xen_changeset_info))
45
46#define XENVER_platform_parameters 5
47struct xen_platform_parameters {
48 unsigned long virt_start;
49};
50
51#define XENVER_get_features 6
52struct xen_feature_info {
53 unsigned int submap_idx; /* IN: which 32-bit submap to return */
54 uint32_t submap; /* OUT: 32-bit submap */
55};
56
57/* Declares the features reported by XENVER_get_features. */
58#include "features.h"
59
60#endif /* __XEN_PUBLIC_VERSION_H__ */
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
new file mode 100644
index 000000000000..518a5bf79ed3
--- /dev/null
+++ b/include/xen/interface/xen.h
@@ -0,0 +1,447 @@
1/******************************************************************************
2 * xen.h
3 *
4 * Guest OS interface to Xen.
5 *
6 * Copyright (c) 2004, K A Fraser
7 */
8
9#ifndef __XEN_PUBLIC_XEN_H__
10#define __XEN_PUBLIC_XEN_H__
11
12#include <asm/xen/interface.h>
13
14/*
15 * XEN "SYSTEM CALLS" (a.k.a. HYPERCALLS).
16 */
17
18/*
19 * x86_32: EAX = vector; EBX, ECX, EDX, ESI, EDI = args 1, 2, 3, 4, 5.
20 * EAX = return value
21 * (argument registers may be clobbered on return)
22 * x86_64: RAX = vector; RDI, RSI, RDX, R10, R8, R9 = args 1, 2, 3, 4, 5, 6.
23 * RAX = return value
24 * (argument registers not clobbered on return; RCX, R11 are)
25 */
26#define __HYPERVISOR_set_trap_table 0
27#define __HYPERVISOR_mmu_update 1
28#define __HYPERVISOR_set_gdt 2
29#define __HYPERVISOR_stack_switch 3
30#define __HYPERVISOR_set_callbacks 4
31#define __HYPERVISOR_fpu_taskswitch 5
32#define __HYPERVISOR_sched_op 6
33#define __HYPERVISOR_dom0_op 7
34#define __HYPERVISOR_set_debugreg 8
35#define __HYPERVISOR_get_debugreg 9
36#define __HYPERVISOR_update_descriptor 10
37#define __HYPERVISOR_memory_op 12
38#define __HYPERVISOR_multicall 13
39#define __HYPERVISOR_update_va_mapping 14
40#define __HYPERVISOR_set_timer_op 15
41#define __HYPERVISOR_event_channel_op_compat 16
42#define __HYPERVISOR_xen_version 17
43#define __HYPERVISOR_console_io 18
44#define __HYPERVISOR_physdev_op_compat 19
45#define __HYPERVISOR_grant_table_op 20
46#define __HYPERVISOR_vm_assist 21
47#define __HYPERVISOR_update_va_mapping_otherdomain 22
48#define __HYPERVISOR_iret 23 /* x86 only */
49#define __HYPERVISOR_vcpu_op 24
50#define __HYPERVISOR_set_segment_base 25 /* x86/64 only */
51#define __HYPERVISOR_mmuext_op 26
52#define __HYPERVISOR_acm_op 27
53#define __HYPERVISOR_nmi_op 28
54#define __HYPERVISOR_sched_op_new 29
55#define __HYPERVISOR_callback_op 30
56#define __HYPERVISOR_xenoprof_op 31
57#define __HYPERVISOR_event_channel_op 32
58#define __HYPERVISOR_physdev_op 33
59#define __HYPERVISOR_hvm_op 34
60
61/*
62 * VIRTUAL INTERRUPTS
63 *
64 * Virtual interrupts that a guest OS may receive from Xen.
65 */
66#define VIRQ_TIMER 0 /* Timebase update, and/or requested timeout. */
67#define VIRQ_DEBUG 1 /* Request guest to dump debug info. */
68#define VIRQ_CONSOLE 2 /* (DOM0) Bytes received on emergency console. */
69#define VIRQ_DOM_EXC 3 /* (DOM0) Exceptional event for some domain. */
70#define VIRQ_DEBUGGER 6 /* (DOM0) A domain has paused for debugging. */
71#define NR_VIRQS 8
72
73/*
74 * MMU-UPDATE REQUESTS
75 *
76 * HYPERVISOR_mmu_update() accepts a list of (ptr, val) pairs.
77 * A foreigndom (FD) can be specified (or DOMID_SELF for none).
78 * Where the FD has some effect, it is described below.
79 * ptr[1:0] specifies the appropriate MMU_* command.
80 *
81 * ptr[1:0] == MMU_NORMAL_PT_UPDATE:
82 * Updates an entry in a page table. If updating an L1 table, and the new
83 * table entry is valid/present, the mapped frame must belong to the FD, if
84 * an FD has been specified. If attempting to map an I/O page then the
85 * caller assumes the privilege of the FD.
86 * FD == DOMID_IO: Permit /only/ I/O mappings, at the priv level of the caller.
87 * FD == DOMID_XEN: Map restricted areas of Xen's heap space.
88 * ptr[:2] -- Machine address of the page-table entry to modify.
89 * val -- Value to write.
90 *
91 * ptr[1:0] == MMU_MACHPHYS_UPDATE:
92 * Updates an entry in the machine->pseudo-physical mapping table.
93 * ptr[:2] -- Machine address within the frame whose mapping to modify.
94 * The frame must belong to the FD, if one is specified.
95 * val -- Value to write into the mapping entry.
96 */
97#define MMU_NORMAL_PT_UPDATE 0 /* checked '*ptr = val'. ptr is MA. */
98#define MMU_MACHPHYS_UPDATE 1 /* ptr = MA of frame to modify entry for */
99
100/*
101 * MMU EXTENDED OPERATIONS
102 *
103 * HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
104 * A foreigndom (FD) can be specified (or DOMID_SELF for none).
105 * Where the FD has some effect, it is described below.
106 *
107 * cmd: MMUEXT_(UN)PIN_*_TABLE
108 * mfn: Machine frame number to be (un)pinned as a p.t. page.
109 * The frame must belong to the FD, if one is specified.
110 *
111 * cmd: MMUEXT_NEW_BASEPTR
112 * mfn: Machine frame number of new page-table base to install in MMU.
113 *
114 * cmd: MMUEXT_NEW_USER_BASEPTR [x86/64 only]
115 * mfn: Machine frame number of new page-table base to install in MMU
116 * when in user space.
117 *
118 * cmd: MMUEXT_TLB_FLUSH_LOCAL
119 * No additional arguments. Flushes local TLB.
120 *
121 * cmd: MMUEXT_INVLPG_LOCAL
122 * linear_addr: Linear address to be flushed from the local TLB.
123 *
124 * cmd: MMUEXT_TLB_FLUSH_MULTI
125 * vcpumask: Pointer to bitmap of VCPUs to be flushed.
126 *
127 * cmd: MMUEXT_INVLPG_MULTI
128 * linear_addr: Linear address to be flushed.
129 * vcpumask: Pointer to bitmap of VCPUs to be flushed.
130 *
131 * cmd: MMUEXT_TLB_FLUSH_ALL
132 * No additional arguments. Flushes all VCPUs' TLBs.
133 *
134 * cmd: MMUEXT_INVLPG_ALL
135 * linear_addr: Linear address to be flushed from all VCPUs' TLBs.
136 *
137 * cmd: MMUEXT_FLUSH_CACHE
138 * No additional arguments. Writes back and flushes cache contents.
139 *
140 * cmd: MMUEXT_SET_LDT
141 * linear_addr: Linear address of LDT base (NB. must be page-aligned).
142 * nr_ents: Number of entries in LDT.
143 */
144#define MMUEXT_PIN_L1_TABLE 0
145#define MMUEXT_PIN_L2_TABLE 1
146#define MMUEXT_PIN_L3_TABLE 2
147#define MMUEXT_PIN_L4_TABLE 3
148#define MMUEXT_UNPIN_TABLE 4
149#define MMUEXT_NEW_BASEPTR 5
150#define MMUEXT_TLB_FLUSH_LOCAL 6
151#define MMUEXT_INVLPG_LOCAL 7
152#define MMUEXT_TLB_FLUSH_MULTI 8
153#define MMUEXT_INVLPG_MULTI 9
154#define MMUEXT_TLB_FLUSH_ALL 10
155#define MMUEXT_INVLPG_ALL 11
156#define MMUEXT_FLUSH_CACHE 12
157#define MMUEXT_SET_LDT 13
158#define MMUEXT_NEW_USER_BASEPTR 15
159
160#ifndef __ASSEMBLY__
161struct mmuext_op {
162 unsigned int cmd;
163 union {
164 /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */
165 unsigned long mfn;
166 /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
167 unsigned long linear_addr;
168 } arg1;
169 union {
170 /* SET_LDT */
171 unsigned int nr_ents;
172 /* TLB_FLUSH_MULTI, INVLPG_MULTI */
173 void *vcpumask;
174 } arg2;
175};
176DEFINE_GUEST_HANDLE_STRUCT(mmuext_op);
177#endif
178
179/* These are passed as 'flags' to update_va_mapping. They can be ORed. */
180/* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap. */
181/* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer. */
182#define UVMF_NONE (0UL<<0) /* No flushing at all. */
183#define UVMF_TLB_FLUSH (1UL<<0) /* Flush entire TLB(s). */
184#define UVMF_INVLPG (2UL<<0) /* Flush only one entry. */
185#define UVMF_FLUSHTYPE_MASK (3UL<<0)
186#define UVMF_MULTI (0UL<<2) /* Flush subset of TLBs. */
187#define UVMF_LOCAL (0UL<<2) /* Flush local TLB. */
188#define UVMF_ALL (1UL<<2) /* Flush all TLBs. */
189
190/*
191 * Commands to HYPERVISOR_console_io().
192 */
193#define CONSOLEIO_write 0
194#define CONSOLEIO_read 1
195
196/*
197 * Commands to HYPERVISOR_vm_assist().
198 */
199#define VMASST_CMD_enable 0
200#define VMASST_CMD_disable 1
201#define VMASST_TYPE_4gb_segments 0
202#define VMASST_TYPE_4gb_segments_notify 1
203#define VMASST_TYPE_writable_pagetables 2
204#define VMASST_TYPE_pae_extended_cr3 3
205#define MAX_VMASST_TYPE 3
206
207#ifndef __ASSEMBLY__
208
209typedef uint16_t domid_t;
210
211/* Domain ids >= DOMID_FIRST_RESERVED cannot be used for ordinary domains. */
212#define DOMID_FIRST_RESERVED (0x7FF0U)
213
214/* DOMID_SELF is used in certain contexts to refer to oneself. */
215#define DOMID_SELF (0x7FF0U)
216
217/*
218 * DOMID_IO is used to restrict page-table updates to mapping I/O memory.
219 * Although no Foreign Domain need be specified to map I/O pages, DOMID_IO
220 * is useful to ensure that no mappings to the OS's own heap are accidentally
221 * installed. (e.g., in Linux this could cause havoc as reference counts
222 * aren't adjusted on the I/O-mapping code path).
223 * This only makes sense in MMUEXT_SET_FOREIGNDOM, but in that context can
224 * be specified by any calling domain.
225 */
226#define DOMID_IO (0x7FF1U)
227
228/*
229 * DOMID_XEN is used to allow privileged domains to map restricted parts of
230 * Xen's heap space (e.g., the machine_to_phys table).
231 * This only makes sense in MMUEXT_SET_FOREIGNDOM, and is only permitted if
232 * the caller is privileged.
233 */
234#define DOMID_XEN (0x7FF2U)
235
236/*
237 * Send an array of these to HYPERVISOR_mmu_update().
238 * NB. The fields are natural pointer/address size for this architecture.
239 */
240struct mmu_update {
241 uint64_t ptr; /* Machine address of PTE. */
242 uint64_t val; /* New contents of PTE. */
243};
244DEFINE_GUEST_HANDLE_STRUCT(mmu_update);
245
246/*
247 * Send an array of these to HYPERVISOR_multicall().
248 * NB. The fields are natural register size for this architecture.
249 */
250struct multicall_entry {
251 unsigned long op;
252 long result;
253 unsigned long args[6];
254};
255DEFINE_GUEST_HANDLE_STRUCT(multicall_entry);
256
257/*
258 * Event channel endpoints per domain:
259 * 1024 if a long is 32 bits; 4096 if a long is 64 bits.
260 */
261#define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64)
262
263struct vcpu_time_info {
264 /*
265 * Updates to the following values are preceded and followed
266 * by an increment of 'version'. The guest can therefore
267 * detect updates by looking for changes to 'version'. If the
268 * least-significant bit of the version number is set then an
269 * update is in progress and the guest must wait to read a
270 * consistent set of values. The correct way to interact with
271 * the version number is similar to Linux's seqlock: see the
272 * implementations of read_seqbegin/read_seqretry.
273 */
274 uint32_t version;
275 uint32_t pad0;
276 uint64_t tsc_timestamp; /* TSC at last update of time vals. */
277 uint64_t system_time; /* Time, in nanosecs, since boot. */
278 /*
279 * Current system time:
280 * system_time + ((tsc - tsc_timestamp) << tsc_shift) * tsc_to_system_mul
281 * CPU frequency (Hz):
282 * ((10^9 << 32) / tsc_to_system_mul) >> tsc_shift
283 */
284 uint32_t tsc_to_system_mul;
285 int8_t tsc_shift;
286 int8_t pad1[3];
287}; /* 32 bytes */
288
289struct vcpu_info {
290 /*
291 * 'evtchn_upcall_pending' is written non-zero by Xen to indicate
292 * a pending notification for a particular VCPU. It is then cleared
293 * by the guest OS /before/ checking for pending work, thus avoiding
294 * a set-and-check race. Note that the mask is only accessed by Xen
295 * on the CPU that is currently hosting the VCPU. This means that the
296 * pending and mask flags can be updated by the guest without special
297 * synchronisation (i.e., no need for the x86 LOCK prefix).
298 * This may seem suboptimal because if the pending flag is set by
299 * a different CPU then an IPI may be scheduled even when the mask
300 * is set. However, note:
301 * 1. The task of 'interrupt holdoff' is covered by the per-event-
302 * channel mask bits. A 'noisy' event that is continually being
303 * triggered can be masked at source at this very precise
304 * granularity.
305 * 2. The main purpose of the per-VCPU mask is therefore to restrict
306 * reentrant execution: whether for concurrency control, or to
307 * prevent unbounded stack usage. Whatever the purpose, we expect
308 * that the mask will be asserted only for short periods at a time,
309 * and so the likelihood of a 'spurious' IPI is suitably small.
310 * The mask is read before making an event upcall to the guest: a
311 * non-zero mask therefore guarantees that the VCPU will not receive
312 * an upcall activation. The mask is cleared when the VCPU requests
313 * to block: this avoids wakeup-waiting races.
314 */
315 uint8_t evtchn_upcall_pending;
316 uint8_t evtchn_upcall_mask;
317 unsigned long evtchn_pending_sel;
318 struct arch_vcpu_info arch;
319 struct vcpu_time_info time;
320}; /* 64 bytes (x86) */
321
322/*
323 * Xen/kernel shared data -- pointer provided in start_info.
324 * NB. We expect that this struct is smaller than a page.
325 */
326struct shared_info {
327 struct vcpu_info vcpu_info[MAX_VIRT_CPUS];
328
329 /*
330 * A domain can create "event channels" on which it can send and receive
331 * asynchronous event notifications. There are three classes of event that
332 * are delivered by this mechanism:
333 * 1. Bi-directional inter- and intra-domain connections. Domains must
334 * arrange out-of-band to set up a connection (usually by allocating
335 * an unbound 'listener' port and avertising that via a storage service
336 * such as xenstore).
337 * 2. Physical interrupts. A domain with suitable hardware-access
338 * privileges can bind an event-channel port to a physical interrupt
339 * source.
340 * 3. Virtual interrupts ('events'). A domain can bind an event-channel
341 * port to a virtual interrupt source, such as the virtual-timer
342 * device or the emergency console.
343 *
344 * Event channels are addressed by a "port index". Each channel is
345 * associated with two bits of information:
346 * 1. PENDING -- notifies the domain that there is a pending notification
347 * to be processed. This bit is cleared by the guest.
348 * 2. MASK -- if this bit is clear then a 0->1 transition of PENDING
349 * will cause an asynchronous upcall to be scheduled. This bit is only
350 * updated by the guest. It is read-only within Xen. If a channel
351 * becomes pending while the channel is masked then the 'edge' is lost
352 * (i.e., when the channel is unmasked, the guest must manually handle
353 * pending notifications as no upcall will be scheduled by Xen).
354 *
355 * To expedite scanning of pending notifications, any 0->1 pending
356 * transition on an unmasked channel causes a corresponding bit in a
357 * per-vcpu selector word to be set. Each bit in the selector covers a
358 * 'C long' in the PENDING bitfield array.
359 */
360 unsigned long evtchn_pending[sizeof(unsigned long) * 8];
361 unsigned long evtchn_mask[sizeof(unsigned long) * 8];
362
363 /*
364 * Wallclock time: updated only by control software. Guests should base
365 * their gettimeofday() syscall on this wallclock-base value.
366 */
367 uint32_t wc_version; /* Version counter: see vcpu_time_info_t. */
368 uint32_t wc_sec; /* Secs 00:00:00 UTC, Jan 1, 1970. */
369 uint32_t wc_nsec; /* Nsecs 00:00:00 UTC, Jan 1, 1970. */
370
371 struct arch_shared_info arch;
372
373};
374
375/*
376 * Start-of-day memory layout for the initial domain (DOM0):
377 * 1. The domain is started within contiguous virtual-memory region.
378 * 2. The contiguous region begins and ends on an aligned 4MB boundary.
379 * 3. The region start corresponds to the load address of the OS image.
380 * If the load address is not 4MB aligned then the address is rounded down.
381 * 4. This the order of bootstrap elements in the initial virtual region:
382 * a. relocated kernel image
383 * b. initial ram disk [mod_start, mod_len]
384 * c. list of allocated page frames [mfn_list, nr_pages]
385 * d. start_info_t structure [register ESI (x86)]
386 * e. bootstrap page tables [pt_base, CR3 (x86)]
387 * f. bootstrap stack [register ESP (x86)]
388 * 5. Bootstrap elements are packed together, but each is 4kB-aligned.
389 * 6. The initial ram disk may be omitted.
390 * 7. The list of page frames forms a contiguous 'pseudo-physical' memory
391 * layout for the domain. In particular, the bootstrap virtual-memory
392 * region is a 1:1 mapping to the first section of the pseudo-physical map.
393 * 8. All bootstrap elements are mapped read-writable for the guest OS. The
394 * only exception is the bootstrap page table, which is mapped read-only.
395 * 9. There is guaranteed to be at least 512kB padding after the final
396 * bootstrap element. If necessary, the bootstrap virtual region is
397 * extended by an extra 4MB to ensure this.
398 */
399
400#define MAX_GUEST_CMDLINE 1024
401struct start_info {
402 /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME. */
403 char magic[32]; /* "xen-<version>-<platform>". */
404 unsigned long nr_pages; /* Total pages allocated to this domain. */
405 unsigned long shared_info; /* MACHINE address of shared info struct. */
406 uint32_t flags; /* SIF_xxx flags. */
407 unsigned long store_mfn; /* MACHINE page number of shared page. */
408 uint32_t store_evtchn; /* Event channel for store communication. */
409 union {
410 struct {
411 unsigned long mfn; /* MACHINE page number of console page. */
412 uint32_t evtchn; /* Event channel for console page. */
413 } domU;
414 struct {
415 uint32_t info_off; /* Offset of console_info struct. */
416 uint32_t info_size; /* Size of console_info struct from start.*/
417 } dom0;
418 } console;
419 /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME). */
420 unsigned long pt_base; /* VIRTUAL address of page directory. */
421 unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames. */
422 unsigned long mfn_list; /* VIRTUAL address of page-frame list. */
423 unsigned long mod_start; /* VIRTUAL address of pre-loaded module. */
424 unsigned long mod_len; /* Size (bytes) of pre-loaded module. */
425 int8_t cmd_line[MAX_GUEST_CMDLINE];
426};
427
428/* These flags are passed in the 'flags' field of start_info_t. */
429#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
430#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */
431
432typedef uint64_t cpumap_t;
433
434typedef uint8_t xen_domain_handle_t[16];
435
436/* Turn a plain number into a C unsigned long constant. */
437#define __mk_unsigned_long(x) x ## UL
438#define mk_unsigned_long(x) __mk_unsigned_long(x)
439
440#else /* __ASSEMBLY__ */
441
442/* In assembly code we cannot use C numeric constant suffixes. */
443#define mk_unsigned_long(x) x
444
445#endif /* !__ASSEMBLY__ */
446
447#endif /* __XEN_PUBLIC_XEN_H__ */
diff --git a/include/xen/page.h b/include/xen/page.h
new file mode 100644
index 000000000000..1df6c1930578
--- /dev/null
+++ b/include/xen/page.h
@@ -0,0 +1,179 @@
1#ifndef __XEN_PAGE_H
2#define __XEN_PAGE_H
3
4#include <linux/pfn.h>
5
6#include <asm/uaccess.h>
7
8#include <xen/features.h>
9
10#ifdef CONFIG_X86_PAE
11/* Xen machine address */
12typedef struct xmaddr {
13 unsigned long long maddr;
14} xmaddr_t;
15
16/* Xen pseudo-physical address */
17typedef struct xpaddr {
18 unsigned long long paddr;
19} xpaddr_t;
20#else
21/* Xen machine address */
22typedef struct xmaddr {
23 unsigned long maddr;
24} xmaddr_t;
25
26/* Xen pseudo-physical address */
27typedef struct xpaddr {
28 unsigned long paddr;
29} xpaddr_t;
30#endif
31
32#define XMADDR(x) ((xmaddr_t) { .maddr = (x) })
33#define XPADDR(x) ((xpaddr_t) { .paddr = (x) })
34
35/**** MACHINE <-> PHYSICAL CONVERSION MACROS ****/
36#define INVALID_P2M_ENTRY (~0UL)
37#define FOREIGN_FRAME_BIT (1UL<<31)
38#define FOREIGN_FRAME(m) ((m) | FOREIGN_FRAME_BIT)
39
40extern unsigned long *phys_to_machine_mapping;
41
42static inline unsigned long pfn_to_mfn(unsigned long pfn)
43{
44 if (xen_feature(XENFEAT_auto_translated_physmap))
45 return pfn;
46
47 return phys_to_machine_mapping[(unsigned int)(pfn)] &
48 ~FOREIGN_FRAME_BIT;
49}
50
51static inline int phys_to_machine_mapping_valid(unsigned long pfn)
52{
53 if (xen_feature(XENFEAT_auto_translated_physmap))
54 return 1;
55
56 return (phys_to_machine_mapping[pfn] != INVALID_P2M_ENTRY);
57}
58
59static inline unsigned long mfn_to_pfn(unsigned long mfn)
60{
61 unsigned long pfn;
62
63 if (xen_feature(XENFEAT_auto_translated_physmap))
64 return mfn;
65
66#if 0
67 if (unlikely((mfn >> machine_to_phys_order) != 0))
68 return max_mapnr;
69#endif
70
71 pfn = 0;
72 /*
73 * The array access can fail (e.g., device space beyond end of RAM).
74 * In such cases it doesn't matter what we return (we return garbage),
75 * but we must handle the fault without crashing!
76 */
77 __get_user(pfn, &machine_to_phys_mapping[mfn]);
78
79 return pfn;
80}
81
82static inline xmaddr_t phys_to_machine(xpaddr_t phys)
83{
84 unsigned offset = phys.paddr & ~PAGE_MASK;
85 return XMADDR(PFN_PHYS((u64)pfn_to_mfn(PFN_DOWN(phys.paddr))) | offset);
86}
87
88static inline xpaddr_t machine_to_phys(xmaddr_t machine)
89{
90 unsigned offset = machine.maddr & ~PAGE_MASK;
91 return XPADDR(PFN_PHYS((u64)mfn_to_pfn(PFN_DOWN(machine.maddr))) | offset);
92}
93
94/*
95 * We detect special mappings in one of two ways:
96 * 1. If the MFN is an I/O page then Xen will set the m2p entry
97 * to be outside our maximum possible pseudophys range.
98 * 2. If the MFN belongs to a different domain then we will certainly
99 * not have MFN in our p2m table. Conversely, if the page is ours,
100 * then we'll have p2m(m2p(MFN))==MFN.
101 * If we detect a special mapping then it doesn't have a 'struct page'.
102 * We force !pfn_valid() by returning an out-of-range pointer.
103 *
104 * NB. These checks require that, for any MFN that is not in our reservation,
105 * there is no PFN such that p2m(PFN) == MFN. Otherwise we can get confused if
106 * we are foreign-mapping the MFN, and the other domain as m2p(MFN) == PFN.
107 * Yikes! Various places must poke in INVALID_P2M_ENTRY for safety.
108 *
109 * NB2. When deliberately mapping foreign pages into the p2m table, you *must*
110 * use FOREIGN_FRAME(). This will cause pte_pfn() to choke on it, as we
111 * require. In all the cases we care about, the FOREIGN_FRAME bit is
112 * masked (e.g., pfn_to_mfn()) so behaviour there is correct.
113 */
114static inline unsigned long mfn_to_local_pfn(unsigned long mfn)
115{
116 extern unsigned long max_mapnr;
117 unsigned long pfn = mfn_to_pfn(mfn);
118 if ((pfn < max_mapnr)
119 && !xen_feature(XENFEAT_auto_translated_physmap)
120 && (phys_to_machine_mapping[pfn] != mfn))
121 return max_mapnr; /* force !pfn_valid() */
122 return pfn;
123}
124
125static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn)
126{
127 if (xen_feature(XENFEAT_auto_translated_physmap)) {
128 BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
129 return;
130 }
131 phys_to_machine_mapping[pfn] = mfn;
132}
133
134/* VIRT <-> MACHINE conversion */
135#define virt_to_machine(v) (phys_to_machine(XPADDR(__pa(v))))
136#define virt_to_mfn(v) (pfn_to_mfn(PFN_DOWN(__pa(v))))
137#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
138
139#ifdef CONFIG_X86_PAE
140#define pte_mfn(_pte) (((_pte).pte_low >> PAGE_SHIFT) | \
141 (((_pte).pte_high & 0xfff) << (32-PAGE_SHIFT)))
142
143static inline pte_t mfn_pte(unsigned long page_nr, pgprot_t pgprot)
144{
145 pte_t pte;
146
147 pte.pte_high = (page_nr >> (32 - PAGE_SHIFT)) |
148 (pgprot_val(pgprot) >> 32);
149 pte.pte_high &= (__supported_pte_mask >> 32);
150 pte.pte_low = ((page_nr << PAGE_SHIFT) | pgprot_val(pgprot));
151 pte.pte_low &= __supported_pte_mask;
152
153 return pte;
154}
155
156static inline unsigned long long pte_val_ma(pte_t x)
157{
158 return ((unsigned long long)x.pte_high << 32) | x.pte_low;
159}
160#define pmd_val_ma(v) ((v).pmd)
161#define pud_val_ma(v) ((v).pgd.pgd)
162#define __pte_ma(x) ((pte_t) { .pte_low = (x), .pte_high = (x)>>32 } )
163#define __pmd_ma(x) ((pmd_t) { (x) } )
164#else /* !X86_PAE */
165#define pte_mfn(_pte) ((_pte).pte_low >> PAGE_SHIFT)
166#define mfn_pte(pfn, prot) __pte_ma(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
167#define pte_val_ma(x) ((x).pte_low)
168#define pmd_val_ma(v) ((v).pud.pgd.pgd)
169#define __pte_ma(x) ((pte_t) { (x) } )
170#endif /* CONFIG_X86_PAE */
171
172#define pgd_val_ma(x) ((x).pgd)
173
174
175xmaddr_t arbitrary_virt_to_machine(unsigned long address);
176void make_lowmem_page_readonly(void *vaddr);
177void make_lowmem_page_readwrite(void *vaddr);
178
179#endif /* __XEN_PAGE_H */
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
new file mode 100644
index 000000000000..6f7c290651ae
--- /dev/null
+++ b/include/xen/xenbus.h
@@ -0,0 +1,234 @@
1/******************************************************************************
2 * xenbus.h
3 *
4 * Talks to Xen Store to figure out what devices we have.
5 *
6 * Copyright (C) 2005 Rusty Russell, IBM Corporation
7 * Copyright (C) 2005 XenSource Ltd.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation; or, when distributed
12 * separately from the Linux kernel or incorporated into other
13 * software packages, subject to the following license:
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * of this source file (the "Software"), to deal in the Software without
17 * restriction, including without limitation the rights to use, copy, modify,
18 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
19 * and to permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be included in
23 * all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
31 * IN THE SOFTWARE.
32 */
33
34#ifndef _XEN_XENBUS_H
35#define _XEN_XENBUS_H
36
37#include <linux/device.h>
38#include <linux/notifier.h>
39#include <linux/mutex.h>
40#include <linux/completion.h>
41#include <linux/init.h>
42#include <xen/interface/xen.h>
43#include <xen/interface/grant_table.h>
44#include <xen/interface/io/xenbus.h>
45#include <xen/interface/io/xs_wire.h>
46
47/* Register callback to watch this node. */
48struct xenbus_watch
49{
50 struct list_head list;
51
52 /* Path being watched. */
53 const char *node;
54
55 /* Callback (executed in a process context with no locks held). */
56 void (*callback)(struct xenbus_watch *,
57 const char **vec, unsigned int len);
58};
59
60
61/* A xenbus device. */
62struct xenbus_device {
63 const char *devicetype;
64 const char *nodename;
65 const char *otherend;
66 int otherend_id;
67 struct xenbus_watch otherend_watch;
68 struct device dev;
69 enum xenbus_state state;
70 struct completion down;
71};
72
73static inline struct xenbus_device *to_xenbus_device(struct device *dev)
74{
75 return container_of(dev, struct xenbus_device, dev);
76}
77
78struct xenbus_device_id
79{
80 /* .../device/<device_type>/<identifier> */
81 char devicetype[32]; /* General class of device. */
82};
83
84/* A xenbus driver. */
85struct xenbus_driver {
86 char *name;
87 struct module *owner;
88 const struct xenbus_device_id *ids;
89 int (*probe)(struct xenbus_device *dev,
90 const struct xenbus_device_id *id);
91 void (*otherend_changed)(struct xenbus_device *dev,
92 enum xenbus_state backend_state);
93 int (*remove)(struct xenbus_device *dev);
94 int (*suspend)(struct xenbus_device *dev);
95 int (*suspend_cancel)(struct xenbus_device *dev);
96 int (*resume)(struct xenbus_device *dev);
97 int (*uevent)(struct xenbus_device *, char **, int, char *, int);
98 struct device_driver driver;
99 int (*read_otherend_details)(struct xenbus_device *dev);
100};
101
102static inline struct xenbus_driver *to_xenbus_driver(struct device_driver *drv)
103{
104 return container_of(drv, struct xenbus_driver, driver);
105}
106
107int __must_check __xenbus_register_frontend(struct xenbus_driver *drv,
108 struct module *owner,
109 const char *mod_name);
110
111static inline int __must_check
112xenbus_register_frontend(struct xenbus_driver *drv)
113{
114 WARN_ON(drv->owner != THIS_MODULE);
115 return __xenbus_register_frontend(drv, THIS_MODULE, KBUILD_MODNAME);
116}
117
118int __must_check __xenbus_register_backend(struct xenbus_driver *drv,
119 struct module *owner,
120 const char *mod_name);
121static inline int __must_check
122xenbus_register_backend(struct xenbus_driver *drv)
123{
124 WARN_ON(drv->owner != THIS_MODULE);
125 return __xenbus_register_backend(drv, THIS_MODULE, KBUILD_MODNAME);
126}
127
128void xenbus_unregister_driver(struct xenbus_driver *drv);
129
130struct xenbus_transaction
131{
132 u32 id;
133};
134
135/* Nil transaction ID. */
136#define XBT_NIL ((struct xenbus_transaction) { 0 })
137
138int __init xenbus_dev_init(void);
139
140char **xenbus_directory(struct xenbus_transaction t,
141 const char *dir, const char *node, unsigned int *num);
142void *xenbus_read(struct xenbus_transaction t,
143 const char *dir, const char *node, unsigned int *len);
144int xenbus_write(struct xenbus_transaction t,
145 const char *dir, const char *node, const char *string);
146int xenbus_mkdir(struct xenbus_transaction t,
147 const char *dir, const char *node);
148int xenbus_exists(struct xenbus_transaction t,
149 const char *dir, const char *node);
150int xenbus_rm(struct xenbus_transaction t, const char *dir, const char *node);
151int xenbus_transaction_start(struct xenbus_transaction *t);
152int xenbus_transaction_end(struct xenbus_transaction t, int abort);
153
154/* Single read and scanf: returns -errno or num scanned if > 0. */
155int xenbus_scanf(struct xenbus_transaction t,
156 const char *dir, const char *node, const char *fmt, ...)
157 __attribute__((format(scanf, 4, 5)));
158
159/* Single printf and write: returns -errno or 0. */
160int xenbus_printf(struct xenbus_transaction t,
161 const char *dir, const char *node, const char *fmt, ...)
162 __attribute__((format(printf, 4, 5)));
163
164/* Generic read function: NULL-terminated triples of name,
165 * sprintf-style type string, and pointer. Returns 0 or errno.*/
166int xenbus_gather(struct xenbus_transaction t, const char *dir, ...);
167
168/* notifer routines for when the xenstore comes up */
169extern int xenstored_ready;
170int register_xenstore_notifier(struct notifier_block *nb);
171void unregister_xenstore_notifier(struct notifier_block *nb);
172
173int register_xenbus_watch(struct xenbus_watch *watch);
174void unregister_xenbus_watch(struct xenbus_watch *watch);
175void xs_suspend(void);
176void xs_resume(void);
177void xs_suspend_cancel(void);
178
179/* Used by xenbus_dev to borrow kernel's store connection. */
180void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg);
181
182struct work_struct;
183
184/* Prepare for domain suspend: then resume or cancel the suspend. */
185void xenbus_suspend(void);
186void xenbus_resume(void);
187void xenbus_probe(struct work_struct *);
188void xenbus_suspend_cancel(void);
189
190#define XENBUS_IS_ERR_READ(str) ({ \
191 if (!IS_ERR(str) && strlen(str) == 0) { \
192 kfree(str); \
193 str = ERR_PTR(-ERANGE); \
194 } \
195 IS_ERR(str); \
196})
197
198#define XENBUS_EXIST_ERR(err) ((err) == -ENOENT || (err) == -ERANGE)
199
200int xenbus_watch_path(struct xenbus_device *dev, const char *path,
201 struct xenbus_watch *watch,
202 void (*callback)(struct xenbus_watch *,
203 const char **, unsigned int));
204int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch,
205 void (*callback)(struct xenbus_watch *,
206 const char **, unsigned int),
207 const char *pathfmt, ...)
208 __attribute__ ((format (printf, 4, 5)));
209
210int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state);
211int xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn);
212int xenbus_map_ring_valloc(struct xenbus_device *dev,
213 int gnt_ref, void **vaddr);
214int xenbus_map_ring(struct xenbus_device *dev, int gnt_ref,
215 grant_handle_t *handle, void *vaddr);
216
217int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr);
218int xenbus_unmap_ring(struct xenbus_device *dev,
219 grant_handle_t handle, void *vaddr);
220
221int xenbus_alloc_evtchn(struct xenbus_device *dev, int *port);
222int xenbus_bind_evtchn(struct xenbus_device *dev, int remote_port, int *port);
223int xenbus_free_evtchn(struct xenbus_device *dev, int port);
224
225enum xenbus_state xenbus_read_driver_state(const char *path);
226
227void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...);
228void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...);
229
230const char *xenbus_strstate(enum xenbus_state state);
231int xenbus_dev_is_online(struct xenbus_device *dev);
232int xenbus_frontend_closed(struct xenbus_device *dev);
233
234#endif /* _XEN_XENBUS_H */